diff --git a/escheduler-ui/dist/index.html b/escheduler-ui/dist/index.html index 3062095c91..1b6645b246 100644 --- a/escheduler-ui/dist/index.html +++ b/escheduler-ui/dist/index.html @@ -4,4 +4,4 @@ d="M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23" fill="#0097e0"> Loading ... \ No newline at end of file +fill="#7f8b95"> Loading ... \ No newline at end of file diff --git a/escheduler-ui/dist/js/0.738a8a5.js b/escheduler-ui/dist/js/0.8ca091c.js similarity index 96% rename from escheduler-ui/dist/js/0.738a8a5.js rename to escheduler-ui/dist/js/0.8ca091c.js index 99d53e9242..f0413262a5 100644 --- a/escheduler-ui/dist/js/0.738a8a5.js +++ b/escheduler-ui/dist/js/0.8ca091c.js @@ -1,2 +1,2 @@ -webpackJsonp([0],Array(605).concat([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(1021),i=n.n(a);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);var o=n(1104);var s=function(t){n(1100)},l=n(27)(i.a,o.a,!1,s,null,null);e.default=l.exports},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";e.__esModule=!0,e.default={name:"spin",data:function(){return{}},props:{isSpin:{type:Boolean,default:!0},isLeft:{type:Boolean,default:!0}}}},function(t,e,n){"use strict";e.__esModule=!0,e.default={name:"list-construction",data:function(){return{}},props:{title:String}}},function(t,e,n){"use strict";e.__esModule=!0;var a,i=n(659),r=(a=i)&&a.__esModule?a:{default:a};e.default={name:"secondary-menu",data:function(){return{menuList:(0,r.default)(this.type),index:0,id:this.$route.params.id,isTogHide:!1}},props:{type:String,className:String},watch:{isTogHide:function(t){var e=$(".main-layout-box");t?e.addClass("toggle"):e.removeClass("toggle")}},methods:{_toggleSubMenu:function(t){t.isOpen=!t.isOpen},_toggleMenu:function(){this.isTogHide=!this.isTogHide}},mounted:function(){}}},function(t,e,n){"use strict";e.__esModule=!0;var a=r(n(91)),i=r(n(222));function r(t){return t&&t.__esModule?t:{default:t}}e.default={data:function(){return{router:i.default,store:a.default,isDetails:!1}},created:function(){this.isDetails=this.store.state.dag.isDetails},methods:{},computed:{_isDetails:function(){return this.isDetails?"icon-disabled":""}}}},function(t,e,n){"use strict";e.__esModule=!0,e.default={name:"no-data",props:{msg:String}}},,function(t,e,n){var a;a=function(){"use strict";var t="millisecond",e="second",n="minute",a="hour",i="day",r="week",o="month",s="quarter",l="year",c=/^(\d{4})-?(\d{1,2})-?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d{1,3})?$/,u=/\[([^\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f=function(t,e,n){var a=String(t);return!a||a.length>=e?t:""+Array(e+1-a.length).join(n)+t},d={s:f,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),a=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+f(a,2,"0")+":"+f(i,2,"0")},m:function(t,e){var n=12*(e.year()-t.year())+(e.month()-t.month()),a=t.clone().add(n,o),i=e-a<0,r=t.clone().add(n+(i?-1:1),o);return Number(-(n+(e-a)/(i?a-r:r-a))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(c){return{M:o,y:l,w:r,d:i,h:a,m:n,s:e,ms:t,Q:s}[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},v="en",h={};h[v]=p;var m=function(t){return t instanceof x},y=function(t,e,n){var a;if(!t)return null;if("string"==typeof t)h[t]&&(a=t),e&&(h[t]=e,a=t);else{var i=t.name;h[i]=t,a=i}return n||(v=a),a},_=function(t,e,n){if(m(t))return t.clone();var a=e?"string"==typeof e?{format:e,pl:n}:e:{};return a.date=t,new x(a)},b=d;b.l=y,b.i=m,b.w=function(t,e){return _(t,{locale:e.$L,utc:e.$u})};var x=function(){function f(t){this.$L=this.$L||y(t.locale,null,!0)||v,this.parse(t)}var d=f.prototype;return d.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var a=e.match(c);if(a)return n?new Date(Date.UTC(a[1],a[2]-1,a[3]||1,a[4]||0,a[5]||0,a[6]||0,a[7]||0)):new Date(a[1],a[2]-1,a[3]||1,a[4]||0,a[5]||0,a[6]||0,a[7]||0)}return new Date(e)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return b},d.isValid=function(){return!("Invalid Date"===this.$d.toString())},d.isSame=function(t,e){var n=_(t);return this.startOf(e)<=n&&n<=this.endOf(e)},d.isAfter=function(t,e){return _(t).secondary-menu-model{left:-200px}.secondary-menu-model{position:fixed;left:0;top:0;width:200px;background:#41444c;height:100%;padding-top:80px}.secondary-menu-model .toogle-box{position:absolute;right:-1px;top:calc(50% - 50px)}.secondary-menu-model .toogle-box .tog-close{width:12px;height:102px;background:url("+a(n(657))+") no-repeat;display:inline-block}.secondary-menu-model .toogle-box .tog-open{width:12px;height:102px;background:url("+a(n(658))+") no-repeat;display:inline-block;position:absolute;right:-12px;top:0}.secondary-menu-model .leven-1 .name a{height:40px;line-height:40px;display:block;position:relative;padding-left:12px}.secondary-menu-model .leven-1 .name a>.icon{vertical-align:middle;font-size:15px;width:20px;text-align:center;color:#fff}.secondary-menu-model .leven-1 .name a>span{vertical-align:middle;padding-left:2px;font-size:14px;color:#fff}.secondary-menu-model .leven-1 .name a>.angle{position:absolute;right:12px;top:14px}.secondary-menu-model .leven-1 ul li{height:36px;line-height:36px;cursor:pointer;padding-left:39px;color:#fff}.secondary-menu-model .leven-1 ul li a{font-size:14px}.secondary-menu-model .leven-1 ul li.active{border-right:2px solid #2d8cf0;background:#2c2f39}.secondary-menu-model .leven-1 ul li.active span{font-weight:700;color:#2d8cf0}.secondary-menu-model .leven-1 .router-link-active,.secondary-menu-model .leven-1>.router-link-exact-active{background:#f0f6fb}.secondary-menu-model .leven-1 .router-link-active .name,.secondary-menu-model .leven-1>.router-link-exact-active .name{border-right:2px solid #2d8cf0;background:#2b2e38}.secondary-menu-model .leven-1 .router-link-active .name a span,.secondary-menu-model .leven-1>.router-link-exact-active .name a span{color:#2d8cf0;font-weight:700}.secondary-menu-model .leven-1 .router-link-active .name a .fa,.secondary-menu-model .leven-1>.router-link-exact-active .name a .fa{color:#2d8cf0}",""])},function(t,e,n){t.exports=n.p+"images/close.png?02806e641df25c1b4dbff4cb0af3984d"},function(t,e,n){t.exports=n.p+"images/open.png?97ec0726c7acab8a2a48282d68cea631"},function(t,e,n){"use strict";e.__esModule=!0;var a,i=n(36),r=(a=i)&&a.__esModule?a:{default:a};var o={projects:[{name:""+r.default.$t("项目首页"),id:1,path:"projects-index",isOpen:!0,icon:"fa-home",children:[]},{name:""+r.default.$t("工作流"),id:2,path:"",isOpen:!0,icon:"fa-gear",children:[{name:""+r.default.$t("工作流定义"),path:"definition",id:1},{name:""+r.default.$t("工作流实例"),path:"instance",id:2},{name:""+r.default.$t("任务实例"),path:"task-instance-list",id:3}]}],security:[{name:""+r.default.$t("租户管理"),id:1,path:"tenement-manage",isOpen:!0,icon:"fa-users",children:[]},{name:""+r.default.$t("用户管理"),id:1,path:"users-manage",isOpen:!0,icon:"fa-user-circle",children:[]},{name:""+r.default.$t("告警组管理"),id:1,path:"warning-groups-manage",isOpen:!0,icon:"fa-warning",children:[]},{name:""+r.default.$t("队列管理"),id:1,path:"queue-manage",isOpen:!0,icon:"fa-warning",children:[]},{name:""+r.default.$t("服务管理"),id:1,path:"",isOpen:!0,icon:"fa-server",children:[{name:"master",path:"servers-master",id:1},{name:"worker",path:"servers-worker",id:2}]}],resource:[{name:""+r.default.$t("文件管理"),id:1,path:"file",isOpen:!0,icon:"fa-files-o",children:[],disabled:!1},{name:""+r.default.$t("UDF管理"),id:1,path:"",isOpen:!0,icon:"fa-file-text",disabled:!1,children:[{name:""+r.default.$t("资源管理"),path:"resource-udf-resource",id:1},{name:""+r.default.$t("函数管理"),path:"resource-udf-function",id:2}]}],user:[{name:""+r.default.$t("用户信息"),id:1,path:"account",isOpen:!0,icon:"fa-user",children:[],disabled:!1},{name:""+r.default.$t("修改密码"),id:1,path:"password",isOpen:!0,icon:"fa-key",children:[],disabled:!1}]};e.default=function(t){return o[t]}},function(t,e,n){"use strict";var a={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"secondary-menu-model",class:t.className},[n("div",{staticClass:"toogle-box"},[t.isTogHide?t._e():n("a",{staticClass:"tog-close",attrs:{href:"javascript:"},on:{click:t._toggleMenu}}),t._v(" "),t.isTogHide?n("a",{staticClass:"tog-open",attrs:{href:"javascript:"},on:{click:t._toggleMenu}}):t._e()]),t._v(" "),t._l(t.menuList,function(e,a){return n("div",{staticClass:"leven-1"},[e.path?[n("router-link",{attrs:{to:{name:e.path}}},[n("div",{staticClass:"name",on:{click:function(n){return t._toggleSubMenu(e)}}},[n("a",{attrs:{href:"javascript:"}},[n("i",{staticClass:"fa icon",class:e.icon}),t._v(" "),n("span",[t._v(t._s(e.name))]),t._v(" "),e.children.length?n("i",{staticClass:"fa angle",class:e.isOpen?"fa-angle-down":"fa-angle-right"}):t._e()])])])]:t._e(),t._v(" "),e.path?t._e():[n("div",{staticClass:"name",on:{click:function(n){return t._toggleSubMenu(e)}}},[n("a",{attrs:{href:"javascript:"}},[n("i",{staticClass:"fa icon",class:e.icon}),t._v(" "),n("span",[t._v(t._s(e.name))]),t._v(" "),e.children.length?n("i",{staticClass:"fa angle",class:e.isOpen?"fa-angle-down":"fa-angle-right"}):t._e()])])],t._v(" "),e.isOpen&&e.children.length?n("ul",t._l(e.children,function(e,a){return n("router-link",{attrs:{to:{name:e.path},tag:"li","active-class":"active"}},[n("span",[t._v(t._s(e.name))])])}),1):t._e()],2)})],2)},staticRenderFns:[]};e.a=a},function(t,e,n){"use strict";e.__esModule=!0,e.formatDate=void 0;var a,i=n(645),r=(a=i)&&a.__esModule?a:{default:a};e.formatDate=function(t,e){return e=e||"YYYY-MM-DD HH:mm:ss",(0,r.default)(t).format(e)}},function(t,e,n){"use strict";e.__esModule=!0;var a,i=n(28),r=(a=i)&&a.__esModule?a:{default:a};e.default={name:"conditions",data:function(){return{searchVal:""}},props:{operation:Array},methods:{_ckQuery:function(){this.$emit("on-conditions",{searchVal:r.default.trim(this.searchVal)})}},computed:{isShow:function(){return this.$slots["search-group"]}},components:{}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(643),i=n.n(a);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);var o=n(666);var s=function(t){n(664)},l=n(27)(i.a,o.a,!1,s,null,null);e.default=l.exports},function(t,e,n){var a=n(665);"string"==typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);n(35)("3cb222d8",a,!0,{})},function(t,e,n){(t.exports=n(34)(!1)).push([t.i,".no-data-model{position:relative;width:100%;height:calc(100vh - 200px)}.no-data-model .no-data-box{width:210px;height:210px;position:absolute;left:50%;top:50%;margin-left:-105px;margin-top:-105px;text-align:center}.no-data-model .no-data-box .text{padding-top:10px;color:#666}",""])},function(t,e,n){"use strict";var a={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"no-data-model"},[e("div",{staticClass:"no-data-box"},[this._m(0),this._v(" "),e("div",{staticClass:"text"},[this._v(this._s(this.msg||this.$t("查询无数据")))])])])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"img"},[e("img",{attrs:{src:n(667),alt:""}})])}]};e.a=a},function(t,e,n){t.exports=n.p+"images/errorTip.png?a7b20f0ca8727f22f405c2a34d1363a0"},function(t,e,n){"use strict";var a,i=n(29),r=(a=i)&&a.__esModule?a:{default:a},o=n(661);r.default.filter("formatDate",o.formatDate)},function(t,e,n){var a=n(745),i="object"==typeof self&&self&&self.Object===Object&&self,r=a||i||Function("return this")();t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(662),i=n.n(a);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);var o=n(671),s=n(27)(i.a,o.a,!1,null,null,null);e.default=s.exports},function(t,e,n){"use strict";var a={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"conditions-model"},[n("div",{staticClass:"left"},[t._t("button-group")],2),t._v(" "),n("div",{staticClass:"right"},[n("div",{staticClass:"from-box"},[t.isShow?t._t("search-group"):t._e(),t._v(" "),t.isShow?t._e():[n("div",{staticClass:"list"},[n("x-button",{attrs:{type:"ghost",size:"small",icon:"fa fa-search"},on:{click:t._ckQuery}})],1),t._v(" "),n("div",{staticClass:"list"},[n("x-input",{staticStyle:{width:"180px"},attrs:{size:"small",placeholder:t.$t("请输入关键词"),type:"text"},on:{"on-enterkey":t._ckQuery},model:{value:t.searchVal,callback:function(e){t.searchVal=e},expression:"searchVal"}})],1)]],2)])])},staticRenderFns:[]};e.a=a},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){var a=n(827),i=n(830);t.exports=function(t,e){var n=i(t,e);return a(n)?n:void 0}},,,function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){var a=n(679),i=n(815),r=n(816),o="[object Null]",s="[object Undefined]",l=a?a.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?s:o:l&&l in Object(t)?i(t):r(t)}},function(t,e,n){var a=n(669).Symbol;t.exports=a},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var a=n(767),i=n(716);t.exports=function(t,e,n,r){var o=!n;n||(n={});for(var s=-1,l=e.length;++s'+e.unicode+""},_onChange:function(t){this.value=t.value,this.$emit("priorityEvent",t.value)}},created:function(){},mounted:function(){},components:{}}},function(t,e,n){var a=n(744),i=n(819),r=n(690);t.exports=function(t){return r(t)?a(t):i(t)}},function(t,e,n){(function(t){var a=n(669),i=n(817),r="object"==typeof e&&e&&!e.nodeType&&e,o=r&&"object"==typeof t&&t&&!t.nodeType&&t,s=o&&o.exports===r?a.Buffer:void 0,l=(s?s.isBuffer:void 0)||i;t.exports=l}).call(e,n(92)(t))},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,n){var a=n(691),i=n(747);t.exports=function(t){return null!=t&&i(t.length)&&!a(t)}},function(t,e,n){var a=n(678),i=n(673),r="[object AsyncFunction]",o="[object Function]",s="[object GeneratorFunction]",l="[object Proxy]";t.exports=function(t){if(!i(t))return!1;var e=a(t);return e==o||e==s||e==r||e==l}},function(t,e,n){var a=n(674)(Object,"create");t.exports=a},function(t,e,n){var a=n(840),i=n(841),r=n(842),o=n(843),s=n(844);function l(t){var e=-1,n=null==t?0:t.length;for(this.clear();++espan{font-weight:400}.priority-model .ans-option-listp>span>.iconfont{padding-right:2px}.priority-model .ans-input .input-element{cursor:pointer;height:32px;line-height:30px;position:relative;font-weight:400}.priority-model .ans-input .input-element .ans-icon-arrow-down{position:absolute;right:8px;top:0;font-size:12px;color:#888;cursor:pointer}.priority-model .ans-input .input-element span{vertical-align:middle}.priority-model .ans-input .input-element span.label-p{margin-top:-4px;display:inline-block}",""])},function(t,e,n){"use strict";var a={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"priority-model"},[n("x-select",{staticStyle:{width:"130px"},attrs:{disabled:t.isDetails},on:{"on-change":t._onChange},scopedSlots:t._u([{key:"trigger",fn:function(e){var a=e.selectedModel;return n("div",{staticClass:"ans-input"},[n("div",{staticClass:"input-element",class:t.isDetails?"disabled":""},[n("span",{domProps:{innerHTML:t._s(t._rtUnicode(a?a.label:"MEDIUM"))}}),t._v(" "),n("span",{staticClass:"label-p"},[t._v(t._s(a?a.label:"MEDIUM"))]),t._v(" "),n("i",{staticClass:"ans-icon-arrow-down"})])])}}]),model:{value:t.value,callback:function(e){t.value=e},expression:"value"}},[t._v(" "),t._l(t.priorityList,function(e){return n("x-option",{key:e.code,attrs:{value:e.code,label:e.code}},[n("li",{staticClass:"ans-option ans-option-listp"},[n("span",{staticClass:"default-option-class"},[n("i",{staticClass:"iconfont",style:{color:e.color},domProps:{innerHTML:t._s(e.unicode)}}),t._v("\n "+t._s(e.code)+"\n ")])])])})],2)],1)},staticRenderFns:[]};e.a=a},function(t,e){t.exports=function(t,e){for(var n=-1,a=null==t?0:t.length,i=Array(a);++n-1&&t%1==0&&t-1&&t%1==0&&t<=n}},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){var a=n(750),i=n(708),r=n(832),o=n(713),s=n(758),l=i(function(t){var e=s(t);return e="function"==typeof e?e:void 0,r(a(t,1,o,!0),void 0,e)});t.exports=l},function(t,e,n){var a=n(707),i=n(821);t.exports=function t(e,n,r,o,s){var l=-1,c=e.length;for(r||(r=i),s||(s=[]);++l0&&r(u)?n>1?t(u,n-1,r,o,s):a(s,u):o||(s[s.length]=u)}return s}},function(t,e){t.exports=function(t){return t}},function(t,e,n){var a=n(674),i=function(){try{var t=a(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=i},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e,n){var a=n(833),i=n(845),r=n(847),o=n(848),s=n(849);function l(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1}},function(t,e){t.exports=function(t,e,n){for(var a=-1,i=null==t?0:t.length;++ad))return!1;var v=u.get(t);if(v&&u.get(e))return v==e;var h=-1,m=!0,y=n&s?new a:void 0;for(u.set(t,e),u.set(e,t);++h=0}t.exports=d,t.exports.multiple=function(){for(var t=arguments.length,e=Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return d({customizeArray:v(t),customizeObject:h(t)})},t.exports.smartStrategy=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return d({customizeArray:function(e,n,a){if(m(a.split(".").slice(-1)[0]))switch(t[a]){case"prepend":return[].concat(f((0,o.default)(n,e,function(e,n){return(0,l.uniteRules)(t,a,e,n,"prepend")})),f(e));case"replace":return n;default:return(0,i.default)(e,n,l.uniteRules.bind(null,t,a))}return v(t)(e,n,a)},customizeObject:h(t)})},t.exports.unique=c.default},function(t,e,n){var a=n(812),i=n(687);t.exports=function(t){return null==t?[]:a(t,i(t))}},function(t,e,n){var a=n(743);t.exports=function(t,e){return a(e,function(e){return t[e]})}},function(t,e){t.exports=function(t,e){for(var n=-1,a=Array(t);++n0){if(++e>=n)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var a=n(709),i=n(755),r=n(756),o=n(711),s=n(856),l=n(712),c=200;t.exports=function(t,e,n){var u=-1,f=i,d=t.length,p=!0,v=[],h=v;if(n)p=!1,f=r;else if(d>=c){var m=e?null:s(t);if(m)return l(m);p=!1,f=o,h=new a}else h=e?[]:v;t:for(;++u-1}},function(t,e,n){var a=n(694);t.exports=function(t,e){var n=this.__data__,i=a(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},function(t,e,n){var a=n(695);t.exports=function(t){var e=a(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,n){var a=n(695);t.exports=function(t){return a(this,t).get(t)}},function(t,e,n){var a=n(695);t.exports=function(t){return a(this,t).has(t)}},function(t,e,n){var a=n(695);t.exports=function(t,e){var n=a(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}},function(t,e){var n="__lodash_hash_undefined__";t.exports=function(t){return this.__data__.set(t,n),this}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var a=n(853),i=n(854),r=n(855);t.exports=function(t,e,n){return e==e?r(t,e,n):a(t,i,n)}},function(t,e){t.exports=function(t,e,n,a){for(var i=t.length,r=n+(a?1:-1);a?r--:++r1?n[r-1]:void 0,s=r>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(r--,o):void 0,s&&i(n[0],n[1],s)&&(o=r<3?void 0:o,r=1),e=Object(e);++a=c&&(d=l,p=!1,e=new a(e));t:for(;++f0&&void 0!==arguments[0]?arguments[0]:{},n=e.customizeArray,s=e.customizeObject,u=e.key;return function e(f,d,p){var v=u?u+"."+p:p;if((0,r.default)(f)&&(0,r.default)(d))return function(){return e(f.apply(void 0,arguments),d.apply(void 0,arguments),p)};if(c(f)&&c(d)){var h=n&&n(f,d,v);return h||[].concat(l(f),l(d))}if((0,i.default)(f)&&(0,i.default)(d)){var m=s&&s(f,d,v);return m||(0,a.default)({},f,d,t({customizeArray:n,customizeObject:s,key:v}))}return(0,i.default)(d)?(0,o.default)(d):c(d)?[].concat(l(d)):d}};var c=Array.isArray},function(t,e,n){var a=n(876),i=1,r=4;t.exports=function(t){return a(t,i|r)}},function(t,e,n){var a=n(715),i=n(877),r=n(767),o=n(878),s=n(879),l=n(760),c=n(763),u=n(880),f=n(882),d=n(770),p=n(883),v=n(697),h=n(887),m=n(888),y=n(764),_=n(677),b=n(688),x=n(892),g=n(673),V=n(894),k=n(687),S=1,w=2,C=4,$="[object Arguments]",M="[object Function]",L="[object GeneratorFunction]",D="[object Object]",j={};j[$]=j["[object Array]"]=j["[object ArrayBuffer]"]=j["[object DataView]"]=j["[object Boolean]"]=j["[object Date]"]=j["[object Float32Array]"]=j["[object Float64Array]"]=j["[object Int8Array]"]=j["[object Int16Array]"]=j["[object Int32Array]"]=j["[object Map]"]=j["[object Number]"]=j[D]=j["[object RegExp]"]=j["[object Set]"]=j["[object String]"]=j["[object Symbol]"]=j["[object Uint8Array]"]=j["[object Uint8ClampedArray]"]=j["[object Uint16Array]"]=j["[object Uint32Array]"]=!0,j["[object Error]"]=j[M]=j["[object WeakMap]"]=!1,t.exports=function t(e,n,E,W,I,P){var O,A=n&S,T=n&w,N=n&C;if(E&&(O=I?E(e,W,I,P):E(e)),void 0!==O)return O;if(!g(e))return e;var R=_(e);if(R){if(O=h(e),!A)return c(e,O)}else{var U=v(e),z=U==M||U==L;if(b(e))return l(e,A);if(U==D||U==$||z&&!I){if(O=T||z?{}:y(e),!A)return T?f(e,s(O,e)):u(e,o(O,e))}else{if(!j[U])return I?e:{};O=m(e,U,A)}}P||(P=new a);var H=P.get(e);if(H)return H;if(P.set(e,O),V(e))return e.forEach(function(a){O.add(t(a,n,E,a,e,P))}),O;if(x(e))return e.forEach(function(a,i){O.set(i,t(a,n,E,i,e,P))}),O;var Y=N?T?p:d:T?keysIn:k,G=R?void 0:Y(e);return i(G||e,function(a,i){G&&(a=e[i=a]),r(O,i,t(a,n,E,i,e,P))}),O}},function(t,e){t.exports=function(t,e){for(var n=-1,a=null==t?0:t.length;++n=0;i-=1)if(d(e,t[i]))return i;return-1}e.uniteRules=function t(e,n,r,o){if(String(o.test)!==String(r.test)||(r.enforce||o.enforce)&&o.enforce!==r.enforce||r.include&&!f(o.include,r.include)||r.exclude&&!f(o.exclude,r.exclude))return!1;if(!(o.test||o.include||o.exclude||(o.loader&&o.loader.split("?")[0])===(r.loader&&r.loader.split("?")[0])))return!1;if((o.include||o.exclude)&&!r.include&&!r.exclude)return!1;if(o.oneOf&&r.oneOf)return o.oneOf=(0,a.default)(o.oneOf,r.oneOf,t.bind(null,{},"oneOf")),!0;if(r.loader){var s=r.options?"options":r.query&&"query";delete o.use,delete o.loaders,delete o.oneOf,o.loader=r.loader,s&&(o[s]=r[s])}else if(r.oneOf)delete o.use,delete o.loaders,delete o.loader,o.oneOf=r.oneOf;else if((o.use||o.loaders||o.loader)&&(r.use||r.loaders)){var l=function(t){return"string"==typeof t?{loader:t}:t},u=function(t){return t.options||t.query?t:t.loader},d=void 0;if(o.loader){var h=o.options?"options":o.query&&"query";d=[{loader:o.loader}],h&&(d[0][h]=o[h]),delete o.loader,h&&delete o[h]}else d=[].concat(o.use||o.loaders).map(l);var m=[].concat(r.use||r.loaders).map(l),y=o.use||r.use?"use":"loaders";switch(e[n+"."+y]){case"prepend":o[y]=[].concat(c((0,i.default)(m,d,p)),c(d)).map(u);break;case"replace":o[y]=r.use||r.loaders;break;default:o[y]=function(t,e){for(var n=[],a=e.length-1,i=t.length-1;i>=0;i-=1){var r=t[i],o=v(e,r,0,a),s=-1!==o;if(s){for(var l=a;l>o;l-=1){var c=e[l],u=-1!==v(t,c,0,i);u||n.unshift(c),a-=1}p(r,e[a]),n.unshift(e[a]),a-=1}else{var f=-1!==v(n,r);f||n.unshift(r)}}for(;a>=0;a-=1){var d=e[a],h=-1!==v(n,d);h||n.unshift(d)}return n}(m,d).map(u)}}return r.include&&(o.include=r.include),r.exclude&&(o.exclude=r.exclude),!0},e.uniteEntries=p},function(t,e,n){var a=n(898);t.exports=function(t,e){return a(t,e)}},function(t,e,n){var a=n(899),i=n(672);t.exports=function t(e,n,r,o,s){return e===n||(null==e||null==n||!i(e)&&!i(n)?e!=e&&n!=n:a(e,n,r,o,t,s))}},function(t,e,n){var a=n(715),i=n(772),r=n(901),o=n(903),s=n(697),l=n(677),c=n(688),u=n(704),f=1,d="[object Arguments]",p="[object Array]",v="[object Object]",h=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,m,y,_){var b=l(t),x=l(e),g=b?p:s(t),V=x?p:s(e),k=(g=g==d?v:g)==v,S=(V=V==d?v:V)==v,w=g==V;if(w&&c(t)){if(!c(e))return!1;b=!0,k=!1}if(w&&!k)return _||(_=new a),b||u(t)?i(t,e,n,m,y,_):r(t,e,g,n,m,y,_);if(!(n&f)){var C=k&&h.call(t,"__wrapped__"),$=S&&h.call(e,"__wrapped__");if(C||$){var M=C?t.value():t,L=$?e.value():e;return _||(_=new a),y(M,L,n,m,_)}}return!!w&&(_||(_=new a),o(t,e,n,m,y,_))}},function(t,e){t.exports=function(t,e){for(var n=-1,a=null==t?0:t.length;++n2&&void 0!==arguments[2]?arguments[2]:function(t){return t};return function(a,i,s){return s===t&&[].concat(o(a),o((0,r.default)(i,a,function(t){return e.indexOf(n(t))>=0})))}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(809),i=n.n(a);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);var o=n(998);var s=function(t){n(994)},l=n(27)(i.a,o.a,!1,s,null,null);e.default=l.exports},function(t,e,n){var a=n(995);"string"==typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);n(35)("731da2de",a,!0,{})},function(t,e,n){(t.exports=n(34)(!1)).push([t.i,".timing-process-model{width:860px;min-height:300px;background:#fff;border-radius:3px;margin-top:-24%}.timing-process-model .crontab-box{margin:-6px}.timing-process-model .from-model{padding-top:0}.timing-process-model .title-box{margin-bottom:18px}.timing-process-model .title-box span{padding-left:30px;font-size:16px;padding-top:29px;display:block}.timing-process-model .list{margin-bottom:14px}.timing-process-model .list>.text{width:140px;float:left;text-align:right;line-height:32px;padding-right:8px}.timing-process-model .list .cont{width:350px;float:left}.timing-process-model .submit{text-align:right;padding-right:30px;padding-top:10px;padding-bottom:30px}.v-crontab-from-model .list-box{padding:0}",""])},function(t,e){},function(t,e,n){"use strict";(function(t){var a,i,r,o,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};"undefined"!=typeof self&&self,o=function(t){return function(t){var e={};function n(a){if(e[a])return e[a].exports;var i=e[a]={i:a,l:!1,exports:{}};return t[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,a){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:a})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=29)}([function(e,n){e.exports=t},function(t,e,n){e.a=function(t,e,n,a,i,r,o,s){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),a&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),o?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=l):i&&(l=s?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(t,e){return l.call(e),u(t,e)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,l):[l]}return{exports:t,options:c}}},function(t,e,n){e.__esModule=!0;var a=n(34),i=n(37);e.default={methods:{$t:function(t,e){return(0,i.template)((0,a.findLocale)(window.localeCrontab).locale[t],e)}}}},function(t,e,n){e.__esModule=!0,e.template=e.isWeek=e.isStr=e.selectList=void 0;var a,i="function"==typeof Symbol&&"symbol"==s(Symbol.iterator)?function(t){return void 0===t?"undefined":s(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":s(t)},r=(a=n(0))&&a.__esModule?a:{default:a},o=function(t,e){var n=e-t+1,a=t-1;return Array.apply(null,{length:n}).map(function(t,e){return++a})},l={60:r.default.map(o(0,59),function(t){return{value:t+"",label:t+""}}),24:r.default.map(o(0,23),function(t){return{value:t+"",label:t+""}}),12:r.default.map(o(0,12),function(t){return{value:t+"",label:t+""}}),year:r.default.map(o(2018,2030),function(t){return{value:t+"",label:t+""}}),week:[{value:1,label:"星期天"},{value:2,label:"星期一"},{value:3,label:"星期二"},{value:4,label:"星期三"},{value:5,label:"星期四"},{value:6,label:"星期五"},{value:7,label:"星期六"}],specificWeek:[{value:"SUN",label:"SUN"},{value:"MON",label:"MON"},{value:"TUE",label:"TUE"},{value:"WED",label:"WED"},{value:"THU",label:"THU"},{value:"FRI",label:"FRI"},{value:"SAT",label:"SAT"}],day:r.default.map(o(1,31),function(t){return{value:t+"",label:t+""}}),lastWeeks:[{value:"1L",label:"星期天"},{value:"2L",label:"星期一"},{value:"3L",label:"星期二"},{value:"4L",label:"星期三"},{value:"5L",label:"星期四"},{value:"6L",label:"星期五"},{value:"7L",label:"星期六"}]},c={}.hasOwnProperty,u=/(%|)\{([0-9a-zA-Z_]+)\}/g;e.selectList=l,e.isStr=function(t,e){var n=void 0;return-1!==t.indexOf(e)&&(n=t.split(e)),n},e.isWeek=function(t){var e=!1,n=t.split(",");return r.default.map(n,function(t){var n;n=t,-1!==r.default.findIndex(l.specificWeek,function(t){return t.value===n})&&(e=!0)}),e},e.template=function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),a=1;athis.max&&(this.value=this.max),this.min>this.value&&(this.value=this.min),this.$emit("on-number",this.value)},onIncrease:function(){this.value=parseInt(this.value)+1,this.$emit("on-number",this.value)},onReduce:function(){this.value=parseInt(this.value)-1,this.$emit("on-number",this.value)}},watch:{},beforeCreate:function(){},created:function(){this.value=this.propsValue?this.propsValue:this.min},beforeMount:function(){},mounted:function(){},beforeUpdate:function(){},updated:function(){},beforeDestroy:function(){},destroyed:function(){},computed:{},components:{}}},function(t,e){},function(t,e){},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(14),i=n.n(a);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);e.default=i.a},function(t,e,n){e.__esModule=!0;var a=s(n(0)),i=s(n(2)),r=n(3),o=s(n(4));function s(t){return t&&t.__esModule?t:{default:t}}e.default={name:"minute",mixins:[i.default],data:function(){return{minuteValue:"*",radioMinute:"everyMinute",selectMinuteList:r.selectList[60],intervalPerformVal:5,intervalStartVal:3,specificMinutesVal:[],cycleStartVal:1,cycleEndVal:1}},props:{minuteVal:String,value:{type:String,default:"*"}},model:{prop:"value",event:"minuteValueEvent"},methods:{onIntervalPerform:function(t){this.intervalPerformVal=t,"intervalMinute"===this.radioMinute&&(this.minuteValue=this.intervalStartVal+"/"+this.intervalPerformVal)},onIntervalStart:function(t){this.intervalStartVal=t,"intervalMinute"===this.radioMinute&&(this.minuteValue=this.intervalStartVal+"/"+this.intervalPerformVal)},onspecificMinutes:function(t){},onCycleStart:function(t){this.cycleStartVal=t,"cycleMinute"===this.radioMinute&&(this.minuteValue=this.cycleStartVal+"-"+this.cycleEndVal)},onCycleEnd:function(t){this.cycleEndVal=t,"cycleMinute"===this.radioMinute&&(this.minuteValue=this.cycleStartVal+"-"+this.cycleEndVal)},everyReset:function(){this.minuteValue="*"},intervalReset:function(){this.minuteValue=this.intervalStartVal+"/"+this.intervalPerformVal},specificReset:function(){this.specificMinutesVal.length?this.minuteValue=this.specificMinutesVal.join(","):this.minuteValue="*"},cycleReset:function(){this.minuteValue=this.cycleStartVal+"-"+this.cycleEndVal},analyticalValue:function(){var t=this;return new Promise(function(e,n){var i=a.default.cloneDeep(t.value),o=(0,r.isStr)(i,"/"),s=(0,r.isStr)(i,","),l=(0,r.isStr)(i,"-");return"*"===i?(t.radioMinute="everyMinute",void(t.minuteValue="*")):1===i.length&&a.default.isInteger(parseInt(i))||2===i.length&&a.default.isInteger(parseInt(i))?(t.radioMinute="specificMinute",void(t.specificMinutesVal=[i])):o?(t.radioMinute="intervalMinute",t.intervalStartVal=parseInt(o[0]),t.intervalPerformVal=parseInt(o[1]),void(t.minuteValue=t.intervalStartVal+"/"+t.intervalPerformVal)):s?(t.radioMinute="specificMinute",void(t.specificMinutesVal=s)):l?(t.radioMinute="cycleMinute",t.cycleStartVal=parseInt(l[0]),t.cycleEndVal=parseInt(l[1]),void(t.minuteValue=t.cycleStartVal+"/"+t.cycleEndVal)):void e()})}},watch:{minuteValue:function(t){this.$emit("minuteValueEvent",t)},radioMinute:function(t){switch(t){case"everyMinute":this.everyReset();break;case"intervalMinute":this.intervalReset();break;case"specificMinute":this.specificReset();break;case"cycleMinute":this.cycleReset()}},specificMinutesVal:function(t){this.minuteValue=t.join(",")}},beforeCreate:function(){},created:function(){this.analyticalValue().then(function(){})},beforeMount:function(){},mounted:function(){},beforeUpdate:function(){},updated:function(){},beforeDestroy:function(){},destroyed:function(){},computed:{},components:{mInputNumber:o.default}}},function(t,e){},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(17),i=n.n(a);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);e.default=i.a},function(t,e,n){e.__esModule=!0;var a=s(n(0)),i=s(n(2)),r=n(3),o=s(n(4));function s(t){return t&&t.__esModule?t:{default:t}}e.default={name:"hour",mixins:[i.default],data:function(){return{hourValue:"*",radioHour:"everyHour",selectHourList:r.selectList[24],intervalPerformVal:5,intervalStartVal:3,specificHoursVal:[],cycleStartVal:1,cycleEndVal:1}},props:{hourVal:String,value:{type:String,default:"*"}},model:{prop:"value",event:"hourValueEvent"},methods:{onIntervalPerform:function(t){this.intervalPerformVal=t,"intervalHour"===this.radioHour&&(this.hourValue=this.intervalStartVal+"/"+this.intervalPerformVal)},onIntervalStart:function(t){this.intervalStartVal=t,"intervalHour"===this.radioHour&&(this.hourValue=this.intervalStartVal+"/"+this.intervalPerformVal)},onspecificHours:function(t){},onCycleStart:function(t){this.cycleStartVal=t,"cycleHour"===this.radioHour&&(this.hourValue=this.cycleStartVal+"-"+this.cycleEndVal)},onCycleEnd:function(t){this.cycleEndVal=t,"cycleHour"===this.radioHour&&(this.hourValue=this.cycleStartVal+"-"+this.cycleEndVal)},everyReset:function(){this.hourValue="*"},intervalReset:function(){this.hourValue=this.intervalStartVal+"/"+this.intervalPerformVal},specificReset:function(){this.specificHoursVal.length?this.hourValue=this.specificHoursVal.join(","):this.hourValue="*"},cycleReset:function(){this.hourValue=this.cycleStartVal+"-"+this.cycleEndVal},analyticalValue:function(){var t=this;return new Promise(function(e,n){var i=a.default.cloneDeep(t.value),o=(0,r.isStr)(i,"/"),s=(0,r.isStr)(i,","),l=(0,r.isStr)(i,"-");return"*"===i?(t.radioHour="everyHour",void(t.hourValue="*")):1===i.length&&a.default.isInteger(parseInt(i))||2===i.length&&a.default.isInteger(parseInt(i))?(t.radioHour="specificHour",void(t.specificHoursVal=[i])):o?(t.radioHour="intervalHour",t.intervalStartVal=parseInt(o[0]),t.intervalPerformVal=parseInt(o[1]),void(t.hourValue=t.intervalStartVal+"/"+t.intervalPerformVal)):s?(t.radioHour="specificHour",void(t.specificHoursVal=s)):l?(t.radioHour="cycleHour",t.cycleStartVal=parseInt(l[0]),t.cycleEndVal=parseInt(l[1]),void(t.hourValue=t.cycleStartVal+"/"+t.cycleEndVal)):void e()})}},watch:{hourValue:function(t){this.$emit("hourValueEvent",t)},radioHour:function(t){switch(t){case"everyHour":this.everyReset();break;case"intervalHour":this.intervalReset();break;case"specificHour":this.specificReset();break;case"cycleHour":this.cycleReset()}},specificHoursVal:function(t){this.hourValue=t.join(",")}},beforeCreate:function(){},created:function(){this.analyticalValue().then(function(){})},beforeMount:function(){},mounted:function(){},beforeUpdate:function(){},updated:function(){},beforeDestroy:function(){},destroyed:function(){},computed:{},components:{mInputNumber:o.default}}},function(t,e){},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(20),i=n.n(a);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);e.default=i.a},function(t,e,n){e.__esModule=!0;var a=s(n(0)),i=s(n(2)),r=n(3),o=s(n(4));function s(t){return t&&t.__esModule?t:{default:t}}e.default={name:"day",mixins:[i.default],data:function(){var t=this;return{radioDay:"everyDay",dayValue:"*",weekValue:"?",everyDayVal:"*",WkintervalWeekPerformVal:2,WkintervalWeekStartVal:2,selectWeekList:a.default.map(a.default.cloneDeep(r.selectList.week),function(e){return{value:e.value,label:""+t.$t(e.label)}}),intervalDayPerformVal:1,intervalDayStartVal:1,WkspecificWeekVal:[],selectSpecificWeekList:r.selectList.specificWeek,WkspecificDayVal:[],selectSpecificDayList:r.selectList.day,monthLastDaysVal:"L",monthLastWorkingDays:"LW",monthLastWeeksVal:"1L",monthLastWeeksList:a.default.map(a.default.cloneDeep(r.selectList.lastWeeks),function(e){return{value:e.value,label:""+t.$t(e.label)}}),monthTailBeforeVal:1,recentlyWorkingDaysMonthVal:1,WkmonthNumWeeksDayVal:1,WkmonthNumWeeksWeekVal:1,WkmonthNumWeeksWeekList:a.default.map(a.default.cloneDeep(r.selectList.week),function(e){return{value:e.value,label:""+t.$t(e.label)}})}},props:{dayVal:String,weekVal:String},methods:{onWkintervalWeekPerform:function(t){this.WkintervalWeekPerformVal=t,"WkintervalWeek"===this.radioDay&&(this.dayValue="?",this.weekValue=this.WkintervalWeekStartVal+"/"+this.WkintervalWeekPerformVal)},onIntervalDayPerform:function(t){this.intervalDayPerformVal=t,"intervalDay"===this.radioDay&&(this.dayValue=this.intervalDayStartVal+"/"+this.intervalDayPerformVal)},onIntervalDayStart:function(t){this.intervalDayStartVal=t,"intervalDay"===this.radioDay&&(this.dayValue=this.intervalDayStartVal+"/"+this.intervalDayPerformVal)},onMonthTailBefore:function(t){this.monthTailBeforeVal=t,"monthTailBefore"===this.radioDay&&(this.dayValue="L-"+this.monthTailBeforeVal)},onRecentlyWorkingDaysMonth:function(t){this.recentlyWorkingDaysMonthVal=t,"recentlyWorkingDaysMonth"===this.radioDay&&(this.dayValue=this.recentlyWorkingDaysMonthVal+"W")},onWkmonthNumWeeksDay:function(t){this.WkmonthNumWeeksDayVal=t,this.weekValue=this.WkmonthNumWeeksWeekVal+"#"+this.WkmonthNumWeeksDayVal},everyDayReset:function(){this.dayValue=a.default.cloneDeep(this.everyDayVal)},WkintervalWeekReset:function(){this.weekValue=this.WkintervalWeekStartVal+"/"+this.WkintervalWeekPerformVal},intervalDayReset:function(){this.dayValue=this.intervalDayStartVal+"/"+this.intervalDayPerformVal},WkspecificWeekReset:function(){this.weekValue=this.WkspecificWeekVal.length?this.WkspecificWeekVal.join(","):"*"},specificDayReset:function(){this.dayValue=this.WkspecificDayVal.length?this.WkspecificDayVal.join(","):"*"},monthLastDaysReset:function(){this.dayValue=a.default.cloneDeep(this.monthLastDaysVal)},monthLastWorkingDaysReset:function(){this.dayValue=a.default.cloneDeep(this.monthLastWorkingDays)},monthLastWeeksReset:function(){this.dayValue=a.default.cloneDeep(this.monthLastWeeksVal)},monthTailBeforeReset:function(){this.dayValue="L-"+this.monthTailBeforeVal},recentlyWorkingDaysMonthReset:function(){this.dayValue=this.recentlyWorkingDaysMonthVal+"W"},WkmonthNumReset:function(){this.weekValue=this.WkmonthNumWeeksWeekVal+"#"+this.WkmonthNumWeeksDayVal}},watch:{dayValue:function(t){this.$emit("on-day-value",t)},weekValue:function(t){this.$emit("on-week-value",t)},radioDay:function(t){switch(t){case"everyDay":this.weekValue="?",this.everyDayReset();break;case"WkintervalWeek":this.dayValue="?",this.WkintervalWeekReset();break;case"intervalDay":this.weekValue="?",this.intervalDayReset();break;case"WkspecificWeek":this.dayValue="?",this.WkspecificWeekReset();break;case"specificDay":this.weekValue="?",this.specificDayReset();break;case"monthLastDays":this.weekValue="?",this.monthLastDaysReset();break;case"monthLastWorkingDays":this.weekValue="?",this.monthLastWorkingDaysReset();break;case"monthLastWeeks":this.weekValue="?",this.monthLastWeeksReset();break;case"monthTailBefore":this.weekValue="?",this.monthTailBeforeReset();break;case"recentlyWorkingDaysMonth":this.weekValue="?",this.recentlyWorkingDaysMonthReset();break;case"WkmonthNumWeeks":this.dayValue="?",this.WkmonthNumReset()}},WkintervalWeekStartVal:function(t){"WkintervalWeek"===this.radioDay&&(this.dayValue="?",this.weekValue=t+"/"+this.WkintervalWeekPerformVal)},WkspecificWeekVal:function(t){"WkspecificWeek"===this.radioDay&&(this.dayValue="?",this.weekValue=t.join(","))},WkspecificDayVal:function(t){"specificDay"===this.radioDay&&(this.weekValue="?",this.dayValue=t.join(","))},monthLastWeeksVal:function(t){"monthLastWeeks"===this.radioDay&&(this.weekValue="?",this.dayValue=t)},WkmonthNumWeeksWeekVal:function(t){"WkmonthNumWeeks"===this.radioDay&&(this.dayValue="?",this.weekValue=t+"#"+this.WkmonthNumWeeksDayVal)}},beforeCreate:function(){},created:function(){var t,e=this,n=a.default.cloneDeep(this.dayVal),i=a.default.cloneDeep(this.weekVal),o=-1!==i.indexOf("/"),s=-1!==i.indexOf("#");"*"!==n||"?"!==i?o||s||(0,r.isWeek)(i)?(this.dayValue="?",(0,r.isStr)(i,"/")?(t=(0,r.isStr)(i,"/"),e.WkintervalWeekStartVal=parseInt(t[0]),e.WkintervalWeekPerformVal=parseInt(t[1]),e.dayValue="?",e.weekValue=e.WkintervalWeekPerformVal+"/"+e.WkintervalWeekStartVal,e.radioDay="WkintervalWeek"):(0,r.isStr)(i,"#")?function(){var t=(0,r.isStr)(i,"#");e.WkmonthNumWeeksWeekVal=parseInt(t[0]),e.WkmonthNumWeeksDayVal=parseInt(t[1]),e.radioDay="WkmonthNumWeeks"}():(0,r.isWeek)(i)&&(e.WkspecificWeekVal=i.split(","),e.radioDay="WkspecificWeek")):(this.weekValue="?","*"===n||((0,r.isStr)(n,"/")?function(){var t=(0,r.isStr)(n,"/");e.intervalDayStartVal=parseInt(t[0]),e.intervalDayPerformVal=parseInt(t[1]),e.radioDay="intervalDay"}():"L"===n?e.radioDay="monthLastDays":"LW"===n?e.radioDay="monthLastWorkingDays":"L"===n.charAt(n.length-1)?(e.monthLastWeeksVal=n,e.radioDay="monthLastWeeks"):(0,r.isStr)(n,"-")?function(){var t=(0,r.isStr)(n,"-");e.monthTailBeforeVal=parseInt(t[1]),e.radioDay="monthTailBefore"}():"W"===n.charAt(n.length-1)?(e.recentlyWorkingDaysMonthVal=parseInt(n.slice(0,n.length-1)),e.radioDay="recentlyWorkingDaysMonth"):(e.WkspecificDayVal=n.split(","),e.radioDay="specificDay"))):this.radioDay="everyDay"},beforeMount:function(){},mounted:function(){},beforeUpdate:function(){},updated:function(){},beforeDestroy:function(){},destroyed:function(){},computed:{},components:{mInputNumber:o.default}}},function(t,e){},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(23),i=n.n(a);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);e.default=i.a},function(t,e,n){e.__esModule=!0;var a=s(n(0)),i=s(n(2)),r=n(3),o=s(n(4));function s(t){return t&&t.__esModule?t:{default:t}}e.default={name:"month",mixins:[i.default],data:function(){return{monthValue:"*",radioMonth:"everyMonth",selectMonthList:r.selectList[12],intervalPerformVal:5,intervalStartVal:3,specificMonthVal:[],cycleStartVal:1,cycleEndVal:1}},props:{monthVal:String,value:{type:String,default:"*"}},model:{prop:"value",event:"monthValueEvent"},methods:{onIntervalPerform:function(t){this.intervalPerformVal=t,"intervalMonth"===this.radioMonth&&(this.monthValue=this.intervalStartVal+"/"+this.intervalPerformVal)},onIntervalStart:function(t){this.intervalStartVal=t,"intervalMonth"===this.radioMonth&&(this.monthValue=this.intervalStartVal+"/"+this.intervalPerformVal)},onspecificlMonths:function(t){},onCycleStart:function(t){this.cycleStartVal=t,"cycleMonth"===this.radioMonth&&(this.monthValue=this.cycleStartVal+"-"+this.cycleEndVal)},onCycleEnd:function(t){this.cycleEndVal=t,"cycleMonth"===this.radioMonth&&(this.monthValue=this.cycleStartVal+"-"+this.cycleEndVal)},everyReset:function(){this.monthValue="*"},intervalReset:function(){this.monthValue=this.intervalStartVal+"/"+this.intervalPerformVal},specificReset:function(){this.specificMonthVal.length?this.monthValue=this.specificMonthVal.join(","):this.monthValue="*"},cycleReset:function(){this.monthValue=this.cycleStartVal+"-"+this.cycleEndVal},analyticalValue:function(){var t=this;return new Promise(function(e,n){var i=a.default.cloneDeep(t.value),o=(0,r.isStr)(i,"/"),s=(0,r.isStr)(i,","),l=(0,r.isStr)(i,"-");return"*"===i?(t.radioMonth="everyMonth",void(t.monthValue="*")):1===i.length&&a.default.isInteger(parseInt(i))||2===i.length&&a.default.isInteger(parseInt(i))?(t.radioMonth="specificlMonth",void(t.specificMonthVal=[i])):o?(t.radioMonth="intervalMonth",t.intervalStartVal=parseInt(o[0]),t.intervalPerformVal=parseInt(o[1]),void(t.monthValue=t.intervalStartVal+"/"+t.intervalPerformVal)):s?(t.radioMonth="specificlMonth",void(t.specificMonthVal=s)):l?(t.radioMonth="cycleMonth",t.cycleStartVal=parseInt(l[0]),t.cycleEndVal=parseInt(l[1]),void(t.monthValue=t.cycleStartVal+"/"+t.cycleEndVal)):void e()})}},watch:{monthValue:function(t){this.$emit("monthValueEvent",t)},radioMonth:function(t){switch(t){case"everyMonth":this.everyReset();break;case"intervalMonth":this.intervalReset();break;case"specificlMonth":this.specificReset();break;case"cycleMonth":this.cycleReset()}},specificMonthVal:function(t){this.monthValue=t.join(",")}},beforeCreate:function(){},created:function(){this.analyticalValue().then(function(){})},beforeMount:function(){},mounted:function(){},beforeUpdate:function(){},updated:function(){},beforeDestroy:function(){},destroyed:function(){},computed:{},components:{mInputNumber:o.default}}},function(t,e){},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(26),i=n.n(a);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);e.default=i.a},function(t,e,n){e.__esModule=!0;var a=s(n(0)),i=s(n(2)),r=n(3),o=s(n(4));function s(t){return t&&t.__esModule?t:{default:t}}e.default={name:"year",mixins:[i.default],data:function(){return{yearValue:"*",radioYear:"everyYear",selectYearList:r.selectList.year,intervalPerformVal:1,intervalStartVal:2019,specificYearVal:[],cycleStartVal:2019,cycleEndVal:2019}},props:{yearVal:String,value:{type:String,default:"*"}},model:{prop:"value",event:"yearValueEvent"},methods:{onIntervalPerform:function(t){this.intervalPerformVal=t,"intervalYear"===this.radioYear&&(this.yearValue=this.intervalStartVal+"/"+this.intervalPerformVal)},onIntervalStart:function(t){this.intervalStartVal=t,"intervalYear"===this.radioYear&&(this.yearValue=this.intervalStartVal+"/"+this.intervalPerformVal)},onspecificYears:function(t){},onCycleStart:function(t){this.cycleStartVal=t,"cycleYear"===this.radioYear&&(this.yearValue=this.cycleStartVal+"-"+this.cycleEndVal)},onCycleEnd:function(t){this.cycleEndVal=t,"cycleYear"===this.radioYear&&(this.yearValue=this.cycleStartVal+"-"+this.cycleEndVal)},everyReset:function(){this.yearValue="*"},intervalReset:function(){this.yearValue=this.intervalStartVal+"/"+this.intervalPerformVal},specificReset:function(){this.specificYearVal.length?this.yearValue=this.specificYearVal.join(","):this.yearValue="*"},cycleReset:function(){this.yearValue=this.cycleStartVal+"-"+this.cycleEndVal},analyticalValue:function(){var t=this;return new Promise(function(e,n){var i=a.default.cloneDeep(t.value),o=(0,r.isStr)(i,"/"),s=(0,r.isStr)(i,","),l=(0,r.isStr)(i,"-");return"*"===i?(t.radioYear="everyYear",void(t.yearValue="*")):4===i.length&&a.default.isInteger(parseInt(i))?(t.radioYear="specificYear",void(t.specificYearVal=[i])):o?(t.radioYear="intervalYear",t.intervalStartVal=parseInt(o[0]),t.intervalPerformVal=parseInt(o[1]),void(t.yearValue=t.intervalStartVal+"/"+t.intervalPerformVal)):s?(t.radioYear="specificYear",void(t.specificYearVal=s)):l?(t.radioYear="cycleYear",t.cycleStartVal=parseInt(l[0]),t.cycleEndVal=parseInt(l[1]),void(t.yearValue=t.cycleStartVal+"/"+t.cycleEndVal)):void e()})}},watch:{yearValue:function(t){this.$emit("yearValueEvent",t)},radioYear:function(t){switch(t){case"everyYear":this.everyReset();break;case"intervalYear":this.intervalReset();break;case"specificYear":this.specificReset();break;case"cycleYear":this.cycleReset()}},specificYearVal:function(t){this.yearValue=t.join(",")}},beforeCreate:function(){},created:function(){this.analyticalValue().then(function(){})},beforeMount:function(){},mounted:function(){},beforeUpdate:function(){},updated:function(){},beforeDestroy:function(){},destroyed:function(){},computed:{},components:{mInputNumber:o.default}}},function(t,e){},function(t,e){},function(t,e,n){t.exports=n(30)},function(t,e,n){e.__esModule=!0,e.vCrontab=void 0;var a,i=(a=n(31))&&a.__esModule?a:{default:a};n(66),e.vCrontab=i.default},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(32),i=n(5);for(var r in i)"default"!==r&&function(t){n.d(e,t,function(){return i[t]})}(r);n(65);var o=n(1),s=Object(o.a)(i.default,a.a,a.b,!1,null,null,null);s.options.__file="app.vue",e.default=s.exports},function(t,e,n){var a=n(33);n.d(e,"a",function(){return a.a}),n.d(e,"b",function(){return a.b})},function(t,e,n){n.d(e,"a",function(){return a}),n.d(e,"b",function(){return i});var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"v-crontab"},[n("div",{staticClass:"v-crontab-model"},[n("div",{staticClass:"clearfix v-crontab-tab"},[n("a",{class:"second"===t.tabVal?" active":"",attrs:{href:"javascript:"},on:{click:function(e){t.onTab("second")}}},[n("i",{staticClass:"ans-icon-calendar"}),n("span",[t._v(t._s(t.$t("秒")))])]),t._v(" "),n("a",{class:"minute"===t.tabVal?" active":"",attrs:{href:"javascript:"},on:{click:function(e){t.onTab("minute")}}},[n("i",{staticClass:"ans-icon-calendar"}),n("span",[t._v(t._s(t.$t("分")))])]),t._v(" "),n("a",{class:"hour"===t.tabVal?" active":"",attrs:{href:"javascript:"},on:{click:function(e){t.onTab("hour")}}},[n("i",{staticClass:"ans-icon-calendar"}),n("span",[t._v(t._s(t.$t("时")))])]),t._v(" "),n("a",{class:"day"===t.tabVal?" active":"",attrs:{href:"javascript:"},on:{click:function(e){t.onTab("day")}}},[n("i",{staticClass:"ans-icon-calendar"}),n("span",[t._v(t._s(t.$t("天")))])]),t._v(" "),n("a",{class:"month"===t.tabVal?" active":"",attrs:{href:"javascript:"},on:{click:function(e){t.onTab("month")}}},[n("i",{staticClass:"ans-icon-calendar"}),n("span",[t._v(t._s(t.$t("月")))])]),t._v(" "),n("a",{class:"year"===t.tabVal?" active":"",attrs:{href:"javascript:"},on:{click:function(e){t.onTab("year")}}},[n("i",{staticClass:"ans-icon-calendar"}),n("span",[t._v(t._s(t.$t("年")))])])]),t._v(" "),n("div",{staticClass:"v-crontab-content"},["second"===t.tabVal?[n("m-second",{model:{value:t.secondVal,callback:function(e){t.secondVal=e},expression:"secondVal"}})]:t._e(),t._v(" "),"minute"===t.tabVal?[n("m-minute",{model:{value:t.minuteVal,callback:function(e){t.minuteVal=e},expression:"minuteVal"}})]:t._e(),t._v(" "),"hour"===t.tabVal?[n("m-hour",{model:{value:t.hourVal,callback:function(e){t.hourVal=e},expression:"hourVal"}})]:t._e(),t._v(" "),"day"===t.tabVal?[n("m-day",{attrs:{"day-val":t.dayVal,"week-val":t.weekVal},on:{"on-day-value":t._onDayValue,"on-week-value":t._onWeekValue}})]:t._e(),t._v(" "),"month"===t.tabVal?[n("m-month",{model:{value:t.monthVal,callback:function(e){t.monthVal=e},expression:"monthVal"}})]:t._e(),t._v(" "),"year"===t.tabVal?[n("m-year",{model:{value:t.yearVal,callback:function(e){t.yearVal=e},expression:"yearVal"}})]:t._e()],2)])])},i=[]},function(t,e,n){e.__esModule=!0,e.localeList=s,e.findLocale=function(t){return a.default.find(s(),["code",t])};var a=o(n(0)),i=o(n(35)),r=o(n(36));function o(t){return t&&t.__esModule?t:{default:t}}function s(){return[{code:"zh_CN",name:"中文",locale:i.default},{code:"en_US",name:"English",locale:r.default}]}},function(t,e,n){e.__esModule=!0,e.default={"秒":"秒","分":"分","时":"时","天":"天","月":"月","年":"年","星期一":"星期一","星期二":"星期二","星期三":"星期三","星期四":"星期四","星期五":"星期五","星期六":"星期六","星期天":"星期天","每一秒钟":"每一秒钟","每隔":"每隔","秒执行 从":"秒执行 从","秒开始":"秒开始","具体秒数(可多选)":"具体秒数(可多选)","请选择具体秒数":"请选择具体秒数","周期从":"周期从","到":"到","每一分钟":"每一分钟","分执行 从":"分执行 从","分开始":"分开始","具体分钟数(可多选)":"具体分钟数(可多选)","请选择具体分钟数":"请选择具体分钟数","每一小时":"每一小时","小时执行 从":"小时执行 从","小时开始":"小时开始","具体小时数(可多选)":"具体小时数(可多选)","请选择具体小时数":"请选择具体小时数","每一天":"每一天","周执行 从":"周执行 从","开始":"开始","天执行 从":"天执行 从","天开始":"天开始","具体星期几(可多选)":"具体星期几(可多选)","请选择具体周几":"请选择具体周几","具体天数(可多选)":"具体天数(可多选)","请选择具体天数":"请选择具体天数","在这个月的最后一天":"在这个月的最后一天","在这个月的最后一个工作日":"在这个月的最后一个工作日","在这个月的最后一个":"在这个月的最后一个","在本月底前":"在本月底前","最近的工作日(周一至周五)至本月":"最近的工作日(周一至周五)至本月","在这个月的第":"在这个月的第","每一月":"每一月","月执行 从":"月执行 从","月开始":"月开始","具体月数(可多选)":"具体月数(可多选)","请选择具体月数":"请选择具体月数","每一年":"每一年","年执行 从":"年执行 从","年开始":"年开始","具体年数(可多选)":"具体年数(可多选)","请选择具体年数":"请选择具体年数","小时":"小时","日":"日"}},function(t,e,n){e.__esModule=!0,e.default={"秒":"second","分":"minute","时":"hour","天":"day","月":"month","年":"year","星期一":"Monday","星期二":"Tuesday","星期三":"Wednesday","星期四":"Thursday","星期五":"Friday","星期六":"Saturday","星期天":"Sunday","每一秒钟":"Every second","每隔":"Every","秒执行 从":"second carried out","秒开始":"Start","具体秒数(可多选)":"Specific second(multiple)","请选择具体秒数":"Please enter a specific second","周期从":"Cycle from","到":"to","每一分钟":"Every minute","分执行 从":"minute carried out","分开始":"Start","具体分钟数(可多选)":"Specific minute(multiple)","请选择具体分钟数":"Please enter a specific minute","每一小时":"Every hour","小时执行 从":"hour carried out","小时开始":"Start","具体小时数(可多选)":"Specific hour(multiple)","请选择具体小时数":"Please enter a hour","每一天":"Every day","周执行 从":"week carried out","开始":"Start","天执行 从":"day carried out","天开始":"Start","具体星期几(可多选)":"Specific day of the week(multiple)","请选择具体周几":"Please enter a week","具体天数(可多选)":"Specific days(multiple)","请选择具体天数":"Please enter a days","在这个月的最后一天":"On the last day of the month","在这个月的最后一个工作日":"On the last working day of the month","在这个月的最后一个":"At the last of this month","在本月底前":"Before the end of this month","最近的工作日(周一至周五)至本月":"The most recent business day (Monday to Friday) to this month","在这个月的第":"In this months","每一月":"Every month","月执行 从":"month carried out","月开始":"Start","具体月数(可多选)":"Specific months(multiple)","请选择具体月数":"Please enter a months","每一年":"Every year","年执行 从":"year carried out","年开始":"Start","具体年数(可多选)":"Specific year(multiple)","请选择具体年数":"Please enter a year","小时":"hour","日":"day"}},function(t,e,n){e.__esModule=!0;var a="function"==typeof Symbol&&"symbol"==s(Symbol.iterator)?function(t){return void 0===t?"undefined":s(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":s(t)},i={}.hasOwnProperty,r=/(%|)\{([0-9a-zA-Z_]+)\}/g;e.template=function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),o=1;ot.max-1},on:{click:function(e){t.onIncrease()}}},[n("span",{staticClass:"bt-text"},[t._v("+")])])],1)},i=[]},function(t,e,n){var a=n(11);n.n(a).a},function(t,e,n){var a=n(12);n.n(a).a},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(46),i=n(13);for(var r in i)"default"!==r&&function(t){n.d(e,t,function(){return i[t]})}(r);n(48);var o=n(1),s=Object(o.a)(i.default,a.a,a.b,!1,null,null,null);s.options.__file="minute.vue",e.default=s.exports},function(t,e,n){var a=n(47);n.d(e,"a",function(){return a.a}),n.d(e,"b",function(){return a.b})},function(t,e,n){n.d(e,"a",function(){return a}),n.d(e,"b",function(){return i});var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"minute-model"},[n("div",{staticClass:"v-crontab-from-model"},[n("x-radio-group",{attrs:{vertical:""},model:{value:t.radioMinute,callback:function(e){t.radioMinute=e},expression:"radioMinute"}},[n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"everyMinute"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每一分钟")))])])],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"intervalMinute"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每隔")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:59,"props-value":parseInt(t.intervalPerformVal)},on:{"on-number":t.onIntervalPerform}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("分执行 从")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:59,"props-value":parseInt(t.intervalStartVal)},on:{"on-number":t.onIntervalStart}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("分开始")))])],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"specificMinute"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("具体分钟数(可多选)")))]),t._v(" "),n("x-select",{attrs:{multiple:"",placeholder:t.$t("请选择具体分钟数")},on:{"on-change":t.onspecificMinutes},model:{value:t.specificMinutesVal,callback:function(e){t.specificMinutesVal=e},expression:"specificMinutesVal"}},t._l(t.selectMinuteList,function(t){return n("x-option",{key:t.value,attrs:{value:t.value,label:t.label}})}))],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"cycleMinute"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("周期从")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:59,"props-value":parseInt(t.cycleStartVal)},on:{"on-number":t.onCycleStart}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("到")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:59,"props-value":parseInt(t.cycleEndVal)},on:{"on-number":t.onCycleEnd}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("分")))])],1)],1)])],1)])},i=[]},function(t,e,n){var a=n(15);n.n(a).a},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(50),i=n(16);for(var r in i)"default"!==r&&function(t){n.d(e,t,function(){return i[t]})}(r);n(52);var o=n(1),s=Object(o.a)(i.default,a.a,a.b,!1,null,null,null);s.options.__file="hour.vue",e.default=s.exports},function(t,e,n){var a=n(51);n.d(e,"a",function(){return a.a}),n.d(e,"b",function(){return a.b})},function(t,e,n){n.d(e,"a",function(){return a}),n.d(e,"b",function(){return i});var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"hour-model"},[n("div",{staticClass:"v-crontab-from-model"},[n("x-radio-group",{attrs:{vertical:""},model:{value:t.radioHour,callback:function(e){t.radioHour=e},expression:"radioHour"}},[n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"everyHour"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每一小时")))])])],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"intervalHour"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每隔")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:23,"props-value":parseInt(t.intervalPerformVal)},on:{"on-number":t.onIntervalPerform}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("小时执行 从")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:23,"props-value":parseInt(t.intervalStartVal)},on:{"on-number":t.onIntervalStart}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("小时开始")))])],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"specificHour"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("具体小时数(可多选)")))]),t._v(" "),n("x-select",{attrs:{multiple:"",placeholder:t.$t("请选择具体小时数")},on:{"on-change":t.onspecificHours},model:{value:t.specificHoursVal,callback:function(e){t.specificHoursVal=e},expression:"specificHoursVal"}},t._l(t.selectHourList,function(t){return n("x-option",{key:t.value,attrs:{value:t.value,label:t.label}})}))],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"cycleHour"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("周期从")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:23,"props-value":parseInt(t.cycleStartVal)},on:{"on-number":t.onCycleStart}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("到")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:23,"props-value":parseInt(t.cycleEndVal)},on:{"on-number":t.onCycleEnd}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("小时")))])],1)],1)])],1)])},i=[]},function(t,e,n){var a=n(18);n.n(a).a},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(54),i=n(19);for(var r in i)"default"!==r&&function(t){n.d(e,t,function(){return i[t]})}(r);n(56);var o=n(1),s=Object(o.a)(i.default,a.a,a.b,!1,null,null,null);s.options.__file="day.vue",e.default=s.exports},function(t,e,n){var a=n(55);n.d(e,"a",function(){return a.a}),n.d(e,"b",function(){return a.b})},function(t,e,n){n.d(e,"a",function(){return a}),n.d(e,"b",function(){return i});var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"day-model"},[n("div",{staticClass:"v-crontab-from-model"},[n("x-radio-group",{attrs:{vertical:""},model:{value:t.radioDay,callback:function(e){t.radioDay=e},expression:"radioDay"}},[n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"everyDay"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每一天")))])])],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"WkintervalWeek"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每隔")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:7,"props-value":parseInt(t.WkintervalWeekPerformVal)},on:{"on-number":t.onWkintervalWeekPerform}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("天执行 从")))]),t._v(" "),n("x-select",{staticStyle:{width:"200px"},attrs:{placeholder:t.$t("请选择具体小时数")},model:{value:t.WkintervalWeekStartVal,callback:function(e){t.WkintervalWeekStartVal=e},expression:"WkintervalWeekStartVal"}},t._l(t.selectWeekList,function(t){return n("x-option",{key:t.value,attrs:{value:t.value,label:t.label}})})),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("开始")))])],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"intervalDay"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每隔")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:31,"props-value":parseInt(t.intervalDayPerformVal)},on:{"on-number":t.onIntervalDayPerform}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("天执行 从")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:31,"props-value":parseInt(t.intervalDayStartVal)},on:{"on-number":t.onIntervalDayStart}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("天开始")))])],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"WkspecificWeek"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("具体星期几(可多选)")))]),t._v(" "),n("x-select",{attrs:{multiple:"",placeholder:t.$t("请选择具体周几")},model:{value:t.WkspecificWeekVal,callback:function(e){t.WkspecificWeekVal=e},expression:"WkspecificWeekVal"}},t._l(t.selectSpecificWeekList,function(t){return n("x-option",{key:t.value,attrs:{value:t.value,label:t.label}})}))],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"specificDay"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("具体天数(可多选)")))]),t._v(" "),n("x-select",{attrs:{multiple:"",placeholder:t.$t("请选择具体天数")},model:{value:t.WkspecificDayVal,callback:function(e){t.WkspecificDayVal=e},expression:"WkspecificDayVal"}},t._l(t.selectSpecificDayList,function(t){return n("x-option",{key:t.value,attrs:{value:t.value,label:t.label}})}))],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"monthLastDays"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("在这个月的最后一天")))])])],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"monthLastWorkingDays"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("在这个月的最后一个工作日")))])])],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"monthLastWeeks"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("在这个月的最后一个")))]),t._v(" "),n("x-select",{attrs:{placeholder:t.$t("请选择具体周几")},model:{value:t.monthLastWeeksVal,callback:function(e){t.monthLastWeeksVal=e},expression:"monthLastWeeksVal"}},t._l(t.monthLastWeeksList,function(t){return n("x-option",{key:t.value,attrs:{value:t.value,label:t.label}})}))],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"monthTailBefore"}},[n("m-input-number",{attrs:{min:0,max:31,"props-value":parseInt(t.monthTailBeforeVal)},on:{"on-number":t.onMonthTailBefore}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("在本月底前")))])],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"recentlyWorkingDaysMonth"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("最近的工作日(周一至周五)至本月")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:31,"props-value":parseInt(t.recentlyWorkingDaysMonthVal)},on:{"on-number":t.onRecentlyWorkingDaysMonth}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("日")))])],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"WkmonthNumWeeks"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("在这个月的第")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:31,"props-value":parseInt(t.WkmonthNumWeeksDayVal)},on:{"on-number":t.onWkmonthNumWeeksDay}}),t._v(" "),n("x-select",{staticStyle:{width:"200px"},attrs:{placeholder:t.$t("请选择具体周几")},model:{value:t.WkmonthNumWeeksWeekVal,callback:function(e){t.WkmonthNumWeeksWeekVal=e},expression:"WkmonthNumWeeksWeekVal"}},t._l(t.WkmonthNumWeeksWeekList,function(t){return n("x-option",{key:t.value,attrs:{value:t.value,label:t.label}})}))],1)],1)])],1)])},i=[]},function(t,e,n){var a=n(21);n.n(a).a},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(58),i=n(22);for(var r in i)"default"!==r&&function(t){n.d(e,t,function(){return i[t]})}(r);n(60);var o=n(1),s=Object(o.a)(i.default,a.a,a.b,!1,null,null,null);s.options.__file="month.vue",e.default=s.exports},function(t,e,n){var a=n(59);n.d(e,"a",function(){return a.a}),n.d(e,"b",function(){return a.b})},function(t,e,n){n.d(e,"a",function(){return a}),n.d(e,"b",function(){return i});var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"month-model"},[n("div",{staticClass:"v-crontab-from-model"},[n("x-radio-group",{attrs:{vertical:""},model:{value:t.radioMonth,callback:function(e){t.radioMonth=e},expression:"radioMonth"}},[n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"everyMonth"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每一月")))])])],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"intervalMonth"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每隔")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:12,"props-value":parseInt(t.intervalPerformVal)},on:{"on-number":t.onIntervalPerform}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("月执行 从")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:12,"props-value":parseInt(t.intervalStartVal)},on:{"on-number":t.onIntervalStart}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("月开始")))])],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"specificlMonth"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("具体月数(可多选)")))]),t._v(" "),n("x-select",{attrs:{multiple:"",placeholder:t.$t("请选择具体月数")},on:{"on-change":t.onspecificlMonths},model:{value:t.specificMonthVal,callback:function(e){t.specificMonthVal=e},expression:"specificMonthVal"}},t._l(t.selectMonthList,function(t){return n("x-option",{key:t.value,attrs:{value:t.value,label:t.label}})}))],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"cycleMonth"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("周期从")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:12,"props-value":parseInt(t.cycleStartVal)},on:{"on-number":t.onCycleStart}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("到")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:12,"props-value":parseInt(t.cycleEndVal)},on:{"on-number":t.onCycleEnd}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("月")))])],1)],1)])],1)])},i=[]},function(t,e,n){var a=n(24);n.n(a).a},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(62),i=n(25);for(var r in i)"default"!==r&&function(t){n.d(e,t,function(){return i[t]})}(r);n(64);var o=n(1),s=Object(o.a)(i.default,a.a,a.b,!1,null,null,null);s.options.__file="year.vue",e.default=s.exports},function(t,e,n){var a=n(63);n.d(e,"a",function(){return a.a}),n.d(e,"b",function(){return a.b})},function(t,e,n){n.d(e,"a",function(){return a}),n.d(e,"b",function(){return i});var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"year-model"},[n("div",{staticClass:"v-crontab-from-model"},[n("x-radio-group",{attrs:{vertical:""},model:{value:t.radioYear,callback:function(e){t.radioYear=e},expression:"radioYear"}},[n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"everyYear"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每一年")))])])],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"intervalYear"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每隔")))]),t._v(" "),n("m-input-number",{attrs:{min:2019,max:2030,"props-value":parseInt(t.intervalPerformVal)},on:{"on-number":t.onIntervalPerform}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("年执行 从")))]),t._v(" "),n("m-input-number",{attrs:{min:2019,max:2030,"props-value":parseInt(t.intervalStartVal)},on:{"on-number":t.onIntervalStart}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("年开始")))])],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"specificYear"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("具体年数(可多选)")))]),t._v(" "),n("x-select",{attrs:{multiple:"",placeholder:t.$t("请选择具体年数")},on:{"on-change":t.onspecificYears},model:{value:t.specificYearVal,callback:function(e){t.specificYearVal=e},expression:"specificYearVal"}},t._l(t.selectYearList,function(t){return n("x-option",{key:t.value,attrs:{value:t.value,label:t.label}})}))],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"cycleYear"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("周期从")))]),t._v(" "),n("m-input-number",{attrs:{min:2019,max:2030,"props-value":parseInt(t.cycleStartVal)},on:{"on-number":t.onCycleStart}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("到")))]),t._v(" "),n("m-input-number",{attrs:{min:2019,max:2030,"props-value":parseInt(t.cycleEndVal)},on:{"on-number":t.onCycleEnd}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("年")))])],1)],1)])],1)])},i=[]},function(t,e,n){var a=n(27);n.n(a).a},function(t,e,n){var a=n(28);n.n(a).a},function(t,e){}])},"object"==s(e)&&"object"==s(t)?t.exports=o(n(28)):(i=[n(28)],void 0===(r="function"==typeof(a=o)?a.apply(e,i):a)||(t.exports=r))}).call(e,n(92)(t))},function(t,e,n){"use strict";var a={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"timing-process-model"},[n("div",{staticClass:"title-box"},[n("span",[t._v(t._s(t.$t("定时前请先设置参数")))])]),t._v(" "),n("div",{staticClass:"clearfix list"},[n("div",{staticClass:"text"},[t._v("\n "+t._s(t.$t("起止时间"))+"\n ")]),t._v(" "),n("div",{staticClass:"cont"},[n("x-datepicker",{staticStyle:{width:"300px"},attrs:{"panel-num":2,placement:"bottom-start",value:t.scheduleTime,type:"daterange",placeholder:t.$t("选择日期区间"),format:"YYYY-MM-DD HH:mm:ss"},on:{"on-change":t._datepicker}})],1)]),t._v(" "),n("div",{staticClass:"clearfix list"},[n("div",{staticClass:"text"},[t._v("\n "+t._s(t.$t("定时"))+"\n ")]),t._v(" "),n("div",{staticClass:"cont"},[[n("x-poptip",{ref:"poptip",attrs:{placement:"bottom-start"}},[n("div",{staticClass:"crontab-box"},[n("v-crontab",{attrs:{locale:t.i18n},model:{value:t.crontab,callback:function(e){t.crontab=e},expression:"crontab"}})],1),t._v(" "),n("template",{slot:"reference"},[n("x-input",{staticStyle:{width:"300px"},attrs:{type:"text",readonly:"",value:t.crontab,autocomplete:"off"}})],1)],2)]],2)]),t._v(" "),n("div",{staticClass:"clearfix list"},[n("div",{staticClass:"text"},[t._v("\n "+t._s(t.$t("失败策略"))+"\n ")]),t._v(" "),n("div",{staticClass:"cont"},[n("x-radio-group",{staticStyle:{"margin-top":"7px"},model:{value:t.failureStrategy,callback:function(e){t.failureStrategy=e},expression:"failureStrategy"}},[n("x-radio",{attrs:{label:"CONTINUE"}},[t._v(t._s(t.$t("继续")))]),t._v(" "),n("x-radio",{attrs:{label:"END"}},[t._v(t._s(t.$t("结束")))])],1)],1)]),t._v(" "),n("div",{staticClass:"clearfix list"},[n("div",{staticClass:"text"},[t._v("\n "+t._s(t.$t("通知策略"))+"\n ")]),t._v(" "),n("div",{staticClass:"cont"},[n("x-select",{staticStyle:{width:"200px"},model:{value:t.warningType,callback:function(e){t.warningType=e},expression:"warningType"}},t._l(t.warningTypeList,function(t){return n("x-option",{key:t.id,attrs:{value:t.id,label:t.code}})}),1)],1)]),t._v(" "),n("div",{staticClass:"clearfix list"},[n("div",{staticClass:"text"},[t._v("\n "+t._s(t.$t("流程优先级"))+"\n ")]),t._v(" "),n("div",{staticClass:"cont"},[n("m-priority",{model:{value:t.processInstancePriority,callback:function(e){t.processInstancePriority=e},expression:"processInstancePriority"}})],1)]),t._v(" "),n("div",{staticClass:"clearfix list"},[n("div",{staticClass:"text"},[t._v("\n "+t._s(t.$t("通知组"))+"\n ")]),t._v(" "),n("div",{staticClass:"cont"},[n("x-select",{staticStyle:{width:"200px"},attrs:{disabled:!t.notifyGroupList.length},scopedSlots:t._u([{key:"trigger",fn:function(e){var a=e.selectedModel;return n("x-input",{staticStyle:{width:"200px"},attrs:{readonly:"",placeholder:t.$t("请选择通知组"),value:a?a.label:""},on:{"on-click-icon":function(e){e.stopPropagation(),t.warningGroupId={}}}},[n("i",{directives:[{name:"show",rawName:"v-show",value:t.warningGroupId.id,expression:"warningGroupId.id"}],staticClass:"fa fa-times-circle",staticStyle:{"font-size":"15px",cursor:"pointer"},attrs:{slot:"suffix"},slot:"suffix"}),t._v(" "),n("i",{directives:[{name:"show",rawName:"v-show",value:!t.warningGroupId.id,expression:"!warningGroupId.id"}],staticClass:"ans-icon-arrow-down",staticStyle:{"font-size":"12px"},attrs:{slot:"suffix"},slot:"suffix"})])}}]),model:{value:t.warningGroupId,callback:function(e){t.warningGroupId=e},expression:"warningGroupId"}},[t._v(" "),t._l(t.notifyGroupList,function(t){return n("x-option",{key:t.id,attrs:{value:t,label:t.code}})})],2)],1)]),t._v(" "),n("div",{staticClass:"clearfix list"},[n("div",{staticClass:"text"},[t._v("\n "+t._s(t.$t("收件人"))+"\n ")]),t._v(" "),n("div",{staticClass:"cont",staticStyle:{width:"680px"}},[n("m-email",{attrs:{"repeat-data":t.receiversCc},model:{value:t.receivers,callback:function(e){t.receivers=e},expression:"receivers"}})],1)]),t._v(" "),n("div",{staticClass:"clearfix list"},[n("div",{staticClass:"text"},[t._v("\n "+t._s(t.$t("抄送人"))+"\n ")]),t._v(" "),n("div",{staticClass:"cont",staticStyle:{width:"680px"}},[n("m-email",{attrs:{"repeat-data":t.receivers},model:{value:t.receiversCc,callback:function(e){t.receiversCc=e},expression:"receiversCc"}})],1)]),t._v(" "),n("div",{staticClass:"submit"},[n("x-button",{attrs:{type:"text"},on:{click:function(e){return t.close()}}},[t._v(" "+t._s(t.$t("取消"))+" ")]),t._v(" "),n("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"primary",shape:"circle",loading:t.spinnerLoading},on:{click:function(e){return t.ok()}}},[t._v(t._s(t.spinnerLoading?"Loading...":t.item.crontab?t.$t("编辑"):t.$t("创建"))+" ")])],1)])},staticRenderFns:[]};e.a=a},,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";e.__esModule=!0;var a=p(n(28)),i=n(123),r=p(n(1102)),o=p(n(646)),s=p(n(226)),l=n(802),c=p(n(663)),u=p(n(670)),f=p(n(654)),d=p(n(650));function p(t){return t&&t.__esModule?t:{default:t}}e.default={name:"definition-list-index",data:function(){return{total:null,processListP:[],isLoading:!0,searchParams:{pageSize:10,pageNo:1,searchVal:""}}},props:{},methods:Object.assign({},(0,i.mapActions)("dag",["getProcessListP"]),{_page:function(t){this.searchParams.pageNo=t,(0,l.setUrlParams)({pageNo:this.searchParams.pageNo}),this._debounceGET()},_onConditions:function(t){this.searchParams.searchVal=t.searchVal,this.searchParams.pageNo=1,(0,l.setUrlParams)({pageNo:this.searchParams.pageNo}),this._debounceGET()},_getProcessListP:function(t){var e=this;this.isLoading=!t,this.getProcessListP({pageSize:this.searchParams.pageSize,pageNo:this.searchParams.pageNo,searchVal:this.searchParams.searchVal,userId:this.$route.query.userId||""}).then(function(t){(0,l.setUrlParams)({pageNo:e.pageNo}),e.processListP=[],e.processListP=t.totalList,e.total=t.total,e.isLoading=!1}).catch(function(t){e.isLoading=!1})},_onUpdate:function(){this._debounceGET("false")},_debounceGET:a.default.debounce(function(t){this._getProcessListP(t)},100,{leading:!1,trailing:!0})}),watch:{$route:function(t){a.default.isEmpty(t.query)?this.searchParams.pageNo=1:this.searchParams.pageNo=t.query.pageNo||1},searchParams:{deep:!0,handler:function(){this._debounceGET()}}},created:function(){s.default.removeItem("subProcessId"),a.default.isEmpty(this.$route.query)||(this.searchParams=a.default.assign(this.searchParams,this.$route.query))},mounted:function(){this._debounceGET()},components:{mList:r.default,mConditions:u.default,mSpin:o.default,mListConstruction:d.default,mSecondaryMenu:f.default,mNoData:c.default}}},function(t,e,n){"use strict";e.__esModule=!0;var a=l(n(28)),i=l(n(798)),r=l(n(993)),o=n(123);n(668);var s=n(225);function l(t){return t&&t.__esModule?t:{default:t}}e.default={name:"definition-list",data:function(){return{list:[]}},props:{processList:Array,pageNo:Number,pageSize:Number},methods:Object.assign({},(0,o.mapActions)("dag",["editProcessState","getStartCheck","getReceiver"]),{_rtPublishStatus:function(t){return a.default.filter(s.publishStatus,function(e){return e.code===t})[0].desc},_treeView:function(t){this.$router.push({path:"/projects/definition/tree/"+t.id})},_start:function(t){var e=this;this.getStartCheck({processDefinitionId:t.id}).then(function(n){var a=e,r=e.$modal.dialog({closable:!1,showMask:!0,escClose:!0,className:"v-modal-custom",transitionName:"opacityp",render:function(e){return e(i.default,{on:{onUpdate:function(){a._onUpdate(),r.remove()},close:function(){r.remove()}},props:{item:t}})}})}).catch(function(t){e.$message.error(t.msg||"")})},_getReceiver:function(t){var e=this;return new Promise(function(n,a){e.getReceiver({processDefinitionId:t}).then(function(t){n({receivers:t.receivers&&t.receivers.split(",")||[],receiversCc:t.receiversCc&&t.receiversCc.split(",")||[]})})})},_timing:function(t){var e=this,n=this;this._getReceiver(t.id).then(function(a){var i=e.$modal.dialog({closable:!1,showMask:!0,escClose:!0,className:"v-modal-custom",transitionName:"opacityp",render:function(e){return e(r.default,{on:{onUpdate:function(){n._onUpdate(),i.remove()},close:function(){i.remove()}},props:{item:t,receiversD:a.receivers,receiversCcD:a.receiversCc}})}})})},_timingManage:function(t){this.$router.push({path:"/projects/definition/list/timing/"+t.id})},_edit:function(t){this.$router.push({path:"/projects/definition/list/"+t.id})},_downline:function(t){this._upProcessState({processId:t.id,releaseState:0})},_poponline:function(t){this._upProcessState({processId:t.id,releaseState:1})},_upProcessState:function(t){var e=this;this.editProcessState(t).then(function(t){e.$message.success(t.msg),$("body").find(".tooltip.fade.top.in").remove(),e._onUpdate()}).catch(function(t){e.$message.error(t.msg||"")})},_onUpdate:function(){this.$emit("on-update")}}),watch:{processList:function(t){var e=this;this.list=[],setTimeout(function(){e.list=t})}},created:function(){},mounted:function(){this.list=this.processList},components:{}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){var a=n(1101);"string"==typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);n(35)("733e1347",a,!0,{})},function(t,e,n){(t.exports=n(34)(!1)).push([t.i,"",""])},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(1022),i=n.n(a);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);var o=n(1103),s=n(27)(i.a,o.a,!1,null,null,null);e.default=s.exports},function(t,e,n){"use strict";var a={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"list-model"},[n("div",{staticClass:"table-box"},[n("table",{staticClass:"fixed"},[n("tr",[n("th",[n("span",[t._v(t._s(t.$t("编号")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("工作流名称")))])]),t._v(" "),n("th",{attrs:{width:"50"}},[n("span",[t._v(t._s(t.$t("状态")))])]),t._v(" "),n("th",{attrs:{width:"140"}},[n("span",[t._v(t._s(t.$t("创建时间")))])]),t._v(" "),n("th",{attrs:{width:"140"}},[n("span",[t._v(t._s(t.$t("更新时间")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("描述")))])]),t._v(" "),n("th",{attrs:{width:"90"}},[n("span",[t._v(t._s(t.$t("定时状态")))])]),t._v(" "),n("th",{attrs:{width:"220"}},[n("span",[t._v(t._s(t.$t("操作")))])])]),t._v(" "),t._l(t.list,function(e,a){return n("tr",{key:e.id},[n("td",[n("span",[t._v(t._s(parseInt(1===t.pageNo?a+1:a+1+t.pageSize*(t.pageNo-1))))])]),t._v(" "),n("td",[n("span",{staticClass:"ellipsis"},[n("router-link",{staticClass:"links",attrs:{to:{path:"/projects/definition/list/"+e.id},tag:"a"}},[t._v("\n "+t._s(e.name)+"\n ")])],1)]),t._v(" "),n("td",[n("span",[t._v(t._s(t._rtPublishStatus(e.releaseState)))])]),t._v(" "),n("td",[e.createTime?n("span",[t._v(t._s(t._f("formatDate")(e.createTime)))]):t._e(),t._v(" "),e.createTime?t._e():n("span",[t._v("-")])]),t._v(" "),n("td",[n("span",[t._v(t._s(t._f("formatDate")(e.updateTime)))])]),t._v(" "),n("td",[n("span",{staticClass:"ellipsis"},[t._v(t._s(e.desc))])]),t._v(" "),n("td",["OFFLINE"===e.scheduleReleaseState?n("span",[t._v(t._s(t.$t("下线")))]):t._e(),t._v(" "),"ONLINE"===e.scheduleReleaseState?n("span",[t._v(t._s(t.$t("上线")))]):t._e(),t._v(" "),e.scheduleReleaseState?t._e():n("span",[t._v("-")])]),t._v(" "),n("td",[n("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"info",shape:"circle",size:"xsmall","data-toggle":"tooltip",title:t.$t("编辑"),disabled:"ONLINE"===e.releaseState,icon:"iconfont icon-bianji"},on:{click:function(n){return t._edit(e)}}}),t._v(" "),n("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"success",shape:"circle",size:"xsmall","data-toggle":"tooltip",title:t.$t("启动"),disabled:"ONLINE"!==e.releaseState,icon:"iconfont icon-qidong"},on:{click:function(n){return t._start(e)}}}),t._v(" "),n("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"info",shape:"circle",size:"xsmall","data-toggle":"tooltip",title:t.$t("定时"),disabled:"ONLINE"!==e.releaseState||null!==e.scheduleReleaseState,icon:"iconfont icon-timer"},on:{click:function(n){return t._timing(e)}}}),t._v(" "),"ONLINE"===e.releaseState?n("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"error",shape:"circle",size:"xsmall","data-toggle":"tooltip",title:t.$t("下线"),icon:"iconfont icon-erji-xiaxianjilu"},on:{click:function(n){return t._downline(e)}}}):t._e(),t._v(" "),"OFFLINE"===e.releaseState?n("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"warning",shape:"circle",size:"xsmall","data-toggle":"tooltip",title:t.$t("上线"),icon:"iconfont icon-erji-xiaxianjilu-copy"},on:{click:function(n){return t._poponline(e)}}}):t._e(),t._v(" "),n("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"info",shape:"circle",size:"xsmall","data-toggle":"tooltip",title:t.$t("定时管理"),disabled:"ONLINE"!==e.releaseState,icon:"iconfont icon-paibanguanli"},on:{click:function(n){return t._timingManage(e)}}}),t._v(" "),n("x-button",{attrs:{type:"info",shape:"circle",size:"xsmall","data-toggle":"tooltip",title:t.$t("树形图"),icon:"iconfont icon-juxingkaobei"},on:{click:function(n){return t._treeView(e)}}})],1)])})],2)])])},staticRenderFns:[]};e.a=a},function(t,e,n){"use strict";var a={render:function(){var t=this,e=this,n=e.$createElement,a=e._self._c||n;return a("div",{staticClass:"main-layout-box"},[a("m-secondary-menu",{attrs:{type:"projects"}}),e._v(" "),a("m-list-construction",{attrs:{title:e.$t("工作流定义")}},[a("template",{slot:"conditions"},[a("m-conditions",{on:{"on-conditions":e._onConditions}},[a("template",{slot:"button-group"},[a("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"ghost",size:"small"},on:{click:function(){return t.$router.push({name:"definition-create"})}}},[e._v(e._s(e.$t("创建工作流")))])],1)],2)],1),e._v(" "),a("template",{slot:"content"},[e.processListP.length?[a("m-list",{attrs:{"process-list":e.processListP,"page-no":e.searchParams.pageNo,"page-size":e.searchParams.pageSize},on:{"on-update":e._onUpdate}}),e._v(" "),a("div",{staticClass:"page-box"},[a("x-page",{attrs:{current:parseInt(e.searchParams.pageNo),total:e.total,"show-elevator":""},on:{"on-change":e._page}})],1)]:e._e(),e._v(" "),e.processListP.length?e._e():[a("m-no-data")],e._v(" "),a("m-spin",{attrs:{"is-spin":e.isLoading}})],2)],2)],1)},staticRenderFns:[]};e.a=a}])); -//# sourceMappingURL=0.738a8a5.js.map \ No newline at end of file +webpackJsonp([0],Array(605).concat([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(1021),i=n.n(a);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);var o=n(1102);var s=function(t){n(1098)},l=n(27)(i.a,o.a,!1,s,null,null);e.default=l.exports},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";e.__esModule=!0,e.default={name:"spin",data:function(){return{}},props:{isSpin:{type:Boolean,default:!0},isLeft:{type:Boolean,default:!0}}}},function(t,e,n){"use strict";e.__esModule=!0,e.default={name:"list-construction",data:function(){return{}},props:{title:String}}},function(t,e,n){"use strict";e.__esModule=!0;var a,i=n(659),r=(a=i)&&a.__esModule?a:{default:a};e.default={name:"secondary-menu",data:function(){return{menuList:(0,r.default)(this.type),index:0,id:this.$route.params.id,isTogHide:!1}},props:{type:String,className:String},watch:{isTogHide:function(t){var e=$(".main-layout-box");t?e.addClass("toggle"):e.removeClass("toggle")}},methods:{_toggleSubMenu:function(t){t.isOpen=!t.isOpen},_toggleMenu:function(){this.isTogHide=!this.isTogHide}},mounted:function(){}}},function(t,e,n){"use strict";e.__esModule=!0;var a=r(n(91)),i=r(n(222));function r(t){return t&&t.__esModule?t:{default:t}}e.default={data:function(){return{router:i.default,store:a.default,isDetails:!1}},created:function(){this.isDetails=this.store.state.dag.isDetails},methods:{},computed:{_isDetails:function(){return this.isDetails?"icon-disabled":""}}}},function(t,e,n){"use strict";e.__esModule=!0,e.default={name:"no-data",props:{msg:String}}},,function(t,e,n){var a;a=function(){"use strict";var t="millisecond",e="second",n="minute",a="hour",i="day",r="week",o="month",s="quarter",l="year",c=/^(\d{4})-?(\d{1,2})-?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d{1,3})?$/,u=/\[([^\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f=function(t,e,n){var a=String(t);return!a||a.length>=e?t:""+Array(e+1-a.length).join(n)+t},d={s:f,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),a=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+f(a,2,"0")+":"+f(i,2,"0")},m:function(t,e){var n=12*(e.year()-t.year())+(e.month()-t.month()),a=t.clone().add(n,o),i=e-a<0,r=t.clone().add(n+(i?-1:1),o);return Number(-(n+(e-a)/(i?a-r:r-a))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(c){return{M:o,y:l,w:r,d:i,h:a,m:n,s:e,ms:t,Q:s}[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},v="en",h={};h[v]=p;var m=function(t){return t instanceof x},y=function(t,e,n){var a;if(!t)return null;if("string"==typeof t)h[t]&&(a=t),e&&(h[t]=e,a=t);else{var i=t.name;h[i]=t,a=i}return n||(v=a),a},_=function(t,e,n){if(m(t))return t.clone();var a=e?"string"==typeof e?{format:e,pl:n}:e:{};return a.date=t,new x(a)},b=d;b.l=y,b.i=m,b.w=function(t,e){return _(t,{locale:e.$L,utc:e.$u})};var x=function(){function f(t){this.$L=this.$L||y(t.locale,null,!0)||v,this.parse(t)}var d=f.prototype;return d.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var a=e.match(c);if(a)return n?new Date(Date.UTC(a[1],a[2]-1,a[3]||1,a[4]||0,a[5]||0,a[6]||0,a[7]||0)):new Date(a[1],a[2]-1,a[3]||1,a[4]||0,a[5]||0,a[6]||0,a[7]||0)}return new Date(e)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return b},d.isValid=function(){return!("Invalid Date"===this.$d.toString())},d.isSame=function(t,e){var n=_(t);return this.startOf(e)<=n&&n<=this.endOf(e)},d.isAfter=function(t,e){return _(t).secondary-menu-model{left:-200px}.secondary-menu-model{position:fixed;left:0;top:0;width:200px;background:#41444c;height:100%;padding-top:80px}.secondary-menu-model .toogle-box{position:absolute;right:-1px;top:calc(50% - 50px)}.secondary-menu-model .toogle-box .tog-close{width:12px;height:102px;background:url("+a(n(657))+") no-repeat;display:inline-block}.secondary-menu-model .toogle-box .tog-open{width:12px;height:102px;background:url("+a(n(658))+") no-repeat;display:inline-block;position:absolute;right:-12px;top:0}.secondary-menu-model .leven-1 .name a{height:40px;line-height:40px;display:block;position:relative;padding-left:12px}.secondary-menu-model .leven-1 .name a>.icon{vertical-align:middle;font-size:15px;width:20px;text-align:center;color:#fff}.secondary-menu-model .leven-1 .name a>span{vertical-align:middle;padding-left:2px;font-size:14px;color:#fff}.secondary-menu-model .leven-1 .name a>.angle{position:absolute;right:12px;top:14px}.secondary-menu-model .leven-1 ul li{height:36px;line-height:36px;cursor:pointer;padding-left:39px;color:#fff}.secondary-menu-model .leven-1 ul li a{font-size:14px}.secondary-menu-model .leven-1 ul li.active{border-right:2px solid #2d8cf0;background:#2c2f39}.secondary-menu-model .leven-1 ul li.active span{font-weight:700;color:#2d8cf0}.secondary-menu-model .leven-1 .router-link-active,.secondary-menu-model .leven-1>.router-link-exact-active{background:#f0f6fb}.secondary-menu-model .leven-1 .router-link-active .name,.secondary-menu-model .leven-1>.router-link-exact-active .name{border-right:2px solid #2d8cf0;background:#2b2e38}.secondary-menu-model .leven-1 .router-link-active .name a span,.secondary-menu-model .leven-1>.router-link-exact-active .name a span{color:#2d8cf0;font-weight:700}.secondary-menu-model .leven-1 .router-link-active .name a .fa,.secondary-menu-model .leven-1>.router-link-exact-active .name a .fa{color:#2d8cf0}",""])},function(t,e,n){t.exports=n.p+"images/close.png?02806e641df25c1b4dbff4cb0af3984d"},function(t,e,n){t.exports=n.p+"images/open.png?97ec0726c7acab8a2a48282d68cea631"},function(t,e,n){"use strict";e.__esModule=!0;var a,i=n(36),r=(a=i)&&a.__esModule?a:{default:a};var o={projects:[{name:""+r.default.$t("项目首页"),id:1,path:"projects-index",isOpen:!0,icon:"fa-home",children:[]},{name:""+r.default.$t("工作流"),id:2,path:"",isOpen:!0,icon:"fa-gear",children:[{name:""+r.default.$t("工作流定义"),path:"definition",id:1},{name:""+r.default.$t("工作流实例"),path:"instance",id:2},{name:""+r.default.$t("任务实例"),path:"task-instance-list",id:3}]}],security:[{name:""+r.default.$t("租户管理"),id:1,path:"tenement-manage",isOpen:!0,icon:"fa-users",children:[]},{name:""+r.default.$t("用户管理"),id:1,path:"users-manage",isOpen:!0,icon:"fa-user-circle",children:[]},{name:""+r.default.$t("告警组管理"),id:1,path:"warning-groups-manage",isOpen:!0,icon:"fa-warning",children:[]},{name:""+r.default.$t("队列管理"),id:1,path:"queue-manage",isOpen:!0,icon:"fa-recycle",children:[]},{name:""+r.default.$t("服务管理"),id:1,path:"",isOpen:!0,icon:"fa-server",children:[{name:"master",path:"servers-master",id:1},{name:"worker",path:"servers-worker",id:2}]}],resource:[{name:""+r.default.$t("文件管理"),id:1,path:"file",isOpen:!0,icon:"fa-files-o",children:[],disabled:!1},{name:""+r.default.$t("UDF管理"),id:1,path:"",isOpen:!0,icon:"fa-file-text",disabled:!1,children:[{name:""+r.default.$t("资源管理"),path:"resource-udf-resource",id:1},{name:""+r.default.$t("函数管理"),path:"resource-udf-function",id:2}]}],user:[{name:""+r.default.$t("用户信息"),id:1,path:"account",isOpen:!0,icon:"fa-user",children:[],disabled:!1},{name:""+r.default.$t("修改密码"),id:1,path:"password",isOpen:!0,icon:"fa-key",children:[],disabled:!1}]};e.default=function(t){return o[t]}},function(t,e,n){"use strict";var a={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"secondary-menu-model",class:t.className},[n("div",{staticClass:"toogle-box"},[t.isTogHide?t._e():n("a",{staticClass:"tog-close",attrs:{href:"javascript:"},on:{click:t._toggleMenu}}),t._v(" "),t.isTogHide?n("a",{staticClass:"tog-open",attrs:{href:"javascript:"},on:{click:t._toggleMenu}}):t._e()]),t._v(" "),t._l(t.menuList,function(e,a){return n("div",{staticClass:"leven-1"},[e.path?[n("router-link",{attrs:{to:{name:e.path}}},[n("div",{staticClass:"name",on:{click:function(n){return t._toggleSubMenu(e)}}},[n("a",{attrs:{href:"javascript:"}},[n("i",{staticClass:"fa icon",class:e.icon}),t._v(" "),n("span",[t._v(t._s(e.name))]),t._v(" "),e.children.length?n("i",{staticClass:"fa angle",class:e.isOpen?"fa-angle-down":"fa-angle-right"}):t._e()])])])]:t._e(),t._v(" "),e.path?t._e():[n("div",{staticClass:"name",on:{click:function(n){return t._toggleSubMenu(e)}}},[n("a",{attrs:{href:"javascript:"}},[n("i",{staticClass:"fa icon",class:e.icon}),t._v(" "),n("span",[t._v(t._s(e.name))]),t._v(" "),e.children.length?n("i",{staticClass:"fa angle",class:e.isOpen?"fa-angle-down":"fa-angle-right"}):t._e()])])],t._v(" "),e.isOpen&&e.children.length?n("ul",t._l(e.children,function(e,a){return n("router-link",{attrs:{to:{name:e.path},tag:"li","active-class":"active"}},[n("span",[t._v(t._s(e.name))])])}),1):t._e()],2)})],2)},staticRenderFns:[]};e.a=a},function(t,e,n){"use strict";e.__esModule=!0,e.formatDate=void 0;var a,i=n(645),r=(a=i)&&a.__esModule?a:{default:a};e.formatDate=function(t,e){return e=e||"YYYY-MM-DD HH:mm:ss",(0,r.default)(t).format(e)}},function(t,e,n){"use strict";e.__esModule=!0;var a,i=n(28),r=(a=i)&&a.__esModule?a:{default:a};e.default={name:"conditions",data:function(){return{searchVal:""}},props:{operation:Array},methods:{_ckQuery:function(){this.$emit("on-conditions",{searchVal:r.default.trim(this.searchVal)})}},computed:{isShow:function(){return this.$slots["search-group"]}},components:{}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(643),i=n.n(a);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);var o=n(666);var s=function(t){n(664)},l=n(27)(i.a,o.a,!1,s,null,null);e.default=l.exports},function(t,e,n){var a=n(665);"string"==typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);n(35)("3cb222d8",a,!0,{})},function(t,e,n){(t.exports=n(34)(!1)).push([t.i,".no-data-model{position:relative;width:100%;height:calc(100vh - 200px)}.no-data-model .no-data-box{width:210px;height:210px;position:absolute;left:50%;top:50%;margin-left:-105px;margin-top:-105px;text-align:center}.no-data-model .no-data-box .text{padding-top:10px;color:#666}",""])},function(t,e,n){"use strict";var a={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"no-data-model"},[e("div",{staticClass:"no-data-box"},[this._m(0),this._v(" "),e("div",{staticClass:"text"},[this._v(this._s(this.msg||this.$t("查询无数据")))])])])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"img"},[e("img",{attrs:{src:n(667),alt:""}})])}]};e.a=a},function(t,e,n){t.exports=n.p+"images/errorTip.png?a7b20f0ca8727f22f405c2a34d1363a0"},function(t,e,n){"use strict";var a,i=n(29),r=(a=i)&&a.__esModule?a:{default:a},o=n(661);r.default.filter("formatDate",o.formatDate)},function(t,e,n){var a=n(745),i="object"==typeof self&&self&&self.Object===Object&&self,r=a||i||Function("return this")();t.exports=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(662),i=n.n(a);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);var o=n(671),s=n(27)(i.a,o.a,!1,null,null,null);e.default=s.exports},function(t,e,n){"use strict";var a={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"conditions-model"},[n("div",{staticClass:"left"},[t._t("button-group")],2),t._v(" "),n("div",{staticClass:"right"},[n("div",{staticClass:"from-box"},[t.isShow?t._t("search-group"):t._e(),t._v(" "),t.isShow?t._e():[n("div",{staticClass:"list"},[n("x-button",{attrs:{type:"ghost",size:"small",icon:"fa fa-search"},on:{click:t._ckQuery}})],1),t._v(" "),n("div",{staticClass:"list"},[n("x-input",{staticStyle:{width:"180px"},attrs:{size:"small",placeholder:t.$t("请输入关键词"),type:"text"},on:{"on-enterkey":t._ckQuery},model:{value:t.searchVal,callback:function(e){t.searchVal=e},expression:"searchVal"}})],1)]],2)])])},staticRenderFns:[]};e.a=a},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){var a=n(827),i=n(830);t.exports=function(t,e){var n=i(t,e);return a(n)?n:void 0}},,,function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){var a=n(679),i=n(815),r=n(816),o="[object Null]",s="[object Undefined]",l=a?a.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?s:o:l&&l in Object(t)?i(t):r(t)}},function(t,e,n){var a=n(669).Symbol;t.exports=a},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var a=n(767),i=n(716);t.exports=function(t,e,n,r){var o=!n;n||(n={});for(var s=-1,l=e.length;++s'+e.unicode+""},_onChange:function(t){this.value=t.value,this.$emit("priorityEvent",t.value)}},created:function(){},mounted:function(){},components:{}}},function(t,e,n){var a=n(744),i=n(819),r=n(690);t.exports=function(t){return r(t)?a(t):i(t)}},function(t,e,n){(function(t){var a=n(669),i=n(817),r="object"==typeof e&&e&&!e.nodeType&&e,o=r&&"object"==typeof t&&t&&!t.nodeType&&t,s=o&&o.exports===r?a.Buffer:void 0,l=(s?s.isBuffer:void 0)||i;t.exports=l}).call(e,n(92)(t))},function(t,e){t.exports=function(t){return function(e){return t(e)}}},function(t,e,n){var a=n(691),i=n(747);t.exports=function(t){return null!=t&&i(t.length)&&!a(t)}},function(t,e,n){var a=n(678),i=n(673),r="[object AsyncFunction]",o="[object Function]",s="[object GeneratorFunction]",l="[object Proxy]";t.exports=function(t){if(!i(t))return!1;var e=a(t);return e==o||e==s||e==r||e==l}},function(t,e,n){var a=n(674)(Object,"create");t.exports=a},function(t,e,n){var a=n(840),i=n(841),r=n(842),o=n(843),s=n(844);function l(t){var e=-1,n=null==t?0:t.length;for(this.clear();++espan{font-weight:400}.priority-model .ans-option-listp>span>.iconfont{padding-right:2px}.priority-model .ans-input .input-element{cursor:pointer;height:32px;line-height:30px;position:relative;font-weight:400}.priority-model .ans-input .input-element .ans-icon-arrow-down{position:absolute;right:8px;top:0;font-size:12px;color:#888;cursor:pointer}.priority-model .ans-input .input-element span{vertical-align:middle}.priority-model .ans-input .input-element span.label-p{margin-top:-4px;display:inline-block}",""])},function(t,e,n){"use strict";var a={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"priority-model"},[n("x-select",{staticStyle:{width:"130px"},attrs:{disabled:t.isDetails},on:{"on-change":t._onChange},scopedSlots:t._u([{key:"trigger",fn:function(e){var a=e.selectedModel;return n("div",{staticClass:"ans-input"},[n("div",{staticClass:"input-element",class:t.isDetails?"disabled":""},[n("span",{domProps:{innerHTML:t._s(t._rtUnicode(a?a.label:"MEDIUM"))}}),t._v(" "),n("span",{staticClass:"label-p"},[t._v(t._s(a?a.label:"MEDIUM"))]),t._v(" "),n("i",{staticClass:"ans-icon-arrow-down"})])])}}]),model:{value:t.value,callback:function(e){t.value=e},expression:"value"}},[t._v(" "),t._l(t.priorityList,function(e){return n("x-option",{key:e.code,attrs:{value:e.code,label:e.code}},[n("li",{staticClass:"ans-option ans-option-listp"},[n("span",{staticClass:"default-option-class"},[n("i",{staticClass:"iconfont",style:{color:e.color},domProps:{innerHTML:t._s(e.unicode)}}),t._v("\n "+t._s(e.code)+"\n ")])])])})],2)],1)},staticRenderFns:[]};e.a=a},function(t,e){t.exports=function(t,e){for(var n=-1,a=null==t?0:t.length,i=Array(a);++n-1&&t%1==0&&t-1&&t%1==0&&t<=n}},function(t,e){t.exports=function(t,e){return function(n){return t(e(n))}}},function(t,e,n){var a=n(750),i=n(708),r=n(832),o=n(713),s=n(758),l=i(function(t){var e=s(t);return e="function"==typeof e?e:void 0,r(a(t,1,o,!0),void 0,e)});t.exports=l},function(t,e,n){var a=n(707),i=n(821);t.exports=function t(e,n,r,o,s){var l=-1,c=e.length;for(r||(r=i),s||(s=[]);++l0&&r(u)?n>1?t(u,n-1,r,o,s):a(s,u):o||(s[s.length]=u)}return s}},function(t,e){t.exports=function(t){return t}},function(t,e,n){var a=n(674),i=function(){try{var t=a(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=i},function(t,e){var n=Function.prototype.toString;t.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},function(t,e,n){var a=n(833),i=n(845),r=n(847),o=n(848),s=n(849);function l(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1}},function(t,e){t.exports=function(t,e,n){for(var a=-1,i=null==t?0:t.length;++ad))return!1;var v=u.get(t);if(v&&u.get(e))return v==e;var h=-1,m=!0,y=n&s?new a:void 0;for(u.set(t,e),u.set(e,t);++h=0}t.exports=d,t.exports.multiple=function(){for(var t=arguments.length,e=Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return d({customizeArray:v(t),customizeObject:h(t)})},t.exports.smartStrategy=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return d({customizeArray:function(e,n,a){if(m(a.split(".").slice(-1)[0]))switch(t[a]){case"prepend":return[].concat(f((0,o.default)(n,e,function(e,n){return(0,l.uniteRules)(t,a,e,n,"prepend")})),f(e));case"replace":return n;default:return(0,i.default)(e,n,l.uniteRules.bind(null,t,a))}return v(t)(e,n,a)},customizeObject:h(t)})},t.exports.unique=c.default},function(t,e,n){var a=n(812),i=n(687);t.exports=function(t){return null==t?[]:a(t,i(t))}},function(t,e,n){var a=n(743);t.exports=function(t,e){return a(e,function(e){return t[e]})}},function(t,e){t.exports=function(t,e){for(var n=-1,a=Array(t);++n0){if(++e>=n)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var a=n(709),i=n(755),r=n(756),o=n(711),s=n(856),l=n(712),c=200;t.exports=function(t,e,n){var u=-1,f=i,d=t.length,p=!0,v=[],h=v;if(n)p=!1,f=r;else if(d>=c){var m=e?null:s(t);if(m)return l(m);p=!1,f=o,h=new a}else h=e?[]:v;t:for(;++u-1}},function(t,e,n){var a=n(694);t.exports=function(t,e){var n=this.__data__,i=a(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},function(t,e,n){var a=n(695);t.exports=function(t){var e=a(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,n){var a=n(695);t.exports=function(t){return a(this,t).get(t)}},function(t,e,n){var a=n(695);t.exports=function(t){return a(this,t).has(t)}},function(t,e,n){var a=n(695);t.exports=function(t,e){var n=a(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}},function(t,e){var n="__lodash_hash_undefined__";t.exports=function(t){return this.__data__.set(t,n),this}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var a=n(853),i=n(854),r=n(855);t.exports=function(t,e,n){return e==e?r(t,e,n):a(t,i,n)}},function(t,e){t.exports=function(t,e,n,a){for(var i=t.length,r=n+(a?1:-1);a?r--:++r1?n[r-1]:void 0,s=r>2?n[2]:void 0;for(o=t.length>3&&"function"==typeof o?(r--,o):void 0,s&&i(n[0],n[1],s)&&(o=r<3?void 0:o,r=1),e=Object(e);++a=c&&(d=l,p=!1,e=new a(e));t:for(;++f0&&void 0!==arguments[0]?arguments[0]:{},n=e.customizeArray,s=e.customizeObject,u=e.key;return function e(f,d,p){var v=u?u+"."+p:p;if((0,r.default)(f)&&(0,r.default)(d))return function(){return e(f.apply(void 0,arguments),d.apply(void 0,arguments),p)};if(c(f)&&c(d)){var h=n&&n(f,d,v);return h||[].concat(l(f),l(d))}if((0,i.default)(f)&&(0,i.default)(d)){var m=s&&s(f,d,v);return m||(0,a.default)({},f,d,t({customizeArray:n,customizeObject:s,key:v}))}return(0,i.default)(d)?(0,o.default)(d):c(d)?[].concat(l(d)):d}};var c=Array.isArray},function(t,e,n){var a=n(876),i=1,r=4;t.exports=function(t){return a(t,i|r)}},function(t,e,n){var a=n(715),i=n(877),r=n(767),o=n(878),s=n(879),l=n(760),c=n(763),u=n(880),f=n(882),d=n(770),p=n(883),v=n(697),h=n(887),m=n(888),y=n(764),_=n(677),b=n(688),x=n(892),g=n(673),V=n(894),k=n(687),S=1,w=2,C=4,$="[object Arguments]",M="[object Function]",L="[object GeneratorFunction]",D="[object Object]",j={};j[$]=j["[object Array]"]=j["[object ArrayBuffer]"]=j["[object DataView]"]=j["[object Boolean]"]=j["[object Date]"]=j["[object Float32Array]"]=j["[object Float64Array]"]=j["[object Int8Array]"]=j["[object Int16Array]"]=j["[object Int32Array]"]=j["[object Map]"]=j["[object Number]"]=j[D]=j["[object RegExp]"]=j["[object Set]"]=j["[object String]"]=j["[object Symbol]"]=j["[object Uint8Array]"]=j["[object Uint8ClampedArray]"]=j["[object Uint16Array]"]=j["[object Uint32Array]"]=!0,j["[object Error]"]=j[M]=j["[object WeakMap]"]=!1,t.exports=function t(e,n,E,W,I,P){var O,A=n&S,T=n&w,N=n&C;if(E&&(O=I?E(e,W,I,P):E(e)),void 0!==O)return O;if(!g(e))return e;var R=_(e);if(R){if(O=h(e),!A)return c(e,O)}else{var U=v(e),z=U==M||U==L;if(b(e))return l(e,A);if(U==D||U==$||z&&!I){if(O=T||z?{}:y(e),!A)return T?f(e,s(O,e)):u(e,o(O,e))}else{if(!j[U])return I?e:{};O=m(e,U,A)}}P||(P=new a);var H=P.get(e);if(H)return H;if(P.set(e,O),V(e))return e.forEach(function(a){O.add(t(a,n,E,a,e,P))}),O;if(x(e))return e.forEach(function(a,i){O.set(i,t(a,n,E,i,e,P))}),O;var Y=N?T?p:d:T?keysIn:k,G=R?void 0:Y(e);return i(G||e,function(a,i){G&&(a=e[i=a]),r(O,i,t(a,n,E,i,e,P))}),O}},function(t,e){t.exports=function(t,e){for(var n=-1,a=null==t?0:t.length;++n=0;i-=1)if(d(e,t[i]))return i;return-1}e.uniteRules=function t(e,n,r,o){if(String(o.test)!==String(r.test)||(r.enforce||o.enforce)&&o.enforce!==r.enforce||r.include&&!f(o.include,r.include)||r.exclude&&!f(o.exclude,r.exclude))return!1;if(!(o.test||o.include||o.exclude||(o.loader&&o.loader.split("?")[0])===(r.loader&&r.loader.split("?")[0])))return!1;if((o.include||o.exclude)&&!r.include&&!r.exclude)return!1;if(o.oneOf&&r.oneOf)return o.oneOf=(0,a.default)(o.oneOf,r.oneOf,t.bind(null,{},"oneOf")),!0;if(r.loader){var s=r.options?"options":r.query&&"query";delete o.use,delete o.loaders,delete o.oneOf,o.loader=r.loader,s&&(o[s]=r[s])}else if(r.oneOf)delete o.use,delete o.loaders,delete o.loader,o.oneOf=r.oneOf;else if((o.use||o.loaders||o.loader)&&(r.use||r.loaders)){var l=function(t){return"string"==typeof t?{loader:t}:t},u=function(t){return t.options||t.query?t:t.loader},d=void 0;if(o.loader){var h=o.options?"options":o.query&&"query";d=[{loader:o.loader}],h&&(d[0][h]=o[h]),delete o.loader,h&&delete o[h]}else d=[].concat(o.use||o.loaders).map(l);var m=[].concat(r.use||r.loaders).map(l),y=o.use||r.use?"use":"loaders";switch(e[n+"."+y]){case"prepend":o[y]=[].concat(c((0,i.default)(m,d,p)),c(d)).map(u);break;case"replace":o[y]=r.use||r.loaders;break;default:o[y]=function(t,e){for(var n=[],a=e.length-1,i=t.length-1;i>=0;i-=1){var r=t[i],o=v(e,r,0,a),s=-1!==o;if(s){for(var l=a;l>o;l-=1){var c=e[l],u=-1!==v(t,c,0,i);u||n.unshift(c),a-=1}p(r,e[a]),n.unshift(e[a]),a-=1}else{var f=-1!==v(n,r);f||n.unshift(r)}}for(;a>=0;a-=1){var d=e[a],h=-1!==v(n,d);h||n.unshift(d)}return n}(m,d).map(u)}}return r.include&&(o.include=r.include),r.exclude&&(o.exclude=r.exclude),!0},e.uniteEntries=p},function(t,e,n){var a=n(898);t.exports=function(t,e){return a(t,e)}},function(t,e,n){var a=n(899),i=n(672);t.exports=function t(e,n,r,o,s){return e===n||(null==e||null==n||!i(e)&&!i(n)?e!=e&&n!=n:a(e,n,r,o,t,s))}},function(t,e,n){var a=n(715),i=n(772),r=n(901),o=n(903),s=n(697),l=n(677),c=n(688),u=n(704),f=1,d="[object Arguments]",p="[object Array]",v="[object Object]",h=Object.prototype.hasOwnProperty;t.exports=function(t,e,n,m,y,_){var b=l(t),x=l(e),g=b?p:s(t),V=x?p:s(e),k=(g=g==d?v:g)==v,S=(V=V==d?v:V)==v,w=g==V;if(w&&c(t)){if(!c(e))return!1;b=!0,k=!1}if(w&&!k)return _||(_=new a),b||u(t)?i(t,e,n,m,y,_):r(t,e,g,n,m,y,_);if(!(n&f)){var C=k&&h.call(t,"__wrapped__"),$=S&&h.call(e,"__wrapped__");if(C||$){var M=C?t.value():t,L=$?e.value():e;return _||(_=new a),y(M,L,n,m,_)}}return!!w&&(_||(_=new a),o(t,e,n,m,y,_))}},function(t,e){t.exports=function(t,e){for(var n=-1,a=null==t?0:t.length;++n2&&void 0!==arguments[2]?arguments[2]:function(t){return t};return function(a,i,s){return s===t&&[].concat(o(a),o((0,r.default)(i,a,function(t){return e.indexOf(n(t))>=0})))}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(809),i=n.n(a);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);var o=n(998);var s=function(t){n(994)},l=n(27)(i.a,o.a,!1,s,null,null);e.default=l.exports},function(t,e,n){var a=n(995);"string"==typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);n(35)("731da2de",a,!0,{})},function(t,e,n){(t.exports=n(34)(!1)).push([t.i,".timing-process-model{width:860px;min-height:300px;background:#fff;border-radius:3px;margin-top:-24%}.timing-process-model .crontab-box{margin:-6px}.timing-process-model .from-model{padding-top:0}.timing-process-model .title-box{margin-bottom:18px}.timing-process-model .title-box span{padding-left:30px;font-size:16px;padding-top:29px;display:block}.timing-process-model .list{margin-bottom:14px}.timing-process-model .list>.text{width:140px;float:left;text-align:right;line-height:32px;padding-right:8px}.timing-process-model .list .cont{width:350px;float:left}.timing-process-model .submit{text-align:right;padding-right:30px;padding-top:10px;padding-bottom:30px}.v-crontab-from-model .list-box{padding:0}",""])},function(t,e){},function(t,e,n){"use strict";(function(t){var a,i,r,o,s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};"undefined"!=typeof self&&self,o=function(t){return function(t){var e={};function n(a){if(e[a])return e[a].exports;var i=e[a]={i:a,l:!1,exports:{}};return t[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,a){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:a})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=29)}([function(e,n){e.exports=t},function(t,e,n){e.a=function(t,e,n,a,i,r,o,s){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),a&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),o?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=l):i&&(l=s?function(){i.call(this,this.$root.$options.shadowRoot)}:i),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(t,e){return l.call(e),u(t,e)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,l):[l]}return{exports:t,options:c}}},function(t,e,n){e.__esModule=!0;var a=n(34),i=n(37);e.default={methods:{$t:function(t,e){return(0,i.template)((0,a.findLocale)(window.localeCrontab).locale[t],e)}}}},function(t,e,n){e.__esModule=!0,e.template=e.isWeek=e.isStr=e.selectList=void 0;var a,i="function"==typeof Symbol&&"symbol"==s(Symbol.iterator)?function(t){return void 0===t?"undefined":s(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":s(t)},r=(a=n(0))&&a.__esModule?a:{default:a},o=function(t,e){var n=e-t+1,a=t-1;return Array.apply(null,{length:n}).map(function(t,e){return++a})},l={60:r.default.map(o(0,59),function(t){return{value:t+"",label:t+""}}),24:r.default.map(o(0,23),function(t){return{value:t+"",label:t+""}}),12:r.default.map(o(0,12),function(t){return{value:t+"",label:t+""}}),year:r.default.map(o(2018,2030),function(t){return{value:t+"",label:t+""}}),week:[{value:1,label:"星期天"},{value:2,label:"星期一"},{value:3,label:"星期二"},{value:4,label:"星期三"},{value:5,label:"星期四"},{value:6,label:"星期五"},{value:7,label:"星期六"}],specificWeek:[{value:"SUN",label:"SUN"},{value:"MON",label:"MON"},{value:"TUE",label:"TUE"},{value:"WED",label:"WED"},{value:"THU",label:"THU"},{value:"FRI",label:"FRI"},{value:"SAT",label:"SAT"}],day:r.default.map(o(1,31),function(t){return{value:t+"",label:t+""}}),lastWeeks:[{value:"1L",label:"星期天"},{value:"2L",label:"星期一"},{value:"3L",label:"星期二"},{value:"4L",label:"星期三"},{value:"5L",label:"星期四"},{value:"6L",label:"星期五"},{value:"7L",label:"星期六"}]},c={}.hasOwnProperty,u=/(%|)\{([0-9a-zA-Z_]+)\}/g;e.selectList=l,e.isStr=function(t,e){var n=void 0;return-1!==t.indexOf(e)&&(n=t.split(e)),n},e.isWeek=function(t){var e=!1,n=t.split(",");return r.default.map(n,function(t){var n;n=t,-1!==r.default.findIndex(l.specificWeek,function(t){return t.value===n})&&(e=!0)}),e},e.template=function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),a=1;athis.max&&(this.value=this.max),this.min>this.value&&(this.value=this.min),this.$emit("on-number",this.value)},onIncrease:function(){this.value=parseInt(this.value)+1,this.$emit("on-number",this.value)},onReduce:function(){this.value=parseInt(this.value)-1,this.$emit("on-number",this.value)}},watch:{},beforeCreate:function(){},created:function(){this.value=this.propsValue?this.propsValue:this.min},beforeMount:function(){},mounted:function(){},beforeUpdate:function(){},updated:function(){},beforeDestroy:function(){},destroyed:function(){},computed:{},components:{}}},function(t,e){},function(t,e){},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(14),i=n.n(a);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);e.default=i.a},function(t,e,n){e.__esModule=!0;var a=s(n(0)),i=s(n(2)),r=n(3),o=s(n(4));function s(t){return t&&t.__esModule?t:{default:t}}e.default={name:"minute",mixins:[i.default],data:function(){return{minuteValue:"*",radioMinute:"everyMinute",selectMinuteList:r.selectList[60],intervalPerformVal:5,intervalStartVal:3,specificMinutesVal:[],cycleStartVal:1,cycleEndVal:1}},props:{minuteVal:String,value:{type:String,default:"*"}},model:{prop:"value",event:"minuteValueEvent"},methods:{onIntervalPerform:function(t){this.intervalPerformVal=t,"intervalMinute"===this.radioMinute&&(this.minuteValue=this.intervalStartVal+"/"+this.intervalPerformVal)},onIntervalStart:function(t){this.intervalStartVal=t,"intervalMinute"===this.radioMinute&&(this.minuteValue=this.intervalStartVal+"/"+this.intervalPerformVal)},onspecificMinutes:function(t){},onCycleStart:function(t){this.cycleStartVal=t,"cycleMinute"===this.radioMinute&&(this.minuteValue=this.cycleStartVal+"-"+this.cycleEndVal)},onCycleEnd:function(t){this.cycleEndVal=t,"cycleMinute"===this.radioMinute&&(this.minuteValue=this.cycleStartVal+"-"+this.cycleEndVal)},everyReset:function(){this.minuteValue="*"},intervalReset:function(){this.minuteValue=this.intervalStartVal+"/"+this.intervalPerformVal},specificReset:function(){this.specificMinutesVal.length?this.minuteValue=this.specificMinutesVal.join(","):this.minuteValue="*"},cycleReset:function(){this.minuteValue=this.cycleStartVal+"-"+this.cycleEndVal},analyticalValue:function(){var t=this;return new Promise(function(e,n){var i=a.default.cloneDeep(t.value),o=(0,r.isStr)(i,"/"),s=(0,r.isStr)(i,","),l=(0,r.isStr)(i,"-");return"*"===i?(t.radioMinute="everyMinute",void(t.minuteValue="*")):1===i.length&&a.default.isInteger(parseInt(i))||2===i.length&&a.default.isInteger(parseInt(i))?(t.radioMinute="specificMinute",void(t.specificMinutesVal=[i])):o?(t.radioMinute="intervalMinute",t.intervalStartVal=parseInt(o[0]),t.intervalPerformVal=parseInt(o[1]),void(t.minuteValue=t.intervalStartVal+"/"+t.intervalPerformVal)):s?(t.radioMinute="specificMinute",void(t.specificMinutesVal=s)):l?(t.radioMinute="cycleMinute",t.cycleStartVal=parseInt(l[0]),t.cycleEndVal=parseInt(l[1]),void(t.minuteValue=t.cycleStartVal+"/"+t.cycleEndVal)):void e()})}},watch:{minuteValue:function(t){this.$emit("minuteValueEvent",t)},radioMinute:function(t){switch(t){case"everyMinute":this.everyReset();break;case"intervalMinute":this.intervalReset();break;case"specificMinute":this.specificReset();break;case"cycleMinute":this.cycleReset()}},specificMinutesVal:function(t){this.minuteValue=t.join(",")}},beforeCreate:function(){},created:function(){this.analyticalValue().then(function(){})},beforeMount:function(){},mounted:function(){},beforeUpdate:function(){},updated:function(){},beforeDestroy:function(){},destroyed:function(){},computed:{},components:{mInputNumber:o.default}}},function(t,e){},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(17),i=n.n(a);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);e.default=i.a},function(t,e,n){e.__esModule=!0;var a=s(n(0)),i=s(n(2)),r=n(3),o=s(n(4));function s(t){return t&&t.__esModule?t:{default:t}}e.default={name:"hour",mixins:[i.default],data:function(){return{hourValue:"*",radioHour:"everyHour",selectHourList:r.selectList[24],intervalPerformVal:5,intervalStartVal:3,specificHoursVal:[],cycleStartVal:1,cycleEndVal:1}},props:{hourVal:String,value:{type:String,default:"*"}},model:{prop:"value",event:"hourValueEvent"},methods:{onIntervalPerform:function(t){this.intervalPerformVal=t,"intervalHour"===this.radioHour&&(this.hourValue=this.intervalStartVal+"/"+this.intervalPerformVal)},onIntervalStart:function(t){this.intervalStartVal=t,"intervalHour"===this.radioHour&&(this.hourValue=this.intervalStartVal+"/"+this.intervalPerformVal)},onspecificHours:function(t){},onCycleStart:function(t){this.cycleStartVal=t,"cycleHour"===this.radioHour&&(this.hourValue=this.cycleStartVal+"-"+this.cycleEndVal)},onCycleEnd:function(t){this.cycleEndVal=t,"cycleHour"===this.radioHour&&(this.hourValue=this.cycleStartVal+"-"+this.cycleEndVal)},everyReset:function(){this.hourValue="*"},intervalReset:function(){this.hourValue=this.intervalStartVal+"/"+this.intervalPerformVal},specificReset:function(){this.specificHoursVal.length?this.hourValue=this.specificHoursVal.join(","):this.hourValue="*"},cycleReset:function(){this.hourValue=this.cycleStartVal+"-"+this.cycleEndVal},analyticalValue:function(){var t=this;return new Promise(function(e,n){var i=a.default.cloneDeep(t.value),o=(0,r.isStr)(i,"/"),s=(0,r.isStr)(i,","),l=(0,r.isStr)(i,"-");return"*"===i?(t.radioHour="everyHour",void(t.hourValue="*")):1===i.length&&a.default.isInteger(parseInt(i))||2===i.length&&a.default.isInteger(parseInt(i))?(t.radioHour="specificHour",void(t.specificHoursVal=[i])):o?(t.radioHour="intervalHour",t.intervalStartVal=parseInt(o[0]),t.intervalPerformVal=parseInt(o[1]),void(t.hourValue=t.intervalStartVal+"/"+t.intervalPerformVal)):s?(t.radioHour="specificHour",void(t.specificHoursVal=s)):l?(t.radioHour="cycleHour",t.cycleStartVal=parseInt(l[0]),t.cycleEndVal=parseInt(l[1]),void(t.hourValue=t.cycleStartVal+"/"+t.cycleEndVal)):void e()})}},watch:{hourValue:function(t){this.$emit("hourValueEvent",t)},radioHour:function(t){switch(t){case"everyHour":this.everyReset();break;case"intervalHour":this.intervalReset();break;case"specificHour":this.specificReset();break;case"cycleHour":this.cycleReset()}},specificHoursVal:function(t){this.hourValue=t.join(",")}},beforeCreate:function(){},created:function(){this.analyticalValue().then(function(){})},beforeMount:function(){},mounted:function(){},beforeUpdate:function(){},updated:function(){},beforeDestroy:function(){},destroyed:function(){},computed:{},components:{mInputNumber:o.default}}},function(t,e){},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(20),i=n.n(a);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);e.default=i.a},function(t,e,n){e.__esModule=!0;var a=s(n(0)),i=s(n(2)),r=n(3),o=s(n(4));function s(t){return t&&t.__esModule?t:{default:t}}e.default={name:"day",mixins:[i.default],data:function(){var t=this;return{radioDay:"everyDay",dayValue:"*",weekValue:"?",everyDayVal:"*",WkintervalWeekPerformVal:2,WkintervalWeekStartVal:2,selectWeekList:a.default.map(a.default.cloneDeep(r.selectList.week),function(e){return{value:e.value,label:""+t.$t(e.label)}}),intervalDayPerformVal:1,intervalDayStartVal:1,WkspecificWeekVal:[],selectSpecificWeekList:r.selectList.specificWeek,WkspecificDayVal:[],selectSpecificDayList:r.selectList.day,monthLastDaysVal:"L",monthLastWorkingDays:"LW",monthLastWeeksVal:"1L",monthLastWeeksList:a.default.map(a.default.cloneDeep(r.selectList.lastWeeks),function(e){return{value:e.value,label:""+t.$t(e.label)}}),monthTailBeforeVal:1,recentlyWorkingDaysMonthVal:1,WkmonthNumWeeksDayVal:1,WkmonthNumWeeksWeekVal:1,WkmonthNumWeeksWeekList:a.default.map(a.default.cloneDeep(r.selectList.week),function(e){return{value:e.value,label:""+t.$t(e.label)}})}},props:{dayVal:String,weekVal:String},methods:{onWkintervalWeekPerform:function(t){this.WkintervalWeekPerformVal=t,"WkintervalWeek"===this.radioDay&&(this.dayValue="?",this.weekValue=this.WkintervalWeekStartVal+"/"+this.WkintervalWeekPerformVal)},onIntervalDayPerform:function(t){this.intervalDayPerformVal=t,"intervalDay"===this.radioDay&&(this.dayValue=this.intervalDayStartVal+"/"+this.intervalDayPerformVal)},onIntervalDayStart:function(t){this.intervalDayStartVal=t,"intervalDay"===this.radioDay&&(this.dayValue=this.intervalDayStartVal+"/"+this.intervalDayPerformVal)},onMonthTailBefore:function(t){this.monthTailBeforeVal=t,"monthTailBefore"===this.radioDay&&(this.dayValue="L-"+this.monthTailBeforeVal)},onRecentlyWorkingDaysMonth:function(t){this.recentlyWorkingDaysMonthVal=t,"recentlyWorkingDaysMonth"===this.radioDay&&(this.dayValue=this.recentlyWorkingDaysMonthVal+"W")},onWkmonthNumWeeksDay:function(t){this.WkmonthNumWeeksDayVal=t,this.weekValue=this.WkmonthNumWeeksWeekVal+"#"+this.WkmonthNumWeeksDayVal},everyDayReset:function(){this.dayValue=a.default.cloneDeep(this.everyDayVal)},WkintervalWeekReset:function(){this.weekValue=this.WkintervalWeekStartVal+"/"+this.WkintervalWeekPerformVal},intervalDayReset:function(){this.dayValue=this.intervalDayStartVal+"/"+this.intervalDayPerformVal},WkspecificWeekReset:function(){this.weekValue=this.WkspecificWeekVal.length?this.WkspecificWeekVal.join(","):"*"},specificDayReset:function(){this.dayValue=this.WkspecificDayVal.length?this.WkspecificDayVal.join(","):"*"},monthLastDaysReset:function(){this.dayValue=a.default.cloneDeep(this.monthLastDaysVal)},monthLastWorkingDaysReset:function(){this.dayValue=a.default.cloneDeep(this.monthLastWorkingDays)},monthLastWeeksReset:function(){this.dayValue=a.default.cloneDeep(this.monthLastWeeksVal)},monthTailBeforeReset:function(){this.dayValue="L-"+this.monthTailBeforeVal},recentlyWorkingDaysMonthReset:function(){this.dayValue=this.recentlyWorkingDaysMonthVal+"W"},WkmonthNumReset:function(){this.weekValue=this.WkmonthNumWeeksWeekVal+"#"+this.WkmonthNumWeeksDayVal}},watch:{dayValue:function(t){this.$emit("on-day-value",t)},weekValue:function(t){this.$emit("on-week-value",t)},radioDay:function(t){switch(t){case"everyDay":this.weekValue="?",this.everyDayReset();break;case"WkintervalWeek":this.dayValue="?",this.WkintervalWeekReset();break;case"intervalDay":this.weekValue="?",this.intervalDayReset();break;case"WkspecificWeek":this.dayValue="?",this.WkspecificWeekReset();break;case"specificDay":this.weekValue="?",this.specificDayReset();break;case"monthLastDays":this.weekValue="?",this.monthLastDaysReset();break;case"monthLastWorkingDays":this.weekValue="?",this.monthLastWorkingDaysReset();break;case"monthLastWeeks":this.weekValue="?",this.monthLastWeeksReset();break;case"monthTailBefore":this.weekValue="?",this.monthTailBeforeReset();break;case"recentlyWorkingDaysMonth":this.weekValue="?",this.recentlyWorkingDaysMonthReset();break;case"WkmonthNumWeeks":this.dayValue="?",this.WkmonthNumReset()}},WkintervalWeekStartVal:function(t){"WkintervalWeek"===this.radioDay&&(this.dayValue="?",this.weekValue=t+"/"+this.WkintervalWeekPerformVal)},WkspecificWeekVal:function(t){"WkspecificWeek"===this.radioDay&&(this.dayValue="?",this.weekValue=t.join(","))},WkspecificDayVal:function(t){"specificDay"===this.radioDay&&(this.weekValue="?",this.dayValue=t.join(","))},monthLastWeeksVal:function(t){"monthLastWeeks"===this.radioDay&&(this.weekValue="?",this.dayValue=t)},WkmonthNumWeeksWeekVal:function(t){"WkmonthNumWeeks"===this.radioDay&&(this.dayValue="?",this.weekValue=t+"#"+this.WkmonthNumWeeksDayVal)}},beforeCreate:function(){},created:function(){var t,e=this,n=a.default.cloneDeep(this.dayVal),i=a.default.cloneDeep(this.weekVal),o=-1!==i.indexOf("/"),s=-1!==i.indexOf("#");"*"!==n||"?"!==i?o||s||(0,r.isWeek)(i)?(this.dayValue="?",(0,r.isStr)(i,"/")?(t=(0,r.isStr)(i,"/"),e.WkintervalWeekStartVal=parseInt(t[0]),e.WkintervalWeekPerformVal=parseInt(t[1]),e.dayValue="?",e.weekValue=e.WkintervalWeekPerformVal+"/"+e.WkintervalWeekStartVal,e.radioDay="WkintervalWeek"):(0,r.isStr)(i,"#")?function(){var t=(0,r.isStr)(i,"#");e.WkmonthNumWeeksWeekVal=parseInt(t[0]),e.WkmonthNumWeeksDayVal=parseInt(t[1]),e.radioDay="WkmonthNumWeeks"}():(0,r.isWeek)(i)&&(e.WkspecificWeekVal=i.split(","),e.radioDay="WkspecificWeek")):(this.weekValue="?","*"===n||((0,r.isStr)(n,"/")?function(){var t=(0,r.isStr)(n,"/");e.intervalDayStartVal=parseInt(t[0]),e.intervalDayPerformVal=parseInt(t[1]),e.radioDay="intervalDay"}():"L"===n?e.radioDay="monthLastDays":"LW"===n?e.radioDay="monthLastWorkingDays":"L"===n.charAt(n.length-1)?(e.monthLastWeeksVal=n,e.radioDay="monthLastWeeks"):(0,r.isStr)(n,"-")?function(){var t=(0,r.isStr)(n,"-");e.monthTailBeforeVal=parseInt(t[1]),e.radioDay="monthTailBefore"}():"W"===n.charAt(n.length-1)?(e.recentlyWorkingDaysMonthVal=parseInt(n.slice(0,n.length-1)),e.radioDay="recentlyWorkingDaysMonth"):(e.WkspecificDayVal=n.split(","),e.radioDay="specificDay"))):this.radioDay="everyDay"},beforeMount:function(){},mounted:function(){},beforeUpdate:function(){},updated:function(){},beforeDestroy:function(){},destroyed:function(){},computed:{},components:{mInputNumber:o.default}}},function(t,e){},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(23),i=n.n(a);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);e.default=i.a},function(t,e,n){e.__esModule=!0;var a=s(n(0)),i=s(n(2)),r=n(3),o=s(n(4));function s(t){return t&&t.__esModule?t:{default:t}}e.default={name:"month",mixins:[i.default],data:function(){return{monthValue:"*",radioMonth:"everyMonth",selectMonthList:r.selectList[12],intervalPerformVal:5,intervalStartVal:3,specificMonthVal:[],cycleStartVal:1,cycleEndVal:1}},props:{monthVal:String,value:{type:String,default:"*"}},model:{prop:"value",event:"monthValueEvent"},methods:{onIntervalPerform:function(t){this.intervalPerformVal=t,"intervalMonth"===this.radioMonth&&(this.monthValue=this.intervalStartVal+"/"+this.intervalPerformVal)},onIntervalStart:function(t){this.intervalStartVal=t,"intervalMonth"===this.radioMonth&&(this.monthValue=this.intervalStartVal+"/"+this.intervalPerformVal)},onspecificlMonths:function(t){},onCycleStart:function(t){this.cycleStartVal=t,"cycleMonth"===this.radioMonth&&(this.monthValue=this.cycleStartVal+"-"+this.cycleEndVal)},onCycleEnd:function(t){this.cycleEndVal=t,"cycleMonth"===this.radioMonth&&(this.monthValue=this.cycleStartVal+"-"+this.cycleEndVal)},everyReset:function(){this.monthValue="*"},intervalReset:function(){this.monthValue=this.intervalStartVal+"/"+this.intervalPerformVal},specificReset:function(){this.specificMonthVal.length?this.monthValue=this.specificMonthVal.join(","):this.monthValue="*"},cycleReset:function(){this.monthValue=this.cycleStartVal+"-"+this.cycleEndVal},analyticalValue:function(){var t=this;return new Promise(function(e,n){var i=a.default.cloneDeep(t.value),o=(0,r.isStr)(i,"/"),s=(0,r.isStr)(i,","),l=(0,r.isStr)(i,"-");return"*"===i?(t.radioMonth="everyMonth",void(t.monthValue="*")):1===i.length&&a.default.isInteger(parseInt(i))||2===i.length&&a.default.isInteger(parseInt(i))?(t.radioMonth="specificlMonth",void(t.specificMonthVal=[i])):o?(t.radioMonth="intervalMonth",t.intervalStartVal=parseInt(o[0]),t.intervalPerformVal=parseInt(o[1]),void(t.monthValue=t.intervalStartVal+"/"+t.intervalPerformVal)):s?(t.radioMonth="specificlMonth",void(t.specificMonthVal=s)):l?(t.radioMonth="cycleMonth",t.cycleStartVal=parseInt(l[0]),t.cycleEndVal=parseInt(l[1]),void(t.monthValue=t.cycleStartVal+"/"+t.cycleEndVal)):void e()})}},watch:{monthValue:function(t){this.$emit("monthValueEvent",t)},radioMonth:function(t){switch(t){case"everyMonth":this.everyReset();break;case"intervalMonth":this.intervalReset();break;case"specificlMonth":this.specificReset();break;case"cycleMonth":this.cycleReset()}},specificMonthVal:function(t){this.monthValue=t.join(",")}},beforeCreate:function(){},created:function(){this.analyticalValue().then(function(){})},beforeMount:function(){},mounted:function(){},beforeUpdate:function(){},updated:function(){},beforeDestroy:function(){},destroyed:function(){},computed:{},components:{mInputNumber:o.default}}},function(t,e){},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(26),i=n.n(a);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);e.default=i.a},function(t,e,n){e.__esModule=!0;var a=s(n(0)),i=s(n(2)),r=n(3),o=s(n(4));function s(t){return t&&t.__esModule?t:{default:t}}e.default={name:"year",mixins:[i.default],data:function(){return{yearValue:"*",radioYear:"everyYear",selectYearList:r.selectList.year,intervalPerformVal:1,intervalStartVal:2019,specificYearVal:[],cycleStartVal:2019,cycleEndVal:2019}},props:{yearVal:String,value:{type:String,default:"*"}},model:{prop:"value",event:"yearValueEvent"},methods:{onIntervalPerform:function(t){this.intervalPerformVal=t,"intervalYear"===this.radioYear&&(this.yearValue=this.intervalStartVal+"/"+this.intervalPerformVal)},onIntervalStart:function(t){this.intervalStartVal=t,"intervalYear"===this.radioYear&&(this.yearValue=this.intervalStartVal+"/"+this.intervalPerformVal)},onspecificYears:function(t){},onCycleStart:function(t){this.cycleStartVal=t,"cycleYear"===this.radioYear&&(this.yearValue=this.cycleStartVal+"-"+this.cycleEndVal)},onCycleEnd:function(t){this.cycleEndVal=t,"cycleYear"===this.radioYear&&(this.yearValue=this.cycleStartVal+"-"+this.cycleEndVal)},everyReset:function(){this.yearValue="*"},intervalReset:function(){this.yearValue=this.intervalStartVal+"/"+this.intervalPerformVal},specificReset:function(){this.specificYearVal.length?this.yearValue=this.specificYearVal.join(","):this.yearValue="*"},cycleReset:function(){this.yearValue=this.cycleStartVal+"-"+this.cycleEndVal},analyticalValue:function(){var t=this;return new Promise(function(e,n){var i=a.default.cloneDeep(t.value),o=(0,r.isStr)(i,"/"),s=(0,r.isStr)(i,","),l=(0,r.isStr)(i,"-");return"*"===i?(t.radioYear="everyYear",void(t.yearValue="*")):4===i.length&&a.default.isInteger(parseInt(i))?(t.radioYear="specificYear",void(t.specificYearVal=[i])):o?(t.radioYear="intervalYear",t.intervalStartVal=parseInt(o[0]),t.intervalPerformVal=parseInt(o[1]),void(t.yearValue=t.intervalStartVal+"/"+t.intervalPerformVal)):s?(t.radioYear="specificYear",void(t.specificYearVal=s)):l?(t.radioYear="cycleYear",t.cycleStartVal=parseInt(l[0]),t.cycleEndVal=parseInt(l[1]),void(t.yearValue=t.cycleStartVal+"/"+t.cycleEndVal)):void e()})}},watch:{yearValue:function(t){this.$emit("yearValueEvent",t)},radioYear:function(t){switch(t){case"everyYear":this.everyReset();break;case"intervalYear":this.intervalReset();break;case"specificYear":this.specificReset();break;case"cycleYear":this.cycleReset()}},specificYearVal:function(t){this.yearValue=t.join(",")}},beforeCreate:function(){},created:function(){this.analyticalValue().then(function(){})},beforeMount:function(){},mounted:function(){},beforeUpdate:function(){},updated:function(){},beforeDestroy:function(){},destroyed:function(){},computed:{},components:{mInputNumber:o.default}}},function(t,e){},function(t,e){},function(t,e,n){t.exports=n(30)},function(t,e,n){e.__esModule=!0,e.vCrontab=void 0;var a,i=(a=n(31))&&a.__esModule?a:{default:a};n(66),e.vCrontab=i.default},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(32),i=n(5);for(var r in i)"default"!==r&&function(t){n.d(e,t,function(){return i[t]})}(r);n(65);var o=n(1),s=Object(o.a)(i.default,a.a,a.b,!1,null,null,null);s.options.__file="app.vue",e.default=s.exports},function(t,e,n){var a=n(33);n.d(e,"a",function(){return a.a}),n.d(e,"b",function(){return a.b})},function(t,e,n){n.d(e,"a",function(){return a}),n.d(e,"b",function(){return i});var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"v-crontab"},[n("div",{staticClass:"v-crontab-model"},[n("div",{staticClass:"clearfix v-crontab-tab"},[n("a",{class:"second"===t.tabVal?" active":"",attrs:{href:"javascript:"},on:{click:function(e){t.onTab("second")}}},[n("i",{staticClass:"ans-icon-calendar"}),n("span",[t._v(t._s(t.$t("秒")))])]),t._v(" "),n("a",{class:"minute"===t.tabVal?" active":"",attrs:{href:"javascript:"},on:{click:function(e){t.onTab("minute")}}},[n("i",{staticClass:"ans-icon-calendar"}),n("span",[t._v(t._s(t.$t("分")))])]),t._v(" "),n("a",{class:"hour"===t.tabVal?" active":"",attrs:{href:"javascript:"},on:{click:function(e){t.onTab("hour")}}},[n("i",{staticClass:"ans-icon-calendar"}),n("span",[t._v(t._s(t.$t("时")))])]),t._v(" "),n("a",{class:"day"===t.tabVal?" active":"",attrs:{href:"javascript:"},on:{click:function(e){t.onTab("day")}}},[n("i",{staticClass:"ans-icon-calendar"}),n("span",[t._v(t._s(t.$t("天")))])]),t._v(" "),n("a",{class:"month"===t.tabVal?" active":"",attrs:{href:"javascript:"},on:{click:function(e){t.onTab("month")}}},[n("i",{staticClass:"ans-icon-calendar"}),n("span",[t._v(t._s(t.$t("月")))])]),t._v(" "),n("a",{class:"year"===t.tabVal?" active":"",attrs:{href:"javascript:"},on:{click:function(e){t.onTab("year")}}},[n("i",{staticClass:"ans-icon-calendar"}),n("span",[t._v(t._s(t.$t("年")))])])]),t._v(" "),n("div",{staticClass:"v-crontab-content"},["second"===t.tabVal?[n("m-second",{model:{value:t.secondVal,callback:function(e){t.secondVal=e},expression:"secondVal"}})]:t._e(),t._v(" "),"minute"===t.tabVal?[n("m-minute",{model:{value:t.minuteVal,callback:function(e){t.minuteVal=e},expression:"minuteVal"}})]:t._e(),t._v(" "),"hour"===t.tabVal?[n("m-hour",{model:{value:t.hourVal,callback:function(e){t.hourVal=e},expression:"hourVal"}})]:t._e(),t._v(" "),"day"===t.tabVal?[n("m-day",{attrs:{"day-val":t.dayVal,"week-val":t.weekVal},on:{"on-day-value":t._onDayValue,"on-week-value":t._onWeekValue}})]:t._e(),t._v(" "),"month"===t.tabVal?[n("m-month",{model:{value:t.monthVal,callback:function(e){t.monthVal=e},expression:"monthVal"}})]:t._e(),t._v(" "),"year"===t.tabVal?[n("m-year",{model:{value:t.yearVal,callback:function(e){t.yearVal=e},expression:"yearVal"}})]:t._e()],2)])])},i=[]},function(t,e,n){e.__esModule=!0,e.localeList=s,e.findLocale=function(t){return a.default.find(s(),["code",t])};var a=o(n(0)),i=o(n(35)),r=o(n(36));function o(t){return t&&t.__esModule?t:{default:t}}function s(){return[{code:"zh_CN",name:"中文",locale:i.default},{code:"en_US",name:"English",locale:r.default}]}},function(t,e,n){e.__esModule=!0,e.default={"秒":"秒","分":"分","时":"时","天":"天","月":"月","年":"年","星期一":"星期一","星期二":"星期二","星期三":"星期三","星期四":"星期四","星期五":"星期五","星期六":"星期六","星期天":"星期天","每一秒钟":"每一秒钟","每隔":"每隔","秒执行 从":"秒执行 从","秒开始":"秒开始","具体秒数(可多选)":"具体秒数(可多选)","请选择具体秒数":"请选择具体秒数","周期从":"周期从","到":"到","每一分钟":"每一分钟","分执行 从":"分执行 从","分开始":"分开始","具体分钟数(可多选)":"具体分钟数(可多选)","请选择具体分钟数":"请选择具体分钟数","每一小时":"每一小时","小时执行 从":"小时执行 从","小时开始":"小时开始","具体小时数(可多选)":"具体小时数(可多选)","请选择具体小时数":"请选择具体小时数","每一天":"每一天","周执行 从":"周执行 从","开始":"开始","天执行 从":"天执行 从","天开始":"天开始","具体星期几(可多选)":"具体星期几(可多选)","请选择具体周几":"请选择具体周几","具体天数(可多选)":"具体天数(可多选)","请选择具体天数":"请选择具体天数","在这个月的最后一天":"在这个月的最后一天","在这个月的最后一个工作日":"在这个月的最后一个工作日","在这个月的最后一个":"在这个月的最后一个","在本月底前":"在本月底前","最近的工作日(周一至周五)至本月":"最近的工作日(周一至周五)至本月","在这个月的第":"在这个月的第","每一月":"每一月","月执行 从":"月执行 从","月开始":"月开始","具体月数(可多选)":"具体月数(可多选)","请选择具体月数":"请选择具体月数","每一年":"每一年","年执行 从":"年执行 从","年开始":"年开始","具体年数(可多选)":"具体年数(可多选)","请选择具体年数":"请选择具体年数","小时":"小时","日":"日"}},function(t,e,n){e.__esModule=!0,e.default={"秒":"second","分":"minute","时":"hour","天":"day","月":"month","年":"year","星期一":"Monday","星期二":"Tuesday","星期三":"Wednesday","星期四":"Thursday","星期五":"Friday","星期六":"Saturday","星期天":"Sunday","每一秒钟":"Every second","每隔":"Every","秒执行 从":"second carried out","秒开始":"Start","具体秒数(可多选)":"Specific second(multiple)","请选择具体秒数":"Please enter a specific second","周期从":"Cycle from","到":"to","每一分钟":"Every minute","分执行 从":"minute carried out","分开始":"Start","具体分钟数(可多选)":"Specific minute(multiple)","请选择具体分钟数":"Please enter a specific minute","每一小时":"Every hour","小时执行 从":"hour carried out","小时开始":"Start","具体小时数(可多选)":"Specific hour(multiple)","请选择具体小时数":"Please enter a hour","每一天":"Every day","周执行 从":"week carried out","开始":"Start","天执行 从":"day carried out","天开始":"Start","具体星期几(可多选)":"Specific day of the week(multiple)","请选择具体周几":"Please enter a week","具体天数(可多选)":"Specific days(multiple)","请选择具体天数":"Please enter a days","在这个月的最后一天":"On the last day of the month","在这个月的最后一个工作日":"On the last working day of the month","在这个月的最后一个":"At the last of this month","在本月底前":"Before the end of this month","最近的工作日(周一至周五)至本月":"The most recent business day (Monday to Friday) to this month","在这个月的第":"In this months","每一月":"Every month","月执行 从":"month carried out","月开始":"Start","具体月数(可多选)":"Specific months(multiple)","请选择具体月数":"Please enter a months","每一年":"Every year","年执行 从":"year carried out","年开始":"Start","具体年数(可多选)":"Specific year(multiple)","请选择具体年数":"Please enter a year","小时":"hour","日":"day"}},function(t,e,n){e.__esModule=!0;var a="function"==typeof Symbol&&"symbol"==s(Symbol.iterator)?function(t){return void 0===t?"undefined":s(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":s(t)},i={}.hasOwnProperty,r=/(%|)\{([0-9a-zA-Z_]+)\}/g;e.template=function(t){for(var e=arguments.length,n=Array(e>1?e-1:0),o=1;ot.max-1},on:{click:function(e){t.onIncrease()}}},[n("span",{staticClass:"bt-text"},[t._v("+")])])],1)},i=[]},function(t,e,n){var a=n(11);n.n(a).a},function(t,e,n){var a=n(12);n.n(a).a},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(46),i=n(13);for(var r in i)"default"!==r&&function(t){n.d(e,t,function(){return i[t]})}(r);n(48);var o=n(1),s=Object(o.a)(i.default,a.a,a.b,!1,null,null,null);s.options.__file="minute.vue",e.default=s.exports},function(t,e,n){var a=n(47);n.d(e,"a",function(){return a.a}),n.d(e,"b",function(){return a.b})},function(t,e,n){n.d(e,"a",function(){return a}),n.d(e,"b",function(){return i});var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"minute-model"},[n("div",{staticClass:"v-crontab-from-model"},[n("x-radio-group",{attrs:{vertical:""},model:{value:t.radioMinute,callback:function(e){t.radioMinute=e},expression:"radioMinute"}},[n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"everyMinute"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每一分钟")))])])],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"intervalMinute"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每隔")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:59,"props-value":parseInt(t.intervalPerformVal)},on:{"on-number":t.onIntervalPerform}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("分执行 从")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:59,"props-value":parseInt(t.intervalStartVal)},on:{"on-number":t.onIntervalStart}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("分开始")))])],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"specificMinute"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("具体分钟数(可多选)")))]),t._v(" "),n("x-select",{attrs:{multiple:"",placeholder:t.$t("请选择具体分钟数")},on:{"on-change":t.onspecificMinutes},model:{value:t.specificMinutesVal,callback:function(e){t.specificMinutesVal=e},expression:"specificMinutesVal"}},t._l(t.selectMinuteList,function(t){return n("x-option",{key:t.value,attrs:{value:t.value,label:t.label}})}))],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"cycleMinute"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("周期从")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:59,"props-value":parseInt(t.cycleStartVal)},on:{"on-number":t.onCycleStart}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("到")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:59,"props-value":parseInt(t.cycleEndVal)},on:{"on-number":t.onCycleEnd}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("分")))])],1)],1)])],1)])},i=[]},function(t,e,n){var a=n(15);n.n(a).a},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(50),i=n(16);for(var r in i)"default"!==r&&function(t){n.d(e,t,function(){return i[t]})}(r);n(52);var o=n(1),s=Object(o.a)(i.default,a.a,a.b,!1,null,null,null);s.options.__file="hour.vue",e.default=s.exports},function(t,e,n){var a=n(51);n.d(e,"a",function(){return a.a}),n.d(e,"b",function(){return a.b})},function(t,e,n){n.d(e,"a",function(){return a}),n.d(e,"b",function(){return i});var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"hour-model"},[n("div",{staticClass:"v-crontab-from-model"},[n("x-radio-group",{attrs:{vertical:""},model:{value:t.radioHour,callback:function(e){t.radioHour=e},expression:"radioHour"}},[n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"everyHour"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每一小时")))])])],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"intervalHour"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每隔")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:23,"props-value":parseInt(t.intervalPerformVal)},on:{"on-number":t.onIntervalPerform}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("小时执行 从")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:23,"props-value":parseInt(t.intervalStartVal)},on:{"on-number":t.onIntervalStart}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("小时开始")))])],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"specificHour"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("具体小时数(可多选)")))]),t._v(" "),n("x-select",{attrs:{multiple:"",placeholder:t.$t("请选择具体小时数")},on:{"on-change":t.onspecificHours},model:{value:t.specificHoursVal,callback:function(e){t.specificHoursVal=e},expression:"specificHoursVal"}},t._l(t.selectHourList,function(t){return n("x-option",{key:t.value,attrs:{value:t.value,label:t.label}})}))],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"cycleHour"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("周期从")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:23,"props-value":parseInt(t.cycleStartVal)},on:{"on-number":t.onCycleStart}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("到")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:23,"props-value":parseInt(t.cycleEndVal)},on:{"on-number":t.onCycleEnd}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("小时")))])],1)],1)])],1)])},i=[]},function(t,e,n){var a=n(18);n.n(a).a},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(54),i=n(19);for(var r in i)"default"!==r&&function(t){n.d(e,t,function(){return i[t]})}(r);n(56);var o=n(1),s=Object(o.a)(i.default,a.a,a.b,!1,null,null,null);s.options.__file="day.vue",e.default=s.exports},function(t,e,n){var a=n(55);n.d(e,"a",function(){return a.a}),n.d(e,"b",function(){return a.b})},function(t,e,n){n.d(e,"a",function(){return a}),n.d(e,"b",function(){return i});var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"day-model"},[n("div",{staticClass:"v-crontab-from-model"},[n("x-radio-group",{attrs:{vertical:""},model:{value:t.radioDay,callback:function(e){t.radioDay=e},expression:"radioDay"}},[n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"everyDay"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每一天")))])])],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"WkintervalWeek"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每隔")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:7,"props-value":parseInt(t.WkintervalWeekPerformVal)},on:{"on-number":t.onWkintervalWeekPerform}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("天执行 从")))]),t._v(" "),n("x-select",{staticStyle:{width:"200px"},attrs:{placeholder:t.$t("请选择具体小时数")},model:{value:t.WkintervalWeekStartVal,callback:function(e){t.WkintervalWeekStartVal=e},expression:"WkintervalWeekStartVal"}},t._l(t.selectWeekList,function(t){return n("x-option",{key:t.value,attrs:{value:t.value,label:t.label}})})),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("开始")))])],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"intervalDay"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每隔")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:31,"props-value":parseInt(t.intervalDayPerformVal)},on:{"on-number":t.onIntervalDayPerform}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("天执行 从")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:31,"props-value":parseInt(t.intervalDayStartVal)},on:{"on-number":t.onIntervalDayStart}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("天开始")))])],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"WkspecificWeek"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("具体星期几(可多选)")))]),t._v(" "),n("x-select",{attrs:{multiple:"",placeholder:t.$t("请选择具体周几")},model:{value:t.WkspecificWeekVal,callback:function(e){t.WkspecificWeekVal=e},expression:"WkspecificWeekVal"}},t._l(t.selectSpecificWeekList,function(t){return n("x-option",{key:t.value,attrs:{value:t.value,label:t.label}})}))],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"specificDay"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("具体天数(可多选)")))]),t._v(" "),n("x-select",{attrs:{multiple:"",placeholder:t.$t("请选择具体天数")},model:{value:t.WkspecificDayVal,callback:function(e){t.WkspecificDayVal=e},expression:"WkspecificDayVal"}},t._l(t.selectSpecificDayList,function(t){return n("x-option",{key:t.value,attrs:{value:t.value,label:t.label}})}))],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"monthLastDays"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("在这个月的最后一天")))])])],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"monthLastWorkingDays"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("在这个月的最后一个工作日")))])])],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"monthLastWeeks"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("在这个月的最后一个")))]),t._v(" "),n("x-select",{attrs:{placeholder:t.$t("请选择具体周几")},model:{value:t.monthLastWeeksVal,callback:function(e){t.monthLastWeeksVal=e},expression:"monthLastWeeksVal"}},t._l(t.monthLastWeeksList,function(t){return n("x-option",{key:t.value,attrs:{value:t.value,label:t.label}})}))],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"monthTailBefore"}},[n("m-input-number",{attrs:{min:0,max:31,"props-value":parseInt(t.monthTailBeforeVal)},on:{"on-number":t.onMonthTailBefore}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("在本月底前")))])],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"recentlyWorkingDaysMonth"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("最近的工作日(周一至周五)至本月")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:31,"props-value":parseInt(t.recentlyWorkingDaysMonthVal)},on:{"on-number":t.onRecentlyWorkingDaysMonth}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("日")))])],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"WkmonthNumWeeks"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("在这个月的第")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:31,"props-value":parseInt(t.WkmonthNumWeeksDayVal)},on:{"on-number":t.onWkmonthNumWeeksDay}}),t._v(" "),n("x-select",{staticStyle:{width:"200px"},attrs:{placeholder:t.$t("请选择具体周几")},model:{value:t.WkmonthNumWeeksWeekVal,callback:function(e){t.WkmonthNumWeeksWeekVal=e},expression:"WkmonthNumWeeksWeekVal"}},t._l(t.WkmonthNumWeeksWeekList,function(t){return n("x-option",{key:t.value,attrs:{value:t.value,label:t.label}})}))],1)],1)])],1)])},i=[]},function(t,e,n){var a=n(21);n.n(a).a},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(58),i=n(22);for(var r in i)"default"!==r&&function(t){n.d(e,t,function(){return i[t]})}(r);n(60);var o=n(1),s=Object(o.a)(i.default,a.a,a.b,!1,null,null,null);s.options.__file="month.vue",e.default=s.exports},function(t,e,n){var a=n(59);n.d(e,"a",function(){return a.a}),n.d(e,"b",function(){return a.b})},function(t,e,n){n.d(e,"a",function(){return a}),n.d(e,"b",function(){return i});var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"month-model"},[n("div",{staticClass:"v-crontab-from-model"},[n("x-radio-group",{attrs:{vertical:""},model:{value:t.radioMonth,callback:function(e){t.radioMonth=e},expression:"radioMonth"}},[n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"everyMonth"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每一月")))])])],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"intervalMonth"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每隔")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:12,"props-value":parseInt(t.intervalPerformVal)},on:{"on-number":t.onIntervalPerform}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("月执行 从")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:12,"props-value":parseInt(t.intervalStartVal)},on:{"on-number":t.onIntervalStart}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("月开始")))])],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"specificlMonth"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("具体月数(可多选)")))]),t._v(" "),n("x-select",{attrs:{multiple:"",placeholder:t.$t("请选择具体月数")},on:{"on-change":t.onspecificlMonths},model:{value:t.specificMonthVal,callback:function(e){t.specificMonthVal=e},expression:"specificMonthVal"}},t._l(t.selectMonthList,function(t){return n("x-option",{key:t.value,attrs:{value:t.value,label:t.label}})}))],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"cycleMonth"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("周期从")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:12,"props-value":parseInt(t.cycleStartVal)},on:{"on-number":t.onCycleStart}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("到")))]),t._v(" "),n("m-input-number",{attrs:{min:0,max:12,"props-value":parseInt(t.cycleEndVal)},on:{"on-number":t.onCycleEnd}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("月")))])],1)],1)])],1)])},i=[]},function(t,e,n){var a=n(24);n.n(a).a},function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0});var a=n(62),i=n(25);for(var r in i)"default"!==r&&function(t){n.d(e,t,function(){return i[t]})}(r);n(64);var o=n(1),s=Object(o.a)(i.default,a.a,a.b,!1,null,null,null);s.options.__file="year.vue",e.default=s.exports},function(t,e,n){var a=n(63);n.d(e,"a",function(){return a.a}),n.d(e,"b",function(){return a.b})},function(t,e,n){n.d(e,"a",function(){return a}),n.d(e,"b",function(){return i});var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"year-model"},[n("div",{staticClass:"v-crontab-from-model"},[n("x-radio-group",{attrs:{vertical:""},model:{value:t.radioYear,callback:function(e){t.radioYear=e},expression:"radioYear"}},[n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"everyYear"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每一年")))])])],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"intervalYear"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("每隔")))]),t._v(" "),n("m-input-number",{attrs:{min:2019,max:2030,"props-value":parseInt(t.intervalPerformVal)},on:{"on-number":t.onIntervalPerform}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("年执行 从")))]),t._v(" "),n("m-input-number",{attrs:{min:2019,max:2030,"props-value":parseInt(t.intervalStartVal)},on:{"on-number":t.onIntervalStart}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("年开始")))])],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"specificYear"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("具体年数(可多选)")))]),t._v(" "),n("x-select",{attrs:{multiple:"",placeholder:t.$t("请选择具体年数")},on:{"on-change":t.onspecificYears},model:{value:t.specificYearVal,callback:function(e){t.specificYearVal=e},expression:"specificYearVal"}},t._l(t.selectYearList,function(t){return n("x-option",{key:t.value,attrs:{value:t.value,label:t.label}})}))],1)],1),t._v(" "),n("div",{staticClass:"list-box"},[n("x-radio",{attrs:{label:"cycleYear"}},[n("span",{staticClass:"text"},[t._v(t._s(t.$t("周期从")))]),t._v(" "),n("m-input-number",{attrs:{min:2019,max:2030,"props-value":parseInt(t.cycleStartVal)},on:{"on-number":t.onCycleStart}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("到")))]),t._v(" "),n("m-input-number",{attrs:{min:2019,max:2030,"props-value":parseInt(t.cycleEndVal)},on:{"on-number":t.onCycleEnd}}),t._v(" "),n("span",{staticClass:"text"},[t._v(t._s(t.$t("年")))])],1)],1)])],1)])},i=[]},function(t,e,n){var a=n(27);n.n(a).a},function(t,e,n){var a=n(28);n.n(a).a},function(t,e){}])},"object"==s(e)&&"object"==s(t)?t.exports=o(n(28)):(i=[n(28)],void 0===(r="function"==typeof(a=o)?a.apply(e,i):a)||(t.exports=r))}).call(e,n(92)(t))},function(t,e,n){"use strict";var a={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"timing-process-model"},[n("div",{staticClass:"title-box"},[n("span",[t._v(t._s(t.$t("定时前请先设置参数")))])]),t._v(" "),n("div",{staticClass:"clearfix list"},[n("div",{staticClass:"text"},[t._v("\n "+t._s(t.$t("起止时间"))+"\n ")]),t._v(" "),n("div",{staticClass:"cont"},[n("x-datepicker",{staticStyle:{width:"300px"},attrs:{"panel-num":2,placement:"bottom-start",value:t.scheduleTime,type:"daterange",placeholder:t.$t("选择日期区间"),format:"YYYY-MM-DD HH:mm:ss"},on:{"on-change":t._datepicker}})],1)]),t._v(" "),n("div",{staticClass:"clearfix list"},[n("div",{staticClass:"text"},[t._v("\n "+t._s(t.$t("定时"))+"\n ")]),t._v(" "),n("div",{staticClass:"cont"},[[n("x-poptip",{ref:"poptip",attrs:{placement:"bottom-start"}},[n("div",{staticClass:"crontab-box"},[n("v-crontab",{attrs:{locale:t.i18n},model:{value:t.crontab,callback:function(e){t.crontab=e},expression:"crontab"}})],1),t._v(" "),n("template",{slot:"reference"},[n("x-input",{staticStyle:{width:"300px"},attrs:{type:"text",readonly:"",value:t.crontab,autocomplete:"off"}})],1)],2)]],2)]),t._v(" "),n("div",{staticClass:"clearfix list"},[n("div",{staticClass:"text"},[t._v("\n "+t._s(t.$t("失败策略"))+"\n ")]),t._v(" "),n("div",{staticClass:"cont"},[n("x-radio-group",{staticStyle:{"margin-top":"7px"},model:{value:t.failureStrategy,callback:function(e){t.failureStrategy=e},expression:"failureStrategy"}},[n("x-radio",{attrs:{label:"CONTINUE"}},[t._v(t._s(t.$t("继续")))]),t._v(" "),n("x-radio",{attrs:{label:"END"}},[t._v(t._s(t.$t("结束")))])],1)],1)]),t._v(" "),n("div",{staticClass:"clearfix list"},[n("div",{staticClass:"text"},[t._v("\n "+t._s(t.$t("通知策略"))+"\n ")]),t._v(" "),n("div",{staticClass:"cont"},[n("x-select",{staticStyle:{width:"200px"},model:{value:t.warningType,callback:function(e){t.warningType=e},expression:"warningType"}},t._l(t.warningTypeList,function(t){return n("x-option",{key:t.id,attrs:{value:t.id,label:t.code}})}),1)],1)]),t._v(" "),n("div",{staticClass:"clearfix list"},[n("div",{staticClass:"text"},[t._v("\n "+t._s(t.$t("流程优先级"))+"\n ")]),t._v(" "),n("div",{staticClass:"cont"},[n("m-priority",{model:{value:t.processInstancePriority,callback:function(e){t.processInstancePriority=e},expression:"processInstancePriority"}})],1)]),t._v(" "),n("div",{staticClass:"clearfix list"},[n("div",{staticClass:"text"},[t._v("\n "+t._s(t.$t("通知组"))+"\n ")]),t._v(" "),n("div",{staticClass:"cont"},[n("x-select",{staticStyle:{width:"200px"},attrs:{disabled:!t.notifyGroupList.length},scopedSlots:t._u([{key:"trigger",fn:function(e){var a=e.selectedModel;return n("x-input",{staticStyle:{width:"200px"},attrs:{readonly:"",placeholder:t.$t("请选择通知组"),value:a?a.label:""},on:{"on-click-icon":function(e){e.stopPropagation(),t.warningGroupId={}}}},[n("i",{directives:[{name:"show",rawName:"v-show",value:t.warningGroupId.id,expression:"warningGroupId.id"}],staticClass:"fa fa-times-circle",staticStyle:{"font-size":"15px",cursor:"pointer"},attrs:{slot:"suffix"},slot:"suffix"}),t._v(" "),n("i",{directives:[{name:"show",rawName:"v-show",value:!t.warningGroupId.id,expression:"!warningGroupId.id"}],staticClass:"ans-icon-arrow-down",staticStyle:{"font-size":"12px"},attrs:{slot:"suffix"},slot:"suffix"})])}}]),model:{value:t.warningGroupId,callback:function(e){t.warningGroupId=e},expression:"warningGroupId"}},[t._v(" "),t._l(t.notifyGroupList,function(t){return n("x-option",{key:t.id,attrs:{value:t,label:t.code}})})],2)],1)]),t._v(" "),n("div",{staticClass:"clearfix list"},[n("div",{staticClass:"text"},[t._v("\n "+t._s(t.$t("收件人"))+"\n ")]),t._v(" "),n("div",{staticClass:"cont",staticStyle:{width:"680px"}},[n("m-email",{attrs:{"repeat-data":t.receiversCc},model:{value:t.receivers,callback:function(e){t.receivers=e},expression:"receivers"}})],1)]),t._v(" "),n("div",{staticClass:"clearfix list"},[n("div",{staticClass:"text"},[t._v("\n "+t._s(t.$t("抄送人"))+"\n ")]),t._v(" "),n("div",{staticClass:"cont",staticStyle:{width:"680px"}},[n("m-email",{attrs:{"repeat-data":t.receivers},model:{value:t.receiversCc,callback:function(e){t.receiversCc=e},expression:"receiversCc"}})],1)]),t._v(" "),n("div",{staticClass:"submit"},[n("x-button",{attrs:{type:"text"},on:{click:function(e){return t.close()}}},[t._v(" "+t._s(t.$t("取消"))+" ")]),t._v(" "),n("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"primary",shape:"circle",loading:t.spinnerLoading},on:{click:function(e){return t.ok()}}},[t._v(t._s(t.spinnerLoading?"Loading...":t.item.crontab?t.$t("编辑"):t.$t("创建"))+" ")])],1)])},staticRenderFns:[]};e.a=a},,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";e.__esModule=!0;var a=p(n(28)),i=n(123),r=p(n(1100)),o=p(n(646)),s=p(n(226)),l=n(802),c=p(n(663)),u=p(n(670)),f=p(n(654)),d=p(n(650));function p(t){return t&&t.__esModule?t:{default:t}}e.default={name:"definition-list-index",data:function(){return{total:null,processListP:[],isLoading:!0,searchParams:{pageSize:10,pageNo:1,searchVal:""}}},props:{},methods:Object.assign({},(0,i.mapActions)("dag",["getProcessListP"]),{_page:function(t){this.searchParams.pageNo=t,(0,l.setUrlParams)({pageNo:this.searchParams.pageNo}),this._debounceGET()},_onConditions:function(t){this.searchParams.searchVal=t.searchVal,this.searchParams.pageNo=1,(0,l.setUrlParams)({pageNo:this.searchParams.pageNo}),this._debounceGET()},_getProcessListP:function(t){var e=this;this.isLoading=!t,this.getProcessListP({pageSize:this.searchParams.pageSize,pageNo:this.searchParams.pageNo,searchVal:this.searchParams.searchVal,userId:this.$route.query.userId||""}).then(function(t){(0,l.setUrlParams)({pageNo:e.pageNo}),e.processListP=[],e.processListP=t.totalList,e.total=t.total,e.isLoading=!1}).catch(function(t){e.isLoading=!1})},_onUpdate:function(){this._debounceGET("false")},_debounceGET:a.default.debounce(function(t){this._getProcessListP(t)},100,{leading:!1,trailing:!0})}),watch:{$route:function(t){a.default.isEmpty(t.query)?this.searchParams.pageNo=1:this.searchParams.pageNo=t.query.pageNo||1},searchParams:{deep:!0,handler:function(){this._debounceGET()}}},created:function(){s.default.removeItem("subProcessId"),a.default.isEmpty(this.$route.query)||(this.searchParams=a.default.assign(this.searchParams,this.$route.query))},mounted:function(){this._debounceGET()},components:{mList:r.default,mConditions:u.default,mSpin:o.default,mListConstruction:d.default,mSecondaryMenu:f.default,mNoData:c.default}}},function(t,e,n){"use strict";e.__esModule=!0;var a=l(n(28)),i=l(n(798)),r=l(n(993)),o=n(123);n(668);var s=n(225);function l(t){return t&&t.__esModule?t:{default:t}}e.default={name:"definition-list",data:function(){return{list:[]}},props:{processList:Array,pageNo:Number,pageSize:Number},methods:Object.assign({},(0,o.mapActions)("dag",["editProcessState","getStartCheck","getReceiver"]),{_rtPublishStatus:function(t){return a.default.filter(s.publishStatus,function(e){return e.code===t})[0].desc},_treeView:function(t){this.$router.push({path:"/projects/definition/tree/"+t.id})},_start:function(t){var e=this;this.getStartCheck({processDefinitionId:t.id}).then(function(n){var a=e,r=e.$modal.dialog({closable:!1,showMask:!0,escClose:!0,className:"v-modal-custom",transitionName:"opacityp",render:function(e){return e(i.default,{on:{onUpdate:function(){a._onUpdate(),r.remove()},close:function(){r.remove()}},props:{item:t}})}})}).catch(function(t){e.$message.error(t.msg||"")})},_getReceiver:function(t){var e=this;return new Promise(function(n,a){e.getReceiver({processDefinitionId:t}).then(function(t){n({receivers:t.receivers&&t.receivers.split(",")||[],receiversCc:t.receiversCc&&t.receiversCc.split(",")||[]})})})},_timing:function(t){var e=this,n=this;this._getReceiver(t.id).then(function(a){var i=e.$modal.dialog({closable:!1,showMask:!0,escClose:!0,className:"v-modal-custom",transitionName:"opacityp",render:function(e){return e(r.default,{on:{onUpdate:function(){n._onUpdate(),i.remove()},close:function(){i.remove()}},props:{item:t,receiversD:a.receivers,receiversCcD:a.receiversCc}})}})})},_timingManage:function(t){this.$router.push({path:"/projects/definition/list/timing/"+t.id})},_edit:function(t){this.$router.push({path:"/projects/definition/list/"+t.id})},_downline:function(t){this._upProcessState({processId:t.id,releaseState:0})},_poponline:function(t){this._upProcessState({processId:t.id,releaseState:1})},_upProcessState:function(t){var e=this;this.editProcessState(t).then(function(t){e.$message.success(t.msg),$("body").find(".tooltip.fade.top.in").remove(),e._onUpdate()}).catch(function(t){e.$message.error(t.msg||"")})},_onUpdate:function(){this.$emit("on-update")}}),watch:{processList:function(t){var e=this;this.list=[],setTimeout(function(){e.list=t})}},created:function(){},mounted:function(){this.list=this.processList},components:{}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){var a=n(1099);"string"==typeof a&&(a=[[t.i,a,""]]),a.locals&&(t.exports=a.locals);n(35)("733e1347",a,!0,{})},function(t,e,n){(t.exports=n(34)(!1)).push([t.i,"",""])},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(1022),i=n.n(a);for(var r in a)"default"!==r&&function(t){n.d(e,t,function(){return a[t]})}(r);var o=n(1101),s=n(27)(i.a,o.a,!1,null,null,null);e.default=s.exports},function(t,e,n){"use strict";var a={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"list-model"},[n("div",{staticClass:"table-box"},[n("table",{staticClass:"fixed"},[n("tr",[n("th",[n("span",[t._v(t._s(t.$t("编号")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("工作流名称")))])]),t._v(" "),n("th",{attrs:{width:"50"}},[n("span",[t._v(t._s(t.$t("状态")))])]),t._v(" "),n("th",{attrs:{width:"140"}},[n("span",[t._v(t._s(t.$t("创建时间")))])]),t._v(" "),n("th",{attrs:{width:"140"}},[n("span",[t._v(t._s(t.$t("更新时间")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("描述")))])]),t._v(" "),n("th",{attrs:{width:"90"}},[n("span",[t._v(t._s(t.$t("定时状态")))])]),t._v(" "),n("th",{attrs:{width:"220"}},[n("span",[t._v(t._s(t.$t("操作")))])])]),t._v(" "),t._l(t.list,function(e,a){return n("tr",{key:e.id},[n("td",[n("span",[t._v(t._s(parseInt(1===t.pageNo?a+1:a+1+t.pageSize*(t.pageNo-1))))])]),t._v(" "),n("td",[n("span",{staticClass:"ellipsis"},[n("router-link",{staticClass:"links",attrs:{to:{path:"/projects/definition/list/"+e.id},tag:"a"}},[t._v("\n "+t._s(e.name)+"\n ")])],1)]),t._v(" "),n("td",[n("span",[t._v(t._s(t._rtPublishStatus(e.releaseState)))])]),t._v(" "),n("td",[e.createTime?n("span",[t._v(t._s(t._f("formatDate")(e.createTime)))]):t._e(),t._v(" "),e.createTime?t._e():n("span",[t._v("-")])]),t._v(" "),n("td",[n("span",[t._v(t._s(t._f("formatDate")(e.updateTime)))])]),t._v(" "),n("td",[n("span",{staticClass:"ellipsis"},[t._v(t._s(e.desc))])]),t._v(" "),n("td",["OFFLINE"===e.scheduleReleaseState?n("span",[t._v(t._s(t.$t("下线")))]):t._e(),t._v(" "),"ONLINE"===e.scheduleReleaseState?n("span",[t._v(t._s(t.$t("上线")))]):t._e(),t._v(" "),e.scheduleReleaseState?t._e():n("span",[t._v("-")])]),t._v(" "),n("td",[n("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"info",shape:"circle",size:"xsmall","data-toggle":"tooltip",title:t.$t("编辑"),disabled:"ONLINE"===e.releaseState,icon:"iconfont icon-bianji"},on:{click:function(n){return t._edit(e)}}}),t._v(" "),n("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"success",shape:"circle",size:"xsmall","data-toggle":"tooltip",title:t.$t("启动"),disabled:"ONLINE"!==e.releaseState,icon:"iconfont icon-qidong"},on:{click:function(n){return t._start(e)}}}),t._v(" "),n("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"info",shape:"circle",size:"xsmall","data-toggle":"tooltip",title:t.$t("定时"),disabled:"ONLINE"!==e.releaseState||null!==e.scheduleReleaseState,icon:"iconfont icon-timer"},on:{click:function(n){return t._timing(e)}}}),t._v(" "),"ONLINE"===e.releaseState?n("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"error",shape:"circle",size:"xsmall","data-toggle":"tooltip",title:t.$t("下线"),icon:"iconfont icon-erji-xiaxianjilu"},on:{click:function(n){return t._downline(e)}}}):t._e(),t._v(" "),"OFFLINE"===e.releaseState?n("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"warning",shape:"circle",size:"xsmall","data-toggle":"tooltip",title:t.$t("上线"),icon:"iconfont icon-erji-xiaxianjilu-copy"},on:{click:function(n){return t._poponline(e)}}}):t._e(),t._v(" "),n("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"info",shape:"circle",size:"xsmall","data-toggle":"tooltip",title:t.$t("定时管理"),disabled:"ONLINE"!==e.releaseState,icon:"iconfont icon-paibanguanli"},on:{click:function(n){return t._timingManage(e)}}}),t._v(" "),n("x-button",{attrs:{type:"info",shape:"circle",size:"xsmall","data-toggle":"tooltip",title:t.$t("树形图"),icon:"iconfont icon-juxingkaobei"},on:{click:function(n){return t._treeView(e)}}})],1)])})],2)])])},staticRenderFns:[]};e.a=a},function(t,e,n){"use strict";var a={render:function(){var t=this,e=this,n=e.$createElement,a=e._self._c||n;return a("div",{staticClass:"main-layout-box"},[a("m-secondary-menu",{attrs:{type:"projects"}}),e._v(" "),a("m-list-construction",{attrs:{title:e.$t("工作流定义")}},[a("template",{slot:"conditions"},[a("m-conditions",{on:{"on-conditions":e._onConditions}},[a("template",{slot:"button-group"},[a("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"ghost",size:"small"},on:{click:function(){return t.$router.push({name:"definition-create"})}}},[e._v(e._s(e.$t("创建工作流")))])],1)],2)],1),e._v(" "),a("template",{slot:"content"},[e.processListP.length?[a("m-list",{attrs:{"process-list":e.processListP,"page-no":e.searchParams.pageNo,"page-size":e.searchParams.pageSize},on:{"on-update":e._onUpdate}}),e._v(" "),a("div",{staticClass:"page-box"},[a("x-page",{attrs:{current:parseInt(e.searchParams.pageNo),total:e.total,"show-elevator":""},on:{"on-change":e._page}})],1)]:e._e(),e._v(" "),e.processListP.length?e._e():[a("m-no-data")],e._v(" "),a("m-spin",{attrs:{"is-spin":e.isLoading}})],2)],2)],1)},staticRenderFns:[]};e.a=a}])); +//# sourceMappingURL=0.8ca091c.js.map \ No newline at end of file diff --git a/escheduler-ui/dist/js/0.738a8a5.js.map b/escheduler-ui/dist/js/0.8ca091c.js.map similarity index 99% rename from escheduler-ui/dist/js/0.738a8a5.js.map rename to escheduler-ui/dist/js/0.8ca091c.js.map index d82b52c70d..2aa465e5cc 100644 --- a/escheduler-ui/dist/js/0.738a8a5.js.map +++ b/escheduler-ui/dist/js/0.8ca091c.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///./src/js/conf/home/pages/projects/pages/definition/pages/list/index.vue","webpack:///src/js/module/components/spin/spin.vue","webpack:///src/js/module/components/listConstruction/listConstruction.vue","webpack:///src/js/module/components/secondaryMenu/secondaryMenu.vue","webpack:///./src/js/module/mixin/disabledState.js","webpack:///src/js/module/components/noData/noData.vue","webpack:///./node_modules/dayjs/dayjs.min.js","webpack:///./src/js/module/components/spin/spin.vue","webpack:///./src/js/module/components/spin/spin.vue?542d","webpack:///./src/js/module/components/spin/spin.vue?9371","webpack:///./src/js/module/components/spin/spin.vue?87eb","webpack:///./src/js/module/components/listConstruction/listConstruction.vue","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?b527","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?50be","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?6117","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?c652","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?7693","webpack:///./src/js/module/components/secondaryMenu/close.png","webpack:///./src/js/module/components/secondaryMenu/open.png","webpack:///./src/js/module/components/secondaryMenu/menu.js","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?048e","webpack:///./src/js/module/filter/filter.js","webpack:///src/js/module/components/conditions/conditions.vue","webpack:///./src/js/module/components/noData/noData.vue","webpack:///./src/js/module/components/noData/noData.vue?93a9","webpack:///./src/js/module/components/noData/noData.vue?86e8","webpack:///./src/js/module/components/noData/noData.vue?5a51","webpack:///./src/js/module/components/noData/images/errorTip.png","webpack:///./src/js/module/filter/formatDate.js","webpack:///./node_modules/lodash/_root.js","webpack:///./src/js/module/components/conditions/conditions.vue","webpack:///./src/js/module/components/conditions/conditions.vue?8ed7","webpack:///./node_modules/lodash/isObjectLike.js","webpack:///./node_modules/lodash/isObject.js","webpack:///./node_modules/lodash/_getNative.js","webpack:///./node_modules/lodash/isArray.js","webpack:///./node_modules/lodash/_baseGetTag.js","webpack:///./node_modules/lodash/_Symbol.js","webpack:///./node_modules/lodash/eq.js","webpack:///./node_modules/lodash/_copyObject.js","webpack:///./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/util.js","webpack:///src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue","webpack:///src/js/module/components/priority/priority.vue","webpack:///./node_modules/lodash/keys.js","webpack:///./node_modules/lodash/isBuffer.js","webpack:///./node_modules/lodash/_baseUnary.js","webpack:///./node_modules/lodash/isArrayLike.js","webpack:///./node_modules/lodash/isFunction.js","webpack:///./node_modules/lodash/_nativeCreate.js","webpack:///./node_modules/lodash/_ListCache.js","webpack:///./node_modules/lodash/_assocIndexOf.js","webpack:///./node_modules/lodash/_getMapData.js","webpack:///./node_modules/lodash/keysIn.js","webpack:///./node_modules/lodash/_getTag.js","webpack:///./src/js/module/components/priority/priority.vue","webpack:///src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue","webpack:///./node_modules/lodash/isArguments.js","webpack:///./node_modules/lodash/isTypedArray.js","webpack:///./node_modules/lodash/_nodeUtil.js","webpack:///./node_modules/lodash/_isPrototype.js","webpack:///./node_modules/lodash/_arrayPush.js","webpack:///./node_modules/lodash/_baseRest.js","webpack:///./node_modules/lodash/_SetCache.js","webpack:///./node_modules/lodash/_Map.js","webpack:///./node_modules/lodash/_cacheHas.js","webpack:///./node_modules/lodash/_setToArray.js","webpack:///./node_modules/lodash/isArrayLikeObject.js","webpack:///./node_modules/lodash/mergeWith.js","webpack:///./node_modules/lodash/_Stack.js","webpack:///./node_modules/lodash/_baseAssignValue.js","webpack:///./node_modules/lodash/_cloneArrayBuffer.js","webpack:///./node_modules/lodash/_getPrototype.js","webpack:///./node_modules/lodash/differenceWith.js","webpack:///./node_modules/lodash/_getSymbols.js","webpack:///./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue","webpack:///./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue?56df","webpack:///./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue?a332","webpack:///./src/lib/localData/email.js","webpack:///./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue?1e68","webpack:///./src/js/module/components/priority/priority.vue?4252","webpack:///./src/js/module/components/priority/priority.vue?ffb9","webpack:///./src/js/module/components/priority/priority.vue?cd09","webpack:///./node_modules/lodash/_arrayMap.js","webpack:///./node_modules/lodash/_arrayLikeKeys.js","webpack:///./node_modules/lodash/_freeGlobal.js","webpack:///./node_modules/lodash/_isIndex.js","webpack:///./node_modules/lodash/isLength.js","webpack:///./node_modules/lodash/_overArg.js","webpack:///./node_modules/lodash/unionWith.js","webpack:///./node_modules/lodash/_baseFlatten.js","webpack:///./node_modules/lodash/identity.js","webpack:///./node_modules/lodash/_defineProperty.js","webpack:///./node_modules/lodash/_toSource.js","webpack:///./node_modules/lodash/_MapCache.js","webpack:///./node_modules/lodash/_arrayIncludes.js","webpack:///./node_modules/lodash/_arrayIncludesWith.js","webpack:///./node_modules/lodash/_Set.js","webpack:///./node_modules/lodash/last.js","webpack:///./node_modules/lodash/_assignMergeValue.js","webpack:///./node_modules/lodash/_cloneBuffer.js","webpack:///./node_modules/lodash/_cloneTypedArray.js","webpack:///./node_modules/lodash/_Uint8Array.js","webpack:///./node_modules/lodash/_copyArray.js","webpack:///./node_modules/lodash/_initCloneObject.js","webpack:///./node_modules/lodash/isPlainObject.js","webpack:///./node_modules/lodash/_safeGet.js","webpack:///./node_modules/lodash/_assignValue.js","webpack:///./node_modules/lodash/stubArray.js","webpack:///./node_modules/lodash/_getSymbolsIn.js","webpack:///./node_modules/lodash/_getAllKeys.js","webpack:///./node_modules/lodash/_baseGetAllKeys.js","webpack:///./node_modules/lodash/_equalArrays.js","webpack:///./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue","webpack:///./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue?9af2","webpack:///./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue?3cff","webpack:///./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue?ea4b","webpack:///./src/js/module/util/routerUtil.js","webpack:///src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue","webpack:///(webpack)-merge/lib/index.js","webpack:///./node_modules/lodash/values.js","webpack:///./node_modules/lodash/_baseValues.js","webpack:///./node_modules/lodash/_baseTimes.js","webpack:///./node_modules/lodash/_baseIsArguments.js","webpack:///./node_modules/lodash/_getRawTag.js","webpack:///./node_modules/lodash/_objectToString.js","webpack:///./node_modules/lodash/stubFalse.js","webpack:///./node_modules/lodash/_baseIsTypedArray.js","webpack:///./node_modules/lodash/_baseKeys.js","webpack:///./node_modules/lodash/_nativeKeys.js","webpack:///./node_modules/lodash/_isFlattenable.js","webpack:///./node_modules/lodash/_overRest.js","webpack:///./node_modules/lodash/_apply.js","webpack:///./node_modules/lodash/_setToString.js","webpack:///./node_modules/lodash/_baseSetToString.js","webpack:///./node_modules/lodash/constant.js","webpack:///./node_modules/lodash/_baseIsNative.js","webpack:///./node_modules/lodash/_isMasked.js","webpack:///./node_modules/lodash/_coreJsData.js","webpack:///./node_modules/lodash/_getValue.js","webpack:///./node_modules/lodash/_shortOut.js","webpack:///./node_modules/lodash/_baseUniq.js","webpack:///./node_modules/lodash/_mapCacheClear.js","webpack:///./node_modules/lodash/_Hash.js","webpack:///./node_modules/lodash/_hashClear.js","webpack:///./node_modules/lodash/_hashDelete.js","webpack:///./node_modules/lodash/_hashGet.js","webpack:///./node_modules/lodash/_hashHas.js","webpack:///./node_modules/lodash/_hashSet.js","webpack:///./node_modules/lodash/_listCacheClear.js","webpack:///./node_modules/lodash/_listCacheDelete.js","webpack:///./node_modules/lodash/_listCacheGet.js","webpack:///./node_modules/lodash/_listCacheHas.js","webpack:///./node_modules/lodash/_listCacheSet.js","webpack:///./node_modules/lodash/_mapCacheDelete.js","webpack:///./node_modules/lodash/_isKeyable.js","webpack:///./node_modules/lodash/_mapCacheGet.js","webpack:///./node_modules/lodash/_mapCacheHas.js","webpack:///./node_modules/lodash/_mapCacheSet.js","webpack:///./node_modules/lodash/_setCacheAdd.js","webpack:///./node_modules/lodash/_setCacheHas.js","webpack:///./node_modules/lodash/_baseIndexOf.js","webpack:///./node_modules/lodash/_baseFindIndex.js","webpack:///./node_modules/lodash/_baseIsNaN.js","webpack:///./node_modules/lodash/_strictIndexOf.js","webpack:///./node_modules/lodash/_createSet.js","webpack:///./node_modules/lodash/noop.js","webpack:///./node_modules/lodash/_baseMerge.js","webpack:///./node_modules/lodash/_stackClear.js","webpack:///./node_modules/lodash/_stackDelete.js","webpack:///./node_modules/lodash/_stackGet.js","webpack:///./node_modules/lodash/_stackHas.js","webpack:///./node_modules/lodash/_stackSet.js","webpack:///./node_modules/lodash/_baseFor.js","webpack:///./node_modules/lodash/_createBaseFor.js","webpack:///./node_modules/lodash/_baseMergeDeep.js","webpack:///./node_modules/lodash/_baseCreate.js","webpack:///./node_modules/lodash/toPlainObject.js","webpack:///./node_modules/lodash/_baseKeysIn.js","webpack:///./node_modules/lodash/_nativeKeysIn.js","webpack:///./node_modules/lodash/_createAssigner.js","webpack:///./node_modules/lodash/_isIterateeCall.js","webpack:///./node_modules/lodash/_baseDifference.js","webpack:///(webpack)-merge/lib/join-arrays.js","webpack:///./node_modules/lodash/cloneDeep.js","webpack:///./node_modules/lodash/_baseClone.js","webpack:///./node_modules/lodash/_arrayEach.js","webpack:///./node_modules/lodash/_baseAssign.js","webpack:///./node_modules/lodash/_baseAssignIn.js","webpack:///./node_modules/lodash/_copySymbols.js","webpack:///./node_modules/lodash/_arrayFilter.js","webpack:///./node_modules/lodash/_copySymbolsIn.js","webpack:///./node_modules/lodash/_getAllKeysIn.js","webpack:///./node_modules/lodash/_DataView.js","webpack:///./node_modules/lodash/_Promise.js","webpack:///./node_modules/lodash/_WeakMap.js","webpack:///./node_modules/lodash/_initCloneArray.js","webpack:///./node_modules/lodash/_initCloneByTag.js","webpack:///./node_modules/lodash/_cloneDataView.js","webpack:///./node_modules/lodash/_cloneRegExp.js","webpack:///./node_modules/lodash/_cloneSymbol.js","webpack:///./node_modules/lodash/isMap.js","webpack:///./node_modules/lodash/_baseIsMap.js","webpack:///./node_modules/lodash/isSet.js","webpack:///./node_modules/lodash/_baseIsSet.js","webpack:///(webpack)-merge/lib/join-arrays-smart.js","webpack:///./node_modules/lodash/isEqual.js","webpack:///./node_modules/lodash/_baseIsEqual.js","webpack:///./node_modules/lodash/_baseIsEqualDeep.js","webpack:///./node_modules/lodash/_arraySome.js","webpack:///./node_modules/lodash/_equalByTag.js","webpack:///./node_modules/lodash/_mapToArray.js","webpack:///./node_modules/lodash/_equalObjects.js","webpack:///(webpack)-merge/lib/unique.js","webpack:///./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue","webpack:///./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue?77cc","webpack:///./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue?c304","webpack:///./src/lib/@vue/crontab/dist/index.js","webpack:///./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue?1665","webpack:///src/js/conf/home/pages/projects/pages/definition/pages/list/index.vue","webpack:///src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue","webpack:///./src/js/conf/home/pages/projects/pages/definition/pages/list/index.vue?487e","webpack:///./src/js/conf/home/pages/projects/pages/definition/pages/list/index.vue?eef0","webpack:///./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue","webpack:///./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue?c2e4","webpack:///./src/js/conf/home/pages/projects/pages/definition/pages/list/index.vue?239c"],"names":["Object","defineProperty","__webpack_exports__","value","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_index_vue__","__webpack_require__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_index_vue___default","n","__WEBPACK_IMPORT_KEY__","key","d","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_cab89844_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_index_vue__","__vue_styles__","ssrContext","Component","normalizeComponent","a","name","data","props","isSpin","type","Boolean","default","isLeft","title","String","menuList","_menu2","this","index","id","$route","params","isTogHide","className","watch","is","layoutBox","$","addClass","removeClass","methods","_toggleSubMenu","item","isOpen","_toggleMenu","mounted","router","store","isDetails","created","state","dag","computed","_isDetails","msg","t","e","i","r","s","u","o","h","f","c","length","Array","join","z","utcOffset","Math","abs","floor","m","year","month","clone","add","Number","ceil","p","M","y","w","ms","Q","toLowerCase","replace","weekdays","split","months","l","S","g","format","pl","date","D","locale","$L","utc","$u","parse","prototype","$d","Date","NaN","test","match","UTC","init","$y","getFullYear","$M","getMonth","$D","getDate","$W","getDay","$H","getHours","$m","getMinutes","$s","getSeconds","$ms","getMilliseconds","$utils","isValid","toString","isSame","startOf","endOf","isAfter","isBefore","$g","set","day","hour","minute","second","millisecond","unix","valueOf","getTime","toDate","apply","slice","$locale","weekStart","$set","min","daysInMonth","get","setDate","subtract","substr","YY","YYYY","MM","MMM","monthsShort","MMMM","DD","dd","weekdaysMin","ddd","weekdaysShort","dddd","H","HH","hh","A","mm","ss","SSS","Z","round","getTimezoneOffset","diff","toJSON","toISOString","toUTCString","extend","isDayjs","en","Ls","module","exports","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_16cfa774_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_spin_vue__","content","locals","push","esExports","render","_vm","_h","$createElement","_c","_self","class","attrs","staticClass","staticStyle","background","width","height","xmlns","xmlns:xlink","viewBox","preserveAspectRatio","transform","attributeName","values","keyTimes","dur","begin","repeatCount","fill","_v","_s","$t","_e","staticRenderFns","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_listConstruction_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_listConstruction_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_eae3645c_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_listConstruction_vue__","_t","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_secondaryMenu_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_secondaryMenu_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_f72bdd3a_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_secondaryMenu_vue__","escape","_i18n","menu","projects","i18n","path","icon","children","security","resource","disabled","user","href","on","click","_l","$index","to","$event","el","tag","active-class","_dayjs","formatDate","fmt","_dayjs2","searchVal","operation","_ckQuery","$emit","_lodash2","trim","isShow","$slots","components","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noData_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noData_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_2d3808af_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_noData_vue__","_m","src","alt","_vue","_filter","Vue","filter","freeGlobal","freeSelf","self","root","Function","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_conditions_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_conditions_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_a4fced1a_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_conditions_vue__","size","placeholder","on-enterkey","model","callback","$$v","expression","baseIsNative","getValue","object","undefined","isArray","Symbol","getRawTag","objectToString","nullTag","undefinedTag","symToStringTag","toStringTag","other","assignValue","baseAssignValue","source","customizer","isNew","newValue","warningTypeList","code","isEmial","val","fuzzyQuery","list","keyWord","len","arr","reg","RegExp","_util","tagModel","email","activeIndex","emailList","emailWidth","isCn","activeList","repeatData","prop","event","_manualEmail","_this","some","cloneDeep","concat","v","$message","warning","_i18n2","_handlerEmailWitch","_handlerEmail","b","_email2","uniqWith","isEqual","isEmail","_emailEnter","_selectEmail","_emailDelete","isInteger","pop","_del","splice","_emailKeyup","_this2","setTimeout","$refs","emailInput","focus","_this3","parseInt","position","left","_emailTab","_this4","_this5","priorityList","unicode","color","mixins","_disabledState2","_rtUnicode","find","_onChange","arrayLikeKeys","baseKeys","isArrayLike","stubFalse","freeExports","nodeType","freeModule","Buffer","isBuffer","func","isFunction","isLength","baseGetTag","isObject","asyncTag","funcTag","genTag","proxyTag","nativeCreate","getNative","listCacheClear","listCacheDelete","listCacheGet","listCacheHas","listCacheSet","ListCache","entries","clear","entry","has","eq","array","isKeyable","map","__data__","baseKeysIn","DataView","Map","Promise","Set","WeakMap","toSource","dataViewCtorString","mapCtorString","promiseCtorString","setCtorString","weakMapCtorString","getTag","ArrayBuffer","resolve","result","Ctor","constructor","ctorString","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_priority_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_priority_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_6a4fc01c_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_priority_vue__","_store2","processDefinitionId","failureStrategy","warningType","notifyGroupList","warningGroupId","scheduleTime","spinnerLoading","execType","taskDependType","receivers","receiversCc","runMode","processInstancePriority","startNodeList","sourceType","_datepicker","_start","param","isEmpty","dispatch","then","res","success","close","catch","error","_getNotifyGroupList","reject","notifyGroupListS","_getReceiver","ok","$nextTick","mEmail","mPriority","_priority2","baseIsArguments","isObjectLike","objectProto","hasOwnProperty","propertyIsEnumerable","isArguments","arguments","call","baseIsTypedArray","baseUnary","nodeUtil","nodeIsTypedArray","isTypedArray","freeProcess","process","types","require","binding","offset","identity","overRest","setToString","start","MapCache","setCacheAdd","setCacheHas","SetCache","cache","forEach","baseMerge","mergeWith","createAssigner","srcIndex","stackClear","stackDelete","stackGet","stackHas","stackSet","Stack","configurable","enumerable","writable","Uint8Array","arrayBuffer","byteLength","getPrototype","overArg","getPrototypeOf","baseDifference","baseFlatten","baseRest","isArrayLikeObject","last","differenceWith","comparator","arrayFilter","stubArray","nativeGetSymbols","getOwnPropertySymbols","getSymbols","symbol","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_email_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_email_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_17a2306c_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_email_vue__","placement","append-to-body","visible-arrow","trigger","max-height","slot","directives","rawName","ref","style","domProps","keydown","indexOf","_k","keyCode","keyup","input","target","composing","on-change","scopedSlots","_u","fn","selectedModel","innerHTML","label","iteratee","baseTimes","isIndex","inherited","isArr","isArg","isBuff","isType","skipIndexes","global","MAX_SAFE_INTEGER","reIsUint","arg","baseUniq","unionWith","arrays","arrayPush","isFlattenable","depth","predicate","isStrict","funcToString","mapCacheClear","mapCacheDelete","mapCacheGet","mapCacheHas","mapCacheSet","baseIndexOf","allocUnsafe","buffer","isDeep","copy","cloneArrayBuffer","typedArray","byteOffset","baseCreate","isPrototype","objectTag","funcProto","objectCtorString","proto","objValue","getSymbolsIn","baseGetAllKeys","keys","keysFunc","symbolsFunc","arraySome","cacheHas","COMPARE_PARTIAL_FLAG","COMPARE_UNORDERED_FLAG","bitmask","equalFunc","stack","isPartial","arrLength","othLength","stacked","seen","arrValue","othValue","compared","othIndex","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_start_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_start_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_2175c153_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_start_vue__","margin-top","city","readonly","on-click-icon","stopPropagation","font-size","cursor","repeat-data","padding-top","margin","panel-num","shape","loading","setUrlParams","query","_webpackMerge2","history","current","_dist","crontab","cronPopover","globalScope","LOCALE","receiversD","receiversCcD","_verification","_timing","api","searchParams","schedule","JSON","stringify","startTime","endTime","Error","vCrontab","_values3","_interopRequireDefault","_unionWith3","_mergeWith3","_differenceWith3","_joinArrays2","_joinArraysSmart","_unique2","obj","__esModule","_toConsumableArray","arr2","from","merge","_len","sources","_key","customizeArray","customizeObject","_len2","structures","_key2","mergeSmart","isRule","uniteRules","bind","_customizeArray","rules","multiple","_len3","_key3","smart","strategy","smartStrategy","newRule","seenRule","unique","baseValues","arrayMap","argsTag","nativeObjectToString","isOwn","unmasked","typedArrayTags","nativeKeys","spreadableSymbol","isConcatSpreadable","nativeMax","max","args","otherArgs","thisArg","baseSetToString","shortOut","constant","string","isMasked","reIsHostCtor","reIsNative","uid","coreJsData","maskSrcKey","exec","IE_PROTO","HOT_COUNT","HOT_SPAN","nativeNow","now","count","lastCalled","stamp","remaining","arrayIncludes","arrayIncludesWith","createSet","setToArray","LARGE_ARRAY_SIZE","includes","isCommon","outer","seenIndex","Hash","hash","hashClear","hashDelete","hashGet","hashHas","hashSet","HASH_UNDEFINED","assocIndexOf","getMapData","baseFindIndex","baseIsNaN","strictIndexOf","fromIndex","fromRight","noop","assignMergeValue","baseFor","baseMergeDeep","keysIn","safeGet","srcValue","pairs","createBaseFor","iterable","cloneBuffer","cloneTypedArray","copyArray","initCloneObject","isPlainObject","toPlainObject","mergeFunc","isTyped","objectCreate","create","copyObject","nativeKeysIn","isProto","isIterateeCall","assigner","guard","valuesLength","valuesIndex","_isPlainObject3","_isFunction3","_cloneDeep3","joinArrays","_ref","_joinArrays","k","newKey","customResult","_customResult","baseClone","CLONE_DEEP_FLAG","CLONE_SYMBOLS_FLAG","arrayEach","baseAssign","baseAssignIn","copySymbols","copySymbolsIn","getAllKeys","getAllKeysIn","initCloneArray","initCloneByTag","isMap","isSet","CLONE_FLAT_FLAG","cloneableTags","isFlat","isFull","isFunc","subValue","resIndex","cloneDataView","cloneRegExp","cloneSymbol","boolTag","dateTag","mapTag","numberTag","regexpTag","setTag","stringTag","symbolTag","arrayBufferTag","dataViewTag","float32Tag","float64Tag","int8Tag","int16Tag","int32Tag","uint8Tag","uint8ClampedTag","uint16Tag","uint32Tag","dataView","reFlags","regexp","lastIndex","symbolProto","symbolValueOf","baseIsMap","nodeIsMap","baseIsSet","nodeIsSet","uniteEntries","_isEqual3","_slicedToArray","iterator","_arr","_n","_d","_i","next","done","err","sliceIterator","TypeError","isSameValue","_map","sort","_map2","propA","propB","areEqualEntries","newEntry","loaderNameRe","_entry$loader$match","loader","loaderName","_newEntry$loader$matc","findLastIndexUsingComparinator","entryToFind","comparinator","startingIndex","rule","enforce","include","exclude","oneOf","optionsKey","options","use","loaders","expandEntry","unwrapEntry","_optionsKey","newEntries","loadersKey","existingEntries","resultSet","existingEntriesIteratorIndex","currentEntry","indexInExistingEntries","hasEquivalentEntryInExistingEntries","j","existingEntry","hasMatchingEntryInNewEntries","unshift","alreadyHasMatchingEntryInResultSet","_existingEntry","_alreadyHasMatchingEntryInResultSet","combineEntries","baseIsEqual","baseIsEqualDeep","equalArrays","equalByTag","equalObjects","arrayTag","objIsArr","othIsArr","objTag","othTag","objIsObj","othIsObj","isSameTag","objIsWrapped","othIsWrapped","objUnwrapped","othUnwrapped","mapToArray","errorTag","message","convert","objProps","objLength","skipCtor","objCtor","othCtor","_differenceWith2","uniques","getter","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timing_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_timing_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_516d5d0c_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_timing_vue__","_compiled","functional","_scopeId","$vnode","parent","__VUE_SSR_CONTEXT__","_registeredComponents","_ssrRegister","$root","$options","shadowRoot","_injectStyles","beforeCreate","template","findLocale","window","localeCrontab","isWeek","isStr","selectList","_typeof","60","24","12","week","specificWeek","lastWeeks","findIndex","__file","tabVal","secondVal","minuteVal","hourVal","dayVal","monthVal","weekVal","yearVal","watchValue","onTab","_onDayValue","_onWeekValue","_reset","rtValue","beforeMount","beforeUpdate","updated","beforeDestroy","destroyed","mSecond","mMinute","mHour","mDay","mMonth","mYear","secondValue","radioSecond","selectSecondList","intervalPerformVal","intervalStartVal","specificSecondsVal","cycleStartVal","cycleEndVal","onIntervalPerform","onIntervalStart","onSpecificSeconds","onCycleStart","onCycleEnd","everyReset","intervalReset","specificReset","cycleReset","analyticalValue","mInputNumber","isIncrease","isReduce","propsValue","onBlur","onIncrease","onReduce","minuteValue","radioMinute","selectMinuteList","specificMinutesVal","onspecificMinutes","hourValue","radioHour","selectHourList","specificHoursVal","onspecificHours","radioDay","dayValue","weekValue","everyDayVal","WkintervalWeekPerformVal","WkintervalWeekStartVal","selectWeekList","intervalDayPerformVal","intervalDayStartVal","WkspecificWeekVal","selectSpecificWeekList","WkspecificDayVal","selectSpecificDayList","monthLastDaysVal","monthLastWorkingDays","monthLastWeeksVal","monthLastWeeksList","monthTailBeforeVal","recentlyWorkingDaysMonthVal","WkmonthNumWeeksDayVal","WkmonthNumWeeksWeekVal","WkmonthNumWeeksWeekList","onWkintervalWeekPerform","onIntervalDayPerform","onIntervalDayStart","onMonthTailBefore","onRecentlyWorkingDaysMonth","onWkmonthNumWeeksDay","everyDayReset","WkintervalWeekReset","intervalDayReset","WkspecificWeekReset","specificDayReset","monthLastDaysReset","monthLastWorkingDaysReset","monthLastWeeksReset","monthTailBeforeReset","recentlyWorkingDaysMonthReset","WkmonthNumReset","charAt","monthValue","radioMonth","selectMonthList","specificMonthVal","onspecificlMonths","yearValue","radioYear","selectYearList","specificYearVal","onspecificYears","day-val","week-val","on-day-value","on-week-value","localeList","秒","分","时","天","月","年","星期一","星期二","星期三","星期四","星期五","星期六","星期天","每一秒钟","每隔","秒执行 从","秒开始","具体秒数(可多选)","请选择具体秒数","周期从","到","每一分钟","分执行 从","分开始","具体分钟数(可多选)","请选择具体分钟数","每一小时","小时执行 从","小时开始","具体小时数(可多选)","请选择具体小时数","每一天","周执行 从","开始","天执行 从","天开始","具体星期几(可多选)","请选择具体周几","具体天数(可多选)","请选择具体天数","在这个月的最后一天","在这个月的最后一个工作日","在这个月的最后一个","在本月底前","最近的工作日(周一至周五)至本月","在这个月的第","每一月","月执行 从","月开始","具体月数(可多选)","请选择具体月数","每一年","年执行 从","年开始","具体年数(可多选)","请选择具体年数","小时","日","vertical","props-value","on-number","on-blur","define","__WEBPACK_AMD_DEFINE_RESULT__","__WEBPACK_AMD_DEFINE_FACTORY__","__WEBPACK_AMD_DEFINE_ARRAY__","autocomplete","_vuex","_routerUtil","total","processListP","isLoading","pageSize","pageNo","assign","mapActions","_page","_debounceGET","_onConditions","_getProcessListP","flag","getProcessListP","userId","totalList","_onUpdate","debounce","leading","trailing","deep","handler","_localStorage2","removeItem","mList","_list2","mConditions","_conditions2","mSpin","_spin2","mListConstruction","_listConstruction2","mSecondaryMenu","_secondaryMenu2","mNoData","_noData2","_config","processList","_rtPublishStatus","publishStatus","desc","_treeView","$router","getStartCheck","modal","$modal","dialog","closable","showMask","escClose","transitionName","_start3","onUpdate","remove","getReceiver","_timing3","_timingManage","_edit","_downline","_upProcessState","processId","releaseState","_poponline","editProcessState","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_2f8310d3_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue__","_f","createTime","updateTime","scheduleReleaseState","data-toggle","this$1","on-conditions","process-list","page-no","page-size","on-update","show-elevator","is-spin"],"mappings":"iEAAAA,OAAAC,eAAAC,EAAA,cAAAC,OAAA,QAAAC,EAAAC,EAAA,MAAAC,EAAAD,EAAAE,EAAAH,GAAA,QAAAI,KAAAJ,EAAA,YAAAI,GAAA,SAAAC,GAAAJ,EAAAK,EAAAR,EAAAO,EAAA,kBAAAL,EAAAK,KAAA,CAAAD,GAAA,IAAAG,EAAAN,EAAA,MAGA,IASAO,EAZA,SAAAC,GACER,EAAQ,OAgBVS,EAdyBT,EAAQ,GAcjCU,CACET,EAAAU,EACAL,EAAA,GATF,EAWAC,EAPA,KAEA,MAUeV,EAAA,QAAAY,EAAiB,kGCdhCG,KAAA,OACAC,KAFA,WAGA,UAEAC,OACAC,QACAC,KAAAC,QACAC,SAAA,GAEAC,QACAH,KAAAC,QACAC,SAAA,8DCNAN,KAAA,oBACAC,KAFA,WAGA,UAEAC,OACAM,MAAAC,qHCkBAT,KAAA,iBACAC,KAFA,WAGA,OACAS,UAAA,EAAAC,EAAAL,SAAAM,KAAAR,MACAS,MAAA,EACAC,GAAAF,KAAAG,OAAAC,OAAAF,GACAG,WAAA,IAGAf,OACAE,KAAAK,OACAS,UAAAT,QAEAU,OACAF,UADA,SACAG,GACA,IAAAC,EAAAC,EAAA,oBACAF,EAAAC,EAAAE,SAAA,UAAAF,EAAAG,YAAA,YAGAC,SACAC,eADA,SACAC,GACAA,EAAAC,QAAAD,EAAAC,QAEAC,YAJA,WAKAjB,KAAAK,WAAAL,KAAAK,YAGAa,QA5BA,4DCtBA,QAAA1C,EAAA,SACAA,EAAA,oEAGEa,KADa,WAEX,OACE8B,iBACAC,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AA,WAAqB,OAAAi9B,EAAA9B,QAAAx+B,MAA6BnL,KAAA,0BAAgCsL,EAAAwB,GAAAxB,EAAAyB,GAAAzB,EAAA0B,GAAA,yBAAA1B,EAAAwB,GAAA,KAAArB,EAAA,YAA2EoV,KAAA,YAAevV,EAAA67B,aAAA,QAAA17B,EAAA,UAA0CG,OAAO+/B,eAAArgC,EAAA67B,aAAAyE,UAAAtgC,EAAA0c,aAAAsf,OAAAuE,YAAAvgC,EAAA0c,aAAAqf,UAAwG94B,IAAKu9B,YAAAxgC,EAAA28B,aAA2B38B,EAAAwB,GAAA,KAAArB,EAAA,OAAwBI,YAAA,aAAuBJ,EAAA,UAAeG,OAAOyb,QAAAxR,SAAAvK,EAAA0c,aAAAsf,QAAAJ,MAAA57B,EAAA47B,MAAA6E,gBAAA,IAAiFx9B,IAAKoT,YAAArW,EAAAm8B,UAAuB,IAAAn8B,EAAA2B,KAAA3B,EAAAwB,GAAA,KAAAxB,EAAA67B,aAAAjkC,OAAAoI,EAAA2B,MAAAxB,EAAA,cAAAH,EAAAwB,GAAA,KAAArB,EAAA,UAA2GG,OAAOogC,UAAA1gC,EAAA87B,cAAyB,YAExpCl6B,oBACFjO,EAAA","file":"js/0.738a8a5.js","sourcesContent":["function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-cab89844\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./index.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./index.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./index.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-cab89844\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./index.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/pages/list/index.vue\n// module id = 605\n// module chunks = 0","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\n\nexport default {\n data () {\n return {\n router,\n store,\n isDetails: false\n }\n },\n created () {\n this.isDetails = this.store.state.dag.isDetails\n },\n methods: {\n },\n computed: {\n _isDetails () {\n return this.isDetails ? 'icon-disabled' : ''\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/module/mixin/disabledState.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/priority/priority.vue","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/keys.js\n// module id = 687\n// module chunks = 0 1 2","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isBuffer.js\n// module id = 688\n// module chunks = 0 1 2","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseUnary.js\n// module id = 689\n// module chunks = 0 1 2","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isArrayLike.js\n// module id = 690\n// module chunks = 0 1 2","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isFunction.js\n// module id = 691\n// module chunks = 0 1 2","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_nativeCreate.js\n// module id = 692\n// module chunks = 0 1 2","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_ListCache.js\n// module id = 693\n// module chunks = 0 1 2","var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_assocIndexOf.js\n// module id = 694\n// module chunks = 0 1 2","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_getMapData.js\n// module id = 695\n// module chunks = 0 1 2","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeysIn = require('./_baseKeysIn'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nmodule.exports = keysIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/keysIn.js\n// module id = 696\n// module chunks = 0 1 2","var DataView = require('./_DataView'),\n Map = require('./_Map'),\n Promise = require('./_Promise'),\n Set = require('./_Set'),\n WeakMap = require('./_WeakMap'),\n baseGetTag = require('./_baseGetTag'),\n toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nmodule.exports = getTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_getTag.js\n// module id = 697\n// module chunks = 0 1 2","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-6a4fc01c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./priority.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./priority.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./priority.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-6a4fc01c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./priority.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/priority/priority.vue\n// module id = 700\n// module chunks = 0 3 4 5 6","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isArguments.js\n// module id = 703\n// module chunks = 0 1 2","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isTypedArray.js\n// module id = 704\n// module chunks = 0 1 2","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_nodeUtil.js\n// module id = 705\n// module chunks = 0 1 2","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_isPrototype.js\n// module id = 706\n// module chunks = 0 1 2","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_arrayPush.js\n// module id = 707\n// module chunks = 0 1 2","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseRest.js\n// module id = 708\n// module chunks = 0 1 2","var MapCache = require('./_MapCache'),\n setCacheAdd = require('./_setCacheAdd'),\n setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_SetCache.js\n// module id = 709\n// module chunks = 0 1 2","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_Map.js\n// module id = 710\n// module chunks = 0 1 2","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nmodule.exports = cacheHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_cacheHas.js\n// module id = 711\n// module chunks = 0 1 2","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nmodule.exports = setToArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_setToArray.js\n// module id = 712\n// module chunks = 0 1 2","var isArrayLike = require('./isArrayLike'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nmodule.exports = isArrayLikeObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isArrayLikeObject.js\n// module id = 713\n// module chunks = 0 1 2","var baseMerge = require('./_baseMerge'),\n createAssigner = require('./_createAssigner');\n\n/**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\nvar mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n});\n\nmodule.exports = mergeWith;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/mergeWith.js\n// module id = 714\n// module chunks = 0 1 2","var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_Stack.js\n// module id = 715\n// module chunks = 0 1 2","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseAssignValue.js\n// module id = 716\n// module chunks = 0 1 2","var Uint8Array = require('./_Uint8Array');\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nmodule.exports = cloneArrayBuffer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_cloneArrayBuffer.js\n// module id = 717\n// module chunks = 0 1 2","var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_getPrototype.js\n// module id = 718\n// module chunks = 0 1 2","var baseDifference = require('./_baseDifference'),\n baseFlatten = require('./_baseFlatten'),\n baseRest = require('./_baseRest'),\n isArrayLikeObject = require('./isArrayLikeObject'),\n last = require('./last');\n\n/**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\nvar differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n});\n\nmodule.exports = differenceWith;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/differenceWith.js\n// module id = 719\n// module chunks = 0 1 2","var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nmodule.exports = getSymbols;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_getSymbols.js\n// module id = 720\n// module chunks = 0 1 2","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-17a2306c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./email.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./email.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./email.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-17a2306c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./email.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue\n// module id = 734\n// module chunks = 0 3 4 5 6","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue","'use strict';\n\nvar _values2 = require('lodash/values');\n\nvar _values3 = _interopRequireDefault(_values2);\n\nvar _unionWith2 = require('lodash/unionWith');\n\nvar _unionWith3 = _interopRequireDefault(_unionWith2);\n\nvar _mergeWith2 = require('lodash/mergeWith');\n\nvar _mergeWith3 = _interopRequireDefault(_mergeWith2);\n\nvar _differenceWith2 = require('lodash/differenceWith');\n\nvar _differenceWith3 = _interopRequireDefault(_differenceWith2);\n\nvar _joinArrays = require('./join-arrays');\n\nvar _joinArrays2 = _interopRequireDefault(_joinArrays);\n\nvar _joinArraysSmart = require('./join-arrays-smart');\n\nvar _unique = require('./unique');\n\nvar _unique2 = _interopRequireDefault(_unique);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction merge() {\n for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) {\n sources[_key] = arguments[_key];\n }\n\n // This supports\n // merge([] | ...)\n // merge({ customizeArray: , customizeObject: })([] | ...)\n // where fn = (a, b, key)\n if (sources.length === 1) {\n if (Array.isArray(sources[0])) {\n return _mergeWith3.default.apply(undefined, [{}].concat(_toConsumableArray(sources[0]), [(0, _joinArrays2.default)(sources[0])]));\n }\n\n if (sources[0].customizeArray || sources[0].customizeObject) {\n return function () {\n for (var _len2 = arguments.length, structures = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n structures[_key2] = arguments[_key2];\n }\n\n if (Array.isArray(structures[0])) {\n return _mergeWith3.default.apply(undefined, [{}].concat(_toConsumableArray(structures[0]), [(0, _joinArrays2.default)(sources[0])]));\n }\n\n return _mergeWith3.default.apply(undefined, [{}].concat(structures, [(0, _joinArrays2.default)(sources[0])]));\n };\n }\n\n return sources[0];\n }\n\n return _mergeWith3.default.apply(undefined, [{}].concat(sources, [(0, _joinArrays2.default)()]));\n}\n\nvar mergeSmart = merge({\n customizeArray: function customizeArray(a, b, key) {\n if (isRule(key.split('.').slice(-1)[0])) {\n return (0, _unionWith3.default)(a, b, _joinArraysSmart.uniteRules.bind(null, {}, key));\n }\n\n return null;\n }\n});\n\nvar mergeMultiple = function mergeMultiple() {\n for (var _len3 = arguments.length, sources = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n sources[_key3] = arguments[_key3];\n }\n\n return (0, _values3.default)(merge(sources));\n};\n\n// rules: { : <'append'|'prepend'|'replace'> }\n// All default to append but you can override here\nvar mergeStrategy = function mergeStrategy() {\n var rules = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return merge({\n customizeArray: _customizeArray(rules),\n customizeObject: customizeObject(rules)\n });\n};\nvar mergeSmartStrategy = function mergeSmartStrategy() {\n var rules = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return merge({\n customizeArray: function customizeArray(a, b, key) {\n var topKey = key.split('.').slice(-1)[0];\n\n if (isRule(topKey)) {\n switch (rules[key]) {\n case 'prepend':\n return [].concat(_toConsumableArray((0, _differenceWith3.default)(b, a, function (newRule, seenRule) {\n return (0, _joinArraysSmart.uniteRules)(rules, key, newRule, seenRule, 'prepend');\n })), _toConsumableArray(a));\n case 'replace':\n return b;\n default:\n // append\n return (0, _unionWith3.default)(a, b, _joinArraysSmart.uniteRules.bind(null, rules, key));\n }\n }\n\n return _customizeArray(rules)(a, b, key);\n },\n customizeObject: customizeObject(rules)\n });\n};\n\nfunction _customizeArray(rules) {\n return function (a, b, key) {\n switch (rules[key]) {\n case 'prepend':\n return [].concat(_toConsumableArray(b), _toConsumableArray(a));\n case 'replace':\n return b;\n default:\n // append\n return false;\n }\n };\n}\n\nfunction customizeObject(rules) {\n return function (a, b, key) {\n switch (rules[key]) {\n case 'prepend':\n return (0, _mergeWith3.default)({}, b, a, (0, _joinArrays2.default)());\n case 'replace':\n return b;\n default:\n // append\n return false;\n }\n };\n}\n\nfunction isRule(key) {\n return ['preLoaders', 'loaders', 'postLoaders', 'rules'].indexOf(key) >= 0;\n}\n\nmodule.exports = merge;\nmodule.exports.multiple = mergeMultiple;\nmodule.exports.smart = mergeSmart;\nmodule.exports.strategy = mergeStrategy;\nmodule.exports.smartStrategy = mergeSmartStrategy;\nmodule.exports.unique = _unique2.default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)-merge/lib/index.js\n// module id = 810\n// module chunks = 0 1 2","var baseValues = require('./_baseValues'),\n keys = require('./keys');\n\n/**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\nfunction values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n}\n\nmodule.exports = values;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/values.js\n// module id = 811\n// module chunks = 0 1 2","var arrayMap = require('./_arrayMap');\n\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n}\n\nmodule.exports = baseValues;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseValues.js\n// module id = 812\n// module chunks = 0 1 2","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseTimes.js\n// module id = 813\n// module chunks = 0 1 2","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseIsArguments.js\n// module id = 814\n// module chunks = 0 1 2","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_getRawTag.js\n// module id = 815\n// module chunks = 0 1 2","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_objectToString.js\n// module id = 816\n// module chunks = 0 1 2","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/stubFalse.js\n// module id = 817\n// module chunks = 0 1 2","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseIsTypedArray.js\n// module id = 818\n// module chunks = 0 1 2","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseKeys.js\n// module id = 819\n// module chunks = 0 1 2","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_nativeKeys.js\n// module id = 820\n// module chunks = 0 1 2","var Symbol = require('./_Symbol'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray');\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_isFlattenable.js\n// module id = 821\n// module chunks = 0 1 2","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_overRest.js\n// module id = 822\n// module chunks = 0 1 2","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_apply.js\n// module id = 823\n// module chunks = 0 1 2","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_setToString.js\n// module id = 824\n// module chunks = 0 1 2","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseSetToString.js\n// module id = 825\n// module chunks = 0 1 2","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/constant.js\n// module id = 826\n// module chunks = 0 1 2","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseIsNative.js\n// module id = 827\n// module chunks = 0 1 2","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_isMasked.js\n// module id = 828\n// module chunks = 0 1 2","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_coreJsData.js\n// module id = 829\n// module chunks = 0 1 2","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_getValue.js\n// module id = 830\n// module chunks = 0 1 2","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_shortOut.js\n// module id = 831\n// module chunks = 0 1 2","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n cacheHas = require('./_cacheHas'),\n createSet = require('./_createSet'),\n setToArray = require('./_setToArray');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseUniq;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseUniq.js\n// module id = 832\n// module chunks = 0 1 2","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_mapCacheClear.js\n// module id = 833\n// module chunks = 0 1 2","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_Hash.js\n// module id = 834\n// module chunks = 0 1 2","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_hashClear.js\n// module id = 835\n// module chunks = 0 1 2","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_hashDelete.js\n// module id = 836\n// module chunks = 0 1 2","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_hashGet.js\n// module id = 837\n// module chunks = 0 1 2","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_hashHas.js\n// module id = 838\n// module chunks = 0 1 2","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_hashSet.js\n// module id = 839\n// module chunks = 0 1 2","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_listCacheClear.js\n// module id = 840\n// module chunks = 0 1 2","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_listCacheDelete.js\n// module id = 841\n// module chunks = 0 1 2","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_listCacheGet.js\n// module id = 842\n// module chunks = 0 1 2","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_listCacheHas.js\n// module id = 843\n// module chunks = 0 1 2","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_listCacheSet.js\n// module id = 844\n// module chunks = 0 1 2","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_mapCacheDelete.js\n// module id = 845\n// module chunks = 0 1 2","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_isKeyable.js\n// module id = 846\n// module chunks = 0 1 2","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_mapCacheGet.js\n// module id = 847\n// module chunks = 0 1 2","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_mapCacheHas.js\n// module id = 848\n// module chunks = 0 1 2","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_mapCacheSet.js\n// module id = 849\n// module chunks = 0 1 2","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nmodule.exports = setCacheAdd;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_setCacheAdd.js\n// module id = 850\n// module chunks = 0 1 2","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_setCacheHas.js\n// module id = 851\n// module chunks = 0 1 2","var baseFindIndex = require('./_baseFindIndex'),\n baseIsNaN = require('./_baseIsNaN'),\n strictIndexOf = require('./_strictIndexOf');\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nmodule.exports = baseIndexOf;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseIndexOf.js\n// module id = 852\n// module chunks = 0 1 2","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseFindIndex;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseFindIndex.js\n// module id = 853\n// module chunks = 0 1 2","/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nmodule.exports = baseIsNaN;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseIsNaN.js\n// module id = 854\n// module chunks = 0 1 2","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = strictIndexOf;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_strictIndexOf.js\n// module id = 855\n// module chunks = 0 1 2","var Set = require('./_Set'),\n noop = require('./noop'),\n setToArray = require('./_setToArray');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\nmodule.exports = createSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_createSet.js\n// module id = 856\n// module chunks = 0 1 2","/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nmodule.exports = noop;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/noop.js\n// module id = 857\n// module chunks = 0 1 2","var Stack = require('./_Stack'),\n assignMergeValue = require('./_assignMergeValue'),\n baseFor = require('./_baseFor'),\n baseMergeDeep = require('./_baseMergeDeep'),\n isObject = require('./isObject'),\n keysIn = require('./keysIn'),\n safeGet = require('./_safeGet');\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n if (isObject(srcValue)) {\n stack || (stack = new Stack);\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nmodule.exports = baseMerge;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseMerge.js\n// module id = 858\n// module chunks = 0 1 2","var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_stackClear.js\n// module id = 859\n// module chunks = 0 1 2","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_stackDelete.js\n// module id = 860\n// module chunks = 0 1 2","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_stackGet.js\n// module id = 861\n// module chunks = 0 1 2","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_stackHas.js\n// module id = 862\n// module chunks = 0 1 2","var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_stackSet.js\n// module id = 863\n// module chunks = 0 1 2","var createBaseFor = require('./_createBaseFor');\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseFor.js\n// module id = 864\n// module chunks = 0 1 2","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_createBaseFor.js\n// module id = 865\n// module chunks = 0 1 2","var assignMergeValue = require('./_assignMergeValue'),\n cloneBuffer = require('./_cloneBuffer'),\n cloneTypedArray = require('./_cloneTypedArray'),\n copyArray = require('./_copyArray'),\n initCloneObject = require('./_initCloneObject'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isArrayLikeObject = require('./isArrayLikeObject'),\n isBuffer = require('./isBuffer'),\n isFunction = require('./isFunction'),\n isObject = require('./isObject'),\n isPlainObject = require('./isPlainObject'),\n isTypedArray = require('./isTypedArray'),\n safeGet = require('./_safeGet'),\n toPlainObject = require('./toPlainObject');\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nmodule.exports = baseMergeDeep;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseMergeDeep.js\n// module id = 866\n// module chunks = 0 1 2","var isObject = require('./isObject');\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nmodule.exports = baseCreate;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseCreate.js\n// module id = 867\n// module chunks = 0 1 2","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nmodule.exports = toPlainObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/toPlainObject.js\n// module id = 868\n// module chunks = 0 1 2","var isObject = require('./isObject'),\n isPrototype = require('./_isPrototype'),\n nativeKeysIn = require('./_nativeKeysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeysIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseKeysIn.js\n// module id = 869\n// module chunks = 0 1 2","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = nativeKeysIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_nativeKeysIn.js\n// module id = 870\n// module chunks = 0 1 2","var baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nmodule.exports = createAssigner;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_createAssigner.js\n// module id = 871\n// module chunks = 0 1 2","var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_isIterateeCall.js\n// module id = 872\n// module chunks = 0 1 2","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n arrayMap = require('./_arrayMap'),\n baseUnary = require('./_baseUnary'),\n cacheHas = require('./_cacheHas');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\nfunction baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseDifference;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseDifference.js\n// module id = 873\n// module chunks = 0 1 2","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _mergeWith2 = require('lodash/mergeWith');\n\nvar _mergeWith3 = _interopRequireDefault(_mergeWith2);\n\nvar _isPlainObject2 = require('lodash/isPlainObject');\n\nvar _isPlainObject3 = _interopRequireDefault(_isPlainObject2);\n\nvar _isFunction2 = require('lodash/isFunction');\n\nvar _isFunction3 = _interopRequireDefault(_isFunction2);\n\nvar _cloneDeep2 = require('lodash/cloneDeep');\n\nvar _cloneDeep3 = _interopRequireDefault(_cloneDeep2);\n\nexports.default = joinArrays;\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar isArray = Array.isArray;\n\nfunction joinArrays() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n customizeArray = _ref.customizeArray,\n customizeObject = _ref.customizeObject,\n key = _ref.key;\n\n return function _joinArrays(a, b, k) {\n var newKey = key ? key + '.' + k : k;\n\n if ((0, _isFunction3.default)(a) && (0, _isFunction3.default)(b)) {\n return function () {\n return _joinArrays(a.apply(undefined, arguments), b.apply(undefined, arguments), k);\n };\n }\n if (isArray(a) && isArray(b)) {\n var customResult = customizeArray && customizeArray(a, b, newKey);\n\n return customResult || [].concat(_toConsumableArray(a), _toConsumableArray(b));\n }\n\n if ((0, _isPlainObject3.default)(a) && (0, _isPlainObject3.default)(b)) {\n var _customResult = customizeObject && customizeObject(a, b, newKey);\n\n return _customResult || (0, _mergeWith3.default)({}, a, b, joinArrays({\n customizeArray: customizeArray,\n customizeObject: customizeObject,\n key: newKey\n }));\n }\n\n if ((0, _isPlainObject3.default)(b)) {\n return (0, _cloneDeep3.default)(b);\n }\n\n if (isArray(b)) {\n return [].concat(_toConsumableArray(b));\n }\n\n return b;\n };\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)-merge/lib/join-arrays.js\n// module id = 874\n// module chunks = 0 1 2","var baseClone = require('./_baseClone');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nmodule.exports = cloneDeep;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/cloneDeep.js\n// module id = 875\n// module chunks = 0 1 2","var Stack = require('./_Stack'),\n arrayEach = require('./_arrayEach'),\n assignValue = require('./_assignValue'),\n baseAssign = require('./_baseAssign'),\n baseAssignIn = require('./_baseAssignIn'),\n cloneBuffer = require('./_cloneBuffer'),\n copyArray = require('./_copyArray'),\n copySymbols = require('./_copySymbols'),\n copySymbolsIn = require('./_copySymbolsIn'),\n getAllKeys = require('./_getAllKeys'),\n getAllKeysIn = require('./_getAllKeysIn'),\n getTag = require('./_getTag'),\n initCloneArray = require('./_initCloneArray'),\n initCloneByTag = require('./_initCloneByTag'),\n initCloneObject = require('./_initCloneObject'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isMap = require('./isMap'),\n isObject = require('./isObject'),\n isSet = require('./isSet'),\n keys = require('./keys');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n\n return result;\n }\n\n if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n\n return result;\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nmodule.exports = baseClone;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseClone.js\n// module id = 876\n// module chunks = 0 1 2","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_arrayEach.js\n// module id = 877\n// module chunks = 0 1 2","var copyObject = require('./_copyObject'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseAssign.js\n// module id = 878\n// module chunks = 0 1 2","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nmodule.exports = baseAssignIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseAssignIn.js\n// module id = 879\n// module chunks = 0 1 2","var copyObject = require('./_copyObject'),\n getSymbols = require('./_getSymbols');\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_copySymbols.js\n// module id = 880\n// module chunks = 0 1 2","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_arrayFilter.js\n// module id = 881\n// module chunks = 0 1 2","var copyObject = require('./_copyObject'),\n getSymbolsIn = require('./_getSymbolsIn');\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_copySymbolsIn.js\n// module id = 882\n// module chunks = 0 1 2","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbolsIn = require('./_getSymbolsIn'),\n keysIn = require('./keysIn');\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nmodule.exports = getAllKeysIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_getAllKeysIn.js\n// module id = 883\n// module chunks = 0 1 2","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_DataView.js\n// module id = 884\n// module chunks = 0 1 2","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_Promise.js\n// module id = 885\n// module chunks = 0 1 2","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_WeakMap.js\n// module id = 886\n// module chunks = 0 1 2","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nmodule.exports = initCloneArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_initCloneArray.js\n// module id = 887\n// module chunks = 0 1 2","var cloneArrayBuffer = require('./_cloneArrayBuffer'),\n cloneDataView = require('./_cloneDataView'),\n cloneRegExp = require('./_cloneRegExp'),\n cloneSymbol = require('./_cloneSymbol'),\n cloneTypedArray = require('./_cloneTypedArray');\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nmodule.exports = initCloneByTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_initCloneByTag.js\n// module id = 888\n// module chunks = 0 1 2","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nmodule.exports = cloneDataView;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_cloneDataView.js\n// module id = 889\n// module chunks = 0 1 2","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nmodule.exports = cloneRegExp;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_cloneRegExp.js\n// module id = 890\n// module chunks = 0 1 2","var Symbol = require('./_Symbol');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nmodule.exports = cloneSymbol;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_cloneSymbol.js\n// module id = 891\n// module chunks = 0 1 2","var baseIsMap = require('./_baseIsMap'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nmodule.exports = isMap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isMap.js\n// module id = 892\n// module chunks = 0 1 2","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nmodule.exports = baseIsMap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseIsMap.js\n// module id = 893\n// module chunks = 0 1 2","var baseIsSet = require('./_baseIsSet'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nmodule.exports = isSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isSet.js\n// module id = 894\n// module chunks = 0 1 2","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nmodule.exports = baseIsSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseIsSet.js\n// module id = 895\n// module chunks = 0 1 2","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.uniteEntries = exports.uniteRules = undefined;\n\nvar _unionWith2 = require('lodash/unionWith');\n\nvar _unionWith3 = _interopRequireDefault(_unionWith2);\n\nvar _differenceWith2 = require('lodash/differenceWith');\n\nvar _differenceWith3 = _interopRequireDefault(_differenceWith2);\n\nvar _mergeWith2 = require('lodash/mergeWith');\n\nvar _mergeWith3 = _interopRequireDefault(_mergeWith2);\n\nvar _isEqual2 = require('lodash/isEqual');\n\nvar _isEqual3 = _interopRequireDefault(_isEqual2);\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar isArray = Array.isArray;\n\nfunction uniteRules(rules, key, newRule, rule) {\n if (String(rule.test) !== String(newRule.test) || (newRule.enforce || rule.enforce) && rule.enforce !== newRule.enforce || newRule.include && !isSameValue(rule.include, newRule.include) || newRule.exclude && !isSameValue(rule.exclude, newRule.exclude)) {\n return false;\n } else if (!rule.test && !rule.include && !rule.exclude && (rule.loader && rule.loader.split('?')[0]) !== (newRule.loader && newRule.loader.split('?')[0])) {\n // Don't merge the rule if there isn't any identifying fields and the loaders don't match\n return false;\n } else if ((rule.include || rule.exclude) && !newRule.include && !newRule.exclude) {\n // Don't merge child without include/exclude to parent that has either\n return false;\n }\n\n // apply the same logic for oneOf\n if (rule.oneOf && newRule.oneOf) {\n rule.oneOf = (0, _unionWith3.default)(rule.oneOf, newRule.oneOf, uniteRules.bind(null, {}, 'oneOf'));\n\n return true;\n }\n\n // newRule.loader should always override use, loaders and oneOf\n if (newRule.loader) {\n var optionsKey = newRule.options ? 'options' : newRule.query && 'query';\n\n delete rule.use;\n delete rule.loaders;\n delete rule.oneOf;\n\n rule.loader = newRule.loader;\n\n if (optionsKey) {\n rule[optionsKey] = newRule[optionsKey];\n }\n } else if (newRule.oneOf) {\n delete rule.use;\n delete rule.loaders;\n delete rule.loader;\n\n rule.oneOf = newRule.oneOf;\n } else if ((rule.use || rule.loaders || rule.loader) && (newRule.use || newRule.loaders)) {\n var expandEntry = function expandEntry(loader) {\n return typeof loader === 'string' ? { loader: loader } : loader;\n };\n // this is only here to avoid breaking existing tests\n var unwrapEntry = function unwrapEntry(entry) {\n return !entry.options && !entry.query ? entry.loader : entry;\n };\n\n var entries = void 0;\n if (rule.loader) {\n var _optionsKey = rule.options ? 'options' : rule.query && 'query';\n entries = [{ loader: rule.loader }];\n\n if (_optionsKey) {\n entries[0][_optionsKey] = rule[_optionsKey];\n }\n\n delete rule.loader;\n\n if (_optionsKey) {\n delete rule[_optionsKey];\n }\n } else {\n entries = [].concat(rule.use || rule.loaders).map(expandEntry);\n }\n var newEntries = [].concat(newRule.use || newRule.loaders).map(expandEntry);\n\n var loadersKey = rule.use || newRule.use ? 'use' : 'loaders';\n var resolvedKey = key + '.' + loadersKey;\n\n switch (rules[resolvedKey]) {\n case 'prepend':\n rule[loadersKey] = [].concat(_toConsumableArray((0, _differenceWith3.default)(newEntries, entries, uniteEntries)), _toConsumableArray(entries)).map(unwrapEntry);\n break;\n case 'replace':\n rule[loadersKey] = newRule.use || newRule.loaders;\n break;\n default:\n rule[loadersKey] = combineEntries(newEntries, entries).map(unwrapEntry);\n }\n }\n\n if (newRule.include) {\n rule.include = newRule.include;\n }\n\n if (newRule.exclude) {\n rule.exclude = newRule.exclude;\n }\n\n return true;\n}\n\n/**\n * Check equality of two values using lodash's isEqual\n * Arrays need to be sorted for equality checking\n * but clone them first so as not to disrupt the sort order in tests\n */\nfunction isSameValue(a, b) {\n var _map = [a, b].map(function (value) {\n return isArray(value) ? [].concat(_toConsumableArray(value)).sort() : value;\n }),\n _map2 = _slicedToArray(_map, 2),\n propA = _map2[0],\n propB = _map2[1];\n\n return (0, _isEqual3.default)(propA, propB);\n}\n\nfunction areEqualEntries(newEntry, entry) {\n var loaderNameRe = /^([^?]+)/ig;\n\n var _entry$loader$match = entry.loader.match(loaderNameRe),\n _entry$loader$match2 = _slicedToArray(_entry$loader$match, 1),\n loaderName = _entry$loader$match2[0];\n\n var _newEntry$loader$matc = newEntry.loader.match(loaderNameRe),\n _newEntry$loader$matc2 = _slicedToArray(_newEntry$loader$matc, 1),\n newLoaderName = _newEntry$loader$matc2[0];\n\n return loaderName === newLoaderName;\n}\n\nfunction uniteEntries(newEntry, entry) {\n if (areEqualEntries(newEntry, entry)) {\n // Replace query values with newer ones\n (0, _mergeWith3.default)(entry, newEntry);\n return true;\n }\n return false;\n}\n\n/* Combines entries and newEntries, while respecting the order of loaders in each.\n\nIterates through new entries. If the new entry also exists in existing entries,\nwe'll put in all of the loaders from existing entries that come before it (in case\nthose are pre-requisites). Any remaining existing entries are added at the end.\n\nSince webpack processes right-to-left, we're working backwards through the arrays\n*/\nfunction combineEntries(newEntries, existingEntries) {\n var resultSet = [];\n\n // We're iterating through newEntries, this keeps track of where we are in the existingEntries\n var existingEntriesIteratorIndex = existingEntries.length - 1;\n\n for (var i = newEntries.length - 1; i >= 0; i -= 1) {\n var currentEntry = newEntries[i];\n var indexInExistingEntries = findLastIndexUsingComparinator(existingEntries, currentEntry, areEqualEntries, existingEntriesIteratorIndex);\n var hasEquivalentEntryInExistingEntries = indexInExistingEntries !== -1;\n\n if (hasEquivalentEntryInExistingEntries) {\n // If the same entry exists in existing entries, we should add all of the entries that\n // come before to maintain order\n for (var j = existingEntriesIteratorIndex; j > indexInExistingEntries; j -= 1) {\n var existingEntry = existingEntries[j];\n\n // If this entry also exists in new entries, we'll add as part of iterating through\n // new entries so that if there's a conflict between existing entries and new entries,\n // new entries order wins\n var hasMatchingEntryInNewEntries = findLastIndexUsingComparinator(newEntries, existingEntry, areEqualEntries, i) !== -1;\n\n if (!hasMatchingEntryInNewEntries) {\n resultSet.unshift(existingEntry);\n }\n existingEntriesIteratorIndex -= 1;\n }\n\n uniteEntries(currentEntry, existingEntries[existingEntriesIteratorIndex]);\n // uniteEntries mutates the second parameter to be a merged version, so that's what's pushed\n resultSet.unshift(existingEntries[existingEntriesIteratorIndex]);\n\n existingEntriesIteratorIndex -= 1;\n } else {\n var alreadyHasMatchingEntryInResultSet = findLastIndexUsingComparinator(resultSet, currentEntry, areEqualEntries) !== -1;\n\n if (!alreadyHasMatchingEntryInResultSet) {\n resultSet.unshift(currentEntry);\n }\n }\n }\n\n // Add remaining existing entries\n for (existingEntriesIteratorIndex; existingEntriesIteratorIndex >= 0; existingEntriesIteratorIndex -= 1) {\n\n var _existingEntry = existingEntries[existingEntriesIteratorIndex];\n var _alreadyHasMatchingEntryInResultSet = findLastIndexUsingComparinator(resultSet, _existingEntry, areEqualEntries) !== -1;\n\n if (!_alreadyHasMatchingEntryInResultSet) {\n resultSet.unshift(_existingEntry);\n }\n }\n\n return resultSet;\n}\n\nfunction findLastIndexUsingComparinator(entries, entryToFind, comparinator, startingIndex) {\n startingIndex = startingIndex || entries.length - 1;\n for (var i = startingIndex; i >= 0; i -= 1) {\n if (areEqualEntries(entryToFind, entries[i])) {\n return i;\n }\n }\n return -1;\n}\n\nexports.uniteRules = uniteRules;\nexports.uniteEntries = uniteEntries;\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)-merge/lib/join-arrays-smart.js\n// module id = 896\n// module chunks = 0 1 2","var baseIsEqual = require('./_baseIsEqual');\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nmodule.exports = isEqual;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isEqual.js\n// module id = 897\n// module chunks = 0 1 2","var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseIsEqual.js\n// module id = 898\n// module chunks = 0 1 2","var Stack = require('./_Stack'),\n equalArrays = require('./_equalArrays'),\n equalByTag = require('./_equalByTag'),\n equalObjects = require('./_equalObjects'),\n getTag = require('./_getTag'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isTypedArray = require('./isTypedArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseIsEqualDeep.js\n// module id = 899\n// module chunks = 0 1 2","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arraySome;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_arraySome.js\n// module id = 900\n// module chunks = 0 1 2","var Symbol = require('./_Symbol'),\n Uint8Array = require('./_Uint8Array'),\n eq = require('./eq'),\n equalArrays = require('./_equalArrays'),\n mapToArray = require('./_mapToArray'),\n setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_equalByTag.js\n// module id = 901\n// module chunks = 0 1 2","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nmodule.exports = mapToArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_mapToArray.js\n// module id = 902\n// module chunks = 0 1 2","var getAllKeys = require('./_getAllKeys');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalObjects;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_equalObjects.js\n// module id = 903\n// module chunks = 0 1 2","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _differenceWith2 = require('lodash/differenceWith');\n\nvar _differenceWith3 = _interopRequireDefault(_differenceWith2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction mergeUnique(key, uniques) {\n var getter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (a) {\n return a;\n };\n\n return function (a, b, k) {\n return k === key && [].concat(_toConsumableArray(a), _toConsumableArray((0, _differenceWith3.default)(b, a, function (item) {\n return uniques.indexOf(getter(item)) >= 0;\n })));\n };\n}\n\nexports.default = mergeUnique;\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)-merge/lib/unique.js\n// module id = 904\n// module chunks = 0 1 2","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-516d5d0c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./timing.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./timing.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./timing.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-516d5d0c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./timing.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue\n// module id = 993\n// module chunks = 0 6","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/index.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\n\nexport default {\n data () {\n return {\n router,\n store,\n isDetails: false\n }\n },\n created () {\n this.isDetails = this.store.state.dag.isDetails\n },\n methods: {\n },\n computed: {\n _isDetails () {\n return this.isDetails ? 'icon-disabled' : ''\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/module/mixin/disabledState.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/priority/priority.vue","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/keys.js\n// module id = 687\n// module chunks = 0 1 2","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isBuffer.js\n// module id = 688\n// module chunks = 0 1 2","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseUnary.js\n// module id = 689\n// module chunks = 0 1 2","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isArrayLike.js\n// module id = 690\n// module chunks = 0 1 2","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isFunction.js\n// module id = 691\n// module chunks = 0 1 2","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_nativeCreate.js\n// module id = 692\n// module chunks = 0 1 2","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_ListCache.js\n// module id = 693\n// module chunks = 0 1 2","var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_assocIndexOf.js\n// module id = 694\n// module chunks = 0 1 2","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_getMapData.js\n// module id = 695\n// module chunks = 0 1 2","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeysIn = require('./_baseKeysIn'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nmodule.exports = keysIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/keysIn.js\n// module id = 696\n// module chunks = 0 1 2","var DataView = require('./_DataView'),\n Map = require('./_Map'),\n Promise = require('./_Promise'),\n Set = require('./_Set'),\n WeakMap = require('./_WeakMap'),\n baseGetTag = require('./_baseGetTag'),\n toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nmodule.exports = getTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_getTag.js\n// module id = 697\n// module chunks = 0 1 2","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-6a4fc01c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./priority.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./priority.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./priority.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-6a4fc01c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./priority.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/priority/priority.vue\n// module id = 700\n// module chunks = 0 3 4 5 6","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isArguments.js\n// module id = 703\n// module chunks = 0 1 2","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isTypedArray.js\n// module id = 704\n// module chunks = 0 1 2","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_nodeUtil.js\n// module id = 705\n// module chunks = 0 1 2","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_isPrototype.js\n// module id = 706\n// module chunks = 0 1 2","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_arrayPush.js\n// module id = 707\n// module chunks = 0 1 2","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseRest.js\n// module id = 708\n// module chunks = 0 1 2","var MapCache = require('./_MapCache'),\n setCacheAdd = require('./_setCacheAdd'),\n setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_SetCache.js\n// module id = 709\n// module chunks = 0 1 2","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_Map.js\n// module id = 710\n// module chunks = 0 1 2","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nmodule.exports = cacheHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_cacheHas.js\n// module id = 711\n// module chunks = 0 1 2","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nmodule.exports = setToArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_setToArray.js\n// module id = 712\n// module chunks = 0 1 2","var isArrayLike = require('./isArrayLike'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nmodule.exports = isArrayLikeObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isArrayLikeObject.js\n// module id = 713\n// module chunks = 0 1 2","var baseMerge = require('./_baseMerge'),\n createAssigner = require('./_createAssigner');\n\n/**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\nvar mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n});\n\nmodule.exports = mergeWith;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/mergeWith.js\n// module id = 714\n// module chunks = 0 1 2","var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_Stack.js\n// module id = 715\n// module chunks = 0 1 2","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseAssignValue.js\n// module id = 716\n// module chunks = 0 1 2","var Uint8Array = require('./_Uint8Array');\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nmodule.exports = cloneArrayBuffer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_cloneArrayBuffer.js\n// module id = 717\n// module chunks = 0 1 2","var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_getPrototype.js\n// module id = 718\n// module chunks = 0 1 2","var baseDifference = require('./_baseDifference'),\n baseFlatten = require('./_baseFlatten'),\n baseRest = require('./_baseRest'),\n isArrayLikeObject = require('./isArrayLikeObject'),\n last = require('./last');\n\n/**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\nvar differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n});\n\nmodule.exports = differenceWith;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/differenceWith.js\n// module id = 719\n// module chunks = 0 1 2","var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nmodule.exports = getSymbols;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_getSymbols.js\n// module id = 720\n// module chunks = 0 1 2","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-17a2306c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./email.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./email.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./email.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-17a2306c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./email.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue\n// module id = 734\n// module chunks = 0 3 4 5 6","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue","'use strict';\n\nvar _values2 = require('lodash/values');\n\nvar _values3 = _interopRequireDefault(_values2);\n\nvar _unionWith2 = require('lodash/unionWith');\n\nvar _unionWith3 = _interopRequireDefault(_unionWith2);\n\nvar _mergeWith2 = require('lodash/mergeWith');\n\nvar _mergeWith3 = _interopRequireDefault(_mergeWith2);\n\nvar _differenceWith2 = require('lodash/differenceWith');\n\nvar _differenceWith3 = _interopRequireDefault(_differenceWith2);\n\nvar _joinArrays = require('./join-arrays');\n\nvar _joinArrays2 = _interopRequireDefault(_joinArrays);\n\nvar _joinArraysSmart = require('./join-arrays-smart');\n\nvar _unique = require('./unique');\n\nvar _unique2 = _interopRequireDefault(_unique);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction merge() {\n for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) {\n sources[_key] = arguments[_key];\n }\n\n // This supports\n // merge([] | ...)\n // merge({ customizeArray: , customizeObject: })([] | ...)\n // where fn = (a, b, key)\n if (sources.length === 1) {\n if (Array.isArray(sources[0])) {\n return _mergeWith3.default.apply(undefined, [{}].concat(_toConsumableArray(sources[0]), [(0, _joinArrays2.default)(sources[0])]));\n }\n\n if (sources[0].customizeArray || sources[0].customizeObject) {\n return function () {\n for (var _len2 = arguments.length, structures = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n structures[_key2] = arguments[_key2];\n }\n\n if (Array.isArray(structures[0])) {\n return _mergeWith3.default.apply(undefined, [{}].concat(_toConsumableArray(structures[0]), [(0, _joinArrays2.default)(sources[0])]));\n }\n\n return _mergeWith3.default.apply(undefined, [{}].concat(structures, [(0, _joinArrays2.default)(sources[0])]));\n };\n }\n\n return sources[0];\n }\n\n return _mergeWith3.default.apply(undefined, [{}].concat(sources, [(0, _joinArrays2.default)()]));\n}\n\nvar mergeSmart = merge({\n customizeArray: function customizeArray(a, b, key) {\n if (isRule(key.split('.').slice(-1)[0])) {\n return (0, _unionWith3.default)(a, b, _joinArraysSmart.uniteRules.bind(null, {}, key));\n }\n\n return null;\n }\n});\n\nvar mergeMultiple = function mergeMultiple() {\n for (var _len3 = arguments.length, sources = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n sources[_key3] = arguments[_key3];\n }\n\n return (0, _values3.default)(merge(sources));\n};\n\n// rules: { : <'append'|'prepend'|'replace'> }\n// All default to append but you can override here\nvar mergeStrategy = function mergeStrategy() {\n var rules = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return merge({\n customizeArray: _customizeArray(rules),\n customizeObject: customizeObject(rules)\n });\n};\nvar mergeSmartStrategy = function mergeSmartStrategy() {\n var rules = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return merge({\n customizeArray: function customizeArray(a, b, key) {\n var topKey = key.split('.').slice(-1)[0];\n\n if (isRule(topKey)) {\n switch (rules[key]) {\n case 'prepend':\n return [].concat(_toConsumableArray((0, _differenceWith3.default)(b, a, function (newRule, seenRule) {\n return (0, _joinArraysSmart.uniteRules)(rules, key, newRule, seenRule, 'prepend');\n })), _toConsumableArray(a));\n case 'replace':\n return b;\n default:\n // append\n return (0, _unionWith3.default)(a, b, _joinArraysSmart.uniteRules.bind(null, rules, key));\n }\n }\n\n return _customizeArray(rules)(a, b, key);\n },\n customizeObject: customizeObject(rules)\n });\n};\n\nfunction _customizeArray(rules) {\n return function (a, b, key) {\n switch (rules[key]) {\n case 'prepend':\n return [].concat(_toConsumableArray(b), _toConsumableArray(a));\n case 'replace':\n return b;\n default:\n // append\n return false;\n }\n };\n}\n\nfunction customizeObject(rules) {\n return function (a, b, key) {\n switch (rules[key]) {\n case 'prepend':\n return (0, _mergeWith3.default)({}, b, a, (0, _joinArrays2.default)());\n case 'replace':\n return b;\n default:\n // append\n return false;\n }\n };\n}\n\nfunction isRule(key) {\n return ['preLoaders', 'loaders', 'postLoaders', 'rules'].indexOf(key) >= 0;\n}\n\nmodule.exports = merge;\nmodule.exports.multiple = mergeMultiple;\nmodule.exports.smart = mergeSmart;\nmodule.exports.strategy = mergeStrategy;\nmodule.exports.smartStrategy = mergeSmartStrategy;\nmodule.exports.unique = _unique2.default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)-merge/lib/index.js\n// module id = 810\n// module chunks = 0 1 2","var baseValues = require('./_baseValues'),\n keys = require('./keys');\n\n/**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\nfunction values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n}\n\nmodule.exports = values;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/values.js\n// module id = 811\n// module chunks = 0 1 2","var arrayMap = require('./_arrayMap');\n\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n}\n\nmodule.exports = baseValues;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseValues.js\n// module id = 812\n// module chunks = 0 1 2","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseTimes.js\n// module id = 813\n// module chunks = 0 1 2","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseIsArguments.js\n// module id = 814\n// module chunks = 0 1 2","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_getRawTag.js\n// module id = 815\n// module chunks = 0 1 2","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_objectToString.js\n// module id = 816\n// module chunks = 0 1 2","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/stubFalse.js\n// module id = 817\n// module chunks = 0 1 2","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseIsTypedArray.js\n// module id = 818\n// module chunks = 0 1 2","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseKeys.js\n// module id = 819\n// module chunks = 0 1 2","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_nativeKeys.js\n// module id = 820\n// module chunks = 0 1 2","var Symbol = require('./_Symbol'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray');\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_isFlattenable.js\n// module id = 821\n// module chunks = 0 1 2","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_overRest.js\n// module id = 822\n// module chunks = 0 1 2","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_apply.js\n// module id = 823\n// module chunks = 0 1 2","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_setToString.js\n// module id = 824\n// module chunks = 0 1 2","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseSetToString.js\n// module id = 825\n// module chunks = 0 1 2","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/constant.js\n// module id = 826\n// module chunks = 0 1 2","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseIsNative.js\n// module id = 827\n// module chunks = 0 1 2","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_isMasked.js\n// module id = 828\n// module chunks = 0 1 2","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_coreJsData.js\n// module id = 829\n// module chunks = 0 1 2","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_getValue.js\n// module id = 830\n// module chunks = 0 1 2","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_shortOut.js\n// module id = 831\n// module chunks = 0 1 2","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n cacheHas = require('./_cacheHas'),\n createSet = require('./_createSet'),\n setToArray = require('./_setToArray');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseUniq;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseUniq.js\n// module id = 832\n// module chunks = 0 1 2","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_mapCacheClear.js\n// module id = 833\n// module chunks = 0 1 2","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_Hash.js\n// module id = 834\n// module chunks = 0 1 2","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_hashClear.js\n// module id = 835\n// module chunks = 0 1 2","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_hashDelete.js\n// module id = 836\n// module chunks = 0 1 2","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_hashGet.js\n// module id = 837\n// module chunks = 0 1 2","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_hashHas.js\n// module id = 838\n// module chunks = 0 1 2","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_hashSet.js\n// module id = 839\n// module chunks = 0 1 2","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_listCacheClear.js\n// module id = 840\n// module chunks = 0 1 2","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_listCacheDelete.js\n// module id = 841\n// module chunks = 0 1 2","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_listCacheGet.js\n// module id = 842\n// module chunks = 0 1 2","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_listCacheHas.js\n// module id = 843\n// module chunks = 0 1 2","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_listCacheSet.js\n// module id = 844\n// module chunks = 0 1 2","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_mapCacheDelete.js\n// module id = 845\n// module chunks = 0 1 2","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_isKeyable.js\n// module id = 846\n// module chunks = 0 1 2","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_mapCacheGet.js\n// module id = 847\n// module chunks = 0 1 2","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_mapCacheHas.js\n// module id = 848\n// module chunks = 0 1 2","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_mapCacheSet.js\n// module id = 849\n// module chunks = 0 1 2","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nmodule.exports = setCacheAdd;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_setCacheAdd.js\n// module id = 850\n// module chunks = 0 1 2","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_setCacheHas.js\n// module id = 851\n// module chunks = 0 1 2","var baseFindIndex = require('./_baseFindIndex'),\n baseIsNaN = require('./_baseIsNaN'),\n strictIndexOf = require('./_strictIndexOf');\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nmodule.exports = baseIndexOf;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseIndexOf.js\n// module id = 852\n// module chunks = 0 1 2","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseFindIndex;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseFindIndex.js\n// module id = 853\n// module chunks = 0 1 2","/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nmodule.exports = baseIsNaN;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseIsNaN.js\n// module id = 854\n// module chunks = 0 1 2","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = strictIndexOf;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_strictIndexOf.js\n// module id = 855\n// module chunks = 0 1 2","var Set = require('./_Set'),\n noop = require('./noop'),\n setToArray = require('./_setToArray');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\nmodule.exports = createSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_createSet.js\n// module id = 856\n// module chunks = 0 1 2","/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nmodule.exports = noop;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/noop.js\n// module id = 857\n// module chunks = 0 1 2","var Stack = require('./_Stack'),\n assignMergeValue = require('./_assignMergeValue'),\n baseFor = require('./_baseFor'),\n baseMergeDeep = require('./_baseMergeDeep'),\n isObject = require('./isObject'),\n keysIn = require('./keysIn'),\n safeGet = require('./_safeGet');\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n if (isObject(srcValue)) {\n stack || (stack = new Stack);\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nmodule.exports = baseMerge;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseMerge.js\n// module id = 858\n// module chunks = 0 1 2","var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_stackClear.js\n// module id = 859\n// module chunks = 0 1 2","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_stackDelete.js\n// module id = 860\n// module chunks = 0 1 2","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_stackGet.js\n// module id = 861\n// module chunks = 0 1 2","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_stackHas.js\n// module id = 862\n// module chunks = 0 1 2","var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_stackSet.js\n// module id = 863\n// module chunks = 0 1 2","var createBaseFor = require('./_createBaseFor');\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseFor.js\n// module id = 864\n// module chunks = 0 1 2","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_createBaseFor.js\n// module id = 865\n// module chunks = 0 1 2","var assignMergeValue = require('./_assignMergeValue'),\n cloneBuffer = require('./_cloneBuffer'),\n cloneTypedArray = require('./_cloneTypedArray'),\n copyArray = require('./_copyArray'),\n initCloneObject = require('./_initCloneObject'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isArrayLikeObject = require('./isArrayLikeObject'),\n isBuffer = require('./isBuffer'),\n isFunction = require('./isFunction'),\n isObject = require('./isObject'),\n isPlainObject = require('./isPlainObject'),\n isTypedArray = require('./isTypedArray'),\n safeGet = require('./_safeGet'),\n toPlainObject = require('./toPlainObject');\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nmodule.exports = baseMergeDeep;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseMergeDeep.js\n// module id = 866\n// module chunks = 0 1 2","var isObject = require('./isObject');\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nmodule.exports = baseCreate;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseCreate.js\n// module id = 867\n// module chunks = 0 1 2","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nmodule.exports = toPlainObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/toPlainObject.js\n// module id = 868\n// module chunks = 0 1 2","var isObject = require('./isObject'),\n isPrototype = require('./_isPrototype'),\n nativeKeysIn = require('./_nativeKeysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeysIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseKeysIn.js\n// module id = 869\n// module chunks = 0 1 2","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = nativeKeysIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_nativeKeysIn.js\n// module id = 870\n// module chunks = 0 1 2","var baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nmodule.exports = createAssigner;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_createAssigner.js\n// module id = 871\n// module chunks = 0 1 2","var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_isIterateeCall.js\n// module id = 872\n// module chunks = 0 1 2","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n arrayMap = require('./_arrayMap'),\n baseUnary = require('./_baseUnary'),\n cacheHas = require('./_cacheHas');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\nfunction baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseDifference;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseDifference.js\n// module id = 873\n// module chunks = 0 1 2","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _mergeWith2 = require('lodash/mergeWith');\n\nvar _mergeWith3 = _interopRequireDefault(_mergeWith2);\n\nvar _isPlainObject2 = require('lodash/isPlainObject');\n\nvar _isPlainObject3 = _interopRequireDefault(_isPlainObject2);\n\nvar _isFunction2 = require('lodash/isFunction');\n\nvar _isFunction3 = _interopRequireDefault(_isFunction2);\n\nvar _cloneDeep2 = require('lodash/cloneDeep');\n\nvar _cloneDeep3 = _interopRequireDefault(_cloneDeep2);\n\nexports.default = joinArrays;\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar isArray = Array.isArray;\n\nfunction joinArrays() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n customizeArray = _ref.customizeArray,\n customizeObject = _ref.customizeObject,\n key = _ref.key;\n\n return function _joinArrays(a, b, k) {\n var newKey = key ? key + '.' + k : k;\n\n if ((0, _isFunction3.default)(a) && (0, _isFunction3.default)(b)) {\n return function () {\n return _joinArrays(a.apply(undefined, arguments), b.apply(undefined, arguments), k);\n };\n }\n if (isArray(a) && isArray(b)) {\n var customResult = customizeArray && customizeArray(a, b, newKey);\n\n return customResult || [].concat(_toConsumableArray(a), _toConsumableArray(b));\n }\n\n if ((0, _isPlainObject3.default)(a) && (0, _isPlainObject3.default)(b)) {\n var _customResult = customizeObject && customizeObject(a, b, newKey);\n\n return _customResult || (0, _mergeWith3.default)({}, a, b, joinArrays({\n customizeArray: customizeArray,\n customizeObject: customizeObject,\n key: newKey\n }));\n }\n\n if ((0, _isPlainObject3.default)(b)) {\n return (0, _cloneDeep3.default)(b);\n }\n\n if (isArray(b)) {\n return [].concat(_toConsumableArray(b));\n }\n\n return b;\n };\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)-merge/lib/join-arrays.js\n// module id = 874\n// module chunks = 0 1 2","var baseClone = require('./_baseClone');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nmodule.exports = cloneDeep;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/cloneDeep.js\n// module id = 875\n// module chunks = 0 1 2","var Stack = require('./_Stack'),\n arrayEach = require('./_arrayEach'),\n assignValue = require('./_assignValue'),\n baseAssign = require('./_baseAssign'),\n baseAssignIn = require('./_baseAssignIn'),\n cloneBuffer = require('./_cloneBuffer'),\n copyArray = require('./_copyArray'),\n copySymbols = require('./_copySymbols'),\n copySymbolsIn = require('./_copySymbolsIn'),\n getAllKeys = require('./_getAllKeys'),\n getAllKeysIn = require('./_getAllKeysIn'),\n getTag = require('./_getTag'),\n initCloneArray = require('./_initCloneArray'),\n initCloneByTag = require('./_initCloneByTag'),\n initCloneObject = require('./_initCloneObject'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isMap = require('./isMap'),\n isObject = require('./isObject'),\n isSet = require('./isSet'),\n keys = require('./keys');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n\n return result;\n }\n\n if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n\n return result;\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nmodule.exports = baseClone;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseClone.js\n// module id = 876\n// module chunks = 0 1 2","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_arrayEach.js\n// module id = 877\n// module chunks = 0 1 2","var copyObject = require('./_copyObject'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseAssign.js\n// module id = 878\n// module chunks = 0 1 2","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nmodule.exports = baseAssignIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseAssignIn.js\n// module id = 879\n// module chunks = 0 1 2","var copyObject = require('./_copyObject'),\n getSymbols = require('./_getSymbols');\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_copySymbols.js\n// module id = 880\n// module chunks = 0 1 2","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_arrayFilter.js\n// module id = 881\n// module chunks = 0 1 2","var copyObject = require('./_copyObject'),\n getSymbolsIn = require('./_getSymbolsIn');\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_copySymbolsIn.js\n// module id = 882\n// module chunks = 0 1 2","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbolsIn = require('./_getSymbolsIn'),\n keysIn = require('./keysIn');\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nmodule.exports = getAllKeysIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_getAllKeysIn.js\n// module id = 883\n// module chunks = 0 1 2","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_DataView.js\n// module id = 884\n// module chunks = 0 1 2","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_Promise.js\n// module id = 885\n// module chunks = 0 1 2","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_WeakMap.js\n// module id = 886\n// module chunks = 0 1 2","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nmodule.exports = initCloneArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_initCloneArray.js\n// module id = 887\n// module chunks = 0 1 2","var cloneArrayBuffer = require('./_cloneArrayBuffer'),\n cloneDataView = require('./_cloneDataView'),\n cloneRegExp = require('./_cloneRegExp'),\n cloneSymbol = require('./_cloneSymbol'),\n cloneTypedArray = require('./_cloneTypedArray');\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nmodule.exports = initCloneByTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_initCloneByTag.js\n// module id = 888\n// module chunks = 0 1 2","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nmodule.exports = cloneDataView;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_cloneDataView.js\n// module id = 889\n// module chunks = 0 1 2","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nmodule.exports = cloneRegExp;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_cloneRegExp.js\n// module id = 890\n// module chunks = 0 1 2","var Symbol = require('./_Symbol');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nmodule.exports = cloneSymbol;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_cloneSymbol.js\n// module id = 891\n// module chunks = 0 1 2","var baseIsMap = require('./_baseIsMap'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nmodule.exports = isMap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isMap.js\n// module id = 892\n// module chunks = 0 1 2","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nmodule.exports = baseIsMap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseIsMap.js\n// module id = 893\n// module chunks = 0 1 2","var baseIsSet = require('./_baseIsSet'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nmodule.exports = isSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isSet.js\n// module id = 894\n// module chunks = 0 1 2","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nmodule.exports = baseIsSet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseIsSet.js\n// module id = 895\n// module chunks = 0 1 2","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.uniteEntries = exports.uniteRules = undefined;\n\nvar _unionWith2 = require('lodash/unionWith');\n\nvar _unionWith3 = _interopRequireDefault(_unionWith2);\n\nvar _differenceWith2 = require('lodash/differenceWith');\n\nvar _differenceWith3 = _interopRequireDefault(_differenceWith2);\n\nvar _mergeWith2 = require('lodash/mergeWith');\n\nvar _mergeWith3 = _interopRequireDefault(_mergeWith2);\n\nvar _isEqual2 = require('lodash/isEqual');\n\nvar _isEqual3 = _interopRequireDefault(_isEqual2);\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nvar isArray = Array.isArray;\n\nfunction uniteRules(rules, key, newRule, rule) {\n if (String(rule.test) !== String(newRule.test) || (newRule.enforce || rule.enforce) && rule.enforce !== newRule.enforce || newRule.include && !isSameValue(rule.include, newRule.include) || newRule.exclude && !isSameValue(rule.exclude, newRule.exclude)) {\n return false;\n } else if (!rule.test && !rule.include && !rule.exclude && (rule.loader && rule.loader.split('?')[0]) !== (newRule.loader && newRule.loader.split('?')[0])) {\n // Don't merge the rule if there isn't any identifying fields and the loaders don't match\n return false;\n } else if ((rule.include || rule.exclude) && !newRule.include && !newRule.exclude) {\n // Don't merge child without include/exclude to parent that has either\n return false;\n }\n\n // apply the same logic for oneOf\n if (rule.oneOf && newRule.oneOf) {\n rule.oneOf = (0, _unionWith3.default)(rule.oneOf, newRule.oneOf, uniteRules.bind(null, {}, 'oneOf'));\n\n return true;\n }\n\n // newRule.loader should always override use, loaders and oneOf\n if (newRule.loader) {\n var optionsKey = newRule.options ? 'options' : newRule.query && 'query';\n\n delete rule.use;\n delete rule.loaders;\n delete rule.oneOf;\n\n rule.loader = newRule.loader;\n\n if (optionsKey) {\n rule[optionsKey] = newRule[optionsKey];\n }\n } else if (newRule.oneOf) {\n delete rule.use;\n delete rule.loaders;\n delete rule.loader;\n\n rule.oneOf = newRule.oneOf;\n } else if ((rule.use || rule.loaders || rule.loader) && (newRule.use || newRule.loaders)) {\n var expandEntry = function expandEntry(loader) {\n return typeof loader === 'string' ? { loader: loader } : loader;\n };\n // this is only here to avoid breaking existing tests\n var unwrapEntry = function unwrapEntry(entry) {\n return !entry.options && !entry.query ? entry.loader : entry;\n };\n\n var entries = void 0;\n if (rule.loader) {\n var _optionsKey = rule.options ? 'options' : rule.query && 'query';\n entries = [{ loader: rule.loader }];\n\n if (_optionsKey) {\n entries[0][_optionsKey] = rule[_optionsKey];\n }\n\n delete rule.loader;\n\n if (_optionsKey) {\n delete rule[_optionsKey];\n }\n } else {\n entries = [].concat(rule.use || rule.loaders).map(expandEntry);\n }\n var newEntries = [].concat(newRule.use || newRule.loaders).map(expandEntry);\n\n var loadersKey = rule.use || newRule.use ? 'use' : 'loaders';\n var resolvedKey = key + '.' + loadersKey;\n\n switch (rules[resolvedKey]) {\n case 'prepend':\n rule[loadersKey] = [].concat(_toConsumableArray((0, _differenceWith3.default)(newEntries, entries, uniteEntries)), _toConsumableArray(entries)).map(unwrapEntry);\n break;\n case 'replace':\n rule[loadersKey] = newRule.use || newRule.loaders;\n break;\n default:\n rule[loadersKey] = combineEntries(newEntries, entries).map(unwrapEntry);\n }\n }\n\n if (newRule.include) {\n rule.include = newRule.include;\n }\n\n if (newRule.exclude) {\n rule.exclude = newRule.exclude;\n }\n\n return true;\n}\n\n/**\n * Check equality of two values using lodash's isEqual\n * Arrays need to be sorted for equality checking\n * but clone them first so as not to disrupt the sort order in tests\n */\nfunction isSameValue(a, b) {\n var _map = [a, b].map(function (value) {\n return isArray(value) ? [].concat(_toConsumableArray(value)).sort() : value;\n }),\n _map2 = _slicedToArray(_map, 2),\n propA = _map2[0],\n propB = _map2[1];\n\n return (0, _isEqual3.default)(propA, propB);\n}\n\nfunction areEqualEntries(newEntry, entry) {\n var loaderNameRe = /^([^?]+)/ig;\n\n var _entry$loader$match = entry.loader.match(loaderNameRe),\n _entry$loader$match2 = _slicedToArray(_entry$loader$match, 1),\n loaderName = _entry$loader$match2[0];\n\n var _newEntry$loader$matc = newEntry.loader.match(loaderNameRe),\n _newEntry$loader$matc2 = _slicedToArray(_newEntry$loader$matc, 1),\n newLoaderName = _newEntry$loader$matc2[0];\n\n return loaderName === newLoaderName;\n}\n\nfunction uniteEntries(newEntry, entry) {\n if (areEqualEntries(newEntry, entry)) {\n // Replace query values with newer ones\n (0, _mergeWith3.default)(entry, newEntry);\n return true;\n }\n return false;\n}\n\n/* Combines entries and newEntries, while respecting the order of loaders in each.\n\nIterates through new entries. If the new entry also exists in existing entries,\nwe'll put in all of the loaders from existing entries that come before it (in case\nthose are pre-requisites). Any remaining existing entries are added at the end.\n\nSince webpack processes right-to-left, we're working backwards through the arrays\n*/\nfunction combineEntries(newEntries, existingEntries) {\n var resultSet = [];\n\n // We're iterating through newEntries, this keeps track of where we are in the existingEntries\n var existingEntriesIteratorIndex = existingEntries.length - 1;\n\n for (var i = newEntries.length - 1; i >= 0; i -= 1) {\n var currentEntry = newEntries[i];\n var indexInExistingEntries = findLastIndexUsingComparinator(existingEntries, currentEntry, areEqualEntries, existingEntriesIteratorIndex);\n var hasEquivalentEntryInExistingEntries = indexInExistingEntries !== -1;\n\n if (hasEquivalentEntryInExistingEntries) {\n // If the same entry exists in existing entries, we should add all of the entries that\n // come before to maintain order\n for (var j = existingEntriesIteratorIndex; j > indexInExistingEntries; j -= 1) {\n var existingEntry = existingEntries[j];\n\n // If this entry also exists in new entries, we'll add as part of iterating through\n // new entries so that if there's a conflict between existing entries and new entries,\n // new entries order wins\n var hasMatchingEntryInNewEntries = findLastIndexUsingComparinator(newEntries, existingEntry, areEqualEntries, i) !== -1;\n\n if (!hasMatchingEntryInNewEntries) {\n resultSet.unshift(existingEntry);\n }\n existingEntriesIteratorIndex -= 1;\n }\n\n uniteEntries(currentEntry, existingEntries[existingEntriesIteratorIndex]);\n // uniteEntries mutates the second parameter to be a merged version, so that's what's pushed\n resultSet.unshift(existingEntries[existingEntriesIteratorIndex]);\n\n existingEntriesIteratorIndex -= 1;\n } else {\n var alreadyHasMatchingEntryInResultSet = findLastIndexUsingComparinator(resultSet, currentEntry, areEqualEntries) !== -1;\n\n if (!alreadyHasMatchingEntryInResultSet) {\n resultSet.unshift(currentEntry);\n }\n }\n }\n\n // Add remaining existing entries\n for (existingEntriesIteratorIndex; existingEntriesIteratorIndex >= 0; existingEntriesIteratorIndex -= 1) {\n\n var _existingEntry = existingEntries[existingEntriesIteratorIndex];\n var _alreadyHasMatchingEntryInResultSet = findLastIndexUsingComparinator(resultSet, _existingEntry, areEqualEntries) !== -1;\n\n if (!_alreadyHasMatchingEntryInResultSet) {\n resultSet.unshift(_existingEntry);\n }\n }\n\n return resultSet;\n}\n\nfunction findLastIndexUsingComparinator(entries, entryToFind, comparinator, startingIndex) {\n startingIndex = startingIndex || entries.length - 1;\n for (var i = startingIndex; i >= 0; i -= 1) {\n if (areEqualEntries(entryToFind, entries[i])) {\n return i;\n }\n }\n return -1;\n}\n\nexports.uniteRules = uniteRules;\nexports.uniteEntries = uniteEntries;\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)-merge/lib/join-arrays-smart.js\n// module id = 896\n// module chunks = 0 1 2","var baseIsEqual = require('./_baseIsEqual');\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nmodule.exports = isEqual;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isEqual.js\n// module id = 897\n// module chunks = 0 1 2","var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseIsEqual.js\n// module id = 898\n// module chunks = 0 1 2","var Stack = require('./_Stack'),\n equalArrays = require('./_equalArrays'),\n equalByTag = require('./_equalByTag'),\n equalObjects = require('./_equalObjects'),\n getTag = require('./_getTag'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isTypedArray = require('./isTypedArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseIsEqualDeep.js\n// module id = 899\n// module chunks = 0 1 2","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arraySome;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_arraySome.js\n// module id = 900\n// module chunks = 0 1 2","var Symbol = require('./_Symbol'),\n Uint8Array = require('./_Uint8Array'),\n eq = require('./eq'),\n equalArrays = require('./_equalArrays'),\n mapToArray = require('./_mapToArray'),\n setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_equalByTag.js\n// module id = 901\n// module chunks = 0 1 2","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nmodule.exports = mapToArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_mapToArray.js\n// module id = 902\n// module chunks = 0 1 2","var getAllKeys = require('./_getAllKeys');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalObjects;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_equalObjects.js\n// module id = 903\n// module chunks = 0 1 2","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _differenceWith2 = require('lodash/differenceWith');\n\nvar _differenceWith3 = _interopRequireDefault(_differenceWith2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction mergeUnique(key, uniques) {\n var getter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (a) {\n return a;\n };\n\n return function (a, b, k) {\n return k === key && [].concat(_toConsumableArray(a), _toConsumableArray((0, _differenceWith3.default)(b, a, function (item) {\n return uniques.indexOf(getter(item)) >= 0;\n })));\n };\n}\n\nexports.default = mergeUnique;\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)-merge/lib/unique.js\n// module id = 904\n// module chunks = 0 1 2","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-516d5d0c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./timing.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./timing.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./timing.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-516d5d0c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./timing.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue\n// module id = 993\n// module chunks = 0 6","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/index.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/log.vue","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_arrayMap.js\n// module id = 743\n// module chunks = 0 1 2","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_arrayLikeKeys.js\n// module id = 744\n// module chunks = 0 1 2","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_freeGlobal.js\n// module id = 745\n// module chunks = 0 1 2","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_isIndex.js\n// module id = 746\n// module chunks = 0 1 2","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isLength.js\n// module id = 747\n// module chunks = 0 1 2","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_overArg.js\n// module id = 748\n// module chunks = 0 1 2","var baseFlatten = require('./_baseFlatten'),\n baseRest = require('./_baseRest'),\n baseUniq = require('./_baseUniq'),\n isArrayLikeObject = require('./isArrayLikeObject'),\n last = require('./last');\n\n/**\n * This method is like `_.union` except that it accepts `comparator` which\n * is invoked to compare elements of `arrays`. Result values are chosen from\n * the first array in which the value occurs. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.unionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\nvar unionWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);\n});\n\nmodule.exports = unionWith;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/unionWith.js\n// module id = 749\n// module chunks = 0 1 2","var arrayPush = require('./_arrayPush'),\n isFlattenable = require('./_isFlattenable');\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseFlatten.js\n// module id = 750\n// module chunks = 0 1 2","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/identity.js\n// module id = 751\n// module chunks = 0 1 2","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_defineProperty.js\n// module id = 752\n// module chunks = 0 1 2","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_toSource.js\n// module id = 753\n// module chunks = 0 1 2","var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_MapCache.js\n// module id = 754\n// module chunks = 0 1 2","var baseIndexOf = require('./_baseIndexOf');\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nmodule.exports = arrayIncludes;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_arrayIncludes.js\n// module id = 755\n// module chunks = 0 1 2","/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arrayIncludesWith;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_arrayIncludesWith.js\n// module id = 756\n// module chunks = 0 1 2","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_Set.js\n// module id = 757\n// module chunks = 0 1 2","/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n}\n\nmodule.exports = last;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/last.js\n// module id = 758\n// module chunks = 0 1 2","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignMergeValue;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_assignMergeValue.js\n// module id = 759\n// module chunks = 0 1 2","var root = require('./_root');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nmodule.exports = cloneBuffer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_cloneBuffer.js\n// module id = 760\n// module chunks = 0 1 2","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nmodule.exports = cloneTypedArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_cloneTypedArray.js\n// module id = 761\n// module chunks = 0 1 2","var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_Uint8Array.js\n// module id = 762\n// module chunks = 0 1 2","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nmodule.exports = copyArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_copyArray.js\n// module id = 763\n// module chunks = 0 1 2","var baseCreate = require('./_baseCreate'),\n getPrototype = require('./_getPrototype'),\n isPrototype = require('./_isPrototype');\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nmodule.exports = initCloneObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_initCloneObject.js\n// module id = 764\n// module chunks = 0 1 2","var baseGetTag = require('./_baseGetTag'),\n getPrototype = require('./_getPrototype'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isPlainObject.js\n// module id = 765\n// module chunks = 0 1 2","/**\n * Gets the value at `key`, unless `key` is \"__proto__\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nmodule.exports = safeGet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_safeGet.js\n// module id = 766\n// module chunks = 0 1 2","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignValue;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_assignValue.js\n// module id = 767\n// module chunks = 0 1 2","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nmodule.exports = stubArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/stubArray.js\n// module id = 768\n// module chunks = 0 1 2","var arrayPush = require('./_arrayPush'),\n getPrototype = require('./_getPrototype'),\n getSymbols = require('./_getSymbols'),\n stubArray = require('./stubArray');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nmodule.exports = getSymbolsIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_getSymbolsIn.js\n// module id = 769\n// module chunks = 0 1 2","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_getAllKeys.js\n// module id = 770\n// module chunks = 0 1 2","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseGetAllKeys.js\n// module id = 771\n// module chunks = 0 1 2","var SetCache = require('./_SetCache'),\n arraySome = require('./_arraySome'),\n cacheHas = require('./_cacheHas');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalArrays;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_equalArrays.js\n// module id = 772\n// module chunks = 0 1 2","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport i18n from '@/module/i18n'\n\n/**\n * 状态码表\n */\nlet stateType = [\n {\n code: '',\n label: `${i18n.$t('无')}`\n }, {\n code: 'SUBMITTED_SUCCESS',\n label: `${i18n.$t('提交成功')}`\n }, {\n code: 'RUNNING_EXEUTION',\n label: `${i18n.$t('正在运行')}`\n }, {\n code: 'READY_PAUSE',\n label: `${i18n.$t('准备暂停')}`\n }, {\n code: 'PAUSE',\n label: `${i18n.$t('暂停')}`\n }, {\n code: 'READY_STOP',\n label: `${i18n.$t('准备停止')}`\n }, {\n code: 'STOP',\n label: `${i18n.$t('停止')}`\n }, {\n code: 'FAILURE',\n label: `${i18n.$t('失败')}`\n }, {\n code: 'SUCCESS',\n label: `${i18n.$t('成功')}`\n }, {\n code: 'NEED_FAULT_TOLERANCE',\n label: `${i18n.$t('需要容错')}`\n }, {\n code: 'KILL',\n label: `${i18n.$t('kill')}`\n }, {\n code: 'WAITTING_THREAD',\n label: `${i18n.$t('等待线程')}`\n }, {\n code: 'WAITTING_DEPEND',\n label: `${i18n.$t('等待依赖完成')}`\n }\n]\n\nexport {\n stateType\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/projects/pages/instance/pages/list/_source/common.js","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport merge from 'webpack-merge'\nimport router from '@/conf/home/router'\n\nexport function setUrlParams (o) {\n router.push({\n query: merge(router.history.current.query, o)\n })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/module/util/routerUtil.js","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-2c0a3d2b\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./log.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./log.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./log.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-2c0a3d2b\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./log.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/dag/_source/formModel/log.vue\n// module id = 803\n// module chunks = 1 3 4 5","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/log.vue","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_arrayMap.js\n// module id = 743\n// module chunks = 0 1 2","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_arrayLikeKeys.js\n// module id = 744\n// module chunks = 0 1 2","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_freeGlobal.js\n// module id = 745\n// module chunks = 0 1 2","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_isIndex.js\n// module id = 746\n// module chunks = 0 1 2","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isLength.js\n// module id = 747\n// module chunks = 0 1 2","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_overArg.js\n// module id = 748\n// module chunks = 0 1 2","var baseFlatten = require('./_baseFlatten'),\n baseRest = require('./_baseRest'),\n baseUniq = require('./_baseUniq'),\n isArrayLikeObject = require('./isArrayLikeObject'),\n last = require('./last');\n\n/**\n * This method is like `_.union` except that it accepts `comparator` which\n * is invoked to compare elements of `arrays`. Result values are chosen from\n * the first array in which the value occurs. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.unionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\nvar unionWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);\n});\n\nmodule.exports = unionWith;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/unionWith.js\n// module id = 749\n// module chunks = 0 1 2","var arrayPush = require('./_arrayPush'),\n isFlattenable = require('./_isFlattenable');\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseFlatten.js\n// module id = 750\n// module chunks = 0 1 2","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/identity.js\n// module id = 751\n// module chunks = 0 1 2","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_defineProperty.js\n// module id = 752\n// module chunks = 0 1 2","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_toSource.js\n// module id = 753\n// module chunks = 0 1 2","var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_MapCache.js\n// module id = 754\n// module chunks = 0 1 2","var baseIndexOf = require('./_baseIndexOf');\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nmodule.exports = arrayIncludes;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_arrayIncludes.js\n// module id = 755\n// module chunks = 0 1 2","/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arrayIncludesWith;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_arrayIncludesWith.js\n// module id = 756\n// module chunks = 0 1 2","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_Set.js\n// module id = 757\n// module chunks = 0 1 2","/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n}\n\nmodule.exports = last;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/last.js\n// module id = 758\n// module chunks = 0 1 2","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignMergeValue;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_assignMergeValue.js\n// module id = 759\n// module chunks = 0 1 2","var root = require('./_root');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nmodule.exports = cloneBuffer;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_cloneBuffer.js\n// module id = 760\n// module chunks = 0 1 2","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nmodule.exports = cloneTypedArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_cloneTypedArray.js\n// module id = 761\n// module chunks = 0 1 2","var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_Uint8Array.js\n// module id = 762\n// module chunks = 0 1 2","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nmodule.exports = copyArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_copyArray.js\n// module id = 763\n// module chunks = 0 1 2","var baseCreate = require('./_baseCreate'),\n getPrototype = require('./_getPrototype'),\n isPrototype = require('./_isPrototype');\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nmodule.exports = initCloneObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_initCloneObject.js\n// module id = 764\n// module chunks = 0 1 2","var baseGetTag = require('./_baseGetTag'),\n getPrototype = require('./_getPrototype'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/isPlainObject.js\n// module id = 765\n// module chunks = 0 1 2","/**\n * Gets the value at `key`, unless `key` is \"__proto__\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nmodule.exports = safeGet;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_safeGet.js\n// module id = 766\n// module chunks = 0 1 2","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignValue;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_assignValue.js\n// module id = 767\n// module chunks = 0 1 2","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nmodule.exports = stubArray;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/stubArray.js\n// module id = 768\n// module chunks = 0 1 2","var arrayPush = require('./_arrayPush'),\n getPrototype = require('./_getPrototype'),\n getSymbols = require('./_getSymbols'),\n stubArray = require('./stubArray');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nmodule.exports = getSymbolsIn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_getSymbolsIn.js\n// module id = 769\n// module chunks = 0 1 2","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_getAllKeys.js\n// module id = 770\n// module chunks = 0 1 2","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_baseGetAllKeys.js\n// module id = 771\n// module chunks = 0 1 2","var SetCache = require('./_SetCache'),\n arraySome = require('./_arraySome'),\n cacheHas = require('./_cacheHas');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalArrays;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/lodash/_equalArrays.js\n// module id = 772\n// module chunks = 0 1 2","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport i18n from '@/module/i18n'\n\n/**\n * 状态码表\n */\nlet stateType = [\n {\n code: '',\n label: `${i18n.$t('无')}`\n }, {\n code: 'SUBMITTED_SUCCESS',\n label: `${i18n.$t('提交成功')}`\n }, {\n code: 'RUNNING_EXEUTION',\n label: `${i18n.$t('正在运行')}`\n }, {\n code: 'READY_PAUSE',\n label: `${i18n.$t('准备暂停')}`\n }, {\n code: 'PAUSE',\n label: `${i18n.$t('暂停')}`\n }, {\n code: 'READY_STOP',\n label: `${i18n.$t('准备停止')}`\n }, {\n code: 'STOP',\n label: `${i18n.$t('停止')}`\n }, {\n code: 'FAILURE',\n label: `${i18n.$t('失败')}`\n }, {\n code: 'SUCCESS',\n label: `${i18n.$t('成功')}`\n }, {\n code: 'NEED_FAULT_TOLERANCE',\n label: `${i18n.$t('需要容错')}`\n }, {\n code: 'KILL',\n label: `${i18n.$t('kill')}`\n }, {\n code: 'WAITTING_THREAD',\n label: `${i18n.$t('等待线程')}`\n }, {\n code: 'WAITTING_DEPEND',\n label: `${i18n.$t('等待依赖完成')}`\n }\n]\n\nexport {\n stateType\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/projects/pages/instance/pages/list/_source/common.js","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport merge from 'webpack-merge'\nimport router from '@/conf/home/router'\n\nexport function setUrlParams (o) {\n router.push({\n query: merge(router.history.current.query, o)\n })\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/module/util/routerUtil.js","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-2c0a3d2b\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./log.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./log.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./log.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-2c0a3d2b\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./log.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/dag/_source/formModel/log.vue\n// module id = 803\n// module chunks = 1 3 4 5","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/transfer/transfer.vue"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///./src/js/module/components/transfer/transfer.vue","webpack:///./src/js/module/components/transfer/transfer.vue?8a16","webpack:///./src/js/module/components/transfer/transfer.vue?aa69","webpack:///./src/js/module/components/transfer/transfer.vue?0602","webpack:///src/js/conf/home/pages/security/pages/warningGroups/index.vue","webpack:///src/js/conf/home/pages/security/pages/warningGroups/_source/list.vue","webpack:///src/js/conf/home/pages/security/pages/warningGroups/_source/createWarning.vue","webpack:///./src/js/conf/home/pages/security/pages/warningGroups/_source/list.vue","webpack:///./src/js/conf/home/pages/security/pages/warningGroups/_source/list.vue?4007","webpack:///./src/js/conf/home/pages/security/pages/warningGroups/_source/createWarning.vue","webpack:///./src/js/conf/home/pages/security/pages/warningGroups/_source/createWarning.vue?8aaf","webpack:///./src/js/conf/home/pages/security/pages/warningGroups/index.vue?7708","webpack:///./src/js/conf/home/pages/security/pages/warningGroups/index.vue","webpack:///src/js/module/components/spin/spin.vue","webpack:///src/js/module/components/listConstruction/listConstruction.vue","webpack:///src/js/module/components/secondaryMenu/secondaryMenu.vue","webpack:///src/js/module/components/noData/noData.vue","webpack:///./node_modules/dayjs/dayjs.min.js","webpack:///./src/js/module/components/spin/spin.vue","webpack:///./src/js/module/components/spin/spin.vue?542d","webpack:///./src/js/module/components/spin/spin.vue?9371","webpack:///./src/js/module/components/spin/spin.vue?87eb","webpack:///./src/js/module/components/listConstruction/listConstruction.vue","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?b527","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?50be","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?6117","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?c652","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?7693","webpack:///./src/js/module/components/secondaryMenu/close.png","webpack:///./src/js/module/components/secondaryMenu/open.png","webpack:///./src/js/module/components/secondaryMenu/menu.js","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?048e","webpack:///./src/js/module/filter/filter.js","webpack:///src/js/module/components/conditions/conditions.vue","webpack:///./src/js/module/components/noData/noData.vue","webpack:///./src/js/module/components/noData/noData.vue?93a9","webpack:///./src/js/module/components/noData/noData.vue?86e8","webpack:///./src/js/module/components/noData/noData.vue?5a51","webpack:///./src/js/module/components/noData/images/errorTip.png","webpack:///./src/js/module/filter/formatDate.js","webpack:///./src/js/module/components/conditions/conditions.vue","webpack:///./src/js/module/components/conditions/conditions.vue?8ed7","webpack:///src/js/module/components/transfer/transfer.vue"],"names":["Object","defineProperty","__webpack_exports__","value","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_transfer_vue__","__webpack_require__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_transfer_vue___default","n","__WEBPACK_IMPORT_KEY__","key","d","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_5d5d2e6e_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_transfer_vue__","__vue_styles__","ssrContext","Component","normalizeComponent","a","content","module","i","locals","exports","push","esExports","render","_vm","this","_h","$createElement","_c","_self","ref","attrs","ok-text","$t","nameText","type","name","on","ok","_ok","slot","staticClass","_v","_s","cacheSourceList","length","_l","item","$index","id","click","$event","_ckSource","href","cacheTargetList","_ckTarget","staticRenderFns","data","pageSize","pageNo","total","searchVal","isLoading","alertgroupList","props","methods","assign","_vuex","mapActions","_onConditions","o","_getAlertgroupP","_page","val","_create","self","modal","$modal","dialog","closable","showMask","escClose","className","transitionName","h","_createWarning2","default","onUpdate","remove","close","flag","_this","getAlertgroupP","then","res","totalList","catch","e","watch","created","mounted","components","mSecondaryMenu","_secondaryMenu2","mList","_list2","mListConstruction","_listConstruction2","mConditions","_conditions2","mSpin","_spin2","mNoData","_noData2","_util","list","Array","Number","_closeDelete","$refs","doClose","_delete","deleteAlertgrou","splice","$message","success","msg","error","_edit","findComponentDownward","$root","_mangeUser","_this2","getAuthList","category","sourceListPrs","_lodash2","map","v","userName","targetListPrs","_transfer2","userIds","_grantAuthorization","alertgroupId","_i18n2","api","param","_this3","grantAuthorization","_this4","setTimeout","store","_store2","groupName","groupType","desc","options","code","_verification","_submit","dispatch","warning","spinnerLoading","$emit","mPopup","_popup2","mListBoxF","_listBoxF2","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_9e75a8ec_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue__","width","parseInt","_f","createTime","updateTime","shape","size","data-toggle","icon","title","refInFor","placement","staticStyle","text-align","margin","padding-top","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_createWarning_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_createWarning_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_f33c16ec_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_createWarning_vue__","placeholder","model","callback","$$v","expression","city","label","on-conditions","alertgroup-list","page-no","page-size","current","show-elevator","on-change","_e","is-spin","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_index_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_index_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_4aee3a7f_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_index_vue__","isSpin","Boolean","isLeft","String","menuList","_menu2","index","$route","params","isTogHide","is","layoutBox","$","addClass","removeClass","_toggleSubMenu","isOpen","_toggleMenu","t","r","s","u","f","c","join","z","utcOffset","Math","abs","floor","m","year","month","clone","add","ceil","p","M","y","w","ms","Q","toLowerCase","replace","weekdays","split","months","l","S","g","format","pl","date","D","locale","$L","utc","$u","parse","prototype","$d","Date","NaN","test","match","UTC","init","$y","getFullYear","$M","getMonth","$D","getDate","$W","getDay","$H","getHours","$m","getMinutes","$s","getSeconds","$ms","getMilliseconds","$utils","isValid","toString","isSame","startOf","endOf","isAfter","isBefore","$g","set","day","hour","minute","second","millisecond","unix","valueOf","getTime","toDate","apply","slice","$locale","weekStart","$set","min","daysInMonth","get","setDate","subtract","substr","YY","YYYY","MM","MMM","monthsShort","MMMM","DD","dd","weekdaysMin","ddd","weekdaysShort","dddd","H","HH","hh","A","mm","ss","SSS","Z","round","getTimezoneOffset","diff","toJSON","toISOString","toUTCString","extend","isDayjs","en","Ls","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_16cfa774_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_spin_vue__","class","background","height","xmlns","xmlns:xlink","viewBox","preserveAspectRatio","transform","attributeName","values","keyTimes","dur","begin","repeatCount","fill","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_listConstruction_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_listConstruction_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_eae3645c_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_listConstruction_vue__","_t","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_secondaryMenu_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_secondaryMenu_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_f72bdd3a_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_secondaryMenu_vue__","escape","_i18n","menu","projects","i18n","path","children","security","resource","disabled","user","to","el","tag","active-class","_dayjs","formatDate","fmt","_dayjs2","operation","_ckQuery","trim","computed","isShow","$slots","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noData_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noData_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_2d3808af_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_noData_vue__","_m","src","alt","_vue","_filter","Vue","filter","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_conditions_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_conditions_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_a4fced1a_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_conditions_vue__","on-enterkey","sourceList","targetList","searchSourceVal","searchTargetVal","_sourceQuery","indexOf","_targetQuery","unshift","i1","findIndex","i2","cloneDeep"],"mappings":"qDAAAA,OAAAC,eAAAC,EAAA,cAAAC,OAAA,QAAAC,EAAAC,EAAA,KAAAC,EAAAD,EAAAE,EAAAH,GAAA,QAAAI,KAAAJ,EAAA,YAAAI,GAAA,SAAAC,GAAAJ,EAAAK,EAAAR,EAAAO,EAAA,kBAAAL,EAAAK,KAAA,CAAAD,GAAA,IAAAG,EAAAN,EAAA,MAGA,IASAO,EAZA,SAAAC,GACER,EAAQ,OAgBVS,EAdyBT,EAAQ,GAcjCU,CACET,EAAAU,EACAL,EAAA,GATF,EAWAC,EAPA,KAEA,MAUeV,EAAA,QAAAY,EAAiB,8BCvBhC,IAAAG,EAAcZ,EAAQ,MACtB,iBAAAY,QAA4CC,EAAAC,EAASF,EAAA,MACrDA,EAAAG,SAAAF,EAAAG,QAAAJ,EAAAG,QAEaf,EAAQ,GAARA,CAAsG,WAAAY,GAAA,6BCPnHC,EAAAG,QAA2BhB,EAAQ,GAARA,EAAgE,IAK3FiB,MAAcJ,EAAAC,EAAS,wiCAAwiC,wCCL/jC,IAEAI,GAAiBC,OAFjB,WAA0B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AAE,EAAAnS,EAAAlD,QAAAoV,UAAAjZ,KAAA6B,gBAAA,SAAAoF,GAAA,OAAA3F,EAAAE,KAAAyF,EAAAzF,MACA,IAAA0X,GACAlZ,KAAA6B,gBAAAqE,OAAAgT,EAAA,KAIAzU,OACAiU,gBADA,SACA1V,GACAA,EAIAhD,KAAA4Y,eAHA5Y,KAAAwY,WAAAzR,EAAAlD,QAAAsV,UAAAnZ,KAAAmB,kBAKAwX,gBARA,SAQA3V,GACAA,EAIAhD,KAAA8Y,eAHA9Y,KAAAyY,WAAA1R,EAAAlD,QAAAsV,UAAAnZ,KAAA6B,mBAMA+C,YAAAgE,OAAAC,EAAAhF,QAAAiF,UAAAC,EAAAlF","file":"js/10.73c0240.js","sourcesContent":["function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-5d5d2e6e\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./transfer.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./transfer.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./transfer.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-5d5d2e6e\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./transfer.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/transfer/transfer.vue\n// module id = 1006\n// module chunks = 9 10","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/transfer/transfer.vue"],"sourceRoot":""} \ No newline at end of file diff --git a/escheduler-ui/dist/js/11.685f19d.js b/escheduler-ui/dist/js/11.078cbab.js similarity index 92% rename from escheduler-ui/dist/js/11.685f19d.js rename to escheduler-ui/dist/js/11.078cbab.js index 8b03af9680..293ba32173 100644 --- a/escheduler-ui/dist/js/11.685f19d.js +++ b/escheduler-ui/dist/js/11.078cbab.js @@ -1,2 +1,2 @@ -webpackJsonp([11],{1055:function(t,e,n){"use strict";e.__esModule=!0;var s=n(123),a=d(n(1176)),i=d(n(1057)),o=d(n(646)),r=d(n(663)),u=d(n(670)),l=d(n(654)),c=d(n(650));function d(t){return t&&t.__esModule?t:{default:t}}e.default={name:"udf-function-index",data:function(){return{pageSize:10,pageNo:1,total:20,searchVal:"",isLoading:!1,udfFuncList:[]}},props:{},methods:Object.assign({},(0,s.mapActions)("resource",["getUdfFuncListP"]),{_onConditions:function(t){this.searchVal=t.searchVal,this.pageNo=1,this._getUdfFuncListP()},_page:function(t){this.pageNo=t,this._getUdfFuncListP()},_create:function(){var t=this,e=this.$modal.dialog({closable:!1,showMask:!0,escClose:!0,className:"v-modal-custom",transitionName:"opacityp",render:function(n){return n(i.default,{on:{onUpdate:function(){t._updateList(),e.remove()},close:function(){e.remove()}},props:{}})}})},_updateList:function(){this.pageSize=10,this.pageNo=1,this.searchVal="",this._getUdfFuncListP()},_getUdfFuncListP:function(t){var e=this;this.isLoading=!t,this.getUdfFuncListP({pageSize:this.pageSize,pageNo:this.pageNo,searchVal:this.searchVal}).then(function(t){e.udfFuncList=t.totalList,e.total=t.total,e.isLoading=!1}).catch(function(t){e.isLoading=!1})}}),watch:{},created:function(){},mounted:function(){this._getUdfFuncListP()},components:{mSecondaryMenu:l.default,mListConstruction:c.default,mConditions:u.default,mList:a.default,mSpin:o.default,mCreateUdf:i.default,mNoData:r.default}}},1056:function(t,e,n){"use strict";e.__esModule=!0;var s=n(123);n(668);var a,i=n(1057),o=(a=i)&&a.__esModule?a:{default:a};e.default={name:"udf-manage-list",data:function(){return{list:[]}},props:{udfFuncList:Array,pageNo:Number,pageSize:Number},methods:Object.assign({},(0,s.mapActions)("resource",["deleteUdf"]),{_closeDelete:function(t){this.$refs["poptip-"+t][0].doClose()},_delete:function(t,e){var n=this;this.deleteUdf({id:t.id}).then(function(t){n.$refs["poptip-"+e][0].doClose(),n.list.splice(e,1),n.$message.success(t.msg)}).catch(function(t){n.$refs["poptip-"+e][0].doClose(),n.$message.error(t.msg||"")})},_edit:function(t){var e=this,n=this.$modal.dialog({closable:!1,showMask:!0,escClose:!0,className:"v-modal-custom",transitionName:"opacityp",render:function(s){return s(o.default,{on:{onUpdate:function(){e.$emit("on-update"),n.remove()},close:function(){n.remove()}},props:{item:t}})}})}}),watch:{udfFuncList:function(t){var e=this;this.list=[],setTimeout(function(){e.list=t})}},created:function(){},mounted:function(){this.list=this.udfFuncList},components:{}}},1057:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(1058),a=n.n(s);for(var i in s)"default"!==i&&function(t){n.d(e,t,function(){return s[t]})}(i);var o=n(1181),r=n(27)(a.a,o.a,!1,null,null,null);e.default=r.exports},1058:function(t,e,n){"use strict";e.__esModule=!0;var s=l(n(28)),a=l(n(36)),i=l(n(91)),o=l(n(223)),r=l(n(224)),u=l(n(1177));function l(t){return t&&t.__esModule?t:{default:t}}e.default={name:"udf-create",data:function(){return{store:i.default,type:"HIVE",funcName:"",className:"",argTypes:"",database:"",desc:"",resourceId:{},udfResourceList:[],isUpdate:!1,upDisabled:!1}},props:{item:Object},methods:{_ok:function(){var t=this;this.$refs.popup.spinnerLoading=!0,this._validation()?this._verifyUdfFuncName().then(function(e){t._createUdfFunc().then()}).then(function(e){setTimeout(function(){t.$refs.popup.spinnerLoading=!1},800)}).catch(function(e){t.$refs.popup.spinnerLoading=!1}):this.$refs.popup.spinnerLoading=!1},_createUdfFunc:function(){var t=this;return new Promise(function(e,n){var s={type:t.type,funcName:t.funcName,className:t.className,argTypes:t.argTypes,database:t.database,desc:t.desc,resourceId:t.resourceId.id},a=t.item&&t.item.id||null;a&&(s.id=a),t.store.dispatch("resource/"+(a?"updateUdfFunc":"createUdfFunc"),s).then(function(n){t.$emit("onUpdate",s),t.$message.success(n.msg),e()}).catch(function(e){t.$message.error(e.msg||""),n(e)})})},_onUpdatePresent:function(){this.$refs.popup.apDisabled=!0,this.upDisabled=!0},_getUdfList:function(){var t=this;return new Promise(function(e,n){t.store.dispatch("resource/getResourcesList",{type:"UDF"}).then(function(n){t.udfResourceList=n.data,e()})})},_onUpdate:function(t){var e=this;this.upDisabled=!1,this.udfResourceList.push(t),this.isUpdate=!1,this.$nextTick(function(){e.resourceId=s.default.filter(e.udfResourceList,function(e){return e.id===t.id})[0]}),this.$refs.popup.apDisabled=!1},_toggleUpdate:function(){this.isUpdate=!this.isUpdate,this.isUpdate&&(this.resourceId=null)},_validation:function(){return this.funcName?this.className?!!this.resourceId||(this.$message.warning(""+a.default.$t("请选择UDF资源")),!1):(this.$message.warning(""+a.default.$t("请输入包名类名")),!1):(this.$message.warning(""+a.default.$t("请输入UDF函数名称")),!1)},_verifyUdfFuncName:function(){var t=this;return new Promise(function(e,n){t.item&&t.item.funcName===t.funcName?e():t.store.dispatch("resource/verifyUdfFuncName",{name:t.funcName}).then(function(t){e()}).catch(function(e){t.$message.error(e.msg||""),n(e)})})}},watch:{},created:function(){var t=this;this._getUdfList().then(function(e){t.item?(t.type=t.item.type,t.funcName=t.item.funcName||"",t.className=t.item.className||"",t.argTypes=t.item.argTypes||"",t.database=t.item.database||"",t.desc=t.item.desc||"",t.resourceId=s.default.filter(t.udfResourceList,function(e){return e.id===t.item.resourceId})[0]):t.resourceId=t.udfResourceList.length&&t.udfResourceList[0]||[]})},mounted:function(){},components:{mPopup:o.default,mListBoxF:r.default,mUdfUpdate:u.default}}},1059:function(t,e,n){"use strict";e.__esModule=!0;var s=o(n(30)),a=o(n(36)),i=o(n(91));function o(t){return t&&t.__esModule?t:{default:t}}e.default={name:"udf-update",data:function(){return{store:i.default,udfName:"",udfDesc:"",file:"",progress:0,spinnerLoading:!1}},props:{},methods:{_validation:function(){return this.udfName?!!this.file||(this.$message.warning(""+a.default.$t("请选择要上传的文件")),!1):(this.$message.warning(""+a.default.$t("请输入文件名")),!1)},_verifyName:function(){var t=this;return new Promise(function(e,n){t.store.dispatch("resource/resourceVerifyName",{name:t.udfName,type:"UDF"}).then(function(t){e()}).catch(function(e){t.$message.error(e.msg||""),n(e)})})},_formDataUpdate:function(){var t=this,e=this,n=new FormData;n.append("file",this.file),n.append("type","UDF"),n.append("name",this.udfName),n.append("desc",this.udfDesc),this.spinnerLoading=!0,this.$emit("on-update-present",!1),s.default.post("resources/create",function(e){t.$message.success(e.msg),t.spinnerLoading=!1,t.progress=0,t.$emit("on-update",e.data)},function(e){t.spinnerLoading=!1,t.progress=0,t.$message.error(e.msg||""),t.$emit("on-update",e)},{data:n,emulateJSON:!1,timeout:99999999,onUploadProgress:function(t){var n=t.loaded,s=t.total;e.progress=Math.floor(100*n/s)}})},_ok:function(){var t=this;this._validation()&&this._verifyName().then(function(e){t._formDataUpdate()})}},watch:{},created:function(){},mounted:function(){var t=this;$("#file").change(function(){var e=$("#file")[0].files[0];t.file=e,t.udfName=e.name})},updated:function(){},beforeDestroy:function(){},destroyed:function(){},computed:{},components:{}}},1176:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(1056),a=n.n(s);for(var i in s)"default"!==i&&function(t){n.d(e,t,function(){return s[t]})}(i);var o=n(1182),r=n(27)(a.a,o.a,!1,null,null,null);e.default=r.exports},1177:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(1059),a=n.n(s);for(var i in s)"default"!==i&&function(t){n.d(e,t,function(){return s[t]})}(i);var o=n(1180);var r=function(t){n(1178)},u=n(27)(a.a,o.a,!1,r,null,null);e.default=u.exports},1178:function(t,e,n){var s=n(1179);"string"==typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);n(35)("28933aae",s,!0,{})},1179:function(t,e,n){(t.exports=n(34)(!1)).push([t.i,".update-udf-model{min-height:40px;border-radius:3px;margin-top:-10px;margin-bottom:-10px}.update-udf-model .update-udf-box ul li{margin-bottom:8px}.update-udf-model .update-udf-box ul li .v-input textarea{min-height:60px!important}.update-udf-model .update-udf-box ul li .update-pbx{position:relative}.update-udf-model .update-udf-box ul li .update-pbx .p1{right:0;top:0;width:82px;height:28px;overflow:hidden}.update-udf-model .update-udf-box ul li .update-pbx .p1 .file-update{position:absolute;left:0;top:0;opacity:0;cursor:pointer}",""])},1180:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"update-udf-model"},[n("div",{staticClass:"update-udf-box"},[n("ul",[n("li",[n("div",{staticClass:"update-pbx"},[n("x-input",{staticStyle:{width:"268px"},attrs:{type:"input",size:"small",disabled:0!==t.progress,placeholder:t.$t("请输入资源名称"),autocomplete:"off"},model:{value:t.udfName,callback:function(e){t.udfName=e},expression:"udfName"}}),t._v(" "),n("div",{staticClass:"p1",staticStyle:{position:"absolute"}},[t.progress?t._e():n("input",{staticClass:"file-update",attrs:{name:"file",id:"file",type:"file"}}),t._v(" "),n("x-button",{attrs:{type:"dashed",size:"small",disabled:0!==t.progress}},[t._v(" "+t._s(t.$t("点击上传"))+" ")])],1)],1)]),t._v(" "),n("li",[n("x-input",{attrs:{type:"textarea",size:"small",disabled:0!==t.progress,placeholder:t.$t("请输入资源描述"),autocomplete:"off"},model:{value:t.udfDesc,callback:function(e){t.udfDesc=e},expression:"udfDesc"}})],1),t._v(" "),n("li",{staticStyle:{"margin-top":"-4px","margin-bottom":"8px"}},[n("x-button",{attrs:{type:"success",size:"xsmall",long:"",loading:t.spinnerLoading},on:{click:t._ok}},[t._v(t._s(t.spinnerLoading?"Loading... ("+t.progress+"%)":t.$t("上传UDF资源")))])],1)])])])},staticRenderFns:[]};e.a=s},1181:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("m-popup",{ref:"popup",attrs:{"ok-text":t.item?t.$t("编辑"):t.$t("确定提交"),nameText:t.item?t.$t("编辑UDF函数"):t.$t("创建UDF函数")},on:{ok:t._ok}},[n("template",{slot:"content"},[n("div",{staticClass:"udf-create-model"},[n("m-list-box-f",[n("template",{slot:"name"},[n("b",[t._v("*")]),t._v(t._s(t.$t("类型")))]),t._v(" "),n("template",{slot:"content"},[n("x-radio-group",{model:{value:t.type,callback:function(e){t.type=e},expression:"type"}},[n("x-radio",{attrs:{label:"HIVE"}},[t._v("HIVE UDF")])],1)],1)],2),t._v(" "),n("m-list-box-f",[n("template",{slot:"name"},[n("b",[t._v("*")]),t._v(t._s(t.$t("UDF函数名称")))]),t._v(" "),n("template",{slot:"content"},[n("x-input",{attrs:{type:"input",maxlength:"40",placeholder:t.$t("请输入函数名")},model:{value:t.funcName,callback:function(e){t.funcName=e},expression:"funcName"}})],1)],2),t._v(" "),n("m-list-box-f",[n("template",{slot:"name"},[n("b",[t._v("*")]),t._v(t._s(t.$t("包名类名")))]),t._v(" "),n("template",{slot:"content"},[n("x-input",{attrs:{type:"input",maxlength:"40",placeholder:t.$t("请输入包名类名")},model:{value:t.className,callback:function(e){t.className=e},expression:"className"}})],1)],2),t._v(" "),n("m-list-box-f",[n("template",{slot:"name"},[t._v(t._s(t.$t("参数")))]),t._v(" "),n("template",{slot:"content"},[n("x-input",{attrs:{type:"input",placeholder:t.$t("请输入参数")},model:{value:t.argTypes,callback:function(e){t.argTypes=e},expression:"argTypes"}})],1)],2),t._v(" "),n("m-list-box-f",[n("template",{slot:"name"},[t._v(t._s(t.$t("数据库名")))]),t._v(" "),n("template",{slot:"content"},[n("x-input",{attrs:{type:"input",placeholder:t.$t("请输入数据库名")},model:{value:t.database,callback:function(e){t.database=e},expression:"database"}})],1)],2),t._v(" "),n("m-list-box-f",[n("template",{slot:"name"},[n("b",[t._v("*")]),t._v(t._s(t.$t("UDF资源")))]),t._v(" "),n("template",{slot:"content"},[n("x-select",{staticStyle:{width:"200px"},attrs:{filterable:"",disabled:t.isUpdate},model:{value:t.resourceId,callback:function(e){t.resourceId=e},expression:"resourceId"}},t._l(t.udfResourceList,function(t){return n("x-option",{key:t.id,attrs:{value:t,label:t.alias}})}),1),t._v(" "),n("x-button",{attrs:{type:"primary",disabled:t.upDisabled},on:{click:t._toggleUpdate}},[t._v(t._s(t.$t("上传资源")))])],1)],2),t._v(" "),t.isUpdate?n("m-list-box-f",[n("template",{slot:"name"},[t._v(" ")]),t._v(" "),n("template",{slot:"content"},[n("m-udf-update",{on:{"on-update-present":t._onUpdatePresent,"on-update":t._onUpdate}})],1)],2):t._e(),t._v(" "),n("m-list-box-f",[n("template",{slot:"name"},[t._v(t._s(t.$t("使用说明")))]),t._v(" "),n("template",{slot:"content"},[n("x-input",{attrs:{type:"textarea",placeholder:t.$t("请输入使用说明")},model:{value:t.desc,callback:function(e){t.desc=e},expression:"desc"}})],1)],2)],1)])],2)},staticRenderFns:[]};e.a=s},1182:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"list-model"},[n("div",{staticClass:"table-box"},[n("table",{staticClass:"fixed"},[n("tr",[n("th",[n("span",[t._v(t._s(t.$t("编号")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("UDF函数名称")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("类名")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("参数")))])]),t._v(" "),n("th",{attrs:{width:"80"}},[n("span",[t._v(t._s(t.$t("类型")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("描述")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("jar包")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("库名")))])]),t._v(" "),n("th",{attrs:{width:"140"}},[n("span",[t._v(t._s(t.$t("更新时间")))])]),t._v(" "),n("th",{attrs:{width:"80"}},[n("span",[t._v(t._s(t.$t("操作")))])])]),t._v(" "),t._l(t.list,function(e,s){return n("tr",{key:s},[n("td",[n("span",[t._v(t._s(s+1))])]),t._v(" "),n("td",[n("span",{staticClass:"ellipsis"},[n("a",{staticClass:"links",attrs:{href:"javascript:"}},[t._v(t._s(e.funcName))])])]),t._v(" "),n("td",[n("span",{staticClass:"ellipsis"},[t._v(t._s(e.className||"-"))])]),t._v(" "),n("td",[n("span",[t._v(t._s(e.argTypes||"-"))])]),t._v(" "),n("td",[n("span",[t._v(t._s(e.type))])]),t._v(" "),n("td",[n("span",{staticClass:"ellipsis"},[t._v(t._s(e.desc||"-"))])]),t._v(" "),n("td",[n("span",[t._v(t._s(e.resourceName))])]),t._v(" "),n("td",[n("span",[t._v(t._s(e.database||"-"))])]),t._v(" "),n("td",[n("span",[t._v(t._s(t._f("formatDate")(e.updateTime)))])]),t._v(" "),n("td",[n("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"info",shape:"circle",size:"xsmall","data-toggle":"tooltip",title:t.$t("编辑"),icon:"iconfont icon-bianjixiugai"},on:{click:function(n){return t._edit(e)}}}),t._v(" "),n("x-poptip",{ref:"poptip-"+s,refInFor:!0,attrs:{placement:"bottom-end",width:"90"}},[n("p",[t._v(t._s(t.$t("确定删除吗?")))]),t._v(" "),n("div",{staticStyle:{"text-align":"right",margin:"0","padding-top":"4px"}},[n("x-button",{attrs:{type:"text",size:"xsmall",shape:"circle"},on:{click:function(e){return t._closeDelete(s)}}},[t._v(t._s(t.$t("取消")))]),t._v(" "),n("x-button",{attrs:{type:"primary",size:"xsmall",shape:"circle"},on:{click:function(n){return t._delete(e,s)}}},[t._v(t._s(t.$t("确定")))])],1),t._v(" "),n("template",{slot:"reference"},[n("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"error",shape:"circle",size:"xsmall",icon:"iconfont icon-shanchu","data-toggle":"tooltip",title:t.$t("删除")}})],1)],2)],1)])})],2)])])},staticRenderFns:[]};e.a=s},1183:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"main-layout-box"},[n("m-secondary-menu",{attrs:{type:"resource"}}),t._v(" "),n("m-list-construction",{attrs:{title:t.$t("UDF函数管理")}},[n("template",{slot:"conditions"},[n("m-conditions",{on:{"on-conditions":t._onConditions}},[n("template",{slot:"button-group"},[n("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"ghost",size:"small"},on:{click:t._create}},[t._v(t._s(t.$t("创建UDF函数")))])],1)],2)],1),t._v(" "),n("template",{slot:"content"},[t.udfFuncList.length?[n("m-list",{attrs:{"udf-func-list":t.udfFuncList,"page-no":t.pageNo,"page-size":t.pageSize},on:{"on-update":t._updateList}}),t._v(" "),n("div",{staticClass:"page-box"},[n("x-page",{attrs:{current:t.pageNo,total:t.total,"show-elevator":""},on:{"on-change":t._page}})],1)]:t._e(),t._v(" "),t.udfFuncList.length?t._e():[n("m-no-data")],t._v(" "),n("m-spin",{attrs:{"is-spin":t.isLoading}})],2)],2)],1)},staticRenderFns:[]};e.a=s},625:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(1055),a=n.n(s);for(var i in s)"default"!==i&&function(t){n.d(e,t,function(){return s[t]})}(i);var o=n(1183),r=n(27)(a.a,o.a,!1,null,null,null);e.default=r.exports},639:function(t,e,n){"use strict";e.__esModule=!0,e.default={name:"spin",data:function(){return{}},props:{isSpin:{type:Boolean,default:!0},isLeft:{type:Boolean,default:!0}}}},640:function(t,e,n){"use strict";e.__esModule=!0,e.default={name:"list-construction",data:function(){return{}},props:{title:String}}},641:function(t,e,n){"use strict";e.__esModule=!0;var s,a=n(659),i=(s=a)&&s.__esModule?s:{default:s};e.default={name:"secondary-menu",data:function(){return{menuList:(0,i.default)(this.type),index:0,id:this.$route.params.id,isTogHide:!1}},props:{type:String,className:String},watch:{isTogHide:function(t){var e=$(".main-layout-box");t?e.addClass("toggle"):e.removeClass("toggle")}},methods:{_toggleSubMenu:function(t){t.isOpen=!t.isOpen},_toggleMenu:function(){this.isTogHide=!this.isTogHide}},mounted:function(){}}},643:function(t,e,n){"use strict";e.__esModule=!0,e.default={name:"no-data",props:{msg:String}}},645:function(t,e,n){var s;s=function(){"use strict";var t="millisecond",e="second",n="minute",s="hour",a="day",i="week",o="month",r="quarter",u="year",l=/^(\d{4})-?(\d{1,2})-?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d{1,3})?$/,c=/\[([^\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d=function(t,e,n){var s=String(t);return!s||s.length>=e?t:""+Array(e+1-s.length).join(n)+t},f={s:d,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),s=Math.floor(n/60),a=n%60;return(e<=0?"+":"-")+d(s,2,"0")+":"+d(a,2,"0")},m:function(t,e){var n=12*(e.year()-t.year())+(e.month()-t.month()),s=t.clone().add(n,o),a=e-s<0,i=t.clone().add(n+(a?-1:1),o);return Number(-(n+(e-s)/(a?s-i:i-s))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(l){return{M:o,y:u,w:i,d:a,h:s,m:n,s:e,ms:t,Q:r}[l]||String(l||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m="en",h={};h[m]=p;var v=function(t){return t instanceof $},_=function(t,e,n){var s;if(!t)return null;if("string"==typeof t)h[t]&&(s=t),e&&(h[t]=e,s=t);else{var a=t.name;h[a]=t,s=a}return n||(m=s),s},g=function(t,e,n){if(v(t))return t.clone();var s=e?"string"==typeof e?{format:e,pl:n}:e:{};return s.date=t,new $(s)},x=f;x.l=_,x.i=v,x.w=function(t,e){return g(t,{locale:e.$L,utc:e.$u})};var $=function(){function d(t){this.$L=this.$L||_(t.locale,null,!0)||m,this.parse(t)}var f=d.prototype;return f.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(x.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var s=e.match(l);if(s)return n?new Date(Date.UTC(s[1],s[2]-1,s[3]||1,s[4]||0,s[5]||0,s[6]||0,s[7]||0)):new Date(s[1],s[2]-1,s[3]||1,s[4]||0,s[5]||0,s[6]||0,s[7]||0)}return new Date(e)}(t),this.init()},f.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},f.$utils=function(){return x},f.isValid=function(){return!("Invalid Date"===this.$d.toString())},f.isSame=function(t,e){var n=g(t);return this.startOf(e)<=n&&n<=this.endOf(e)},f.isAfter=function(t,e){return g(t).secondary-menu-model{left:-200px}.secondary-menu-model{position:fixed;left:0;top:0;width:200px;background:#41444c;height:100%;padding-top:80px}.secondary-menu-model .toogle-box{position:absolute;right:-1px;top:calc(50% - 50px)}.secondary-menu-model .toogle-box .tog-close{width:12px;height:102px;background:url("+s(n(657))+") no-repeat;display:inline-block}.secondary-menu-model .toogle-box .tog-open{width:12px;height:102px;background:url("+s(n(658))+") no-repeat;display:inline-block;position:absolute;right:-12px;top:0}.secondary-menu-model .leven-1 .name a{height:40px;line-height:40px;display:block;position:relative;padding-left:12px}.secondary-menu-model .leven-1 .name a>.icon{vertical-align:middle;font-size:15px;width:20px;text-align:center;color:#fff}.secondary-menu-model .leven-1 .name a>span{vertical-align:middle;padding-left:2px;font-size:14px;color:#fff}.secondary-menu-model .leven-1 .name a>.angle{position:absolute;right:12px;top:14px}.secondary-menu-model .leven-1 ul li{height:36px;line-height:36px;cursor:pointer;padding-left:39px;color:#fff}.secondary-menu-model .leven-1 ul li a{font-size:14px}.secondary-menu-model .leven-1 ul li.active{border-right:2px solid #2d8cf0;background:#2c2f39}.secondary-menu-model .leven-1 ul li.active span{font-weight:700;color:#2d8cf0}.secondary-menu-model .leven-1 .router-link-active,.secondary-menu-model .leven-1>.router-link-exact-active{background:#f0f6fb}.secondary-menu-model .leven-1 .router-link-active .name,.secondary-menu-model .leven-1>.router-link-exact-active .name{border-right:2px solid #2d8cf0;background:#2b2e38}.secondary-menu-model .leven-1 .router-link-active .name a span,.secondary-menu-model .leven-1>.router-link-exact-active .name a span{color:#2d8cf0;font-weight:700}.secondary-menu-model .leven-1 .router-link-active .name a .fa,.secondary-menu-model .leven-1>.router-link-exact-active .name a .fa{color:#2d8cf0}",""])},657:function(t,e,n){t.exports=n.p+"images/close.png?02806e641df25c1b4dbff4cb0af3984d"},658:function(t,e,n){t.exports=n.p+"images/open.png?97ec0726c7acab8a2a48282d68cea631"},659:function(t,e,n){"use strict";e.__esModule=!0;var s,a=n(36),i=(s=a)&&s.__esModule?s:{default:s};var o={projects:[{name:""+i.default.$t("项目首页"),id:1,path:"projects-index",isOpen:!0,icon:"fa-home",children:[]},{name:""+i.default.$t("工作流"),id:2,path:"",isOpen:!0,icon:"fa-gear",children:[{name:""+i.default.$t("工作流定义"),path:"definition",id:1},{name:""+i.default.$t("工作流实例"),path:"instance",id:2},{name:""+i.default.$t("任务实例"),path:"task-instance-list",id:3}]}],security:[{name:""+i.default.$t("租户管理"),id:1,path:"tenement-manage",isOpen:!0,icon:"fa-users",children:[]},{name:""+i.default.$t("用户管理"),id:1,path:"users-manage",isOpen:!0,icon:"fa-user-circle",children:[]},{name:""+i.default.$t("告警组管理"),id:1,path:"warning-groups-manage",isOpen:!0,icon:"fa-warning",children:[]},{name:""+i.default.$t("队列管理"),id:1,path:"queue-manage",isOpen:!0,icon:"fa-warning",children:[]},{name:""+i.default.$t("服务管理"),id:1,path:"",isOpen:!0,icon:"fa-server",children:[{name:"master",path:"servers-master",id:1},{name:"worker",path:"servers-worker",id:2}]}],resource:[{name:""+i.default.$t("文件管理"),id:1,path:"file",isOpen:!0,icon:"fa-files-o",children:[],disabled:!1},{name:""+i.default.$t("UDF管理"),id:1,path:"",isOpen:!0,icon:"fa-file-text",disabled:!1,children:[{name:""+i.default.$t("资源管理"),path:"resource-udf-resource",id:1},{name:""+i.default.$t("函数管理"),path:"resource-udf-function",id:2}]}],user:[{name:""+i.default.$t("用户信息"),id:1,path:"account",isOpen:!0,icon:"fa-user",children:[],disabled:!1},{name:""+i.default.$t("修改密码"),id:1,path:"password",isOpen:!0,icon:"fa-key",children:[],disabled:!1}]};e.default=function(t){return o[t]}},660:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"secondary-menu-model",class:t.className},[n("div",{staticClass:"toogle-box"},[t.isTogHide?t._e():n("a",{staticClass:"tog-close",attrs:{href:"javascript:"},on:{click:t._toggleMenu}}),t._v(" "),t.isTogHide?n("a",{staticClass:"tog-open",attrs:{href:"javascript:"},on:{click:t._toggleMenu}}):t._e()]),t._v(" "),t._l(t.menuList,function(e,s){return n("div",{staticClass:"leven-1"},[e.path?[n("router-link",{attrs:{to:{name:e.path}}},[n("div",{staticClass:"name",on:{click:function(n){return t._toggleSubMenu(e)}}},[n("a",{attrs:{href:"javascript:"}},[n("i",{staticClass:"fa icon",class:e.icon}),t._v(" "),n("span",[t._v(t._s(e.name))]),t._v(" "),e.children.length?n("i",{staticClass:"fa angle",class:e.isOpen?"fa-angle-down":"fa-angle-right"}):t._e()])])])]:t._e(),t._v(" "),e.path?t._e():[n("div",{staticClass:"name",on:{click:function(n){return t._toggleSubMenu(e)}}},[n("a",{attrs:{href:"javascript:"}},[n("i",{staticClass:"fa icon",class:e.icon}),t._v(" "),n("span",[t._v(t._s(e.name))]),t._v(" "),e.children.length?n("i",{staticClass:"fa angle",class:e.isOpen?"fa-angle-down":"fa-angle-right"}):t._e()])])],t._v(" "),e.isOpen&&e.children.length?n("ul",t._l(e.children,function(e,s){return n("router-link",{attrs:{to:{name:e.path},tag:"li","active-class":"active"}},[n("span",[t._v(t._s(e.name))])])}),1):t._e()],2)})],2)},staticRenderFns:[]};e.a=s},661:function(t,e,n){"use strict";e.__esModule=!0,e.formatDate=void 0;var s,a=n(645),i=(s=a)&&s.__esModule?s:{default:s};e.formatDate=function(t,e){return e=e||"YYYY-MM-DD HH:mm:ss",(0,i.default)(t).format(e)}},662:function(t,e,n){"use strict";e.__esModule=!0;var s,a=n(28),i=(s=a)&&s.__esModule?s:{default:s};e.default={name:"conditions",data:function(){return{searchVal:""}},props:{operation:Array},methods:{_ckQuery:function(){this.$emit("on-conditions",{searchVal:i.default.trim(this.searchVal)})}},computed:{isShow:function(){return this.$slots["search-group"]}},components:{}}},663:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(643),a=n.n(s);for(var i in s)"default"!==i&&function(t){n.d(e,t,function(){return s[t]})}(i);var o=n(666);var r=function(t){n(664)},u=n(27)(a.a,o.a,!1,r,null,null);e.default=u.exports},664:function(t,e,n){var s=n(665);"string"==typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);n(35)("3cb222d8",s,!0,{})},665:function(t,e,n){(t.exports=n(34)(!1)).push([t.i,".no-data-model{position:relative;width:100%;height:calc(100vh - 200px)}.no-data-model .no-data-box{width:210px;height:210px;position:absolute;left:50%;top:50%;margin-left:-105px;margin-top:-105px;text-align:center}.no-data-model .no-data-box .text{padding-top:10px;color:#666}",""])},666:function(t,e,n){"use strict";var s={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"no-data-model"},[e("div",{staticClass:"no-data-box"},[this._m(0),this._v(" "),e("div",{staticClass:"text"},[this._v(this._s(this.msg||this.$t("查询无数据")))])])])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"img"},[e("img",{attrs:{src:n(667),alt:""}})])}]};e.a=s},667:function(t,e,n){t.exports=n.p+"images/errorTip.png?a7b20f0ca8727f22f405c2a34d1363a0"},668:function(t,e,n){"use strict";var s,a=n(29),i=(s=a)&&s.__esModule?s:{default:s},o=n(661);i.default.filter("formatDate",o.formatDate)},670:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(662),a=n.n(s);for(var i in s)"default"!==i&&function(t){n.d(e,t,function(){return s[t]})}(i);var o=n(671),r=n(27)(a.a,o.a,!1,null,null,null);e.default=r.exports},671:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"conditions-model"},[n("div",{staticClass:"left"},[t._t("button-group")],2),t._v(" "),n("div",{staticClass:"right"},[n("div",{staticClass:"from-box"},[t.isShow?t._t("search-group"):t._e(),t._v(" "),t.isShow?t._e():[n("div",{staticClass:"list"},[n("x-button",{attrs:{type:"ghost",size:"small",icon:"fa fa-search"},on:{click:t._ckQuery}})],1),t._v(" "),n("div",{staticClass:"list"},[n("x-input",{staticStyle:{width:"180px"},attrs:{size:"small",placeholder:t.$t("请输入关键词"),type:"text"},on:{"on-enterkey":t._ckQuery},model:{value:t.searchVal,callback:function(e){t.searchVal=e},expression:"searchVal"}})],1)]],2)])])},staticRenderFns:[]};e.a=s}}); -//# sourceMappingURL=11.685f19d.js.map \ No newline at end of file +webpackJsonp([11],{1055:function(t,e,n){"use strict";e.__esModule=!0;var s=n(123),a=d(n(1174)),i=d(n(1057)),o=d(n(646)),r=d(n(663)),u=d(n(670)),c=d(n(654)),l=d(n(650));function d(t){return t&&t.__esModule?t:{default:t}}e.default={name:"udf-function-index",data:function(){return{pageSize:10,pageNo:1,total:20,searchVal:"",isLoading:!1,udfFuncList:[]}},props:{},methods:Object.assign({},(0,s.mapActions)("resource",["getUdfFuncListP"]),{_onConditions:function(t){this.searchVal=t.searchVal,this.pageNo=1,this._getUdfFuncListP()},_page:function(t){this.pageNo=t,this._getUdfFuncListP()},_create:function(){var t=this,e=this.$modal.dialog({closable:!1,showMask:!0,escClose:!0,className:"v-modal-custom",transitionName:"opacityp",render:function(n){return n(i.default,{on:{onUpdate:function(){t._updateList(),e.remove()},close:function(){e.remove()}},props:{}})}})},_updateList:function(){this.pageSize=10,this.pageNo=1,this.searchVal="",this._getUdfFuncListP()},_getUdfFuncListP:function(t){var e=this;this.isLoading=!t,this.getUdfFuncListP({pageSize:this.pageSize,pageNo:this.pageNo,searchVal:this.searchVal}).then(function(t){e.udfFuncList=t.totalList,e.total=t.total,e.isLoading=!1}).catch(function(t){e.isLoading=!1})}}),watch:{},created:function(){},mounted:function(){this._getUdfFuncListP()},components:{mSecondaryMenu:c.default,mListConstruction:l.default,mConditions:u.default,mList:a.default,mSpin:o.default,mCreateUdf:i.default,mNoData:r.default}}},1056:function(t,e,n){"use strict";e.__esModule=!0;var s=n(123);n(668);var a,i=n(1057),o=(a=i)&&a.__esModule?a:{default:a};e.default={name:"udf-manage-list",data:function(){return{list:[]}},props:{udfFuncList:Array,pageNo:Number,pageSize:Number},methods:Object.assign({},(0,s.mapActions)("resource",["deleteUdf"]),{_closeDelete:function(t){this.$refs["poptip-"+t][0].doClose()},_delete:function(t,e){var n=this;this.deleteUdf({id:t.id}).then(function(t){n.$refs["poptip-"+e][0].doClose(),n.list.splice(e,1),n.$message.success(t.msg)}).catch(function(t){n.$refs["poptip-"+e][0].doClose(),n.$message.error(t.msg||"")})},_edit:function(t){var e=this,n=this.$modal.dialog({closable:!1,showMask:!0,escClose:!0,className:"v-modal-custom",transitionName:"opacityp",render:function(s){return s(o.default,{on:{onUpdate:function(){e.$emit("on-update"),n.remove()},close:function(){n.remove()}},props:{item:t}})}})}}),watch:{udfFuncList:function(t){var e=this;this.list=[],setTimeout(function(){e.list=t})}},created:function(){},mounted:function(){this.list=this.udfFuncList},components:{}}},1057:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(1058),a=n.n(s);for(var i in s)"default"!==i&&function(t){n.d(e,t,function(){return s[t]})}(i);var o=n(1179),r=n(27)(a.a,o.a,!1,null,null,null);e.default=r.exports},1058:function(t,e,n){"use strict";e.__esModule=!0;var s=c(n(28)),a=c(n(36)),i=c(n(91)),o=c(n(223)),r=c(n(224)),u=c(n(1175));function c(t){return t&&t.__esModule?t:{default:t}}e.default={name:"udf-create",data:function(){return{store:i.default,type:"HIVE",funcName:"",className:"",argTypes:"",database:"",desc:"",resourceId:{},udfResourceList:[],isUpdate:!1,upDisabled:!1}},props:{item:Object},methods:{_ok:function(){var t=this;this.$refs.popup.spinnerLoading=!0,this._validation()?this._verifyUdfFuncName().then(function(e){t._createUdfFunc().then()}).then(function(e){setTimeout(function(){t.$refs.popup.spinnerLoading=!1},800)}).catch(function(e){t.$refs.popup.spinnerLoading=!1}):this.$refs.popup.spinnerLoading=!1},_createUdfFunc:function(){var t=this;return new Promise(function(e,n){var s={type:t.type,funcName:t.funcName,className:t.className,argTypes:t.argTypes,database:t.database,desc:t.desc,resourceId:t.resourceId.id},a=t.item&&t.item.id||null;a&&(s.id=a),t.store.dispatch("resource/"+(a?"updateUdfFunc":"createUdfFunc"),s).then(function(n){t.$emit("onUpdate",s),t.$message.success(n.msg),e()}).catch(function(e){t.$message.error(e.msg||""),n(e)})})},_onUpdatePresent:function(){this.$refs.popup.apDisabled=!0,this.upDisabled=!0},_getUdfList:function(){var t=this;return new Promise(function(e,n){t.store.dispatch("resource/getResourcesList",{type:"UDF"}).then(function(n){t.udfResourceList=n.data,e()})})},_onUpdate:function(t){var e=this;this.upDisabled=!1,this.udfResourceList.push(t),this.isUpdate=!1,this.$nextTick(function(){e.resourceId=s.default.filter(e.udfResourceList,function(e){return e.id===t.id})[0]}),this.$refs.popup.apDisabled=!1},_toggleUpdate:function(){this.isUpdate=!this.isUpdate,this.isUpdate&&(this.resourceId=null)},_validation:function(){return this.funcName?this.className?!!this.resourceId||(this.$message.warning(""+a.default.$t("请选择UDF资源")),!1):(this.$message.warning(""+a.default.$t("请输入包名类名")),!1):(this.$message.warning(""+a.default.$t("请输入UDF函数名称")),!1)},_verifyUdfFuncName:function(){var t=this;return new Promise(function(e,n){t.item&&t.item.funcName===t.funcName?e():t.store.dispatch("resource/verifyUdfFuncName",{name:t.funcName}).then(function(t){e()}).catch(function(e){t.$message.error(e.msg||""),n(e)})})}},watch:{},created:function(){var t=this;this._getUdfList().then(function(e){t.item?(t.type=t.item.type,t.funcName=t.item.funcName||"",t.className=t.item.className||"",t.argTypes=t.item.argTypes||"",t.database=t.item.database||"",t.desc=t.item.desc||"",t.resourceId=s.default.filter(t.udfResourceList,function(e){return e.id===t.item.resourceId})[0]):t.resourceId=t.udfResourceList.length&&t.udfResourceList[0]||[]})},mounted:function(){},components:{mPopup:o.default,mListBoxF:r.default,mUdfUpdate:u.default}}},1059:function(t,e,n){"use strict";e.__esModule=!0;var s=o(n(30)),a=o(n(36)),i=o(n(91));function o(t){return t&&t.__esModule?t:{default:t}}e.default={name:"udf-update",data:function(){return{store:i.default,udfName:"",udfDesc:"",file:"",progress:0,spinnerLoading:!1}},props:{},methods:{_validation:function(){return this.udfName?!!this.file||(this.$message.warning(""+a.default.$t("请选择要上传的文件")),!1):(this.$message.warning(""+a.default.$t("请输入文件名")),!1)},_verifyName:function(){var t=this;return new Promise(function(e,n){t.store.dispatch("resource/resourceVerifyName",{name:t.udfName,type:"UDF"}).then(function(t){e()}).catch(function(e){t.$message.error(e.msg||""),n(e)})})},_formDataUpdate:function(){var t=this,e=this,n=new FormData;n.append("file",this.file),n.append("type","UDF"),n.append("name",this.udfName),n.append("desc",this.udfDesc),this.spinnerLoading=!0,this.$emit("on-update-present",!1),s.default.post("resources/create",function(e){t.$message.success(e.msg),t.spinnerLoading=!1,t.progress=0,t.$emit("on-update",e.data)},function(e){t.spinnerLoading=!1,t.progress=0,t.$message.error(e.msg||""),t.$emit("on-update",e)},{data:n,emulateJSON:!1,timeout:99999999,onUploadProgress:function(t){var n=t.loaded,s=t.total;e.progress=Math.floor(100*n/s)}})},_ok:function(){var t=this;this._validation()&&this._verifyName().then(function(e){t._formDataUpdate()})}},watch:{},created:function(){},mounted:function(){var t=this;$("#file").change(function(){var e=$("#file")[0].files[0];t.file=e,t.udfName=e.name})},updated:function(){},beforeDestroy:function(){},destroyed:function(){},computed:{},components:{}}},1174:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(1056),a=n.n(s);for(var i in s)"default"!==i&&function(t){n.d(e,t,function(){return s[t]})}(i);var o=n(1180),r=n(27)(a.a,o.a,!1,null,null,null);e.default=r.exports},1175:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(1059),a=n.n(s);for(var i in s)"default"!==i&&function(t){n.d(e,t,function(){return s[t]})}(i);var o=n(1178);var r=function(t){n(1176)},u=n(27)(a.a,o.a,!1,r,null,null);e.default=u.exports},1176:function(t,e,n){var s=n(1177);"string"==typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);n(35)("28933aae",s,!0,{})},1177:function(t,e,n){(t.exports=n(34)(!1)).push([t.i,".update-udf-model{min-height:40px;border-radius:3px;margin-top:-10px;margin-bottom:-10px}.update-udf-model .update-udf-box ul li{margin-bottom:8px}.update-udf-model .update-udf-box ul li .v-input textarea{min-height:60px!important}.update-udf-model .update-udf-box ul li .update-pbx{position:relative}.update-udf-model .update-udf-box ul li .update-pbx .p1{right:0;top:0;width:82px;height:28px;overflow:hidden}.update-udf-model .update-udf-box ul li .update-pbx .p1 .file-update{position:absolute;left:0;top:0;opacity:0;cursor:pointer}",""])},1178:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"update-udf-model"},[n("div",{staticClass:"update-udf-box"},[n("ul",[n("li",[n("div",{staticClass:"update-pbx"},[n("x-input",{staticStyle:{width:"268px"},attrs:{type:"input",size:"small",disabled:0!==t.progress,placeholder:t.$t("请输入资源名称"),autocomplete:"off"},model:{value:t.udfName,callback:function(e){t.udfName=e},expression:"udfName"}}),t._v(" "),n("div",{staticClass:"p1",staticStyle:{position:"absolute"}},[t.progress?t._e():n("input",{staticClass:"file-update",attrs:{name:"file",id:"file",type:"file"}}),t._v(" "),n("x-button",{attrs:{type:"dashed",size:"small",disabled:0!==t.progress}},[t._v(" "+t._s(t.$t("点击上传"))+" ")])],1)],1)]),t._v(" "),n("li",[n("x-input",{attrs:{type:"textarea",size:"small",disabled:0!==t.progress,placeholder:t.$t("请输入资源描述"),autocomplete:"off"},model:{value:t.udfDesc,callback:function(e){t.udfDesc=e},expression:"udfDesc"}})],1),t._v(" "),n("li",{staticStyle:{"margin-top":"-4px","margin-bottom":"8px"}},[n("x-button",{attrs:{type:"success",size:"xsmall",long:"",loading:t.spinnerLoading},on:{click:t._ok}},[t._v(t._s(t.spinnerLoading?"Loading... ("+t.progress+"%)":t.$t("上传UDF资源")))])],1)])])])},staticRenderFns:[]};e.a=s},1179:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("m-popup",{ref:"popup",attrs:{"ok-text":t.item?t.$t("编辑"):t.$t("确定提交"),nameText:t.item?t.$t("编辑UDF函数"):t.$t("创建UDF函数")},on:{ok:t._ok}},[n("template",{slot:"content"},[n("div",{staticClass:"udf-create-model"},[n("m-list-box-f",[n("template",{slot:"name"},[n("b",[t._v("*")]),t._v(t._s(t.$t("类型")))]),t._v(" "),n("template",{slot:"content"},[n("x-radio-group",{model:{value:t.type,callback:function(e){t.type=e},expression:"type"}},[n("x-radio",{attrs:{label:"HIVE"}},[t._v("HIVE UDF")])],1)],1)],2),t._v(" "),n("m-list-box-f",[n("template",{slot:"name"},[n("b",[t._v("*")]),t._v(t._s(t.$t("UDF函数名称")))]),t._v(" "),n("template",{slot:"content"},[n("x-input",{attrs:{type:"input",maxlength:"40",placeholder:t.$t("请输入函数名")},model:{value:t.funcName,callback:function(e){t.funcName=e},expression:"funcName"}})],1)],2),t._v(" "),n("m-list-box-f",[n("template",{slot:"name"},[n("b",[t._v("*")]),t._v(t._s(t.$t("包名类名")))]),t._v(" "),n("template",{slot:"content"},[n("x-input",{attrs:{type:"input",maxlength:"40",placeholder:t.$t("请输入包名类名")},model:{value:t.className,callback:function(e){t.className=e},expression:"className"}})],1)],2),t._v(" "),n("m-list-box-f",[n("template",{slot:"name"},[t._v(t._s(t.$t("参数")))]),t._v(" "),n("template",{slot:"content"},[n("x-input",{attrs:{type:"input",placeholder:t.$t("请输入参数")},model:{value:t.argTypes,callback:function(e){t.argTypes=e},expression:"argTypes"}})],1)],2),t._v(" "),n("m-list-box-f",[n("template",{slot:"name"},[t._v(t._s(t.$t("数据库名")))]),t._v(" "),n("template",{slot:"content"},[n("x-input",{attrs:{type:"input",placeholder:t.$t("请输入数据库名")},model:{value:t.database,callback:function(e){t.database=e},expression:"database"}})],1)],2),t._v(" "),n("m-list-box-f",[n("template",{slot:"name"},[n("b",[t._v("*")]),t._v(t._s(t.$t("UDF资源")))]),t._v(" "),n("template",{slot:"content"},[n("x-select",{staticStyle:{width:"200px"},attrs:{filterable:"",disabled:t.isUpdate},model:{value:t.resourceId,callback:function(e){t.resourceId=e},expression:"resourceId"}},t._l(t.udfResourceList,function(t){return n("x-option",{key:t.id,attrs:{value:t,label:t.alias}})}),1),t._v(" "),n("x-button",{attrs:{type:"primary",disabled:t.upDisabled},on:{click:t._toggleUpdate}},[t._v(t._s(t.$t("上传资源")))])],1)],2),t._v(" "),t.isUpdate?n("m-list-box-f",[n("template",{slot:"name"},[t._v(" ")]),t._v(" "),n("template",{slot:"content"},[n("m-udf-update",{on:{"on-update-present":t._onUpdatePresent,"on-update":t._onUpdate}})],1)],2):t._e(),t._v(" "),n("m-list-box-f",[n("template",{slot:"name"},[t._v(t._s(t.$t("使用说明")))]),t._v(" "),n("template",{slot:"content"},[n("x-input",{attrs:{type:"textarea",placeholder:t.$t("请输入使用说明")},model:{value:t.desc,callback:function(e){t.desc=e},expression:"desc"}})],1)],2)],1)])],2)},staticRenderFns:[]};e.a=s},1180:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"list-model"},[n("div",{staticClass:"table-box"},[n("table",{staticClass:"fixed"},[n("tr",[n("th",[n("span",[t._v(t._s(t.$t("编号")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("UDF函数名称")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("类名")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("参数")))])]),t._v(" "),n("th",{attrs:{width:"80"}},[n("span",[t._v(t._s(t.$t("类型")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("描述")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("jar包")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("库名")))])]),t._v(" "),n("th",{attrs:{width:"140"}},[n("span",[t._v(t._s(t.$t("更新时间")))])]),t._v(" "),n("th",{attrs:{width:"80"}},[n("span",[t._v(t._s(t.$t("操作")))])])]),t._v(" "),t._l(t.list,function(e,s){return n("tr",{key:s},[n("td",[n("span",[t._v(t._s(s+1))])]),t._v(" "),n("td",[n("span",{staticClass:"ellipsis"},[n("a",{staticClass:"links",attrs:{href:"javascript:"}},[t._v(t._s(e.funcName))])])]),t._v(" "),n("td",[n("span",{staticClass:"ellipsis"},[t._v(t._s(e.className||"-"))])]),t._v(" "),n("td",[n("span",[t._v(t._s(e.argTypes||"-"))])]),t._v(" "),n("td",[n("span",[t._v(t._s(e.type))])]),t._v(" "),n("td",[n("span",{staticClass:"ellipsis"},[t._v(t._s(e.desc||"-"))])]),t._v(" "),n("td",[n("span",[t._v(t._s(e.resourceName))])]),t._v(" "),n("td",[n("span",[t._v(t._s(e.database||"-"))])]),t._v(" "),n("td",[n("span",[t._v(t._s(t._f("formatDate")(e.updateTime)))])]),t._v(" "),n("td",[n("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"info",shape:"circle",size:"xsmall","data-toggle":"tooltip",title:t.$t("编辑"),icon:"iconfont icon-bianjixiugai"},on:{click:function(n){return t._edit(e)}}}),t._v(" "),n("x-poptip",{ref:"poptip-"+s,refInFor:!0,attrs:{placement:"bottom-end",width:"90"}},[n("p",[t._v(t._s(t.$t("确定删除吗?")))]),t._v(" "),n("div",{staticStyle:{"text-align":"right",margin:"0","padding-top":"4px"}},[n("x-button",{attrs:{type:"text",size:"xsmall",shape:"circle"},on:{click:function(e){return t._closeDelete(s)}}},[t._v(t._s(t.$t("取消")))]),t._v(" "),n("x-button",{attrs:{type:"primary",size:"xsmall",shape:"circle"},on:{click:function(n){return t._delete(e,s)}}},[t._v(t._s(t.$t("确定")))])],1),t._v(" "),n("template",{slot:"reference"},[n("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"error",shape:"circle",size:"xsmall",icon:"iconfont icon-shanchu","data-toggle":"tooltip",title:t.$t("删除")}})],1)],2)],1)])})],2)])])},staticRenderFns:[]};e.a=s},1181:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"main-layout-box"},[n("m-secondary-menu",{attrs:{type:"resource"}}),t._v(" "),n("m-list-construction",{attrs:{title:t.$t("UDF函数管理")}},[n("template",{slot:"conditions"},[n("m-conditions",{on:{"on-conditions":t._onConditions}},[n("template",{slot:"button-group"},[n("x-button",{directives:[{name:"ps",rawName:"v-ps",value:["GENERAL_USER"],expression:"['GENERAL_USER']"}],attrs:{type:"ghost",size:"small"},on:{click:t._create}},[t._v(t._s(t.$t("创建UDF函数")))])],1)],2)],1),t._v(" "),n("template",{slot:"content"},[t.udfFuncList.length?[n("m-list",{attrs:{"udf-func-list":t.udfFuncList,"page-no":t.pageNo,"page-size":t.pageSize},on:{"on-update":t._updateList}}),t._v(" "),n("div",{staticClass:"page-box"},[n("x-page",{attrs:{current:t.pageNo,total:t.total,"show-elevator":""},on:{"on-change":t._page}})],1)]:t._e(),t._v(" "),t.udfFuncList.length?t._e():[n("m-no-data")],t._v(" "),n("m-spin",{attrs:{"is-spin":t.isLoading}})],2)],2)],1)},staticRenderFns:[]};e.a=s},625:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(1055),a=n.n(s);for(var i in s)"default"!==i&&function(t){n.d(e,t,function(){return s[t]})}(i);var o=n(1181),r=n(27)(a.a,o.a,!1,null,null,null);e.default=r.exports},639:function(t,e,n){"use strict";e.__esModule=!0,e.default={name:"spin",data:function(){return{}},props:{isSpin:{type:Boolean,default:!0},isLeft:{type:Boolean,default:!0}}}},640:function(t,e,n){"use strict";e.__esModule=!0,e.default={name:"list-construction",data:function(){return{}},props:{title:String}}},641:function(t,e,n){"use strict";e.__esModule=!0;var s,a=n(659),i=(s=a)&&s.__esModule?s:{default:s};e.default={name:"secondary-menu",data:function(){return{menuList:(0,i.default)(this.type),index:0,id:this.$route.params.id,isTogHide:!1}},props:{type:String,className:String},watch:{isTogHide:function(t){var e=$(".main-layout-box");t?e.addClass("toggle"):e.removeClass("toggle")}},methods:{_toggleSubMenu:function(t){t.isOpen=!t.isOpen},_toggleMenu:function(){this.isTogHide=!this.isTogHide}},mounted:function(){}}},643:function(t,e,n){"use strict";e.__esModule=!0,e.default={name:"no-data",props:{msg:String}}},645:function(t,e,n){var s;s=function(){"use strict";var t="millisecond",e="second",n="minute",s="hour",a="day",i="week",o="month",r="quarter",u="year",c=/^(\d{4})-?(\d{1,2})-?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d{1,3})?$/,l=/\[([^\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d=function(t,e,n){var s=String(t);return!s||s.length>=e?t:""+Array(e+1-s.length).join(n)+t},f={s:d,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),s=Math.floor(n/60),a=n%60;return(e<=0?"+":"-")+d(s,2,"0")+":"+d(a,2,"0")},m:function(t,e){var n=12*(e.year()-t.year())+(e.month()-t.month()),s=t.clone().add(n,o),a=e-s<0,i=t.clone().add(n+(a?-1:1),o);return Number(-(n+(e-s)/(a?s-i:i-s))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(c){return{M:o,y:u,w:i,d:a,h:s,m:n,s:e,ms:t,Q:r}[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m="en",h={};h[m]=p;var v=function(t){return t instanceof $},_=function(t,e,n){var s;if(!t)return null;if("string"==typeof t)h[t]&&(s=t),e&&(h[t]=e,s=t);else{var a=t.name;h[a]=t,s=a}return n||(m=s),s},g=function(t,e,n){if(v(t))return t.clone();var s=e?"string"==typeof e?{format:e,pl:n}:e:{};return s.date=t,new $(s)},x=f;x.l=_,x.i=v,x.w=function(t,e){return g(t,{locale:e.$L,utc:e.$u})};var $=function(){function d(t){this.$L=this.$L||_(t.locale,null,!0)||m,this.parse(t)}var f=d.prototype;return f.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(x.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var s=e.match(c);if(s)return n?new Date(Date.UTC(s[1],s[2]-1,s[3]||1,s[4]||0,s[5]||0,s[6]||0,s[7]||0)):new Date(s[1],s[2]-1,s[3]||1,s[4]||0,s[5]||0,s[6]||0,s[7]||0)}return new Date(e)}(t),this.init()},f.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},f.$utils=function(){return x},f.isValid=function(){return!("Invalid Date"===this.$d.toString())},f.isSame=function(t,e){var n=g(t);return this.startOf(e)<=n&&n<=this.endOf(e)},f.isAfter=function(t,e){return g(t).secondary-menu-model{left:-200px}.secondary-menu-model{position:fixed;left:0;top:0;width:200px;background:#41444c;height:100%;padding-top:80px}.secondary-menu-model .toogle-box{position:absolute;right:-1px;top:calc(50% - 50px)}.secondary-menu-model .toogle-box .tog-close{width:12px;height:102px;background:url("+s(n(657))+") no-repeat;display:inline-block}.secondary-menu-model .toogle-box .tog-open{width:12px;height:102px;background:url("+s(n(658))+") no-repeat;display:inline-block;position:absolute;right:-12px;top:0}.secondary-menu-model .leven-1 .name a{height:40px;line-height:40px;display:block;position:relative;padding-left:12px}.secondary-menu-model .leven-1 .name a>.icon{vertical-align:middle;font-size:15px;width:20px;text-align:center;color:#fff}.secondary-menu-model .leven-1 .name a>span{vertical-align:middle;padding-left:2px;font-size:14px;color:#fff}.secondary-menu-model .leven-1 .name a>.angle{position:absolute;right:12px;top:14px}.secondary-menu-model .leven-1 ul li{height:36px;line-height:36px;cursor:pointer;padding-left:39px;color:#fff}.secondary-menu-model .leven-1 ul li a{font-size:14px}.secondary-menu-model .leven-1 ul li.active{border-right:2px solid #2d8cf0;background:#2c2f39}.secondary-menu-model .leven-1 ul li.active span{font-weight:700;color:#2d8cf0}.secondary-menu-model .leven-1 .router-link-active,.secondary-menu-model .leven-1>.router-link-exact-active{background:#f0f6fb}.secondary-menu-model .leven-1 .router-link-active .name,.secondary-menu-model .leven-1>.router-link-exact-active .name{border-right:2px solid #2d8cf0;background:#2b2e38}.secondary-menu-model .leven-1 .router-link-active .name a span,.secondary-menu-model .leven-1>.router-link-exact-active .name a span{color:#2d8cf0;font-weight:700}.secondary-menu-model .leven-1 .router-link-active .name a .fa,.secondary-menu-model .leven-1>.router-link-exact-active .name a .fa{color:#2d8cf0}",""])},657:function(t,e,n){t.exports=n.p+"images/close.png?02806e641df25c1b4dbff4cb0af3984d"},658:function(t,e,n){t.exports=n.p+"images/open.png?97ec0726c7acab8a2a48282d68cea631"},659:function(t,e,n){"use strict";e.__esModule=!0;var s,a=n(36),i=(s=a)&&s.__esModule?s:{default:s};var o={projects:[{name:""+i.default.$t("项目首页"),id:1,path:"projects-index",isOpen:!0,icon:"fa-home",children:[]},{name:""+i.default.$t("工作流"),id:2,path:"",isOpen:!0,icon:"fa-gear",children:[{name:""+i.default.$t("工作流定义"),path:"definition",id:1},{name:""+i.default.$t("工作流实例"),path:"instance",id:2},{name:""+i.default.$t("任务实例"),path:"task-instance-list",id:3}]}],security:[{name:""+i.default.$t("租户管理"),id:1,path:"tenement-manage",isOpen:!0,icon:"fa-users",children:[]},{name:""+i.default.$t("用户管理"),id:1,path:"users-manage",isOpen:!0,icon:"fa-user-circle",children:[]},{name:""+i.default.$t("告警组管理"),id:1,path:"warning-groups-manage",isOpen:!0,icon:"fa-warning",children:[]},{name:""+i.default.$t("队列管理"),id:1,path:"queue-manage",isOpen:!0,icon:"fa-recycle",children:[]},{name:""+i.default.$t("服务管理"),id:1,path:"",isOpen:!0,icon:"fa-server",children:[{name:"master",path:"servers-master",id:1},{name:"worker",path:"servers-worker",id:2}]}],resource:[{name:""+i.default.$t("文件管理"),id:1,path:"file",isOpen:!0,icon:"fa-files-o",children:[],disabled:!1},{name:""+i.default.$t("UDF管理"),id:1,path:"",isOpen:!0,icon:"fa-file-text",disabled:!1,children:[{name:""+i.default.$t("资源管理"),path:"resource-udf-resource",id:1},{name:""+i.default.$t("函数管理"),path:"resource-udf-function",id:2}]}],user:[{name:""+i.default.$t("用户信息"),id:1,path:"account",isOpen:!0,icon:"fa-user",children:[],disabled:!1},{name:""+i.default.$t("修改密码"),id:1,path:"password",isOpen:!0,icon:"fa-key",children:[],disabled:!1}]};e.default=function(t){return o[t]}},660:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"secondary-menu-model",class:t.className},[n("div",{staticClass:"toogle-box"},[t.isTogHide?t._e():n("a",{staticClass:"tog-close",attrs:{href:"javascript:"},on:{click:t._toggleMenu}}),t._v(" "),t.isTogHide?n("a",{staticClass:"tog-open",attrs:{href:"javascript:"},on:{click:t._toggleMenu}}):t._e()]),t._v(" "),t._l(t.menuList,function(e,s){return n("div",{staticClass:"leven-1"},[e.path?[n("router-link",{attrs:{to:{name:e.path}}},[n("div",{staticClass:"name",on:{click:function(n){return t._toggleSubMenu(e)}}},[n("a",{attrs:{href:"javascript:"}},[n("i",{staticClass:"fa icon",class:e.icon}),t._v(" "),n("span",[t._v(t._s(e.name))]),t._v(" "),e.children.length?n("i",{staticClass:"fa angle",class:e.isOpen?"fa-angle-down":"fa-angle-right"}):t._e()])])])]:t._e(),t._v(" "),e.path?t._e():[n("div",{staticClass:"name",on:{click:function(n){return t._toggleSubMenu(e)}}},[n("a",{attrs:{href:"javascript:"}},[n("i",{staticClass:"fa icon",class:e.icon}),t._v(" "),n("span",[t._v(t._s(e.name))]),t._v(" "),e.children.length?n("i",{staticClass:"fa angle",class:e.isOpen?"fa-angle-down":"fa-angle-right"}):t._e()])])],t._v(" "),e.isOpen&&e.children.length?n("ul",t._l(e.children,function(e,s){return n("router-link",{attrs:{to:{name:e.path},tag:"li","active-class":"active"}},[n("span",[t._v(t._s(e.name))])])}),1):t._e()],2)})],2)},staticRenderFns:[]};e.a=s},661:function(t,e,n){"use strict";e.__esModule=!0,e.formatDate=void 0;var s,a=n(645),i=(s=a)&&s.__esModule?s:{default:s};e.formatDate=function(t,e){return e=e||"YYYY-MM-DD HH:mm:ss",(0,i.default)(t).format(e)}},662:function(t,e,n){"use strict";e.__esModule=!0;var s,a=n(28),i=(s=a)&&s.__esModule?s:{default:s};e.default={name:"conditions",data:function(){return{searchVal:""}},props:{operation:Array},methods:{_ckQuery:function(){this.$emit("on-conditions",{searchVal:i.default.trim(this.searchVal)})}},computed:{isShow:function(){return this.$slots["search-group"]}},components:{}}},663:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(643),a=n.n(s);for(var i in s)"default"!==i&&function(t){n.d(e,t,function(){return s[t]})}(i);var o=n(666);var r=function(t){n(664)},u=n(27)(a.a,o.a,!1,r,null,null);e.default=u.exports},664:function(t,e,n){var s=n(665);"string"==typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);n(35)("3cb222d8",s,!0,{})},665:function(t,e,n){(t.exports=n(34)(!1)).push([t.i,".no-data-model{position:relative;width:100%;height:calc(100vh - 200px)}.no-data-model .no-data-box{width:210px;height:210px;position:absolute;left:50%;top:50%;margin-left:-105px;margin-top:-105px;text-align:center}.no-data-model .no-data-box .text{padding-top:10px;color:#666}",""])},666:function(t,e,n){"use strict";var s={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"no-data-model"},[e("div",{staticClass:"no-data-box"},[this._m(0),this._v(" "),e("div",{staticClass:"text"},[this._v(this._s(this.msg||this.$t("查询无数据")))])])])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"img"},[e("img",{attrs:{src:n(667),alt:""}})])}]};e.a=s},667:function(t,e,n){t.exports=n.p+"images/errorTip.png?a7b20f0ca8727f22f405c2a34d1363a0"},668:function(t,e,n){"use strict";var s,a=n(29),i=(s=a)&&s.__esModule?s:{default:s},o=n(661);i.default.filter("formatDate",o.formatDate)},670:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(662),a=n.n(s);for(var i in s)"default"!==i&&function(t){n.d(e,t,function(){return s[t]})}(i);var o=n(671),r=n(27)(a.a,o.a,!1,null,null,null);e.default=r.exports},671:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"conditions-model"},[n("div",{staticClass:"left"},[t._t("button-group")],2),t._v(" "),n("div",{staticClass:"right"},[n("div",{staticClass:"from-box"},[t.isShow?t._t("search-group"):t._e(),t._v(" "),t.isShow?t._e():[n("div",{staticClass:"list"},[n("x-button",{attrs:{type:"ghost",size:"small",icon:"fa fa-search"},on:{click:t._ckQuery}})],1),t._v(" "),n("div",{staticClass:"list"},[n("x-input",{staticStyle:{width:"180px"},attrs:{size:"small",placeholder:t.$t("请输入关键词"),type:"text"},on:{"on-enterkey":t._ckQuery},model:{value:t.searchVal,callback:function(e){t.searchVal=e},expression:"searchVal"}})],1)]],2)])])},staticRenderFns:[]};e.a=s}}); +//# sourceMappingURL=11.078cbab.js.map \ No newline at end of file diff --git a/escheduler-ui/dist/js/11.685f19d.js.map b/escheduler-ui/dist/js/11.078cbab.js.map similarity index 99% rename from escheduler-ui/dist/js/11.685f19d.js.map rename to escheduler-ui/dist/js/11.078cbab.js.map index dc04bcfcb4..fd20b8fbf2 100644 --- a/escheduler-ui/dist/js/11.685f19d.js.map +++ b/escheduler-ui/dist/js/11.078cbab.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///src/js/conf/home/pages/resource/pages/udf/pages/function/index.vue","webpack:///src/js/conf/home/pages/resource/pages/udf/pages/function/_source/list.vue","webpack:///./src/js/conf/home/pages/resource/pages/udf/pages/function/_source/createUdf.vue","webpack:///src/js/conf/home/pages/resource/pages/udf/pages/function/_source/createUdf.vue","webpack:///src/js/module/components/fileUpdate/udfUpdate.vue","webpack:///./src/js/conf/home/pages/resource/pages/udf/pages/function/_source/list.vue","webpack:///./src/js/module/components/fileUpdate/udfUpdate.vue","webpack:///./src/js/module/components/fileUpdate/udfUpdate.vue?7689","webpack:///./src/js/module/components/fileUpdate/udfUpdate.vue?59ac","webpack:///./src/js/module/components/fileUpdate/udfUpdate.vue?c5b2","webpack:///./src/js/conf/home/pages/resource/pages/udf/pages/function/_source/createUdf.vue?a45c","webpack:///./src/js/conf/home/pages/resource/pages/udf/pages/function/_source/list.vue?acef","webpack:///./src/js/conf/home/pages/resource/pages/udf/pages/function/index.vue?85d0","webpack:///./src/js/conf/home/pages/resource/pages/udf/pages/function/index.vue","webpack:///src/js/module/components/spin/spin.vue","webpack:///src/js/module/components/listConstruction/listConstruction.vue","webpack:///src/js/module/components/secondaryMenu/secondaryMenu.vue","webpack:///src/js/module/components/noData/noData.vue","webpack:///./node_modules/dayjs/dayjs.min.js","webpack:///./src/js/module/components/spin/spin.vue","webpack:///./src/js/module/components/spin/spin.vue?542d","webpack:///./src/js/module/components/spin/spin.vue?9371","webpack:///./src/js/module/components/spin/spin.vue?87eb","webpack:///./src/js/module/components/listConstruction/listConstruction.vue","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?b527","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?50be","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?6117","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?c652","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?7693","webpack:///./src/js/module/components/secondaryMenu/close.png","webpack:///./src/js/module/components/secondaryMenu/open.png","webpack:///./src/js/module/components/secondaryMenu/menu.js","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?048e","webpack:///./src/js/module/filter/filter.js","webpack:///src/js/module/components/conditions/conditions.vue","webpack:///./src/js/module/components/noData/noData.vue","webpack:///./src/js/module/components/noData/noData.vue?93a9","webpack:///./src/js/module/components/noData/noData.vue?86e8","webpack:///./src/js/module/components/noData/noData.vue?5a51","webpack:///./src/js/module/components/noData/images/errorTip.png","webpack:///./src/js/module/filter/formatDate.js","webpack:///./src/js/module/components/conditions/conditions.vue","webpack:///./src/js/module/components/conditions/conditions.vue?8ed7"],"names":["__webpack_require__","name","data","pageSize","pageNo","total","searchVal","isLoading","udfFuncList","props","methods","Object","assign","_vuex","mapActions","_onConditions","o","this","_getUdfFuncListP","_page","val","_create","self","modal","$modal","dialog","closable","showMask","escClose","className","transitionName","render","h","_createUdf2","default","on","onUpdate","_updateList","remove","close","flag","_this","getUdfFuncListP","then","res","totalList","catch","e","watch","created","mounted","components","mSecondaryMenu","_secondaryMenu2","mListConstruction","_listConstruction2","mConditions","_conditions2","mList","_list2","mSpin","_spin2","mCreateUdf","mNoData","_noData2","_createUdf","list","Array","Number","_closeDelete","i","$refs","doClose","_delete","item","deleteUdf","id","splice","$message","success","msg","error","_edit","$emit","a","_this2","setTimeout","defineProperty","__webpack_exports__","value","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_createUdf_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_createUdf_vue___default","n","__WEBPACK_IMPORT_KEY__","key","d","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_056410bc_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_createUdf_vue__","Component","normalizeComponent","store","_store2","type","funcName","argTypes","database","desc","resourceId","udfResourceList","isUpdate","upDisabled","_ok","spinnerLoading","_validation","_verifyUdfFuncName","_createUdfFunc","Promise","resolve","reject","param","dispatch","_onUpdatePresent","popup","apDisabled","_getUdfList","_this3","_onUpdate","_this4","push","$nextTick","_lodash2","filter","v","_toggleUpdate","warning","_i18n2","$t","_this5","_this6","length","mPopup","_popup2","mListBoxF","_listBoxF2","mUdfUpdate","_udfUpdate2","udfName","udfDesc","file","progress","_verifyName","_formDataUpdate","formData","FormData","append","_io2","post","emulateJSON","timeout","onUploadProgress","progressEvent","loaded","Math","floor","$","change","files","updated","beforeDestroy","destroyed","computed","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_44aa2057_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_udfUpdate_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_udfUpdate_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_540287d7_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_udfUpdate_vue__","__vue_styles__","ssrContext","content","module","locals","exports","esExports","_vm","_h","$createElement","_c","_self","staticClass","staticStyle","width","attrs","size","disabled","placeholder","autocomplete","model","callback","$$v","expression","_v","position","_e","_s","margin-top","margin-bottom","long","loading","click","staticRenderFns","ref","ok-text","nameText","ok","slot","label","maxlength","filterable","_l","city","alias","on-update-present","on-update","$index","href","resourceName","_f","updateTime","directives","rawName","shape","data-toggle","title","icon","$event","refInFor","placement","text-align","margin","padding-top","on-conditions","udf-func-list","page-no","page-size","current","show-elevator","on-change","is-spin","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_index_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_index_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_9666268c_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_index_vue__","isSpin","Boolean","isLeft","String","menuList","_menu2","index","$route","params","isTogHide","is","layoutBox","addClass","removeClass","_toggleSubMenu","isOpen","_toggleMenu","t","r","s","u","f","c","join","z","utcOffset","abs","m","year","month","clone","add","ceil","p","M","y","w","ms","Q","toLowerCase","replace","weekdays","split","months","l","S","g","format","pl","date","D","locale","$L","utc","$u","parse","prototype","$d","Date","NaN","test","match","UTC","init","$y","getFullYear","$M","getMonth","$D","getDate","$W","getDay","$H","getHours","$m","getMinutes","$s","getSeconds","$ms","getMilliseconds","$utils","isValid","toString","isSame","startOf","endOf","isAfter","isBefore","$g","set","day","hour","minute","second","millisecond","unix","valueOf","getTime","toDate","apply","slice","$locale","weekStart","$set","min","daysInMonth","get","setDate","subtract","substr","YY","YYYY","MM","MMM","monthsShort","MMMM","DD","dd","weekdaysMin","ddd","weekdaysShort","dddd","H","HH","hh","A","mm","ss","SSS","Z","round","getTimezoneOffset","diff","toJSON","toISOString","toUTCString","extend","isDayjs","en","Ls","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_16cfa774_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_spin_vue__","class","background","height","xmlns","xmlns:xlink","viewBox","preserveAspectRatio","transform","attributeName","values","keyTimes","dur","begin","repeatCount","fill","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_listConstruction_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_listConstruction_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_eae3645c_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_listConstruction_vue__","_t","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_secondaryMenu_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_secondaryMenu_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_f72bdd3a_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_secondaryMenu_vue__","escape","_i18n","menu","projects","i18n","path","children","security","resource","user","to","el","tag","active-class","_dayjs","formatDate","fmt","_dayjs2","operation","_ckQuery","trim","isShow","$slots","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noData_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noData_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_2d3808af_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_noData_vue__","_m","src","alt","_vue","_filter","Vue","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_conditions_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_conditions_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_a4fced1a_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_conditions_vue__","on-enterkey"],"mappings":"sFA8BAA,EAAA,WACAA,EAAA,WACAA,EAAA,UACAA,EAAA,UACAA,EAAA,UACAA,EAAA,UACAA,EAAA,oEAEAC,KAAA,qBACAC,KAFA,WAGA,OACAC,SAAA,GACAC,OAAA,EACAC,MAAA,GACAC,UAAA,GACAC,WAAA,EACAC,iBAGAC,SACAC,QAAAC,OAAAC,WACA,EAAAC,EAAAC,YAAA,iCACAC,cAFA,SAEAC,GACAC,KAAAX,UAAAU,EAAAV,UACAW,KAAAb,OAAA,EACAa,KAAAC,oBAEAC,MAPA,SAOAC,GACAH,KAAAb,OAAAgB,EACAH,KAAAC,oBAEAG,QAXA,WAYA,IAAAC,EAAAL,KACAM,EAAAN,KAAAO,OAAAC,QACAC,UAAA,EACAC,UAAA,EACAC,UAAA,EACAC,UAAA,iBACAC,eAAA,WACAC,OANA,SAMAC,GACA,OAAAA,EAAAC,EAAAC,SACAC,IACAC,SADA,WAEAd,EAAAe,cACAd,EAAAe,UAEAC,MALA,WAMAhB,EAAAe,WAGA7B,eAMA4B,YApCA,WAqCApB,KAAAd,SAAA,GACAc,KAAAb,OAAA,EACAa,KAAAX,UAAA,GACAW,KAAAC,oBAEAA,iBA1CA,SA0CAsB,GAAA,IAAAC,EAAAxB,KACAA,KAAAV,WAAAiC,EACAvB,KAAAyB,iBACAvC,SAAAc,KAAAd,SACAC,OAAAa,KAAAb,OACAE,UAAAW,KAAAX,YACAqC,KAAA,SAAAC,GACAH,EAAAjC,YAAAoC,EAAAC,UACAJ,EAAApC,MAAAuC,EAAAvC,MACAoC,EAAAlC,WAAA,IACAuC,MAAA,SAAAC,GACAN,EAAAlC,WAAA,OAIAyC,SACAC,QAvEA,aAyEAC,QAzEA,WA0EAjC,KAAAC,oBAEAiC,YAAAC,eAAAC,EAAAnB,QA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oBF,EAAA,OAAYE,YAAA,aAAuBL,EAAA,OAAAA,EAAAqO,GAAA,gBAAArO,EAAAmB,KAAAnB,EAAAiB,GAAA,KAAAjB,EAAA8P,OAAgf9P,EAAAmB,MAAhfhB,EAAA,OAAoFE,YAAA,SAAmBF,EAAA,YAAiBK,OAAO1F,KAAA,QAAA2F,KAAA,QAAAyC,KAAA,gBAAoDtM,IAAK6K,MAAAzB,EAAA4P,aAAsB,GAAA5P,EAAAiB,GAAA,KAAAd,EAAA,OAA4BE,YAAA,SAAmBF,EAAA,WAAgBG,aAAaC,MAAA,SAAgBC,OAAQC,KAAA,QAAAE,YAAAX,EAAAhD,GAAA,UAAAlC,KAAA,QAA4DlE,IAAKga,cAAA5Q,EAAA4P,UAA2B/O,OAAQ3G,MAAA8F,EAAA,UAAAc,SAAA,SAAAC,GAA+Cf,EAAAjL,UAAAgM,GAAkBC,WAAA,gBAAyB,aAEjvBU,oBACFzH,EAAA","file":"js/11.685f19d.js","sourcesContent":["\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/resource/pages/udf/pages/function/index.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/resource/pages/udf/pages/function/_source/list.vue","var normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./createUdf.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./createUdf.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-056410bc\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./createUdf.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/resource/pages/udf/pages/function/_source/createUdf.vue\n// module id = 1057\n// module chunks = 11","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/resource/pages/udf/pages/function/_source/createUdf.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/fileUpdate/udfUpdate.vue","var normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./list.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./list.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-44aa2057\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./list.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/resource/pages/udf/pages/function/_source/list.vue\n// module id = 1176\n// module chunks = 11","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-540287d7\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./udfUpdate.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./udfUpdate.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./udfUpdate.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-540287d7\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./udfUpdate.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/fileUpdate/udfUpdate.vue\n// module id = 1177\n// module chunks = 11","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/fileUpdate/udfUpdate.vue","var normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./list.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./list.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-44aa2057\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./list.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/resource/pages/udf/pages/function/_source/list.vue\n// module id = 1174\n// module chunks = 11","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-540287d7\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./udfUpdate.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./udfUpdate.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./udfUpdate.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-540287d7\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./udfUpdate.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/fileUpdate/udfUpdate.vue\n// module id = 1175\n// module chunks = 11","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/resource/pages/file/pages/create/index.vue","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n// This is CodeMirror (https://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\//.test(userAgent);\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\\/\\w+/.test(userAgent);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt() {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var activeElement;\n try {\n activeElement = document.activeElement;\n } catch(e) {\n activeElement = document.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {this.id = null;};\n Delayed.prototype.set = function (ms, f) {\n clearTimeout(this.id);\n this.id = setTimeout(f, ms);\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 30;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\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]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n input.init(d);\n }\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n // Add a span to a line.\n function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers || (emitter._handlers = {});\n map$$1[type] = (map$$1[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers, arr = map$$1 && map$$1[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map$$1[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range$$1;\n try {range$$1 = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range$$1 || range$$1.parentElement() != te) { return false }\n return range$$1.compareEndPoints(\"StartToEnd\", range$$1) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var this$1 = this;\n\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n var this$1 = this;\n\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this$1.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\s)\" + lineClass[2] + \"(?:$|\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {\n var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (node.className == \"CodeMirror-linewidget\")\n { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\");\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map$$1, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map$$1.length; i += 3) {\n mStart = map$$1[i];\n mEnd = map$$1[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map$$1.length - 3 || ch == mEnd && map$$1[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map$$1[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map$$1[i - 2] == map$$1[i - 3] && map$$1[i - 1].insertLeft) {\n node = map$$1[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map$$1.length - 3 && map$$1[i + 3] == map$$1[i + 4] && !map$$1[i + 5].insertLeft) {\n node = map$$1[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX() {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }\n return window.pageXOffset || (document.documentElement || document.body).scrollLeft\n }\n function pageScrollY() {\n if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }\n return window.pageYOffset || (document.documentElement || document.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var height = 0;\n if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above)\n { height += widgetHeight(lineObj.widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = true; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo$$1, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight$$1 = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo$$1, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight$$1; box.bottom += widgetHeight$$1;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight$$1 <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo$$1, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top || y >= coords.bottom;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo$$1, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo$$1, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo$$1, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo$$1, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range$$1 = doc.sel.ranges[i];\n if (range$$1.from().line >= cm.display.viewTo || range$$1.to().line < cm.display.viewFrom) { continue }\n var collapsed = range$$1.empty();\n if (collapsed || cm.options.showCursorWhenSelecting)\n { drawSelectionCursor(cm, range$$1.head, curFragment); }\n if (!collapsed)\n { drawSelectionRange(cm, range$$1, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\"; },\n cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n onBlur(cm);\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range$$1) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range$$1;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val);\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.pointerEvents = this.vert.style.pointerEvents = \"none\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.pointerEvents = \"auto\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt$$1 = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt$$1 != bar) { bar.style.pointerEvents = \"none\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt();\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this$1.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt();\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = window.getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }\n snapshot.activeElt.focus();\n if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var sel = window.getSelection(), range$$1 = document.createRange();\n range$$1.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range$$1.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range$$1);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(cm) {\n var width = cm.display.gutters.offsetWidth;\n cm.display.sizer.style.marginLeft = width + \"px\";\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }\n\n // Make sure the gutters options contains the element\n // \"CodeMirror-linenumbers\" when the lineNumbers option is true.\n function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && wheelPixelsPerUnit != null) {\n var pixels = dy * wheelPixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n var this$1 = this;\n\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this$1.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var this$1 = this;\n\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this$1.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n var this$1 = this;\n\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this$1.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(startGen) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = startGen || 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm)\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n var this$1 = this;\n\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this$1;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n var this$1 = this;\n\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this$1.lines[i];\n this$1.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var e = at + n; at < e; ++at)\n { if (op(this$1.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n var this$1 = this;\n\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this$1;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n var this$1 = this;\n\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this$1.height -= oldHeight - child.height;\n if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this$1.children.splice(++i, 0, leaf);\n leaf.parent = this$1;\n }\n child.lines = child.lines.slice(0, remaining);\n this$1.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n var this$1 = this;\n\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this$1[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var this$1 = this;\n\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n var this$1 = this;\n\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null));\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n var this$1 = this;\n\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this$1; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this$1.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range$$1 = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range$$1.head; }\n else if (start == \"anchor\") { pos = range$$1.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range$$1.to(); }\n else { pos = range$$1.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n var this$1 = this;\n\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this$1, ranges[i].anchor),\n clipPos(this$1, ranges[i].head)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var this$1 = this;\n\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var this$1 = this;\n\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var this$1 = this;\n\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range$$1 = sel.ranges[i];\n changes[i] = {from: range$$1.from(), to: range$$1.to(), text: this$1.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this$1, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {this.history = new History(this.history.maxGeneration);},\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history.maxGeneration);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo$$1 = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo$$1 == from.line && from.ch >= span.to ||\n span.from == null && lineNo$$1 != from.line ||\n span.from != null && lineNo$$1 == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo$$1;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo$$1 = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo$$1;\n });\n return clipPos(this, Pos(lineNo$$1, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n var this$1 = this;\n\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this$1.linked[i];\n if (link.doc != other) { continue }\n this$1.linked.splice(i, 1);\n other.unlinkDoc(this$1);\n detachSharedMarkers(findSharedMarkers(this$1));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var loadFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1)\n { return }\n\n var reader = new FileReader;\n reader.onload = operation(cm, function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) { content = \"\"; }\n text[i] = content;\n if (++read == n) {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)));\n }\n });\n reader.readAsText(file);\n };\n for (var i = 0; i < n; ++i) { loadFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 127: \"Delete\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Alt-F\": \"goWordRight\", \"Alt-B\": \"goWordLeft\", \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\",\n \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\", \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\",\n \"Alt-D\": \"delWordAfter\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\", \"Ctrl-T\": \"transposeChars\",\n \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map$$1, handle, context) {\n map$$1 = getKeyMap(map$$1);\n var found = map$$1.call ? map$$1.call(key, context) : map$$1[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map$$1.fallthrough) {\n if (Object.prototype.toString.call(map$$1.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map$$1.fallthrough, handle, context) }\n for (var i = 0; i < map$$1.fallthrough.length; i++) {\n var result = lookupKey(key, map$$1.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Cmd\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"char\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(0, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n cm.curOp.focus = activeElt();\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if (webkit || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n delayBlurEvent(cm);\n setTimeout(function () { return display.input.focus(); }, 20);\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.options.gutters.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.options.gutters[i];\n signal(cm, type, cm, line, gutter, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b-\\u200f\\u2028\\u2029\\ufeff]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n guttersChanged(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"firstLineNumber\", 1, guttersChanged, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, guttersChanged, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function guttersChanged(cm) {\n updateGutters(cm);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n setGuttersForLineNumbers(options);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input);\n display.wrapper.CodeMirror = this;\n updateGutters(this);\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(bind(onFocus, this), 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this$1, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range$$1 = sel.ranges[i$1];\n var from = range$$1.from(), to = range$$1.to();\n if (range$$1.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == inserted)\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput)\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range$$1 = sel.ranges[i];\n if (range$$1.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range$$1.head.line)) { continue }\n var mode = cm.getModeAt(range$$1.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range$$1.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range$$1.head.line).text.slice(0, range$$1.head.ch)))\n { indented = indentLine(cm, range$$1.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range$$1.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", !!autocorrect);\n field.setAttribute(\"autocapitalize\", !!autocapitalize);\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n disableBrowserMagic(te);\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map$$1, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n },\n removeKeyMap: function(map$$1) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this$1.state.modeGen++;\n regChange(this$1);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range$$1 = ranges[i];\n if (!range$$1.empty()) {\n var from = range$$1.from(), to = range$$1.to();\n var start = Math.max(end, from.line);\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how); }\n var newRanges = this$1.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range$$1.head.line > end) {\n indentLine(this$1, range$$1.head.line, how, true);\n end = range$$1.head.line;\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range$$1 = this.doc.sel.primary();\n if (start == null) { pos = range$$1.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range$$1.from() : range$$1.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range$$1) {\n if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range$$1) {\n var other = findPosH(doc, range$$1.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this$1, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range$$1) {\n if (collapse)\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range$$1 == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range$$1, margin) {\n if (range$$1 == null) {\n range$$1 = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range$$1 == \"number\") {\n range$$1 = {from: Pos(range$$1, 0), to: null};\n } else if (range$$1.from == null) {\n range$$1 = {from: range$$1, to: null};\n }\n if (!range$$1.to) { range$$1.to = range$$1.from; }\n range$$1.margin = margin || 0;\n\n if (range$$1.from.line != null) {\n scrollToRange(this, range$$1);\n } else {\n scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo$$1 = this.display.viewFrom;\n this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n ++lineNo$$1;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"char\", \"column\" (like char, but doesn't\n // cross line boundaries), \"word\" (across next word), or \"group\" (to\n // the start of next group of word or non-word-non-whitespace\n // chars). The visually param controls whether, in right-to-left\n // text, direction 1 means to move towards the next index in the\n // string, or towards the character to the right of the current\n // position. The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n function findNextLine() {\n var l = pos.line + dir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n on(div, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = document.activeElement;\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = this.cm.state.focused;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map$$1 = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map$$1[map$$1.length - 1], offset: map$$1[map$$1.length - 2] - map$$1[map$$1.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor())\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var input = this;\n if (this.selectionInEditor())\n { this.pollSelection(); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range$$1;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range$$1 = found[0].find(0)))\n { addText(getBetween(cm.doc, range$$1.from, range$$1.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map$$1 = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map$$1.length; j += 3) {\n var curNode = map$$1[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map$$1[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map$$1[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing) { return }\n var cm = this.cm;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt() != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { window.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt();\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, …*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.45.0\";\n\n return CodeMirror;\n\n})));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/lib/codemirror.js\n// module id = 644\n// module chunks = 3 4 5 7 8 14","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./spin.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./spin.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./spin.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./spin.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/spin/spin.vue\n// module id = 646\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/resource/pages/file/pages/create/index.vue","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n// This is CodeMirror (https://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\//.test(userAgent);\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\\/\\w+/.test(userAgent);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt() {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var activeElement;\n try {\n activeElement = document.activeElement;\n } catch(e) {\n activeElement = document.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {this.id = null;};\n Delayed.prototype.set = function (ms, f) {\n clearTimeout(this.id);\n this.id = setTimeout(f, ms);\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 30;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\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]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n input.init(d);\n }\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n // Add a span to a line.\n function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers || (emitter._handlers = {});\n map$$1[type] = (map$$1[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers, arr = map$$1 && map$$1[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map$$1[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range$$1;\n try {range$$1 = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range$$1 || range$$1.parentElement() != te) { return false }\n return range$$1.compareEndPoints(\"StartToEnd\", range$$1) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var this$1 = this;\n\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n var this$1 = this;\n\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this$1.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\s)\" + lineClass[2] + \"(?:$|\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {\n var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (node.className == \"CodeMirror-linewidget\")\n { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\");\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map$$1, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map$$1.length; i += 3) {\n mStart = map$$1[i];\n mEnd = map$$1[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map$$1.length - 3 || ch == mEnd && map$$1[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map$$1[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map$$1[i - 2] == map$$1[i - 3] && map$$1[i - 1].insertLeft) {\n node = map$$1[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map$$1.length - 3 && map$$1[i + 3] == map$$1[i + 4] && !map$$1[i + 5].insertLeft) {\n node = map$$1[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX() {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }\n return window.pageXOffset || (document.documentElement || document.body).scrollLeft\n }\n function pageScrollY() {\n if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }\n return window.pageYOffset || (document.documentElement || document.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var height = 0;\n if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above)\n { height += widgetHeight(lineObj.widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = true; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo$$1, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight$$1 = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo$$1, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight$$1; box.bottom += widgetHeight$$1;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight$$1 <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo$$1, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top || y >= coords.bottom;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo$$1, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo$$1, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo$$1, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo$$1, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range$$1 = doc.sel.ranges[i];\n if (range$$1.from().line >= cm.display.viewTo || range$$1.to().line < cm.display.viewFrom) { continue }\n var collapsed = range$$1.empty();\n if (collapsed || cm.options.showCursorWhenSelecting)\n { drawSelectionCursor(cm, range$$1.head, curFragment); }\n if (!collapsed)\n { drawSelectionRange(cm, range$$1, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\"; },\n cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n onBlur(cm);\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range$$1) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range$$1;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val);\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.pointerEvents = this.vert.style.pointerEvents = \"none\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.pointerEvents = \"auto\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt$$1 = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt$$1 != bar) { bar.style.pointerEvents = \"none\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt();\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this$1.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt();\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = window.getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }\n snapshot.activeElt.focus();\n if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var sel = window.getSelection(), range$$1 = document.createRange();\n range$$1.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range$$1.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range$$1);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(cm) {\n var width = cm.display.gutters.offsetWidth;\n cm.display.sizer.style.marginLeft = width + \"px\";\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }\n\n // Make sure the gutters options contains the element\n // \"CodeMirror-linenumbers\" when the lineNumbers option is true.\n function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && wheelPixelsPerUnit != null) {\n var pixels = dy * wheelPixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n var this$1 = this;\n\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this$1.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var this$1 = this;\n\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this$1.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n var this$1 = this;\n\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this$1.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(startGen) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = startGen || 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm)\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n var this$1 = this;\n\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this$1;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n var this$1 = this;\n\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this$1.lines[i];\n this$1.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var e = at + n; at < e; ++at)\n { if (op(this$1.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n var this$1 = this;\n\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this$1;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n var this$1 = this;\n\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this$1.height -= oldHeight - child.height;\n if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this$1.children.splice(++i, 0, leaf);\n leaf.parent = this$1;\n }\n child.lines = child.lines.slice(0, remaining);\n this$1.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n var this$1 = this;\n\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this$1[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var this$1 = this;\n\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n var this$1 = this;\n\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null));\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n var this$1 = this;\n\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this$1; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this$1.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range$$1 = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range$$1.head; }\n else if (start == \"anchor\") { pos = range$$1.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range$$1.to(); }\n else { pos = range$$1.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n var this$1 = this;\n\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this$1, ranges[i].anchor),\n clipPos(this$1, ranges[i].head)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var this$1 = this;\n\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var this$1 = this;\n\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var this$1 = this;\n\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range$$1 = sel.ranges[i];\n changes[i] = {from: range$$1.from(), to: range$$1.to(), text: this$1.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this$1, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {this.history = new History(this.history.maxGeneration);},\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history.maxGeneration);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo$$1 = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo$$1 == from.line && from.ch >= span.to ||\n span.from == null && lineNo$$1 != from.line ||\n span.from != null && lineNo$$1 == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo$$1;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo$$1 = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo$$1;\n });\n return clipPos(this, Pos(lineNo$$1, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n var this$1 = this;\n\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this$1.linked[i];\n if (link.doc != other) { continue }\n this$1.linked.splice(i, 1);\n other.unlinkDoc(this$1);\n detachSharedMarkers(findSharedMarkers(this$1));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var loadFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1)\n { return }\n\n var reader = new FileReader;\n reader.onload = operation(cm, function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) { content = \"\"; }\n text[i] = content;\n if (++read == n) {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)));\n }\n });\n reader.readAsText(file);\n };\n for (var i = 0; i < n; ++i) { loadFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 127: \"Delete\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Alt-F\": \"goWordRight\", \"Alt-B\": \"goWordLeft\", \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\",\n \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\", \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\",\n \"Alt-D\": \"delWordAfter\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\", \"Ctrl-T\": \"transposeChars\",\n \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map$$1, handle, context) {\n map$$1 = getKeyMap(map$$1);\n var found = map$$1.call ? map$$1.call(key, context) : map$$1[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map$$1.fallthrough) {\n if (Object.prototype.toString.call(map$$1.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map$$1.fallthrough, handle, context) }\n for (var i = 0; i < map$$1.fallthrough.length; i++) {\n var result = lookupKey(key, map$$1.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Cmd\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"char\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(0, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n cm.curOp.focus = activeElt();\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if (webkit || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n delayBlurEvent(cm);\n setTimeout(function () { return display.input.focus(); }, 20);\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.options.gutters.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.options.gutters[i];\n signal(cm, type, cm, line, gutter, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b-\\u200f\\u2028\\u2029\\ufeff]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n guttersChanged(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"firstLineNumber\", 1, guttersChanged, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, guttersChanged, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function guttersChanged(cm) {\n updateGutters(cm);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n setGuttersForLineNumbers(options);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input);\n display.wrapper.CodeMirror = this;\n updateGutters(this);\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(bind(onFocus, this), 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this$1, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range$$1 = sel.ranges[i$1];\n var from = range$$1.from(), to = range$$1.to();\n if (range$$1.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == inserted)\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput)\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range$$1 = sel.ranges[i];\n if (range$$1.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range$$1.head.line)) { continue }\n var mode = cm.getModeAt(range$$1.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range$$1.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range$$1.head.line).text.slice(0, range$$1.head.ch)))\n { indented = indentLine(cm, range$$1.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range$$1.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", !!autocorrect);\n field.setAttribute(\"autocapitalize\", !!autocapitalize);\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n disableBrowserMagic(te);\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map$$1, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n },\n removeKeyMap: function(map$$1) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this$1.state.modeGen++;\n regChange(this$1);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range$$1 = ranges[i];\n if (!range$$1.empty()) {\n var from = range$$1.from(), to = range$$1.to();\n var start = Math.max(end, from.line);\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how); }\n var newRanges = this$1.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range$$1.head.line > end) {\n indentLine(this$1, range$$1.head.line, how, true);\n end = range$$1.head.line;\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range$$1 = this.doc.sel.primary();\n if (start == null) { pos = range$$1.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range$$1.from() : range$$1.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range$$1) {\n if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range$$1) {\n var other = findPosH(doc, range$$1.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this$1, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range$$1) {\n if (collapse)\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range$$1 == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range$$1, margin) {\n if (range$$1 == null) {\n range$$1 = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range$$1 == \"number\") {\n range$$1 = {from: Pos(range$$1, 0), to: null};\n } else if (range$$1.from == null) {\n range$$1 = {from: range$$1, to: null};\n }\n if (!range$$1.to) { range$$1.to = range$$1.from; }\n range$$1.margin = margin || 0;\n\n if (range$$1.from.line != null) {\n scrollToRange(this, range$$1);\n } else {\n scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo$$1 = this.display.viewFrom;\n this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n ++lineNo$$1;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"char\", \"column\" (like char, but doesn't\n // cross line boundaries), \"word\" (across next word), or \"group\" (to\n // the start of next group of word or non-word-non-whitespace\n // chars). The visually param controls whether, in right-to-left\n // text, direction 1 means to move towards the next index in the\n // string, or towards the character to the right of the current\n // position. The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n function findNextLine() {\n var l = pos.line + dir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n on(div, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = document.activeElement;\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = this.cm.state.focused;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map$$1 = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map$$1[map$$1.length - 1], offset: map$$1[map$$1.length - 2] - map$$1[map$$1.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor())\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var input = this;\n if (this.selectionInEditor())\n { this.pollSelection(); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range$$1;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range$$1 = found[0].find(0)))\n { addText(getBetween(cm.doc, range$$1.from, range$$1.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map$$1 = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map$$1.length; j += 3) {\n var curNode = map$$1[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map$$1[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map$$1[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing) { return }\n var cm = this.cm;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt() != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { window.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt();\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, …*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.45.0\";\n\n return CodeMirror;\n\n})));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/lib/codemirror.js\n// module id = 644\n// module chunks = 3 4 5 7 8 14","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./spin.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./spin.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./spin.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./spin.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/spin/spin.vue\n// module id = 646\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/tooltipsJSON/tooltipsJSON.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/datasource/pages/list/_source/createDataSource.vue","var normalizeComponent = require(\"!../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./list.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./list.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-39d01284\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./list.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/datasource/pages/list/_source/list.vue\n// module id = 1185\n// module chunks = 17","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-6fcbd2f8\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./tooltipsJSON.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./tooltipsJSON.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./tooltipsJSON.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-6fcbd2f8\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./tooltipsJSON.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/tooltipsJSON/tooltipsJSON.vue\n// module id = 1186\n// module chunks = 17","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/tooltipsJSON/tooltipsJSON.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/datasource/pages/list/_source/createDataSource.vue","var normalizeComponent = require(\"!../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./list.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./list.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-39d01284\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./list.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/datasource/pages/list/_source/list.vue\n// module id = 1183\n// module chunks = 17","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-6fcbd2f8\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./tooltipsJSON.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./tooltipsJSON.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./tooltipsJSON.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-6fcbd2f8\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./tooltipsJSON.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/tooltipsJSON/tooltipsJSON.vue\n// module id = 1184\n// module chunks = 17","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/index/index.vue","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/index/_source/projectChart.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-39c5ab3e\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./projectChart.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./projectChart.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./projectChart.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-39c5ab3e\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./projectChart.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/index/_source/projectChart.vue\n// module id = 988\n// module chunks = 18 26","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/index/index.vue","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/index/_source/projectChart.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-39c5ab3e\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./projectChart.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./projectChart.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./projectChart.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-39c5ab3e\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./projectChart.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/index/_source/projectChart.vue\n// module id = 988\n// module chunks = 18 26","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/instance/pages/list/index.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/instance/pages/list/index.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/instance/pages/gantt/index.vue","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/instance/pages/gantt/index.vue","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/tree/index.vue","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/tree/index.vue","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/list/_source/createProject.vue","var normalizeComponent = require(\"!../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./list.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./list.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-714acc62\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./list.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/list/_source/list.vue\n// module id = 1092\n// module chunks = 24","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"list-model\"},[_c('div',{staticClass:\"table-box\"},[_c('table',[_c('tr',[_c('th',[_c('span',[_vm._v(_vm._s(_vm.$t('编号')))])]),_vm._v(\" \"),_c('th',[_c('span',[_vm._v(_vm._s(_vm.$t('项目名称')))])]),_vm._v(\" \"),_c('th',[_c('span',[_vm._v(_vm._s(_vm.$t('所属用户')))])]),_vm._v(\" \"),_c('th',[_c('span',[_vm._v(_vm._s(_vm.$t('描述')))])]),_vm._v(\" \"),_c('th',[_c('span',[_vm._v(_vm._s(_vm.$t('创建时间')))])]),_vm._v(\" \"),_c('th',[_c('span',[_vm._v(_vm._s(_vm.$t('更新时间')))])]),_vm._v(\" \"),_c('th',{attrs:{\"width\":\"80\"}},[_c('span',[_vm._v(_vm._s(_vm.$t('操作')))])])]),_vm._v(\" \"),_vm._l((_vm.list),function(item,$index){return _c('tr',{key:$index},[_c('td',[_c('span',[_vm._v(_vm._s(parseInt(_vm.pageNo === 1 ? ($index + 1) : (($index + 1) + (_vm.pageSize * (_vm.pageNo - 1))))))])]),_vm._v(\" \"),_c('td',[_c('span',[_c('a',{staticClass:\"links\",attrs:{\"href\":\"javascript:\"},on:{\"click\":function($event){return _vm._switchProjects(item)}}},[_vm._v(_vm._s(item.name))])])]),_vm._v(\" \"),_c('td',[_c('span',[_vm._v(_vm._s(item.userName || '-'))])]),_vm._v(\" \"),_c('td',[_c('span',[_vm._v(_vm._s(item.desc))])]),_vm._v(\" \"),_c('td',[_c('span',[_vm._v(_vm._s(_vm._f(\"formatDate\")(item.createTime)))])]),_vm._v(\" \"),_c('td',[_c('span',[_vm._v(_vm._s(_vm._f(\"formatDate\")(item.updateTime)))])]),_vm._v(\" \"),_c('td',[_c('x-button',{directives:[{name:\"ps\",rawName:\"v-ps\",value:(['GENERAL_USER']),expression:\"['GENERAL_USER']\"}],attrs:{\"type\":\"info\",\"shape\":\"circle\",\"size\":\"xsmall\",\"data-toggle\":\"tooltip\",\"title\":_vm.$t('编辑'),\"icon\":\"iconfont icon-bianjixiugai\"},on:{\"click\":function($event){return _vm._edit(item)}}}),_vm._v(\" \"),_c('x-poptip',{ref:'poptip-' + $index,refInFor:true,attrs:{\"placement\":\"bottom-end\",\"width\":\"90\"}},[_c('p',[_vm._v(_vm._s(_vm.$t('确定删除吗?')))]),_vm._v(\" \"),_c('div',{staticStyle:{\"text-align\":\"right\",\"margin\":\"0\",\"padding-top\":\"4px\"}},[_c('x-button',{attrs:{\"type\":\"text\",\"size\":\"xsmall\",\"shape\":\"circle\"},on:{\"click\":function($event){return _vm._closeDelete($index)}}},[_vm._v(_vm._s(_vm.$t('取消')))]),_vm._v(\" \"),_c('x-button',{attrs:{\"type\":\"primary\",\"size\":\"xsmall\",\"shape\":\"circle\"},on:{\"click\":function($event){return _vm._delete(item,$index)}}},[_vm._v(_vm._s(_vm.$t('确定')))])],1),_vm._v(\" \"),_c('template',{slot:\"reference\"},[_c('x-button',{directives:[{name:\"ps\",rawName:\"v-ps\",value:(['GENERAL_USER']),expression:\"['GENERAL_USER']\"}],attrs:{\"type\":\"error\",\"shape\":\"circle\",\"size\":\"xsmall\",\"data-toggle\":\"tooltip\",\"title\":_vm.$t('删除'),\"icon\":\"iconfont icon-shanchu\"}})],1)],2)],1)])})],2)])])}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-714acc62\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/conf/home/pages/projects/pages/list/_source/list.vue\n// module id = 1093\n// module chunks = 24","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-14efef04\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./createProject.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./createProject.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./createProject.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-14efef04\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./createProject.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/list/_source/createProject.vue\n// module id = 1094\n// module chunks = 24","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/user/pages/account/_source/info.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-a328421e\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./info.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./info.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./info.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-a328421e\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./info.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/user/pages/account/_source/info.vue\n// module id = 1221\n// module chunks = 25","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./listConstruction.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"70439c42\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-eae3645c\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 651\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-eae3645c\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 652\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"home-main list-construction-model\"},[_c('div',{staticClass:\"content-title\"},[_c('span',[_vm._v(_vm._s(_vm.title))])]),_vm._v(\" \"),_c('div',{staticClass:\"conditions-box\"},[_vm._t(\"conditions\")],2),_vm._v(\" \"),_c('div',{staticClass:\"list-box\"},[_vm._t(\"content\")],2)])}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-eae3645c\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 653\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-f72bdd3a\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./secondaryMenu.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./secondaryMenu.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./secondaryMenu.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-f72bdd3a\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./secondaryMenu.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/secondaryMenu/secondaryMenu.vue\n// module id = 654\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 25 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/user/pages/account/_source/info.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-a328421e\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./info.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./info.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./info.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-a328421e\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./info.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/user/pages/account/_source/info.vue\n// module id = 1219\n// module chunks = 25","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./listConstruction.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"70439c42\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-eae3645c\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 651\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-eae3645c\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 652\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"home-main list-construction-model\"},[_c('div',{staticClass:\"content-title\"},[_c('span',[_vm._v(_vm._s(_vm.title))])]),_vm._v(\" \"),_c('div',{staticClass:\"conditions-box\"},[_vm._t(\"conditions\")],2),_vm._v(\" \"),_c('div',{staticClass:\"list-box\"},[_vm._t(\"content\")],2)])}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-eae3645c\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 653\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-f72bdd3a\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./secondaryMenu.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./secondaryMenu.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./secondaryMenu.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-f72bdd3a\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./secondaryMenu.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/secondaryMenu/secondaryMenu.vue\n// module id = 654\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 25 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/user/pages/password/_source/info.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-30a2da57\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./info.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./info.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./info.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-30a2da57\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./info.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/user/pages/password/_source/info.vue\n// module id = 1226\n// module chunks = 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./listConstruction.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"70439c42\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-eae3645c\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 651\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-eae3645c\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 652\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"home-main list-construction-model\"},[_c('div',{staticClass:\"content-title\"},[_c('span',[_vm._v(_vm._s(_vm.title))])]),_vm._v(\" \"),_c('div',{staticClass:\"conditions-box\"},[_vm._t(\"conditions\")],2),_vm._v(\" \"),_c('div',{staticClass:\"list-box\"},[_vm._t(\"content\")],2)])}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-eae3645c\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 653\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-f72bdd3a\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./secondaryMenu.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./secondaryMenu.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./secondaryMenu.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-f72bdd3a\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./secondaryMenu.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/secondaryMenu/secondaryMenu.vue\n// module id = 654\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 25 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/user/pages/password/_source/info.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-30a2da57\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./info.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./info.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./info.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-30a2da57\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./info.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/user/pages/password/_source/info.vue\n// module id = 1224\n// module chunks = 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./listConstruction.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"70439c42\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-eae3645c\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 651\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-eae3645c\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 652\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"home-main list-construction-model\"},[_c('div',{staticClass:\"content-title\"},[_c('span',[_vm._v(_vm._s(_vm.title))])]),_vm._v(\" \"),_c('div',{staticClass:\"conditions-box\"},[_vm._t(\"conditions\")],2),_vm._v(\" \"),_c('div',{staticClass:\"list-box\"},[_vm._t(\"content\")],2)])}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-eae3645c\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 653\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-f72bdd3a\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./secondaryMenu.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./secondaryMenu.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./secondaryMenu.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-f72bdd3a\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./secondaryMenu.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/secondaryMenu/secondaryMenu.vue\n// module id = 654\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 25 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/instance/index.vue","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/instance/index.vue","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/instance/pages/details/index.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/instanceDetails.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/variable/index.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/variable/variablesView.vue","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\n\nexport default {\n data () {\n return {\n router,\n store,\n isDetails: false\n }\n },\n created () {\n this.isDetails = this.store.state.dag.isDetails\n },\n methods: {\n },\n computed: {\n _isDetails () {\n return this.isDetails ? 'icon-disabled' : ''\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/module/mixin/disabledState.js","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n// This is CodeMirror (https://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\//.test(userAgent);\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\\/\\w+/.test(userAgent);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt() {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var activeElement;\n try {\n activeElement = document.activeElement;\n } catch(e) {\n activeElement = document.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {this.id = null;};\n Delayed.prototype.set = function (ms, f) {\n clearTimeout(this.id);\n this.id = setTimeout(f, ms);\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 30;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\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]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n input.init(d);\n }\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n // Add a span to a line.\n function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers || (emitter._handlers = {});\n map$$1[type] = (map$$1[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers, arr = map$$1 && map$$1[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map$$1[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range$$1;\n try {range$$1 = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range$$1 || range$$1.parentElement() != te) { return false }\n return range$$1.compareEndPoints(\"StartToEnd\", range$$1) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var this$1 = this;\n\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n var this$1 = this;\n\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this$1.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\s)\" + lineClass[2] + \"(?:$|\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {\n var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (node.className == \"CodeMirror-linewidget\")\n { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\");\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map$$1, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map$$1.length; i += 3) {\n mStart = map$$1[i];\n mEnd = map$$1[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map$$1.length - 3 || ch == mEnd && map$$1[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map$$1[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map$$1[i - 2] == map$$1[i - 3] && map$$1[i - 1].insertLeft) {\n node = map$$1[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map$$1.length - 3 && map$$1[i + 3] == map$$1[i + 4] && !map$$1[i + 5].insertLeft) {\n node = map$$1[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX() {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }\n return window.pageXOffset || (document.documentElement || document.body).scrollLeft\n }\n function pageScrollY() {\n if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }\n return window.pageYOffset || (document.documentElement || document.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var height = 0;\n if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above)\n { height += widgetHeight(lineObj.widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = true; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo$$1, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight$$1 = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo$$1, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight$$1; box.bottom += widgetHeight$$1;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight$$1 <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo$$1, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top || y >= coords.bottom;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo$$1, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo$$1, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo$$1, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo$$1, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range$$1 = doc.sel.ranges[i];\n if (range$$1.from().line >= cm.display.viewTo || range$$1.to().line < cm.display.viewFrom) { continue }\n var collapsed = range$$1.empty();\n if (collapsed || cm.options.showCursorWhenSelecting)\n { drawSelectionCursor(cm, range$$1.head, curFragment); }\n if (!collapsed)\n { drawSelectionRange(cm, range$$1, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\"; },\n cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n onBlur(cm);\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range$$1) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range$$1;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val);\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.pointerEvents = this.vert.style.pointerEvents = \"none\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.pointerEvents = \"auto\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt$$1 = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt$$1 != bar) { bar.style.pointerEvents = \"none\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt();\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this$1.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt();\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = window.getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }\n snapshot.activeElt.focus();\n if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var sel = window.getSelection(), range$$1 = document.createRange();\n range$$1.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range$$1.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range$$1);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(cm) {\n var width = cm.display.gutters.offsetWidth;\n cm.display.sizer.style.marginLeft = width + \"px\";\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }\n\n // Make sure the gutters options contains the element\n // \"CodeMirror-linenumbers\" when the lineNumbers option is true.\n function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && wheelPixelsPerUnit != null) {\n var pixels = dy * wheelPixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n var this$1 = this;\n\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this$1.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var this$1 = this;\n\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this$1.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n var this$1 = this;\n\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this$1.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(startGen) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = startGen || 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm)\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n var this$1 = this;\n\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this$1;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n var this$1 = this;\n\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this$1.lines[i];\n this$1.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var e = at + n; at < e; ++at)\n { if (op(this$1.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n var this$1 = this;\n\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this$1;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n var this$1 = this;\n\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this$1.height -= oldHeight - child.height;\n if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this$1.children.splice(++i, 0, leaf);\n leaf.parent = this$1;\n }\n child.lines = child.lines.slice(0, remaining);\n this$1.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n var this$1 = this;\n\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this$1[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var this$1 = this;\n\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n var this$1 = this;\n\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null));\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n var this$1 = this;\n\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this$1; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this$1.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range$$1 = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range$$1.head; }\n else if (start == \"anchor\") { pos = range$$1.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range$$1.to(); }\n else { pos = range$$1.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n var this$1 = this;\n\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this$1, ranges[i].anchor),\n clipPos(this$1, ranges[i].head)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var this$1 = this;\n\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var this$1 = this;\n\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var this$1 = this;\n\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range$$1 = sel.ranges[i];\n changes[i] = {from: range$$1.from(), to: range$$1.to(), text: this$1.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this$1, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {this.history = new History(this.history.maxGeneration);},\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history.maxGeneration);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo$$1 = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo$$1 == from.line && from.ch >= span.to ||\n span.from == null && lineNo$$1 != from.line ||\n span.from != null && lineNo$$1 == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo$$1;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo$$1 = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo$$1;\n });\n return clipPos(this, Pos(lineNo$$1, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n var this$1 = this;\n\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this$1.linked[i];\n if (link.doc != other) { continue }\n this$1.linked.splice(i, 1);\n other.unlinkDoc(this$1);\n detachSharedMarkers(findSharedMarkers(this$1));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var loadFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1)\n { return }\n\n var reader = new FileReader;\n reader.onload = operation(cm, function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) { content = \"\"; }\n text[i] = content;\n if (++read == n) {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)));\n }\n });\n reader.readAsText(file);\n };\n for (var i = 0; i < n; ++i) { loadFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 127: \"Delete\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Alt-F\": \"goWordRight\", \"Alt-B\": \"goWordLeft\", \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\",\n \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\", \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\",\n \"Alt-D\": \"delWordAfter\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\", \"Ctrl-T\": \"transposeChars\",\n \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map$$1, handle, context) {\n map$$1 = getKeyMap(map$$1);\n var found = map$$1.call ? map$$1.call(key, context) : map$$1[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map$$1.fallthrough) {\n if (Object.prototype.toString.call(map$$1.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map$$1.fallthrough, handle, context) }\n for (var i = 0; i < map$$1.fallthrough.length; i++) {\n var result = lookupKey(key, map$$1.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Cmd\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"char\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(0, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n cm.curOp.focus = activeElt();\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if (webkit || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n delayBlurEvent(cm);\n setTimeout(function () { return display.input.focus(); }, 20);\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.options.gutters.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.options.gutters[i];\n signal(cm, type, cm, line, gutter, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b-\\u200f\\u2028\\u2029\\ufeff]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n guttersChanged(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"firstLineNumber\", 1, guttersChanged, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, guttersChanged, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function guttersChanged(cm) {\n updateGutters(cm);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n setGuttersForLineNumbers(options);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input);\n display.wrapper.CodeMirror = this;\n updateGutters(this);\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(bind(onFocus, this), 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this$1, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range$$1 = sel.ranges[i$1];\n var from = range$$1.from(), to = range$$1.to();\n if (range$$1.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == inserted)\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput)\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range$$1 = sel.ranges[i];\n if (range$$1.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range$$1.head.line)) { continue }\n var mode = cm.getModeAt(range$$1.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range$$1.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range$$1.head.line).text.slice(0, range$$1.head.ch)))\n { indented = indentLine(cm, range$$1.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range$$1.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", !!autocorrect);\n field.setAttribute(\"autocapitalize\", !!autocapitalize);\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n disableBrowserMagic(te);\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map$$1, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n },\n removeKeyMap: function(map$$1) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this$1.state.modeGen++;\n regChange(this$1);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range$$1 = ranges[i];\n if (!range$$1.empty()) {\n var from = range$$1.from(), to = range$$1.to();\n var start = Math.max(end, from.line);\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how); }\n var newRanges = this$1.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range$$1.head.line > end) {\n indentLine(this$1, range$$1.head.line, how, true);\n end = range$$1.head.line;\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range$$1 = this.doc.sel.primary();\n if (start == null) { pos = range$$1.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range$$1.from() : range$$1.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range$$1) {\n if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range$$1) {\n var other = findPosH(doc, range$$1.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this$1, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range$$1) {\n if (collapse)\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range$$1 == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range$$1, margin) {\n if (range$$1 == null) {\n range$$1 = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range$$1 == \"number\") {\n range$$1 = {from: Pos(range$$1, 0), to: null};\n } else if (range$$1.from == null) {\n range$$1 = {from: range$$1, to: null};\n }\n if (!range$$1.to) { range$$1.to = range$$1.from; }\n range$$1.margin = margin || 0;\n\n if (range$$1.from.line != null) {\n scrollToRange(this, range$$1);\n } else {\n scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo$$1 = this.display.viewFrom;\n this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n ++lineNo$$1;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"char\", \"column\" (like char, but doesn't\n // cross line boundaries), \"word\" (across next word), or \"group\" (to\n // the start of next group of word or non-word-non-whitespace\n // chars). The visually param controls whether, in right-to-left\n // text, direction 1 means to move towards the next index in the\n // string, or towards the character to the right of the current\n // position. The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n function findNextLine() {\n var l = pos.line + dir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n on(div, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = document.activeElement;\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = this.cm.state.focused;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map$$1 = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map$$1[map$$1.length - 1], offset: map$$1[map$$1.length - 2] - map$$1[map$$1.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor())\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var input = this;\n if (this.selectionInEditor())\n { this.pollSelection(); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range$$1;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range$$1 = found[0].find(0)))\n { addText(getBetween(cm.doc, range$$1.from, range$$1.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map$$1 = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map$$1.length; j += 3) {\n var curNode = map$$1[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map$$1[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map$$1[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing) { return }\n var cm = this.cm;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt() != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { window.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt();\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, …*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.45.0\";\n\n return CodeMirror;\n\n})));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/lib/codemirror.js\n// module id = 644\n// module chunks = 3 4 5 7 8 14","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-f72bdd3a\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./secondaryMenu.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./secondaryMenu.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./secondaryMenu.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-f72bdd3a\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./secondaryMenu.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/secondaryMenu/secondaryMenu.vue\n// module id = 654\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 25 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/priority/priority.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport _ from 'lodash'\nimport $ from 'jquery'\nimport i18n from '@/module/i18n'\nimport store from '@/conf/home/store'\n\n/**\n * Node, to array\n */\nconst rtTargetarrArr = (id) => {\n let a = $(`#${id}`).attr('data-targetarr')\n return a ? a.split(',') : []\n}\n\n/**\n * Store node id to targetarr\n */\nconst saveTargetarr = (valId, domId) => {\n let $target = $(`#${domId}`)\n let targetStr = $target.attr('data-targetarr') ? $target.attr('data-targetarr') + `,${valId}` : `${valId}`\n $target.attr('data-targetarr', targetStr)\n}\n\nconst rtBantpl = () => {\n return ``\n}\n\n/**\n * return node html\n */\nconst rtTasksTpl = ({ id, name, x, y, targetarr, isAttachment, taskType,runFlag }) => {\n let tpl = ``\n tpl += `
`\n tpl += `
`\n tpl += `
`\n tpl += `
`\n tpl += `${name}`\n tpl += `
`\n tpl += `
`\n tpl += `
`\n if (runFlag === 'FORBIDDEN') {\n tpl += rtBantpl()\n }\n tpl += `
`\n tpl += `
`\n\n return tpl\n}\n\n/**\n * Get all tasks nodes\n */\nconst tasksAll = () => {\n let a = []\n $('#canvas .w').each(function (idx, elem) {\n let e = $(elem)\n a.push({\n id: e.attr('id'),\n name: e.find('.name-p').text(),\n targetarr: e.attr('data-targetarr') || '',\n x: parseInt(e.css('left'), 10),\n y: parseInt(e.css('top'), 10)\n })\n })\n return a\n}\n\n/**\n * Determine if name is in the current dag map\n * rely dom / backfill\n */\nconst isNameExDag = (name, rely) => {\n if (rely === 'dom') {\n return _.findIndex(tasksAll(), v => v.name === name) !== -1\n } else {\n return _.findIndex(store.state.dag.tasks, v => v.name === name) !== -1\n }\n}\n\n/**\n * Change svg line color\n */\nconst setSvgColor = (e, color) => {\n // Traverse clear all colors\n $('.jtk-connector').each((i, o) => {\n _.map($(o)[0].childNodes, v => {\n $(v).attr('fill', '#555').attr('stroke', '#555').attr('stroke-width', 2)\n })\n })\n\n // Add color to the selection\n _.map($(e.canvas)[0].childNodes, (v, i) => {\n $(v).attr('fill', color).attr('stroke', color)\n if ($(v).attr('class')) {\n $(v).attr('stroke-width', 2)\n }\n })\n}\n\n/**\n * Get all node ids\n */\nconst allNodesId = () => {\n let idArr = []\n $('.w').each((i, o) => {\n let $obj = $(o)\n let $span = $obj.find('.name-p').text()\n if ($span) {\n idArr.push({\n id: $obj.attr('id'),\n name: $span\n })\n }\n })\n return idArr\n}\n\nexport {\n rtTargetarrArr,\n saveTargetarr,\n rtTasksTpl,\n tasksAll,\n isNameExDag,\n setSvgColor,\n allNodesId,\n rtBantpl\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/plugIn/util.js","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-5b25ea8f\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./resources.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./resources.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./resources.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-5b25ea8f\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./resources.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/dag/_source/formModel/tasks/_source/resources.vue\n// module id = 699\n// module chunks = 3 4 5","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-6a4fc01c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./priority.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./priority.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./priority.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-6a4fc01c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./priority.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/priority/priority.vue\n// module id = 700\n// module chunks = 0 3 4 5 6","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport i18n from '@/module/i18n'\n/**\n * download file\n */\nlet downloadFile = ($url, $obj) => {\n let param = {\n url: $url,\n obj: $obj\n }\n\n if (!param.url) {\n this.$message.warning(`${i18n.$t('无下载url无法下载')}`)\n return\n }\n\n let generatorInput = function (obj) {\n let result = ''\n let keyArr = Object.keys(obj)\n keyArr.forEach(function (key) {\n result += \"\"\n })\n return result\n }\n $(`
${generatorInput(param.obj)}
`).appendTo('body').submit().remove()\n}\n\nexport { downloadFile }\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/module/download/index.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue","/**\n * jsBezier\n *\n * Copyright (c) 2010 - 2017 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * licensed under the MIT license.\n *\n * a set of Bezier curve functions that deal with Beziers, used by jsPlumb, and perhaps useful for other people. These functions work with Bezier\n * curves of arbitrary degree.\n *\n * - functions are all in the 'jsBezier' namespace.\n *\n * - all input points should be in the format {x:.., y:..}. all output points are in this format too.\n *\n * - all input curves should be in the format [ {x:.., y:..}, {x:.., y:..}, {x:.., y:..}, {x:.., y:..} ]\n *\n * - 'location' as used as an input here refers to a decimal in the range 0-1 inclusive, which indicates a point some proportion along the length\n * of the curve. location as output has the same format and meaning.\n *\n *\n * Function List:\n * --------------\n *\n * distanceFromCurve(point, curve)\n *\n * \tCalculates the distance that the given point lies from the given Bezier. Note that it is computed relative to the center of the Bezier,\n * so if you have stroked the curve with a wide pen you may wish to take that into account! The distance returned is relative to the values\n * of the curve and the point - it will most likely be pixels.\n *\n * gradientAtPoint(curve, location)\n *\n * \tCalculates the gradient to the curve at the given location, as a decimal between 0 and 1 inclusive.\n *\n * gradientAtPointAlongCurveFrom (curve, location)\n *\n *\tCalculates the gradient at the point on the given curve that is 'distance' units from location.\n *\n * nearestPointOnCurve(point, curve)\n *\n *\tCalculates the nearest point to the given point on the given curve. The return value of this is a JS object literal, containing both the\n *point's coordinates and also the 'location' of the point (see above), for example: { point:{x:551,y:150}, location:0.263365 }.\n *\n * pointOnCurve(curve, location)\n *\n * \tCalculates the coordinates of the point on the given Bezier curve at the given location.\n *\n * pointAlongCurveFrom(curve, location, distance)\n *\n * \tCalculates the coordinates of the point on the given curve that is 'distance' units from location. 'distance' should be in the same coordinate\n * space as that used to construct the Bezier curve. For an HTML Canvas usage, for example, distance would be a measure of pixels.\n *\n * locationAlongCurveFrom(curve, location, distance)\n *\n * \tCalculates the location on the given curve that is 'distance' units from location. 'distance' should be in the same coordinate\n * space as that used to construct the Bezier curve. For an HTML Canvas usage, for example, distance would be a measure of pixels.\n *\n * perpendicularToCurveAt(curve, location, length, distance)\n *\n * \tCalculates the perpendicular to the given curve at the given location. length is the length of the line you wish for (it will be centered\n * on the point at 'location'). distance is optional, and allows you to specify a point along the path from the given location as the center of\n * the perpendicular returned. The return value of this is an array of two points: [ {x:...,y:...}, {x:...,y:...} ].\n *\n *\n */\n\n(function() {\n\n var root = this;\n\n if(typeof Math.sgn == \"undefined\") {\n Math.sgn = function(x) { return x == 0 ? 0 : x > 0 ? 1 :-1; };\n }\n\n var Vectors = {\n subtract \t: \tfunction(v1, v2) { return {x:v1.x - v2.x, y:v1.y - v2.y }; },\n dotProduct\t: \tfunction(v1, v2) { return (v1.x * v2.x) + (v1.y * v2.y); },\n square\t\t:\tfunction(v) { return Math.sqrt((v.x * v.x) + (v.y * v.y)); },\n scale\t\t:\tfunction(v, s) { return {x:v.x * s, y:v.y * s }; }\n },\n\n maxRecursion = 64,\n flatnessTolerance = Math.pow(2.0,-maxRecursion-1);\n\n /**\n * Calculates the distance that the point lies from the curve.\n *\n * @param point a point in the form {x:567, y:3342}\n * @param curve a Bezier curve in the form [{x:..., y:...}, {x:..., y:...}, {x:..., y:...}, {x:..., y:...}]. note that this is currently\n * hardcoded to assume cubiz beziers, but would be better off supporting any degree.\n * @return a JS object literal containing location and distance, for example: {location:0.35, distance:10}. Location is analogous to the location\n * argument you pass to the pointOnPath function: it is a ratio of distance travelled along the curve. Distance is the distance in pixels from\n * the point to the curve.\n */\n var _distanceFromCurve = function(point, curve) {\n var candidates = [],\n w = _convertToBezier(point, curve),\n degree = curve.length - 1, higherDegree = (2 * degree) - 1,\n numSolutions = _findRoots(w, higherDegree, candidates, 0),\n v = Vectors.subtract(point, curve[0]), dist = Vectors.square(v), t = 0.0;\n\n for (var i = 0; i < numSolutions; i++) {\n v = Vectors.subtract(point, _bezier(curve, degree, candidates[i], null, null));\n var newDist = Vectors.square(v);\n if (newDist < dist) {\n dist = newDist;\n t = candidates[i];\n }\n }\n v = Vectors.subtract(point, curve[degree]);\n newDist = Vectors.square(v);\n if (newDist < dist) {\n dist = newDist;\n t = 1.0;\n }\n return {location:t, distance:dist};\n };\n /**\n * finds the nearest point on the curve to the given point.\n */\n var _nearestPointOnCurve = function(point, curve) {\n var td = _distanceFromCurve(point, curve);\n return {point:_bezier(curve, curve.length - 1, td.location, null, null), location:td.location};\n };\n var _convertToBezier = function(point, curve) {\n var degree = curve.length - 1, higherDegree = (2 * degree) - 1,\n c = [], d = [], cdTable = [], w = [],\n z = [ [1.0, 0.6, 0.3, 0.1], [0.4, 0.6, 0.6, 0.4], [0.1, 0.3, 0.6, 1.0] ];\n\n for (var i = 0; i <= degree; i++) c[i] = Vectors.subtract(curve[i], point);\n for (var i = 0; i <= degree - 1; i++) {\n d[i] = Vectors.subtract(curve[i+1], curve[i]);\n d[i] = Vectors.scale(d[i], 3.0);\n }\n for (var row = 0; row <= degree - 1; row++) {\n for (var column = 0; column <= degree; column++) {\n if (!cdTable[row]) cdTable[row] = [];\n cdTable[row][column] = Vectors.dotProduct(d[row], c[column]);\n }\n }\n for (i = 0; i <= higherDegree; i++) {\n if (!w[i]) w[i] = [];\n w[i].y = 0.0;\n w[i].x = parseFloat(i) / higherDegree;\n }\n var n = degree, m = degree-1;\n for (var k = 0; k <= n + m; k++) {\n var lb = Math.max(0, k - m),\n ub = Math.min(k, n);\n for (i = lb; i <= ub; i++) {\n var j = k - i;\n w[i+j].y += cdTable[j][i] * z[j][i];\n }\n }\n return w;\n };\n /**\n * counts how many roots there are.\n */\n var _findRoots = function(w, degree, t, depth) {\n var left = [], right = [],\n left_count, right_count,\n left_t = [], right_t = [];\n\n switch (_getCrossingCount(w, degree)) {\n case 0 : {\n return 0;\n }\n case 1 : {\n if (depth >= maxRecursion) {\n t[0] = (w[0].x + w[degree].x) / 2.0;\n return 1;\n }\n if (_isFlatEnough(w, degree)) {\n t[0] = _computeXIntercept(w, degree);\n return 1;\n }\n break;\n }\n }\n _bezier(w, degree, 0.5, left, right);\n left_count = _findRoots(left, degree, left_t, depth+1);\n right_count = _findRoots(right, degree, right_t, depth+1);\n for (var i = 0; i < left_count; i++) t[i] = left_t[i];\n for (var i = 0; i < right_count; i++) t[i+left_count] = right_t[i];\n return (left_count+right_count);\n };\n var _getCrossingCount = function(curve, degree) {\n var n_crossings = 0, sign, old_sign;\n sign = old_sign = Math.sgn(curve[0].y);\n for (var i = 1; i <= degree; i++) {\n sign = Math.sgn(curve[i].y);\n if (sign != old_sign) n_crossings++;\n old_sign = sign;\n }\n return n_crossings;\n };\n var _isFlatEnough = function(curve, degree) {\n var error,\n intercept_1, intercept_2, left_intercept, right_intercept,\n a, b, c, det, dInv, a1, b1, c1, a2, b2, c2;\n a = curve[0].y - curve[degree].y;\n b = curve[degree].x - curve[0].x;\n c = curve[0].x * curve[degree].y - curve[degree].x * curve[0].y;\n\n var max_distance_above, max_distance_below;\n max_distance_above = max_distance_below = 0.0;\n\n for (var i = 1; i < degree; i++) {\n var value = a * curve[i].x + b * curve[i].y + c;\n if (value > max_distance_above)\n max_distance_above = value;\n else if (value < max_distance_below)\n max_distance_below = value;\n }\n\n a1 = 0.0; b1 = 1.0; c1 = 0.0; a2 = a; b2 = b;\n c2 = c - max_distance_above;\n det = a1 * b2 - a2 * b1;\n dInv = 1.0/det;\n intercept_1 = (b1 * c2 - b2 * c1) * dInv;\n a2 = a; b2 = b; c2 = c - max_distance_below;\n det = a1 * b2 - a2 * b1;\n dInv = 1.0/det;\n intercept_2 = (b1 * c2 - b2 * c1) * dInv;\n left_intercept = Math.min(intercept_1, intercept_2);\n right_intercept = Math.max(intercept_1, intercept_2);\n error = right_intercept - left_intercept;\n return (error < flatnessTolerance)? 1 : 0;\n };\n var _computeXIntercept = function(curve, degree) {\n var XLK = 1.0, YLK = 0.0,\n XNM = curve[degree].x - curve[0].x, YNM = curve[degree].y - curve[0].y,\n XMK = curve[0].x - 0.0, YMK = curve[0].y - 0.0,\n det = XNM*YLK - YNM*XLK, detInv = 1.0/det,\n S = (XNM*YMK - YNM*XMK) * detInv;\n return 0.0 + XLK * S;\n };\n var _bezier = function(curve, degree, t, left, right) {\n var temp = [[]];\n for (var j =0; j <= degree; j++) temp[0][j] = curve[j];\n for (var i = 1; i <= degree; i++) {\n for (var j =0 ; j <= degree - i; j++) {\n if (!temp[i]) temp[i] = [];\n if (!temp[i][j]) temp[i][j] = {};\n temp[i][j].x = (1.0 - t) * temp[i-1][j].x + t * temp[i-1][j+1].x;\n temp[i][j].y = (1.0 - t) * temp[i-1][j].y + t * temp[i-1][j+1].y;\n }\n }\n if (left != null)\n for (j = 0; j <= degree; j++) left[j] = temp[j][0];\n if (right != null)\n for (j = 0; j <= degree; j++) right[j] = temp[degree-j][j];\n\n return (temp[degree][0]);\n };\n\n var _curveFunctionCache = {};\n var _getCurveFunctions = function(order) {\n var fns = _curveFunctionCache[order];\n if (!fns) {\n fns = [];\n var f_term = function() { return function(t) { return Math.pow(t, order); }; },\n l_term = function() { return function(t) { return Math.pow((1-t), order); }; },\n c_term = function(c) { return function(t) { return c; }; },\n t_term = function() { return function(t) { return t; }; },\n one_minus_t_term = function() { return function(t) { return 1-t; }; },\n _termFunc = function(terms) {\n return function(t) {\n var p = 1;\n for (var i = 0; i < terms.length; i++) p = p * terms[i](t);\n return p;\n };\n };\n\n fns.push(new f_term()); // first is t to the power of the curve order\n for (var i = 1; i < order; i++) {\n var terms = [new c_term(order)];\n for (var j = 0 ; j < (order - i); j++) terms.push(new t_term());\n for (var j = 0 ; j < i; j++) terms.push(new one_minus_t_term());\n fns.push(new _termFunc(terms));\n }\n fns.push(new l_term()); // last is (1-t) to the power of the curve order\n\n _curveFunctionCache[order] = fns;\n }\n\n return fns;\n };\n\n\n /**\n * calculates a point on the curve, for a Bezier of arbitrary order.\n * @param curve an array of control points, eg [{x:10,y:20}, {x:50,y:50}, {x:100,y:100}, {x:120,y:100}]. For a cubic bezier this should have four points.\n * @param location a decimal indicating the distance along the curve the point should be located at. this is the distance along the curve as it travels, taking the way it bends into account. should be a number from 0 to 1, inclusive.\n */\n var _pointOnPath = function(curve, location) {\n var cc = _getCurveFunctions(curve.length - 1),\n _x = 0, _y = 0;\n for (var i = 0; i < curve.length ; i++) {\n _x = _x + (curve[i].x * cc[i](location));\n _y = _y + (curve[i].y * cc[i](location));\n }\n\n return {x:_x, y:_y};\n };\n\n var _dist = function(p1,p2) {\n return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));\n };\n\n var _isPoint = function(curve) {\n return curve[0].x === curve[1].x && curve[0].y === curve[1].y;\n };\n\n /**\n * finds the point that is 'distance' along the path from 'location'. this method returns both the x,y location of the point and also\n * its 'location' (proportion of travel along the path); the method below - _pointAlongPathFrom - calls this method and just returns the\n * point.\n */\n var _pointAlongPath = function(curve, location, distance) {\n\n if (_isPoint(curve)) {\n return {\n point:curve[0],\n location:location\n };\n }\n\n var prev = _pointOnPath(curve, location),\n tally = 0,\n curLoc = location,\n direction = distance > 0 ? 1 : -1,\n cur = null;\n\n while (tally < Math.abs(distance)) {\n curLoc += (0.005 * direction);\n cur = _pointOnPath(curve, curLoc);\n tally += _dist(cur, prev);\n prev = cur;\n }\n return {point:cur, location:curLoc};\n };\n\n var _length = function(curve) {\n if (_isPoint(curve)) return 0;\n\n var prev = _pointOnPath(curve, 0),\n tally = 0,\n curLoc = 0,\n direction = 1,\n cur = null;\n\n while (curLoc < 1) {\n curLoc += (0.005 * direction);\n cur = _pointOnPath(curve, curLoc);\n tally += _dist(cur, prev);\n prev = cur;\n }\n return tally;\n };\n\n /**\n * finds the point that is 'distance' along the path from 'location'.\n */\n var _pointAlongPathFrom = function(curve, location, distance) {\n return _pointAlongPath(curve, location, distance).point;\n };\n\n /**\n * finds the location that is 'distance' along the path from 'location'.\n */\n var _locationAlongPathFrom = function(curve, location, distance) {\n return _pointAlongPath(curve, location, distance).location;\n };\n\n /**\n * returns the gradient of the curve at the given location, which is a decimal between 0 and 1 inclusive.\n *\n * thanks // http://bimixual.org/AnimationLibrary/beziertangents.html\n */\n var _gradientAtPoint = function(curve, location) {\n var p1 = _pointOnPath(curve, location),\n p2 = _pointOnPath(curve.slice(0, curve.length - 1), location),\n dy = p2.y - p1.y, dx = p2.x - p1.x;\n return dy === 0 ? Infinity : Math.atan(dy / dx);\n };\n\n /**\n returns the gradient of the curve at the point which is 'distance' from the given location.\n if this point is greater than location 1, the gradient at location 1 is returned.\n if this point is less than location 0, the gradient at location 0 is returned.\n */\n var _gradientAtPointAlongPathFrom = function(curve, location, distance) {\n var p = _pointAlongPath(curve, location, distance);\n if (p.location > 1) p.location = 1;\n if (p.location < 0) p.location = 0;\n return _gradientAtPoint(curve, p.location);\n };\n\n /**\n * calculates a line that is 'length' pixels long, perpendicular to, and centered on, the path at 'distance' pixels from the given location.\n * if distance is not supplied, the perpendicular for the given location is computed (ie. we set distance to zero).\n */\n var _perpendicularToPathAt = function(curve, location, length, distance) {\n distance = distance == null ? 0 : distance;\n var p = _pointAlongPath(curve, location, distance),\n m = _gradientAtPoint(curve, p.location),\n _theta2 = Math.atan(-1 / m),\n y = length / 2 * Math.sin(_theta2),\n x = length / 2 * Math.cos(_theta2);\n return [{x:p.point.x + x, y:p.point.y + y}, {x:p.point.x - x, y:p.point.y - y}];\n };\n\n /**\n * Calculates all intersections of the given line with the given curve.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param curve\n * @returns {Array}\n */\n var _lineIntersection = function(x1, y1, x2, y2, curve) {\n var a = y2 - y1,\n b = x1 - x2,\n c = (x1 * (y1 - y2)) + (y1 * (x2-x1)),\n coeffs = _computeCoefficients(curve),\n p = [\n (a*coeffs[0][0]) + (b * coeffs[1][0]),\n (a*coeffs[0][1])+(b*coeffs[1][1]),\n (a*coeffs[0][2])+(b*coeffs[1][2]),\n (a*coeffs[0][3])+(b*coeffs[1][3]) + c\n ],\n r = _cubicRoots.apply(null, p),\n intersections = [];\n\n if (r != null) {\n\n for (var i = 0; i < 3; i++) {\n var t = r[i],\n t2 = Math.pow(t, 2),\n t3 = Math.pow(t, 3),\n x = [\n (coeffs[0][0] * t3) + (coeffs[0][1] * t2) + (coeffs[0][2] * t) + coeffs[0][3],\n (coeffs[1][0] * t3) + (coeffs[1][1] * t2) + (coeffs[1][2] * t) + coeffs[1][3]\n ];\n\n // check bounds of the line\n var s;\n if ((x2 - x1) !== 0) {\n s = (x[0] - x1) / (x2 - x1);\n }\n else {\n s = (x[1] - y1) / (y2 - y1);\n }\n\n if (t >= 0 && t <= 1.0 && s >= 0 && s <= 1.0) {\n intersections.push(x);\n }\n }\n }\n\n return intersections;\n };\n\n /**\n * Calculates all intersections of the given box with the given curve.\n * @param x X position of top left corner of box\n * @param y Y position of top left corner of box\n * @param w width of box\n * @param h height of box\n * @param curve\n * @returns {Array}\n */\n var _boxIntersection = function(x, y, w, h, curve) {\n var i = [];\n i.push.apply(i, _lineIntersection(x, y, x + w, y, curve));\n i.push.apply(i, _lineIntersection(x + w, y, x + w, y + h, curve));\n i.push.apply(i, _lineIntersection(x + w, y + h, x, y + h, curve));\n i.push.apply(i, _lineIntersection(x, y + h, x, y, curve));\n return i;\n };\n\n /**\n * Calculates all intersections of the given bounding box with the given curve.\n * @param boundingBox Bounding box, in { x:.., y:..., w:..., h:... } format.\n * @param curve\n * @returns {Array}\n */\n var _boundingBoxIntersection = function(boundingBox, curve) {\n var i = [];\n i.push.apply(i, _lineIntersection(boundingBox.x, boundingBox.y, boundingBox.x + boundingBox.w, boundingBox.y, curve));\n i.push.apply(i, _lineIntersection(boundingBox.x + boundingBox.w, boundingBox.y, boundingBox.x + boundingBox.w, boundingBox.y + boundingBox.h, curve));\n i.push.apply(i, _lineIntersection(boundingBox.x + boundingBox.w, boundingBox.y + boundingBox.h, boundingBox.x, boundingBox.y + boundingBox.h, curve));\n i.push.apply(i, _lineIntersection(boundingBox.x, boundingBox.y + boundingBox.h, boundingBox.x, boundingBox.y, curve));\n return i;\n };\n\n\n function _computeCoefficientsForAxis(curve, axis) {\n return [\n -(curve[0][axis]) + (3*curve[1][axis]) + (-3 * curve[2][axis]) + curve[3][axis],\n (3*(curve[0][axis])) - (6*(curve[1][axis])) + (3*(curve[2][axis])),\n -3*curve[0][axis] + 3*curve[1][axis],\n curve[0][axis]\n ];\n }\n\n function _computeCoefficients(curve)\n {\n return [\n _computeCoefficientsForAxis(curve, \"x\"),\n _computeCoefficientsForAxis(curve, \"y\")\n ];\n }\n\n function sgn(x) {\n return x < 0 ? -1 : x > 0 ? 1 : 0;\n }\n\n function _cubicRoots(a, b, c, d) {\n var A = b / a,\n B = c / a,\n C = d / a,\n Q = (3*B - Math.pow(A, 2))/9,\n R = (9*A*B - 27*C - 2*Math.pow(A, 3))/54,\n D = Math.pow(Q, 3) + Math.pow(R, 2),\n S,\n T,\n t = [];\n\n if (D >= 0) // complex or duplicate roots\n {\n S = sgn(R + Math.sqrt(D))*Math.pow(Math.abs(R + Math.sqrt(D)),(1/3));\n T = sgn(R - Math.sqrt(D))*Math.pow(Math.abs(R - Math.sqrt(D)),(1/3));\n\n t[0] = -A/3 + (S + T);\n t[1] = -A/3 - (S + T)/2;\n t[2] = -A/3 - (S + T)/2;\n\n /*discard complex roots*/\n if (Math.abs(Math.sqrt(3)*(S - T)/2) !== 0) {\n t[1] = -1;\n t[2] = -1;\n }\n }\n else // distinct real roots\n {\n var th = Math.acos(R/Math.sqrt(-Math.pow(Q, 3)));\n t[0] = 2*Math.sqrt(-Q)*Math.cos(th/3) - A/3;\n t[1] = 2*Math.sqrt(-Q)*Math.cos((th + 2*Math.PI)/3) - A/3;\n t[2] = 2*Math.sqrt(-Q)*Math.cos((th + 4*Math.PI)/3) - A/3;\n }\n\n // discard out of spec roots\n for (var i = 0; i < 3; i++) {\n if (t[i] < 0 || t[i] > 1.0) {\n t[i] = -1;\n }\n }\n\n return t;\n }\n\n var jsBezier = this.jsBezier = {\n distanceFromCurve : _distanceFromCurve,\n gradientAtPoint : _gradientAtPoint,\n gradientAtPointAlongCurveFrom : _gradientAtPointAlongPathFrom,\n nearestPointOnCurve : _nearestPointOnCurve,\n pointOnCurve : _pointOnPath,\n pointAlongCurveFrom : _pointAlongPathFrom,\n perpendicularToCurveAt : _perpendicularToPathAt,\n locationAlongCurveFrom:_locationAlongPathFrom,\n getLength:_length,\n lineIntersection:_lineIntersection,\n boxIntersection:_boxIntersection,\n boundingBoxIntersection:_boundingBoxIntersection,\n version:\"0.9.0\"\n };\n\n if (typeof exports !== \"undefined\") {\n exports.jsBezier = jsBezier;\n }\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/**\n * Biltong v0.4.0\n *\n * Various geometry functions written as part of jsPlumb and perhaps useful for others.\n *\n * Copyright (c) 2017 jsPlumb\n * https://jsplumbtoolkit.com\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n;(function() {\n\n \"use strict\";\n var root = this;\n\n var Biltong = root.Biltong = {\n version:\"0.4.0\"\n };\n\n if (typeof exports !== \"undefined\") {\n exports.Biltong = Biltong;\n }\n\n var _isa = function(a) { return Object.prototype.toString.call(a) === \"[object Array]\"; },\n _pointHelper = function(p1, p2, fn) {\n p1 = _isa(p1) ? p1 : [p1.x, p1.y];\n p2 = _isa(p2) ? p2 : [p2.x, p2.y];\n return fn(p1, p2);\n },\n /**\n * @name Biltong.gradient\n * @function\n * @desc Calculates the gradient of a line between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The gradient of a line between the two points.\n */\n _gradient = Biltong.gradient = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n if (_p2[0] == _p1[0])\n return _p2[1] > _p1[1] ? Infinity : -Infinity;\n else if (_p2[1] == _p1[1])\n return _p2[0] > _p1[0] ? 0 : -0;\n else\n return (_p2[1] - _p1[1]) / (_p2[0] - _p1[0]);\n });\n },\n /**\n * @name Biltong.normal\n * @function\n * @desc Calculates the gradient of a normal to a line between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The gradient of a normal to a line between the two points.\n */\n _normal = Biltong.normal = function(p1, p2) {\n return -1 / _gradient(p1, p2);\n },\n /**\n * @name Biltong.lineLength\n * @function\n * @desc Calculates the length of a line between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The length of a line between the two points.\n */\n _lineLength = Biltong.lineLength = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n return Math.sqrt(Math.pow(_p2[1] - _p1[1], 2) + Math.pow(_p2[0] - _p1[0], 2));\n });\n },\n /**\n * @name Biltong.quadrant\n * @function\n * @desc Calculates the quadrant in which the angle between the two points lies.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Integer} The quadrant - 1 for upper right, 2 for lower right, 3 for lower left, 4 for upper left.\n */\n _quadrant = Biltong.quadrant = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n if (_p2[0] > _p1[0]) {\n return (_p2[1] > _p1[1]) ? 2 : 1;\n }\n else if (_p2[0] == _p1[0]) {\n return _p2[1] > _p1[1] ? 2 : 1;\n }\n else {\n return (_p2[1] > _p1[1]) ? 3 : 4;\n }\n });\n },\n /**\n * @name Biltong.theta\n * @function\n * @desc Calculates the angle between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The angle between the two points.\n */\n _theta = Biltong.theta = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n var m = _gradient(_p1, _p2),\n t = Math.atan(m),\n s = _quadrant(_p1, _p2);\n if ((s == 4 || s== 3)) t += Math.PI;\n if (t < 0) t += (2 * Math.PI);\n\n return t;\n });\n },\n /**\n * @name Biltong.intersects\n * @function\n * @desc Calculates whether or not the two rectangles intersect.\n * @param {Rectangle} r1 First rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @param {Rectangle} r2 Second rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @return {Boolean} True if the rectangles intersect, false otherwise.\n */\n _intersects = Biltong.intersects = function(r1, r2) {\n var x1 = r1.x, x2 = r1.x + r1.w, y1 = r1.y, y2 = r1.y + r1.h,\n a1 = r2.x, a2 = r2.x + r2.w, b1 = r2.y, b2 = r2.y + r2.h;\n\n return ( (x1 <= a1 && a1 <= x2) && (y1 <= b1 && b1 <= y2) ) ||\n ( (x1 <= a2 && a2 <= x2) && (y1 <= b1 && b1 <= y2) ) ||\n ( (x1 <= a1 && a1 <= x2) && (y1 <= b2 && b2 <= y2) ) ||\n ( (x1 <= a2 && a1 <= x2) && (y1 <= b2 && b2 <= y2) ) ||\n ( (a1 <= x1 && x1 <= a2) && (b1 <= y1 && y1 <= b2) ) ||\n ( (a1 <= x2 && x2 <= a2) && (b1 <= y1 && y1 <= b2) ) ||\n ( (a1 <= x1 && x1 <= a2) && (b1 <= y2 && y2 <= b2) ) ||\n ( (a1 <= x2 && x1 <= a2) && (b1 <= y2 && y2 <= b2) );\n },\n /**\n * @name Biltong.encloses\n * @function\n * @desc Calculates whether or not r2 is completely enclosed by r1.\n * @param {Rectangle} r1 First rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @param {Rectangle} r2 Second rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @param {Boolean} [allowSharedEdges=false] If true, the concept of enclosure allows for one or more edges to be shared by the two rectangles.\n * @return {Boolean} True if r1 encloses r2, false otherwise.\n */\n _encloses = Biltong.encloses = function(r1, r2, allowSharedEdges) {\n var x1 = r1.x, x2 = r1.x + r1.w, y1 = r1.y, y2 = r1.y + r1.h,\n a1 = r2.x, a2 = r2.x + r2.w, b1 = r2.y, b2 = r2.y + r2.h,\n c = function(v1, v2, v3, v4) { return allowSharedEdges ? v1 <= v2 && v3>= v4 : v1 < v2 && v3 > v4; };\n\n return c(x1,a1,x2,a2) && c(y1,b1,y2,b2);\n },\n _segmentMultipliers = [null, [1, -1], [1, 1], [-1, 1], [-1, -1] ],\n _inverseSegmentMultipliers = [null, [-1, -1], [-1, 1], [1, 1], [1, -1] ],\n /**\n * @name Biltong.pointOnLine\n * @function\n * @desc Calculates a point on the line from `fromPoint` to `toPoint` that is `distance` units along the length of the line.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Point} Point on the line, in the form `{ x:..., y:... }`.\n */\n _pointOnLine = Biltong.pointOnLine = function(fromPoint, toPoint, distance) {\n var m = _gradient(fromPoint, toPoint),\n s = _quadrant(fromPoint, toPoint),\n segmentMultiplier = distance > 0 ? _segmentMultipliers[s] : _inverseSegmentMultipliers[s],\n theta = Math.atan(m),\n y = Math.abs(distance * Math.sin(theta)) * segmentMultiplier[1],\n x = Math.abs(distance * Math.cos(theta)) * segmentMultiplier[0];\n return { x:fromPoint.x + x, y:fromPoint.y + y };\n },\n /**\n * @name Biltong.perpendicularLineTo\n * @function\n * @desc Calculates a line of length `length` that is perpendicular to the line from `fromPoint` to `toPoint` and passes through `toPoint`.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Line} Perpendicular line, in the form `[ { x:..., y:... }, { x:..., y:... } ]`.\n */\n _perpendicularLineTo = Biltong.perpendicularLineTo = function(fromPoint, toPoint, length) {\n var m = _gradient(fromPoint, toPoint),\n theta2 = Math.atan(-1 / m),\n y = length / 2 * Math.sin(theta2),\n x = length / 2 * Math.cos(theta2);\n return [{x:toPoint.x + x, y:toPoint.y + y}, {x:toPoint.x - x, y:toPoint.y - y}];\n };\n}).call(typeof window !== 'undefined' ? window : this);\n;\n(function () {\n\n \"use strict\";\n\n /**\n * Creates a Touch object.\n * @param view\n * @param target\n * @param pageX\n * @param pageY\n * @param screenX\n * @param screenY\n * @param clientX\n * @param clientY\n * @returns {Touch}\n * @private\n */\n function _touch(view, target, pageX, pageY, screenX, screenY, clientX, clientY) {\n\n return new Touch({\n target:target,\n identifier:_uuid(),\n pageX: pageX,\n pageY: pageY,\n screenX: screenX,\n screenY: screenY,\n clientX: clientX || screenX,\n clientY: clientY || screenY\n });\n }\n\n /**\n * Create a synthetic touch list from the given list of Touch objects.\n * @returns {Array}\n * @private\n */\n function _touchList() {\n var list = [];\n Array.prototype.push.apply(list, arguments);\n list.item = function(index) { return this[index]; };\n return list;\n }\n\n /**\n * Create a Touch object and then insert it into a synthetic touch list, returning the list.s\n * @param view\n * @param target\n * @param pageX\n * @param pageY\n * @param screenX\n * @param screenY\n * @param clientX\n * @param clientY\n * @returns {Array}\n * @private\n */\n function _touchAndList(view, target, pageX, pageY, screenX, screenY, clientX, clientY) {\n return _touchList(_touch.apply(null, arguments));\n }\n\n var root = this,\n matchesSelector = function (el, selector, ctx) {\n ctx = ctx || el.parentNode;\n var possibles = ctx.querySelectorAll(selector);\n for (var i = 0; i < possibles.length; i++) {\n if (possibles[i] === el) {\n return true;\n }\n }\n return false;\n },\n _gel = function (el) {\n return (typeof el == \"string\" || el.constructor === String) ? document.getElementById(el) : el;\n },\n _t = function (e) {\n return e.srcElement || e.target;\n },\n //\n // gets path info for the given event - the path from target to obj, in the event's bubble chain. if doCompute\n // is false we just return target for the path.\n //\n _pi = function(e, target, obj, doCompute) {\n if (!doCompute) return { path:[target], end:1 };\n else if (typeof e.path !== \"undefined\" && e.path.indexOf) {\n return { path: e.path, end: e.path.indexOf(obj) };\n } else {\n var out = { path:[], end:-1 }, _one = function(el) {\n out.path.push(el);\n if (el === obj) {\n out.end = out.path.length - 1;\n }\n else if (el.parentNode != null) {\n _one(el.parentNode)\n }\n };\n _one(target);\n return out;\n }\n },\n _d = function (l, fn) {\n for (var i = 0, j = l.length; i < j; i++) {\n if (l[i] == fn) break;\n }\n if (i < l.length) l.splice(i, 1);\n },\n guid = 1,\n //\n // this function generates a guid for every handler, sets it on the handler, then adds\n // it to the associated object's map of handlers for the given event. this is what enables us\n // to unbind all events of some type, or all events (the second of which can be requested by the user,\n // but it also used by Mottle when an element is removed.)\n _store = function (obj, event, fn) {\n var g = guid++;\n obj.__ta = obj.__ta || {};\n obj.__ta[event] = obj.__ta[event] || {};\n // store each handler with a unique guid.\n obj.__ta[event][g] = fn;\n // set the guid on the handler.\n fn.__tauid = g;\n return g;\n },\n _unstore = function (obj, event, fn) {\n obj.__ta && obj.__ta[event] && delete obj.__ta[event][fn.__tauid];\n // a handler might have attached extra functions, so we unbind those too.\n if (fn.__taExtra) {\n for (var i = 0; i < fn.__taExtra.length; i++) {\n _unbind(obj, fn.__taExtra[i][0], fn.__taExtra[i][1]);\n }\n fn.__taExtra.length = 0;\n }\n // a handler might have attached an unstore callback\n fn.__taUnstore && fn.__taUnstore();\n },\n _curryChildFilter = function (children, obj, fn, evt) {\n if (children == null) return fn;\n else {\n var c = children.split(\",\"),\n _fn = function (e) {\n _fn.__tauid = fn.__tauid;\n var t = _t(e), target = t; // t is the target element on which the event occurred. it is the\n // element we will wish to pass to any callbacks.\n var pathInfo = _pi(e, t, obj, children != null)\n if (pathInfo.end != -1) {\n for (var p = 0; p < pathInfo.end; p++) {\n target = pathInfo.path[p];\n for (var i = 0; i < c.length; i++) {\n if (matchesSelector(target, c[i], obj)) {\n fn.apply(target, arguments);\n }\n }\n }\n }\n };\n registerExtraFunction(fn, evt, _fn);\n return _fn;\n }\n },\n //\n // registers an 'extra' function on some event listener function we were given - a function that we\n // created and bound to the element as part of our housekeeping, and which we want to unbind and remove\n // whenever the given function is unbound.\n registerExtraFunction = function (fn, evt, newFn) {\n fn.__taExtra = fn.__taExtra || [];\n fn.__taExtra.push([evt, newFn]);\n },\n DefaultHandler = function (obj, evt, fn, children) {\n if (isTouchDevice && touchMap[evt]) {\n var tfn = _curryChildFilter(children, obj, fn, touchMap[evt]);\n _bind(obj, touchMap[evt], tfn , fn);\n }\n if (evt === \"focus\" && obj.getAttribute(\"tabindex\") == null) {\n obj.setAttribute(\"tabindex\", \"1\");\n }\n _bind(obj, evt, _curryChildFilter(children, obj, fn, evt), fn);\n },\n SmartClickHandler = function (obj, evt, fn, children) {\n if (obj.__taSmartClicks == null) {\n var down = function (e) {\n obj.__tad = _pageLocation(e);\n },\n up = function (e) {\n obj.__tau = _pageLocation(e);\n },\n click = function (e) {\n if (obj.__tad && obj.__tau && obj.__tad[0] === obj.__tau[0] && obj.__tad[1] === obj.__tau[1]) {\n for (var i = 0; i < obj.__taSmartClicks.length; i++)\n obj.__taSmartClicks[i].apply(_t(e), [ e ]);\n }\n };\n DefaultHandler(obj, \"mousedown\", down, children);\n DefaultHandler(obj, \"mouseup\", up, children);\n DefaultHandler(obj, \"click\", click, children);\n obj.__taSmartClicks = [];\n }\n\n // store in the list of callbacks\n obj.__taSmartClicks.push(fn);\n // the unstore function removes this function from the object's listener list for this type.\n fn.__taUnstore = function () {\n _d(obj.__taSmartClicks, fn);\n };\n },\n _tapProfiles = {\n \"tap\": {touches: 1, taps: 1},\n \"dbltap\": {touches: 1, taps: 2},\n \"contextmenu\": {touches: 2, taps: 1}\n },\n TapHandler = function (clickThreshold, dblClickThreshold) {\n return function (obj, evt, fn, children) {\n // if event is contextmenu, for devices which are mouse only, we want to\n // use the default bind.\n if (evt == \"contextmenu\" && isMouseDevice)\n DefaultHandler(obj, evt, fn, children);\n else {\n // the issue here is that this down handler gets registered only for the\n // child nodes in the first registration. in fact it should be registered with\n // no child selector and then on down we should cycle through the registered\n // functions to see if one of them matches. on mouseup we should execute ALL of\n // the functions whose children are either null or match the element.\n if (obj.__taTapHandler == null) {\n var tt = obj.__taTapHandler = {\n tap: [],\n dbltap: [],\n contextmenu: [],\n down: false,\n taps: 0,\n downSelectors: []\n };\n var down = function (e) {\n var target = _t(e), pathInfo = _pi(e, target, obj, children != null), finished = false;\n for (var p = 0; p < pathInfo.end; p++) {\n if (finished) return;\n target = pathInfo.path[p];\n for (var i = 0; i < tt.downSelectors.length; i++) {\n if (tt.downSelectors[i] == null || matchesSelector(target, tt.downSelectors[i], obj)) {\n tt.down = true;\n setTimeout(clearSingle, clickThreshold);\n setTimeout(clearDouble, dblClickThreshold);\n finished = true;\n break; // we only need one match on mousedown\n }\n }\n }\n },\n up = function (e) {\n if (tt.down) {\n var target = _t(e), currentTarget, pathInfo;\n tt.taps++;\n var tc = _touchCount(e);\n for (var eventId in _tapProfiles) {\n if (_tapProfiles.hasOwnProperty(eventId)) {\n var p = _tapProfiles[eventId];\n if (p.touches === tc && (p.taps === 1 || p.taps === tt.taps)) {\n for (var i = 0; i < tt[eventId].length; i++) {\n pathInfo = _pi(e, target, obj, tt[eventId][i][1] != null);\n for (var pLoop = 0; pLoop < pathInfo.end; pLoop++) {\n currentTarget = pathInfo.path[pLoop];\n // this is a single event registration handler.\n if (tt[eventId][i][1] == null || matchesSelector(currentTarget, tt[eventId][i][1], obj)) {\n tt[eventId][i][0].apply(currentTarget, [ e ]);\n break;\n }\n }\n }\n }\n }\n }\n }\n },\n clearSingle = function () {\n tt.down = false;\n },\n clearDouble = function () {\n tt.taps = 0;\n };\n\n DefaultHandler(obj, \"mousedown\", down);\n DefaultHandler(obj, \"mouseup\", up);\n }\n // add this child selector (it can be null, that's fine).\n obj.__taTapHandler.downSelectors.push(children);\n\n obj.__taTapHandler[evt].push([fn, children]);\n // the unstore function removes this function from the object's listener list for this type.\n fn.__taUnstore = function () {\n _d(obj.__taTapHandler[evt], fn);\n };\n }\n };\n },\n meeHelper = function (type, evt, obj, target) {\n for (var i in obj.__tamee[type]) {\n if (obj.__tamee[type].hasOwnProperty(i)) {\n obj.__tamee[type][i].apply(target, [ evt ]);\n }\n }\n },\n MouseEnterExitHandler = function () {\n var activeElements = [];\n return function (obj, evt, fn, children) {\n if (!obj.__tamee) {\n // __tamee holds a flag saying whether the mouse is currently \"in\" the element, and a list of\n // both mouseenter and mouseexit functions.\n obj.__tamee = { over: false, mouseenter: [], mouseexit: [] };\n // register over and out functions\n var over = function (e) {\n var t = _t(e);\n if ((children == null && (t == obj && !obj.__tamee.over)) || (matchesSelector(t, children, obj) && (t.__tamee == null || !t.__tamee.over))) {\n meeHelper(\"mouseenter\", e, obj, t);\n t.__tamee = t.__tamee || {};\n t.__tamee.over = true;\n activeElements.push(t);\n }\n },\n out = function (e) {\n var t = _t(e);\n // is the current target one of the activeElements? and is the\n // related target NOT a descendant of it?\n for (var i = 0; i < activeElements.length; i++) {\n if (t == activeElements[i] && !matchesSelector((e.relatedTarget || e.toElement), \"*\", t)) {\n t.__tamee.over = false;\n activeElements.splice(i, 1);\n meeHelper(\"mouseexit\", e, obj, t);\n }\n }\n };\n\n _bind(obj, \"mouseover\", _curryChildFilter(children, obj, over, \"mouseover\"), over);\n _bind(obj, \"mouseout\", _curryChildFilter(children, obj, out, \"mouseout\"), out);\n }\n\n fn.__taUnstore = function () {\n delete obj.__tamee[evt][fn.__tauid];\n };\n\n _store(obj, evt, fn);\n obj.__tamee[evt][fn.__tauid] = fn;\n };\n },\n isTouchDevice = \"ontouchstart\" in document.documentElement,\n isMouseDevice = \"onmousedown\" in document.documentElement,\n touchMap = { \"mousedown\": \"touchstart\", \"mouseup\": \"touchend\", \"mousemove\": \"touchmove\" },\n touchstart = \"touchstart\", touchend = \"touchend\", touchmove = \"touchmove\",\n iev = (function () {\n var rv = -1;\n if (navigator.appName == 'Microsoft Internet Explorer') {\n var ua = navigator.userAgent,\n re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n return rv;\n })(),\n isIELT9 = iev > -1 && iev < 9,\n _genLoc = function (e, prefix) {\n if (e == null) return [ 0, 0 ];\n var ts = _touches(e), t = _getTouch(ts, 0);\n return [t[prefix + \"X\"], t[prefix + \"Y\"]];\n },\n _pageLocation = function (e) {\n if (e == null) return [ 0, 0 ];\n if (isIELT9) {\n return [ e.clientX + document.documentElement.scrollLeft, e.clientY + document.documentElement.scrollTop ];\n }\n else {\n return _genLoc(e, \"page\");\n }\n },\n _screenLocation = function (e) {\n return _genLoc(e, \"screen\");\n },\n _clientLocation = function (e) {\n return _genLoc(e, \"client\");\n },\n _getTouch = function (touches, idx) {\n return touches.item ? touches.item(idx) : touches[idx];\n },\n _touches = function (e) {\n return e.touches && e.touches.length > 0 ? e.touches :\n e.changedTouches && e.changedTouches.length > 0 ? e.changedTouches :\n e.targetTouches && e.targetTouches.length > 0 ? e.targetTouches :\n [ e ];\n },\n _touchCount = function (e) {\n return _touches(e).length;\n },\n //http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html\n _bind = function (obj, type, fn, originalFn) {\n _store(obj, type, fn);\n originalFn.__tauid = fn.__tauid;\n if (obj.addEventListener)\n obj.addEventListener(type, fn, false);\n else if (obj.attachEvent) {\n var key = type + fn.__tauid;\n obj[\"e\" + key] = fn;\n // TODO look at replacing with .call(..)\n obj[key] = function () {\n obj[\"e\" + key] && obj[\"e\" + key](window.event);\n };\n obj.attachEvent(\"on\" + type, obj[key]);\n }\n },\n _unbind = function (obj, type, fn) {\n if (fn == null) return;\n _each(obj, function () {\n var _el = _gel(this);\n _unstore(_el, type, fn);\n // it has been bound if there is a tauid. otherwise it was not bound and we can ignore it.\n if (fn.__tauid != null) {\n if (_el.removeEventListener) {\n _el.removeEventListener(type, fn, false);\n if (isTouchDevice && touchMap[type]) _el.removeEventListener(touchMap[type], fn, false);\n }\n else if (this.detachEvent) {\n var key = type + fn.__tauid;\n _el[key] && _el.detachEvent(\"on\" + type, _el[key]);\n _el[key] = null;\n _el[\"e\" + key] = null;\n }\n }\n\n // if a touch event was also registered, deregister now.\n if (fn.__taTouchProxy) {\n _unbind(obj, fn.__taTouchProxy[1], fn.__taTouchProxy[0]);\n }\n });\n },\n _each = function (obj, fn) {\n if (obj == null) return;\n // if a list (or list-like), use it. if a string, get a list\n // by running the string through querySelectorAll. else, assume\n // it's an Element.\n // obj.top is \"unknown\" in IE8.\n obj = (typeof Window !== \"undefined\" && (typeof obj.top !== \"unknown\" && obj == obj.top)) ? [ obj ] :\n (typeof obj !== \"string\") && (obj.tagName == null && obj.length != null) ? obj :\n typeof obj === \"string\" ? document.querySelectorAll(obj)\n : [ obj ];\n\n for (var i = 0; i < obj.length; i++)\n fn.apply(obj[i]);\n },\n _uuid = function () {\n return ('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n }));\n };\n\n /**\n * Mottle offers support for abstracting out the differences\n * between touch and mouse devices, plus \"smart click\" functionality\n * (don't fire click if the mouse has moved between mousedown and mouseup),\n * and synthesized click/tap events.\n * @class Mottle\n * @constructor\n * @param {Object} params Constructor params\n * @param {Number} [params.clickThreshold=250] Threshold, in milliseconds beyond which a touchstart followed by a touchend is not considered to be a click.\n * @param {Number} [params.dblClickThreshold=450] Threshold, in milliseconds beyond which two successive tap events are not considered to be a click.\n * @param {Boolean} [params.smartClicks=false] If true, won't fire click events if the mouse has moved between mousedown and mouseup. Note that this functionality\n * requires that Mottle consume the mousedown event, and so may not be viable in all use cases.\n */\n root.Mottle = function (params) {\n params = params || {};\n var clickThreshold = params.clickThreshold || 250,\n dblClickThreshold = params.dblClickThreshold || 450,\n mouseEnterExitHandler = new MouseEnterExitHandler(),\n tapHandler = new TapHandler(clickThreshold, dblClickThreshold),\n _smartClicks = params.smartClicks,\n _doBind = function (obj, evt, fn, children) {\n if (fn == null) return;\n _each(obj, function () {\n var _el = _gel(this);\n if (_smartClicks && evt === \"click\")\n SmartClickHandler(_el, evt, fn, children);\n else if (evt === \"tap\" || evt === \"dbltap\" || evt === \"contextmenu\") {\n tapHandler(_el, evt, fn, children);\n }\n else if (evt === \"mouseenter\" || evt == \"mouseexit\")\n mouseEnterExitHandler(_el, evt, fn, children);\n else\n DefaultHandler(_el, evt, fn, children);\n });\n };\n\n /**\n * Removes an element from the DOM, and deregisters all event handlers for it. You should use this\n * to ensure you don't leak memory.\n * @method remove\n * @param {String|Element} el Element, or id of the element, to remove.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.remove = function (el) {\n _each(el, function () {\n var _el = _gel(this);\n if (_el.__ta) {\n for (var evt in _el.__ta) {\n if (_el.__ta.hasOwnProperty(evt)) {\n for (var h in _el.__ta[evt]) {\n if (_el.__ta[evt].hasOwnProperty(h))\n _unbind(_el, evt, _el.__ta[evt][h]);\n }\n }\n }\n }\n _el.parentNode && _el.parentNode.removeChild(_el);\n });\n return this;\n };\n\n /**\n * Register an event handler, optionally as a delegate for some set of descendant elements. Note\n * that this method takes either 3 or 4 arguments - if you supply 3 arguments it is assumed you have\n * omitted the `children` parameter, and that the event handler should be bound directly to the given element.\n * @method on\n * @param {Element[]|Element|String} el Either an Element, or a CSS spec for a list of elements, or an array of Elements.\n * @param {String} [children] Comma-delimited list of selectors identifying allowed children.\n * @param {String} event Event ID.\n * @param {Function} fn Event handler function.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.on = function (el, event, children, fn) {\n var _el = arguments[0],\n _c = arguments.length == 4 ? arguments[2] : null,\n _e = arguments[1],\n _f = arguments[arguments.length - 1];\n\n _doBind(_el, _e, _f, _c);\n return this;\n };\n\n /**\n * Cancel delegate event handling for the given function. Note that unlike with 'on' you do not supply\n * a list of child selectors here: it removes event delegation from all of the child selectors for which the\n * given function was registered (if any).\n * @method off\n * @param {Element[]|Element|String} el Element - or ID of element - from which to remove event listener.\n * @param {String} event Event ID.\n * @param {Function} fn Event handler function.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.off = function (el, event, fn) {\n _unbind(el, event, fn);\n return this;\n };\n\n /**\n * Triggers some event for a given element.\n * @method trigger\n * @param {Element} el Element for which to trigger the event.\n * @param {String} event Event ID.\n * @param {Event} originalEvent The original event. Should be optional of course, but currently is not, due\n * to the jsPlumb use case that caused this method to be added.\n * @param {Object} [payload] Optional object to set as `payload` on the generated event; useful for message passing.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.trigger = function (el, event, originalEvent, payload) {\n // MouseEvent undefined in old IE; that's how we know it's a mouse event. A fine Microsoft paradox.\n var originalIsMouse = isMouseDevice && (typeof MouseEvent === \"undefined\" || originalEvent == null || originalEvent.constructor === MouseEvent);\n\n var eventToBind = (isTouchDevice && !isMouseDevice && touchMap[event]) ? touchMap[event] : event,\n bindingAMouseEvent = !(isTouchDevice && !isMouseDevice && touchMap[event]);\n\n var pl = _pageLocation(originalEvent), sl = _screenLocation(originalEvent), cl = _clientLocation(originalEvent);\n _each(el, function () {\n var _el = _gel(this), evt;\n originalEvent = originalEvent || {\n screenX: sl[0],\n screenY: sl[1],\n clientX: cl[0],\n clientY: cl[1]\n };\n\n var _decorate = function (_evt) {\n if (payload) _evt.payload = payload;\n };\n\n var eventGenerators = {\n \"TouchEvent\": function (evt) {\n\n var touchList = _touchAndList(window, _el, 0, pl[0], pl[1], sl[0], sl[1], cl[0], cl[1]),\n init = evt.initTouchEvent || evt.initEvent;\n\n init(eventToBind, true, true, window, null, sl[0], sl[1],\n cl[0], cl[1], false, false, false, false,\n touchList, touchList, touchList, 1, 0);\n },\n \"MouseEvents\": function (evt) {\n evt.initMouseEvent(eventToBind, true, true, window, 0,\n sl[0], sl[1],\n cl[0], cl[1],\n false, false, false, false, 1, _el);\n }\n };\n\n if (document.createEvent) {\n\n var ite = !bindingAMouseEvent && !originalIsMouse && (isTouchDevice && touchMap[event]),\n evtName = ite ? \"TouchEvent\" : \"MouseEvents\";\n\n evt = document.createEvent(evtName);\n eventGenerators[evtName](evt);\n _decorate(evt);\n _el.dispatchEvent(evt);\n }\n else if (document.createEventObject) {\n evt = document.createEventObject();\n evt.eventType = evt.eventName = eventToBind;\n evt.screenX = sl[0];\n evt.screenY = sl[1];\n evt.clientX = cl[0];\n evt.clientY = cl[1];\n _decorate(evt);\n _el.fireEvent('on' + eventToBind, evt);\n }\n });\n return this;\n }\n };\n\n /**\n * Static method to assist in 'consuming' an element: uses `stopPropagation` where available, or sets\n * `e.returnValue=false` where it is not.\n * @method Mottle.consume\n * @param {Event} e Event to consume\n * @param {Boolean} [doNotPreventDefault=false] If true, does not call `preventDefault()` on the event.\n */\n root.Mottle.consume = function (e, doNotPreventDefault) {\n if (e.stopPropagation)\n e.stopPropagation();\n else\n e.returnValue = false;\n\n if (!doNotPreventDefault && e.preventDefault)\n e.preventDefault();\n };\n\n /**\n * Gets the page location corresponding to the given event. For touch events this means get the page location of the first touch.\n * @method Mottle.pageLocation\n * @param {Event} e Event to get page location for.\n * @return {Number[]} [left, top] for the given event.\n */\n root.Mottle.pageLocation = _pageLocation;\n\n /**\n * Forces touch events to be turned \"on\". Useful for testing: even if you don't have a touch device, you can still\n * trigger a touch event when this is switched on and it will be captured and acted on.\n * @method setForceTouchEvents\n * @param {Boolean} value If true, force touch events to be on.\n */\n root.Mottle.setForceTouchEvents = function (value) {\n isTouchDevice = value;\n };\n\n /**\n * Forces mouse events to be turned \"on\". Useful for testing: even if you don't have a mouse, you can still\n * trigger a mouse event when this is switched on and it will be captured and acted on.\n * @method setForceMouseEvents\n * @param {Boolean} value If true, force mouse events to be on.\n */\n root.Mottle.setForceMouseEvents = function (value) {\n isMouseDevice = value;\n };\n\n root.Mottle.version = \"0.8.0\";\n\n if (typeof exports !== \"undefined\") {\n exports.Mottle = root.Mottle;\n }\n\n}).call(typeof window === \"undefined\" ? this : window);\n\n/**\n drag/drop functionality for use with jsPlumb but with\n no knowledge of jsPlumb. supports multiple scopes (separated by whitespace), dragging\n multiple elements, constrain to parent, drop filters, drag start filters, custom\n css classes.\n\n a lot of the functionality of this script is expected to be plugged in:\n\n addClass\n removeClass\n\n addEvent\n removeEvent\n\n getPosition\n setPosition\n getSize\n\n indexOf\n intersects\n\n the name came from here:\n\n http://mrsharpoblunto.github.io/foswig.js/\n\n copyright 2016 jsPlumb\n */\n\n;(function() {\n\n \"use strict\";\n var root = this;\n\n var _suggest = function(list, item, head) {\n if (list.indexOf(item) === -1) {\n head ? list.unshift(item) : list.push(item);\n return true;\n }\n return false;\n };\n\n var _vanquish = function(list, item) {\n var idx = list.indexOf(item);\n if (idx !== -1) list.splice(idx, 1);\n };\n\n var _difference = function(l1, l2) {\n var d = [];\n for (var i = 0; i < l1.length; i++) {\n if (l2.indexOf(l1[i]) === -1)\n d.push(l1[i]);\n }\n return d;\n };\n\n var _isString = function(f) {\n return f == null ? false : (typeof f === \"string\" || f.constructor === String);\n };\n\n var getOffsetRect = function (elem) {\n // (1)\n var box = elem.getBoundingClientRect(),\n body = document.body,\n docElem = document.documentElement,\n // (2)\n scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop,\n scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft,\n // (3)\n clientTop = docElem.clientTop || body.clientTop || 0,\n clientLeft = docElem.clientLeft || body.clientLeft || 0,\n // (4)\n top = box.top + scrollTop - clientTop,\n left = box.left + scrollLeft - clientLeft;\n\n return { top: Math.round(top), left: Math.round(left) };\n };\n\n var matchesSelector = function(el, selector, ctx) {\n ctx = ctx || el.parentNode;\n var possibles = ctx.querySelectorAll(selector);\n for (var i = 0; i < possibles.length; i++) {\n if (possibles[i] === el)\n return true;\n }\n return false;\n };\n\n var findDelegateElement = function(parentElement, childElement, selector) {\n if (matchesSelector(childElement, selector, parentElement)) {\n return childElement;\n } else {\n var currentParent = childElement.parentNode;\n while (currentParent != null && currentParent !== parentElement) {\n if (matchesSelector(currentParent, selector, parentElement)) {\n return currentParent;\n } else {\n currentParent = currentParent.parentNode;\n }\n }\n }\n };\n\n var iev = (function() {\n var rv = -1;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var ua = navigator.userAgent,\n re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n return rv;\n })(),\n DEFAULT_GRID_X = 10,\n DEFAULT_GRID_Y = 10,\n isIELT9 = iev > -1 && iev < 9,\n isIE9 = iev === 9,\n _pl = function(e) {\n if (isIELT9) {\n return [ e.clientX + document.documentElement.scrollLeft, e.clientY + document.documentElement.scrollTop ];\n }\n else {\n var ts = _touches(e), t = _getTouch(ts, 0);\n // for IE9 pageX might be null if the event was synthesized. We try for pageX/pageY first,\n // falling back to clientX/clientY if necessary. In every other browser we want to use pageX/pageY.\n return isIE9 ? [t.pageX || t.clientX, t.pageY || t.clientY] : [t.pageX, t.pageY];\n }\n },\n _getTouch = function(touches, idx) { return touches.item ? touches.item(idx) : touches[idx]; },\n _touches = function(e) {\n return e.touches && e.touches.length > 0 ? e.touches :\n e.changedTouches && e.changedTouches.length > 0 ? e.changedTouches :\n e.targetTouches && e.targetTouches.length > 0 ? e.targetTouches :\n [ e ];\n },\n _classes = {\n draggable:\"katavorio-draggable\", // draggable elements\n droppable:\"katavorio-droppable\", // droppable elements\n drag : \"katavorio-drag\", // elements currently being dragged\n selected:\"katavorio-drag-selected\", // elements in current drag selection\n active : \"katavorio-drag-active\", // droppables that are targets of a currently dragged element\n hover : \"katavorio-drag-hover\", // droppables over which a matching drag element is hovering\n noSelect : \"katavorio-drag-no-select\", // added to the body to provide a hook to suppress text selection\n ghostProxy:\"katavorio-ghost-proxy\", // added to a ghost proxy element in use when a drag has exited the bounds of its parent.\n clonedDrag:\"katavorio-clone-drag\" // added to a node that is a clone of an element created at the start of a drag\n },\n _defaultScope = \"katavorio-drag-scope\",\n _events = [ \"stop\", \"start\", \"drag\", \"drop\", \"over\", \"out\", \"beforeStart\" ],\n _devNull = function() {},\n _true = function() { return true; },\n _foreach = function(l, fn, from) {\n for (var i = 0; i < l.length; i++) {\n if (l[i] != from)\n fn(l[i]);\n }\n },\n _setDroppablesActive = function(dd, val, andHover, drag) {\n _foreach(dd, function(e) {\n e.setActive(val);\n if (val) e.updatePosition();\n if (andHover) e.setHover(drag, val);\n });\n },\n _each = function(obj, fn) {\n if (obj == null) return;\n obj = !_isString(obj) && (obj.tagName == null && obj.length != null) ? obj : [ obj ];\n for (var i = 0; i < obj.length; i++)\n fn.apply(obj[i], [ obj[i] ]);\n },\n _consume = function(e) {\n if (e.stopPropagation) {\n e.stopPropagation();\n e.preventDefault();\n }\n else {\n e.returnValue = false;\n }\n },\n _defaultInputFilterSelector = \"input,textarea,select,button,option\",\n //\n // filters out events on all input elements, like textarea, checkbox, input, select.\n _inputFilter = function(e, el, _katavorio) {\n var t = e.srcElement || e.target;\n return !matchesSelector(t, _katavorio.getInputFilterSelector(), el);\n };\n\n var Super = function(el, params, css, scope) {\n this.params = params || {};\n this.el = el;\n this.params.addClass(this.el, this._class);\n this.uuid = _uuid();\n var enabled = true;\n this.setEnabled = function(e) { enabled = e; };\n this.isEnabled = function() { return enabled; };\n this.toggleEnabled = function() { enabled = !enabled; };\n this.setScope = function(scopes) {\n this.scopes = scopes ? scopes.split(/\\s+/) : [ scope ];\n };\n this.addScope = function(scopes) {\n var m = {};\n _each(this.scopes, function(s) { m[s] = true;});\n _each(scopes ? scopes.split(/\\s+/) : [], function(s) { m[s] = true;});\n this.scopes = [];\n for (var i in m) this.scopes.push(i);\n };\n this.removeScope = function(scopes) {\n var m = {};\n _each(this.scopes, function(s) { m[s] = true;});\n _each(scopes ? scopes.split(/\\s+/) : [], function(s) { delete m[s];});\n this.scopes = [];\n for (var i in m) this.scopes.push(i);\n };\n this.toggleScope = function(scopes) {\n var m = {};\n _each(this.scopes, function(s) { m[s] = true;});\n _each(scopes ? scopes.split(/\\s+/) : [], function(s) {\n if (m[s]) delete m[s];\n else m[s] = true;\n });\n this.scopes = [];\n for (var i in m) this.scopes.push(i);\n };\n this.setScope(params.scope);\n this.k = params.katavorio;\n return params.katavorio;\n };\n\n var TRUE = function() { return true; };\n var FALSE = function() { return false; };\n\n var Drag = function(el, params, css, scope) {\n this._class = css.draggable;\n var k = Super.apply(this, arguments);\n this.rightButtonCanDrag = this.params.rightButtonCanDrag;\n var downAt = [0,0], posAtDown = null, pagePosAtDown = null, pageDelta = [0,0], moving = false, initialScroll = [0,0],\n consumeStartEvent = this.params.consumeStartEvent !== false,\n dragEl = this.el,\n clone = this.params.clone,\n scroll = this.params.scroll,\n _multipleDrop = params.multipleDrop !== false,\n isConstrained = false,\n useGhostProxy = params.ghostProxy === true ? TRUE : params.ghostProxy && typeof params.ghostProxy === \"function\" ? params.ghostProxy : FALSE,\n ghostProxy = function(el) { return el.cloneNode(true); },\n selector = params.selector,\n elementToDrag = null;\n\n var snapThreshold = params.snapThreshold,\n _snap = function(pos, gridX, gridY, thresholdX, thresholdY) {\n var _dx = Math.floor(pos[0] / gridX),\n _dxl = gridX * _dx,\n _dxt = _dxl + gridX,\n _x = Math.abs(pos[0] - _dxl) <= thresholdX ? _dxl : Math.abs(_dxt - pos[0]) <= thresholdX ? _dxt : pos[0];\n\n var _dy = Math.floor(pos[1] / gridY),\n _dyl = gridY * _dy,\n _dyt = _dyl + gridY,\n _y = Math.abs(pos[1] - _dyl) <= thresholdY ? _dyl : Math.abs(_dyt - pos[1]) <= thresholdY ? _dyt : pos[1];\n\n return [ _x, _y];\n };\n\n this.posses = [];\n this.posseRoles = {};\n\n this.toGrid = function(pos) {\n if (this.params.grid == null) {\n return pos;\n }\n else {\n var tx = this.params.grid ? this.params.grid[0] / 2 : snapThreshold ? snapThreshold : DEFAULT_GRID_X / 2,\n ty = this.params.grid ? this.params.grid[1] / 2 : snapThreshold ? snapThreshold : DEFAULT_GRID_Y / 2;\n\n return _snap(pos, this.params.grid[0], this.params.grid[1], tx, ty);\n }\n };\n\n this.snap = function(x, y) {\n if (dragEl == null) return;\n x = x || (this.params.grid ? this.params.grid[0] : DEFAULT_GRID_X);\n y = y || (this.params.grid ? this.params.grid[1] : DEFAULT_GRID_Y);\n var p = this.params.getPosition(dragEl),\n tx = this.params.grid ? this.params.grid[0] / 2 : snapThreshold,\n ty = this.params.grid ? this.params.grid[1] / 2 : snapThreshold;\n\n this.params.setPosition(dragEl, _snap(p, x, y, tx, ty));\n };\n\n this.setUseGhostProxy = function(val) {\n useGhostProxy = val ? TRUE : FALSE;\n };\n\n var constrain;\n var negativeFilter = function(pos) {\n return (params.allowNegative === false) ? [ Math.max (0, pos[0]), Math.max(0, pos[1]) ] : pos;\n };\n\n var _setConstrain = function(value) {\n constrain = typeof value === \"function\" ? value : value ? function(pos, dragEl, _constrainRect, _size) {\n return negativeFilter([\n Math.max(0, Math.min(_constrainRect.w - _size[0], pos[0])),\n Math.max(0, Math.min(_constrainRect.h - _size[1], pos[1]))\n ]);\n }.bind(this) : function(pos) { return negativeFilter(pos); };\n }.bind(this);\n\n _setConstrain(typeof this.params.constrain === \"function\" ? this.params.constrain : (this.params.constrain || this.params.containment));\n\n\n /**\n * Sets whether or not the Drag is constrained. A value of 'true' means constrain to parent bounds; a function\n * will be executed and returns true if the position is allowed.\n * @param value\n */\n this.setConstrain = function(value) {\n _setConstrain(value);\n };\n\n var revertFunction;\n /**\n * Sets a function to call on drag stop, which, if it returns true, indicates that the given element should\n * revert to its position before the previous drag.\n * @param fn\n */\n this.setRevert = function(fn) {\n revertFunction = fn;\n };\n\n var _assignId = function(obj) {\n if (typeof obj === \"function\") {\n obj._katavorioId = _uuid();\n return obj._katavorioId;\n } else {\n return obj;\n }\n },\n // a map of { spec -> [ fn, exclusion ] } entries.\n _filters = {},\n _testFilter = function(e) {\n for (var key in _filters) {\n var f = _filters[key];\n var rv = f[0](e);\n if (f[1]) rv = !rv;\n if (!rv) return false;\n }\n return true;\n },\n _setFilter = this.setFilter = function(f, _exclude) {\n if (f) {\n var key = _assignId(f);\n _filters[key] = [\n function(e) {\n var t = e.srcElement || e.target, m;\n if (_isString(f)) {\n m = matchesSelector(t, f, el);\n }\n else if (typeof f === \"function\") {\n m = f(e, el);\n }\n return m;\n },\n _exclude !== false\n ];\n\n }\n },\n _addFilter = this.addFilter = _setFilter,\n _removeFilter = this.removeFilter = function(f) {\n var key = typeof f === \"function\" ? f._katavorioId : f;\n delete _filters[key];\n };\n\n this.clearAllFilters = function() {\n _filters = {};\n };\n\n this.canDrag = this.params.canDrag || _true;\n\n var constrainRect,\n matchingDroppables = [],\n intersectingDroppables = [];\n\n this.downListener = function(e) {\n var isNotRightClick = this.rightButtonCanDrag || (e.which !== 3 && e.button !== 2);\n if (isNotRightClick && this.isEnabled() && this.canDrag()) {\n\n var _f = _testFilter(e) && _inputFilter(e, this.el, this.k);\n if (_f) {\n\n if (selector) {\n elementToDrag = findDelegateElement(this.el, e.target || e.srcElement, selector);\n if(elementToDrag == null) {\n return;\n }\n }\n else {\n elementToDrag = this.el;\n }\n\n if (clone) {\n dragEl = elementToDrag.cloneNode(true);\n this.params.addClass(dragEl, _classes.clonedDrag);\n\n dragEl.setAttribute(\"id\", null);\n dragEl.style.position = \"absolute\";\n\n if (this.params.parent != null) {\n var p = this.params.getPosition(this.el);\n dragEl.style.left = p[0] + \"px\";\n dragEl.style.top = p[1] + \"px\";\n this.params.parent.appendChild(dragEl);\n } else {\n // the clone node is added to the body; getOffsetRect gives us a value\n // relative to the body.\n var b = getOffsetRect(elementToDrag);\n dragEl.style.left = b.left + \"px\";\n dragEl.style.top = b.top + \"px\";\n\n document.body.appendChild(dragEl);\n }\n\n } else {\n dragEl = elementToDrag;\n }\n\n consumeStartEvent && _consume(e);\n downAt = _pl(e);\n if (dragEl && dragEl.parentNode)\n {\n initialScroll = [dragEl.parentNode.scrollLeft, dragEl.parentNode.scrollTop];\n }\n //\n this.params.bind(document, \"mousemove\", this.moveListener);\n this.params.bind(document, \"mouseup\", this.upListener);\n k.markSelection(this);\n k.markPosses(this);\n this.params.addClass(document.body, css.noSelect);\n _dispatch(\"beforeStart\", {el:this.el, pos:posAtDown, e:e, drag:this});\n }\n else if (this.params.consumeFilteredEvents) {\n _consume(e);\n }\n }\n }.bind(this);\n\n this.moveListener = function(e) {\n if (downAt) {\n if (!moving) {\n var _continue = _dispatch(\"start\", {el:this.el, pos:posAtDown, e:e, drag:this});\n if (_continue !== false) {\n if (!downAt) {\n return;\n }\n this.mark(true);\n moving = true;\n } else {\n this.abort();\n }\n }\n\n // it is possible that the start event caused the drag to be aborted. So we check\n // again that we are currently dragging.\n if (downAt) {\n intersectingDroppables.length = 0;\n var pos = _pl(e), dx = pos[0] - downAt[0], dy = pos[1] - downAt[1],\n z = this.params.ignoreZoom ? 1 : k.getZoom();\n if (dragEl && dragEl.parentNode)\n {\n dx += dragEl.parentNode.scrollLeft - initialScroll[0];\n dy += dragEl.parentNode.scrollTop - initialScroll[1];\n }\n dx /= z;\n dy /= z;\n this.moveBy(dx, dy, e);\n k.updateSelection(dx, dy, this);\n k.updatePosses(dx, dy, this);\n }\n }\n }.bind(this);\n\n this.upListener = function(e) {\n if (downAt) {\n downAt = null;\n this.params.unbind(document, \"mousemove\", this.moveListener);\n this.params.unbind(document, \"mouseup\", this.upListener);\n this.params.removeClass(document.body, css.noSelect);\n this.unmark(e);\n k.unmarkSelection(this, e);\n k.unmarkPosses(this, e);\n this.stop(e);\n\n //k.notifySelectionDragStop(this, e); removed in 1.1.0 under the \"leave it for one release in case it breaks\" rule.\n // it isnt necessary to fire this as the normal stop event now includes a `selection` member that has every dragged element.\n // firing this event causes consumers who use the `selection` array to process a lot more drag stop events than is necessary\n\n k.notifyPosseDragStop(this, e);\n moving = false;\n if (clone) {\n dragEl && dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n dragEl = null;\n }\n\n intersectingDroppables.length = 0;\n\n if (revertFunction && revertFunction(this.el, this.params.getPosition(this.el)) === true) {\n this.params.setPosition(this.el, posAtDown);\n _dispatch(\"revert\", this.el);\n }\n }\n }.bind(this);\n\n this.getFilters = function() { return _filters; };\n\n this.abort = function() {\n if (downAt != null) {\n this.upListener();\n }\n };\n\n /**\n * Returns the element that was last dragged. This may be some original element from the DOM, or if `clone` is\n * set, then its actually a copy of some original DOM element. In some client calls to this method, it is the\n * actual element that was dragged that is desired. In others, it is the original DOM element that the user\n * wishes to get - in which case, pass true for `retrieveOriginalElement`.\n *\n * @returns {*}\n */\n this.getDragElement = function(retrieveOriginalElement) {\n return retrieveOriginalElement ? elementToDrag || this.el : dragEl || this.el;\n };\n\n var listeners = {\"start\":[], \"drag\":[], \"stop\":[], \"over\":[], \"out\":[], \"beforeStart\":[], \"revert\":[] };\n if (params.events.start) listeners.start.push(params.events.start);\n if (params.events.beforeStart) listeners.beforeStart.push(params.events.beforeStart);\n if (params.events.stop) listeners.stop.push(params.events.stop);\n if (params.events.drag) listeners.drag.push(params.events.drag);\n if (params.events.revert) listeners.revert.push(params.events.revert);\n\n this.on = function(evt, fn) {\n if (listeners[evt]) listeners[evt].push(fn);\n };\n\n this.off = function(evt, fn) {\n if (listeners[evt]) {\n var l = [];\n for (var i = 0; i < listeners[evt].length; i++) {\n if (listeners[evt][i] !== fn) l.push(listeners[evt][i]);\n }\n listeners[evt] = l;\n }\n };\n\n var _dispatch = function(evt, value) {\n var result = null;\n if (listeners[evt]) {\n for (var i = 0; i < listeners[evt].length; i++) {\n try {\n var v = listeners[evt][i](value);\n if (v != null) {\n result = v;\n }\n }\n catch (e) { }\n }\n }\n return result;\n };\n\n this.notifyStart = function(e) {\n _dispatch(\"start\", {el:this.el, pos:this.params.getPosition(dragEl), e:e, drag:this});\n };\n\n this.stop = function(e, force) {\n if (force || moving) {\n var positions = [],\n sel = k.getSelection(),\n dPos = this.params.getPosition(dragEl);\n\n if (sel.length > 1) {\n for (var i = 0; i < sel.length; i++) {\n var p = this.params.getPosition(sel[i].el);\n positions.push([ sel[i].el, { left: p[0], top: p[1] }, sel[i] ]);\n }\n }\n else {\n positions.push([ dragEl, {left:dPos[0], top:dPos[1]}, this ]);\n }\n\n _dispatch(\"stop\", {\n el: dragEl,\n pos: ghostProxyOffsets || dPos,\n finalPos:dPos,\n e: e,\n drag: this,\n selection:positions\n });\n }\n };\n\n this.mark = function(andNotify) {\n posAtDown = this.params.getPosition(dragEl);\n pagePosAtDown = this.params.getPosition(dragEl, true);\n pageDelta = [pagePosAtDown[0] - posAtDown[0], pagePosAtDown[1] - posAtDown[1]];\n this.size = this.params.getSize(dragEl);\n matchingDroppables = k.getMatchingDroppables(this);\n _setDroppablesActive(matchingDroppables, true, false, this);\n this.params.addClass(dragEl, this.params.dragClass || css.drag);\n\n var cs;\n if (this.params.getConstrainingRectangle) {\n cs = this.params.getConstrainingRectangle(dragEl)\n } else {\n cs = this.params.getSize(dragEl.parentNode);\n }\n constrainRect = {w: cs[0], h: cs[1]};\n\n if (andNotify) {\n k.notifySelectionDragStart(this);\n }\n };\n var ghostProxyOffsets;\n this.unmark = function(e, doNotCheckDroppables) {\n _setDroppablesActive(matchingDroppables, false, true, this);\n\n if (isConstrained && useGhostProxy(elementToDrag)) {\n ghostProxyOffsets = [dragEl.offsetLeft, dragEl.offsetTop];\n elementToDrag.parentNode.removeChild(dragEl);\n dragEl = elementToDrag;\n }\n else {\n ghostProxyOffsets = null;\n }\n\n this.params.removeClass(dragEl, this.params.dragClass || css.drag);\n matchingDroppables.length = 0;\n isConstrained = false;\n if (!doNotCheckDroppables) {\n if (intersectingDroppables.length > 0 && ghostProxyOffsets) {\n params.setPosition(elementToDrag, ghostProxyOffsets);\n }\n intersectingDroppables.sort(_rankSort);\n for (var i = 0; i < intersectingDroppables.length; i++) {\n var retVal = intersectingDroppables[i].drop(this, e);\n if (retVal === true) break;\n }\n }\n };\n this.moveBy = function(dx, dy, e) {\n intersectingDroppables.length = 0;\n var desiredLoc = this.toGrid([posAtDown[0] + dx, posAtDown[1] + dy]),\n cPos = constrain(desiredLoc, dragEl, constrainRect, this.size);\n\n if (useGhostProxy(this.el)) {\n if (desiredLoc[0] !== cPos[0] || desiredLoc[1] !== cPos[1]) {\n if (!isConstrained) {\n var gp = ghostProxy(elementToDrag);\n params.addClass(gp, _classes.ghostProxy);\n elementToDrag.parentNode.appendChild(gp);\n dragEl = gp;\n isConstrained = true;\n }\n cPos = desiredLoc;\n }\n else {\n if (isConstrained) {\n elementToDrag.parentNode.removeChild(dragEl);\n dragEl = elementToDrag;\n isConstrained = false;\n }\n }\n }\n\n var rect = { x:cPos[0], y:cPos[1], w:this.size[0], h:this.size[1]},\n pageRect = { x:rect.x + pageDelta[0], y:rect.y + pageDelta[1], w:rect.w, h:rect.h},\n focusDropElement = null;\n\n this.params.setPosition(dragEl, cPos);\n for (var i = 0; i < matchingDroppables.length; i++) {\n var r2 = { x:matchingDroppables[i].pagePosition[0], y:matchingDroppables[i].pagePosition[1], w:matchingDroppables[i].size[0], h:matchingDroppables[i].size[1]};\n if (this.params.intersects(pageRect, r2) && (_multipleDrop || focusDropElement == null || focusDropElement === matchingDroppables[i].el) && matchingDroppables[i].canDrop(this)) {\n if (!focusDropElement) focusDropElement = matchingDroppables[i].el;\n intersectingDroppables.push(matchingDroppables[i]);\n matchingDroppables[i].setHover(this, true, e);\n }\n else if (matchingDroppables[i].isHover()) {\n matchingDroppables[i].setHover(this, false, e);\n }\n }\n\n _dispatch(\"drag\", {el:this.el, pos:cPos, e:e, drag:this});\n\n /* test to see if the parent needs to be scrolled (future)\n if (scroll) {\n var pnsl = dragEl.parentNode.scrollLeft, pnst = dragEl.parentNode.scrollTop;\n console.log(\"scroll!\", pnsl, pnst);\n }*/\n };\n this.destroy = function() {\n this.params.unbind(this.el, \"mousedown\", this.downListener);\n this.params.unbind(document, \"mousemove\", this.moveListener);\n this.params.unbind(document, \"mouseup\", this.upListener);\n this.downListener = null;\n this.upListener = null;\n this.moveListener = null;\n };\n\n // init:register mousedown, and perhaps set a filter\n this.params.bind(this.el, \"mousedown\", this.downListener);\n\n // if handle provded, use that. otherwise, try to set a filter.\n // note that a `handle` selector always results in filterExclude being set to false, ie.\n // the selector defines the handle element(s).\n if (this.params.handle)\n _setFilter(this.params.handle, false);\n else\n _setFilter(this.params.filter, this.params.filterExclude);\n };\n\n var Drop = function(el, params, css, scope) {\n this._class = css.droppable;\n this.params = params || {};\n this.rank = params.rank || 0;\n this._activeClass = this.params.activeClass || css.active;\n this._hoverClass = this.params.hoverClass || css.hover;\n Super.apply(this, arguments);\n var hover = false;\n this.allowLoopback = this.params.allowLoopback !== false;\n\n this.setActive = function(val) {\n this.params[val ? \"addClass\" : \"removeClass\"](this.el, this._activeClass);\n };\n\n this.updatePosition = function() {\n this.position = this.params.getPosition(this.el);\n this.pagePosition = this.params.getPosition(this.el, true);\n this.size = this.params.getSize(this.el);\n };\n\n this.canDrop = this.params.canDrop || function(drag) {\n return true;\n };\n\n this.isHover = function() { return hover; };\n\n this.setHover = function(drag, val, e) {\n // if turning off hover but this was not the drag that caused the hover, ignore.\n if (val || this.el._katavorioDragHover == null || this.el._katavorioDragHover === drag.el._katavorio) {\n this.params[val ? \"addClass\" : \"removeClass\"](this.el, this._hoverClass);\n this.el._katavorioDragHover = val ? drag.el._katavorio : null;\n if (hover !== val) {\n this.params.events[val ? \"over\" : \"out\"]({el: this.el, e: e, drag: drag, drop: this});\n }\n hover = val;\n }\n };\n\n /**\n * A drop event. `drag` is the corresponding Drag object, which may be a Drag for some specific element, or it\n * may be a Drag on some element acting as a delegate for elements contained within it.\n * @param drag\n * @param event\n * @returns {*}\n */\n this.drop = function(drag, event) {\n return this.params.events[\"drop\"]({ drag:drag, e:event, drop:this });\n };\n\n this.destroy = function() {\n this._class = null;\n this._activeClass = null;\n this._hoverClass = null;\n hover = null;\n };\n };\n\n var _uuid = function() {\n return ('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random()*16|0, v = c === 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n }));\n };\n\n var _rankSort = function(a,b) {\n return a.rank < b.rank ? 1 : a.rank > b.rank ? -1 : 0;\n };\n\n var _gel = function(el) {\n if (el == null) return null;\n el = (typeof el === \"string\" || el.constructor === String) ? document.getElementById(el) : el;\n if (el == null) return null;\n el._katavorio = el._katavorio || _uuid();\n return el;\n };\n\n root.Katavorio = function(katavorioParams) {\n\n var _selection = [],\n _selectionMap = {};\n\n this._dragsByScope = {};\n this._dropsByScope = {};\n var _zoom = 1,\n _reg = function(obj, map) {\n _each(obj, function(_obj) {\n for(var i = 0; i < _obj.scopes.length; i++) {\n map[_obj.scopes[i]] = map[_obj.scopes[i]] || [];\n map[_obj.scopes[i]].push(_obj);\n }\n });\n },\n _unreg = function(obj, map) {\n var c = 0;\n _each(obj, function(_obj) {\n for(var i = 0; i < _obj.scopes.length; i++) {\n if (map[_obj.scopes[i]]) {\n var idx = katavorioParams.indexOf(map[_obj.scopes[i]], _obj);\n if (idx !== -1) {\n map[_obj.scopes[i]].splice(idx, 1);\n c++;\n }\n }\n }\n });\n\n return c > 0 ;\n },\n _getMatchingDroppables = this.getMatchingDroppables = function(drag) {\n var dd = [], _m = {};\n for (var i = 0; i < drag.scopes.length; i++) {\n var _dd = this._dropsByScope[drag.scopes[i]];\n if (_dd) {\n for (var j = 0; j < _dd.length; j++) {\n if (_dd[j].canDrop(drag) && !_m[_dd[j].uuid] && (_dd[j].allowLoopback || _dd[j].el !== drag.el)) {\n _m[_dd[j].uuid] = true;\n dd.push(_dd[j]);\n }\n }\n }\n }\n dd.sort(_rankSort);\n return dd;\n },\n _prepareParams = function(p) {\n p = p || {};\n var _p = {\n events:{}\n }, i;\n for (i in katavorioParams) _p[i] = katavorioParams[i];\n for (i in p) _p[i] = p[i];\n // events\n\n for (i = 0; i < _events.length; i++) {\n _p.events[_events[i]] = p[_events[i]] || _devNull;\n }\n _p.katavorio = this;\n return _p;\n }.bind(this),\n _mistletoe = function(existingDrag, params) {\n for (var i = 0; i < _events.length; i++) {\n if (params[_events[i]]) {\n existingDrag.on(_events[i], params[_events[i]]);\n }\n }\n }.bind(this),\n _css = {},\n overrideCss = katavorioParams.css || {},\n _scope = katavorioParams.scope || _defaultScope;\n\n // prepare map of css classes based on defaults frst, then optional overrides\n for (var i in _classes) _css[i] = _classes[i];\n for (var i in overrideCss) _css[i] = overrideCss[i];\n\n var inputFilterSelector = katavorioParams.inputFilterSelector || _defaultInputFilterSelector;\n /**\n * Gets the selector identifying which input elements to filter from drag events.\n * @method getInputFilterSelector\n * @return {String} Current input filter selector.\n */\n this.getInputFilterSelector = function() { return inputFilterSelector; };\n\n /**\n * Sets the selector identifying which input elements to filter from drag events.\n * @method setInputFilterSelector\n * @param {String} selector Input filter selector to set.\n * @return {Katavorio} Current instance; method may be chained.\n */\n this.setInputFilterSelector = function(selector) {\n inputFilterSelector = selector;\n return this;\n };\n\n /**\n * Either makes the given element draggable, or identifies it as an element inside which some identified list\n * of elements may be draggable.\n * @param el\n * @param params\n * @returns {Array}\n */\n this.draggable = function(el, params) {\n var o = [];\n _each(el, function (_el) {\n _el = _gel(_el);\n if (_el != null) {\n if (_el._katavorioDrag == null) {\n var p = _prepareParams(params);\n _el._katavorioDrag = new Drag(_el, p, _css, _scope);\n _reg(_el._katavorioDrag, this._dragsByScope);\n o.push(_el._katavorioDrag);\n katavorioParams.addClass(_el, _css.draggable);\n }\n else {\n _mistletoe(_el._katavorioDrag, params);\n }\n }\n }.bind(this));\n return o;\n };\n\n this.droppable = function(el, params) {\n var o = [];\n _each(el, function(_el) {\n _el = _gel(_el);\n if (_el != null) {\n var drop = new Drop(_el, _prepareParams(params), _css, _scope);\n _el._katavorioDrop = _el._katavorioDrop || [];\n _el._katavorioDrop.push(drop);\n _reg(drop, this._dropsByScope);\n o.push(drop);\n katavorioParams.addClass(_el, _css.droppable);\n }\n }.bind(this));\n return o;\n };\n\n /**\n * @name Katavorio#select\n * @function\n * @desc Adds an element to the current selection (for multiple node drag)\n * @param {Element|String} DOM element - or id of the element - to add.\n */\n this.select = function(el) {\n _each(el, function() {\n var _el = _gel(this);\n if (_el && _el._katavorioDrag) {\n if (!_selectionMap[_el._katavorio]) {\n _selection.push(_el._katavorioDrag);\n _selectionMap[_el._katavorio] = [ _el, _selection.length - 1 ];\n katavorioParams.addClass(_el, _css.selected);\n }\n }\n });\n return this;\n };\n\n /**\n * @name Katavorio#deselect\n * @function\n * @desc Removes an element from the current selection (for multiple node drag)\n * @param {Element|String} DOM element - or id of the element - to remove.\n */\n this.deselect = function(el) {\n _each(el, function() {\n var _el = _gel(this);\n if (_el && _el._katavorio) {\n var e = _selectionMap[_el._katavorio];\n if (e) {\n var _s = [];\n for (var i = 0; i < _selection.length; i++)\n if (_selection[i].el !== _el) _s.push(_selection[i]);\n _selection = _s;\n delete _selectionMap[_el._katavorio];\n katavorioParams.removeClass(_el, _css.selected);\n }\n }\n });\n return this;\n };\n\n this.deselectAll = function() {\n for (var i in _selectionMap) {\n var d = _selectionMap[i];\n katavorioParams.removeClass(d[0], _css.selected);\n }\n\n _selection.length = 0;\n _selectionMap = {};\n };\n\n this.markSelection = function(drag) {\n _foreach(_selection, function(e) { e.mark(); }, drag);\n };\n\n this.markPosses = function(drag) {\n if (drag.posses) {\n _each(drag.posses, function(p) {\n if (drag.posseRoles[p] && _posses[p]) {\n _foreach(_posses[p].members, function (d) {\n d.mark();\n }, drag);\n }\n })\n }\n };\n\n this.unmarkSelection = function(drag, event) {\n _foreach(_selection, function(e) { e.unmark(event); }, drag);\n };\n\n this.unmarkPosses = function(drag, event) {\n if (drag.posses) {\n _each(drag.posses, function(p) {\n if (drag.posseRoles[p] && _posses[p]) {\n _foreach(_posses[p].members, function (d) {\n d.unmark(event, true);\n }, drag);\n }\n });\n }\n };\n\n this.getSelection = function() { return _selection.slice(0); };\n\n this.updateSelection = function(dx, dy, drag) {\n _foreach(_selection, function(e) { e.moveBy(dx, dy); }, drag);\n };\n\n var _posseAction = function(fn, drag) {\n if (drag.posses) {\n _each(drag.posses, function(p) {\n if (drag.posseRoles[p] && _posses[p]) {\n _foreach(_posses[p].members, function (e) {\n fn(e);\n }, drag);\n }\n });\n }\n };\n\n this.updatePosses = function(dx, dy, drag) {\n _posseAction(function(e) { e.moveBy(dx, dy); }, drag);\n };\n\n this.notifyPosseDragStop = function(drag, evt) {\n _posseAction(function(e) { e.stop(evt, true); }, drag);\n };\n\n this.notifySelectionDragStop = function(drag, evt) {\n _foreach(_selection, function(e) { e.stop(evt, true); }, drag);\n };\n\n this.notifySelectionDragStart = function(drag, evt) {\n _foreach(_selection, function(e) { e.notifyStart(evt);}, drag);\n };\n\n this.setZoom = function(z) { _zoom = z; };\n this.getZoom = function() { return _zoom; };\n\n // does the work of changing scopes\n var _scopeManip = function(kObj, scopes, map, fn) {\n _each(kObj, function(_kObj) {\n _unreg(_kObj, map); // deregister existing scopes\n _kObj[fn](scopes); // set scopes\n _reg(_kObj, map); // register new ones\n });\n };\n\n _each([ \"set\", \"add\", \"remove\", \"toggle\"], function(v) {\n this[v + \"Scope\"] = function(el, scopes) {\n _scopeManip(el._katavorioDrag, scopes, this._dragsByScope, v + \"Scope\");\n _scopeManip(el._katavorioDrop, scopes, this._dropsByScope, v + \"Scope\");\n }.bind(this);\n this[v + \"DragScope\"] = function(el, scopes) {\n _scopeManip(el.constructor === Drag ? el : el._katavorioDrag, scopes, this._dragsByScope, v + \"Scope\");\n }.bind(this);\n this[v + \"DropScope\"] = function(el, scopes) {\n _scopeManip(el.constructor === Drop ? el : el._katavorioDrop, scopes, this._dropsByScope, v + \"Scope\");\n }.bind(this);\n }.bind(this));\n\n this.snapToGrid = function(x, y) {\n for (var s in this._dragsByScope) {\n _foreach(this._dragsByScope[s], function(d) { d.snap(x, y); });\n }\n };\n\n this.getDragsForScope = function(s) { return this._dragsByScope[s]; };\n this.getDropsForScope = function(s) { return this._dropsByScope[s]; };\n\n var _destroy = function(el, type, map) {\n el = _gel(el);\n if (el[type]) {\n\n // remove from selection, if present.\n var selIdx = _selection.indexOf(el[type]);\n if (selIdx >= 0) {\n _selection.splice(selIdx, 1);\n }\n\n if (_unreg(el[type], map)) {\n _each(el[type], function(kObj) { kObj.destroy() });\n }\n\n delete el[type];\n }\n };\n\n var _removeListener = function(el, type, evt, fn) {\n el = _gel(el);\n if (el[type]) {\n el[type].off(evt, fn);\n }\n };\n\n this.elementRemoved = function(el) {\n this.destroyDraggable(el);\n this.destroyDroppable(el);\n };\n\n /**\n * Either completely remove drag functionality from the given element, or remove a specific event handler. If you\n * call this method with a single argument - the element - all drag functionality is removed from it. Otherwise, if\n * you provide an event name and listener function, this function is de-registered (if found).\n * @param el Element to update\n * @param {string} [evt] Optional event name to unsubscribe\n * @param {Function} [fn] Optional function to unsubscribe\n */\n this.destroyDraggable = function(el, evt, fn) {\n if (arguments.length === 1) {\n _destroy(el, \"_katavorioDrag\", this._dragsByScope);\n } else {\n _removeListener(el, \"_katavorioDrag\", evt, fn);\n }\n };\n\n /**\n * Either completely remove drop functionality from the given element, or remove a specific event handler. If you\n * call this method with a single argument - the element - all drop functionality is removed from it. Otherwise, if\n * you provide an event name and listener function, this function is de-registered (if found).\n * @param el Element to update\n * @param {string} [evt] Optional event name to unsubscribe\n * @param {Function} [fn] Optional function to unsubscribe\n */\n this.destroyDroppable = function(el, evt, fn) {\n if (arguments.length === 1) {\n _destroy(el, \"_katavorioDrop\", this._dropsByScope);\n } else {\n _removeListener(el, \"_katavorioDrop\", evt, fn);\n }\n };\n\n this.reset = function() {\n this._dragsByScope = {};\n this._dropsByScope = {};\n _selection = [];\n _selectionMap = {};\n _posses = {};\n };\n\n // ----- groups\n var _posses = {};\n\n var _processOneSpec = function(el, _spec, dontAddExisting) {\n var posseId = _isString(_spec) ? _spec : _spec.id;\n var active = _isString(_spec) ? true : _spec.active !== false;\n var posse = _posses[posseId] || (function() {\n var g = {name:posseId, members:[]};\n _posses[posseId] = g;\n return g;\n })();\n _each(el, function(_el) {\n if (_el._katavorioDrag) {\n\n if (dontAddExisting && _el._katavorioDrag.posseRoles[posse.name] != null) return;\n\n _suggest(posse.members, _el._katavorioDrag);\n _suggest(_el._katavorioDrag.posses, posse.name);\n _el._katavorioDrag.posseRoles[posse.name] = active;\n }\n });\n return posse;\n };\n\n /**\n * Add the given element to the posse with the given id, creating the group if it at first does not exist.\n * @method addToPosse\n * @param {Element} el Element to add.\n * @param {String...|Object...} spec Variable args parameters. Each argument can be a either a String, indicating\n * the ID of a Posse to which the element should be added as an active participant, or an Object containing\n * `{ id:\"posseId\", active:false/true}`. In the latter case, if `active` is not provided it is assumed to be\n * true.\n * @returns {Posse|Posse[]} The Posse(s) to which the element(s) was/were added.\n */\n this.addToPosse = function(el, spec) {\n\n var posses = [];\n\n for (var i = 1; i < arguments.length; i++) {\n posses.push(_processOneSpec(el, arguments[i]));\n }\n\n return posses.length === 1 ? posses[0] : posses;\n };\n\n /**\n * Sets the posse(s) for the element with the given id, creating those that do not yet exist, and removing from\n * the element any current Posses that are not specified by this method call. This method will not change the\n * active/passive state if it is given a posse in which the element is already a member.\n * @method setPosse\n * @param {Element} el Element to set posse(s) on.\n * @param {String...|Object...} spec Variable args parameters. Each argument can be a either a String, indicating\n * the ID of a Posse to which the element should be added as an active participant, or an Object containing\n * `{ id:\"posseId\", active:false/true}`. In the latter case, if `active` is not provided it is assumed to be\n * true.\n * @returns {Posse|Posse[]} The Posse(s) to which the element(s) now belongs.\n */\n this.setPosse = function(el, spec) {\n\n var posses = [];\n\n for (var i = 1; i < arguments.length; i++) {\n posses.push(_processOneSpec(el, arguments[i], true).name);\n }\n\n _each(el, function(_el) {\n if (_el._katavorioDrag) {\n var diff = _difference(_el._katavorioDrag.posses, posses);\n var p = [];\n Array.prototype.push.apply(p, _el._katavorioDrag.posses);\n for (var i = 0; i < diff.length; i++) {\n this.removeFromPosse(_el, diff[i]);\n }\n }\n }.bind(this));\n\n return posses.length === 1 ? posses[0] : posses;\n };\n\n /**\n * Remove the given element from the given posse(s).\n * @method removeFromPosse\n * @param {Element} el Element to remove.\n * @param {String...} posseId Varargs parameter: one value for each posse to remove the element from.\n */\n this.removeFromPosse = function(el, posseId) {\n if (arguments.length < 2) throw new TypeError(\"No posse id provided for remove operation\");\n for(var i = 1; i < arguments.length; i++) {\n posseId = arguments[i];\n _each(el, function (_el) {\n if (_el._katavorioDrag && _el._katavorioDrag.posses) {\n var d = _el._katavorioDrag;\n _each(posseId, function (p) {\n _vanquish(_posses[p].members, d);\n _vanquish(d.posses, p);\n delete d.posseRoles[p];\n });\n }\n });\n }\n };\n\n /**\n * Remove the given element from all Posses to which it belongs.\n * @method removeFromAllPosses\n * @param {Element|Element[]} el Element to remove from Posses.\n */\n this.removeFromAllPosses = function(el) {\n _each(el, function(_el) {\n if (_el._katavorioDrag && _el._katavorioDrag.posses) {\n var d = _el._katavorioDrag;\n _each(d.posses, function(p) {\n _vanquish(_posses[p].members, d);\n });\n d.posses.length = 0;\n d.posseRoles = {};\n }\n });\n };\n\n /**\n * Changes the participation state for the element in the Posse with the given ID.\n * @param {Element|Element[]} el Element(s) to change state for.\n * @param {String} posseId ID of the Posse to change element state for.\n * @param {Boolean} state True to make active, false to make passive.\n */\n this.setPosseState = function(el, posseId, state) {\n var posse = _posses[posseId];\n if (posse) {\n _each(el, function(_el) {\n if (_el._katavorioDrag && _el._katavorioDrag.posses) {\n _el._katavorioDrag.posseRoles[posse.name] = state;\n }\n });\n }\n };\n\n };\n\n root.Katavorio.version = \"1.0.0\";\n\n if (typeof exports !== \"undefined\") {\n exports.Katavorio = root.Katavorio;\n }\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n\n(function() {\n\n var root = this;\n root.jsPlumbUtil = root.jsPlumbUtil || {};\n var jsPlumbUtil = root.jsPlumbUtil;\n\n if (typeof exports !=='undefined') { exports.jsPlumbUtil = jsPlumbUtil;}\n\n\n function isArray(a) {\n return Object.prototype.toString.call(a) === \"[object Array]\";\n }\n jsPlumbUtil.isArray = isArray;\n function isNumber(n) {\n return Object.prototype.toString.call(n) === \"[object Number]\";\n }\n jsPlumbUtil.isNumber = isNumber;\n function isString(s) {\n return typeof s === \"string\";\n }\n jsPlumbUtil.isString = isString;\n function isBoolean(s) {\n return typeof s === \"boolean\";\n }\n jsPlumbUtil.isBoolean = isBoolean;\n function isNull(s) {\n return s == null;\n }\n jsPlumbUtil.isNull = isNull;\n function isObject(o) {\n return o == null ? false : Object.prototype.toString.call(o) === \"[object Object]\";\n }\n jsPlumbUtil.isObject = isObject;\n function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n }\n jsPlumbUtil.isDate = isDate;\n function isFunction(o) {\n return Object.prototype.toString.call(o) === \"[object Function]\";\n }\n jsPlumbUtil.isFunction = isFunction;\n function isNamedFunction(o) {\n return isFunction(o) && o.name != null && o.name.length > 0;\n }\n jsPlumbUtil.isNamedFunction = isNamedFunction;\n function isEmpty(o) {\n for (var i in o) {\n if (o.hasOwnProperty(i)) {\n return false;\n }\n }\n return true;\n }\n jsPlumbUtil.isEmpty = isEmpty;\n function clone(a) {\n if (isString(a)) {\n return \"\" + a;\n }\n else if (isBoolean(a)) {\n return !!a;\n }\n else if (isDate(a)) {\n return new Date(a.getTime());\n }\n else if (isFunction(a)) {\n return a;\n }\n else if (isArray(a)) {\n var b = [];\n for (var i = 0; i < a.length; i++) {\n b.push(clone(a[i]));\n }\n return b;\n }\n else if (isObject(a)) {\n var c = {};\n for (var j in a) {\n c[j] = clone(a[j]);\n }\n return c;\n }\n else {\n return a;\n }\n }\n jsPlumbUtil.clone = clone;\n function merge(a, b, collations, overwrites) {\n // first change the collations array - if present - into a lookup table, because its faster.\n var cMap = {}, ar, i, oMap = {};\n collations = collations || [];\n overwrites = overwrites || [];\n for (i = 0; i < collations.length; i++) {\n cMap[collations[i]] = true;\n }\n for (i = 0; i < overwrites.length; i++) {\n oMap[overwrites[i]] = true;\n }\n var c = clone(a);\n for (i in b) {\n if (c[i] == null || oMap[i]) {\n c[i] = b[i];\n }\n else if (isString(b[i]) || isBoolean(b[i])) {\n if (!cMap[i]) {\n c[i] = b[i]; // if we dont want to collate, just copy it in.\n }\n else {\n ar = [];\n // if c's object is also an array we can keep its values.\n ar.push.apply(ar, isArray(c[i]) ? c[i] : [c[i]]);\n ar.push.apply(ar, isBoolean(b[i]) ? b[i] : [b[i]]);\n c[i] = ar;\n }\n }\n else {\n if (isArray(b[i])) {\n ar = [];\n // if c's object is also an array we can keep its values.\n if (isArray(c[i])) {\n ar.push.apply(ar, c[i]);\n }\n ar.push.apply(ar, b[i]);\n c[i] = ar;\n }\n else if (isObject(b[i])) {\n // overwrite c's value with an object if it is not already one.\n if (!isObject(c[i])) {\n c[i] = {};\n }\n for (var j in b[i]) {\n c[i][j] = b[i][j];\n }\n }\n }\n }\n return c;\n }\n jsPlumbUtil.merge = merge;\n function replace(inObj, path, value) {\n if (inObj == null) {\n return;\n }\n var q = inObj, t = q;\n path.replace(/([^\\.])+/g, function (term, lc, pos, str) {\n var array = term.match(/([^\\[0-9]+){1}(\\[)([0-9+])/), last = pos + term.length >= str.length, _getArray = function () {\n return t[array[1]] || (function () {\n t[array[1]] = [];\n return t[array[1]];\n })();\n };\n if (last) {\n // set term = value on current t, creating term as array if necessary.\n if (array) {\n _getArray()[array[3]] = value;\n }\n else {\n t[term] = value;\n }\n }\n else {\n // set to current t[term], creating t[term] if necessary.\n if (array) {\n var a_1 = _getArray();\n t = a_1[array[3]] || (function () {\n a_1[array[3]] = {};\n return a_1[array[3]];\n })();\n }\n else {\n t = t[term] || (function () {\n t[term] = {};\n return t[term];\n })();\n }\n }\n return \"\";\n });\n return inObj;\n }\n jsPlumbUtil.replace = replace;\n //\n // chain a list of functions, supplied by [ object, method name, args ], and return on the first\n // one that returns the failValue. if none return the failValue, return the successValue.\n //\n function functionChain(successValue, failValue, fns) {\n for (var i = 0; i < fns.length; i++) {\n var o = fns[i][0][fns[i][1]].apply(fns[i][0], fns[i][2]);\n if (o === failValue) {\n return o;\n }\n }\n return successValue;\n }\n jsPlumbUtil.functionChain = functionChain;\n /**\n *\n * Take the given model and expand out any parameters. 'functionPrefix' is optional, and if present, helps jsplumb figure out what to do if a value is a Function.\n * if you do not provide it (and doNotExpandFunctions is null, or false), jsplumb will run the given values through any functions it finds, and use the function's\n * output as the value in the result. if you do provide the prefix, only functions that are named and have this prefix\n * will be executed; other functions will be passed as values to the output.\n *\n * @param model\n * @param values\n * @param functionPrefix\n * @param doNotExpandFunctions\n * @returns {any}\n */\n function populate(model, values, functionPrefix, doNotExpandFunctions) {\n // for a string, see if it has parameter matches, and if so, try to make the substitutions.\n var getValue = function (fromString) {\n var matches = fromString.match(/(\\${.*?})/g);\n if (matches != null) {\n for (var i = 0; i < matches.length; i++) {\n var val = values[matches[i].substring(2, matches[i].length - 1)] || \"\";\n if (val != null) {\n fromString = fromString.replace(matches[i], val);\n }\n }\n }\n return fromString;\n };\n // process one entry.\n var _one = function (d) {\n if (d != null) {\n if (isString(d)) {\n return getValue(d);\n }\n else if (isFunction(d) && !doNotExpandFunctions && (functionPrefix == null || (d.name || \"\").indexOf(functionPrefix) === 0)) {\n return d(values);\n }\n else if (isArray(d)) {\n var r = [];\n for (var i = 0; i < d.length; i++) {\n r.push(_one(d[i]));\n }\n return r;\n }\n else if (isObject(d)) {\n var s = {};\n for (var j in d) {\n s[j] = _one(d[j]);\n }\n return s;\n }\n else {\n return d;\n }\n }\n };\n return _one(model);\n }\n jsPlumbUtil.populate = populate;\n function findWithFunction(a, f) {\n if (a) {\n for (var i = 0; i < a.length; i++) {\n if (f(a[i])) {\n return i;\n }\n }\n }\n return -1;\n }\n jsPlumbUtil.findWithFunction = findWithFunction;\n function removeWithFunction(a, f) {\n var idx = findWithFunction(a, f);\n if (idx > -1) {\n a.splice(idx, 1);\n }\n return idx !== -1;\n }\n jsPlumbUtil.removeWithFunction = removeWithFunction;\n function remove(l, v) {\n var idx = l.indexOf(v);\n if (idx > -1) {\n l.splice(idx, 1);\n }\n return idx !== -1;\n }\n jsPlumbUtil.remove = remove;\n function addWithFunction(list, item, hashFunction) {\n if (findWithFunction(list, hashFunction) === -1) {\n list.push(item);\n }\n }\n jsPlumbUtil.addWithFunction = addWithFunction;\n function addToList(map, key, value, insertAtStart) {\n var l = map[key];\n if (l == null) {\n l = [];\n map[key] = l;\n }\n l[insertAtStart ? \"unshift\" : \"push\"](value);\n return l;\n }\n jsPlumbUtil.addToList = addToList;\n function suggest(list, item, insertAtHead) {\n if (list.indexOf(item) === -1) {\n if (insertAtHead) {\n list.unshift(item);\n }\n else {\n list.push(item);\n }\n return true;\n }\n return false;\n }\n jsPlumbUtil.suggest = suggest;\n //\n // extends the given obj (which can be an array) with the given constructor function, prototype functions, and\n // class members, any of which may be null.\n //\n function extend(child, parent, _protoFn) {\n var i;\n parent = isArray(parent) ? parent : [parent];\n var _copyProtoChain = function (focus) {\n var proto = focus.__proto__;\n while (proto != null) {\n if (proto.prototype != null) {\n for (var j in proto.prototype) {\n if (proto.prototype.hasOwnProperty(j) && !child.prototype.hasOwnProperty(j)) {\n child.prototype[j] = proto.prototype[j];\n }\n }\n proto = proto.prototype.__proto__;\n }\n else {\n proto = null;\n }\n }\n };\n for (i = 0; i < parent.length; i++) {\n for (var j in parent[i].prototype) {\n if (parent[i].prototype.hasOwnProperty(j) && !child.prototype.hasOwnProperty(j)) {\n child.prototype[j] = parent[i].prototype[j];\n }\n }\n _copyProtoChain(parent[i]);\n }\n var _makeFn = function (name, protoFn) {\n return function () {\n for (i = 0; i < parent.length; i++) {\n if (parent[i].prototype[name]) {\n parent[i].prototype[name].apply(this, arguments);\n }\n }\n return protoFn.apply(this, arguments);\n };\n };\n var _oneSet = function (fns) {\n for (var k in fns) {\n child.prototype[k] = _makeFn(k, fns[k]);\n }\n };\n if (arguments.length > 2) {\n for (i = 2; i < arguments.length; i++) {\n _oneSet(arguments[i]);\n }\n }\n return child;\n }\n jsPlumbUtil.extend = extend;\n function uuid() {\n return ('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n }));\n }\n jsPlumbUtil.uuid = uuid;\n function fastTrim(s) {\n if (s == null) {\n return null;\n }\n var str = s.replace(/^\\s\\s*/, ''), ws = /\\s/, i = str.length;\n while (ws.test(str.charAt(--i))) {\n }\n return str.slice(0, i + 1);\n }\n jsPlumbUtil.fastTrim = fastTrim;\n function each(obj, fn) {\n obj = obj.length == null || typeof obj === \"string\" ? [obj] : obj;\n for (var i = 0; i < obj.length; i++) {\n fn(obj[i]);\n }\n }\n jsPlumbUtil.each = each;\n function map(obj, fn) {\n var o = [];\n for (var i = 0; i < obj.length; i++) {\n o.push(fn(obj[i]));\n }\n return o;\n }\n jsPlumbUtil.map = map;\n function mergeWithParents(type, map, parentAttribute) {\n parentAttribute = parentAttribute || \"parent\";\n var _def = function (id) {\n return id ? map[id] : null;\n };\n var _parent = function (def) {\n return def ? _def(def[parentAttribute]) : null;\n };\n var _one = function (parent, def) {\n if (parent == null) {\n return def;\n }\n else {\n var d_1 = merge(parent, def);\n return _one(_parent(parent), d_1);\n }\n };\n var _getDef = function (t) {\n if (t == null) {\n return {};\n }\n if (typeof t === \"string\") {\n return _def(t);\n }\n else if (t.length) {\n var done = false, i = 0, _dd = void 0;\n while (!done && i < t.length) {\n _dd = _getDef(t[i]);\n if (_dd) {\n done = true;\n }\n else {\n i++;\n }\n }\n return _dd;\n }\n };\n var d = _getDef(type);\n if (d) {\n return _one(_parent(d), d);\n }\n else {\n return {};\n }\n }\n jsPlumbUtil.mergeWithParents = mergeWithParents;\n jsPlumbUtil.logEnabled = true;\n function log() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (jsPlumbUtil.logEnabled && typeof console !== \"undefined\") {\n try {\n var msg = arguments[arguments.length - 1];\n console.log(msg);\n }\n catch (e) {\n }\n }\n }\n jsPlumbUtil.log = log;\n /**\n * Wraps one function with another, creating a placeholder for the\n * wrapped function if it was null. this is used to wrap the various\n * drag/drop event functions - to allow jsPlumb to be notified of\n * important lifecycle events without imposing itself on the user's\n * drag/drop functionality.\n * @method jsPlumbUtil.wrap\n * @param {Function} wrappedFunction original function to wrap; may be null.\n * @param {Function} newFunction function to wrap the original with.\n * @param {Object} [returnOnThisValue] Optional. Indicates that the wrappedFunction should\n * not be executed if the newFunction returns a value matching 'returnOnThisValue'.\n * note that this is a simple comparison and only works for primitives right now.\n */\n function wrap(wrappedFunction, newFunction, returnOnThisValue) {\n return function () {\n var r = null;\n try {\n if (newFunction != null) {\n r = newFunction.apply(this, arguments);\n }\n }\n catch (e) {\n log(\"jsPlumb function failed : \" + e);\n }\n if ((wrappedFunction != null) && (returnOnThisValue == null || (r !== returnOnThisValue))) {\n try {\n r = wrappedFunction.apply(this, arguments);\n }\n catch (e) {\n log(\"wrapped function failed : \" + e);\n }\n }\n return r;\n };\n }\n jsPlumbUtil.wrap = wrap;\n var EventGenerator = /** @class */ (function () {\n function EventGenerator() {\n var _this = this;\n this._listeners = {};\n this.eventsSuspended = false;\n this.tick = false;\n // this is a list of events that should re-throw any errors that occur during their dispatch.\n this.eventsToDieOn = { \"ready\": true };\n this.queue = [];\n this.bind = function (event, listener, insertAtStart) {\n var _one = function (evt) {\n addToList(_this._listeners, evt, listener, insertAtStart);\n listener.__jsPlumb = listener.__jsPlumb || {};\n listener.__jsPlumb[uuid()] = evt;\n };\n if (typeof event === \"string\") {\n _one(event);\n }\n else if (event.length != null) {\n for (var i = 0; i < event.length; i++) {\n _one(event[i]);\n }\n }\n return _this;\n };\n this.fire = function (event, value, originalEvent) {\n if (!this.tick) {\n this.tick = true;\n if (!this.eventsSuspended && this._listeners[event]) {\n var l = this._listeners[event].length, i = 0, _gone = false, ret = null;\n if (!this.shouldFireEvent || this.shouldFireEvent(event, value, originalEvent)) {\n while (!_gone && i < l && ret !== false) {\n // doing it this way rather than catching and then possibly re-throwing means that an error propagated by this\n // method will have the whole call stack available in the debugger.\n if (this.eventsToDieOn[event]) {\n this._listeners[event][i].apply(this, [value, originalEvent]);\n }\n else {\n try {\n ret = this._listeners[event][i].apply(this, [value, originalEvent]);\n }\n catch (e) {\n log(\"jsPlumb: fire failed for event \" + event + \" : \" + e);\n }\n }\n i++;\n if (this._listeners == null || this._listeners[event] == null) {\n _gone = true;\n }\n }\n }\n }\n this.tick = false;\n this._drain();\n }\n else {\n this.queue.unshift(arguments);\n }\n return this;\n };\n this._drain = function () {\n var n = _this.queue.pop();\n if (n) {\n _this.fire.apply(_this, n);\n }\n };\n this.unbind = function (eventOrListener, listener) {\n if (arguments.length === 0) {\n this._listeners = {};\n }\n else if (arguments.length === 1) {\n if (typeof eventOrListener === \"string\") {\n delete this._listeners[eventOrListener];\n }\n else if (eventOrListener.__jsPlumb) {\n var evt = void 0;\n for (var i in eventOrListener.__jsPlumb) {\n evt = eventOrListener.__jsPlumb[i];\n remove(this._listeners[evt] || [], eventOrListener);\n }\n }\n }\n else if (arguments.length === 2) {\n remove(this._listeners[eventOrListener] || [], listener);\n }\n return this;\n };\n this.getListener = function (forEvent) {\n return _this._listeners[forEvent];\n };\n this.setSuspendEvents = function (val) {\n _this.eventsSuspended = val;\n };\n this.isSuspendEvents = function () {\n return _this.eventsSuspended;\n };\n this.silently = function (fn) {\n _this.setSuspendEvents(true);\n try {\n fn();\n }\n catch (e) {\n log(\"Cannot execute silent function \" + e);\n }\n _this.setSuspendEvents(false);\n };\n this.cleanupListeners = function () {\n for (var i in _this._listeners) {\n _this._listeners[i] = null;\n }\n };\n }\n return EventGenerator;\n }());\n jsPlumbUtil.EventGenerator = EventGenerator;\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains utility functions that run in browsers only.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n ;(function() {\n\n \"use strict\";\n\n var root = this;\n\n root.jsPlumbUtil.matchesSelector = function(el, selector, ctx) {\n ctx = ctx || el.parentNode;\n var possibles = ctx.querySelectorAll(selector);\n for (var i = 0; i < possibles.length; i++) {\n if (possibles[i] === el) {\n return true;\n }\n }\n return false;\n };\n\n root.jsPlumbUtil.consume = function(e, doNotPreventDefault) {\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n else {\n e.returnValue = false;\n }\n\n if (!doNotPreventDefault && e.preventDefault){\n e.preventDefault();\n }\n };\n\n /*\n * Function: sizeElement\n * Helper to size and position an element. You would typically use\n * this when writing your own Connector or Endpoint implementation.\n *\n * Parameters:\n * x - [int] x position for the element origin\n * y - [int] y position for the element origin\n * w - [int] width of the element\n * h - [int] height of the element\n *\n */\n root.jsPlumbUtil.sizeElement = function(el, x, y, w, h) {\n if (el) {\n el.style.height = h + \"px\";\n el.height = h;\n el.style.width = w + \"px\";\n el.width = w;\n el.style.left = x + \"px\";\n el.style.top = y + \"px\";\n }\n };\n\n }).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the core code.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function () {\n\n \"use strict\";\n\n var root = this;\n\n var _ju = root.jsPlumbUtil,\n\n /**\n * creates a timestamp, using milliseconds since 1970, but as a string.\n */\n _timestamp = function () {\n return \"\" + (new Date()).getTime();\n },\n\n // helper method to update the hover style whenever it, or paintStyle, changes.\n // we use paintStyle as the foundation and merge hoverPaintStyle over the\n // top.\n _updateHoverStyle = function (component) {\n if (component._jsPlumb.paintStyle && component._jsPlumb.hoverPaintStyle) {\n var mergedHoverStyle = {};\n jsPlumb.extend(mergedHoverStyle, component._jsPlumb.paintStyle);\n jsPlumb.extend(mergedHoverStyle, component._jsPlumb.hoverPaintStyle);\n delete component._jsPlumb.hoverPaintStyle;\n // we want the fill of paintStyle to override a gradient, if possible.\n if (mergedHoverStyle.gradient && component._jsPlumb.paintStyle.fill) {\n delete mergedHoverStyle.gradient;\n }\n component._jsPlumb.hoverPaintStyle = mergedHoverStyle;\n }\n },\n events = [\"tap\", \"dbltap\", \"click\", \"dblclick\", \"mouseover\", \"mouseout\", \"mousemove\", \"mousedown\", \"mouseup\", \"contextmenu\" ],\n eventFilters = { \"mouseout\": \"mouseleave\", \"mouseexit\": \"mouseleave\" },\n _updateAttachedElements = function (component, state, timestamp, sourceElement) {\n var affectedElements = component.getAttachedElements();\n if (affectedElements) {\n for (var i = 0, j = affectedElements.length; i < j; i++) {\n if (!sourceElement || sourceElement !== affectedElements[i]) {\n affectedElements[i].setHover(state, true, timestamp);\t\t\t// tell the attached elements not to inform their own attached elements.\n }\n }\n }\n },\n _splitType = function (t) {\n return t == null ? null : t.split(\" \");\n },\n _mapType = function(map, obj, typeId) {\n for (var i in obj) {\n map[i] = typeId;\n }\n },\n _each = function(fn, obj) {\n obj = _ju.isArray(obj) || (obj.length != null && !_ju.isString(obj)) ? obj : [ obj ];\n for (var i = 0; i < obj.length; i++) {\n try {\n fn.apply(obj[i], [ obj[i] ]);\n }\n catch (e) {\n _ju.log(\".each iteration failed : \" + e);\n }\n }\n },\n _applyTypes = function (component, params, doNotRepaint) {\n if (component.getDefaultType) {\n var td = component.getTypeDescriptor(), map = {};\n var defType = component.getDefaultType();\n var o = _ju.merge({}, defType);\n _mapType(map, defType, \"__default\");\n for (var i = 0, j = component._jsPlumb.types.length; i < j; i++) {\n var tid = component._jsPlumb.types[i];\n if (tid !== \"__default\") {\n var _t = component._jsPlumb.instance.getType(tid, td);\n if (_t != null) {\n o = _ju.merge(o, _t, [ \"cssClass\" ], [ \"connector\" ]);\n _mapType(map, _t, tid);\n }\n }\n }\n\n if (params) {\n o = _ju.populate(o, params, \"_\");\n }\n\n component.applyType(o, doNotRepaint, map);\n if (!doNotRepaint) {\n component.repaint();\n }\n }\n },\n\n// ------------------------------ BEGIN jsPlumbUIComponent --------------------------------------------\n\n jsPlumbUIComponent = root.jsPlumbUIComponent = function (params) {\n\n _ju.EventGenerator.apply(this, arguments);\n\n var self = this,\n a = arguments,\n idPrefix = self.idPrefix,\n id = idPrefix + (new Date()).getTime();\n\n this._jsPlumb = {\n instance: params._jsPlumb,\n parameters: params.parameters || {},\n paintStyle: null,\n hoverPaintStyle: null,\n paintStyleInUse: null,\n hover: false,\n beforeDetach: params.beforeDetach,\n beforeDrop: params.beforeDrop,\n overlayPlacements: [],\n hoverClass: params.hoverClass || params._jsPlumb.Defaults.HoverClass,\n types: [],\n typeCache:{}\n };\n\n this.cacheTypeItem = function(key, item, typeId) {\n this._jsPlumb.typeCache[typeId] = this._jsPlumb.typeCache[typeId] || {};\n this._jsPlumb.typeCache[typeId][key] = item;\n };\n this.getCachedTypeItem = function(key, typeId) {\n return this._jsPlumb.typeCache[typeId] ? this._jsPlumb.typeCache[typeId][key] : null;\n };\n\n this.getId = function () {\n return id;\n };\n\n// ----------------------------- default type --------------------------------------------\n\n\n var o = params.overlays || [], oo = {};\n if (this.defaultOverlayKeys) {\n for (var i = 0; i < this.defaultOverlayKeys.length; i++) {\n Array.prototype.push.apply(o, this._jsPlumb.instance.Defaults[this.defaultOverlayKeys[i]] || []);\n }\n\n for (i = 0; i < o.length; i++) {\n // if a string, convert to object representation so that we can store the typeid on it.\n // also assign an id.\n var fo = jsPlumb.convertToFullOverlaySpec(o[i]);\n oo[fo[1].id] = fo;\n }\n }\n\n var _defaultType = {\n overlays:oo,\n parameters: params.parameters || {},\n scope: params.scope || this._jsPlumb.instance.getDefaultScope()\n };\n this.getDefaultType = function() {\n return _defaultType;\n };\n this.appendToDefaultType = function(obj) {\n for (var i in obj) {\n _defaultType[i] = obj[i];\n }\n };\n\n// ----------------------------- end default type --------------------------------------------\n\n // all components can generate events\n\n if (params.events) {\n for (var evtName in params.events) {\n self.bind(evtName, params.events[evtName]);\n }\n }\n\n // all components get this clone function.\n // TODO issue 116 showed a problem with this - it seems 'a' that is in\n // the clone function's scope is shared by all invocations of it, the classic\n // JS closure problem. for now, jsPlumb does a version of this inline where\n // it used to call clone. but it would be nice to find some time to look\n // further at this.\n this.clone = function () {\n var o = Object.create(this.constructor.prototype);\n this.constructor.apply(o, a);\n return o;\n }.bind(this);\n\n // user can supply a beforeDetach callback, which will be executed before a detach\n // is performed; returning false prevents the detach.\n this.isDetachAllowed = function (connection) {\n var r = true;\n if (this._jsPlumb.beforeDetach) {\n try {\n r = this._jsPlumb.beforeDetach(connection);\n }\n catch (e) {\n _ju.log(\"jsPlumb: beforeDetach callback failed\", e);\n }\n }\n return r;\n };\n\n // user can supply a beforeDrop callback, which will be executed before a dropped\n // connection is confirmed. user can return false to reject connection.\n this.isDropAllowed = function (sourceId, targetId, scope, connection, dropEndpoint, source, target) {\n var r = this._jsPlumb.instance.checkCondition(\"beforeDrop\", {\n sourceId: sourceId,\n targetId: targetId,\n scope: scope,\n connection: connection,\n dropEndpoint: dropEndpoint,\n source: source, target: target\n });\n if (this._jsPlumb.beforeDrop) {\n try {\n r = this._jsPlumb.beforeDrop({\n sourceId: sourceId,\n targetId: targetId,\n scope: scope,\n connection: connection,\n dropEndpoint: dropEndpoint,\n source: source, target: target\n });\n }\n catch (e) {\n _ju.log(\"jsPlumb: beforeDrop callback failed\", e);\n }\n }\n return r;\n };\n\n var domListeners = [];\n\n // sets the component associated with listener events. for instance, an overlay delegates\n // its events back to a connector. but if the connector is swapped on the underlying connection,\n // then this component must be changed. This is called by setConnector in the Connection class.\n this.setListenerComponent = function (c) {\n for (var i = 0; i < domListeners.length; i++) {\n domListeners[i][3] = c;\n }\n };\n\n\n };\n\n var _removeTypeCssHelper = function (component, typeIndex) {\n var typeId = component._jsPlumb.types[typeIndex],\n type = component._jsPlumb.instance.getType(typeId, component.getTypeDescriptor());\n\n if (type != null && type.cssClass && component.canvas) {\n component._jsPlumb.instance.removeClass(component.canvas, type.cssClass);\n }\n };\n\n _ju.extend(root.jsPlumbUIComponent, _ju.EventGenerator, {\n\n getParameter: function (name) {\n return this._jsPlumb.parameters[name];\n },\n\n setParameter: function (name, value) {\n this._jsPlumb.parameters[name] = value;\n },\n\n getParameters: function () {\n return this._jsPlumb.parameters;\n },\n\n setParameters: function (p) {\n this._jsPlumb.parameters = p;\n },\n\n getClass:function() {\n return jsPlumb.getClass(this.canvas);\n },\n\n hasClass:function(clazz) {\n return jsPlumb.hasClass(this.canvas, clazz);\n },\n\n addClass: function (clazz) {\n jsPlumb.addClass(this.canvas, clazz);\n },\n\n removeClass: function (clazz) {\n jsPlumb.removeClass(this.canvas, clazz);\n },\n\n updateClasses: function (classesToAdd, classesToRemove) {\n jsPlumb.updateClasses(this.canvas, classesToAdd, classesToRemove);\n },\n\n setType: function (typeId, params, doNotRepaint) {\n this.clearTypes();\n this._jsPlumb.types = _splitType(typeId) || [];\n _applyTypes(this, params, doNotRepaint);\n },\n\n getType: function () {\n return this._jsPlumb.types;\n },\n\n reapplyTypes: function (params, doNotRepaint) {\n _applyTypes(this, params, doNotRepaint);\n },\n\n hasType: function (typeId) {\n return this._jsPlumb.types.indexOf(typeId) !== -1;\n },\n\n addType: function (typeId, params, doNotRepaint) {\n var t = _splitType(typeId), _cont = false;\n if (t != null) {\n for (var i = 0, j = t.length; i < j; i++) {\n if (!this.hasType(t[i])) {\n this._jsPlumb.types.push(t[i]);\n _cont = true;\n }\n }\n if (_cont) {\n _applyTypes(this, params, doNotRepaint);\n }\n }\n },\n\n removeType: function (typeId, params, doNotRepaint) {\n var t = _splitType(typeId), _cont = false, _one = function (tt) {\n var idx = this._jsPlumb.types.indexOf(tt);\n if (idx !== -1) {\n // remove css class if necessary\n _removeTypeCssHelper(this, idx);\n this._jsPlumb.types.splice(idx, 1);\n return true;\n }\n return false;\n }.bind(this);\n\n if (t != null) {\n for (var i = 0, j = t.length; i < j; i++) {\n _cont = _one(t[i]) || _cont;\n }\n if (_cont) {\n _applyTypes(this, params, doNotRepaint);\n }\n }\n },\n clearTypes: function (params, doNotRepaint) {\n var i = this._jsPlumb.types.length;\n for (var j = 0; j < i; j++) {\n _removeTypeCssHelper(this, 0);\n this._jsPlumb.types.splice(0, 1);\n }\n _applyTypes(this, params, doNotRepaint);\n },\n\n toggleType: function (typeId, params, doNotRepaint) {\n var t = _splitType(typeId);\n if (t != null) {\n for (var i = 0, j = t.length; i < j; i++) {\n var idx = this._jsPlumb.types.indexOf(t[i]);\n if (idx !== -1) {\n _removeTypeCssHelper(this, idx);\n this._jsPlumb.types.splice(idx, 1);\n }\n else {\n this._jsPlumb.types.push(t[i]);\n }\n }\n\n _applyTypes(this, params, doNotRepaint);\n }\n },\n applyType: function (t, doNotRepaint) {\n this.setPaintStyle(t.paintStyle, doNotRepaint);\n this.setHoverPaintStyle(t.hoverPaintStyle, doNotRepaint);\n if (t.parameters) {\n for (var i in t.parameters) {\n this.setParameter(i, t.parameters[i]);\n }\n }\n this._jsPlumb.paintStyleInUse = this.getPaintStyle();\n },\n setPaintStyle: function (style, doNotRepaint) {\n // this._jsPlumb.paintStyle = jsPlumb.extend({}, style);\n // TODO figure out if we want components to clone paintStyle so as not to share it.\n this._jsPlumb.paintStyle = style;\n this._jsPlumb.paintStyleInUse = this._jsPlumb.paintStyle;\n _updateHoverStyle(this);\n if (!doNotRepaint) {\n this.repaint();\n }\n },\n getPaintStyle: function () {\n return this._jsPlumb.paintStyle;\n },\n setHoverPaintStyle: function (style, doNotRepaint) {\n //this._jsPlumb.hoverPaintStyle = jsPlumb.extend({}, style);\n // TODO figure out if we want components to clone paintStyle so as not to share it.\n this._jsPlumb.hoverPaintStyle = style;\n _updateHoverStyle(this);\n if (!doNotRepaint) {\n this.repaint();\n }\n },\n getHoverPaintStyle: function () {\n return this._jsPlumb.hoverPaintStyle;\n },\n destroy: function (force) {\n if (force || this.typeId == null) {\n this.cleanupListeners(); // this is on EventGenerator\n this.clone = null;\n this._jsPlumb = null;\n }\n },\n\n isHover: function () {\n return this._jsPlumb.hover;\n },\n\n setHover: function (hover, ignoreAttachedElements, timestamp) {\n // while dragging, we ignore these events. this keeps the UI from flashing and\n // swishing and whatevering.\n if (this._jsPlumb && !this._jsPlumb.instance.currentlyDragging && !this._jsPlumb.instance.isHoverSuspended()) {\n\n this._jsPlumb.hover = hover;\n var method = hover ? \"addClass\" : \"removeClass\";\n\n if (this.canvas != null) {\n if (this._jsPlumb.instance.hoverClass != null) {\n this._jsPlumb.instance[method](this.canvas, this._jsPlumb.instance.hoverClass);\n }\n if (this._jsPlumb.hoverClass != null) {\n this._jsPlumb.instance[method](this.canvas, this._jsPlumb.hoverClass);\n }\n }\n if (this._jsPlumb.hoverPaintStyle != null) {\n this._jsPlumb.paintStyleInUse = hover ? this._jsPlumb.hoverPaintStyle : this._jsPlumb.paintStyle;\n if (!this._jsPlumb.instance.isSuspendDrawing()) {\n timestamp = timestamp || _timestamp();\n this.repaint({timestamp: timestamp, recalc: false});\n }\n }\n // get the list of other affected elements, if supported by this component.\n // for a connection, its the endpoints. for an endpoint, its the connections! surprise.\n if (this.getAttachedElements && !ignoreAttachedElements) {\n _updateAttachedElements(this, hover, _timestamp(), this);\n }\n }\n }\n });\n\n// ------------------------------ END jsPlumbUIComponent --------------------------------------------\n\n var _jsPlumbInstanceIndex = 0,\n getInstanceIndex = function () {\n var i = _jsPlumbInstanceIndex + 1;\n _jsPlumbInstanceIndex++;\n return i;\n };\n\n var jsPlumbInstance = root.jsPlumbInstance = function (_defaults) {\n\n this.version = \"2.9.0\";\n\n this.Defaults = {\n Anchor: \"Bottom\",\n Anchors: [ null, null ],\n ConnectionsDetachable: true,\n ConnectionOverlays: [ ],\n Connector: \"Bezier\",\n Container: null,\n DoNotThrowErrors: false,\n DragOptions: { },\n DropOptions: { },\n Endpoint: \"Dot\",\n EndpointOverlays: [ ],\n Endpoints: [ null, null ],\n EndpointStyle: { fill: \"#456\" },\n EndpointStyles: [ null, null ],\n EndpointHoverStyle: null,\n EndpointHoverStyles: [ null, null ],\n HoverPaintStyle: null,\n LabelStyle: { color: \"black\" },\n LogEnabled: false,\n Overlays: [ ],\n MaxConnections: 1,\n PaintStyle: { \"stroke-width\": 4, stroke: \"#456\" },\n ReattachConnections: false,\n RenderMode: \"svg\",\n Scope: \"jsPlumb_DefaultScope\"\n };\n\n if (_defaults) {\n jsPlumb.extend(this.Defaults, _defaults);\n }\n\n this.logEnabled = this.Defaults.LogEnabled;\n this._connectionTypes = {};\n this._endpointTypes = {};\n\n _ju.EventGenerator.apply(this);\n\n var _currentInstance = this,\n _instanceIndex = getInstanceIndex(),\n _bb = _currentInstance.bind,\n _initialDefaults = {},\n _zoom = 1,\n _info = function (el) {\n if (el == null) {\n return null;\n }\n else if (el.nodeType === 3 || el.nodeType === 8) {\n return { el:el, text:true };\n }\n else {\n var _el = _currentInstance.getElement(el);\n return { el: _el, id: (_ju.isString(el) && _el == null) ? el : _getId(_el) };\n }\n };\n\n this.getInstanceIndex = function () {\n return _instanceIndex;\n };\n\n // CONVERTED\n this.setZoom = function (z, repaintEverything) {\n _zoom = z;\n _currentInstance.fire(\"zoom\", _zoom);\n if (repaintEverything) {\n _currentInstance.repaintEverything();\n }\n return true;\n };\n // CONVERTED\n this.getZoom = function () {\n return _zoom;\n };\n\n for (var i in this.Defaults) {\n _initialDefaults[i] = this.Defaults[i];\n }\n\n var _container, _containerDelegations = [];\n this.unbindContainer = function() {\n if (_container != null && _containerDelegations.length > 0) {\n for (var i = 0; i < _containerDelegations.length; i++) {\n _currentInstance.off(_container, _containerDelegations[i][0], _containerDelegations[i][1]);\n }\n }\n };\n this.setContainer = function (c) {\n\n this.unbindContainer();\n\n // get container as dom element.\n c = this.getElement(c);\n // move existing connections and endpoints, if any.\n this.select().each(function (conn) {\n conn.moveParent(c);\n });\n this.selectEndpoints().each(function (ep) {\n ep.moveParent(c);\n });\n\n // set container.\n var previousContainer = _container;\n _container = c;\n _containerDelegations.length = 0;\n var eventAliases = {\n \"endpointclick\":\"endpointClick\",\n \"endpointdblclick\":\"endpointDblClick\"\n };\n\n var _oneDelegateHandler = function (id, e, componentType) {\n var t = e.srcElement || e.target,\n jp = (t && t.parentNode ? t.parentNode._jsPlumb : null) || (t ? t._jsPlumb : null) || (t && t.parentNode && t.parentNode.parentNode ? t.parentNode.parentNode._jsPlumb : null);\n if (jp) {\n jp.fire(id, jp, e);\n var alias = componentType ? eventAliases[componentType + id] || id : id;\n // jsplumb also fires every event coming from components/overlays. That's what the test for `jp.component` is for.\n _currentInstance.fire(alias, jp.component || jp, e);\n }\n };\n\n var _addOneDelegate = function(eventId, selector, fn) {\n _containerDelegations.push([eventId, fn]);\n _currentInstance.on(_container, eventId, selector, fn);\n };\n\n // delegate one event on the container to jsplumb elements. it might be possible to\n // abstract this out: each of endpoint, connection and overlay could register themselves with\n // jsplumb as \"component types\" or whatever, and provide a suitable selector. this would be\n // done by the renderer (although admittedly from 2.0 onwards we're not supporting vml anymore)\n var _oneDelegate = function (id) {\n // connections.\n _addOneDelegate(id, \".jtk-connector\", function (e) {\n _oneDelegateHandler(id, e);\n });\n // endpoints. note they can have an enclosing div, or not.\n _addOneDelegate(id, \".jtk-endpoint\", function (e) {\n _oneDelegateHandler(id, e, \"endpoint\");\n });\n // overlays\n _addOneDelegate(id, \".jtk-overlay\", function (e) {\n _oneDelegateHandler(id, e);\n });\n };\n\n for (var i = 0; i < events.length; i++) {\n _oneDelegate(events[i]);\n }\n\n // managed elements\n for (var elId in managedElements) {\n var el = managedElements[elId].el;\n if (el.parentNode === previousContainer) {\n previousContainer.removeChild(el);\n _container.appendChild(el);\n }\n }\n\n };\n this.getContainer = function () {\n return _container;\n };\n\n this.bind = function (event, fn) {\n if (\"ready\" === event && initialized) {\n fn();\n }\n else {\n _bb.apply(_currentInstance, [event, fn]);\n }\n };\n\n _currentInstance.importDefaults = function (d) {\n for (var i in d) {\n _currentInstance.Defaults[i] = d[i];\n }\n if (d.Container) {\n _currentInstance.setContainer(d.Container);\n }\n\n return _currentInstance;\n };\n\n _currentInstance.restoreDefaults = function () {\n _currentInstance.Defaults = jsPlumb.extend({}, _initialDefaults);\n return _currentInstance;\n };\n\n var log = null,\n initialized = false,\n // TODO remove from window scope\n connections = [],\n // map of element id -> endpoint lists. an element can have an arbitrary\n // number of endpoints on it, and not all of them have to be connected\n // to anything.\n endpointsByElement = {},\n endpointsByUUID = {},\n managedElements = {},\n offsets = {},\n offsetTimestamps = {},\n draggableStates = {},\n connectionBeingDragged = false,\n sizes = [],\n _suspendDrawing = false,\n _suspendedAt = null,\n DEFAULT_SCOPE = this.Defaults.Scope,\n _curIdStamp = 1,\n _idstamp = function () {\n return \"\" + _curIdStamp++;\n },\n\n //\n // appends an element to some other element, which is calculated as follows:\n //\n // 1. if Container exists, use that element.\n // 2. if the 'parent' parameter exists, use that.\n // 3. otherwise just use the root element.\n //\n //\n _appendElement = function (el, parent) {\n if (_container) {\n _container.appendChild(el);\n }\n else if (!parent) {\n this.appendToRoot(el);\n }\n else {\n this.getElement(parent).appendChild(el);\n }\n }.bind(this),\n\n //\n // Draws an endpoint and its connections. this is the main entry point into drawing connections as well\n // as endpoints, since jsPlumb is endpoint-centric under the hood.\n //\n // @param element element to draw (of type library specific element object)\n // @param ui UI object from current library's event system. optional.\n // @param timestamp timestamp for this paint cycle. used to speed things up a little by cutting down the amount of offset calculations we do.\n // @param clearEdits defaults to false; indicates that mouse edits for connectors should be cleared\n ///\n _draw = function (element, ui, timestamp, clearEdits) {\n\n if (!_suspendDrawing) {\n var id = _getId(element),\n repaintEls,\n dm = _currentInstance.getDragManager();\n\n if (dm) {\n repaintEls = dm.getElementsForDraggable(id);\n }\n\n if (timestamp == null) {\n timestamp = _timestamp();\n }\n\n // update the offset of everything _before_ we try to draw anything.\n var o = _updateOffset({ elId: id, offset: ui, recalc: false, timestamp: timestamp });\n\n if (repaintEls && o && o.o) {\n for (var i in repaintEls) {\n _updateOffset({\n elId: repaintEls[i].id,\n offset: {\n left: o.o.left + repaintEls[i].offset.left,\n top: o.o.top + repaintEls[i].offset.top\n },\n recalc: false,\n timestamp: timestamp\n });\n }\n }\n\n _currentInstance.anchorManager.redraw(id, ui, timestamp, null, clearEdits);\n\n if (repaintEls) {\n for (var j in repaintEls) {\n _currentInstance.anchorManager.redraw(repaintEls[j].id, ui, timestamp, repaintEls[j].offset, clearEdits, true);\n }\n }\n }\n },\n\n //\n // gets an Endpoint by uuid.\n //\n _getEndpoint = function (uuid) {\n return endpointsByUUID[uuid];\n },\n\n /**\n * inits a draggable if it's not already initialised.\n * TODO: somehow abstract this to the adapter, because the concept of \"draggable\" has no\n * place on the server.\n */\n\n\n _scopeMatch = function (e1, e2) {\n var s1 = e1.scope.split(/\\s/), s2 = e2.scope.split(/\\s/);\n for (var i = 0; i < s1.length; i++) {\n for (var j = 0; j < s2.length; j++) {\n if (s2[j] === s1[i]) {\n return true;\n }\n }\n }\n\n return false;\n },\n\n _mergeOverrides = function (def, values) {\n var m = jsPlumb.extend({}, def);\n for (var i in values) {\n if (values[i]) {\n m[i] = values[i];\n }\n }\n return m;\n },\n\n /*\n * prepares a final params object that can be passed to _newConnection, taking into account defaults, events, etc.\n */\n _prepareConnectionParams = function (params, referenceParams) {\n var _p = jsPlumb.extend({ }, params);\n if (referenceParams) {\n jsPlumb.extend(_p, referenceParams);\n }\n\n // hotwire endpoints passed as source or target to sourceEndpoint/targetEndpoint, respectively.\n if (_p.source) {\n if (_p.source.endpoint) {\n _p.sourceEndpoint = _p.source;\n }\n else {\n _p.source = _currentInstance.getElement(_p.source);\n }\n }\n if (_p.target) {\n if (_p.target.endpoint) {\n _p.targetEndpoint = _p.target;\n }\n else {\n _p.target = _currentInstance.getElement(_p.target);\n }\n }\n\n // test for endpoint uuids to connect\n if (params.uuids) {\n _p.sourceEndpoint = _getEndpoint(params.uuids[0]);\n _p.targetEndpoint = _getEndpoint(params.uuids[1]);\n }\n\n // now ensure that if we do have Endpoints already, they're not full.\n // source:\n if (_p.sourceEndpoint && _p.sourceEndpoint.isFull()) {\n _ju.log(_currentInstance, \"could not add connection; source endpoint is full\");\n return;\n }\n\n // target:\n if (_p.targetEndpoint && _p.targetEndpoint.isFull()) {\n _ju.log(_currentInstance, \"could not add connection; target endpoint is full\");\n return;\n }\n\n // if source endpoint mandates connection type and nothing specified in our params, use it.\n if (!_p.type && _p.sourceEndpoint) {\n _p.type = _p.sourceEndpoint.connectionType;\n }\n\n // copy in any connectorOverlays that were specified on the source endpoint.\n // it doesnt copy target endpoint overlays. i'm not sure if we want it to or not.\n if (_p.sourceEndpoint && _p.sourceEndpoint.connectorOverlays) {\n _p.overlays = _p.overlays || [];\n for (var i = 0, j = _p.sourceEndpoint.connectorOverlays.length; i < j; i++) {\n _p.overlays.push(_p.sourceEndpoint.connectorOverlays[i]);\n }\n }\n\n // scope\n if (_p.sourceEndpoint && _p.sourceEndpoint.scope) {\n _p.scope = _p.sourceEndpoint.scope;\n }\n\n // pointer events\n if (!_p[\"pointer-events\"] && _p.sourceEndpoint && _p.sourceEndpoint.connectorPointerEvents) {\n _p[\"pointer-events\"] = _p.sourceEndpoint.connectorPointerEvents;\n }\n\n\n var _addEndpoint = function (el, def, idx) {\n return _currentInstance.addEndpoint(el, _mergeOverrides(def, {\n anchor: _p.anchors ? _p.anchors[idx] : _p.anchor,\n endpoint: _p.endpoints ? _p.endpoints[idx] : _p.endpoint,\n paintStyle: _p.endpointStyles ? _p.endpointStyles[idx] : _p.endpointStyle,\n hoverPaintStyle: _p.endpointHoverStyles ? _p.endpointHoverStyles[idx] : _p.endpointHoverStyle\n }));\n };\n\n // check for makeSource/makeTarget specs.\n\n var _oneElementDef = function (type, idx, defs, matchType) {\n if (_p[type] && !_p[type].endpoint && !_p[type + \"Endpoint\"] && !_p.newConnection) {\n var tid = _getId(_p[type]), tep = defs[tid];\n\n tep = tep ? tep[matchType] : null;\n\n if (tep) {\n // if not enabled, return.\n if (!tep.enabled) {\n return false;\n }\n var newEndpoint = tep.endpoint != null && tep.endpoint._jsPlumb ? tep.endpoint : _addEndpoint(_p[type], tep.def, idx);\n if (newEndpoint.isFull()) {\n return false;\n }\n _p[type + \"Endpoint\"] = newEndpoint;\n if (!_p.scope && tep.def.scope) {\n _p.scope = tep.def.scope;\n } // provide scope if not already provided and endpoint def has one.\n if (tep.uniqueEndpoint) {\n if (!tep.endpoint) {\n tep.endpoint = newEndpoint;\n newEndpoint.setDeleteOnEmpty(false);\n }\n else {\n newEndpoint.finalEndpoint = tep.endpoint;\n }\n } else {\n newEndpoint.setDeleteOnEmpty(true);\n }\n\n //\n // copy in connector overlays if present on the source definition.\n //\n if (idx === 0 && tep.def.connectorOverlays) {\n _p.overlays = _p.overlays || [];\n Array.prototype.push.apply(_p.overlays, tep.def.connectorOverlays);\n }\n }\n }\n };\n\n if (_oneElementDef(\"source\", 0, this.sourceEndpointDefinitions, _p.type || \"default\") === false) {\n return;\n }\n if (_oneElementDef(\"target\", 1, this.targetEndpointDefinitions, _p.type || \"default\") === false) {\n return;\n }\n\n // last, ensure scopes match\n if (_p.sourceEndpoint && _p.targetEndpoint) {\n if (!_scopeMatch(_p.sourceEndpoint, _p.targetEndpoint)) {\n _p = null;\n }\n }\n\n return _p;\n }.bind(_currentInstance),\n\n _newConnection = function (params) {\n var connectionFunc = _currentInstance.Defaults.ConnectionType || _currentInstance.getDefaultConnectionType();\n\n params._jsPlumb = _currentInstance;\n params.newConnection = _newConnection;\n params.newEndpoint = _newEndpoint;\n params.endpointsByUUID = endpointsByUUID;\n params.endpointsByElement = endpointsByElement;\n params.finaliseConnection = _finaliseConnection;\n params.id = \"con_\" + _idstamp();\n var con = new connectionFunc(params);\n\n // if the connection is draggable, then maybe we need to tell the target endpoint to init the\n // dragging code. it won't run again if it already configured to be draggable.\n if (con.isDetachable()) {\n con.endpoints[0].initDraggable(\"_jsPlumbSource\");\n con.endpoints[1].initDraggable(\"_jsPlumbTarget\");\n }\n\n return con;\n },\n\n //\n // adds the connection to the backing model, fires an event if necessary and then redraws\n //\n _finaliseConnection = _currentInstance.finaliseConnection = function (jpc, params, originalEvent, doInformAnchorManager) {\n params = params || {};\n // add to list of connections (by scope).\n if (!jpc.suspendedEndpoint) {\n connections.push(jpc);\n }\n\n jpc.pending = null;\n\n // turn off isTemporarySource on the source endpoint (only viable on first draw)\n jpc.endpoints[0].isTemporarySource = false;\n\n // always inform the anchor manager\n // except that if jpc has a suspended endpoint it's not true to say the\n // connection is new; it has just (possibly) moved. the question is whether\n // to make that call here or in the anchor manager. i think perhaps here.\n if (doInformAnchorManager !== false) {\n _currentInstance.anchorManager.newConnection(jpc);\n }\n\n // force a paint\n _draw(jpc.source);\n\n // fire an event\n if (!params.doNotFireConnectionEvent && params.fireEvent !== false) {\n\n var eventArgs = {\n connection: jpc,\n source: jpc.source, target: jpc.target,\n sourceId: jpc.sourceId, targetId: jpc.targetId,\n sourceEndpoint: jpc.endpoints[0], targetEndpoint: jpc.endpoints[1]\n };\n\n _currentInstance.fire(\"connection\", eventArgs, originalEvent);\n }\n },\n\n /*\n factory method to prepare a new endpoint. this should always be used instead of creating Endpoints\n manually, since this method attaches event listeners and an id.\n */\n _newEndpoint = function (params, id) {\n var endpointFunc = _currentInstance.Defaults.EndpointType || jsPlumb.Endpoint;\n var _p = jsPlumb.extend({}, params);\n _p._jsPlumb = _currentInstance;\n _p.newConnection = _newConnection;\n _p.newEndpoint = _newEndpoint;\n _p.endpointsByUUID = endpointsByUUID;\n _p.endpointsByElement = endpointsByElement;\n _p.fireDetachEvent = fireDetachEvent;\n _p.elementId = id || _getId(_p.source);\n var ep = new endpointFunc(_p);\n ep.id = \"ep_\" + _idstamp();\n _manage(_p.elementId, _p.source);\n\n if (!jsPlumb.headless) {\n _currentInstance.getDragManager().endpointAdded(_p.source, id);\n }\n\n return ep;\n },\n\n /*\n * performs the given function operation on all the connections found\n * for the given element id; this means we find all the endpoints for\n * the given element, and then for each endpoint find the connectors\n * connected to it. then we pass each connection in to the given\n * function.\n */\n _operation = function (elId, func, endpointFunc) {\n var endpoints = endpointsByElement[elId];\n if (endpoints && endpoints.length) {\n for (var i = 0, ii = endpoints.length; i < ii; i++) {\n for (var j = 0, jj = endpoints[i].connections.length; j < jj; j++) {\n var retVal = func(endpoints[i].connections[j]);\n // if the function passed in returns true, we exit.\n // most functions return false.\n if (retVal) {\n return;\n }\n }\n if (endpointFunc) {\n endpointFunc(endpoints[i]);\n }\n }\n }\n },\n\n _setDraggable = function (element, draggable) {\n return jsPlumb.each(element, function (el) {\n if (_currentInstance.isDragSupported(el)) {\n draggableStates[_currentInstance.getAttribute(el, \"id\")] = draggable;\n _currentInstance.setElementDraggable(el, draggable);\n }\n });\n },\n /*\n * private method to do the business of hiding/showing.\n *\n * @param el\n * either Id of the element in question or a library specific\n * object for the element.\n * @param state\n * String specifying a value for the css 'display' property\n * ('block' or 'none').\n */\n _setVisible = function (el, state, alsoChangeEndpoints) {\n state = state === \"block\";\n var endpointFunc = null;\n if (alsoChangeEndpoints) {\n endpointFunc = function (ep) {\n ep.setVisible(state, true, true);\n };\n }\n var info = _info(el);\n _operation(info.id, function (jpc) {\n if (state && alsoChangeEndpoints) {\n // this test is necessary because this functionality is new, and i wanted to maintain backwards compatibility.\n // this block will only set a connection to be visible if the other endpoint in the connection is also visible.\n var oidx = jpc.sourceId === info.id ? 1 : 0;\n if (jpc.endpoints[oidx].isVisible()) {\n jpc.setVisible(true);\n }\n }\n else { // the default behaviour for show, and what always happens for hide, is to just set the visibility without getting clever.\n jpc.setVisible(state);\n }\n }, endpointFunc);\n },\n /**\n * private method to do the business of toggling hiding/showing.\n */\n _toggleVisible = function (elId, changeEndpoints) {\n var endpointFunc = null;\n if (changeEndpoints) {\n endpointFunc = function (ep) {\n var state = ep.isVisible();\n ep.setVisible(!state);\n };\n }\n _operation(elId, function (jpc) {\n var state = jpc.isVisible();\n jpc.setVisible(!state);\n }, endpointFunc);\n },\n\n // TODO comparison performance\n _getCachedData = function (elId) {\n var o = offsets[elId];\n if (!o) {\n return _updateOffset({elId: elId});\n }\n else {\n return {o: o, s: sizes[elId]};\n }\n },\n\n /**\n * gets an id for the given element, creating and setting one if\n * necessary. the id is of the form\n *\n * jsPlumb__\n *\n * where \"index in instance\" is a monotonically increasing integer that starts at 0,\n * for each instance. this method is used not only to assign ids to elements that do not\n * have them but also to connections and endpoints.\n */\n _getId = function (element, uuid, doNotCreateIfNotFound) {\n if (_ju.isString(element)) {\n return element;\n }\n if (element == null) {\n return null;\n }\n var id = _currentInstance.getAttribute(element, \"id\");\n if (!id || id === \"undefined\") {\n // check if fixed uuid parameter is given\n if (arguments.length === 2 && arguments[1] !== undefined) {\n id = uuid;\n }\n else if (arguments.length === 1 || (arguments.length === 3 && !arguments[2])) {\n id = \"jsPlumb_\" + _instanceIndex + \"_\" + _idstamp();\n }\n\n if (!doNotCreateIfNotFound) {\n _currentInstance.setAttribute(element, \"id\", id);\n }\n }\n return id;\n };\n\n this.setConnectionBeingDragged = function (v) {\n connectionBeingDragged = v;\n };\n this.isConnectionBeingDragged = function () {\n return connectionBeingDragged;\n };\n\n /**\n * Returns a map of all the elements this jsPlumbInstance is currently managing.\n * @returns {Object} Map of [id-> {el, endpoint[], connection, position}] information.\n */\n this.getManagedElements = function() {\n return managedElements;\n };\n\n this.connectorClass = \"jtk-connector\";\n this.connectorOutlineClass = \"jtk-connector-outline\";\n this.connectedClass = \"jtk-connected\";\n this.hoverClass = \"jtk-hover\";\n this.endpointClass = \"jtk-endpoint\";\n this.endpointConnectedClass = \"jtk-endpoint-connected\";\n this.endpointFullClass = \"jtk-endpoint-full\";\n this.endpointDropAllowedClass = \"jtk-endpoint-drop-allowed\";\n this.endpointDropForbiddenClass = \"jtk-endpoint-drop-forbidden\";\n this.overlayClass = \"jtk-overlay\";\n this.draggingClass = \"jtk-dragging\";// CONVERTED\n this.elementDraggingClass = \"jtk-element-dragging\";// CONVERTED\n this.sourceElementDraggingClass = \"jtk-source-element-dragging\"; // CONVERTED\n this.targetElementDraggingClass = \"jtk-target-element-dragging\";// CONVERTED\n this.endpointAnchorClassPrefix = \"jtk-endpoint-anchor\";\n this.hoverSourceClass = \"jtk-source-hover\";\n this.hoverTargetClass = \"jtk-target-hover\";\n this.dragSelectClass = \"jtk-drag-select\";\n\n this.Anchors = {};\n this.Connectors = { \"svg\": {} };\n this.Endpoints = { \"svg\": {} };\n this.Overlays = { \"svg\": {} } ;\n this.ConnectorRenderers = {};\n this.SVG = \"svg\";\n\n// --------------------------- jsPlumbInstance public API ---------------------------------------------------------\n\n\n this.addEndpoint = function (el, params, referenceParams) {\n referenceParams = referenceParams || {};\n var p = jsPlumb.extend({}, referenceParams);\n jsPlumb.extend(p, params);\n p.endpoint = p.endpoint || _currentInstance.Defaults.Endpoint;\n p.paintStyle = p.paintStyle || _currentInstance.Defaults.EndpointStyle;\n\n var results = [],\n inputs = (_ju.isArray(el) || (el.length != null && !_ju.isString(el))) ? el : [ el ];\n\n for (var i = 0, j = inputs.length; i < j; i++) {\n p.source = _currentInstance.getElement(inputs[i]);\n _ensureContainer(p.source);\n\n var id = _getId(p.source), e = _newEndpoint(p, id);\n\n // ensure element is managed.\n var myOffset = _manage(id, p.source).info.o;\n _ju.addToList(endpointsByElement, id, e);\n\n if (!_suspendDrawing) {\n e.paint({\n anchorLoc: e.anchor.compute({ xy: [ myOffset.left, myOffset.top ], wh: sizes[id], element: e, timestamp: _suspendedAt }),\n timestamp: _suspendedAt\n });\n }\n\n results.push(e);\n }\n\n return results.length === 1 ? results[0] : results;\n };\n\n this.addEndpoints = function (el, endpoints, referenceParams) {\n var results = [];\n for (var i = 0, j = endpoints.length; i < j; i++) {\n var e = _currentInstance.addEndpoint(el, endpoints[i], referenceParams);\n if (_ju.isArray(e)) {\n Array.prototype.push.apply(results, e);\n }\n else {\n results.push(e);\n }\n }\n return results;\n };\n\n this.animate = function (el, properties, options) {\n if (!this.animationSupported) {\n return false;\n }\n\n options = options || {};\n var del = _currentInstance.getElement(el),\n id = _getId(del),\n stepFunction = jsPlumb.animEvents.step,\n completeFunction = jsPlumb.animEvents.complete;\n\n options[stepFunction] = _ju.wrap(options[stepFunction], function () {\n _currentInstance.revalidate(id);\n });\n\n // onComplete repaints, just to make sure everything looks good at the end of the animation.\n options[completeFunction] = _ju.wrap(options[completeFunction], function () {\n _currentInstance.revalidate(id);\n });\n\n _currentInstance.doAnimate(del, properties, options);\n };\n\n /**\n * checks for a listener for the given condition, executing it if found, passing in the given value.\n * condition listeners would have been attached using \"bind\" (which is, you could argue, now overloaded, since\n * firing click events etc is a bit different to what this does). i thought about adding a \"bindCondition\"\n * or something, but decided against it, for the sake of simplicity. jsPlumb will never fire one of these\n * condition events anyway.\n */\n this.checkCondition = function (conditionName, args) {\n var l = _currentInstance.getListener(conditionName),\n r = true;\n\n if (l && l.length > 0) {\n var values = Array.prototype.slice.call(arguments, 1);\n try {\n for (var i = 0, j = l.length; i < j; i++) {\n r = r && l[i].apply(l[i], values);\n }\n }\n catch (e) {\n _ju.log(_currentInstance, \"cannot check condition [\" + conditionName + \"]\" + e);\n }\n }\n return r;\n };\n\n this.connect = function (params, referenceParams) {\n // prepare a final set of parameters to create connection with\n var _p = _prepareConnectionParams(params, referenceParams), jpc;\n // TODO probably a nicer return value if the connection was not made. _prepareConnectionParams\n // will return null (and log something) if either endpoint was full. what would be nicer is to\n // create a dedicated 'error' object.\n if (_p) {\n if (_p.source == null && _p.sourceEndpoint == null) {\n _ju.log(\"Cannot establish connection - source does not exist\");\n return;\n }\n if (_p.target == null && _p.targetEndpoint == null) {\n _ju.log(\"Cannot establish connection - target does not exist\");\n return;\n }\n _ensureContainer(_p.source);\n // create the connection. it is not yet registered\n jpc = _newConnection(_p);\n // now add it the model, fire an event, and redraw\n _finaliseConnection(jpc, _p);\n }\n return jpc;\n };\n\n var stTypes = [\n { el: \"source\", elId: \"sourceId\", epDefs: \"sourceEndpointDefinitions\" },\n { el: \"target\", elId: \"targetId\", epDefs: \"targetEndpointDefinitions\" }\n ];\n\n var _set = function (c, el, idx, doNotRepaint) {\n var ep, _st = stTypes[idx], cId = c[_st.elId], cEl = c[_st.el], sid, sep,\n oldEndpoint = c.endpoints[idx];\n\n var evtParams = {\n index: idx,\n originalSourceId: idx === 0 ? cId : c.sourceId,\n newSourceId: c.sourceId,\n originalTargetId: idx === 1 ? cId : c.targetId,\n newTargetId: c.targetId,\n connection: c\n };\n\n if (el.constructor === jsPlumb.Endpoint) {\n ep = el;\n ep.addConnection(c);\n el = ep.element;\n }\n else {\n sid = _getId(el);\n sep = this[_st.epDefs][sid];\n\n if (sid === c[_st.elId]) {\n ep = null; // dont change source/target if the element is already the one given.\n }\n else if (sep) {\n for (var t in sep) {\n if (!sep[t].enabled) {\n return;\n }\n ep = sep[t].endpoint != null && sep[t].endpoint._jsPlumb ? sep[t].endpoint : this.addEndpoint(el, sep[t].def);\n if (sep[t].uniqueEndpoint) {\n sep[t].endpoint = ep;\n }\n ep.addConnection(c);\n }\n }\n else {\n ep = c.makeEndpoint(idx === 0, el, sid);\n }\n }\n\n if (ep != null) {\n oldEndpoint.detachFromConnection(c);\n c.endpoints[idx] = ep;\n c[_st.el] = ep.element;\n c[_st.elId] = ep.elementId;\n evtParams[idx === 0 ? \"newSourceId\" : \"newTargetId\"] = ep.elementId;\n\n fireMoveEvent(evtParams);\n\n if (!doNotRepaint) {\n c.repaint();\n }\n }\n\n evtParams.element = el;\n return evtParams;\n\n }.bind(this);\n\n this.setSource = function (connection, el, doNotRepaint) {\n var p = _set(connection, el, 0, doNotRepaint);\n this.anchorManager.sourceChanged(p.originalSourceId, p.newSourceId, connection, p.el);\n };\n this.setTarget = function (connection, el, doNotRepaint) {\n var p = _set(connection, el, 1, doNotRepaint);\n this.anchorManager.updateOtherEndpoint(p.originalSourceId, p.originalTargetId, p.newTargetId, connection);\n };\n\n this.deleteEndpoint = function (object, dontUpdateHover, deleteAttachedObjects) {\n var endpoint = (typeof object === \"string\") ? endpointsByUUID[object] : object;\n if (endpoint) {\n _currentInstance.deleteObject({ endpoint: endpoint, dontUpdateHover: dontUpdateHover, deleteAttachedObjects:deleteAttachedObjects });\n }\n return _currentInstance;\n };\n\n this.deleteEveryEndpoint = function () {\n var _is = _currentInstance.setSuspendDrawing(true);\n for (var id in endpointsByElement) {\n var endpoints = endpointsByElement[id];\n if (endpoints && endpoints.length) {\n for (var i = 0, j = endpoints.length; i < j; i++) {\n _currentInstance.deleteEndpoint(endpoints[i], true);\n }\n }\n }\n endpointsByElement = {};\n managedElements = {};\n endpointsByUUID = {};\n offsets = {};\n offsetTimestamps = {};\n _currentInstance.anchorManager.reset();\n var dm = _currentInstance.getDragManager();\n if (dm) {\n dm.reset();\n }\n if (!_is) {\n _currentInstance.setSuspendDrawing(false);\n }\n return _currentInstance;\n };\n\n var fireDetachEvent = function (jpc, doFireEvent, originalEvent) {\n // may have been given a connection, or in special cases, an object\n var connType = _currentInstance.Defaults.ConnectionType || _currentInstance.getDefaultConnectionType(),\n argIsConnection = jpc.constructor === connType,\n params = argIsConnection ? {\n connection: jpc,\n source: jpc.source, target: jpc.target,\n sourceId: jpc.sourceId, targetId: jpc.targetId,\n sourceEndpoint: jpc.endpoints[0], targetEndpoint: jpc.endpoints[1]\n } : jpc;\n\n if (doFireEvent) {\n _currentInstance.fire(\"connectionDetached\", params, originalEvent);\n }\n\n // always fire this. used by internal jsplumb stuff.\n _currentInstance.fire(\"internal.connectionDetached\", params, originalEvent);\n\n _currentInstance.anchorManager.connectionDetached(params);\n };\n\n var fireMoveEvent = _currentInstance.fireMoveEvent = function (params, evt) {\n _currentInstance.fire(\"connectionMoved\", params, evt);\n };\n\n this.unregisterEndpoint = function (endpoint) {\n if (endpoint._jsPlumb.uuid) {\n endpointsByUUID[endpoint._jsPlumb.uuid] = null;\n }\n _currentInstance.anchorManager.deleteEndpoint(endpoint);\n // TODO at least replace this with a removeWithFunction call.\n for (var e in endpointsByElement) {\n var endpoints = endpointsByElement[e];\n if (endpoints) {\n var newEndpoints = [];\n for (var i = 0, j = endpoints.length; i < j; i++) {\n if (endpoints[i] !== endpoint) {\n newEndpoints.push(endpoints[i]);\n }\n }\n\n endpointsByElement[e] = newEndpoints;\n }\n if (endpointsByElement[e].length < 1) {\n delete endpointsByElement[e];\n }\n }\n };\n\n var IS_DETACH_ALLOWED = \"isDetachAllowed\";\n var BEFORE_DETACH = \"beforeDetach\";\n var CHECK_CONDITION = \"checkCondition\";\n\n /**\n * Deletes a Connection.\n * @method deleteConnection\n * @param connection Connection to delete\n * @param {Object} [params] Optional delete parameters\n * @param {Boolean} [params.doNotFireEvent=false] If true, a connection detached event will not be fired. Otherwise one will.\n * @param {Boolean} [params.force=false] If true, the connection will be deleted even if a beforeDetach interceptor tries to stop the deletion.\n * @returns {Boolean} True if the connection was deleted, false otherwise.\n */\n this.deleteConnection = function(connection, params) {\n\n if (connection != null) {\n params = params || {};\n\n if (params.force || _ju.functionChain(true, false, [\n [ connection.endpoints[0], IS_DETACH_ALLOWED, [ connection ] ],\n [ connection.endpoints[1], IS_DETACH_ALLOWED, [ connection ] ],\n [ connection, IS_DETACH_ALLOWED, [ connection ] ],\n [ _currentInstance, CHECK_CONDITION, [ BEFORE_DETACH, connection ] ]\n ])) {\n\n connection.setHover(false);\n fireDetachEvent(connection, !connection.pending && params.fireEvent !== false, params.originalEvent);\n\n connection.endpoints[0].detachFromConnection(connection);\n connection.endpoints[1].detachFromConnection(connection);\n _ju.removeWithFunction(connections, function (_c) {\n return connection.id === _c.id;\n });\n\n connection.cleanup();\n connection.destroy();\n return true;\n }\n }\n return false;\n };\n\n /**\n * Remove all Connections from all elements, but leaves Endpoints in place ((unless a connection is set to auto delete its Endpoints).\n * @method deleteEveryConnection\n * @param {Object} [params] optional params object for the call\n * @param {Boolean} [params.fireEvent=true] Whether or not to fire detach events\n * @param {Boolean} [params.forceDetach=false] If true, this call will ignore any `beforeDetach` interceptors.\n * @returns {Number} The number of connections that were deleted.\n */\n this.deleteEveryConnection = function (params) {\n params = params || {};\n var count = connections.length, deletedCount = 0;\n _currentInstance.batch(function () {\n for (var i = 0; i < count; i++) {\n deletedCount += _currentInstance.deleteConnection(connections[0], params) ? 1 : 0;\n }\n });\n return deletedCount;\n };\n\n /**\n * Removes all an element's Connections.\n * @method deleteConnectionsForElement\n * @param {Object} el Either the id of the element, or a selector for the element.\n * @param {Object} [params] Optional parameters.\n * @param {Boolean} [params.fireEvent=true] Whether or not to fire the detach event.\n * @param {Boolean} [params.forceDetach=false] If true, this call will ignore any `beforeDetach` interceptors.\n * @return {jsPlumbInstance} The current jsPlumb instance.\n */\n this.deleteConnectionsForElement = function (el, params) {\n params = params || {};\n el = _currentInstance.getElement(el);\n var id = _getId(el), endpoints = endpointsByElement[id];\n if (endpoints && endpoints.length) {\n for (var i = 0, j = endpoints.length; i < j; i++) {\n endpoints[i].deleteEveryConnection(params);\n }\n }\n return _currentInstance;\n };\n\n /// not public. but of course its exposed. how to change this.\n this.deleteObject = function (params) {\n var result = {\n endpoints: {},\n connections: {},\n endpointCount: 0,\n connectionCount: 0\n },\n deleteAttachedObjects = params.deleteAttachedObjects !== false;\n\n var unravelConnection = function (connection) {\n if (connection != null && result.connections[connection.id] == null) {\n if (!params.dontUpdateHover && connection._jsPlumb != null) {\n connection.setHover(false);\n }\n result.connections[connection.id] = connection;\n result.connectionCount++;\n }\n };\n var unravelEndpoint = function (endpoint) {\n if (endpoint != null && result.endpoints[endpoint.id] == null) {\n if (!params.dontUpdateHover && endpoint._jsPlumb != null) {\n endpoint.setHover(false);\n }\n result.endpoints[endpoint.id] = endpoint;\n result.endpointCount++;\n\n if (deleteAttachedObjects) {\n for (var i = 0; i < endpoint.connections.length; i++) {\n var c = endpoint.connections[i];\n unravelConnection(c);\n }\n }\n }\n };\n\n if (params.connection) {\n unravelConnection(params.connection);\n }\n else {\n unravelEndpoint(params.endpoint);\n }\n\n // loop through connections\n for (var i in result.connections) {\n var c = result.connections[i];\n if (c._jsPlumb) {\n _ju.removeWithFunction(connections, function (_c) {\n return c.id === _c.id;\n });\n\n fireDetachEvent(c, params.fireEvent === false ? false : !c.pending, params.originalEvent);\n var doNotCleanup = params.deleteAttachedObjects == null ? null : !params.deleteAttachedObjects;\n\n c.endpoints[0].detachFromConnection(c, null, doNotCleanup);\n c.endpoints[1].detachFromConnection(c, null, doNotCleanup);\n\n c.cleanup(true);\n c.destroy(true);\n }\n }\n\n // loop through endpoints\n for (var j in result.endpoints) {\n var e = result.endpoints[j];\n if (e._jsPlumb) {\n _currentInstance.unregisterEndpoint(e);\n // FIRE some endpoint deleted event?\n e.cleanup(true);\n e.destroy(true);\n }\n }\n\n return result;\n };\n\n\n // helpers for select/selectEndpoints\n var _setOperation = function (list, func, args, selector) {\n for (var i = 0, j = list.length; i < j; i++) {\n list[i][func].apply(list[i], args);\n }\n return selector(list);\n },\n _getOperation = function (list, func, args) {\n var out = [];\n for (var i = 0, j = list.length; i < j; i++) {\n out.push([ list[i][func].apply(list[i], args), list[i] ]);\n }\n return out;\n },\n setter = function (list, func, selector) {\n return function () {\n return _setOperation(list, func, arguments, selector);\n };\n },\n getter = function (list, func) {\n return function () {\n return _getOperation(list, func, arguments);\n };\n },\n prepareList = function (input, doNotGetIds) {\n var r = [];\n if (input) {\n if (typeof input === 'string') {\n if (input === \"*\") {\n return input;\n }\n r.push(input);\n }\n else {\n if (doNotGetIds) {\n r = input;\n }\n else {\n if (input.length) {\n for (var i = 0, j = input.length; i < j; i++) {\n r.push(_info(input[i]).id);\n }\n }\n else {\n r.push(_info(input).id);\n }\n }\n }\n }\n return r;\n },\n filterList = function (list, value, missingIsFalse) {\n if (list === \"*\") {\n return true;\n }\n return list.length > 0 ? list.indexOf(value) !== -1 : !missingIsFalse;\n };\n\n // get some connections, specifying source/target/scope\n this.getConnections = function (options, flat) {\n if (!options) {\n options = {};\n } else if (options.constructor === String) {\n options = { \"scope\": options };\n }\n var scope = options.scope || _currentInstance.getDefaultScope(),\n scopes = prepareList(scope, true),\n sources = prepareList(options.source),\n targets = prepareList(options.target),\n results = (!flat && scopes.length > 1) ? {} : [],\n _addOne = function (scope, obj) {\n if (!flat && scopes.length > 1) {\n var ss = results[scope];\n if (ss == null) {\n ss = results[scope] = [];\n }\n ss.push(obj);\n } else {\n results.push(obj);\n }\n };\n\n for (var j = 0, jj = connections.length; j < jj; j++) {\n var c = connections[j],\n sourceId = c.proxies && c.proxies[0] ? c.proxies[0].originalEp.elementId : c.sourceId,\n targetId = c.proxies && c.proxies[1] ? c.proxies[1].originalEp.elementId : c.targetId;\n\n if (filterList(scopes, c.scope) && filterList(sources, sourceId) && filterList(targets, targetId)) {\n _addOne(c.scope, c);\n }\n }\n\n return results;\n };\n\n var _curryEach = function (list, executor) {\n return function (f) {\n for (var i = 0, ii = list.length; i < ii; i++) {\n f(list[i]);\n }\n return executor(list);\n };\n },\n _curryGet = function (list) {\n return function (idx) {\n return list[idx];\n };\n };\n\n var _makeCommonSelectHandler = function (list, executor) {\n var out = {\n length: list.length,\n each: _curryEach(list, executor),\n get: _curryGet(list)\n },\n setters = [\"setHover\", \"removeAllOverlays\", \"setLabel\", \"addClass\", \"addOverlay\", \"removeOverlay\",\n \"removeOverlays\", \"showOverlay\", \"hideOverlay\", \"showOverlays\", \"hideOverlays\", \"setPaintStyle\",\n \"setHoverPaintStyle\", \"setSuspendEvents\", \"setParameter\", \"setParameters\", \"setVisible\",\n \"repaint\", \"addType\", \"toggleType\", \"removeType\", \"removeClass\", \"setType\", \"bind\", \"unbind\" ],\n\n getters = [\"getLabel\", \"getOverlay\", \"isHover\", \"getParameter\", \"getParameters\", \"getPaintStyle\",\n \"getHoverPaintStyle\", \"isVisible\", \"hasType\", \"getType\", \"isSuspendEvents\" ],\n i, ii;\n\n for (i = 0, ii = setters.length; i < ii; i++) {\n out[setters[i]] = setter(list, setters[i], executor);\n }\n\n for (i = 0, ii = getters.length; i < ii; i++) {\n out[getters[i]] = getter(list, getters[i]);\n }\n\n return out;\n };\n\n var _makeConnectionSelectHandler = function (list) {\n var common = _makeCommonSelectHandler(list, _makeConnectionSelectHandler);\n return jsPlumb.extend(common, {\n // setters\n setDetachable: setter(list, \"setDetachable\", _makeConnectionSelectHandler),\n setReattach: setter(list, \"setReattach\", _makeConnectionSelectHandler),\n setConnector: setter(list, \"setConnector\", _makeConnectionSelectHandler),\n delete: function () {\n for (var i = 0, ii = list.length; i < ii; i++) {\n _currentInstance.deleteConnection(list[i]);\n }\n },\n // getters\n isDetachable: getter(list, \"isDetachable\"),\n isReattach: getter(list, \"isReattach\")\n });\n };\n\n var _makeEndpointSelectHandler = function (list) {\n var common = _makeCommonSelectHandler(list, _makeEndpointSelectHandler);\n return jsPlumb.extend(common, {\n setEnabled: setter(list, \"setEnabled\", _makeEndpointSelectHandler),\n setAnchor: setter(list, \"setAnchor\", _makeEndpointSelectHandler),\n isEnabled: getter(list, \"isEnabled\"),\n deleteEveryConnection: function () {\n for (var i = 0, ii = list.length; i < ii; i++) {\n list[i].deleteEveryConnection();\n }\n },\n \"delete\": function () {\n for (var i = 0, ii = list.length; i < ii; i++) {\n _currentInstance.deleteEndpoint(list[i]);\n }\n }\n });\n };\n\n this.select = function (params) {\n params = params || {};\n params.scope = params.scope || \"*\";\n return _makeConnectionSelectHandler(params.connections || _currentInstance.getConnections(params, true));\n };\n\n this.selectEndpoints = function (params) {\n params = params || {};\n params.scope = params.scope || \"*\";\n var noElementFilters = !params.element && !params.source && !params.target,\n elements = noElementFilters ? \"*\" : prepareList(params.element),\n sources = noElementFilters ? \"*\" : prepareList(params.source),\n targets = noElementFilters ? \"*\" : prepareList(params.target),\n scopes = prepareList(params.scope, true);\n\n var ep = [];\n\n for (var el in endpointsByElement) {\n var either = filterList(elements, el, true),\n source = filterList(sources, el, true),\n sourceMatchExact = sources !== \"*\",\n target = filterList(targets, el, true),\n targetMatchExact = targets !== \"*\";\n\n // if they requested 'either' then just match scope. otherwise if they requested 'source' (not as a wildcard) then we have to match only endpoints that have isSource set to to true, and the same thing with isTarget.\n if (either || source || target) {\n inner:\n for (var i = 0, ii = endpointsByElement[el].length; i < ii; i++) {\n var _ep = endpointsByElement[el][i];\n if (filterList(scopes, _ep.scope, true)) {\n\n var noMatchSource = (sourceMatchExact && sources.length > 0 && !_ep.isSource),\n noMatchTarget = (targetMatchExact && targets.length > 0 && !_ep.isTarget);\n\n if (noMatchSource || noMatchTarget) {\n continue inner;\n }\n\n ep.push(_ep);\n }\n }\n }\n }\n\n return _makeEndpointSelectHandler(ep);\n };\n\n // get all connections managed by the instance of jsplumb.\n this.getAllConnections = function () {\n return connections;\n };\n this.getDefaultScope = function () {\n return DEFAULT_SCOPE;\n };\n // get an endpoint by uuid.\n this.getEndpoint = _getEndpoint;\n /**\n * Gets the list of Endpoints for a given element.\n * @method getEndpoints\n * @param {String|Element|Selector} el The element to get endpoints for.\n * @return {Endpoint[]} An array of Endpoints for the specified element.\n */\n this.getEndpoints = function (el) {\n return endpointsByElement[_info(el).id] || [];\n };\n // gets the default endpoint type. used when subclassing. see wiki.\n this.getDefaultEndpointType = function () {\n return jsPlumb.Endpoint;\n };\n // gets the default connection type. used when subclassing. see wiki.\n this.getDefaultConnectionType = function () {\n return jsPlumb.Connection;\n };\n /*\n * Gets an element's id, creating one if necessary. really only exposed\n * for the lib-specific functionality to access; would be better to pass\n * the current instance into the lib-specific code (even though this is\n * a static call. i just don't want to expose it to the public API).\n */\n this.getId = _getId;\n this.draw = _draw;\n this.info = _info;\n\n this.appendElement = _appendElement;\n\n var _hoverSuspended = false;\n this.isHoverSuspended = function () {\n return _hoverSuspended;\n };\n this.setHoverSuspended = function (s) {\n _hoverSuspended = s;\n };\n\n // set an element's connections to be hidden\n this.hide = function (el, changeEndpoints) {\n _setVisible(el, \"none\", changeEndpoints);\n return _currentInstance;\n };\n\n // exposed for other objects to use to get a unique id.\n this.idstamp = _idstamp;\n\n // ensure that, if the current container exists, it is a DOM element and not a selector.\n // if it does not exist and `candidate` is supplied, the offset parent of that element will be set as the Container.\n // this is used to do a better default behaviour for the case that the user has not set a container:\n // addEndpoint, makeSource, makeTarget and connect all call this method with the offsetParent of the\n // element in question (for connect it is the source element). So if no container is set, it is inferred\n // to be the offsetParent of the first element the user tries to connect.\n var _ensureContainer = function (candidate) {\n if (!_container && candidate) {\n var can = _currentInstance.getElement(candidate);\n if (can.offsetParent) {\n _currentInstance.setContainer(can.offsetParent);\n }\n }\n };\n\n var _getContainerFromDefaults = function () {\n if (_currentInstance.Defaults.Container) {\n _currentInstance.setContainer(_currentInstance.Defaults.Container);\n }\n };\n\n // check if a given element is managed or not. if not, add to our map. if drawing is not suspended then\n // we'll also stash its dimensions; otherwise we'll do this in a lazy way through updateOffset.\n var _manage = _currentInstance.manage = function (id, element, _transient) {\n if (!managedElements[id]) {\n managedElements[id] = {\n el: element,\n endpoints: [],\n connections: []\n };\n\n managedElements[id].info = _updateOffset({ elId: id, timestamp: _suspendedAt });\n _currentInstance.addClass(element, \"jtk-managed\");\n if (!_transient) {\n _currentInstance.fire(\"manageElement\", { id:id, info:managedElements[id].info, el:element });\n }\n }\n\n return managedElements[id];\n };\n\n var _unmanage = _currentInstance.unmanage = function(id) {\n if (managedElements[id]) {\n _currentInstance.removeClass(managedElements[id].el, \"jtk-managed\");\n delete managedElements[id];\n _currentInstance.fire(\"unmanageElement\", id);\n }\n };\n\n /**\n * updates the offset and size for a given element, and stores the\n * values. if 'offset' is not null we use that (it would have been\n * passed in from a drag call) because it's faster; but if it is null,\n * or if 'recalc' is true in order to force a recalculation, we get the current values.\n * @method updateOffset\n */\n var _updateOffset = function (params) {\n\n var timestamp = params.timestamp, recalc = params.recalc, offset = params.offset, elId = params.elId, s;\n if (_suspendDrawing && !timestamp) {\n timestamp = _suspendedAt;\n }\n if (!recalc) {\n if (timestamp && timestamp === offsetTimestamps[elId]) {\n return {o: params.offset || offsets[elId], s: sizes[elId]};\n }\n }\n if (recalc || (!offset && offsets[elId] == null)) { // if forced repaint or no offset available, we recalculate.\n\n // get the current size and offset, and store them\n s = managedElements[elId] ? managedElements[elId].el : null;\n if (s != null) {\n sizes[elId] = _currentInstance.getSize(s);\n offsets[elId] = _currentInstance.getOffset(s);\n offsetTimestamps[elId] = timestamp;\n }\n } else {\n offsets[elId] = offset || offsets[elId];\n if (sizes[elId] == null) {\n s = managedElements[elId].el;\n if (s != null) {\n sizes[elId] = _currentInstance.getSize(s);\n }\n }\n offsetTimestamps[elId] = timestamp;\n }\n\n if (offsets[elId] && !offsets[elId].right) {\n offsets[elId].right = offsets[elId].left + sizes[elId][0];\n offsets[elId].bottom = offsets[elId].top + sizes[elId][1];\n offsets[elId].width = sizes[elId][0];\n offsets[elId].height = sizes[elId][1];\n offsets[elId].centerx = offsets[elId].left + (offsets[elId].width / 2);\n offsets[elId].centery = offsets[elId].top + (offsets[elId].height / 2);\n }\n\n return {o: offsets[elId], s: sizes[elId]};\n };\n\n this.updateOffset = _updateOffset;\n\n /**\n * callback from the current library to tell us to prepare ourselves (attach\n * mouse listeners etc; can't do that until the library has provided a bind method)\n */\n this.init = function () {\n if (!initialized) {\n _getContainerFromDefaults();\n _currentInstance.anchorManager = new root.jsPlumb.AnchorManager({jsPlumbInstance: _currentInstance});\n initialized = true;\n _currentInstance.fire(\"ready\", _currentInstance);\n }\n }.bind(this);\n\n this.log = log;\n this.jsPlumbUIComponent = jsPlumbUIComponent;\n\n /*\n * Creates an anchor with the given params.\n *\n *\n * Returns: The newly created Anchor.\n * Throws: an error if a named anchor was not found.\n */\n this.makeAnchor = function () {\n var pp, _a = function (t, p) {\n if (root.jsPlumb.Anchors[t]) {\n return new root.jsPlumb.Anchors[t](p);\n }\n if (!_currentInstance.Defaults.DoNotThrowErrors) {\n throw { msg: \"jsPlumb: unknown anchor type '\" + t + \"'\" };\n }\n };\n if (arguments.length === 0) {\n return null;\n }\n var specimen = arguments[0], elementId = arguments[1], jsPlumbInstance = arguments[2], newAnchor = null;\n // if it appears to be an anchor already...\n if (specimen.compute && specimen.getOrientation) {\n return specimen;\n } //TODO hazy here about whether it should be added or is already added somehow.\n // is it the name of an anchor type?\n else if (typeof specimen === \"string\") {\n newAnchor = _a(arguments[0], {elementId: elementId, jsPlumbInstance: _currentInstance});\n }\n // is it an array? it will be one of:\n // an array of [spec, params] - this defines a single anchor, which may be dynamic, but has parameters.\n // an array of arrays - this defines some dynamic anchors\n // an array of numbers - this defines a single anchor.\n else if (_ju.isArray(specimen)) {\n if (_ju.isArray(specimen[0]) || _ju.isString(specimen[0])) {\n // if [spec, params] format\n if (specimen.length === 2 && _ju.isObject(specimen[1])) {\n // if first arg is a string, its a named anchor with params\n if (_ju.isString(specimen[0])) {\n pp = root.jsPlumb.extend({elementId: elementId, jsPlumbInstance: _currentInstance}, specimen[1]);\n newAnchor = _a(specimen[0], pp);\n }\n // otherwise first arg is array, second is params. we treat as a dynamic anchor, which is fine\n // even if the first arg has only one entry. you could argue all anchors should be implicitly dynamic in fact.\n else {\n pp = root.jsPlumb.extend({elementId: elementId, jsPlumbInstance: _currentInstance, anchors: specimen[0]}, specimen[1]);\n newAnchor = new root.jsPlumb.DynamicAnchor(pp);\n }\n }\n else {\n newAnchor = new jsPlumb.DynamicAnchor({anchors: specimen, selector: null, elementId: elementId, jsPlumbInstance: _currentInstance});\n }\n\n }\n else {\n var anchorParams = {\n x: specimen[0], y: specimen[1],\n orientation: (specimen.length >= 4) ? [ specimen[2], specimen[3] ] : [0, 0],\n offsets: (specimen.length >= 6) ? [ specimen[4], specimen[5] ] : [ 0, 0 ],\n elementId: elementId,\n jsPlumbInstance: _currentInstance,\n cssClass: specimen.length === 7 ? specimen[6] : null\n };\n newAnchor = new root.jsPlumb.Anchor(anchorParams);\n newAnchor.clone = function () {\n return new root.jsPlumb.Anchor(anchorParams);\n };\n }\n }\n\n if (!newAnchor.id) {\n newAnchor.id = \"anchor_\" + _idstamp();\n }\n return newAnchor;\n };\n\n /**\n * makes a list of anchors from the given list of types or coords, eg\n * [\"TopCenter\", \"RightMiddle\", \"BottomCenter\", [0, 1, -1, -1] ]\n */\n this.makeAnchors = function (types, elementId, jsPlumbInstance) {\n var r = [];\n for (var i = 0, ii = types.length; i < ii; i++) {\n if (typeof types[i] === \"string\") {\n r.push(root.jsPlumb.Anchors[types[i]]({elementId: elementId, jsPlumbInstance: jsPlumbInstance}));\n }\n else if (_ju.isArray(types[i])) {\n r.push(_currentInstance.makeAnchor(types[i], elementId, jsPlumbInstance));\n }\n }\n return r;\n };\n\n /**\n * Makes a dynamic anchor from the given list of anchors (which may be in shorthand notation as strings or dimension arrays, or Anchor\n * objects themselves) and the given, optional, anchorSelector function (jsPlumb uses a default if this is not provided; most people will\n * not need to provide this - i think).\n */\n this.makeDynamicAnchor = function (anchors, anchorSelector) {\n return new root.jsPlumb.DynamicAnchor({anchors: anchors, selector: anchorSelector, elementId: null, jsPlumbInstance: _currentInstance});\n };\n\n// --------------------- makeSource/makeTarget ----------------------------------------------\n\n this.targetEndpointDefinitions = {};\n this.sourceEndpointDefinitions = {};\n\n var selectorFilter = function (evt, _el, selector, _instance, negate) {\n var t = evt.target || evt.srcElement, ok = false,\n sel = _instance.getSelector(_el, selector);\n for (var j = 0; j < sel.length; j++) {\n if (sel[j] === t) {\n ok = true;\n break;\n }\n }\n return negate ? !ok : ok;\n };\n\n var _makeElementDropHandler = function (elInfo, p, dropOptions, isSource, isTarget) {\n var proxyComponent = new jsPlumbUIComponent(p);\n var _drop = p._jsPlumb.EndpointDropHandler({\n jsPlumb: _currentInstance,\n enabled: function () {\n return elInfo.def.enabled;\n },\n isFull: function () {\n var targetCount = _currentInstance.select({target: elInfo.id}).length;\n return elInfo.def.maxConnections > 0 && targetCount >= elInfo.def.maxConnections;\n },\n element: elInfo.el,\n elementId: elInfo.id,\n isSource: isSource,\n isTarget: isTarget,\n addClass: function (clazz) {\n _currentInstance.addClass(elInfo.el, clazz);\n },\n removeClass: function (clazz) {\n _currentInstance.removeClass(elInfo.el, clazz);\n },\n onDrop: function (jpc) {\n var source = jpc.endpoints[0];\n source.anchor.unlock();\n },\n isDropAllowed: function () {\n return proxyComponent.isDropAllowed.apply(proxyComponent, arguments);\n },\n isRedrop:function(jpc) {\n return (jpc.suspendedElement != null && jpc.suspendedEndpoint != null && jpc.suspendedEndpoint.element === elInfo.el);\n },\n getEndpoint: function (jpc) {\n\n // make a new Endpoint for the target, or get it from the cache if uniqueEndpoint\n // is set. if its a redrop the new endpoint will be immediately cleaned up.\n\n var newEndpoint = elInfo.def.endpoint;\n\n // if no cached endpoint, or there was one but it has been cleaned up\n // (ie. detached), create a new one\n if (newEndpoint == null || newEndpoint._jsPlumb == null) {\n var eps = _currentInstance.deriveEndpointAndAnchorSpec(jpc.getType().join(\" \"), true);\n var pp = eps.endpoints ? root.jsPlumb.extend(p, {\n endpoint:elInfo.def.def.endpoint || eps.endpoints[1]\n }) :p;\n if (eps.anchors) {\n pp = root.jsPlumb.extend(pp, {\n anchor:elInfo.def.def.anchor || eps.anchors[1]\n });\n }\n newEndpoint = _currentInstance.addEndpoint(elInfo.el, pp);\n newEndpoint._mtNew = true;\n }\n\n if (p.uniqueEndpoint) {\n elInfo.def.endpoint = newEndpoint;\n }\n\n newEndpoint.setDeleteOnEmpty(true);\n\n // if connection is detachable, init the new endpoint to be draggable, to support that happening.\n if (jpc.isDetachable()) {\n newEndpoint.initDraggable();\n }\n\n // if the anchor has a 'positionFinder' set, then delegate to that function to find\n // out where to locate the anchor.\n if (newEndpoint.anchor.positionFinder != null) {\n var dropPosition = _currentInstance.getUIPosition(arguments, _currentInstance.getZoom()),\n elPosition = _currentInstance.getOffset(elInfo.el),\n elSize = _currentInstance.getSize(elInfo.el),\n ap = dropPosition == null ? [0,0] : newEndpoint.anchor.positionFinder(dropPosition, elPosition, elSize, newEndpoint.anchor.constructorParams);\n\n newEndpoint.anchor.x = ap[0];\n newEndpoint.anchor.y = ap[1];\n // now figure an orientation for it..kind of hard to know what to do actually. probably the best thing i can do is to\n // support specifying an orientation in the anchor's spec. if one is not supplied then i will make the orientation\n // be what will cause the most natural link to the source: it will be pointing at the source, but it needs to be\n // specified in one axis only, and so how to make that choice? i think i will use whichever axis is the one in which\n // the target is furthest away from the source.\n }\n\n return newEndpoint;\n },\n maybeCleanup: function (ep) {\n if (ep._mtNew && ep.connections.length === 0) {\n _currentInstance.deleteObject({endpoint: ep});\n }\n else {\n delete ep._mtNew;\n }\n }\n });\n\n // wrap drop events as needed and initialise droppable\n var dropEvent = root.jsPlumb.dragEvents.drop;\n dropOptions.scope = dropOptions.scope || (p.scope || _currentInstance.Defaults.Scope);\n dropOptions[dropEvent] = _ju.wrap(dropOptions[dropEvent], _drop, true);\n dropOptions.rank = p.rank || 0;\n\n // if target, return true from the over event. this will cause katavorio to stop setting drops to hover\n // if multipleDrop is set to false.\n if (isTarget) {\n dropOptions[root.jsPlumb.dragEvents.over] = function () { return true; };\n }\n\n // vanilla jsplumb only\n if (p.allowLoopback === false) {\n dropOptions.canDrop = function (_drag) {\n var de = _drag.getDragElement()._jsPlumbRelatedElement;\n return de !== elInfo.el;\n };\n }\n _currentInstance.initDroppable(elInfo.el, dropOptions, \"internal\");\n\n return _drop;\n\n };\n\n // see API docs\n this.makeTarget = function (el, params, referenceParams) {\n\n // put jsplumb ref into params without altering the params passed in\n var p = root.jsPlumb.extend({_jsPlumb: this}, referenceParams);\n root.jsPlumb.extend(p, params);\n\n var maxConnections = p.maxConnections || -1,\n\n _doOne = function (el) {\n\n // get the element's id and store the endpoint definition for it. jsPlumb.connect calls will look for one of these,\n // and use the endpoint definition if found.\n // decode the info for this element (id and element)\n var elInfo = _info(el),\n elid = elInfo.id,\n dropOptions = root.jsPlumb.extend({}, p.dropOptions || {}),\n type = p.connectionType || \"default\";\n\n this.targetEndpointDefinitions[elid] = this.targetEndpointDefinitions[elid] || {};\n\n _ensureContainer(elid);\n\n // if this is a group and the user has not mandated a rank, set to -1 so that Nodes takes\n // precedence.\n if (elInfo.el._isJsPlumbGroup && dropOptions.rank == null) {\n dropOptions.rank = -1;\n }\n\n // store the definition\n var _def = {\n def: root.jsPlumb.extend({}, p),\n uniqueEndpoint: p.uniqueEndpoint,\n maxConnections: maxConnections,\n enabled: true\n };\n\n if (p.createEndpoint) {\n _def.uniqueEndpoint = true;\n _def.endpoint = _currentInstance.addEndpoint(el, _def.def);\n _def.endpoint.setDeleteOnEmpty(false);\n }\n\n elInfo.def = _def;\n this.targetEndpointDefinitions[elid][type] = _def;\n _makeElementDropHandler(elInfo, p, dropOptions, p.isSource === true, true);\n // stash the definition on the drop\n elInfo.el._katavorioDrop[elInfo.el._katavorioDrop.length - 1].targetDef = _def;\n\n }.bind(this);\n\n // make an array if only given one element\n var inputs = el.length && el.constructor !== String ? el : [ el ];\n\n // register each one in the list.\n for (var i = 0, ii = inputs.length; i < ii; i++) {\n _doOne(inputs[i]);\n }\n\n return this;\n };\n\n // see api docs\n this.unmakeTarget = function (el, doNotClearArrays) {\n var info = _info(el);\n _currentInstance.destroyDroppable(info.el, \"internal\");\n if (!doNotClearArrays) {\n delete this.targetEndpointDefinitions[info.id];\n }\n\n return this;\n };\n\n // see api docs\n this.makeSource = function (el, params, referenceParams) {\n var p = root.jsPlumb.extend({_jsPlumb: this}, referenceParams);\n root.jsPlumb.extend(p, params);\n var type = p.connectionType || \"default\";\n var aae = _currentInstance.deriveEndpointAndAnchorSpec(type);\n p.endpoint = p.endpoint || aae.endpoints[0];\n p.anchor = p.anchor || aae.anchors[0];\n var maxConnections = p.maxConnections || -1,\n onMaxConnections = p.onMaxConnections,\n _doOne = function (elInfo) {\n // get the element's id and store the endpoint definition for it. jsPlumb.connect calls will look for one of these,\n // and use the endpoint definition if found.\n var elid = elInfo.id,\n _del = this.getElement(elInfo.el);\n\n this.sourceEndpointDefinitions[elid] = this.sourceEndpointDefinitions[elid] || {};\n _ensureContainer(elid);\n\n var _def = {\n def:root.jsPlumb.extend({}, p),\n uniqueEndpoint: p.uniqueEndpoint,\n maxConnections: maxConnections,\n enabled: true\n };\n\n if (p.createEndpoint) {\n _def.uniqueEndpoint = true;\n _def.endpoint = _currentInstance.addEndpoint(el, _def.def);\n _def.endpoint.setDeleteOnEmpty(false);\n }\n\n this.sourceEndpointDefinitions[elid][type] = _def;\n elInfo.def = _def;\n\n var stopEvent = root.jsPlumb.dragEvents.stop,\n dragEvent = root.jsPlumb.dragEvents.drag,\n dragOptions = root.jsPlumb.extend({ }, p.dragOptions || {}),\n existingDrag = dragOptions.drag,\n existingStop = dragOptions.stop,\n ep = null,\n endpointAddedButNoDragYet = false;\n\n // set scope if its not set in dragOptions but was passed in in params\n dragOptions.scope = dragOptions.scope || p.scope;\n\n dragOptions[dragEvent] = _ju.wrap(dragOptions[dragEvent], function () {\n if (existingDrag) {\n existingDrag.apply(this, arguments);\n }\n endpointAddedButNoDragYet = false;\n });\n\n dragOptions[stopEvent] = _ju.wrap(dragOptions[stopEvent], function () {\n\n if (existingStop) {\n existingStop.apply(this, arguments);\n }\n this.currentlyDragging = false;\n if (ep._jsPlumb != null) { // if not cleaned up...\n\n // reset the anchor to the anchor that was initially provided. the one we were using to drag\n // the connection was just a placeholder that was located at the place the user pressed the\n // mouse button to initiate the drag.\n var anchorDef = p.anchor || this.Defaults.Anchor,\n oldAnchor = ep.anchor,\n oldConnection = ep.connections[0];\n\n var newAnchor = this.makeAnchor(anchorDef, elid, this),\n _el = ep.element;\n\n // if the anchor has a 'positionFinder' set, then delegate to that function to find\n // out where to locate the anchor. issue 117.\n if (newAnchor.positionFinder != null) {\n var elPosition = _currentInstance.getOffset(_el),\n elSize = this.getSize(_el),\n dropPosition = { left: elPosition.left + (oldAnchor.x * elSize[0]), top: elPosition.top + (oldAnchor.y * elSize[1]) },\n ap = newAnchor.positionFinder(dropPosition, elPosition, elSize, newAnchor.constructorParams);\n\n newAnchor.x = ap[0];\n newAnchor.y = ap[1];\n }\n\n ep.setAnchor(newAnchor, true);\n ep.repaint();\n this.repaint(ep.elementId);\n if (oldConnection != null) {\n this.repaint(oldConnection.targetId);\n }\n }\n }.bind(this));\n\n // when the user presses the mouse, add an Endpoint, if we are enabled.\n var mouseDownListener = function (e) {\n // on right mouse button, abort.\n if (e.which === 3 || e.button === 2) {\n return;\n }\n\n // TODO store def on element.\n var def = this.sourceEndpointDefinitions[elid][type];\n\n // if disabled, return.\n if (!def.enabled) {\n return;\n }\n\n elid = this.getId(this.getElement(elInfo.el)); // elid might have changed since this method was called to configure the element.\n\n // if a filter was given, run it, and return if it says no.\n if (p.filter) {\n var r = _ju.isString(p.filter) ? selectorFilter(e, elInfo.el, p.filter, this, p.filterExclude) : p.filter(e, elInfo.el);\n if (r === false) {\n return;\n }\n }\n\n // if maxConnections reached\n var sourceCount = this.select({source: elid}).length;\n if (def.maxConnections >= 0 && (sourceCount >= def.maxConnections)) {\n if (onMaxConnections) {\n onMaxConnections({\n element: elInfo.el,\n maxConnections: maxConnections\n }, e);\n }\n return false;\n }\n\n // find the position on the element at which the mouse was pressed; this is where the endpoint\n // will be located.\n var elxy = root.jsPlumb.getPositionOnElement(e, _del, _zoom);\n\n // we need to override the anchor in here, and force 'isSource', but we don't want to mess with\n // the params passed in, because after a connection is established we're going to reset the endpoint\n // to have the anchor we were given.\n var tempEndpointParams = {};\n root.jsPlumb.extend(tempEndpointParams, p);\n tempEndpointParams.isTemporarySource = true;\n tempEndpointParams.anchor = [ elxy[0], elxy[1] , 0, 0];\n tempEndpointParams.dragOptions = dragOptions;\n\n if (def.def.scope) {\n tempEndpointParams.scope = def.def.scope;\n }\n\n ep = this.addEndpoint(elid, tempEndpointParams);\n endpointAddedButNoDragYet = true;\n ep.setDeleteOnEmpty(true);\n\n // if unique endpoint and it's already been created, push it onto the endpoint we create. at the end\n // of a successful connection we'll switch to that endpoint.\n // TODO this is the same code as the programmatic endpoints create on line 1050 ish\n if (def.uniqueEndpoint) {\n if (!def.endpoint) {\n def.endpoint = ep;\n ep.setDeleteOnEmpty(false);\n }\n else {\n ep.finalEndpoint = def.endpoint;\n }\n }\n\n var _delTempEndpoint = function () {\n // this mouseup event is fired only if no dragging occurred, by jquery and yui, but for mootools\n // it is fired even if dragging has occurred, in which case we would blow away a perfectly\n // legitimate endpoint, were it not for this check. the flag is set after adding an\n // endpoint and cleared in a drag listener we set in the dragOptions above.\n _currentInstance.off(ep.canvas, \"mouseup\", _delTempEndpoint);\n _currentInstance.off(elInfo.el, \"mouseup\", _delTempEndpoint);\n if (endpointAddedButNoDragYet) {\n endpointAddedButNoDragYet = false;\n _currentInstance.deleteEndpoint(ep);\n }\n };\n\n _currentInstance.on(ep.canvas, \"mouseup\", _delTempEndpoint);\n _currentInstance.on(elInfo.el, \"mouseup\", _delTempEndpoint);\n\n // optionally check for attributes to extract from the source element\n var payload = {};\n if (def.def.extract) {\n for (var att in def.def.extract) {\n var v = (e.srcElement || e.target).getAttribute(att);\n if (v) {\n payload[def.def.extract[att]] = v;\n }\n }\n }\n\n // and then trigger its mousedown event, which will kick off a drag, which will start dragging\n // a new connection from this endpoint.\n _currentInstance.trigger(ep.canvas, \"mousedown\", e, payload);\n\n _ju.consume(e);\n\n }.bind(this);\n\n this.on(elInfo.el, \"mousedown\", mouseDownListener);\n _def.trigger = mouseDownListener;\n\n // if a filter was provided, set it as a dragFilter on the element,\n // to prevent the element drag function from kicking in when we want to\n // drag a new connection\n if (p.filter && (_ju.isString(p.filter) || _ju.isFunction(p.filter))) {\n _currentInstance.setDragFilter(elInfo.el, p.filter);\n }\n\n var dropOptions = root.jsPlumb.extend({}, p.dropOptions || {});\n\n _makeElementDropHandler(elInfo, p, dropOptions, true, p.isTarget === true);\n\n }.bind(this);\n\n var inputs = el.length && el.constructor !== String ? el : [ el ];\n for (var i = 0, ii = inputs.length; i < ii; i++) {\n _doOne(_info(inputs[i]));\n }\n\n return this;\n };\n\n // see api docs\n this.unmakeSource = function (el, connectionType, doNotClearArrays) {\n var info = _info(el);\n _currentInstance.destroyDroppable(info.el, \"internal\");\n var eldefs = this.sourceEndpointDefinitions[info.id];\n if (eldefs) {\n for (var def in eldefs) {\n if (connectionType == null || connectionType === def) {\n var mouseDownListener = eldefs[def].trigger;\n if (mouseDownListener) {\n _currentInstance.off(info.el, \"mousedown\", mouseDownListener);\n }\n if (!doNotClearArrays) {\n delete this.sourceEndpointDefinitions[info.id][def];\n }\n }\n }\n }\n\n return this;\n };\n\n // see api docs\n this.unmakeEverySource = function () {\n for (var i in this.sourceEndpointDefinitions) {\n _currentInstance.unmakeSource(i, null, true);\n }\n\n this.sourceEndpointDefinitions = {};\n return this;\n };\n\n var _getScope = function (el, types, connectionType) {\n types = _ju.isArray(types) ? types : [ types ];\n var id = _getId(el);\n connectionType = connectionType || \"default\";\n for (var i = 0; i < types.length; i++) {\n var eldefs = this[types[i]][id];\n if (eldefs && eldefs[connectionType]) {\n return eldefs[connectionType].def.scope || this.Defaults.Scope;\n }\n }\n }.bind(this);\n\n var _setScope = function (el, scope, types, connectionType) {\n types = _ju.isArray(types) ? types : [ types ];\n var id = _getId(el);\n connectionType = connectionType || \"default\";\n for (var i = 0; i < types.length; i++) {\n var eldefs = this[types[i]][id];\n if (eldefs && eldefs[connectionType]) {\n eldefs[connectionType].def.scope = scope;\n }\n }\n\n }.bind(this);\n\n this.getScope = function (el, scope) {\n return _getScope(el, [ \"sourceEndpointDefinitions\", \"targetEndpointDefinitions\" ]);\n };\n this.getSourceScope = function (el) {\n return _getScope(el, \"sourceEndpointDefinitions\");\n };\n this.getTargetScope = function (el) {\n return _getScope(el, \"targetEndpointDefinitions\");\n };\n this.setScope = function (el, scope, connectionType) {\n this.setSourceScope(el, scope, connectionType);\n this.setTargetScope(el, scope, connectionType);\n };\n this.setSourceScope = function (el, scope, connectionType) {\n _setScope(el, scope, \"sourceEndpointDefinitions\", connectionType);\n // we get the source scope during the mousedown event, but we also want to set this.\n this.setDragScope(el, scope);\n };\n this.setTargetScope = function (el, scope, connectionType) {\n _setScope(el, scope, \"targetEndpointDefinitions\", connectionType);\n this.setDropScope(el, scope);\n };\n\n // see api docs\n this.unmakeEveryTarget = function () {\n for (var i in this.targetEndpointDefinitions) {\n _currentInstance.unmakeTarget(i, true);\n }\n\n this.targetEndpointDefinitions = {};\n return this;\n };\n\n // does the work of setting a source enabled or disabled.\n var _setEnabled = function (type, el, state, toggle, connectionType) {\n var a = type === \"source\" ? this.sourceEndpointDefinitions : this.targetEndpointDefinitions,\n originalState, info, newState;\n\n connectionType = connectionType || \"default\";\n\n // a selector or an array\n if (el.length && !_ju.isString(el)) {\n originalState = [];\n for (var i = 0, ii = el.length; i < ii; i++) {\n info = _info(el[i]);\n if (a[info.id] && a[info.id][connectionType]) {\n originalState[i] = a[info.id][connectionType].enabled;\n newState = toggle ? !originalState[i] : state;\n a[info.id][connectionType].enabled = newState;\n _currentInstance[newState ? \"removeClass\" : \"addClass\"](info.el, \"jtk-\" + type + \"-disabled\");\n }\n }\n }\n // otherwise a DOM element or a String ID.\n else {\n info = _info(el);\n var id = info.id;\n if (a[id] && a[id][connectionType]) {\n originalState = a[id][connectionType].enabled;\n newState = toggle ? !originalState : state;\n a[id][connectionType].enabled = newState;\n _currentInstance[newState ? \"removeClass\" : \"addClass\"](info.el, \"jtk-\" + type + \"-disabled\");\n }\n }\n return originalState;\n }.bind(this);\n\n var _first = function (el, fn) {\n if (_ju.isString(el) || !el.length) {\n return fn.apply(this, [ el ]);\n }\n else if (el.length) {\n return fn.apply(this, [ el[0] ]);\n }\n\n }.bind(this);\n\n this.toggleSourceEnabled = function (el, connectionType) {\n _setEnabled(\"source\", el, null, true, connectionType);\n return this.isSourceEnabled(el, connectionType);\n };\n\n this.setSourceEnabled = function (el, state, connectionType) {\n return _setEnabled(\"source\", el, state, null, connectionType);\n };\n this.isSource = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var eldefs = this.sourceEndpointDefinitions[_info(_el).id];\n return eldefs != null && eldefs[connectionType] != null;\n }.bind(this));\n };\n this.isSourceEnabled = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var sep = this.sourceEndpointDefinitions[_info(_el).id];\n return sep && sep[connectionType] && sep[connectionType].enabled === true;\n }.bind(this));\n };\n\n this.toggleTargetEnabled = function (el, connectionType) {\n _setEnabled(\"target\", el, null, true, connectionType);\n return this.isTargetEnabled(el, connectionType);\n };\n\n this.isTarget = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var eldefs = this.targetEndpointDefinitions[_info(_el).id];\n return eldefs != null && eldefs[connectionType] != null;\n }.bind(this));\n };\n this.isTargetEnabled = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var tep = this.targetEndpointDefinitions[_info(_el).id];\n return tep && tep[connectionType] && tep[connectionType].enabled === true;\n }.bind(this));\n };\n this.setTargetEnabled = function (el, state, connectionType) {\n return _setEnabled(\"target\", el, state, null, connectionType);\n };\n\n// --------------------- end makeSource/makeTarget ----------------------------------------------\n\n this.ready = function (fn) {\n _currentInstance.bind(\"ready\", fn);\n };\n\n var _elEach = function(el, fn) {\n // support both lists...\n if (typeof el === 'object' && el.length) {\n for (var i = 0, ii = el.length; i < ii; i++) {\n fn(el[i]);\n }\n }\n else {// ...and single strings or elements.\n fn(el);\n }\n\n return _currentInstance;\n };\n\n // repaint some element's endpoints and connections\n this.repaint = function (el, ui, timestamp) {\n return _elEach(el, function(_el) {\n _draw(_el, ui, timestamp);\n });\n };\n\n this.revalidate = function (el, timestamp, isIdAlready) {\n return _elEach(el, function(_el) {\n var elId = isIdAlready ? _el : _currentInstance.getId(_el);\n _currentInstance.updateOffset({ elId: elId, recalc: true, timestamp:timestamp });\n var dm = _currentInstance.getDragManager();\n if (dm) {\n dm.updateOffsets(elId);\n }\n _currentInstance.repaint(_el);\n });\n };\n\n // repaint every endpoint and connection.\n this.repaintEverything = function () {\n // TODO this timestamp causes continuous anchors to not repaint properly.\n // fix this. do not just take out the timestamp. it runs a lot faster with\n // the timestamp included.\n var timestamp = _timestamp(), elId;\n\n for (elId in endpointsByElement) {\n _currentInstance.updateOffset({ elId: elId, recalc: true, timestamp: timestamp });\n }\n\n for (elId in endpointsByElement) {\n _draw(elId, null, timestamp);\n }\n\n return this;\n };\n\n this.removeAllEndpoints = function (el, recurse, affectedElements) {\n affectedElements = affectedElements || [];\n var _one = function (_el) {\n var info = _info(_el),\n ebe = endpointsByElement[info.id],\n i, ii;\n\n if (ebe) {\n affectedElements.push(info);\n for (i = 0, ii = ebe.length; i < ii; i++) {\n _currentInstance.deleteEndpoint(ebe[i], false);\n }\n }\n delete endpointsByElement[info.id];\n\n if (recurse) {\n if (info.el && info.el.nodeType !== 3 && info.el.nodeType !== 8) {\n for (i = 0, ii = info.el.childNodes.length; i < ii; i++) {\n _one(info.el.childNodes[i]);\n }\n }\n }\n\n };\n _one(el);\n return this;\n };\n\n var _doRemove = function(info, affectedElements) {\n _currentInstance.removeAllEndpoints(info.id, true, affectedElements);\n var dm = _currentInstance.getDragManager();\n var _one = function(_info) {\n\n if (dm) {\n dm.elementRemoved(_info.id);\n }\n _currentInstance.anchorManager.clearFor(_info.id);\n _currentInstance.anchorManager.removeFloatingConnection(_info.id);\n\n if (_currentInstance.isSource(_info.el)) {\n _currentInstance.unmakeSource(_info.el);\n }\n if (_currentInstance.isTarget(_info.el)) {\n _currentInstance.unmakeTarget(_info.el);\n }\n _currentInstance.destroyDraggable(_info.el);\n _currentInstance.destroyDroppable(_info.el);\n\n\n delete _currentInstance.floatingConnections[_info.id];\n delete managedElements[_info.id];\n delete offsets[_info.id];\n if (_info.el) {\n _currentInstance.removeElement(_info.el);\n _info.el._jsPlumb = null;\n }\n };\n\n // remove all affected child elements\n for (var ae = 1; ae < affectedElements.length; ae++) {\n _one(affectedElements[ae]);\n }\n // and always remove the requested one from the dom.\n _one(info);\n };\n\n /**\n * Remove the given element, including cleaning up all endpoints registered for it.\n * This is exposed in the public API but also used internally by jsPlumb when removing the\n * element associated with a connection drag.\n */\n this.remove = function (el, doNotRepaint) {\n var info = _info(el), affectedElements = [];\n if (info.text) {\n info.el.parentNode.removeChild(info.el);\n }\n else if (info.id) {\n _currentInstance.batch(function () {\n _doRemove(info, affectedElements);\n }, doNotRepaint === true);\n }\n return _currentInstance;\n };\n\n this.empty = function (el, doNotRepaint) {\n var affectedElements = [];\n var _one = function(el, dontRemoveFocus) {\n var info = _info(el);\n if (info.text) {\n info.el.parentNode.removeChild(info.el);\n }\n else if (info.el) {\n while(info.el.childNodes.length > 0) {\n _one(info.el.childNodes[0]);\n }\n if (!dontRemoveFocus) {\n _doRemove(info, affectedElements);\n }\n }\n };\n\n _currentInstance.batch(function() {\n _one(el, true);\n }, doNotRepaint === false);\n\n return _currentInstance;\n };\n\n this.reset = function (doNotUnbindInstanceEventListeners) {\n _currentInstance.silently(function() {\n _hoverSuspended = false;\n _currentInstance.removeAllGroups();\n _currentInstance.removeGroupManager();\n _currentInstance.deleteEveryEndpoint();\n if (!doNotUnbindInstanceEventListeners) {\n _currentInstance.unbind();\n }\n this.targetEndpointDefinitions = {};\n this.sourceEndpointDefinitions = {};\n connections.length = 0;\n if (this.doReset) {\n this.doReset();\n }\n }.bind(this));\n };\n\n var _clearObject = function (obj) {\n if (obj.canvas && obj.canvas.parentNode) {\n obj.canvas.parentNode.removeChild(obj.canvas);\n }\n obj.cleanup();\n obj.destroy();\n };\n\n this.clear = function () {\n _currentInstance.select().each(_clearObject);\n _currentInstance.selectEndpoints().each(_clearObject);\n\n endpointsByElement = {};\n endpointsByUUID = {};\n };\n\n this.setDefaultScope = function (scope) {\n DEFAULT_SCOPE = scope;\n return _currentInstance;\n };\n\n this.deriveEndpointAndAnchorSpec = function(type, dontPrependDefault) {\n var bits = ((dontPrependDefault ? \"\" : \"default \") + type).split(/[\\s]/), eps = null, ep = null, a = null, as = null;\n for (var i = 0; i < bits.length; i++) {\n var _t = _currentInstance.getType(bits[i], \"connection\");\n if (_t) {\n if (_t.endpoints) {\n eps = _t.endpoints;\n }\n if (_t.endpoint) {\n ep = _t.endpoint;\n }\n if (_t.anchors) {\n as = _t.anchors;\n }\n if (_t.anchor) {\n a = _t.anchor;\n }\n }\n }\n return { endpoints: eps ? eps : [ ep, ep ], anchors: as ? as : [a, a ]};\n };\n\n // sets the id of some element, changing whatever we need to to keep track.\n this.setId = function (el, newId, doNotSetAttribute) {\n //\n var id;\n\n if (_ju.isString(el)) {\n id = el;\n }\n else {\n el = this.getElement(el);\n id = this.getId(el);\n }\n\n var sConns = this.getConnections({source: id, scope: '*'}, true),\n tConns = this.getConnections({target: id, scope: '*'}, true);\n\n newId = \"\" + newId;\n\n if (!doNotSetAttribute) {\n el = this.getElement(id);\n this.setAttribute(el, \"id\", newId);\n }\n else {\n el = this.getElement(newId);\n }\n\n endpointsByElement[newId] = endpointsByElement[id] || [];\n for (var i = 0, ii = endpointsByElement[newId].length; i < ii; i++) {\n endpointsByElement[newId][i].setElementId(newId);\n endpointsByElement[newId][i].setReferenceElement(el);\n }\n delete endpointsByElement[id];\n\n this.sourceEndpointDefinitions[newId] = this.sourceEndpointDefinitions[id];\n delete this.sourceEndpointDefinitions[id];\n this.targetEndpointDefinitions[newId] = this.targetEndpointDefinitions[id];\n delete this.targetEndpointDefinitions[id];\n\n this.anchorManager.changeId(id, newId);\n var dm = this.getDragManager();\n if (dm) {\n dm.changeId(id, newId);\n }\n managedElements[newId] = managedElements[id];\n delete managedElements[id];\n\n var _conns = function (list, epIdx, type) {\n for (var i = 0, ii = list.length; i < ii; i++) {\n list[i].endpoints[epIdx].setElementId(newId);\n list[i].endpoints[epIdx].setReferenceElement(el);\n list[i][type + \"Id\"] = newId;\n list[i][type] = el;\n }\n };\n _conns(sConns, 0, \"source\");\n _conns(tConns, 1, \"target\");\n\n this.repaint(newId);\n };\n\n this.setDebugLog = function (debugLog) {\n log = debugLog;\n };\n\n this.setSuspendDrawing = function (val, repaintAfterwards) {\n var curVal = _suspendDrawing;\n _suspendDrawing = val;\n if (val) {\n _suspendedAt = new Date().getTime();\n } else {\n _suspendedAt = null;\n }\n if (repaintAfterwards) {\n this.repaintEverything();\n }\n return curVal;\n };\n\n // returns whether or not drawing is currently suspended.\n this.isSuspendDrawing = function () {\n return _suspendDrawing;\n };\n\n // return timestamp for when drawing was suspended.\n this.getSuspendedAt = function () {\n return _suspendedAt;\n };\n\n this.batch = function (fn, doNotRepaintAfterwards) {\n var _wasSuspended = this.isSuspendDrawing();\n if (!_wasSuspended) {\n this.setSuspendDrawing(true);\n }\n try {\n fn();\n }\n catch (e) {\n _ju.log(\"Function run while suspended failed\", e);\n }\n if (!_wasSuspended) {\n this.setSuspendDrawing(false, !doNotRepaintAfterwards);\n }\n };\n\n this.doWhileSuspended = this.batch;\n\n this.getCachedData = _getCachedData;\n this.timestamp = _timestamp;\n this.show = function (el, changeEndpoints) {\n _setVisible(el, \"block\", changeEndpoints);\n return _currentInstance;\n };\n\n // TODO: update this method to return the current state.\n this.toggleVisible = _toggleVisible;\n this.addListener = this.bind;\n\n var floatingConnections = [];\n this.registerFloatingConnection = function(info, conn, ep) {\n floatingConnections[info.id] = conn;\n // only register for the target endpoint; we will not be dragging the source at any time\n // before this connection is either discarded or made into a permanent connection.\n _ju.addToList(endpointsByElement, info.id, ep);\n };\n this.getFloatingConnectionFor = function(id) {\n return floatingConnections[id];\n };\n };\n\n _ju.extend(root.jsPlumbInstance, _ju.EventGenerator, {\n setAttribute: function (el, a, v) {\n this.setAttribute(el, a, v);\n },\n getAttribute: function (el, a) {\n return this.getAttribute(root.jsPlumb.getElement(el), a);\n },\n convertToFullOverlaySpec: function(spec) {\n if (_ju.isString(spec)) {\n spec = [ spec, { } ];\n }\n spec[1].id = spec[1].id || _ju.uuid();\n return spec;\n },\n registerConnectionType: function (id, type) {\n this._connectionTypes[id] = root.jsPlumb.extend({}, type);\n if (type.overlays) {\n var to = {};\n for (var i = 0; i < type.overlays.length; i++) {\n // if a string, convert to object representation so that we can store the typeid on it.\n // also assign an id.\n var fo = this.convertToFullOverlaySpec(type.overlays[i]);\n to[fo[1].id] = fo;\n }\n this._connectionTypes[id].overlays = to;\n }\n },\n registerConnectionTypes: function (types) {\n for (var i in types) {\n this.registerConnectionType(i, types[i]);\n }\n },\n registerEndpointType: function (id, type) {\n this._endpointTypes[id] = root.jsPlumb.extend({}, type);\n if (type.overlays) {\n var to = {};\n for (var i = 0; i < type.overlays.length; i++) {\n // if a string, convert to object representation so that we can store the typeid on it.\n // also assign an id.\n var fo = this.convertToFullOverlaySpec(type.overlays[i]);\n to[fo[1].id] = fo;\n }\n this._endpointTypes[id].overlays = to;\n }\n },\n registerEndpointTypes: function (types) {\n for (var i in types) {\n this.registerEndpointType(i, types[i]);\n }\n },\n getType: function (id, typeDescriptor) {\n return typeDescriptor === \"connection\" ? this._connectionTypes[id] : this._endpointTypes[id];\n },\n setIdChanged: function (oldId, newId) {\n this.setId(oldId, newId, true);\n },\n // set parent: change the parent for some node and update all the registrations we need to.\n setParent: function (el, newParent) {\n var _dom = this.getElement(el),\n _id = this.getId(_dom),\n _pdom = this.getElement(newParent),\n _pid = this.getId(_pdom),\n dm = this.getDragManager();\n\n _dom.parentNode.removeChild(_dom);\n _pdom.appendChild(_dom);\n if (dm) {\n dm.setParent(_dom, _id, _pdom, _pid);\n }\n },\n extend: function (o1, o2, names) {\n var i;\n if (names) {\n for (i = 0; i < names.length; i++) {\n o1[names[i]] = o2[names[i]];\n }\n }\n else {\n for (i in o2) {\n o1[i] = o2[i];\n }\n }\n\n return o1;\n },\n floatingConnections: {},\n getFloatingAnchorIndex: function (jpc) {\n return jpc.endpoints[0].isFloating() ? 0 : jpc.endpoints[1].isFloating() ? 1 : -1;\n }\n });\n\n// --------------------- static instance + module registration -------------------------------------------\n\n// create static instance and assign to window if window exists.\n var jsPlumb = new jsPlumbInstance();\n // register on 'root' (lets us run on server or browser)\n root.jsPlumb = jsPlumb;\n // add 'getInstance' method to static instance\n jsPlumb.getInstance = function (_defaults, overrideFns) {\n var j = new jsPlumbInstance(_defaults);\n if (overrideFns) {\n for (var ovf in overrideFns) {\n j[ovf] = overrideFns[ovf];\n }\n }\n j.init();\n return j;\n };\n jsPlumb.each = function (spec, fn) {\n if (spec == null) {\n return;\n }\n if (typeof spec === \"string\") {\n fn(jsPlumb.getElement(spec));\n }\n else if (spec.length != null) {\n for (var i = 0; i < spec.length; i++) {\n fn(jsPlumb.getElement(spec[i]));\n }\n }\n else {\n fn(spec);\n } // assume it's an element.\n };\n\n // CommonJS\n if (typeof exports !== 'undefined') {\n exports.jsPlumb = jsPlumb;\n }\n\n// --------------------- end static instance + AMD registration -------------------------------------------\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function() {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n // ------------------------------ BEGIN OverlayCapablejsPlumbUIComponent --------------------------------------------\n\n var _internalLabelOverlayId = \"__label\",\n // this is a shortcut helper method to let people add a label as\n // overlay.\n _makeLabelOverlay = function (component, params) {\n\n var _params = {\n cssClass: params.cssClass,\n labelStyle: component.labelStyle,\n id: _internalLabelOverlayId,\n component: component,\n _jsPlumb: component._jsPlumb.instance // TODO not necessary, since the instance can be accessed through the component.\n },\n mergedParams = _jp.extend(_params, params);\n\n return new _jp.Overlays[component._jsPlumb.instance.getRenderMode()].Label(mergedParams);\n },\n _processOverlay = function (component, o) {\n var _newOverlay = null;\n if (_ju.isArray(o)) {\t// this is for the shorthand [\"Arrow\", { width:50 }] syntax\n // there's also a three arg version:\n // [\"Arrow\", { width:50 }, {location:0.7}]\n // which merges the 3rd arg into the 2nd.\n var type = o[0],\n // make a copy of the object so as not to mess up anyone else's reference...\n p = _jp.extend({component: component, _jsPlumb: component._jsPlumb.instance}, o[1]);\n if (o.length === 3) {\n _jp.extend(p, o[2]);\n }\n _newOverlay = new _jp.Overlays[component._jsPlumb.instance.getRenderMode()][type](p);\n } else if (o.constructor === String) {\n _newOverlay = new _jp.Overlays[component._jsPlumb.instance.getRenderMode()][o]({component: component, _jsPlumb: component._jsPlumb.instance});\n } else {\n _newOverlay = o;\n }\n\n _newOverlay.id = _newOverlay.id || _ju.uuid();\n component.cacheTypeItem(\"overlay\", _newOverlay, _newOverlay.id);\n component._jsPlumb.overlays[_newOverlay.id] = _newOverlay;\n\n return _newOverlay;\n };\n\n _jp.OverlayCapableJsPlumbUIComponent = function (params) {\n\n root.jsPlumbUIComponent.apply(this, arguments);\n this._jsPlumb.overlays = {};\n this._jsPlumb.overlayPositions = {};\n\n if (params.label) {\n this.getDefaultType().overlays[_internalLabelOverlayId] = [\"Label\", {\n label: params.label,\n location: params.labelLocation || this.defaultLabelLocation || 0.5,\n labelStyle: params.labelStyle || this._jsPlumb.instance.Defaults.LabelStyle,\n id:_internalLabelOverlayId\n }];\n }\n\n this.setListenerComponent = function (c) {\n if (this._jsPlumb) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].setListenerComponent(c);\n }\n }\n };\n };\n\n _jp.OverlayCapableJsPlumbUIComponent.applyType = function (component, t) {\n if (t.overlays) {\n // loop through the ones in the type. if already present on the component,\n // dont remove or re-add.\n var keep = {}, i;\n\n for (i in t.overlays) {\n\n var existing = component._jsPlumb.overlays[t.overlays[i][1].id];\n if (existing) {\n // maybe update from data, if there were parameterised values for instance.\n existing.updateFrom(t.overlays[i][1]);\n keep[t.overlays[i][1].id] = true;\n }\n else {\n var c = component.getCachedTypeItem(\"overlay\", t.overlays[i][1].id);\n if (c != null) {\n c.reattach(component._jsPlumb.instance, component);\n c.setVisible(true);\n // maybe update from data, if there were parameterised values for instance.\n c.updateFrom(t.overlays[i][1]);\n component._jsPlumb.overlays[c.id] = c;\n }\n else {\n c = component.addOverlay(t.overlays[i], true);\n }\n keep[c.id] = true;\n }\n }\n\n // now loop through the full overlays and remove those that we dont want to keep\n for (i in component._jsPlumb.overlays) {\n if (keep[component._jsPlumb.overlays[i].id] == null) {\n component.removeOverlay(component._jsPlumb.overlays[i].id, true); // remove overlay but dont clean it up.\n // that would remove event listeners etc; overlays are never discarded by the types stuff, they are\n // just detached/reattached.\n }\n }\n }\n };\n\n _ju.extend(_jp.OverlayCapableJsPlumbUIComponent, root.jsPlumbUIComponent, {\n\n setHover: function (hover, ignoreAttachedElements) {\n if (this._jsPlumb && !this._jsPlumb.instance.isConnectionBeingDragged()) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i][hover ? \"addClass\" : \"removeClass\"](this._jsPlumb.instance.hoverClass);\n }\n }\n },\n addOverlay: function (overlay, doNotRepaint) {\n var o = _processOverlay(this, overlay);\n if (!doNotRepaint) {\n this.repaint();\n }\n return o;\n },\n getOverlay: function (id) {\n return this._jsPlumb.overlays[id];\n },\n getOverlays: function () {\n return this._jsPlumb.overlays;\n },\n hideOverlay: function (id) {\n var o = this.getOverlay(id);\n if (o) {\n o.hide();\n }\n },\n hideOverlays: function () {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].hide();\n }\n },\n showOverlay: function (id) {\n var o = this.getOverlay(id);\n if (o) {\n o.show();\n }\n },\n showOverlays: function () {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].show();\n }\n },\n removeAllOverlays: function (doNotRepaint) {\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays[i].cleanup) {\n this._jsPlumb.overlays[i].cleanup();\n }\n }\n\n this._jsPlumb.overlays = {};\n this._jsPlumb.overlayPositions = null;\n this._jsPlumb.overlayPlacements= {};\n if (!doNotRepaint) {\n this.repaint();\n }\n },\n removeOverlay: function (overlayId, dontCleanup) {\n var o = this._jsPlumb.overlays[overlayId];\n if (o) {\n o.setVisible(false);\n if (!dontCleanup && o.cleanup) {\n o.cleanup();\n }\n delete this._jsPlumb.overlays[overlayId];\n if (this._jsPlumb.overlayPositions) {\n delete this._jsPlumb.overlayPositions[overlayId];\n }\n\n if (this._jsPlumb.overlayPlacements) {\n delete this._jsPlumb.overlayPlacements[overlayId];\n }\n }\n },\n removeOverlays: function () {\n for (var i = 0, j = arguments.length; i < j; i++) {\n this.removeOverlay(arguments[i]);\n }\n },\n moveParent: function (newParent) {\n if (this.bgCanvas) {\n this.bgCanvas.parentNode.removeChild(this.bgCanvas);\n newParent.appendChild(this.bgCanvas);\n }\n\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n newParent.appendChild(this.canvas);\n\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays[i].isAppendedAtTopLevel) {\n var el = this._jsPlumb.overlays[i].getElement();\n el.parentNode.removeChild(el);\n newParent.appendChild(el);\n }\n }\n }\n },\n getLabel: function () {\n var lo = this.getOverlay(_internalLabelOverlayId);\n return lo != null ? lo.getLabel() : null;\n },\n getLabelOverlay: function () {\n return this.getOverlay(_internalLabelOverlayId);\n },\n setLabel: function (l) {\n var lo = this.getOverlay(_internalLabelOverlayId);\n if (!lo) {\n var params = l.constructor === String || l.constructor === Function ? { label: l } : l;\n lo = _makeLabelOverlay(this, params);\n this._jsPlumb.overlays[_internalLabelOverlayId] = lo;\n }\n else {\n if (l.constructor === String || l.constructor === Function) {\n lo.setLabel(l);\n }\n else {\n if (l.label) {\n lo.setLabel(l.label);\n }\n if (l.location) {\n lo.setLocation(l.location);\n }\n }\n }\n\n if (!this._jsPlumb.instance.isSuspendDrawing()) {\n this.repaint();\n }\n },\n cleanup: function (force) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].cleanup(force);\n this._jsPlumb.overlays[i].destroy(force);\n }\n if (force) {\n this._jsPlumb.overlays = {};\n this._jsPlumb.overlayPositions = null;\n }\n },\n setVisible: function (v) {\n this[v ? \"showOverlays\" : \"hideOverlays\"]();\n },\n setAbsoluteOverlayPosition: function (overlay, xy) {\n this._jsPlumb.overlayPositions[overlay.id] = xy;\n },\n getAbsoluteOverlayPosition: function (overlay) {\n return this._jsPlumb.overlayPositions ? this._jsPlumb.overlayPositions[overlay.id] : null;\n },\n _clazzManip:function(action, clazz, dontUpdateOverlays) {\n if (!dontUpdateOverlays) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i][action + \"Class\"](clazz);\n }\n }\n },\n addClass:function(clazz, dontUpdateOverlays) {\n this._clazzManip(\"add\", clazz, dontUpdateOverlays);\n },\n removeClass:function(clazz, dontUpdateOverlays) {\n this._clazzManip(\"remove\", clazz, dontUpdateOverlays);\n }\n });\n\n// ------------------------------ END OverlayCapablejsPlumbUIComponent --------------------------------------------\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the code for Endpoints.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n * \n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n // create the drag handler for a connection\n var _makeConnectionDragHandler = function (endpoint, placeholder, _jsPlumb) {\n var stopped = false;\n return {\n drag: function () {\n if (stopped) {\n stopped = false;\n return true;\n }\n\n if (placeholder.element) {\n var _ui = _jsPlumb.getUIPosition(arguments, _jsPlumb.getZoom());\n if (_ui != null) {\n _jsPlumb.setPosition(placeholder.element, _ui);\n }\n _jsPlumb.repaint(placeholder.element, _ui);\n // always repaint the source endpoint, because only continuous/dynamic anchors cause the endpoint\n // to be repainted, so static anchors need to be told (or the endpoint gets dragged around)\n endpoint.paint({anchorPoint:endpoint.anchor.getCurrentLocation({element:endpoint})});\n }\n },\n stopDrag: function () {\n stopped = true;\n }\n };\n };\n\n // creates a placeholder div for dragging purposes, adds it, and pre-computes its offset.\n var _makeDraggablePlaceholder = function (placeholder, _jsPlumb, ipco, ips) {\n var n = _jsPlumb.createElement(\"div\", { position : \"absolute\" });\n _jsPlumb.appendElement(n);\n var id = _jsPlumb.getId(n);\n _jsPlumb.setPosition(n, ipco);\n n.style.width = ips[0] + \"px\";\n n.style.height = ips[1] + \"px\";\n _jsPlumb.manage(id, n, true); // TRANSIENT MANAGE\n // create and assign an id, and initialize the offset.\n placeholder.id = id;\n placeholder.element = n;\n };\n\n // create a floating endpoint (for drag connections)\n var _makeFloatingEndpoint = function (paintStyle, referenceAnchor, endpoint, referenceCanvas, sourceElement, _jsPlumb, _newEndpoint, scope) {\n var floatingAnchor = new _jp.FloatingAnchor({ reference: referenceAnchor, referenceCanvas: referenceCanvas, jsPlumbInstance: _jsPlumb });\n //setting the scope here should not be the way to fix that mootools issue. it should be fixed by not\n // adding the floating endpoint as a droppable. that makes more sense anyway!\n // TRANSIENT MANAGE\n return _newEndpoint({\n paintStyle: paintStyle,\n endpoint: endpoint,\n anchor: floatingAnchor,\n source: sourceElement,\n scope: scope\n });\n };\n\n var typeParameters = [ \"connectorStyle\", \"connectorHoverStyle\", \"connectorOverlays\",\n \"connector\", \"connectionType\", \"connectorClass\", \"connectorHoverClass\" ];\n\n // a helper function that tries to find a connection to the given element, and returns it if so. if elementWithPrecedence is null,\n // or no connection to it is found, we return the first connection in our list.\n var findConnectionToUseForDynamicAnchor = function (ep, elementWithPrecedence) {\n var idx = 0;\n if (elementWithPrecedence != null) {\n for (var i = 0; i < ep.connections.length; i++) {\n if (ep.connections[i].sourceId === elementWithPrecedence || ep.connections[i].targetId === elementWithPrecedence) {\n idx = i;\n break;\n }\n }\n }\n\n return ep.connections[idx];\n };\n\n _jp.Endpoint = function (params) {\n var _jsPlumb = params._jsPlumb,\n _newConnection = params.newConnection,\n _newEndpoint = params.newEndpoint;\n\n this.idPrefix = \"_jsplumb_e_\";\n this.defaultLabelLocation = [ 0.5, 0.5 ];\n this.defaultOverlayKeys = [\"Overlays\", \"EndpointOverlays\"];\n _jp.OverlayCapableJsPlumbUIComponent.apply(this, arguments);\n\n// TYPE\n\n this.appendToDefaultType({\n connectionType:params.connectionType,\n maxConnections: params.maxConnections == null ? this._jsPlumb.instance.Defaults.MaxConnections : params.maxConnections, // maximum number of connections this endpoint can be the source of.,\n paintStyle: params.endpointStyle || params.paintStyle || params.style || this._jsPlumb.instance.Defaults.EndpointStyle || _jp.Defaults.EndpointStyle,\n hoverPaintStyle: params.endpointHoverStyle || params.hoverPaintStyle || this._jsPlumb.instance.Defaults.EndpointHoverStyle || _jp.Defaults.EndpointHoverStyle,\n connectorStyle: params.connectorStyle,\n connectorHoverStyle: params.connectorHoverStyle,\n connectorClass: params.connectorClass,\n connectorHoverClass: params.connectorHoverClass,\n connectorOverlays: params.connectorOverlays,\n connector: params.connector,\n connectorTooltip: params.connectorTooltip\n });\n\n// END TYPE\n\n this._jsPlumb.enabled = !(params.enabled === false);\n this._jsPlumb.visible = true;\n this.element = _jp.getElement(params.source);\n this._jsPlumb.uuid = params.uuid;\n this._jsPlumb.floatingEndpoint = null;\n var inPlaceCopy = null;\n if (this._jsPlumb.uuid) {\n params.endpointsByUUID[this._jsPlumb.uuid] = this;\n }\n this.elementId = params.elementId;\n this.dragProxy = params.dragProxy;\n\n this._jsPlumb.connectionCost = params.connectionCost;\n this._jsPlumb.connectionsDirected = params.connectionsDirected;\n this._jsPlumb.currentAnchorClass = \"\";\n this._jsPlumb.events = {};\n\n var deleteOnEmpty = params.deleteOnEmpty === true;\n this.setDeleteOnEmpty = function(d) {\n deleteOnEmpty = d;\n };\n\n var _updateAnchorClass = function () {\n // stash old, get new\n var oldAnchorClass = _jsPlumb.endpointAnchorClassPrefix + \"-\" + this._jsPlumb.currentAnchorClass;\n this._jsPlumb.currentAnchorClass = this.anchor.getCssClass();\n var anchorClass = _jsPlumb.endpointAnchorClassPrefix + (this._jsPlumb.currentAnchorClass ? \"-\" + this._jsPlumb.currentAnchorClass : \"\");\n\n this.removeClass(oldAnchorClass);\n this.addClass(anchorClass);\n // add and remove at the same time to reduce the number of reflows.\n _jp.updateClasses(this.element, anchorClass, oldAnchorClass);\n }.bind(this);\n\n this.prepareAnchor = function(anchorParams) {\n var a = this._jsPlumb.instance.makeAnchor(anchorParams, this.elementId, _jsPlumb);\n a.bind(\"anchorChanged\", function (currentAnchor) {\n this.fire(\"anchorChanged\", {endpoint: this, anchor: currentAnchor});\n _updateAnchorClass();\n }.bind(this));\n return a;\n };\n\n this.setPreparedAnchor = function(anchor, doNotRepaint) {\n this._jsPlumb.instance.continuousAnchorFactory.clear(this.elementId);\n this.anchor = anchor;\n _updateAnchorClass();\n\n if (!doNotRepaint) {\n this._jsPlumb.instance.repaint(this.elementId);\n }\n\n return this;\n };\n\n this.setAnchor = function (anchorParams, doNotRepaint) {\n var a = this.prepareAnchor(anchorParams);\n this.setPreparedAnchor(a, doNotRepaint);\n return this;\n };\n\n var internalHover = function (state) {\n if (this.connections.length > 0) {\n for (var i = 0; i < this.connections.length; i++) {\n this.connections[i].setHover(state, false);\n }\n }\n else {\n this.setHover(state);\n }\n }.bind(this);\n\n this.bind(\"mouseover\", function () {\n internalHover(true);\n });\n this.bind(\"mouseout\", function () {\n internalHover(false);\n });\n\n // ANCHOR MANAGER\n if (!params._transient) { // in place copies, for example, are transient. they will never need to be retrieved during a paint cycle, because they dont move, and then they are deleted.\n this._jsPlumb.instance.anchorManager.add(this, this.elementId);\n }\n\n this.prepareEndpoint = function(ep, typeId) {\n var _e = function (t, p) {\n var rm = _jsPlumb.getRenderMode();\n if (_jp.Endpoints[rm][t]) {\n return new _jp.Endpoints[rm][t](p);\n }\n if (!_jsPlumb.Defaults.DoNotThrowErrors) {\n throw { msg: \"jsPlumb: unknown endpoint type '\" + t + \"'\" };\n }\n };\n\n var endpointArgs = {\n _jsPlumb: this._jsPlumb.instance,\n cssClass: params.cssClass,\n container: params.container,\n tooltip: params.tooltip,\n connectorTooltip: params.connectorTooltip,\n endpoint: this\n };\n\n var endpoint;\n\n if (_ju.isString(ep)) {\n endpoint = _e(ep, endpointArgs);\n }\n else if (_ju.isArray(ep)) {\n endpointArgs = _ju.merge(ep[1], endpointArgs);\n endpoint = _e(ep[0], endpointArgs);\n }\n else {\n endpoint = ep.clone();\n }\n\n // assign a clone function using a copy of endpointArgs. this is used when a drag starts: the endpoint that was dragged is cloned,\n // and the clone is left in its place while the original one goes off on a magical journey.\n // the copy is to get around a closure problem, in which endpointArgs ends up getting shared by\n // the whole world.\n //var argsForClone = jsPlumb.extend({}, endpointArgs);\n endpoint.clone = function () {\n // TODO this, and the code above, can be refactored to be more dry.\n if (_ju.isString(ep)) {\n return _e(ep, endpointArgs);\n }\n else if (_ju.isArray(ep)) {\n endpointArgs = _ju.merge(ep[1], endpointArgs);\n return _e(ep[0], endpointArgs);\n }\n }.bind(this);\n\n endpoint.typeId = typeId;\n return endpoint;\n };\n\n this.setEndpoint = function(ep, doNotRepaint) {\n var _ep = this.prepareEndpoint(ep);\n this.setPreparedEndpoint(_ep, true);\n };\n\n this.setPreparedEndpoint = function (ep, doNotRepaint) {\n if (this.endpoint != null) {\n this.endpoint.cleanup();\n this.endpoint.destroy();\n }\n this.endpoint = ep;\n this.type = this.endpoint.type;\n this.canvas = this.endpoint.canvas;\n };\n\n _jp.extend(this, params, typeParameters);\n\n this.isSource = params.isSource || false;\n this.isTemporarySource = params.isTemporarySource || false;\n this.isTarget = params.isTarget || false;\n\n this.connections = params.connections || [];\n this.connectorPointerEvents = params[\"connector-pointer-events\"];\n\n this.scope = params.scope || _jsPlumb.getDefaultScope();\n this.timestamp = null;\n this.reattachConnections = params.reattach || _jsPlumb.Defaults.ReattachConnections;\n this.connectionsDetachable = _jsPlumb.Defaults.ConnectionsDetachable;\n if (params.connectionsDetachable === false || params.detachable === false) {\n this.connectionsDetachable = false;\n }\n this.dragAllowedWhenFull = params.dragAllowedWhenFull !== false;\n\n if (params.onMaxConnections) {\n this.bind(\"maxConnections\", params.onMaxConnections);\n }\n\n //\n // add a connection. not part of public API.\n //\n this.addConnection = function (connection) {\n this.connections.push(connection);\n this[(this.connections.length > 0 ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointConnectedClass);\n this[(this.isFull() ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointFullClass);\n };\n\n this.detachFromConnection = function (connection, idx, doNotCleanup) {\n idx = idx == null ? this.connections.indexOf(connection) : idx;\n if (idx >= 0) {\n this.connections.splice(idx, 1);\n this[(this.connections.length > 0 ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointConnectedClass);\n this[(this.isFull() ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointFullClass);\n }\n\n if (!doNotCleanup && deleteOnEmpty && this.connections.length === 0) {\n _jsPlumb.deleteObject({\n endpoint: this,\n fireEvent: false,\n deleteAttachedObjects: doNotCleanup !== true\n });\n }\n };\n\n this.deleteEveryConnection = function(params) {\n var c = this.connections.length;\n for (var i = 0; i < c; i++) {\n _jsPlumb.deleteConnection(this.connections[0], params);\n }\n };\n\n this.detachFrom = function (targetEndpoint, fireEvent, originalEvent) {\n var c = [];\n for (var i = 0; i < this.connections.length; i++) {\n if (this.connections[i].endpoints[1] === targetEndpoint || this.connections[i].endpoints[0] === targetEndpoint) {\n c.push(this.connections[i]);\n }\n }\n for (var j = 0, count = c.length; j < count; j++) {\n _jsPlumb.deleteConnection(c[0]);\n }\n return this;\n };\n\n this.getElement = function () {\n return this.element;\n };\n\n this.setElement = function (el) {\n var parentId = this._jsPlumb.instance.getId(el),\n curId = this.elementId;\n // remove the endpoint from the list for the current endpoint's element\n _ju.removeWithFunction(params.endpointsByElement[this.elementId], function (e) {\n return e.id === this.id;\n }.bind(this));\n this.element = _jp.getElement(el);\n this.elementId = _jsPlumb.getId(this.element);\n _jsPlumb.anchorManager.rehomeEndpoint(this, curId, this.element);\n _jsPlumb.dragManager.endpointAdded(this.element);\n _ju.addToList(params.endpointsByElement, parentId, this);\n return this;\n };\n\n /**\n * private but must be exposed.\n */\n this.makeInPlaceCopy = function () {\n var loc = this.anchor.getCurrentLocation({element: this}),\n o = this.anchor.getOrientation(this),\n acc = this.anchor.getCssClass(),\n inPlaceAnchor = {\n bind: function () {\n },\n compute: function () {\n return [ loc[0], loc[1] ];\n },\n getCurrentLocation: function () {\n return [ loc[0], loc[1] ];\n },\n getOrientation: function () {\n return o;\n },\n getCssClass: function () {\n return acc;\n }\n };\n\n return _newEndpoint({\n dropOptions: params.dropOptions,\n anchor: inPlaceAnchor,\n source: this.element,\n paintStyle: this.getPaintStyle(),\n endpoint: params.hideOnDrag ? \"Blank\" : this.endpoint,\n _transient: true,\n scope: this.scope,\n reference:this\n });\n };\n\n /**\n * returns a connection from the pool; used when dragging starts. just gets the head of the array if it can.\n */\n this.connectorSelector = function () {\n return this.connections[0];\n };\n\n this.setStyle = this.setPaintStyle;\n\n this.paint = function (params) {\n params = params || {};\n var timestamp = params.timestamp, recalc = !(params.recalc === false);\n if (!timestamp || this.timestamp !== timestamp) {\n\n var info = _jsPlumb.updateOffset({ elId: this.elementId, timestamp: timestamp });\n\n var xy = params.offset ? params.offset.o : info.o;\n if (xy != null) {\n var ap = params.anchorPoint, connectorPaintStyle = params.connectorPaintStyle;\n if (ap == null) {\n var wh = params.dimensions || info.s,\n anchorParams = { xy: [ xy.left, xy.top ], wh: wh, element: this, timestamp: timestamp };\n if (recalc && this.anchor.isDynamic && this.connections.length > 0) {\n var c = findConnectionToUseForDynamicAnchor(this, params.elementWithPrecedence),\n oIdx = c.endpoints[0] === this ? 1 : 0,\n oId = oIdx === 0 ? c.sourceId : c.targetId,\n oInfo = _jsPlumb.getCachedData(oId),\n oOffset = oInfo.o, oWH = oInfo.s;\n\n anchorParams.index = oIdx === 0 ? 1 : 0;\n anchorParams.connection = c;\n anchorParams.txy = [ oOffset.left, oOffset.top ];\n anchorParams.twh = oWH;\n anchorParams.tElement = c.endpoints[oIdx];\n } else if (this.connections.length > 0) {\n anchorParams.connection = this.connections[0];\n }\n ap = this.anchor.compute(anchorParams);\n }\n\n this.endpoint.compute(ap, this.anchor.getOrientation(this), this._jsPlumb.paintStyleInUse, connectorPaintStyle || this.paintStyleInUse);\n this.endpoint.paint(this._jsPlumb.paintStyleInUse, this.anchor);\n this.timestamp = timestamp;\n\n // paint overlays\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays.hasOwnProperty(i)) {\n var o = this._jsPlumb.overlays[i];\n if (o.isVisible()) {\n this._jsPlumb.overlayPlacements[i] = o.draw(this.endpoint, this._jsPlumb.paintStyleInUse);\n o.paint(this._jsPlumb.overlayPlacements[i]);\n }\n }\n }\n }\n }\n };\n\n this.getTypeDescriptor = function () {\n return \"endpoint\";\n };\n this.isVisible = function () {\n return this._jsPlumb.visible;\n };\n\n this.repaint = this.paint;\n\n var draggingInitialised = false;\n this.initDraggable = function () {\n\n // is this a connection source? we make it draggable and have the\n // drag listener maintain a connection with a floating endpoint.\n if (!draggingInitialised && _jp.isDragSupported(this.element)) {\n var placeholderInfo = { id: null, element: null },\n jpc = null,\n existingJpc = false,\n existingJpcParams = null,\n _dragHandler = _makeConnectionDragHandler(this, placeholderInfo, _jsPlumb),\n dragOptions = params.dragOptions || {},\n defaultOpts = {},\n startEvent = _jp.dragEvents.start,\n stopEvent = _jp.dragEvents.stop,\n dragEvent = _jp.dragEvents.drag,\n beforeStartEvent = _jp.dragEvents.beforeStart,\n payload;\n\n // respond to beforeStart from katavorio; this will have, optionally, a payload of attribute values\n // that were placed there by the makeSource mousedown listener.\n var beforeStart = function(beforeStartParams) {\n payload = beforeStartParams.e.payload || {};\n };\n\n var start = function (startParams) {\n\n// ------------- first, get a connection to drag. this may be null, in which case we are dragging a new one.\n\n jpc = this.connectorSelector();\n\n// -------------------------------- now a bunch of tests about whether or not to proceed -------------------------\n\n var _continue = true;\n // if not enabled, return\n if (!this.isEnabled()) {\n _continue = false;\n }\n // if no connection and we're not a source - or temporarily a source, as is the case with makeSource - return.\n if (jpc == null && !this.isSource && !this.isTemporarySource) {\n _continue = false;\n }\n // otherwise if we're full and not allowed to drag, also return false.\n if (this.isSource && this.isFull() && !(jpc != null && this.dragAllowedWhenFull)) {\n _continue = false;\n }\n // if the connection was setup as not detachable or one of its endpoints\n // was setup as connectionsDetachable = false, or Defaults.ConnectionsDetachable\n // is set to false...\n if (jpc != null && !jpc.isDetachable(this)) {\n // .. and the endpoint is full\n if (this.isFull()) {\n _continue = false;\n } else {\n // otherwise, if not full, set the connection to null, and we will now proceed\n // to drag a new connection.\n jpc = null;\n }\n }\n\n var beforeDrag = _jsPlumb.checkCondition(jpc == null ? \"beforeDrag\" : \"beforeStartDetach\", {\n endpoint:this,\n source:this.element,\n sourceId:this.elementId,\n connection:jpc\n });\n if (beforeDrag === false) {\n _continue = false;\n }\n // else we might have been given some data. we'll pass it in to a new connection as 'data'.\n // here we also merge in the optional payload we were given on mousedown.\n else if (typeof beforeDrag === \"object\") {\n _jp.extend(beforeDrag, payload || {});\n }\n else {\n // or if no beforeDrag data, maybe use the payload on its own.\n beforeDrag = payload || {};\n }\n\n if (_continue === false) {\n // this is for mootools and yui. returning false from this causes jquery to stop drag.\n // the events are wrapped in both mootools and yui anyway, but i don't think returning\n // false from the start callback would stop a drag.\n if (_jsPlumb.stopDrag) {\n _jsPlumb.stopDrag(this.canvas);\n }\n _dragHandler.stopDrag();\n return false;\n }\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n // ok to proceed.\n\n // clear hover for all connections for this endpoint before continuing.\n for (var i = 0; i < this.connections.length; i++) {\n this.connections[i].setHover(false);\n }\n\n this.addClass(\"endpointDrag\");\n _jsPlumb.setConnectionBeingDragged(true);\n\n // if we're not full but there was a connection, make it null. we'll create a new one.\n if (jpc && !this.isFull() && this.isSource) {\n jpc = null;\n }\n\n _jsPlumb.updateOffset({ elId: this.elementId });\n\n// ---------------- make the element we will drag around, and position it -----------------------------\n\n var ipco = this._jsPlumb.instance.getOffset(this.canvas),\n canvasElement = this.canvas,\n ips = this._jsPlumb.instance.getSize(this.canvas);\n\n _makeDraggablePlaceholder(placeholderInfo, _jsPlumb, ipco, ips);\n\n // store the id of the dragging div and the source element. the drop function will pick these up. \n _jsPlumb.setAttributes(this.canvas, {\n \"dragId\": placeholderInfo.id,\n \"elId\": this.elementId\n });\n\n// ------------------- create an endpoint that will be our floating endpoint ------------------------------------\n\n var endpointToFloat = this.dragProxy || this.endpoint;\n if (this.dragProxy == null && this.connectionType != null) {\n var aae = this._jsPlumb.instance.deriveEndpointAndAnchorSpec(this.connectionType);\n if (aae.endpoints[1]) {\n endpointToFloat = aae.endpoints[1];\n }\n }\n var centerAnchor = this._jsPlumb.instance.makeAnchor(\"Center\");\n centerAnchor.isFloating = true;\n this._jsPlumb.floatingEndpoint = _makeFloatingEndpoint(this.getPaintStyle(), centerAnchor, endpointToFloat, this.canvas, placeholderInfo.element, _jsPlumb, _newEndpoint, this.scope);\n var _savedAnchor = this._jsPlumb.floatingEndpoint.anchor;\n\n\n if (jpc == null) {\n\n this.setHover(false, false);\n // create a connection. one end is this endpoint, the other is a floating endpoint. \n jpc = _newConnection({\n sourceEndpoint: this,\n targetEndpoint: this._jsPlumb.floatingEndpoint,\n source: this.element, // for makeSource with parent option. ensure source element is represented correctly.\n target: placeholderInfo.element,\n anchors: [ this.anchor, this._jsPlumb.floatingEndpoint.anchor ],\n paintStyle: params.connectorStyle, // this can be null. Connection will use the default.\n hoverPaintStyle: params.connectorHoverStyle,\n connector: params.connector, // this can also be null. Connection will use the default.\n overlays: params.connectorOverlays,\n type: this.connectionType,\n cssClass: this.connectorClass,\n hoverClass: this.connectorHoverClass,\n scope:params.scope,\n data:beforeDrag\n });\n jpc.pending = true;\n jpc.addClass(_jsPlumb.draggingClass);\n this._jsPlumb.floatingEndpoint.addClass(_jsPlumb.draggingClass);\n this._jsPlumb.floatingEndpoint.anchor = _savedAnchor;\n // fire an event that informs that a connection is being dragged\n _jsPlumb.fire(\"connectionDrag\", jpc);\n\n // register the new connection on the drag manager. This connection, at this point, is 'pending',\n // and has as its target a temporary element (the 'placeholder'). If the connection subsequently\n // becomes established, the anchor manager is informed that the target of the connection has\n // changed.\n\n _jsPlumb.anchorManager.newConnection(jpc);\n\n } else {\n existingJpc = true;\n jpc.setHover(false);\n // new anchor idx\n var anchorIdx = jpc.endpoints[0].id === this.id ? 0 : 1;\n this.detachFromConnection(jpc, null, true); // detach from the connection while dragging is occurring. but dont cleanup automatically.\n\n // store the original scope (issue 57)\n var dragScope = _jsPlumb.getDragScope(canvasElement);\n _jsPlumb.setAttribute(this.canvas, \"originalScope\", dragScope);\n\n // fire an event that informs that a connection is being dragged. we do this before\n // replacing the original target with the floating element info.\n _jsPlumb.fire(\"connectionDrag\", jpc);\n\n // now we replace ourselves with the temporary div we created above:\n if (anchorIdx === 0) {\n existingJpcParams = [ jpc.source, jpc.sourceId, canvasElement, dragScope ];\n _jsPlumb.anchorManager.sourceChanged(jpc.endpoints[anchorIdx].elementId, placeholderInfo.id, jpc, placeholderInfo.element);\n\n } else {\n existingJpcParams = [ jpc.target, jpc.targetId, canvasElement, dragScope ];\n jpc.target = placeholderInfo.element;\n jpc.targetId = placeholderInfo.id;\n\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.endpoints[anchorIdx].elementId, jpc.targetId, jpc);\n }\n\n // store the original endpoint and assign the new floating endpoint for the drag.\n jpc.suspendedEndpoint = jpc.endpoints[anchorIdx];\n\n // PROVIDE THE SUSPENDED ELEMENT, BE IT A SOURCE OR TARGET (ISSUE 39)\n jpc.suspendedElement = jpc.endpoints[anchorIdx].getElement();\n jpc.suspendedElementId = jpc.endpoints[anchorIdx].elementId;\n jpc.suspendedElementType = anchorIdx === 0 ? \"source\" : \"target\";\n\n jpc.suspendedEndpoint.setHover(false);\n this._jsPlumb.floatingEndpoint.referenceEndpoint = jpc.suspendedEndpoint;\n jpc.endpoints[anchorIdx] = this._jsPlumb.floatingEndpoint;\n\n jpc.addClass(_jsPlumb.draggingClass);\n this._jsPlumb.floatingEndpoint.addClass(_jsPlumb.draggingClass);\n }\n\n _jsPlumb.registerFloatingConnection(placeholderInfo, jpc, this._jsPlumb.floatingEndpoint);\n\n // // register it and register connection on it.\n // _jsPlumb.floatingConnections[placeholderInfo.id] = jpc;\n //\n // // only register for the target endpoint; we will not be dragging the source at any time\n // // before this connection is either discarded or made into a permanent connection.\n // _ju.addToList(params.endpointsByElement, placeholderInfo.id, this._jsPlumb.floatingEndpoint);\n\n\n // tell jsplumb about it\n _jsPlumb.currentlyDragging = true;\n }.bind(this);\n\n var stop = function () {\n _jsPlumb.setConnectionBeingDragged(false);\n\n if (jpc && jpc.endpoints != null) {\n // get the actual drop event (decode from library args to stop function)\n var originalEvent = _jsPlumb.getDropEvent(arguments);\n // unlock the other endpoint (if it is dynamic, it would have been locked at drag start)\n var idx = _jsPlumb.getFloatingAnchorIndex(jpc);\n jpc.endpoints[idx === 0 ? 1 : 0].anchor.unlock();\n // TODO: Dont want to know about css classes inside jsplumb, ideally.\n jpc.removeClass(_jsPlumb.draggingClass);\n\n // if we have the floating endpoint then the connection has not been dropped\n // on another endpoint. If it is a new connection we throw it away. If it is an\n // existing connection we check to see if we should reattach it, throwing it away\n // if not.\n if (this._jsPlumb && (jpc.deleteConnectionNow || jpc.endpoints[idx] === this._jsPlumb.floatingEndpoint)) {\n // 6a. if the connection was an existing one...\n if (existingJpc && jpc.suspendedEndpoint) {\n // fix for issue35, thanks Sylvain Gizard: when firing the detach event make sure the\n // floating endpoint has been replaced.\n if (idx === 0) {\n jpc.floatingElement = jpc.source;\n jpc.floatingId = jpc.sourceId;\n jpc.floatingEndpoint = jpc.endpoints[0];\n jpc.floatingIndex = 0;\n jpc.source = existingJpcParams[0];\n jpc.sourceId = existingJpcParams[1];\n } else {\n // keep a copy of the floating element; the anchor manager will want to clean up.\n jpc.floatingElement = jpc.target;\n jpc.floatingId = jpc.targetId;\n jpc.floatingEndpoint = jpc.endpoints[1];\n jpc.floatingIndex = 1;\n jpc.target = existingJpcParams[0];\n jpc.targetId = existingJpcParams[1];\n }\n\n var fe = this._jsPlumb.floatingEndpoint; // store for later removal.\n // restore the original scope (issue 57)\n _jsPlumb.setDragScope(existingJpcParams[2], existingJpcParams[3]);\n jpc.endpoints[idx] = jpc.suspendedEndpoint;\n // if the connection should be reattached, or the other endpoint refuses detach, then\n // reset the connection to its original state\n if (jpc.isReattach() || jpc._forceReattach || jpc._forceDetach || !_jsPlumb.deleteConnection(jpc, {originalEvent: originalEvent})) {\n\n jpc.setHover(false);\n jpc._forceDetach = null;\n jpc._forceReattach = null;\n this._jsPlumb.floatingEndpoint.detachFromConnection(jpc);\n jpc.suspendedEndpoint.addConnection(jpc);\n\n // TODO this code is duplicated in lots of places...and there is nothing external\n // in the code; it all refers to the connection itself. we could add a\n // `checkSanity(connection)` method to anchorManager that did this.\n if (idx === 1) {\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.floatingId, jpc.targetId, jpc);\n }\n else {\n _jsPlumb.anchorManager.sourceChanged(jpc.floatingId, jpc.sourceId, jpc, jpc.source);\n }\n\n _jsPlumb.repaint(existingJpcParams[1]);\n }\n else {\n _jsPlumb.deleteObject({endpoint: fe});\n }\n }\n }\n\n // makeTargets sets this flag, to tell us we have been replaced and should delete this object.\n if (this.deleteAfterDragStop) {\n _jsPlumb.deleteObject({endpoint: this});\n }\n else {\n if (this._jsPlumb) {\n this.paint({recalc: false});\n }\n }\n\n // although the connection is no longer valid, there are use cases where this is useful.\n _jsPlumb.fire(\"connectionDragStop\", jpc, originalEvent);\n // fire this event to give people more fine-grained control (connectionDragStop fires a lot)\n if (jpc.pending) {\n _jsPlumb.fire(\"connectionAborted\", jpc, originalEvent);\n }\n // tell jsplumb that dragging is finished.\n _jsPlumb.currentlyDragging = false;\n jpc.suspendedElement = null;\n jpc.suspendedEndpoint = null;\n jpc = null;\n }\n\n // if no endpoints, jpc already cleaned up. but still we want to ensure we're reset properly.\n // remove the element associated with the floating endpoint\n // (and its associated floating endpoint and visual artefacts)\n if (placeholderInfo && placeholderInfo.element) {\n _jsPlumb.remove(placeholderInfo.element, false, false);\n }\n // remove the inplace copy\n if (inPlaceCopy) {\n _jsPlumb.deleteObject({endpoint: inPlaceCopy});\n }\n\n if (this._jsPlumb) {\n // make our canvas visible (TODO: hand off to library; we should not know about DOM)\n this.canvas.style.visibility = \"visible\";\n // unlock our anchor\n this.anchor.unlock();\n // clear floating anchor.\n this._jsPlumb.floatingEndpoint = null;\n }\n\n }.bind(this);\n\n dragOptions = _jp.extend(defaultOpts, dragOptions);\n dragOptions.scope = this.scope || dragOptions.scope;\n dragOptions[beforeStartEvent] = _ju.wrap(dragOptions[beforeStartEvent], beforeStart, false);\n dragOptions[startEvent] = _ju.wrap(dragOptions[startEvent], start, false);\n // extracted drag handler function so can be used by makeSource\n dragOptions[dragEvent] = _ju.wrap(dragOptions[dragEvent], _dragHandler.drag);\n dragOptions[stopEvent] = _ju.wrap(dragOptions[stopEvent], stop);\n dragOptions.multipleDrop = false;\n\n dragOptions.canDrag = function () {\n return this.isSource || this.isTemporarySource || (this.connections.length > 0 && this.connectionsDetachable !== false);\n }.bind(this);\n\n _jsPlumb.initDraggable(this.canvas, dragOptions, \"internal\");\n\n this.canvas._jsPlumbRelatedElement = this.element;\n\n draggingInitialised = true;\n }\n };\n\n var ep = params.endpoint || this._jsPlumb.instance.Defaults.Endpoint || _jp.Defaults.Endpoint;\n this.setEndpoint(ep, true);\n var anchorParamsToUse = params.anchor ? params.anchor : params.anchors ? params.anchors : (_jsPlumb.Defaults.Anchor || \"Top\");\n this.setAnchor(anchorParamsToUse, true);\n\n // finally, set type if it was provided\n var type = [ \"default\", (params.type || \"\")].join(\" \");\n this.addType(type, params.data, true);\n this.canvas = this.endpoint.canvas;\n this.canvas._jsPlumb = this;\n\n this.initDraggable();\n\n // pulled this out into a function so we can reuse it for the inPlaceCopy canvas; you can now drop detached connections\n // back onto the endpoint you detached it from.\n var _initDropTarget = function (canvas, isTransient, endpoint, referenceEndpoint) {\n\n if (_jp.isDropSupported(this.element)) {\n var dropOptions = params.dropOptions || _jsPlumb.Defaults.DropOptions || _jp.Defaults.DropOptions;\n dropOptions = _jp.extend({}, dropOptions);\n dropOptions.scope = dropOptions.scope || this.scope;\n var dropEvent = _jp.dragEvents.drop,\n overEvent = _jp.dragEvents.over,\n outEvent = _jp.dragEvents.out,\n _ep = this,\n drop = _jsPlumb.EndpointDropHandler({\n getEndpoint: function () {\n return _ep;\n },\n jsPlumb: _jsPlumb,\n enabled: function () {\n return endpoint != null ? endpoint.isEnabled() : true;\n },\n isFull: function () {\n return endpoint.isFull();\n },\n element: this.element,\n elementId: this.elementId,\n isSource: this.isSource,\n isTarget: this.isTarget,\n addClass: function (clazz) {\n _ep.addClass(clazz);\n },\n removeClass: function (clazz) {\n _ep.removeClass(clazz);\n },\n isDropAllowed: function () {\n return _ep.isDropAllowed.apply(_ep, arguments);\n },\n reference:referenceEndpoint,\n isRedrop:function(jpc, dhParams) {\n return jpc.suspendedEndpoint && dhParams.reference && (jpc.suspendedEndpoint.id === dhParams.reference.id);\n }\n });\n\n dropOptions[dropEvent] = _ju.wrap(dropOptions[dropEvent], drop, true);\n dropOptions[overEvent] = _ju.wrap(dropOptions[overEvent], function () {\n var draggable = _jp.getDragObject(arguments),\n id = _jsPlumb.getAttribute(_jp.getElement(draggable), \"dragId\"),\n _jpc = _jsPlumb.getFloatingConnectionFor(id);//_jsPlumb.floatingConnections[id];\n\n if (_jpc != null) {\n var idx = _jsPlumb.getFloatingAnchorIndex(_jpc);\n // here we should fire the 'over' event if we are a target and this is a new connection,\n // or we are the same as the floating endpoint.\n var _cont = (this.isTarget && idx !== 0) || (_jpc.suspendedEndpoint && this.referenceEndpoint && this.referenceEndpoint.id === _jpc.suspendedEndpoint.id);\n if (_cont) {\n var bb = _jsPlumb.checkCondition(\"checkDropAllowed\", {\n sourceEndpoint: _jpc.endpoints[idx],\n targetEndpoint: this,\n connection: _jpc\n });\n this[(bb ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointDropAllowedClass);\n this[(bb ? \"remove\" : \"add\") + \"Class\"](_jsPlumb.endpointDropForbiddenClass);\n _jpc.endpoints[idx].anchor.over(this.anchor, this);\n }\n }\n }.bind(this));\n\n dropOptions[outEvent] = _ju.wrap(dropOptions[outEvent], function () {\n var draggable = _jp.getDragObject(arguments),\n id = draggable == null ? null : _jsPlumb.getAttribute(_jp.getElement(draggable), \"dragId\"),\n _jpc = id ? _jsPlumb.getFloatingConnectionFor(id) : null;\n\n if (_jpc != null) {\n var idx = _jsPlumb.getFloatingAnchorIndex(_jpc);\n var _cont = (this.isTarget && idx !== 0) || (_jpc.suspendedEndpoint && this.referenceEndpoint && this.referenceEndpoint.id === _jpc.suspendedEndpoint.id);\n if (_cont) {\n this.removeClass(_jsPlumb.endpointDropAllowedClass);\n this.removeClass(_jsPlumb.endpointDropForbiddenClass);\n _jpc.endpoints[idx].anchor.out();\n }\n }\n }.bind(this));\n\n _jsPlumb.initDroppable(canvas, dropOptions, \"internal\", isTransient);\n }\n }.bind(this);\n\n // Initialise the endpoint's canvas as a drop target. The drop handler will take care of the logic of whether\n // something can actually be dropped.\n if (!this.anchor.isFloating) {\n _initDropTarget(this.canvas, !(params._transient || this.anchor.isFloating), this, params.reference);\n }\n\n return this;\n };\n\n _ju.extend(_jp.Endpoint, _jp.OverlayCapableJsPlumbUIComponent, {\n\n setVisible: function (v, doNotChangeConnections, doNotNotifyOtherEndpoint) {\n this._jsPlumb.visible = v;\n if (this.canvas) {\n this.canvas.style.display = v ? \"block\" : \"none\";\n }\n this[v ? \"showOverlays\" : \"hideOverlays\"]();\n if (!doNotChangeConnections) {\n for (var i = 0; i < this.connections.length; i++) {\n this.connections[i].setVisible(v);\n if (!doNotNotifyOtherEndpoint) {\n var oIdx = this === this.connections[i].endpoints[0] ? 1 : 0;\n // only change the other endpoint if this is its only connection.\n if (this.connections[i].endpoints[oIdx].connections.length === 1) {\n this.connections[i].endpoints[oIdx].setVisible(v, true, true);\n }\n }\n }\n }\n },\n getAttachedElements: function () {\n return this.connections;\n },\n applyType: function (t, doNotRepaint) {\n this.setPaintStyle(t.endpointStyle || t.paintStyle, doNotRepaint);\n this.setHoverPaintStyle(t.endpointHoverStyle || t.hoverPaintStyle, doNotRepaint);\n if (t.maxConnections != null) {\n this._jsPlumb.maxConnections = t.maxConnections;\n }\n if (t.scope) {\n this.scope = t.scope;\n }\n _jp.extend(this, t, typeParameters);\n if (t.cssClass != null && this.canvas) {\n this._jsPlumb.instance.addClass(this.canvas, t.cssClass);\n }\n _jp.OverlayCapableJsPlumbUIComponent.applyType(this, t);\n },\n isEnabled: function () {\n return this._jsPlumb.enabled;\n },\n setEnabled: function (e) {\n this._jsPlumb.enabled = e;\n },\n cleanup: function () {\n var anchorClass = this._jsPlumb.instance.endpointAnchorClassPrefix + (this._jsPlumb.currentAnchorClass ? \"-\" + this._jsPlumb.currentAnchorClass : \"\");\n _jp.removeClass(this.element, anchorClass);\n this.anchor = null;\n this.endpoint.cleanup(true);\n this.endpoint.destroy();\n this.endpoint = null;\n // drag/drop\n this._jsPlumb.instance.destroyDraggable(this.canvas, \"internal\");\n this._jsPlumb.instance.destroyDroppable(this.canvas, \"internal\");\n },\n setHover: function (h) {\n if (this.endpoint && this._jsPlumb && !this._jsPlumb.instance.isConnectionBeingDragged()) {\n this.endpoint.setHover(h);\n }\n },\n isFull: function () {\n return this._jsPlumb.maxConnections === 0 ? true : !(this.isFloating() || this._jsPlumb.maxConnections < 0 || this.connections.length < this._jsPlumb.maxConnections);\n },\n /**\n * private but needs to be exposed.\n */\n isFloating: function () {\n return this.anchor != null && this.anchor.isFloating;\n },\n isConnectedTo: function (endpoint) {\n var found = false;\n if (endpoint) {\n for (var i = 0; i < this.connections.length; i++) {\n if (this.connections[i].endpoints[1] === endpoint || this.connections[i].endpoints[0] === endpoint) {\n found = true;\n break;\n }\n }\n }\n return found;\n },\n getConnectionCost: function () {\n return this._jsPlumb.connectionCost;\n },\n setConnectionCost: function (c) {\n this._jsPlumb.connectionCost = c;\n },\n areConnectionsDirected: function () {\n return this._jsPlumb.connectionsDirected;\n },\n setConnectionsDirected: function (b) {\n this._jsPlumb.connectionsDirected = b;\n },\n setElementId: function (_elId) {\n this.elementId = _elId;\n this.anchor.elementId = _elId;\n },\n setReferenceElement: function (_el) {\n this.element = _jp.getElement(_el);\n },\n setDragAllowedWhenFull: function (allowed) {\n this.dragAllowedWhenFull = allowed;\n },\n equals: function (endpoint) {\n return this.anchor.equals(endpoint.anchor);\n },\n getUuid: function () {\n return this._jsPlumb.uuid;\n },\n computeAnchor: function (params) {\n return this.anchor.compute(params);\n }\n });\n\n root.jsPlumbInstance.prototype.EndpointDropHandler = function (dhParams) {\n return function (e) {\n\n var _jsPlumb = dhParams.jsPlumb;\n\n // remove the classes that are added dynamically. drop is neither forbidden nor allowed now that\n // the drop is finishing.\n dhParams.removeClass(_jsPlumb.endpointDropAllowedClass);\n dhParams.removeClass(_jsPlumb.endpointDropForbiddenClass);\n\n var originalEvent = _jsPlumb.getDropEvent(arguments),\n draggable = _jsPlumb.getDragObject(arguments),\n id = _jsPlumb.getAttribute(draggable, \"dragId\"),\n elId = _jsPlumb.getAttribute(draggable, \"elId\"),\n scope = _jsPlumb.getAttribute(draggable, \"originalScope\"),\n jpc = _jsPlumb.getFloatingConnectionFor(id);\n\n // if no active connection, bail.\n if (jpc == null) {\n return;\n }\n\n // calculate if this is an existing connection.\n var existingConnection = jpc.suspendedEndpoint != null;\n\n // if suspended endpoint exists but has been cleaned up, bail. This means it's an existing connection\n // that has been detached and will shortly be discarded.\n if (existingConnection && jpc.suspendedEndpoint._jsPlumb == null) {\n return;\n }\n\n // get the drop endpoint. for a normal connection this is just the one that would replace the currently\n // floating endpoint. for a makeTarget this is a new endpoint that is created on drop. But we leave that to\n // the handler to figure out.\n var _ep = dhParams.getEndpoint(jpc);\n\n // If we're not given an endpoint to use, bail.\n if (_ep == null) {\n return;\n }\n\n // if this is a drop back where the connection came from, mark it force reattach and\n // return; the stop handler will reattach. without firing an event.\n if (dhParams.isRedrop(jpc, dhParams)) {\n jpc._forceReattach = true;\n jpc.setHover(false);\n if (dhParams.maybeCleanup) {\n dhParams.maybeCleanup(_ep);\n }\n return;\n }\n\n // ensure we dont bother trying to drop sources on non-source eps, and same for target.\n var idx = _jsPlumb.getFloatingAnchorIndex(jpc);\n if ((idx === 0 && !dhParams.isSource)|| (idx === 1 && !dhParams.isTarget)){\n if (dhParams.maybeCleanup) {\n dhParams.maybeCleanup(_ep);\n }\n return;\n }\n\n if (dhParams.onDrop) {\n dhParams.onDrop(jpc);\n }\n\n // restore the original scope if necessary (issue 57)\n if (scope) {\n _jsPlumb.setDragScope(draggable, scope);\n }\n\n // if the target of the drop is full, fire an event (we abort below)\n // makeTarget: keep.\n var isFull = dhParams.isFull(e);\n if (isFull) {\n _ep.fire(\"maxConnections\", {\n endpoint: this,\n connection: jpc,\n maxConnections: _ep._jsPlumb.maxConnections\n }, originalEvent);\n }\n //\n // if endpoint enabled, not full, and matches the index of the floating endpoint...\n if (!isFull && dhParams.enabled()) {\n var _doContinue = true;\n\n // before testing for beforeDrop, reset the connection's source/target to be the actual DOM elements\n // involved (that is, stash any temporary stuff used for dragging. but we need to keep it around in\n // order that the anchor manager can clean things up properly).\n if (idx === 0) {\n jpc.floatingElement = jpc.source;\n jpc.floatingId = jpc.sourceId;\n jpc.floatingEndpoint = jpc.endpoints[0];\n jpc.floatingIndex = 0;\n jpc.source = dhParams.element;\n jpc.sourceId = dhParams.elementId;\n } else {\n jpc.floatingElement = jpc.target;\n jpc.floatingId = jpc.targetId;\n jpc.floatingEndpoint = jpc.endpoints[1];\n jpc.floatingIndex = 1;\n jpc.target = dhParams.element;\n jpc.targetId = dhParams.elementId;\n }\n\n // if this is an existing connection and detach is not allowed we won't continue. The connection's\n // endpoints have been reinstated; everything is back to how it was.\n if (existingConnection && jpc.suspendedEndpoint.id !== _ep.id) {\n if (!jpc.isDetachAllowed(jpc) || !jpc.endpoints[idx].isDetachAllowed(jpc) || !jpc.suspendedEndpoint.isDetachAllowed(jpc) || !_jsPlumb.checkCondition(\"beforeDetach\", jpc)) {\n _doContinue = false;\n }\n }\n\n// ------------ wrap the execution path in a function so we can support asynchronous beforeDrop\n\n var continueFunction = function (optionalData) {\n // remove this jpc from the current endpoint, which is a floating endpoint that we will\n // subsequently discard.\n jpc.endpoints[idx].detachFromConnection(jpc);\n\n // if there's a suspended endpoint, detach it from the connection.\n if (jpc.suspendedEndpoint) {\n jpc.suspendedEndpoint.detachFromConnection(jpc);\n }\n\n jpc.endpoints[idx] = _ep;\n _ep.addConnection(jpc);\n\n // copy our parameters in to the connection:\n var params = _ep.getParameters();\n for (var aParam in params) {\n jpc.setParameter(aParam, params[aParam]);\n }\n\n if (!existingConnection) {\n // if not an existing connection and\n if (params.draggable) {\n _jsPlumb.initDraggable(this.element, dhParams.dragOptions, \"internal\", _jsPlumb);\n }\n }\n else {\n var suspendedElementId = jpc.suspendedEndpoint.elementId;\n _jsPlumb.fireMoveEvent({\n index: idx,\n originalSourceId: idx === 0 ? suspendedElementId : jpc.sourceId,\n newSourceId: idx === 0 ? _ep.elementId : jpc.sourceId,\n originalTargetId: idx === 1 ? suspendedElementId : jpc.targetId,\n newTargetId: idx === 1 ? _ep.elementId : jpc.targetId,\n originalSourceEndpoint: idx === 0 ? jpc.suspendedEndpoint : jpc.endpoints[0],\n newSourceEndpoint: idx === 0 ? _ep : jpc.endpoints[0],\n originalTargetEndpoint: idx === 1 ? jpc.suspendedEndpoint : jpc.endpoints[1],\n newTargetEndpoint: idx === 1 ? _ep : jpc.endpoints[1],\n connection: jpc\n }, originalEvent);\n }\n\n if (idx === 1) {\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.floatingId, jpc.targetId, jpc);\n }\n else {\n _jsPlumb.anchorManager.sourceChanged(jpc.floatingId, jpc.sourceId, jpc, jpc.source);\n }\n\n // when makeSource has uniqueEndpoint:true, we want to create connections with new endpoints\n // that are subsequently deleted. So makeSource sets `finalEndpoint`, which is the Endpoint to\n // which the connection should be attached. The `detachFromConnection` call below results in the\n // temporary endpoint being cleaned up.\n if (jpc.endpoints[0].finalEndpoint) {\n var _toDelete = jpc.endpoints[0];\n _toDelete.detachFromConnection(jpc);\n jpc.endpoints[0] = jpc.endpoints[0].finalEndpoint;\n jpc.endpoints[0].addConnection(jpc);\n }\n\n // if optionalData was given, merge it onto the connection's data.\n if (_ju.isObject(optionalData)) {\n jpc.mergeData(optionalData);\n }\n // finalise will inform the anchor manager and also add to\n // connectionsByScope if necessary.\n _jsPlumb.finaliseConnection(jpc, null, originalEvent, false);\n jpc.setHover(false);\n\n // SP continuous anchor flush\n _jsPlumb.revalidate(jpc.endpoints[0].element);\n\n }.bind(this);\n\n var dontContinueFunction = function () {\n // otherwise just put it back on the endpoint it was on before the drag.\n if (jpc.suspendedEndpoint) {\n jpc.endpoints[idx] = jpc.suspendedEndpoint;\n jpc.setHover(false);\n jpc._forceDetach = true;\n if (idx === 0) {\n jpc.source = jpc.suspendedEndpoint.element;\n jpc.sourceId = jpc.suspendedEndpoint.elementId;\n } else {\n jpc.target = jpc.suspendedEndpoint.element;\n jpc.targetId = jpc.suspendedEndpoint.elementId;\n }\n jpc.suspendedEndpoint.addConnection(jpc);\n\n // TODO checkSanity\n if (idx === 1) {\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.floatingId, jpc.targetId, jpc);\n }\n else {\n _jsPlumb.anchorManager.sourceChanged(jpc.floatingId, jpc.sourceId, jpc, jpc.source);\n }\n\n _jsPlumb.repaint(jpc.sourceId);\n jpc._forceDetach = false;\n }\n };\n\n// --------------------------------------\n // now check beforeDrop. this will be available only on Endpoints that are setup to\n // have a beforeDrop condition (although, secretly, under the hood all Endpoints and\n // the Connection have them, because they are on jsPlumbUIComponent. shhh!), because\n // it only makes sense to have it on a target endpoint.\n _doContinue = _doContinue && dhParams.isDropAllowed(jpc.sourceId, jpc.targetId, jpc.scope, jpc, _ep);// && jpc.pending;\n\n if (_doContinue) {\n continueFunction(_doContinue);\n return true;\n }\n else {\n dontContinueFunction();\n }\n }\n\n if (dhParams.maybeCleanup) {\n dhParams.maybeCleanup(_ep);\n }\n\n _jsPlumb.currentlyDragging = false;\n };\n };\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the code for Connections.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this,\n _jp = root.jsPlumb,\n _ju = root.jsPlumbUtil;\n\n var makeConnector = function (_jsPlumb, renderMode, connectorName, connectorArgs, forComponent) {\n // first make sure we have a cache for the specified renderer\n _jp.Connectors[renderMode] = _jp.Connectors[renderMode] || {};\n\n // now see if the one we want exists; if not we will try to make it\n if (_jp.Connectors[renderMode][connectorName] == null) {\n\n if (_jp.Connectors[connectorName] == null) {\n if (!_jsPlumb.Defaults.DoNotThrowErrors) {\n throw new TypeError(\"jsPlumb: unknown connector type '\" + connectorName + \"'\");\n } else {\n return null;\n }\n }\n\n _jp.Connectors[renderMode][connectorName] = function() {\n _jp.Connectors[connectorName].apply(this, arguments);\n _jp.ConnectorRenderers[renderMode].apply(this, arguments);\n };\n\n _ju.extend(_jp.Connectors[renderMode][connectorName], [ _jp.Connectors[connectorName], _jp.ConnectorRenderers[renderMode]]);\n\n }\n\n return new _jp.Connectors[renderMode][connectorName](connectorArgs, forComponent);\n },\n _makeAnchor = function (anchorParams, elementId, _jsPlumb) {\n return (anchorParams) ? _jsPlumb.makeAnchor(anchorParams, elementId, _jsPlumb) : null;\n },\n _updateConnectedClass = function (conn, element, _jsPlumb, remove) {\n if (element != null) {\n element._jsPlumbConnections = element._jsPlumbConnections || {};\n if (remove) {\n delete element._jsPlumbConnections[conn.id];\n }\n else {\n element._jsPlumbConnections[conn.id] = true;\n }\n\n if (_ju.isEmpty(element._jsPlumbConnections)) {\n _jsPlumb.removeClass(element, _jsPlumb.connectedClass);\n }\n else {\n _jsPlumb.addClass(element, _jsPlumb.connectedClass);\n }\n }\n };\n\n _jp.Connection = function (params) {\n var _newEndpoint = params.newEndpoint;\n\n this.id = params.id;\n this.connector = null;\n this.idPrefix = \"_jsplumb_c_\";\n this.defaultLabelLocation = 0.5;\n this.defaultOverlayKeys = [\"Overlays\", \"ConnectionOverlays\"];\n // if a new connection is the result of moving some existing connection, params.previousConnection\n // will have that Connection in it. listeners for the jsPlumbConnection event can look for that\n // member and take action if they need to.\n this.previousConnection = params.previousConnection;\n this.source = _jp.getElement(params.source);\n this.target = _jp.getElement(params.target);\n\n\n _jp.OverlayCapableJsPlumbUIComponent.apply(this, arguments);\n\n // sourceEndpoint and targetEndpoint override source/target, if they are present. but \n // source is not overridden if the Endpoint has declared it is not the final target of a connection;\n // instead we use the source that the Endpoint declares will be the final source element.\n if (params.sourceEndpoint) {\n this.source = params.sourceEndpoint.getElement();\n this.sourceId = params.sourceEndpoint.elementId;\n } else {\n this.sourceId = this._jsPlumb.instance.getId(this.source);\n }\n\n if (params.targetEndpoint) {\n this.target = params.targetEndpoint.getElement();\n this.targetId = params.targetEndpoint.elementId;\n } else {\n this.targetId = this._jsPlumb.instance.getId(this.target);\n }\n\n\n this.scope = params.scope; // scope may have been passed in to the connect call. if it wasn't, we will pull it from the source endpoint, after having initialised the endpoints. \n this.endpoints = [];\n this.endpointStyles = [];\n\n var _jsPlumb = this._jsPlumb.instance;\n\n _jsPlumb.manage(this.sourceId, this.source);\n _jsPlumb.manage(this.targetId, this.target);\n\n this._jsPlumb.visible = true;\n\n this._jsPlumb.params = {\n cssClass: params.cssClass,\n container: params.container,\n \"pointer-events\": params[\"pointer-events\"],\n editorParams: params.editorParams,\n overlays: params.overlays\n };\n this._jsPlumb.lastPaintedAt = null;\n\n // listen to mouseover and mouseout events passed from the container delegate.\n this.bind(\"mouseover\", function () {\n this.setHover(true);\n }.bind(this));\n this.bind(\"mouseout\", function () {\n this.setHover(false);\n }.bind(this));\n\n\n// INITIALISATION CODE\n\n this.makeEndpoint = function (isSource, el, elId, ep) {\n elId = elId || this._jsPlumb.instance.getId(el);\n return this.prepareEndpoint(_jsPlumb, _newEndpoint, this, ep, isSource ? 0 : 1, params, el, elId);\n };\n\n // if type given, get the endpoint definitions mapping to that type from the jsplumb instance, and use those.\n // we apply types at the end of this constructor but endpoints are only honoured in a type definition at\n // create time.\n if (params.type) {\n params.endpoints = params.endpoints || this._jsPlumb.instance.deriveEndpointAndAnchorSpec(params.type).endpoints;\n }\n\n var eS = this.makeEndpoint(true, this.source, this.sourceId, params.sourceEndpoint),\n eT = this.makeEndpoint(false, this.target, this.targetId, params.targetEndpoint);\n\n if (eS) {\n _ju.addToList(params.endpointsByElement, this.sourceId, eS);\n }\n if (eT) {\n _ju.addToList(params.endpointsByElement, this.targetId, eT);\n }\n // if scope not set, set it to be the scope for the source endpoint.\n if (!this.scope) {\n this.scope = this.endpoints[0].scope;\n }\n\n // if explicitly told to (or not to) delete endpoints when empty, override endpoint's preferences\n if (params.deleteEndpointsOnEmpty != null) {\n this.endpoints[0].setDeleteOnEmpty(params.deleteEndpointsOnEmpty);\n this.endpoints[1].setDeleteOnEmpty(params.deleteEndpointsOnEmpty);\n }\n\n// -------------------------- DEFAULT TYPE ---------------------------------------------\n\n // DETACHABLE\n var _detachable = _jsPlumb.Defaults.ConnectionsDetachable;\n if (params.detachable === false) {\n _detachable = false;\n }\n if (this.endpoints[0].connectionsDetachable === false) {\n _detachable = false;\n }\n if (this.endpoints[1].connectionsDetachable === false) {\n _detachable = false;\n }\n // REATTACH\n var _reattach = params.reattach || this.endpoints[0].reattachConnections || this.endpoints[1].reattachConnections || _jsPlumb.Defaults.ReattachConnections;\n\n this.appendToDefaultType({\n detachable: _detachable,\n reattach: _reattach,\n paintStyle:this.endpoints[0].connectorStyle || this.endpoints[1].connectorStyle || params.paintStyle || _jsPlumb.Defaults.PaintStyle || _jp.Defaults.PaintStyle,\n hoverPaintStyle:this.endpoints[0].connectorHoverStyle || this.endpoints[1].connectorHoverStyle || params.hoverPaintStyle || _jsPlumb.Defaults.HoverPaintStyle || _jp.Defaults.HoverPaintStyle\n });\n\n var _suspendedAt = _jsPlumb.getSuspendedAt();\n if (!_jsPlumb.isSuspendDrawing()) {\n // paint the endpoints\n var myInfo = _jsPlumb.getCachedData(this.sourceId),\n myOffset = myInfo.o, myWH = myInfo.s,\n otherInfo = _jsPlumb.getCachedData(this.targetId),\n otherOffset = otherInfo.o,\n otherWH = otherInfo.s,\n initialTimestamp = _suspendedAt || _jsPlumb.timestamp(),\n anchorLoc = this.endpoints[0].anchor.compute({\n xy: [ myOffset.left, myOffset.top ], wh: myWH, element: this.endpoints[0],\n elementId: this.endpoints[0].elementId,\n txy: [ otherOffset.left, otherOffset.top ], twh: otherWH, tElement: this.endpoints[1],\n timestamp: initialTimestamp\n });\n\n this.endpoints[0].paint({ anchorLoc: anchorLoc, timestamp: initialTimestamp });\n\n anchorLoc = this.endpoints[1].anchor.compute({\n xy: [ otherOffset.left, otherOffset.top ], wh: otherWH, element: this.endpoints[1],\n elementId: this.endpoints[1].elementId,\n txy: [ myOffset.left, myOffset.top ], twh: myWH, tElement: this.endpoints[0],\n timestamp: initialTimestamp\n });\n this.endpoints[1].paint({ anchorLoc: anchorLoc, timestamp: initialTimestamp });\n }\n\n this.getTypeDescriptor = function () {\n return \"connection\";\n };\n this.getAttachedElements = function () {\n return this.endpoints;\n };\n\n this.isDetachable = function (ep) {\n return this._jsPlumb.detachable === false ? false : ep != null ? ep.connectionsDetachable === true : this._jsPlumb.detachable === true;\n };\n this.setDetachable = function (detachable) {\n this._jsPlumb.detachable = detachable === true;\n };\n this.isReattach = function () {\n return this._jsPlumb.reattach === true || this.endpoints[0].reattachConnections === true || this.endpoints[1].reattachConnections === true;\n };\n this.setReattach = function (reattach) {\n this._jsPlumb.reattach = reattach === true;\n };\n\n// END INITIALISATION CODE\n\n\n// COST + DIRECTIONALITY\n // if cost not supplied, try to inherit from source endpoint\n this._jsPlumb.cost = params.cost || this.endpoints[0].getConnectionCost();\n this._jsPlumb.directed = params.directed;\n // inherit directed flag if set no source endpoint\n if (params.directed == null) {\n this._jsPlumb.directed = this.endpoints[0].areConnectionsDirected();\n }\n// END COST + DIRECTIONALITY\n\n// PARAMETERS\n // merge all the parameters objects into the connection. parameters set\n // on the connection take precedence; then source endpoint params, then\n // finally target endpoint params.\n var _p = _jp.extend({}, this.endpoints[1].getParameters());\n _jp.extend(_p, this.endpoints[0].getParameters());\n _jp.extend(_p, this.getParameters());\n this.setParameters(_p);\n// END PARAMETERS\n\n// PAINTING\n\n this.setConnector(this.endpoints[0].connector || this.endpoints[1].connector || params.connector || _jsPlumb.Defaults.Connector || _jp.Defaults.Connector, true);\n var data = params.data == null || !_ju.isObject(params.data) ? {} : params.data;\n this.getData = function() { return data; };\n this.setData = function(d) { data = d || {}; };\n this.mergeData = function(d) { data = _jp.extend(data, d); };\n\n // the very last thing we do is apply types, if there are any.\n var _types = [ \"default\", this.endpoints[0].connectionType, this.endpoints[1].connectionType, params.type ].join(\" \");\n if (/[^\\s]/.test(_types)) {\n this.addType(_types, params.data, true);\n }\n\n this.updateConnectedClass();\n\n// END PAINTING \n };\n\n _ju.extend(_jp.Connection, _jp.OverlayCapableJsPlumbUIComponent, {\n applyType: function (t, doNotRepaint, typeMap) {\n\n var _connector = null;\n if (t.connector != null) {\n _connector = this.getCachedTypeItem(\"connector\", typeMap.connector);\n if (_connector == null) {\n _connector = this.prepareConnector(t.connector, typeMap.connector);\n this.cacheTypeItem(\"connector\", _connector, typeMap.connector);\n }\n this.setPreparedConnector(_connector);\n }\n\n // none of these things result in the creation of objects so can be ignored.\n if (t.detachable != null) {\n this.setDetachable(t.detachable);\n }\n if (t.reattach != null) {\n this.setReattach(t.reattach);\n }\n if (t.scope) {\n this.scope = t.scope;\n }\n\n if (t.cssClass != null && this.canvas) {\n this._jsPlumb.instance.addClass(this.canvas, t.cssClass);\n }\n\n var _anchors = null;\n // this also results in the creation of objects.\n if (t.anchor) {\n // note that even if the param was anchor, we store `anchors`.\n _anchors = this.getCachedTypeItem(\"anchors\", typeMap.anchor);\n if (_anchors == null) {\n _anchors = [ this._jsPlumb.instance.makeAnchor(t.anchor), this._jsPlumb.instance.makeAnchor(t.anchor) ];\n this.cacheTypeItem(\"anchors\", _anchors, typeMap.anchor);\n }\n }\n else if (t.anchors) {\n _anchors = this.getCachedTypeItem(\"anchors\", typeMap.anchors);\n if (_anchors == null) {\n _anchors = [\n this._jsPlumb.instance.makeAnchor(t.anchors[0]),\n this._jsPlumb.instance.makeAnchor(t.anchors[1])\n ];\n this.cacheTypeItem(\"anchors\", _anchors, typeMap.anchors);\n }\n }\n if (_anchors != null) {\n this.endpoints[0].anchor = _anchors[0];\n this.endpoints[1].anchor = _anchors[1];\n if (this.endpoints[1].anchor.isDynamic) {\n this._jsPlumb.instance.repaint(this.endpoints[1].elementId);\n }\n }\n\n _jp.OverlayCapableJsPlumbUIComponent.applyType(this, t);\n },\n addClass: function (c, informEndpoints) {\n if (informEndpoints) {\n this.endpoints[0].addClass(c);\n this.endpoints[1].addClass(c);\n if (this.suspendedEndpoint) {\n this.suspendedEndpoint.addClass(c);\n }\n }\n if (this.connector) {\n this.connector.addClass(c);\n }\n },\n removeClass: function (c, informEndpoints) {\n if (informEndpoints) {\n this.endpoints[0].removeClass(c);\n this.endpoints[1].removeClass(c);\n if (this.suspendedEndpoint) {\n this.suspendedEndpoint.removeClass(c);\n }\n }\n if (this.connector) {\n this.connector.removeClass(c);\n }\n },\n isVisible: function () {\n return this._jsPlumb.visible;\n },\n setVisible: function (v) {\n this._jsPlumb.visible = v;\n if (this.connector) {\n this.connector.setVisible(v);\n }\n this.repaint();\n },\n cleanup: function () {\n this.updateConnectedClass(true);\n this.endpoints = null;\n this.source = null;\n this.target = null;\n if (this.connector != null) {\n this.connector.cleanup(true);\n this.connector.destroy(true);\n }\n this.connector = null;\n },\n updateConnectedClass:function(remove) {\n if (this._jsPlumb) {\n _updateConnectedClass(this, this.source, this._jsPlumb.instance, remove);\n _updateConnectedClass(this, this.target, this._jsPlumb.instance, remove);\n }\n },\n setHover: function (state) {\n if (this.connector && this._jsPlumb && !this._jsPlumb.instance.isConnectionBeingDragged()) {\n this.connector.setHover(state);\n root.jsPlumb[state ? \"addClass\" : \"removeClass\"](this.source, this._jsPlumb.instance.hoverSourceClass);\n root.jsPlumb[state ? \"addClass\" : \"removeClass\"](this.target, this._jsPlumb.instance.hoverTargetClass);\n }\n },\n getUuids:function() {\n return [ this.endpoints[0].getUuid(), this.endpoints[1].getUuid() ];\n },\n getCost: function () {\n return this._jsPlumb ? this._jsPlumb.cost : -Infinity;\n },\n setCost: function (c) {\n this._jsPlumb.cost = c;\n },\n isDirected: function () {\n return this._jsPlumb.directed;\n },\n getConnector: function () {\n return this.connector;\n },\n prepareConnector:function(connectorSpec, typeId) {\n var connectorArgs = {\n _jsPlumb: this._jsPlumb.instance,\n cssClass: this._jsPlumb.params.cssClass,\n container: this._jsPlumb.params.container,\n \"pointer-events\": this._jsPlumb.params[\"pointer-events\"]\n },\n renderMode = this._jsPlumb.instance.getRenderMode(),\n connector;\n\n if (_ju.isString(connectorSpec)) {\n connector = makeConnector(this._jsPlumb.instance, renderMode, connectorSpec, connectorArgs, this);\n } // lets you use a string as shorthand.\n else if (_ju.isArray(connectorSpec)) {\n if (connectorSpec.length === 1) {\n connector = makeConnector(this._jsPlumb.instance, renderMode, connectorSpec[0], connectorArgs, this);\n }\n else {\n connector = makeConnector(this._jsPlumb.instance, renderMode, connectorSpec[0], _ju.merge(connectorSpec[1], connectorArgs), this);\n }\n }\n if (typeId != null) {\n connector.typeId = typeId;\n }\n return connector;\n },\n setPreparedConnector: function(connector, doNotRepaint, doNotChangeListenerComponent, typeId) {\n\n if (this.connector !== connector) {\n\n var previous, previousClasses = \"\";\n // the connector will not be cleaned up if it was set as part of a type, because `typeId` will be set on it\n // and we havent passed in `true` for \"force\" here.\n if (this.connector != null) {\n previous = this.connector;\n previousClasses = previous.getClass();\n this.connector.cleanup();\n this.connector.destroy();\n }\n\n this.connector = connector;\n if (typeId) {\n this.cacheTypeItem(\"connector\", connector, typeId);\n }\n\n this.canvas = this.connector.canvas;\n this.bgCanvas = this.connector.bgCanvas;\n\n // put classes from prior connector onto the canvas\n this.addClass(previousClasses);\n\n // new: instead of binding listeners per connector, we now just have one delegate on the container.\n // so for that handler we set the connection as the '_jsPlumb' member of the canvas element, and\n // bgCanvas, if it exists, which it does right now in the VML renderer, so it won't from v 2.0.0 onwards.\n if (this.canvas) {\n this.canvas._jsPlumb = this;\n }\n if (this.bgCanvas) {\n this.bgCanvas._jsPlumb = this;\n }\n\n if (previous != null) {\n var o = this.getOverlays();\n for (var i = 0; i < o.length; i++) {\n if (o[i].transfer) {\n o[i].transfer(this.connector);\n }\n }\n }\n\n if (!doNotChangeListenerComponent) {\n this.setListenerComponent(this.connector);\n }\n if (!doNotRepaint) {\n this.repaint();\n }\n }\n },\n setConnector: function (connectorSpec, doNotRepaint, doNotChangeListenerComponent, typeId) {\n var connector = this.prepareConnector(connectorSpec, typeId);\n this.setPreparedConnector(connector, doNotRepaint, doNotChangeListenerComponent, typeId);\n },\n paint: function (params) {\n\n if (!this._jsPlumb.instance.isSuspendDrawing() && this._jsPlumb.visible) {\n params = params || {};\n var timestamp = params.timestamp,\n // if the moving object is not the source we must transpose the two references.\n swap = false,\n tId = swap ? this.sourceId : this.targetId, sId = swap ? this.targetId : this.sourceId,\n tIdx = swap ? 0 : 1, sIdx = swap ? 1 : 0;\n\n if (timestamp == null || timestamp !== this._jsPlumb.lastPaintedAt) {\n var sourceInfo = this._jsPlumb.instance.updateOffset({elId:sId}).o,\n targetInfo = this._jsPlumb.instance.updateOffset({elId:tId}).o,\n sE = this.endpoints[sIdx], tE = this.endpoints[tIdx];\n\n var sAnchorP = sE.anchor.getCurrentLocation({xy: [sourceInfo.left, sourceInfo.top], wh: [sourceInfo.width, sourceInfo.height], element: sE, timestamp: timestamp}),\n tAnchorP = tE.anchor.getCurrentLocation({xy: [targetInfo.left, targetInfo.top], wh: [targetInfo.width, targetInfo.height], element: tE, timestamp: timestamp});\n\n this.connector.resetBounds();\n\n this.connector.compute({\n sourcePos: sAnchorP,\n targetPos: tAnchorP,\n sourceOrientation:sE.anchor.getOrientation(sE),\n targetOrientation:tE.anchor.getOrientation(tE),\n sourceEndpoint: this.endpoints[sIdx],\n targetEndpoint: this.endpoints[tIdx],\n \"stroke-width\": this._jsPlumb.paintStyleInUse.strokeWidth,\n sourceInfo: sourceInfo,\n targetInfo: targetInfo\n });\n\n var overlayExtents = { minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity };\n\n // compute overlays. we do this first so we can get their placements, and adjust the\n // container if needs be (if an overlay would be clipped)\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays.hasOwnProperty(i)) {\n var o = this._jsPlumb.overlays[i];\n if (o.isVisible()) {\n this._jsPlumb.overlayPlacements[i] = o.draw(this.connector, this._jsPlumb.paintStyleInUse, this.getAbsoluteOverlayPosition(o));\n overlayExtents.minX = Math.min(overlayExtents.minX, this._jsPlumb.overlayPlacements[i].minX);\n overlayExtents.maxX = Math.max(overlayExtents.maxX, this._jsPlumb.overlayPlacements[i].maxX);\n overlayExtents.minY = Math.min(overlayExtents.minY, this._jsPlumb.overlayPlacements[i].minY);\n overlayExtents.maxY = Math.max(overlayExtents.maxY, this._jsPlumb.overlayPlacements[i].maxY);\n }\n }\n }\n\n var lineWidth = parseFloat(this._jsPlumb.paintStyleInUse.strokeWidth || 1) / 2,\n outlineWidth = parseFloat(this._jsPlumb.paintStyleInUse.strokeWidth || 0),\n extents = {\n xmin: Math.min(this.connector.bounds.minX - (lineWidth + outlineWidth), overlayExtents.minX),\n ymin: Math.min(this.connector.bounds.minY - (lineWidth + outlineWidth), overlayExtents.minY),\n xmax: Math.max(this.connector.bounds.maxX + (lineWidth + outlineWidth), overlayExtents.maxX),\n ymax: Math.max(this.connector.bounds.maxY + (lineWidth + outlineWidth), overlayExtents.maxY)\n };\n // paint the connector.\n this.connector.paint(this._jsPlumb.paintStyleInUse, null, extents);\n // and then the overlays\n for (var j in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays.hasOwnProperty(j)) {\n var p = this._jsPlumb.overlays[j];\n if (p.isVisible()) {\n p.paint(this._jsPlumb.overlayPlacements[j], extents);\n }\n }\n }\n }\n this._jsPlumb.lastPaintedAt = timestamp;\n }\n },\n repaint: function (params) {\n var p = jsPlumb.extend(params || {}, {});\n p.elId = this.sourceId;\n this.paint(p);\n },\n prepareEndpoint: function (_jsPlumb, _newEndpoint, conn, existing, index, params, element, elementId) {\n var e;\n if (existing) {\n conn.endpoints[index] = existing;\n existing.addConnection(conn);\n } else {\n if (!params.endpoints) {\n params.endpoints = [ null, null ];\n }\n var ep = params.endpoints[index] || params.endpoint || _jsPlumb.Defaults.Endpoints[index] || _jp.Defaults.Endpoints[index] || _jsPlumb.Defaults.Endpoint || _jp.Defaults.Endpoint;\n if (!params.endpointStyles) {\n params.endpointStyles = [ null, null ];\n }\n if (!params.endpointHoverStyles) {\n params.endpointHoverStyles = [ null, null ];\n }\n var es = params.endpointStyles[index] || params.endpointStyle || _jsPlumb.Defaults.EndpointStyles[index] || _jp.Defaults.EndpointStyles[index] || _jsPlumb.Defaults.EndpointStyle || _jp.Defaults.EndpointStyle;\n // Endpoints derive their fill from the connector's stroke, if no fill was specified.\n if (es.fill == null && params.paintStyle != null) {\n es.fill = params.paintStyle.stroke;\n }\n\n if (es.outlineStroke == null && params.paintStyle != null) {\n es.outlineStroke = params.paintStyle.outlineStroke;\n }\n if (es.outlineWidth == null && params.paintStyle != null) {\n es.outlineWidth = params.paintStyle.outlineWidth;\n }\n\n var ehs = params.endpointHoverStyles[index] || params.endpointHoverStyle || _jsPlumb.Defaults.EndpointHoverStyles[index] || _jp.Defaults.EndpointHoverStyles[index] || _jsPlumb.Defaults.EndpointHoverStyle || _jp.Defaults.EndpointHoverStyle;\n // endpoint hover fill style is derived from connector's hover stroke style\n if (params.hoverPaintStyle != null) {\n if (ehs == null) {\n ehs = {};\n }\n if (ehs.fill == null) {\n ehs.fill = params.hoverPaintStyle.stroke;\n }\n }\n var a = params.anchors ? params.anchors[index] :\n params.anchor ? params.anchor :\n _makeAnchor(_jsPlumb.Defaults.Anchors[index], elementId, _jsPlumb) ||\n _makeAnchor(_jp.Defaults.Anchors[index], elementId, _jsPlumb) ||\n _makeAnchor(_jsPlumb.Defaults.Anchor, elementId, _jsPlumb) ||\n _makeAnchor(_jp.Defaults.Anchor, elementId, _jsPlumb),\n u = params.uuids ? params.uuids[index] : null;\n\n e = _newEndpoint({\n paintStyle: es, hoverPaintStyle: ehs, endpoint: ep, connections: [ conn ],\n uuid: u, anchor: a, source: element, scope: params.scope,\n reattach: params.reattach || _jsPlumb.Defaults.ReattachConnections,\n detachable: params.detachable || _jsPlumb.Defaults.ConnectionsDetachable\n });\n if (existing == null) {\n e.setDeleteOnEmpty(true);\n }\n conn.endpoints[index] = e;\n\n if (params.drawEndpoints === false) {\n e.setVisible(false, true, true);\n }\n\n }\n return e;\n }\n\n }); // END Connection class \n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the code for creating and manipulating anchors.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n\n var root = this,\n _ju = root.jsPlumbUtil,\n _jp = root.jsPlumb;\n\n //\n // manages anchors for all elements.\n //\n _jp.AnchorManager = function (params) {\n var _amEndpoints = {},\n continuousAnchorLocations = {},\n continuousAnchorOrientations = {},\n connectionsByElementId = {},\n self = this,\n anchorLists = {},\n jsPlumbInstance = params.jsPlumbInstance,\n floatingConnections = {},\n // used by placeAnchors function\n placeAnchorsOnLine = function (desc, elementDimensions, elementPosition, connections, horizontal, otherMultiplier, reverse) {\n var a = [], step = elementDimensions[horizontal ? 0 : 1] / (connections.length + 1);\n\n for (var i = 0; i < connections.length; i++) {\n var val = (i + 1) * step, other = otherMultiplier * elementDimensions[horizontal ? 1 : 0];\n if (reverse) {\n val = elementDimensions[horizontal ? 0 : 1] - val;\n }\n\n var dx = (horizontal ? val : other), x = elementPosition[0] + dx, xp = dx / elementDimensions[0],\n dy = (horizontal ? other : val), y = elementPosition[1] + dy, yp = dy / elementDimensions[1];\n\n a.push([ x, y, xp, yp, connections[i][1], connections[i][2] ]);\n }\n\n return a;\n },\n // used by edgeSortFunctions\n currySort = function (reverseAngles) {\n return function (a, b) {\n var r = true;\n if (reverseAngles) {\n r = a[0][0] < b[0][0];\n }\n else {\n r = a[0][0] > b[0][0];\n }\n return r === false ? -1 : 1;\n };\n },\n // used by edgeSortFunctions\n leftSort = function (a, b) {\n // first get adjusted values\n var p1 = a[0][0] < 0 ? -Math.PI - a[0][0] : Math.PI - a[0][0],\n p2 = b[0][0] < 0 ? -Math.PI - b[0][0] : Math.PI - b[0][0];\n if (p1 > p2) {\n return 1;\n }\n else {\n return -1;\n }\n },\n // used by placeAnchors\n edgeSortFunctions = {\n \"top\": function (a, b) {\n return a[0] > b[0] ? 1 : -1;\n },\n \"right\": currySort(true),\n \"bottom\": currySort(true),\n \"left\": leftSort\n },\n // used by placeAnchors\n _sortHelper = function (_array, _fn) {\n return _array.sort(_fn);\n },\n // used by AnchorManager.redraw\n placeAnchors = function (elementId, _anchorLists) {\n var cd = jsPlumbInstance.getCachedData(elementId), sS = cd.s, sO = cd.o,\n placeSomeAnchors = function (desc, elementDimensions, elementPosition, unsortedConnections, isHorizontal, otherMultiplier, orientation) {\n if (unsortedConnections.length > 0) {\n var sc = _sortHelper(unsortedConnections, edgeSortFunctions[desc]), // puts them in order based on the target element's pos on screen\n reverse = desc === \"right\" || desc === \"top\",\n anchors = placeAnchorsOnLine(desc, elementDimensions,\n elementPosition, sc,\n isHorizontal, otherMultiplier, reverse);\n\n // takes a computed anchor position and adjusts it for parent offset and scroll, then stores it.\n var _setAnchorLocation = function (endpoint, anchorPos) {\n continuousAnchorLocations[endpoint.id] = [ anchorPos[0], anchorPos[1], anchorPos[2], anchorPos[3] ];\n continuousAnchorOrientations[endpoint.id] = orientation;\n };\n\n for (var i = 0; i < anchors.length; i++) {\n var c = anchors[i][4], weAreSource = c.endpoints[0].elementId === elementId, weAreTarget = c.endpoints[1].elementId === elementId;\n if (weAreSource) {\n _setAnchorLocation(c.endpoints[0], anchors[i]);\n }\n if (weAreTarget) {\n _setAnchorLocation(c.endpoints[1], anchors[i]);\n }\n }\n }\n };\n\n placeSomeAnchors(\"bottom\", sS, [sO.left, sO.top], _anchorLists.bottom, true, 1, [0, 1]);\n placeSomeAnchors(\"top\", sS, [sO.left, sO.top], _anchorLists.top, true, 0, [0, -1]);\n placeSomeAnchors(\"left\", sS, [sO.left, sO.top], _anchorLists.left, false, 0, [-1, 0]);\n placeSomeAnchors(\"right\", sS, [sO.left, sO.top], _anchorLists.right, false, 1, [1, 0]);\n };\n\n this.reset = function () {\n _amEndpoints = {};\n connectionsByElementId = {};\n anchorLists = {};\n };\n this.addFloatingConnection = function (key, conn) {\n floatingConnections[key] = conn;\n };\n this.removeFloatingConnection = function (key) {\n delete floatingConnections[key];\n };\n this.newConnection = function (conn) {\n var sourceId = conn.sourceId, targetId = conn.targetId,\n ep = conn.endpoints,\n doRegisterTarget = true,\n registerConnection = function (otherIndex, otherEndpoint, otherAnchor, elId, c) {\n if ((sourceId === targetId) && otherAnchor.isContinuous) {\n // remove the target endpoint's canvas. we dont need it.\n conn._jsPlumb.instance.removeElement(ep[1].canvas);\n doRegisterTarget = false;\n }\n _ju.addToList(connectionsByElementId, elId, [c, otherEndpoint, otherAnchor.constructor === _jp.DynamicAnchor]);\n };\n\n registerConnection(0, ep[0], ep[0].anchor, targetId, conn);\n if (doRegisterTarget) {\n registerConnection(1, ep[1], ep[1].anchor, sourceId, conn);\n }\n };\n var removeEndpointFromAnchorLists = function (endpoint) {\n (function (list, eId) {\n if (list) { // transient anchors dont get entries in this list.\n var f = function (e) {\n return e[4] === eId;\n };\n _ju.removeWithFunction(list.top, f);\n _ju.removeWithFunction(list.left, f);\n _ju.removeWithFunction(list.bottom, f);\n _ju.removeWithFunction(list.right, f);\n }\n })(anchorLists[endpoint.elementId], endpoint.id);\n };\n this.connectionDetached = function (connInfo, doNotRedraw) {\n var connection = connInfo.connection || connInfo,\n sourceId = connInfo.sourceId,\n targetId = connInfo.targetId,\n ep = connection.endpoints,\n removeConnection = function (otherIndex, otherEndpoint, otherAnchor, elId, c) {\n _ju.removeWithFunction(connectionsByElementId[elId], function (_c) {\n return _c[0].id === c.id;\n });\n };\n\n removeConnection(1, ep[1], ep[1].anchor, sourceId, connection);\n removeConnection(0, ep[0], ep[0].anchor, targetId, connection);\n if (connection.floatingId) {\n removeConnection(connection.floatingIndex, connection.floatingEndpoint, connection.floatingEndpoint.anchor, connection.floatingId, connection);\n removeEndpointFromAnchorLists(connection.floatingEndpoint);\n }\n\n // remove from anchorLists\n removeEndpointFromAnchorLists(connection.endpoints[0]);\n removeEndpointFromAnchorLists(connection.endpoints[1]);\n\n if (!doNotRedraw) {\n self.redraw(connection.sourceId);\n if (connection.targetId !== connection.sourceId) {\n self.redraw(connection.targetId);\n }\n }\n };\n this.add = function (endpoint, elementId) {\n _ju.addToList(_amEndpoints, elementId, endpoint);\n };\n this.changeId = function (oldId, newId) {\n connectionsByElementId[newId] = connectionsByElementId[oldId];\n _amEndpoints[newId] = _amEndpoints[oldId];\n delete connectionsByElementId[oldId];\n delete _amEndpoints[oldId];\n };\n this.getConnectionsFor = function (elementId) {\n return connectionsByElementId[elementId] || [];\n };\n this.getEndpointsFor = function (elementId) {\n return _amEndpoints[elementId] || [];\n };\n this.deleteEndpoint = function (endpoint) {\n _ju.removeWithFunction(_amEndpoints[endpoint.elementId], function (e) {\n return e.id === endpoint.id;\n });\n removeEndpointFromAnchorLists(endpoint);\n };\n this.clearFor = function (elementId) {\n delete _amEndpoints[elementId];\n _amEndpoints[elementId] = [];\n };\n // updates the given anchor list by either updating an existing anchor's info, or adding it. this function\n // also removes the anchor from its previous list, if the edge it is on has changed.\n // all connections found along the way (those that are connected to one of the faces this function\n // operates on) are added to the connsToPaint list, as are their endpoints. in this way we know to repaint\n // them wthout having to calculate anything else about them.\n var _updateAnchorList = function (lists, theta, order, conn, aBoolean, otherElId, idx, reverse, edgeId, elId, connsToPaint, endpointsToPaint) {\n // first try to find the exact match, but keep track of the first index of a matching element id along the way.s\n var exactIdx = -1,\n firstMatchingElIdx = -1,\n endpoint = conn.endpoints[idx],\n endpointId = endpoint.id,\n oIdx = [1, 0][idx],\n values = [\n [ theta, order ],\n conn,\n aBoolean,\n otherElId,\n endpointId\n ],\n listToAddTo = lists[edgeId],\n listToRemoveFrom = endpoint._continuousAnchorEdge ? lists[endpoint._continuousAnchorEdge] : null,\n i,\n candidate;\n\n if (listToRemoveFrom) {\n var rIdx = _ju.findWithFunction(listToRemoveFrom, function (e) {\n return e[4] === endpointId;\n });\n if (rIdx !== -1) {\n listToRemoveFrom.splice(rIdx, 1);\n // get all connections from this list\n for (i = 0; i < listToRemoveFrom.length; i++) {\n candidate = listToRemoveFrom[i][1];\n _ju.addWithFunction(connsToPaint, candidate, function (c) {\n return c.id === candidate.id;\n });\n _ju.addWithFunction(endpointsToPaint, listToRemoveFrom[i][1].endpoints[idx], function (e) {\n return e.id === candidate.endpoints[idx].id;\n });\n _ju.addWithFunction(endpointsToPaint, listToRemoveFrom[i][1].endpoints[oIdx], function (e) {\n return e.id === candidate.endpoints[oIdx].id;\n });\n }\n }\n }\n\n for (i = 0; i < listToAddTo.length; i++) {\n candidate = listToAddTo[i][1];\n if (params.idx === 1 && listToAddTo[i][3] === otherElId && firstMatchingElIdx === -1) {\n firstMatchingElIdx = i;\n }\n _ju.addWithFunction(connsToPaint, candidate, function (c) {\n return c.id === candidate.id;\n });\n _ju.addWithFunction(endpointsToPaint, listToAddTo[i][1].endpoints[idx], function (e) {\n return e.id === candidate.endpoints[idx].id;\n });\n _ju.addWithFunction(endpointsToPaint, listToAddTo[i][1].endpoints[oIdx], function (e) {\n return e.id === candidate.endpoints[oIdx].id;\n });\n }\n if (exactIdx !== -1) {\n listToAddTo[exactIdx] = values;\n }\n else {\n var insertIdx = reverse ? firstMatchingElIdx !== -1 ? firstMatchingElIdx : 0 : listToAddTo.length; // of course we will get this from having looked through the array shortly.\n listToAddTo.splice(insertIdx, 0, values);\n }\n\n // store this for next time.\n endpoint._continuousAnchorEdge = edgeId;\n };\n\n //\n // find the entry in an endpoint's list for this connection and update its target endpoint\n // with the current target in the connection.\n // This method and sourceChanged need to be folder into one.\n //\n this.updateOtherEndpoint = function (sourceElId, oldTargetId, newTargetId, connection) {\n var sIndex = _ju.findWithFunction(connectionsByElementId[sourceElId], function (i) {\n return i[0].id === connection.id;\n }),\n tIndex = _ju.findWithFunction(connectionsByElementId[oldTargetId], function (i) {\n return i[0].id === connection.id;\n });\n\n // update or add data for source\n if (sIndex !== -1) {\n connectionsByElementId[sourceElId][sIndex][0] = connection;\n connectionsByElementId[sourceElId][sIndex][1] = connection.endpoints[1];\n connectionsByElementId[sourceElId][sIndex][2] = connection.endpoints[1].anchor.constructor === _jp.DynamicAnchor;\n }\n\n // remove entry for previous target (if there)\n if (tIndex > -1) {\n connectionsByElementId[oldTargetId].splice(tIndex, 1);\n // add entry for new target\n _ju.addToList(connectionsByElementId, newTargetId, [connection, connection.endpoints[0], connection.endpoints[0].anchor.constructor === _jp.DynamicAnchor]);\n }\n\n connection.updateConnectedClass();\n };\n\n //\n // notification that the connection given has changed source from the originalId to the newId.\n // This involves:\n // 1. removing the connection from the list of connections stored for the originalId\n // 2. updating the source information for the target of the connection\n // 3. re-registering the connection in connectionsByElementId with the newId\n //\n this.sourceChanged = function (originalId, newId, connection, newElement) {\n if (originalId !== newId) {\n\n connection.sourceId = newId;\n connection.source = newElement;\n\n // remove the entry that points from the old source to the target\n _ju.removeWithFunction(connectionsByElementId[originalId], function (info) {\n return info[0].id === connection.id;\n });\n // find entry for target and update it\n var tIdx = _ju.findWithFunction(connectionsByElementId[connection.targetId], function (i) {\n return i[0].id === connection.id;\n });\n if (tIdx > -1) {\n connectionsByElementId[connection.targetId][tIdx][0] = connection;\n connectionsByElementId[connection.targetId][tIdx][1] = connection.endpoints[0];\n connectionsByElementId[connection.targetId][tIdx][2] = connection.endpoints[0].anchor.constructor === _jp.DynamicAnchor;\n }\n // add entry for new source\n _ju.addToList(connectionsByElementId, newId, [connection, connection.endpoints[1], connection.endpoints[1].anchor.constructor === _jp.DynamicAnchor]);\n\n // TODO SP not final on this yet. when a user drags an existing connection and it turns into a self\n // loop, then this code hides the target endpoint (by removing it from the DOM) But I think this should\n // occur only if the anchor is Continuous\n if (connection.endpoints[1].anchor.isContinuous) {\n if (connection.source === connection.target) {\n connection._jsPlumb.instance.removeElement(connection.endpoints[1].canvas);\n }\n else {\n if (connection.endpoints[1].canvas.parentNode == null) {\n connection._jsPlumb.instance.appendElement(connection.endpoints[1].canvas);\n }\n }\n }\n\n connection.updateConnectedClass();\n }\n };\n\n //\n // moves the given endpoint from `currentId` to `element`.\n // This involves:\n //\n // 1. changing the key in _amEndpoints under which the endpoint is stored\n // 2. changing the source or target values in all of the endpoint's connections\n // 3. changing the array in connectionsByElementId in which the endpoint's connections\n // are stored (done by either sourceChanged or updateOtherEndpoint)\n //\n this.rehomeEndpoint = function (ep, currentId, element) {\n var eps = _amEndpoints[currentId] || [],\n elementId = jsPlumbInstance.getId(element);\n\n if (elementId !== currentId) {\n var idx = eps.indexOf(ep);\n if (idx > -1) {\n var _ep = eps.splice(idx, 1)[0];\n self.add(_ep, elementId);\n }\n }\n\n for (var i = 0; i < ep.connections.length; i++) {\n if (ep.connections[i].sourceId === currentId) {\n self.sourceChanged(currentId, ep.elementId, ep.connections[i], ep.element);\n }\n else if (ep.connections[i].targetId === currentId) {\n ep.connections[i].targetId = ep.elementId;\n ep.connections[i].target = ep.element;\n self.updateOtherEndpoint(ep.connections[i].sourceId, currentId, ep.elementId, ep.connections[i]);\n }\n }\n };\n\n this.redraw = function (elementId, ui, timestamp, offsetToUI, clearEdits, doNotRecalcEndpoint) {\n\n if (!jsPlumbInstance.isSuspendDrawing()) {\n // get all the endpoints for this element\n var ep = _amEndpoints[elementId] || [],\n endpointConnections = connectionsByElementId[elementId] || [],\n connectionsToPaint = [],\n endpointsToPaint = [],\n anchorsToUpdate = [];\n\n timestamp = timestamp || jsPlumbInstance.timestamp();\n // offsetToUI are values that would have been calculated in the dragManager when registering\n // an endpoint for an element that had a parent (somewhere in the hierarchy) that had been\n // registered as draggable.\n offsetToUI = offsetToUI || {left: 0, top: 0};\n if (ui) {\n ui = {\n left: ui.left + offsetToUI.left,\n top: ui.top + offsetToUI.top\n };\n }\n\n // valid for one paint cycle.\n var myOffset = jsPlumbInstance.updateOffset({ elId: elementId, offset: ui, recalc: false, timestamp: timestamp }),\n orientationCache = {};\n\n // actually, first we should compute the orientation of this element to all other elements to which\n // this element is connected with a continuous anchor (whether both ends of the connection have\n // a continuous anchor or just one)\n\n for (var i = 0; i < endpointConnections.length; i++) {\n var conn = endpointConnections[i][0],\n sourceId = conn.sourceId,\n targetId = conn.targetId,\n sourceContinuous = conn.endpoints[0].anchor.isContinuous,\n targetContinuous = conn.endpoints[1].anchor.isContinuous;\n\n if (sourceContinuous || targetContinuous) {\n var oKey = sourceId + \"_\" + targetId,\n o = orientationCache[oKey],\n oIdx = conn.sourceId === elementId ? 1 : 0;\n\n if (sourceContinuous && !anchorLists[sourceId]) {\n anchorLists[sourceId] = { top: [], right: [], bottom: [], left: [] };\n }\n if (targetContinuous && !anchorLists[targetId]) {\n anchorLists[targetId] = { top: [], right: [], bottom: [], left: [] };\n }\n\n if (elementId !== targetId) {\n jsPlumbInstance.updateOffset({ elId: targetId, timestamp: timestamp });\n }\n if (elementId !== sourceId) {\n jsPlumbInstance.updateOffset({ elId: sourceId, timestamp: timestamp });\n }\n\n var td = jsPlumbInstance.getCachedData(targetId),\n sd = jsPlumbInstance.getCachedData(sourceId);\n\n if (targetId === sourceId && (sourceContinuous || targetContinuous)) {\n // here we may want to improve this by somehow determining the face we'd like\n // to put the connector on. ideally, when drawing, the face should be calculated\n // by determining which face is closest to the point at which the mouse button\n // was released. for now, we're putting it on the top face.\n _updateAnchorList( anchorLists[sourceId], -Math.PI / 2, 0, conn, false, targetId, 0, false, \"top\", sourceId, connectionsToPaint, endpointsToPaint);\n _updateAnchorList( anchorLists[targetId], -Math.PI / 2, 0, conn, false, sourceId, 1, false, \"top\", targetId, connectionsToPaint, endpointsToPaint);\n }\n else {\n if (!o) {\n o = this.calculateOrientation(sourceId, targetId, sd.o, td.o, conn.endpoints[0].anchor, conn.endpoints[1].anchor, conn);\n orientationCache[oKey] = o;\n // this would be a performance enhancement, but the computed angles need to be clamped to\n //the (-PI/2 -> PI/2) range in order for the sorting to work properly.\n /* orientationCache[oKey2] = {\n orientation:o.orientation,\n a:[o.a[1], o.a[0]],\n theta:o.theta + Math.PI,\n theta2:o.theta2 + Math.PI\n };*/\n }\n if (sourceContinuous) {\n _updateAnchorList(anchorLists[sourceId], o.theta, 0, conn, false, targetId, 0, false, o.a[0], sourceId, connectionsToPaint, endpointsToPaint);\n }\n if (targetContinuous) {\n _updateAnchorList(anchorLists[targetId], o.theta2, -1, conn, true, sourceId, 1, true, o.a[1], targetId, connectionsToPaint, endpointsToPaint);\n }\n }\n\n if (sourceContinuous) {\n _ju.addWithFunction(anchorsToUpdate, sourceId, function (a) {\n return a === sourceId;\n });\n }\n if (targetContinuous) {\n _ju.addWithFunction(anchorsToUpdate, targetId, function (a) {\n return a === targetId;\n });\n }\n _ju.addWithFunction(connectionsToPaint, conn, function (c) {\n return c.id === conn.id;\n });\n if ((sourceContinuous && oIdx === 0) || (targetContinuous && oIdx === 1)) {\n _ju.addWithFunction(endpointsToPaint, conn.endpoints[oIdx], function (e) {\n return e.id === conn.endpoints[oIdx].id;\n });\n }\n }\n }\n\n // place Endpoints whose anchors are continuous but have no Connections\n for (i = 0; i < ep.length; i++) {\n if (ep[i].connections.length === 0 && ep[i].anchor.isContinuous) {\n if (!anchorLists[elementId]) {\n anchorLists[elementId] = { top: [], right: [], bottom: [], left: [] };\n }\n _updateAnchorList(anchorLists[elementId], -Math.PI / 2, 0, {endpoints: [ep[i], ep[i]], paint: function () {\n }}, false, elementId, 0, false, ep[i].anchor.getDefaultFace(), elementId, connectionsToPaint, endpointsToPaint);\n _ju.addWithFunction(anchorsToUpdate, elementId, function (a) {\n return a === elementId;\n });\n }\n }\n\n // now place all the continuous anchors we need to;\n for (i = 0; i < anchorsToUpdate.length; i++) {\n placeAnchors(anchorsToUpdate[i], anchorLists[anchorsToUpdate[i]]);\n }\n\n // now that continuous anchors have been placed, paint all the endpoints for this element\n for (i = 0; i < ep.length; i++) {\n ep[i].paint({ timestamp: timestamp, offset: myOffset, dimensions: myOffset.s, recalc: doNotRecalcEndpoint !== true });\n }\n\n // ... and any other endpoints we came across as a result of the continuous anchors.\n for (i = 0; i < endpointsToPaint.length; i++) {\n var cd = jsPlumbInstance.getCachedData(endpointsToPaint[i].elementId);\n //endpointsToPaint[i].paint({ timestamp: timestamp, offset: cd, dimensions: cd.s });\n endpointsToPaint[i].paint({ timestamp: null, offset: cd, dimensions: cd.s });\n }\n\n // paint all the standard and \"dynamic connections\", which are connections whose other anchor is\n // static and therefore does need to be recomputed; we make sure that happens only one time.\n\n // TODO we could have compiled a list of these in the first pass through connections; might save some time.\n for (i = 0; i < endpointConnections.length; i++) {\n var otherEndpoint = endpointConnections[i][1];\n if (otherEndpoint.anchor.constructor === _jp.DynamicAnchor) {\n otherEndpoint.paint({ elementWithPrecedence: elementId, timestamp: timestamp });\n _ju.addWithFunction(connectionsToPaint, endpointConnections[i][0], function (c) {\n return c.id === endpointConnections[i][0].id;\n });\n // all the connections for the other endpoint now need to be repainted\n for (var k = 0; k < otherEndpoint.connections.length; k++) {\n if (otherEndpoint.connections[k] !== endpointConnections[i][0]) {\n _ju.addWithFunction(connectionsToPaint, otherEndpoint.connections[k], function (c) {\n return c.id === otherEndpoint.connections[k].id;\n });\n }\n }\n } else {\n _ju.addWithFunction(connectionsToPaint, endpointConnections[i][0], function (c) {\n return c.id === endpointConnections[i][0].id;\n });\n }\n }\n\n // paint current floating connection for this element, if there is one.\n var fc = floatingConnections[elementId];\n if (fc) {\n fc.paint({timestamp: timestamp, recalc: false, elId: elementId});\n }\n\n // paint all the connections\n for (i = 0; i < connectionsToPaint.length; i++) {\n connectionsToPaint[i].paint({elId: elementId, timestamp: null, recalc: false, clearEdits: clearEdits});\n }\n }\n };\n\n var ContinuousAnchor = function (anchorParams) {\n _ju.EventGenerator.apply(this);\n this.type = \"Continuous\";\n this.isDynamic = true;\n this.isContinuous = true;\n var faces = anchorParams.faces || [\"top\", \"right\", \"bottom\", \"left\"],\n clockwise = !(anchorParams.clockwise === false),\n availableFaces = { },\n opposites = { \"top\": \"bottom\", \"right\": \"left\", \"left\": \"right\", \"bottom\": \"top\" },\n clockwiseOptions = { \"top\": \"right\", \"right\": \"bottom\", \"left\": \"top\", \"bottom\": \"left\" },\n antiClockwiseOptions = { \"top\": \"left\", \"right\": \"top\", \"left\": \"bottom\", \"bottom\": \"right\" },\n secondBest = clockwise ? clockwiseOptions : antiClockwiseOptions,\n lastChoice = clockwise ? antiClockwiseOptions : clockwiseOptions,\n cssClass = anchorParams.cssClass || \"\",\n _currentFace = null, _lockedFace = null, X_AXIS_FACES = [\"left\", \"right\"], Y_AXIS_FACES = [\"top\", \"bottom\"],\n _lockedAxis = null;\n\n for (var i = 0; i < faces.length; i++) {\n availableFaces[faces[i]] = true;\n }\n\n this.getDefaultFace = function () {\n return faces.length === 0 ? \"top\" : faces[0];\n };\n\n this.isRelocatable = function() { return true; };\n this.isSnapOnRelocate = function() { return true; };\n\n // if the given edge is supported, returns it. otherwise looks for a substitute that _is_\n // supported. if none supported we also return the request edge.\n this.verifyEdge = function (edge) {\n if (availableFaces[edge]) {\n return edge;\n }\n else if (availableFaces[opposites[edge]]) {\n return opposites[edge];\n }\n else if (availableFaces[secondBest[edge]]) {\n return secondBest[edge];\n }\n else if (availableFaces[lastChoice[edge]]) {\n return lastChoice[edge];\n }\n return edge; // we have to give them something.\n };\n\n this.isEdgeSupported = function (edge) {\n return _lockedAxis == null ?\n\n (_lockedFace == null ? availableFaces[edge] === true : _lockedFace === edge)\n\n : _lockedAxis.indexOf(edge) !== -1;\n };\n\n this.setCurrentFace = function(face, overrideLock) {\n _currentFace = face;\n // if currently locked, and the user wants to override, do that.\n if (overrideLock && _lockedFace != null) {\n _lockedFace = _currentFace;\n }\n };\n\n this.getCurrentFace = function() { return _currentFace; };\n this.getSupportedFaces = function() {\n var af = [];\n for (var k in availableFaces) {\n if (availableFaces[k]) {\n af.push(k);\n }\n }\n return af;\n };\n\n this.lock = function() {\n _lockedFace = _currentFace;\n };\n this.unlock = function() {\n _lockedFace = null;\n };\n this.isLocked = function() {\n return _lockedFace != null;\n };\n\n this.lockCurrentAxis = function() {\n if (_currentFace != null) {\n _lockedAxis = (_currentFace === \"left\" || _currentFace === \"right\") ? X_AXIS_FACES : Y_AXIS_FACES;\n }\n };\n\n this.unlockCurrentAxis = function() {\n _lockedAxis = null;\n };\n\n this.compute = function (params) {\n return continuousAnchorLocations[params.element.id] || [0, 0];\n };\n this.getCurrentLocation = function (params) {\n return continuousAnchorLocations[params.element.id] || [0, 0];\n };\n this.getOrientation = function (endpoint) {\n return continuousAnchorOrientations[endpoint.id] || [0, 0];\n };\n this.getCssClass = function () {\n return cssClass;\n };\n };\n\n // continuous anchors\n jsPlumbInstance.continuousAnchorFactory = {\n get: function (params) {\n return new ContinuousAnchor(params);\n },\n clear: function (elementId) {\n delete continuousAnchorLocations[elementId];\n }\n };\n };\n\n _jp.AnchorManager.prototype.calculateOrientation = function (sourceId, targetId, sd, td, sourceAnchor, targetAnchor) {\n\n var Orientation = { HORIZONTAL: \"horizontal\", VERTICAL: \"vertical\", DIAGONAL: \"diagonal\", IDENTITY: \"identity\" },\n axes = [\"left\", \"top\", \"right\", \"bottom\"];\n\n if (sourceId === targetId) {\n return {\n orientation: Orientation.IDENTITY,\n a: [\"top\", \"top\"]\n };\n }\n\n var theta = Math.atan2((td.centery - sd.centery), (td.centerx - sd.centerx)),\n theta2 = Math.atan2((sd.centery - td.centery), (sd.centerx - td.centerx));\n\n// --------------------------------------------------------------------------------------\n\n // improved face calculation. get midpoints of each face for source and target, then put in an array with all combinations of\n // source/target faces. sort this array by distance between midpoints. the entry at index 0 is our preferred option. we can\n // go through the array one by one until we find an entry in which each requested face is supported.\n var candidates = [], midpoints = { };\n (function (types, dim) {\n for (var i = 0; i < types.length; i++) {\n midpoints[types[i]] = {\n \"left\": [ dim[i].left, dim[i].centery ],\n \"right\": [ dim[i].right, dim[i].centery ],\n \"top\": [ dim[i].centerx, dim[i].top ],\n \"bottom\": [ dim[i].centerx , dim[i].bottom]\n };\n }\n })([ \"source\", \"target\" ], [ sd, td ]);\n\n for (var sf = 0; sf < axes.length; sf++) {\n for (var tf = 0; tf < axes.length; tf++) {\n candidates.push({\n source: axes[sf],\n target: axes[tf],\n dist: Biltong.lineLength(midpoints.source[axes[sf]], midpoints.target[axes[tf]])\n });\n }\n }\n\n candidates.sort(function (a, b) {\n return a.dist < b.dist ? -1 : a.dist > b.dist ? 1 : 0;\n });\n\n // now go through this list and try to get an entry that satisfies both (there will be one, unless one of the anchors\n // declares no available faces)\n var sourceEdge = candidates[0].source, targetEdge = candidates[0].target;\n for (var i = 0; i < candidates.length; i++) {\n\n if (!sourceAnchor.isContinuous || sourceAnchor.isEdgeSupported(candidates[i].source)) {\n sourceEdge = candidates[i].source;\n }\n else {\n sourceEdge = null;\n }\n\n if (!targetAnchor.isContinuous || targetAnchor.isEdgeSupported(candidates[i].target)) {\n targetEdge = candidates[i].target;\n }\n else {\n targetEdge = null;\n }\n\n if (sourceEdge != null && targetEdge != null) {\n break;\n }\n }\n\n if (sourceAnchor.isContinuous) {\n sourceAnchor.setCurrentFace(sourceEdge);\n }\n\n if (targetAnchor.isContinuous) {\n targetAnchor.setCurrentFace(targetEdge);\n }\n\n// --------------------------------------------------------------------------------------\n\n return {\n a: [ sourceEdge, targetEdge ],\n theta: theta,\n theta2: theta2\n };\n };\n\n /**\n * Anchors model a position on some element at which an Endpoint may be located. They began as a first class citizen of jsPlumb, ie. a user\n * was required to create these themselves, but over time this has been replaced by the concept of referring to them either by name (eg. \"TopMiddle\"),\n * or by an array describing their coordinates (eg. [ 0, 0.5, 0, -1 ], which is the same as \"TopMiddle\"). jsPlumb now handles all of the\n * creation of Anchors without user intervention.\n */\n _jp.Anchor = function (params) {\n this.x = params.x || 0;\n this.y = params.y || 0;\n this.elementId = params.elementId;\n this.cssClass = params.cssClass || \"\";\n this.userDefinedLocation = null;\n this.orientation = params.orientation || [ 0, 0 ];\n this.lastReturnValue = null;\n this.offsets = params.offsets || [ 0, 0 ];\n this.timestamp = null;\n\n var relocatable = params.relocatable !== false;\n this.isRelocatable = function() { return relocatable; };\n this.setRelocatable = function(_relocatable) { relocatable = _relocatable; };\n var snapOnRelocate = params.snapOnRelocate !== false;\n this.isSnapOnRelocate = function() { return snapOnRelocate; };\n\n var locked = false;\n this.lock = function() { locked = true; };\n this.unlock = function() { locked = false; };\n this.isLocked = function() { return locked; };\n\n _ju.EventGenerator.apply(this);\n\n this.compute = function (params) {\n\n var xy = params.xy, wh = params.wh, timestamp = params.timestamp;\n\n if (params.clearUserDefinedLocation) {\n this.userDefinedLocation = null;\n }\n\n if (timestamp && timestamp === this.timestamp) {\n return this.lastReturnValue;\n }\n\n if (this.userDefinedLocation != null) {\n this.lastReturnValue = this.userDefinedLocation;\n }\n else {\n this.lastReturnValue = [ xy[0] + (this.x * wh[0]) + this.offsets[0], xy[1] + (this.y * wh[1]) + this.offsets[1], this.x, this.y ];\n }\n\n this.timestamp = timestamp;\n return this.lastReturnValue;\n };\n\n this.getCurrentLocation = function (params) {\n params = params || {};\n return (this.lastReturnValue == null || (params.timestamp != null && this.timestamp !== params.timestamp)) ? this.compute(params) : this.lastReturnValue;\n };\n\n this.setPosition = function(x, y, ox, oy, overrideLock) {\n if (!locked || overrideLock) {\n this.x = x;\n this.y = y;\n this.orientation = [ ox, oy ];\n this.lastReturnValue = null;\n }\n };\n };\n _ju.extend(_jp.Anchor, _ju.EventGenerator, {\n equals: function (anchor) {\n if (!anchor) {\n return false;\n }\n var ao = anchor.getOrientation(),\n o = this.getOrientation();\n return this.x === anchor.x && this.y === anchor.y && this.offsets[0] === anchor.offsets[0] && this.offsets[1] === anchor.offsets[1] && o[0] === ao[0] && o[1] === ao[1];\n },\n getUserDefinedLocation: function () {\n return this.userDefinedLocation;\n },\n setUserDefinedLocation: function (l) {\n this.userDefinedLocation = l;\n },\n clearUserDefinedLocation: function () {\n this.userDefinedLocation = null;\n },\n getOrientation: function () {\n return this.orientation;\n },\n getCssClass: function () {\n return this.cssClass;\n }\n });\n\n /**\n * An Anchor that floats. its orientation is computed dynamically from\n * its position relative to the anchor it is floating relative to. It is used when creating\n * a connection through drag and drop.\n *\n * TODO FloatingAnchor could totally be refactored to extend Anchor just slightly.\n */\n _jp.FloatingAnchor = function (params) {\n\n _jp.Anchor.apply(this, arguments);\n\n // this is the anchor that this floating anchor is referenced to for\n // purposes of calculating the orientation.\n var ref = params.reference,\n // the canvas this refers to.\n refCanvas = params.referenceCanvas,\n size = _jp.getSize(refCanvas),\n // these are used to store the current relative position of our\n // anchor wrt the reference anchor. they only indicate\n // direction, so have a value of 1 or -1 (or, very rarely, 0). these\n // values are written by the compute method, and read\n // by the getOrientation method.\n xDir = 0, yDir = 0,\n // temporary member used to store an orientation when the floating\n // anchor is hovering over another anchor.\n orientation = null,\n _lastResult = null;\n\n // clear from parent. we want floating anchor orientation to always be computed.\n this.orientation = null;\n\n // set these to 0 each; they are used by certain types of connectors in the loopback case,\n // when the connector is trying to clear the element it is on. but for floating anchor it's not\n // very important.\n this.x = 0;\n this.y = 0;\n\n this.isFloating = true;\n\n this.compute = function (params) {\n var xy = params.xy,\n result = [ xy[0] + (size[0] / 2), xy[1] + (size[1] / 2) ]; // return origin of the element. we may wish to improve this so that any object can be the drag proxy.\n _lastResult = result;\n return result;\n };\n\n this.getOrientation = function (_endpoint) {\n if (orientation) {\n return orientation;\n }\n else {\n var o = ref.getOrientation(_endpoint);\n // here we take into account the orientation of the other\n // anchor: if it declares zero for some direction, we declare zero too. this might not be the most awesome. perhaps we can come\n // up with a better way. it's just so that the line we draw looks like it makes sense. maybe this wont make sense.\n return [ Math.abs(o[0]) * xDir * -1,\n Math.abs(o[1]) * yDir * -1 ];\n }\n };\n\n /**\n * notification the endpoint associated with this anchor is hovering\n * over another anchor; we want to assume that anchor's orientation\n * for the duration of the hover.\n */\n this.over = function (anchor, endpoint) {\n orientation = anchor.getOrientation(endpoint);\n };\n\n /**\n * notification the endpoint associated with this anchor is no\n * longer hovering over another anchor; we should resume calculating\n * orientation as we normally do.\n */\n this.out = function () {\n orientation = null;\n };\n\n this.getCurrentLocation = function (params) {\n return _lastResult == null ? this.compute(params) : _lastResult;\n };\n };\n _ju.extend(_jp.FloatingAnchor, _jp.Anchor);\n\n var _convertAnchor = function (anchor, jsPlumbInstance, elementId) {\n return anchor.constructor === _jp.Anchor ? anchor : jsPlumbInstance.makeAnchor(anchor, elementId, jsPlumbInstance);\n };\n\n /* \n * A DynamicAnchor is an Anchor that contains a list of other Anchors, which it cycles\n * through at compute time to find the one that is located closest to\n * the center of the target element, and returns that Anchor's compute\n * method result. this causes endpoints to follow each other with\n * respect to the orientation of their target elements, which is a useful\n * feature for some applications.\n * \n */\n _jp.DynamicAnchor = function (params) {\n _jp.Anchor.apply(this, arguments);\n\n this.isDynamic = true;\n this.anchors = [];\n this.elementId = params.elementId;\n this.jsPlumbInstance = params.jsPlumbInstance;\n\n for (var i = 0; i < params.anchors.length; i++) {\n this.anchors[i] = _convertAnchor(params.anchors[i], this.jsPlumbInstance, this.elementId);\n }\n\n this.getAnchors = function () {\n return this.anchors;\n };\n\n var _curAnchor = this.anchors.length > 0 ? this.anchors[0] : null,\n _lastAnchor = _curAnchor,\n self = this,\n\n // helper method to calculate the distance between the centers of the two elements.\n _distance = function (anchor, cx, cy, xy, wh) {\n var ax = xy[0] + (anchor.x * wh[0]), ay = xy[1] + (anchor.y * wh[1]),\n acx = xy[0] + (wh[0] / 2), acy = xy[1] + (wh[1] / 2);\n return (Math.sqrt(Math.pow(cx - ax, 2) + Math.pow(cy - ay, 2)) +\n Math.sqrt(Math.pow(acx - ax, 2) + Math.pow(acy - ay, 2)));\n },\n // default method uses distance between element centers. you can provide your own method in the dynamic anchor\n // constructor (and also to jsPlumb.makeDynamicAnchor). the arguments to it are four arrays:\n // xy - xy loc of the anchor's element\n // wh - anchor's element's dimensions\n // txy - xy loc of the element of the other anchor in the connection\n // twh - dimensions of the element of the other anchor in the connection.\n // anchors - the list of selectable anchors\n _anchorSelector = params.selector || function (xy, wh, txy, twh, anchors) {\n var cx = txy[0] + (twh[0] / 2), cy = txy[1] + (twh[1] / 2);\n var minIdx = -1, minDist = Infinity;\n for (var i = 0; i < anchors.length; i++) {\n var d = _distance(anchors[i], cx, cy, xy, wh);\n if (d < minDist) {\n minIdx = i + 0;\n minDist = d;\n }\n }\n return anchors[minIdx];\n };\n\n this.compute = function (params) {\n var xy = params.xy, wh = params.wh, txy = params.txy, twh = params.twh;\n\n this.timestamp = params.timestamp;\n\n var udl = self.getUserDefinedLocation();\n if (udl != null) {\n return udl;\n }\n\n // if anchor is locked or an opposite element was not given, we\n // maintain our state. anchor will be locked\n // if it is the source of a drag and drop.\n if (this.isLocked() || txy == null || twh == null) {\n return _curAnchor.compute(params);\n }\n else {\n params.timestamp = null; // otherwise clear this, i think. we want the anchor to compute.\n }\n\n _curAnchor = _anchorSelector(xy, wh, txy, twh, this.anchors);\n this.x = _curAnchor.x;\n this.y = _curAnchor.y;\n\n if (_curAnchor !== _lastAnchor) {\n this.fire(\"anchorChanged\", _curAnchor);\n }\n\n _lastAnchor = _curAnchor;\n\n return _curAnchor.compute(params);\n };\n\n this.getCurrentLocation = function (params) {\n return this.getUserDefinedLocation() || (_curAnchor != null ? _curAnchor.getCurrentLocation(params) : null);\n };\n\n this.getOrientation = function (_endpoint) {\n return _curAnchor != null ? _curAnchor.getOrientation(_endpoint) : [ 0, 0 ];\n };\n this.over = function (anchor, endpoint) {\n if (_curAnchor != null) {\n _curAnchor.over(anchor, endpoint);\n }\n };\n this.out = function () {\n if (_curAnchor != null) {\n _curAnchor.out();\n }\n };\n\n this.setAnchor = function(a) {\n _curAnchor = a;\n };\n\n this.getCssClass = function () {\n return (_curAnchor && _curAnchor.getCssClass()) || \"\";\n };\n\n /**\n * Attempt to match an anchor with the given coordinates and then set it.\n * @param coords\n * @returns true if matching anchor found, false otherwise.\n */\n this.setAnchorCoordinates = function(coords) {\n var idx = jsPlumbUtil.findWithFunction(this.anchors, function(a) {\n return a.x === coords[0] && a.y === coords[1];\n });\n if (idx !== -1) {\n this.setAnchor(this.anchors[idx]);\n return true;\n } else {\n return false;\n }\n };\n };\n _ju.extend(_jp.DynamicAnchor, _jp.Anchor);\n\n// -------- basic anchors ------------------ \n var _curryAnchor = function (x, y, ox, oy, type, fnInit) {\n _jp.Anchors[type] = function (params) {\n var a = params.jsPlumbInstance.makeAnchor([ x, y, ox, oy, 0, 0 ], params.elementId, params.jsPlumbInstance);\n a.type = type;\n if (fnInit) {\n fnInit(a, params);\n }\n return a;\n };\n };\n\n _curryAnchor(0.5, 0, 0, -1, \"TopCenter\");\n _curryAnchor(0.5, 1, 0, 1, \"BottomCenter\");\n _curryAnchor(0, 0.5, -1, 0, \"LeftMiddle\");\n _curryAnchor(1, 0.5, 1, 0, \"RightMiddle\");\n\n _curryAnchor(0.5, 0, 0, -1, \"Top\");\n _curryAnchor(0.5, 1, 0, 1, \"Bottom\");\n _curryAnchor(0, 0.5, -1, 0, \"Left\");\n _curryAnchor(1, 0.5, 1, 0, \"Right\");\n _curryAnchor(0.5, 0.5, 0, 0, \"Center\");\n _curryAnchor(1, 0, 0, -1, \"TopRight\");\n _curryAnchor(1, 1, 0, 1, \"BottomRight\");\n _curryAnchor(0, 0, 0, -1, \"TopLeft\");\n _curryAnchor(0, 1, 0, 1, \"BottomLeft\");\n\n// ------- dynamic anchors ------------------- \n\n // default dynamic anchors chooses from Top, Right, Bottom, Left\n _jp.Defaults.DynamicAnchors = function (params) {\n return params.jsPlumbInstance.makeAnchors([\"TopCenter\", \"RightMiddle\", \"BottomCenter\", \"LeftMiddle\"], params.elementId, params.jsPlumbInstance);\n };\n\n // default dynamic anchors bound to name 'AutoDefault'\n _jp.Anchors.AutoDefault = function (params) {\n var a = params.jsPlumbInstance.makeDynamicAnchor(_jp.Defaults.DynamicAnchors(params));\n a.type = \"AutoDefault\";\n return a;\n };\n\n// ------- continuous anchors ------------------- \n\n var _curryContinuousAnchor = function (type, faces) {\n _jp.Anchors[type] = function (params) {\n var a = params.jsPlumbInstance.makeAnchor([\"Continuous\", { faces: faces }], params.elementId, params.jsPlumbInstance);\n a.type = type;\n return a;\n };\n };\n\n _jp.Anchors.Continuous = function (params) {\n return params.jsPlumbInstance.continuousAnchorFactory.get(params);\n };\n\n _curryContinuousAnchor(\"ContinuousLeft\", [\"left\"]);\n _curryContinuousAnchor(\"ContinuousTop\", [\"top\"]);\n _curryContinuousAnchor(\"ContinuousBottom\", [\"bottom\"]);\n _curryContinuousAnchor(\"ContinuousRight\", [\"right\"]);\n\n// ------- position assign anchors ------------------- \n\n // this anchor type lets you assign the position at connection time.\n _curryAnchor(0, 0, 0, 0, \"Assign\", function (anchor, params) {\n // find what to use as the \"position finder\". the user may have supplied a String which represents\n // the id of a position finder in jsPlumb.AnchorPositionFinders, or the user may have supplied the\n // position finder as a function. we find out what to use and then set it on the anchor.\n var pf = params.position || \"Fixed\";\n anchor.positionFinder = pf.constructor === String ? params.jsPlumbInstance.AnchorPositionFinders[pf] : pf;\n // always set the constructor params; the position finder might need them later (the Grid one does,\n // for example)\n anchor.constructorParams = params;\n });\n\n // these are the default anchor positions finders, which are used by the makeTarget function. supplying\n // a position finder argument to that function allows you to specify where the resulting anchor will\n // be located\n root.jsPlumbInstance.prototype.AnchorPositionFinders = {\n \"Fixed\": function (dp, ep, es) {\n return [ (dp.left - ep.left) / es[0], (dp.top - ep.top) / es[1] ];\n },\n \"Grid\": function (dp, ep, es, params) {\n var dx = dp.left - ep.left, dy = dp.top - ep.top,\n gx = es[0] / (params.grid[0]), gy = es[1] / (params.grid[1]),\n mx = Math.floor(dx / gx), my = Math.floor(dy / gy);\n return [ ((mx * gx) + (gx / 2)) / es[0], ((my * gy) + (gy / 2)) / es[1] ];\n }\n };\n\n// ------- perimeter anchors ------------------- \n\n _jp.Anchors.Perimeter = function (params) {\n params = params || {};\n var anchorCount = params.anchorCount || 60,\n shape = params.shape;\n\n if (!shape) {\n throw new Error(\"no shape supplied to Perimeter Anchor type\");\n }\n\n var _circle = function () {\n var r = 0.5, step = Math.PI * 2 / anchorCount, current = 0, a = [];\n for (var i = 0; i < anchorCount; i++) {\n var x = r + (r * Math.sin(current)),\n y = r + (r * Math.cos(current));\n a.push([ x, y, 0, 0 ]);\n current += step;\n }\n return a;\n },\n _path = function (segments) {\n var anchorsPerFace = anchorCount / segments.length, a = [],\n _computeFace = function (x1, y1, x2, y2, fractionalLength) {\n anchorsPerFace = anchorCount * fractionalLength;\n var dx = (x2 - x1) / anchorsPerFace, dy = (y2 - y1) / anchorsPerFace;\n for (var i = 0; i < anchorsPerFace; i++) {\n a.push([\n x1 + (dx * i),\n y1 + (dy * i),\n 0,\n 0\n ]);\n }\n };\n\n for (var i = 0; i < segments.length; i++) {\n _computeFace.apply(null, segments[i]);\n }\n\n return a;\n },\n _shape = function (faces) {\n var s = [];\n for (var i = 0; i < faces.length; i++) {\n s.push([faces[i][0], faces[i][1], faces[i][2], faces[i][3], 1 / faces.length]);\n }\n return _path(s);\n },\n _rectangle = function () {\n return _shape([\n [ 0, 0, 1, 0 ],\n [ 1, 0, 1, 1 ],\n [ 1, 1, 0, 1 ],\n [ 0, 1, 0, 0 ]\n ]);\n };\n\n var _shapes = {\n \"Circle\": _circle,\n \"Ellipse\": _circle,\n \"Diamond\": function () {\n return _shape([\n [ 0.5, 0, 1, 0.5 ],\n [ 1, 0.5, 0.5, 1 ],\n [ 0.5, 1, 0, 0.5 ],\n [ 0, 0.5, 0.5, 0 ]\n ]);\n },\n \"Rectangle\": _rectangle,\n \"Square\": _rectangle,\n \"Triangle\": function () {\n return _shape([\n [ 0.5, 0, 1, 1 ],\n [ 1, 1, 0, 1 ],\n [ 0, 1, 0.5, 0]\n ]);\n },\n \"Path\": function (params) {\n var points = params.points, p = [], tl = 0;\n for (var i = 0; i < points.length - 1; i++) {\n var l = Math.sqrt(Math.pow(points[i][2] - points[i][0]) + Math.pow(points[i][3] - points[i][1]));\n tl += l;\n p.push([points[i][0], points[i][1], points[i + 1][0], points[i + 1][1], l]);\n }\n for (var j = 0; j < p.length; j++) {\n p[j][4] = p[j][4] / tl;\n }\n return _path(p);\n }\n },\n _rotate = function (points, amountInDegrees) {\n var o = [], theta = amountInDegrees / 180 * Math.PI;\n for (var i = 0; i < points.length; i++) {\n var _x = points[i][0] - 0.5,\n _y = points[i][1] - 0.5;\n\n o.push([\n 0.5 + ((_x * Math.cos(theta)) - (_y * Math.sin(theta))),\n 0.5 + ((_x * Math.sin(theta)) + (_y * Math.cos(theta))),\n points[i][2],\n points[i][3]\n ]);\n }\n return o;\n };\n\n if (!_shapes[shape]) {\n throw new Error(\"Shape [\" + shape + \"] is unknown by Perimeter Anchor type\");\n }\n\n var da = _shapes[shape](params);\n if (params.rotation) {\n da = _rotate(da, params.rotation);\n }\n var a = params.jsPlumbInstance.makeDynamicAnchor(da);\n a.type = \"Perimeter\";\n return a;\n };\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the default Connectors, Endpoint and Overlay definitions.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n * \n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil, _jg = root.Biltong;\n\n _jp.Segments = {\n\n /*\n * Class: AbstractSegment\n * A Connector is made up of 1..N Segments, each of which has a Type, such as 'Straight', 'Arc',\n * 'Bezier'. This is new from 1.4.2, and gives us a lot more flexibility when drawing connections: things such\n * as rounded corners for flowchart connectors, for example, or a straight line stub for Bezier connections, are\n * much easier to do now.\n *\n * A Segment is responsible for providing coordinates for painting it, and also must be able to report its length.\n * \n */\n AbstractSegment: function (params) {\n this.params = params;\n\n /**\n * Function: findClosestPointOnPath\n * Finds the closest point on this segment to the given [x, y],\n * returning both the x and y of the point plus its distance from\n * the supplied point, and its location along the length of the\n * path inscribed by the segment. This implementation returns\n * Infinity for distance and null values for everything else;\n * subclasses are expected to override.\n */\n this.findClosestPointOnPath = function (x, y) {\n return {\n d: Infinity,\n x: null,\n y: null,\n l: null\n };\n };\n\n this.getBounds = function () {\n return {\n minX: Math.min(params.x1, params.x2),\n minY: Math.min(params.y1, params.y2),\n maxX: Math.max(params.x1, params.x2),\n maxY: Math.max(params.y1, params.y2)\n };\n };\n\n /**\n * Computes the list of points on the segment that intersect the given line.\n * @method lineIntersection\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @returns {Array<[number, number]>}\n */\n this.lineIntersection = function(x1, y1, x2, y2) {\n return [];\n };\n\n /**\n * Computes the list of points on the segment that intersect the box with the given origin and size.\n * @method boxIntersection\n * @param {number} x1\n * @param {number} y1\n * @param {number} w\n * @param {number} h\n * @returns {Array<[number, number]>}\n */\n this.boxIntersection = function(x, y, w, h) {\n var a = [];\n a.push.apply(a, this.lineIntersection(x, y, x + w, y));\n a.push.apply(a, this.lineIntersection(x + w, y, x + w, y + h));\n a.push.apply(a, this.lineIntersection(x + w, y + h, x, y + h));\n a.push.apply(a, this.lineIntersection(x, y + h, x, y));\n return a;\n };\n\n /**\n * Computes the list of points on the segment that intersect the given bounding box, which is an object of the form { x:.., y:.., w:.., h:.. }.\n * @method lineIntersection\n * @param {BoundingRectangle} box\n * @returns {Array<[number, number]>}\n */\n this.boundingBoxIntersection = function(box) {\n return this.boxIntersection(box.x, box.y, box.w, box.y);\n };\n },\n Straight: function (params) {\n var _super = _jp.Segments.AbstractSegment.apply(this, arguments),\n length, m, m2, x1, x2, y1, y2,\n _recalc = function () {\n length = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n m = _jg.gradient({x: x1, y: y1}, {x: x2, y: y2});\n m2 = -1 / m;\n };\n\n this.type = \"Straight\";\n\n this.getLength = function () {\n return length;\n };\n this.getGradient = function () {\n return m;\n };\n\n this.getCoordinates = function () {\n return { x1: x1, y1: y1, x2: x2, y2: y2 };\n };\n this.setCoordinates = function (coords) {\n x1 = coords.x1;\n y1 = coords.y1;\n x2 = coords.x2;\n y2 = coords.y2;\n _recalc();\n };\n this.setCoordinates({x1: params.x1, y1: params.y1, x2: params.x2, y2: params.y2});\n\n this.getBounds = function () {\n return {\n minX: Math.min(x1, x2),\n minY: Math.min(y1, y2),\n maxX: Math.max(x1, x2),\n maxY: Math.max(y1, y2)\n };\n };\n\n /**\n * returns the point on the segment's path that is 'location' along the length of the path, where 'location' is a decimal from\n * 0 to 1 inclusive. for the straight line segment this is simple maths.\n */\n this.pointOnPath = function (location, absolute) {\n if (location === 0 && !absolute) {\n return { x: x1, y: y1 };\n }\n else if (location === 1 && !absolute) {\n return { x: x2, y: y2 };\n }\n else {\n var l = absolute ? location > 0 ? location : length + location : location * length;\n return _jg.pointOnLine({x: x1, y: y1}, {x: x2, y: y2}, l);\n }\n };\n\n /**\n * returns the gradient of the segment at the given point - which for us is constant.\n */\n this.gradientAtPoint = function (_) {\n return m;\n };\n\n /**\n * returns the point on the segment's path that is 'distance' along the length of the path from 'location', where\n * 'location' is a decimal from 0 to 1 inclusive, and 'distance' is a number of pixels.\n * this hands off to jsPlumbUtil to do the maths, supplying two points and the distance.\n */\n this.pointAlongPathFrom = function (location, distance, absolute) {\n var p = this.pointOnPath(location, absolute),\n farAwayPoint = distance <= 0 ? {x: x1, y: y1} : {x: x2, y: y2 };\n\n /*\n location == 1 ? {\n x:x1 + ((x2 - x1) * 10),\n y:y1 + ((y1 - y2) * 10)\n } :\n */\n\n if (distance <= 0 && Math.abs(distance) > 1) {\n distance *= -1;\n }\n\n return _jg.pointOnLine(p, farAwayPoint, distance);\n };\n\n // is c between a and b?\n var within = function (a, b, c) {\n return c >= Math.min(a, b) && c <= Math.max(a, b);\n };\n // find which of a and b is closest to c\n var closest = function (a, b, c) {\n return Math.abs(c - a) < Math.abs(c - b) ? a : b;\n };\n\n /**\n Function: findClosestPointOnPath\n Finds the closest point on this segment to [x,y]. See\n notes on this method in AbstractSegment.\n */\n this.findClosestPointOnPath = function (x, y) {\n var out = {\n d: Infinity,\n x: null,\n y: null,\n l: null,\n x1: x1,\n x2: x2,\n y1: y1,\n y2: y2\n };\n\n if (m === 0) {\n out.y = y1;\n out.x = within(x1, x2, x) ? x : closest(x1, x2, x);\n }\n else if (m === Infinity || m === -Infinity) {\n out.x = x1;\n out.y = within(y1, y2, y) ? y : closest(y1, y2, y);\n }\n else {\n // closest point lies on normal from given point to this line. \n var b = y1 - (m * x1),\n b2 = y - (m2 * x),\n // y1 = m.x1 + b and y1 = m2.x1 + b2\n // so m.x1 + b = m2.x1 + b2\n // x1(m - m2) = b2 - b\n // x1 = (b2 - b) / (m - m2)\n _x1 = (b2 - b) / (m - m2),\n _y1 = (m * _x1) + b;\n\n out.x = within(x1, x2, _x1) ? _x1 : closest(x1, x2, _x1);//_x1;\n out.y = within(y1, y2, _y1) ? _y1 : closest(y1, y2, _y1);//_y1;\n }\n\n var fractionInSegment = _jg.lineLength([ out.x, out.y ], [ x1, y1 ]);\n out.d = _jg.lineLength([x, y], [out.x, out.y]);\n out.l = fractionInSegment / length;\n return out;\n };\n\n var _pointLiesBetween = function(q, p1, p2) {\n return (p2 > p1) ? (p1 <= q && q <= p2) : (p1 >= q && q >= p2);\n }, _plb = _pointLiesBetween;\n\n /**\n * Calculates all intersections of the given line with this segment.\n * @param _x1\n * @param _y1\n * @param _x2\n * @param _y2\n * @returns {Array}\n */\n this.lineIntersection = function(_x1, _y1, _x2, _y2) {\n var m2 = Math.abs(_jg.gradient({x: _x1, y: _y1}, {x: _x2, y: _y2})),\n m1 = Math.abs(m),\n b = m1 === Infinity ? x1 : y1 - (m1 * x1),\n out = [],\n b2 = m2 === Infinity ? _x1 : _y1 - (m2 * _x1);\n\n // if lines parallel, no intersection\n if (m2 !== m1) {\n // perpendicular, segment horizontal\n if(m2 === Infinity && m1 === 0) {\n if (_plb(_x1, x1, x2) && _plb(y1, _y1, _y2)) {\n out = [ _x1, y1 ]; // we return X on the incident line and Y from the segment\n }\n } else if(m2 === 0 && m1 === Infinity) {\n // perpendicular, segment vertical\n if(_plb(_y1, y1, y2) && _plb(x1, _x1, _x2)) {\n out = [x1, _y1]; // we return X on the segment and Y from the incident line\n }\n } else {\n var X, Y;\n if (m2 === Infinity) {\n // test line is a vertical line. where does it cross the segment?\n X = _x1;\n if (_plb(X, x1, x2)) {\n Y = (m1 * _x1) + b;\n if (_plb(Y, _y1, _y2)) {\n out = [ X, Y ];\n }\n }\n } else if (m2 === 0) {\n Y = _y1;\n // test line is a horizontal line. where does it cross the segment?\n if (_plb(Y, y1, y2)) {\n X = (_y1 - b) / m1;\n if (_plb(X, _x1, _x2)) {\n out = [ X, Y ];\n }\n }\n } else {\n // mX + b = m2X + b2\n // mX - m2X = b2 - b\n // X(m - m2) = b2 - b\n // X = (b2 - b) / (m - m2)\n // Y = mX + b\n X = (b2 - b) / (m1 - m2);\n Y = (m1 * X) + b;\n if(_plb(X, x1, x2) && _plb(Y, y1, y2)) {\n out = [ X, Y];\n }\n }\n }\n }\n\n return out;\n };\n\n /**\n * Calculates all intersections of the given box with this segment. By default this method simply calls `lineIntersection` with each of the four\n * faces of the box; subclasses can override this if they think there's a faster way to compute the entire box at once.\n * @param x X position of top left corner of box\n * @param y Y position of top left corner of box\n * @param w width of box\n * @param h height of box\n * @returns {Array}\n */\n this.boxIntersection = function(x, y, w, h) {\n var a = [];\n a.push.apply(a, this.lineIntersection(x, y, x + w, y));\n a.push.apply(a, this.lineIntersection(x + w, y, x + w, y + h));\n a.push.apply(a, this.lineIntersection(x + w, y + h, x, y + h));\n a.push.apply(a, this.lineIntersection(x, y + h, x, y));\n return a;\n };\n\n /**\n * Calculates all intersections of the given bounding box with this segment. By default this method simply calls `lineIntersection` with each of the four\n * faces of the box; subclasses can override this if they think there's a faster way to compute the entire box at once.\n * @param box Bounding box, in { x:.., y:..., w:..., h:... } format.\n * @returns {Array}\n */\n this.boundingBoxIntersection = function(box) {\n return this.boxIntersection(box.x, box.y, box.w, box.h);\n };\n },\n\n /*\n Arc Segment. You need to supply:\n\n r - radius\n cx - center x for the arc\n cy - center y for the arc\n ac - whether the arc is anticlockwise or not. default is clockwise.\n\n and then either:\n\n startAngle - startAngle for the arc.\n endAngle - endAngle for the arc.\n\n or:\n\n x1 - x for start point\n y1 - y for start point\n x2 - x for end point\n y2 - y for end point\n\n */\n Arc: function (params) {\n var _super = _jp.Segments.AbstractSegment.apply(this, arguments),\n _calcAngle = function (_x, _y) {\n return _jg.theta([params.cx, params.cy], [_x, _y]);\n },\n _calcAngleForLocation = function (segment, location) {\n if (segment.anticlockwise) {\n var sa = segment.startAngle < segment.endAngle ? segment.startAngle + TWO_PI : segment.startAngle,\n s = Math.abs(sa - segment.endAngle);\n return sa - (s * location);\n }\n else {\n var ea = segment.endAngle < segment.startAngle ? segment.endAngle + TWO_PI : segment.endAngle,\n ss = Math.abs(ea - segment.startAngle);\n\n return segment.startAngle + (ss * location);\n }\n },\n TWO_PI = 2 * Math.PI;\n\n this.radius = params.r;\n this.anticlockwise = params.ac;\n this.type = \"Arc\";\n\n if (params.startAngle && params.endAngle) {\n this.startAngle = params.startAngle;\n this.endAngle = params.endAngle;\n this.x1 = params.cx + (this.radius * Math.cos(params.startAngle));\n this.y1 = params.cy + (this.radius * Math.sin(params.startAngle));\n this.x2 = params.cx + (this.radius * Math.cos(params.endAngle));\n this.y2 = params.cy + (this.radius * Math.sin(params.endAngle));\n }\n else {\n this.startAngle = _calcAngle(params.x1, params.y1);\n this.endAngle = _calcAngle(params.x2, params.y2);\n this.x1 = params.x1;\n this.y1 = params.y1;\n this.x2 = params.x2;\n this.y2 = params.y2;\n }\n\n if (this.endAngle < 0) {\n this.endAngle += TWO_PI;\n }\n if (this.startAngle < 0) {\n this.startAngle += TWO_PI;\n }\n\n // segment is used by vml \n //this.segment = _jg.quadrant([this.x1, this.y1], [this.x2, this.y2]);\n\n // we now have startAngle and endAngle as positive numbers, meaning the\n // absolute difference (|d|) between them is the sweep (s) of this arc, unless the\n // arc is 'anticlockwise' in which case 's' is given by 2PI - |d|.\n\n var ea = this.endAngle < this.startAngle ? this.endAngle + TWO_PI : this.endAngle;\n this.sweep = Math.abs(ea - this.startAngle);\n if (this.anticlockwise) {\n this.sweep = TWO_PI - this.sweep;\n }\n var circumference = 2 * Math.PI * this.radius,\n frac = this.sweep / TWO_PI,\n length = circumference * frac;\n\n this.getLength = function () {\n return length;\n };\n\n this.getBounds = function () {\n return {\n minX: params.cx - params.r,\n maxX: params.cx + params.r,\n minY: params.cy - params.r,\n maxY: params.cy + params.r\n };\n };\n\n var VERY_SMALL_VALUE = 0.0000000001,\n gentleRound = function (n) {\n var f = Math.floor(n), r = Math.ceil(n);\n if (n - f < VERY_SMALL_VALUE) {\n return f;\n }\n else if (r - n < VERY_SMALL_VALUE) {\n return r;\n }\n return n;\n };\n\n /**\n * returns the point on the segment's path that is 'location' along the length of the path, where 'location' is a decimal from\n * 0 to 1 inclusive.\n */\n this.pointOnPath = function (location, absolute) {\n\n if (location === 0) {\n return { x: this.x1, y: this.y1, theta: this.startAngle };\n }\n else if (location === 1) {\n return { x: this.x2, y: this.y2, theta: this.endAngle };\n }\n\n if (absolute) {\n location = location / length;\n }\n\n var angle = _calcAngleForLocation(this, location),\n _x = params.cx + (params.r * Math.cos(angle)),\n _y = params.cy + (params.r * Math.sin(angle));\n\n return { x: gentleRound(_x), y: gentleRound(_y), theta: angle };\n };\n\n /**\n * returns the gradient of the segment at the given point.\n */\n this.gradientAtPoint = function (location, absolute) {\n var p = this.pointOnPath(location, absolute);\n var m = _jg.normal([ params.cx, params.cy ], [p.x, p.y ]);\n if (!this.anticlockwise && (m === Infinity || m === -Infinity)) {\n m *= -1;\n }\n return m;\n };\n\n this.pointAlongPathFrom = function (location, distance, absolute) {\n var p = this.pointOnPath(location, absolute),\n arcSpan = distance / circumference * 2 * Math.PI,\n dir = this.anticlockwise ? -1 : 1,\n startAngle = p.theta + (dir * arcSpan),\n startX = params.cx + (this.radius * Math.cos(startAngle)),\n startY = params.cy + (this.radius * Math.sin(startAngle));\n\n return {x: startX, y: startY};\n };\n\n // TODO: lineIntersection\n },\n\n Bezier: function (params) {\n this.curve = [\n { x: params.x1, y: params.y1},\n { x: params.cp1x, y: params.cp1y },\n { x: params.cp2x, y: params.cp2y },\n { x: params.x2, y: params.y2 }\n ];\n\n var _super = _jp.Segments.AbstractSegment.apply(this, arguments);\n // although this is not a strictly rigorous determination of bounds\n // of a bezier curve, it works for the types of curves that this segment\n // type produces.\n this.bounds = {\n minX: Math.min(params.x1, params.x2, params.cp1x, params.cp2x),\n minY: Math.min(params.y1, params.y2, params.cp1y, params.cp2y),\n maxX: Math.max(params.x1, params.x2, params.cp1x, params.cp2x),\n maxY: Math.max(params.y1, params.y2, params.cp1y, params.cp2y)\n };\n\n this.type = \"Bezier\";\n\n var _translateLocation = function (_curve, location, absolute) {\n if (absolute) {\n location = root.jsBezier.locationAlongCurveFrom(_curve, location > 0 ? 0 : 1, location);\n }\n\n return location;\n };\n\n /**\n * returns the point on the segment's path that is 'location' along the length of the path, where 'location' is a decimal from\n * 0 to 1 inclusive.\n */\n this.pointOnPath = function (location, absolute) {\n location = _translateLocation(this.curve, location, absolute);\n return root.jsBezier.pointOnCurve(this.curve, location);\n };\n\n /**\n * returns the gradient of the segment at the given point.\n */\n this.gradientAtPoint = function (location, absolute) {\n location = _translateLocation(this.curve, location, absolute);\n return root.jsBezier.gradientAtPoint(this.curve, location);\n };\n\n this.pointAlongPathFrom = function (location, distance, absolute) {\n location = _translateLocation(this.curve, location, absolute);\n return root.jsBezier.pointAlongCurveFrom(this.curve, location, distance);\n };\n\n this.getLength = function () {\n return root.jsBezier.getLength(this.curve);\n };\n\n this.getBounds = function () {\n return this.bounds;\n };\n\n this.findClosestPointOnPath = function (x, y) {\n var p = root.jsBezier.nearestPointOnCurve({x:x,y:y}, this.curve);\n return {\n d:Math.sqrt(Math.pow(p.point.x - x, 2) + Math.pow(p.point.y - y, 2)),\n x:p.point.x,\n y:p.point.y,\n l:p.location,\n s:this\n };\n };\n\n this.lineIntersection = function(x1, y1, x2, y2) {\n return root.jsBezier.lineIntersection(x1, y1, x2, y2, this.curve);\n };\n }\n };\n\n _jp.SegmentRenderer = {\n getPath: function (segment, isFirstSegment) {\n return ({\n \"Straight\": function (isFirstSegment) {\n var d = segment.getCoordinates();\n return (isFirstSegment ? \"M \" + d.x1 + \" \" + d.y1 + \" \" : \"\") + \"L \" + d.x2 + \" \" + d.y2;\n },\n \"Bezier\": function (isFirstSegment) {\n var d = segment.params;\n return (isFirstSegment ? \"M \" + d.x2 + \" \" + d.y2 + \" \" : \"\") +\n \"C \" + d.cp2x + \" \" + d.cp2y + \" \" + d.cp1x + \" \" + d.cp1y + \" \" + d.x1 + \" \" + d.y1;\n },\n \"Arc\": function (isFirstSegment) {\n var d = segment.params,\n laf = segment.sweep > Math.PI ? 1 : 0,\n sf = segment.anticlockwise ? 0 : 1;\n\n return (isFirstSegment ? \"M\" + segment.x1 + \" \" + segment.y1 + \" \" : \"\") + \"A \" + segment.radius + \" \" + d.r + \" 0 \" + laf + \",\" + sf + \" \" + segment.x2 + \" \" + segment.y2;\n }\n })[segment.type](isFirstSegment);\n }\n };\n\n /*\n Class: UIComponent\n Superclass for Connector and AbstractEndpoint.\n */\n var AbstractComponent = function () {\n this.resetBounds = function () {\n this.bounds = { minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity };\n };\n this.resetBounds();\n };\n\n /*\n * Class: Connector\n * Superclass for all Connectors; here is where Segments are managed. This is exposed on jsPlumb just so it\n * can be accessed from other files. You should not try to instantiate one of these directly.\n *\n * When this class is asked for a pointOnPath, or gradient etc, it must first figure out which segment to dispatch\n * that request to. This is done by keeping track of the total connector length as segments are added, and also\n * their cumulative ratios to the total length. Then when the right segment is found it is a simple case of dispatching\n * the request to it (and adjusting 'location' so that it is relative to the beginning of that segment.)\n */\n _jp.Connectors.AbstractConnector = function (params) {\n\n AbstractComponent.apply(this, arguments);\n\n var segments = [],\n totalLength = 0,\n segmentProportions = [],\n segmentProportionalLengths = [],\n stub = params.stub || 0,\n sourceStub = _ju.isArray(stub) ? stub[0] : stub,\n targetStub = _ju.isArray(stub) ? stub[1] : stub,\n gap = params.gap || 0,\n sourceGap = _ju.isArray(gap) ? gap[0] : gap,\n targetGap = _ju.isArray(gap) ? gap[1] : gap,\n userProvidedSegments = null,\n paintInfo = null;\n\n this.getPathData = function() {\n var p = \"\";\n for (var i = 0; i < segments.length; i++) {\n p += _jp.SegmentRenderer.getPath(segments[i], i === 0);\n p += \" \";\n }\n return p;\n };\n\n /**\n * Function: findSegmentForPoint\n * Returns the segment that is closest to the given [x,y],\n * null if nothing found. This function returns a JS\n * object with:\n *\n * d - distance from segment\n * l - proportional location in segment\n * x - x point on the segment\n * y - y point on the segment\n * s - the segment itself.\n */\n this.findSegmentForPoint = function (x, y) {\n var out = { d: Infinity, s: null, x: null, y: null, l: null };\n for (var i = 0; i < segments.length; i++) {\n var _s = segments[i].findClosestPointOnPath(x, y);\n if (_s.d < out.d) {\n out.d = _s.d;\n out.l = _s.l;\n out.x = _s.x;\n out.y = _s.y;\n out.s = segments[i];\n out.x1 = _s.x1;\n out.x2 = _s.x2;\n out.y1 = _s.y1;\n out.y2 = _s.y2;\n out.index = i;\n }\n }\n\n return out;\n };\n\n this.lineIntersection = function(x1, y1, x2, y2) {\n var out = [];\n for (var i = 0; i < segments.length; i++) {\n out.push.apply(out, segments[i].lineIntersection(x1, y1, x2, y2));\n }\n return out;\n };\n\n this.boxIntersection = function(x, y, w, h) {\n var out = [];\n for (var i = 0; i < segments.length; i++) {\n out.push.apply(out, segments[i].boxIntersection(x, y, w, h));\n }\n return out;\n };\n\n this.boundingBoxIntersection = function(box) {\n var out = [];\n for (var i = 0; i < segments.length; i++) {\n out.push.apply(out, segments[i].boundingBoxIntersection(box));\n }\n return out;\n };\n\n var _updateSegmentProportions = function () {\n var curLoc = 0;\n for (var i = 0; i < segments.length; i++) {\n var sl = segments[i].getLength();\n segmentProportionalLengths[i] = sl / totalLength;\n segmentProportions[i] = [curLoc, (curLoc += (sl / totalLength)) ];\n }\n },\n\n /**\n * returns [segment, proportion of travel in segment, segment index] for the segment\n * that contains the point which is 'location' distance along the entire path, where\n * 'location' is a decimal between 0 and 1 inclusive. in this connector type, paths\n * are made up of a list of segments, each of which contributes some fraction to\n * the total length.\n * From 1.3.10 this also supports the 'absolute' property, which lets us specify a location\n * as the absolute distance in pixels, rather than a proportion of the total path.\n */\n _findSegmentForLocation = function (location, absolute) {\n if (absolute) {\n location = location > 0 ? location / totalLength : (totalLength + location) / totalLength;\n }\n var idx = segmentProportions.length - 1, inSegmentProportion = 1;\n for (var i = 0; i < segmentProportions.length; i++) {\n if (segmentProportions[i][1] >= location) {\n idx = i;\n // todo is this correct for all connector path types?\n inSegmentProportion = location === 1 ? 1 : location === 0 ? 0 : (location - segmentProportions[i][0]) / segmentProportionalLengths[i];\n break;\n }\n }\n return { segment: segments[idx], proportion: inSegmentProportion, index: idx };\n },\n _addSegment = function (conn, type, params) {\n if (params.x1 === params.x2 && params.y1 === params.y2) {\n return;\n }\n var s = new _jp.Segments[type](params);\n segments.push(s);\n totalLength += s.getLength();\n conn.updateBounds(s);\n },\n _clearSegments = function () {\n totalLength = segments.length = segmentProportions.length = segmentProportionalLengths.length = 0;\n };\n\n this.setSegments = function (_segs) {\n userProvidedSegments = [];\n totalLength = 0;\n for (var i = 0; i < _segs.length; i++) {\n userProvidedSegments.push(_segs[i]);\n totalLength += _segs[i].getLength();\n }\n };\n\n this.getLength = function() {\n return totalLength;\n };\n\n var _prepareCompute = function (params) {\n this.strokeWidth = params.strokeWidth;\n var segment = _jg.quadrant(params.sourcePos, params.targetPos),\n swapX = params.targetPos[0] < params.sourcePos[0],\n swapY = params.targetPos[1] < params.sourcePos[1],\n lw = params.strokeWidth || 1,\n so = params.sourceEndpoint.anchor.getOrientation(params.sourceEndpoint),\n to = params.targetEndpoint.anchor.getOrientation(params.targetEndpoint),\n x = swapX ? params.targetPos[0] : params.sourcePos[0],\n y = swapY ? params.targetPos[1] : params.sourcePos[1],\n w = Math.abs(params.targetPos[0] - params.sourcePos[0]),\n h = Math.abs(params.targetPos[1] - params.sourcePos[1]);\n\n // if either anchor does not have an orientation set, we derive one from their relative\n // positions. we fix the axis to be the one in which the two elements are further apart, and\n // point each anchor at the other element. this is also used when dragging a new connection.\n if (so[0] === 0 && so[1] === 0 || to[0] === 0 && to[1] === 0) {\n var index = w > h ? 0 : 1, oIndex = [1, 0][index];\n so = [];\n to = [];\n so[index] = params.sourcePos[index] > params.targetPos[index] ? -1 : 1;\n to[index] = params.sourcePos[index] > params.targetPos[index] ? 1 : -1;\n so[oIndex] = 0;\n to[oIndex] = 0;\n }\n\n var sx = swapX ? w + (sourceGap * so[0]) : sourceGap * so[0],\n sy = swapY ? h + (sourceGap * so[1]) : sourceGap * so[1],\n tx = swapX ? targetGap * to[0] : w + (targetGap * to[0]),\n ty = swapY ? targetGap * to[1] : h + (targetGap * to[1]),\n oProduct = ((so[0] * to[0]) + (so[1] * to[1]));\n\n var result = {\n sx: sx, sy: sy, tx: tx, ty: ty, lw: lw,\n xSpan: Math.abs(tx - sx),\n ySpan: Math.abs(ty - sy),\n mx: (sx + tx) / 2,\n my: (sy + ty) / 2,\n so: so, to: to, x: x, y: y, w: w, h: h,\n segment: segment,\n startStubX: sx + (so[0] * sourceStub),\n startStubY: sy + (so[1] * sourceStub),\n endStubX: tx + (to[0] * targetStub),\n endStubY: ty + (to[1] * targetStub),\n isXGreaterThanStubTimes2: Math.abs(sx - tx) > (sourceStub + targetStub),\n isYGreaterThanStubTimes2: Math.abs(sy - ty) > (sourceStub + targetStub),\n opposite: oProduct === -1,\n perpendicular: oProduct === 0,\n orthogonal: oProduct === 1,\n sourceAxis: so[0] === 0 ? \"y\" : \"x\",\n points: [x, y, w, h, sx, sy, tx, ty ],\n stubs:[sourceStub, targetStub]\n };\n result.anchorOrientation = result.opposite ? \"opposite\" : result.orthogonal ? \"orthogonal\" : \"perpendicular\";\n return result;\n };\n\n this.getSegments = function () {\n return segments;\n };\n\n this.updateBounds = function (segment) {\n var segBounds = segment.getBounds();\n this.bounds.minX = Math.min(this.bounds.minX, segBounds.minX);\n this.bounds.maxX = Math.max(this.bounds.maxX, segBounds.maxX);\n this.bounds.minY = Math.min(this.bounds.minY, segBounds.minY);\n this.bounds.maxY = Math.max(this.bounds.maxY, segBounds.maxY);\n };\n\n var dumpSegmentsToConsole = function () {\n console.log(\"SEGMENTS:\");\n for (var i = 0; i < segments.length; i++) {\n console.log(segments[i].type, segments[i].getLength(), segmentProportions[i]);\n }\n };\n\n this.pointOnPath = function (location, absolute) {\n var seg = _findSegmentForLocation(location, absolute);\n return seg.segment && seg.segment.pointOnPath(seg.proportion, false) || [0, 0];\n };\n\n this.gradientAtPoint = function (location, absolute) {\n var seg = _findSegmentForLocation(location, absolute);\n return seg.segment && seg.segment.gradientAtPoint(seg.proportion, false) || 0;\n };\n\n this.pointAlongPathFrom = function (location, distance, absolute) {\n var seg = _findSegmentForLocation(location, absolute);\n // TODO what happens if this crosses to the next segment?\n return seg.segment && seg.segment.pointAlongPathFrom(seg.proportion, distance, false) || [0, 0];\n };\n\n this.compute = function (params) {\n paintInfo = _prepareCompute.call(this, params);\n\n _clearSegments();\n this._compute(paintInfo, params);\n this.x = paintInfo.points[0];\n this.y = paintInfo.points[1];\n this.w = paintInfo.points[2];\n this.h = paintInfo.points[3];\n this.segment = paintInfo.segment;\n _updateSegmentProportions();\n };\n\n return {\n addSegment: _addSegment,\n prepareCompute: _prepareCompute,\n sourceStub: sourceStub,\n targetStub: targetStub,\n maxStub: Math.max(sourceStub, targetStub),\n sourceGap: sourceGap,\n targetGap: targetGap,\n maxGap: Math.max(sourceGap, targetGap)\n };\n };\n _ju.extend(_jp.Connectors.AbstractConnector, AbstractComponent);\n\n\n // ********************************* END OF CONNECTOR TYPES *******************************************************************\n\n // ********************************* ENDPOINT TYPES *******************************************************************\n\n _jp.Endpoints.AbstractEndpoint = function (params) {\n AbstractComponent.apply(this, arguments);\n var compute = this.compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n var out = this._compute.apply(this, arguments);\n this.x = out[0];\n this.y = out[1];\n this.w = out[2];\n this.h = out[3];\n this.bounds.minX = this.x;\n this.bounds.minY = this.y;\n this.bounds.maxX = this.x + this.w;\n this.bounds.maxY = this.y + this.h;\n return out;\n };\n return {\n compute: compute,\n cssClass: params.cssClass\n };\n };\n _ju.extend(_jp.Endpoints.AbstractEndpoint, AbstractComponent);\n\n /**\n * Class: Endpoints.Dot\n * A round endpoint, with default radius 10 pixels.\n */\n\n /**\n * Function: Constructor\n *\n * Parameters:\n *\n * radius - radius of the endpoint. defaults to 10 pixels.\n */\n _jp.Endpoints.Dot = function (params) {\n this.type = \"Dot\";\n var _super = _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n params = params || {};\n this.radius = params.radius || 10;\n this.defaultOffset = 0.5 * this.radius;\n this.defaultInnerRadius = this.radius / 3;\n\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n this.radius = endpointStyle.radius || this.radius;\n var x = anchorPoint[0] - this.radius,\n y = anchorPoint[1] - this.radius,\n w = this.radius * 2,\n h = this.radius * 2;\n\n if (endpointStyle.stroke) {\n var lw = endpointStyle.strokeWidth || 1;\n x -= lw;\n y -= lw;\n w += (lw * 2);\n h += (lw * 2);\n }\n return [ x, y, w, h, this.radius ];\n };\n };\n _ju.extend(_jp.Endpoints.Dot, _jp.Endpoints.AbstractEndpoint);\n\n _jp.Endpoints.Rectangle = function (params) {\n this.type = \"Rectangle\";\n var _super = _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n params = params || {};\n this.width = params.width || 20;\n this.height = params.height || 20;\n\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n var width = endpointStyle.width || this.width,\n height = endpointStyle.height || this.height,\n x = anchorPoint[0] - (width / 2),\n y = anchorPoint[1] - (height / 2);\n\n return [ x, y, width, height];\n };\n };\n _ju.extend(_jp.Endpoints.Rectangle, _jp.Endpoints.AbstractEndpoint);\n\n var DOMElementEndpoint = function (params) {\n _jp.jsPlumbUIComponent.apply(this, arguments);\n this._jsPlumb.displayElements = [];\n };\n _ju.extend(DOMElementEndpoint, _jp.jsPlumbUIComponent, {\n getDisplayElements: function () {\n return this._jsPlumb.displayElements;\n },\n appendDisplayElement: function (el) {\n this._jsPlumb.displayElements.push(el);\n }\n });\n\n /**\n * Class: Endpoints.Image\n * Draws an image as the Endpoint.\n */\n /**\n * Function: Constructor\n *\n * Parameters:\n *\n * src - location of the image to use.\n\n TODO: multiple references to self. not sure quite how to get rid of them entirely. perhaps self = null in the cleanup\n function will suffice\n\n TODO this class still might leak memory.\n\n */\n _jp.Endpoints.Image = function (params) {\n\n this.type = \"Image\";\n DOMElementEndpoint.apply(this, arguments);\n _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n\n var _onload = params.onload,\n src = params.src || params.url,\n clazz = params.cssClass ? \" \" + params.cssClass : \"\";\n\n this._jsPlumb.img = new Image();\n this._jsPlumb.ready = false;\n this._jsPlumb.initialized = false;\n this._jsPlumb.deleted = false;\n this._jsPlumb.widthToUse = params.width;\n this._jsPlumb.heightToUse = params.height;\n this._jsPlumb.endpoint = params.endpoint;\n\n this._jsPlumb.img.onload = function () {\n if (this._jsPlumb != null) {\n this._jsPlumb.ready = true;\n this._jsPlumb.widthToUse = this._jsPlumb.widthToUse || this._jsPlumb.img.width;\n this._jsPlumb.heightToUse = this._jsPlumb.heightToUse || this._jsPlumb.img.height;\n if (_onload) {\n _onload(this);\n }\n }\n }.bind(this);\n\n /*\n Function: setImage\n Sets the Image to use in this Endpoint.\n\n Parameters:\n img - may be a URL or an Image object\n onload - optional; a callback to execute once the image has loaded.\n */\n this._jsPlumb.endpoint.setImage = function (_img, onload) {\n var s = _img.constructor === String ? _img : _img.src;\n _onload = onload;\n this._jsPlumb.img.src = s;\n\n if (this.canvas != null) {\n this.canvas.setAttribute(\"src\", this._jsPlumb.img.src);\n }\n }.bind(this);\n\n this._jsPlumb.endpoint.setImage(src, _onload);\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n this.anchorPoint = anchorPoint;\n if (this._jsPlumb.ready) {\n return [anchorPoint[0] - this._jsPlumb.widthToUse / 2, anchorPoint[1] - this._jsPlumb.heightToUse / 2,\n this._jsPlumb.widthToUse, this._jsPlumb.heightToUse];\n }\n else {\n return [0, 0, 0, 0];\n }\n };\n\n this.canvas = _jp.createElement(\"img\", {\n position:\"absolute\",\n margin:0,\n padding:0,\n outline:0\n }, this._jsPlumb.instance.endpointClass + clazz);\n\n if (this._jsPlumb.widthToUse) {\n this.canvas.setAttribute(\"width\", this._jsPlumb.widthToUse);\n }\n if (this._jsPlumb.heightToUse) {\n this.canvas.setAttribute(\"height\", this._jsPlumb.heightToUse);\n }\n this._jsPlumb.instance.appendElement(this.canvas);\n\n this.actuallyPaint = function (d, style, anchor) {\n if (!this._jsPlumb.deleted) {\n if (!this._jsPlumb.initialized) {\n this.canvas.setAttribute(\"src\", this._jsPlumb.img.src);\n this.appendDisplayElement(this.canvas);\n this._jsPlumb.initialized = true;\n }\n var x = this.anchorPoint[0] - (this._jsPlumb.widthToUse / 2),\n y = this.anchorPoint[1] - (this._jsPlumb.heightToUse / 2);\n _ju.sizeElement(this.canvas, x, y, this._jsPlumb.widthToUse, this._jsPlumb.heightToUse);\n }\n };\n\n this.paint = function (style, anchor) {\n if (this._jsPlumb != null) { // may have been deleted\n if (this._jsPlumb.ready) {\n this.actuallyPaint(style, anchor);\n }\n else {\n root.setTimeout(function () {\n this.paint(style, anchor);\n }.bind(this), 200);\n }\n }\n };\n };\n _ju.extend(_jp.Endpoints.Image, [ DOMElementEndpoint, _jp.Endpoints.AbstractEndpoint ], {\n cleanup: function (force) {\n if (force) {\n this._jsPlumb.deleted = true;\n if (this.canvas) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n this.canvas = null;\n }\n }\n });\n\n /*\n * Class: Endpoints.Blank\n * An Endpoint that paints nothing (visible) on the screen. Supports cssClass and hoverClass parameters like all Endpoints.\n */\n _jp.Endpoints.Blank = function (params) {\n var _super = _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n this.type = \"Blank\";\n DOMElementEndpoint.apply(this, arguments);\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n return [anchorPoint[0], anchorPoint[1], 10, 0];\n };\n\n var clazz = params.cssClass ? \" \" + params.cssClass : \"\";\n\n this.canvas = _jp.createElement(\"div\", {\n display: \"block\",\n width: \"1px\",\n height: \"1px\",\n background: \"transparent\",\n position: \"absolute\"\n }, this._jsPlumb.instance.endpointClass + clazz);\n\n this._jsPlumb.instance.appendElement(this.canvas);\n\n this.paint = function (style, anchor) {\n _ju.sizeElement(this.canvas, this.x, this.y, this.w, this.h);\n };\n };\n _ju.extend(_jp.Endpoints.Blank, [_jp.Endpoints.AbstractEndpoint, DOMElementEndpoint], {\n cleanup: function () {\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n }\n });\n\n /*\n * Class: Endpoints.Triangle\n * A triangular Endpoint.\n */\n /*\n * Function: Constructor\n *\n * Parameters:\n *\n * width width of the triangle's base. defaults to 55 pixels.\n * height height of the triangle from base to apex. defaults to 55 pixels.\n */\n _jp.Endpoints.Triangle = function (params) {\n this.type = \"Triangle\";\n _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n var self = this;\n params = params || { };\n params.width = params.width || 55;\n params.height = params.height || 55;\n this.width = params.width;\n this.height = params.height;\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n var width = endpointStyle.width || self.width,\n height = endpointStyle.height || self.height,\n x = anchorPoint[0] - (width / 2),\n y = anchorPoint[1] - (height / 2);\n return [ x, y, width, height ];\n };\n };\n// ********************************* END OF ENDPOINT TYPES *******************************************************************\n\n\n// ********************************* OVERLAY DEFINITIONS *********************************************************************** \n\n var AbstractOverlay = _jp.Overlays.AbstractOverlay = function (params) {\n this.visible = true;\n this.isAppendedAtTopLevel = true;\n this.component = params.component;\n this.loc = params.location == null ? 0.5 : params.location;\n this.endpointLoc = params.endpointLocation == null ? [ 0.5, 0.5] : params.endpointLocation;\n this.visible = params.visible !== false;\n };\n AbstractOverlay.prototype = {\n cleanup: function (force) {\n if (force) {\n this.component = null;\n this.canvas = null;\n this.endpointLoc = null;\n }\n },\n reattach:function(instance, component) { },\n setVisible: function (val) {\n this.visible = val;\n this.component.repaint();\n },\n isVisible: function () {\n return this.visible;\n },\n hide: function () {\n this.setVisible(false);\n },\n show: function () {\n this.setVisible(true);\n },\n incrementLocation: function (amount) {\n this.loc += amount;\n this.component.repaint();\n },\n setLocation: function (l) {\n this.loc = l;\n this.component.repaint();\n },\n getLocation: function () {\n return this.loc;\n },\n updateFrom:function() { }\n };\n\n\n /*\n * Class: Overlays.Arrow\n *\n * An arrow overlay, defined by four points: the head, the two sides of the tail, and a 'foldback' point at some distance along the length\n * of the arrow that lines from each tail point converge into. The foldback point is defined using a decimal that indicates some fraction\n * of the length of the arrow and has a default value of 0.623. A foldback point value of 1 would mean that the arrow had a straight line\n * across the tail.\n */\n /*\n * @constructor\n *\n * @param {Object} params Constructor params.\n * @param {Number} [params.length] Distance in pixels from head to tail baseline. default 20.\n * @param {Number} [params.width] Width in pixels of the tail baseline. default 20.\n * @param {String} [params.fill] Style to use when filling the arrow. defaults to \"black\".\n * @param {String} [params.stroke] Style to use when stroking the arrow. defaults to null, which means the arrow is not stroked.\n * @param {Number} [params.stroke-width] Line width to use when stroking the arrow. defaults to 1, but only used if stroke is not null.\n * @param {Number} [params.foldback] Distance (as a decimal from 0 to 1 inclusive) along the length of the arrow marking the point the tail points should fold back to. defaults to 0.623.\n * @param {Number} [params.location] Distance (as a decimal from 0 to 1 inclusive) marking where the arrow should sit on the connector. defaults to 0.5.\n * @param {NUmber} [params.direction] Indicates the direction the arrow points in. valid values are -1 and 1; 1 is default.\n */\n _jp.Overlays.Arrow = function (params) {\n this.type = \"Arrow\";\n AbstractOverlay.apply(this, arguments);\n this.isAppendedAtTopLevel = false;\n params = params || {};\n var self = this;\n\n this.length = params.length || 20;\n this.width = params.width || 20;\n this.id = params.id;\n var direction = (params.direction || 1) < 0 ? -1 : 1,\n paintStyle = params.paintStyle || { \"stroke-width\": 1 },\n // how far along the arrow the lines folding back in come to. default is 62.3%.\n foldback = params.foldback || 0.623;\n\n this.computeMaxSize = function () {\n return self.width * 1.5;\n };\n\n this.elementCreated = function(p, component) {\n this.path = p;\n if (params.events) {\n for (var i in params.events) {\n _jp.on(p, i, params.events[i]);\n }\n }\n };\n\n this.draw = function (component, currentConnectionPaintStyle) {\n\n var hxy, mid, txy, tail, cxy;\n if (component.pointAlongPathFrom) {\n\n if (_ju.isString(this.loc) || this.loc > 1 || this.loc < 0) {\n var l = parseInt(this.loc, 10),\n fromLoc = this.loc < 0 ? 1 : 0;\n hxy = component.pointAlongPathFrom(fromLoc, l, false);\n mid = component.pointAlongPathFrom(fromLoc, l - (direction * this.length / 2), false);\n txy = _jg.pointOnLine(hxy, mid, this.length);\n }\n else if (this.loc === 1) {\n hxy = component.pointOnPath(this.loc);\n mid = component.pointAlongPathFrom(this.loc, -(this.length));\n txy = _jg.pointOnLine(hxy, mid, this.length);\n\n if (direction === -1) {\n var _ = txy;\n txy = hxy;\n hxy = _;\n }\n }\n else if (this.loc === 0) {\n txy = component.pointOnPath(this.loc);\n mid = component.pointAlongPathFrom(this.loc, this.length);\n hxy = _jg.pointOnLine(txy, mid, this.length);\n if (direction === -1) {\n var __ = txy;\n txy = hxy;\n hxy = __;\n }\n }\n else {\n hxy = component.pointAlongPathFrom(this.loc, direction * this.length / 2);\n mid = component.pointOnPath(this.loc);\n txy = _jg.pointOnLine(hxy, mid, this.length);\n }\n\n tail = _jg.perpendicularLineTo(hxy, txy, this.width);\n cxy = _jg.pointOnLine(hxy, txy, foldback * this.length);\n\n var d = { hxy: hxy, tail: tail, cxy: cxy },\n stroke = paintStyle.stroke || currentConnectionPaintStyle.stroke,\n fill = paintStyle.fill || currentConnectionPaintStyle.stroke,\n lineWidth = paintStyle.strokeWidth || currentConnectionPaintStyle.strokeWidth;\n\n return {\n component: component,\n d: d,\n \"stroke-width\": lineWidth,\n stroke: stroke,\n fill: fill,\n minX: Math.min(hxy.x, tail[0].x, tail[1].x),\n maxX: Math.max(hxy.x, tail[0].x, tail[1].x),\n minY: Math.min(hxy.y, tail[0].y, tail[1].y),\n maxY: Math.max(hxy.y, tail[0].y, tail[1].y)\n };\n }\n else {\n return {component: component, minX: 0, maxX: 0, minY: 0, maxY: 0};\n }\n };\n };\n _ju.extend(_jp.Overlays.Arrow, AbstractOverlay, {\n updateFrom:function(d) {\n this.length = d.length || this.length;\n this.width = d.width|| this.width;\n this.direction = d.direction != null ? d.direction : this.direction;\n this.foldback = d.foldback|| this.foldback;\n },\n cleanup:function() {\n if (this.path && this.canvas) {\n this.canvas.removeChild(this.path);\n }\n }\n });\n\n /*\n * Class: Overlays.PlainArrow\n *\n * A basic arrow. This is in fact just one instance of the more generic case in which the tail folds back on itself to some\n * point along the length of the arrow: in this case, that foldback point is the full length of the arrow. so it just does\n * a 'call' to Arrow with foldback set appropriately.\n */\n /*\n * Function: Constructor\n * See for allowed parameters for this overlay.\n */\n _jp.Overlays.PlainArrow = function (params) {\n params = params || {};\n var p = _jp.extend(params, {foldback: 1});\n _jp.Overlays.Arrow.call(this, p);\n this.type = \"PlainArrow\";\n };\n _ju.extend(_jp.Overlays.PlainArrow, _jp.Overlays.Arrow);\n\n /*\n * Class: Overlays.Diamond\n * \n * A diamond. Like PlainArrow, this is a concrete case of the more generic case of the tail points converging on some point...it just\n * happens that in this case, that point is greater than the length of the the arrow.\n *\n * this could probably do with some help with positioning...due to the way it reuses the Arrow paint code, what Arrow thinks is the\n * center is actually 1/4 of the way along for this guy. but we don't have any knowledge of pixels at this point, so we're kind of\n * stuck when it comes to helping out the Arrow class. possibly we could pass in a 'transpose' parameter or something. the value\n * would be -l/4 in this case - move along one quarter of the total length.\n */\n /*\n * Function: Constructor\n * See for allowed parameters for this overlay.\n */\n _jp.Overlays.Diamond = function (params) {\n params = params || {};\n var l = params.length || 40,\n p = _jp.extend(params, {length: l / 2, foldback: 2});\n _jp.Overlays.Arrow.call(this, p);\n this.type = \"Diamond\";\n };\n _ju.extend(_jp.Overlays.Diamond, _jp.Overlays.Arrow);\n\n var _getDimensions = function (component, forceRefresh) {\n if (component._jsPlumb.cachedDimensions == null || forceRefresh) {\n component._jsPlumb.cachedDimensions = component.getDimensions();\n }\n return component._jsPlumb.cachedDimensions;\n };\n\n // abstract superclass for overlays that add an element to the DOM.\n var AbstractDOMOverlay = function (params) {\n _jp.jsPlumbUIComponent.apply(this, arguments);\n AbstractOverlay.apply(this, arguments);\n\n // hand off fired events to associated component.\n var _f = this.fire;\n this.fire = function () {\n _f.apply(this, arguments);\n if (this.component) {\n this.component.fire.apply(this.component, arguments);\n }\n };\n\n this.detached=false;\n this.id = params.id;\n this._jsPlumb.div = null;\n this._jsPlumb.initialised = false;\n this._jsPlumb.component = params.component;\n this._jsPlumb.cachedDimensions = null;\n this._jsPlumb.create = params.create;\n this._jsPlumb.initiallyInvisible = params.visible === false;\n\n this.getElement = function () {\n if (this._jsPlumb.div == null) {\n var div = this._jsPlumb.div = _jp.getElement(this._jsPlumb.create(this._jsPlumb.component));\n div.style.position = \"absolute\";\n jsPlumb.addClass(div, this._jsPlumb.instance.overlayClass + \" \" +\n (this.cssClass ? this.cssClass :\n params.cssClass ? params.cssClass : \"\"));\n this._jsPlumb.instance.appendElement(div);\n this._jsPlumb.instance.getId(div);\n this.canvas = div;\n\n // in IE the top left corner is what it placed at the desired location. This will not\n // be fixed. IE8 is not going to be supported for much longer.\n var ts = \"translate(-50%, -50%)\";\n div.style.webkitTransform = ts;\n div.style.mozTransform = ts;\n div.style.msTransform = ts;\n div.style.oTransform = ts;\n div.style.transform = ts;\n\n // write the related component into the created element\n div._jsPlumb = this;\n\n if (params.visible === false) {\n div.style.display = \"none\";\n }\n }\n return this._jsPlumb.div;\n };\n\n this.draw = function (component, currentConnectionPaintStyle, absolutePosition) {\n var td = _getDimensions(this);\n if (td != null && td.length === 2) {\n var cxy = { x: 0, y: 0 };\n\n // absolutePosition would have been set by a call to connection.setAbsoluteOverlayPosition.\n if (absolutePosition) {\n cxy = { x: absolutePosition[0], y: absolutePosition[1] };\n }\n else if (component.pointOnPath) {\n var loc = this.loc, absolute = false;\n if (_ju.isString(this.loc) || this.loc < 0 || this.loc > 1) {\n loc = parseInt(this.loc, 10);\n absolute = true;\n }\n cxy = component.pointOnPath(loc, absolute); // a connection\n }\n else {\n var locToUse = this.loc.constructor === Array ? this.loc : this.endpointLoc;\n cxy = { x: locToUse[0] * component.w,\n y: locToUse[1] * component.h };\n }\n\n var minx = cxy.x - (td[0] / 2),\n miny = cxy.y - (td[1] / 2);\n\n return {\n component: component,\n d: { minx: minx, miny: miny, td: td, cxy: cxy },\n minX: minx,\n maxX: minx + td[0],\n minY: miny,\n maxY: miny + td[1]\n };\n }\n else {\n return {minX: 0, maxX: 0, minY: 0, maxY: 0};\n }\n };\n };\n _ju.extend(AbstractDOMOverlay, [_jp.jsPlumbUIComponent, AbstractOverlay], {\n getDimensions: function () {\n return [1,1];\n },\n setVisible: function (state) {\n if (this._jsPlumb.div) {\n this._jsPlumb.div.style.display = state ? \"block\" : \"none\";\n // if initially invisible, dimensions are 0,0 and never get updated\n if (state && this._jsPlumb.initiallyInvisible) {\n _getDimensions(this, true);\n this.component.repaint();\n this._jsPlumb.initiallyInvisible = false;\n }\n }\n },\n /*\n * Function: clearCachedDimensions\n * Clears the cached dimensions for the label. As a performance enhancement, label dimensions are\n * cached from 1.3.12 onwards. The cache is cleared when you change the label text, of course, but\n * there are other reasons why the text dimensions might change - if you make a change through CSS, for\n * example, you might change the font size. in that case you should explicitly call this method.\n */\n clearCachedDimensions: function () {\n this._jsPlumb.cachedDimensions = null;\n },\n cleanup: function (force) {\n if (force) {\n if (this._jsPlumb.div != null) {\n this._jsPlumb.div._jsPlumb = null;\n this._jsPlumb.instance.removeElement(this._jsPlumb.div);\n }\n }\n else {\n // if not a forced cleanup, just detach child from parent for now.\n if (this._jsPlumb && this._jsPlumb.div && this._jsPlumb.div.parentNode) {\n this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div);\n }\n this.detached = true;\n }\n\n },\n reattach:function(instance, component) {\n if (this._jsPlumb.div != null) {\n instance.getContainer().appendChild(this._jsPlumb.div);\n }\n this.detached = false;\n },\n computeMaxSize: function () {\n var td = _getDimensions(this);\n return Math.max(td[0], td[1]);\n },\n paint: function (p, containerExtents) {\n if (!this._jsPlumb.initialised) {\n this.getElement();\n p.component.appendDisplayElement(this._jsPlumb.div);\n this._jsPlumb.initialised = true;\n if (this.detached) {\n this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div);\n }\n }\n this._jsPlumb.div.style.left = (p.component.x + p.d.minx) + \"px\";\n this._jsPlumb.div.style.top = (p.component.y + p.d.miny) + \"px\";\n }\n });\n\n /*\n * Class: Overlays.Custom\n * A Custom overlay. You supply a 'create' function which returns some DOM element, and jsPlumb positions it.\n * The 'create' function is passed a Connection or Endpoint.\n */\n /*\n * Function: Constructor\n * \n * Parameters:\n * create - function for jsPlumb to call that returns a DOM element.\n * location - distance (as a decimal from 0 to 1 inclusive) marking where the label should sit on the connector. defaults to 0.5.\n * id - optional id to use for later retrieval of this overlay.\n *\n */\n _jp.Overlays.Custom = function (params) {\n this.type = \"Custom\";\n AbstractDOMOverlay.apply(this, arguments);\n };\n _ju.extend(_jp.Overlays.Custom, AbstractDOMOverlay);\n\n _jp.Overlays.GuideLines = function () {\n var self = this;\n self.length = 50;\n self.strokeWidth = 5;\n this.type = \"GuideLines\";\n AbstractOverlay.apply(this, arguments);\n _jp.jsPlumbUIComponent.apply(this, arguments);\n this.draw = function (connector, currentConnectionPaintStyle) {\n\n var head = connector.pointAlongPathFrom(self.loc, self.length / 2),\n mid = connector.pointOnPath(self.loc),\n tail = _jg.pointOnLine(head, mid, self.length),\n tailLine = _jg.perpendicularLineTo(head, tail, 40),\n headLine = _jg.perpendicularLineTo(tail, head, 20);\n\n return {\n connector: connector,\n head: head,\n tail: tail,\n headLine: headLine,\n tailLine: tailLine,\n minX: Math.min(head.x, tail.x, headLine[0].x, headLine[1].x),\n minY: Math.min(head.y, tail.y, headLine[0].y, headLine[1].y),\n maxX: Math.max(head.x, tail.x, headLine[0].x, headLine[1].x),\n maxY: Math.max(head.y, tail.y, headLine[0].y, headLine[1].y)\n };\n };\n\n // this.cleanup = function() { }; // nothing to clean up for GuideLines\n };\n\n /*\n * Class: Overlays.Label\n\n */\n /*\n * Function: Constructor\n * \n * Parameters:\n * cssClass - optional css class string to append to css class. This string is appended \"as-is\", so you can of course have multiple classes\n * defined. This parameter is preferred to using labelStyle, borderWidth and borderStyle.\n * label - the label to paint. May be a string or a function that returns a string. Nothing will be painted if your label is null or your\n * label function returns null. empty strings _will_ be painted.\n * location - distance (as a decimal from 0 to 1 inclusive) marking where the label should sit on the connector. defaults to 0.5.\n * id - optional id to use for later retrieval of this overlay.\n * \n *\n */\n _jp.Overlays.Label = function (params) {\n this.labelStyle = params.labelStyle;\n\n var labelWidth = null, labelHeight = null, labelText = null, labelPadding = null;\n this.cssClass = this.labelStyle != null ? this.labelStyle.cssClass : null;\n var p = _jp.extend({\n create: function () {\n return _jp.createElement(\"div\");\n }}, params);\n _jp.Overlays.Custom.call(this, p);\n this.type = \"Label\";\n this.label = params.label || \"\";\n this.labelText = null;\n if (this.labelStyle) {\n var el = this.getElement();\n this.labelStyle.font = this.labelStyle.font || \"12px sans-serif\";\n el.style.font = this.labelStyle.font;\n el.style.color = this.labelStyle.color || \"black\";\n if (this.labelStyle.fill) {\n el.style.background = this.labelStyle.fill;\n }\n if (this.labelStyle.borderWidth > 0) {\n var dStyle = this.labelStyle.borderStyle ? this.labelStyle.borderStyle : \"black\";\n el.style.border = this.labelStyle.borderWidth + \"px solid \" + dStyle;\n }\n if (this.labelStyle.padding) {\n el.style.padding = this.labelStyle.padding;\n }\n }\n\n };\n _ju.extend(_jp.Overlays.Label, _jp.Overlays.Custom, {\n cleanup: function (force) {\n if (force) {\n this.div = null;\n this.label = null;\n this.labelText = null;\n this.cssClass = null;\n this.labelStyle = null;\n }\n },\n getLabel: function () {\n return this.label;\n },\n /*\n * Function: setLabel\n * sets the label's, um, label. you would think i'd call this function\n * 'setText', but you can pass either a Function or a String to this, so\n * it makes more sense as 'setLabel'. This uses innerHTML on the label div, so keep\n * that in mind if you need escaped HTML.\n */\n setLabel: function (l) {\n this.label = l;\n this.labelText = null;\n this.clearCachedDimensions();\n this.update();\n this.component.repaint();\n },\n getDimensions: function () {\n this.update();\n return AbstractDOMOverlay.prototype.getDimensions.apply(this, arguments);\n },\n update: function () {\n if (typeof this.label === \"function\") {\n var lt = this.label(this);\n this.getElement().innerHTML = lt.replace(/\\r\\n/g, \"
\");\n }\n else {\n if (this.labelText == null) {\n this.labelText = this.label;\n this.getElement().innerHTML = this.labelText.replace(/\\r\\n/g, \"
\");\n }\n }\n },\n updateFrom:function(d) {\n if(d.label != null){\n this.setLabel(d.label);\n }\n }\n });\n\n // ********************************* END OF OVERLAY DEFINITIONS ***********************************************************************\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function() {\n \"use strict\";\n\n var root = this,\n _ju = root.jsPlumbUtil,\n _jpi = root.jsPlumbInstance;\n\n var GROUP_COLLAPSED_CLASS = \"jtk-group-collapsed\";\n var GROUP_EXPANDED_CLASS = \"jtk-group-expanded\";\n var GROUP_CONTAINER_SELECTOR = \"[jtk-group-content]\";\n var ELEMENT_DRAGGABLE_EVENT = \"elementDraggable\";\n var STOP = \"stop\";\n var REVERT = \"revert\";\n var GROUP_MANAGER = \"_groupManager\";\n var GROUP = \"_jsPlumbGroup\";\n var GROUP_DRAG_SCOPE = \"_jsPlumbGroupDrag\";\n var EVT_CHILD_ADDED = \"group:addMember\";\n var EVT_CHILD_REMOVED = \"group:removeMember\";\n var EVT_GROUP_ADDED = \"group:add\";\n var EVT_GROUP_REMOVED = \"group:remove\";\n var EVT_EXPAND = \"group:expand\";\n var EVT_COLLAPSE = \"group:collapse\";\n var EVT_GROUP_DRAG_STOP = \"groupDragStop\";\n var EVT_CONNECTION_MOVED = \"connectionMoved\";\n var EVT_INTERNAL_CONNECTION_DETACHED = \"internal.connectionDetached\";\n\n var CMD_REMOVE_ALL = \"removeAll\";\n var CMD_ORPHAN_ALL = \"orphanAll\";\n var CMD_SHOW = \"show\";\n var CMD_HIDE = \"hide\";\n\n var GroupManager = function(_jsPlumb) {\n var _managedGroups = {}, _connectionSourceMap = {}, _connectionTargetMap = {}, self = this;\n\n _jsPlumb.bind(\"connection\", function(p) {\n if (p.source[GROUP] != null && p.target[GROUP] != null && p.source[GROUP] === p.target[GROUP]) {\n _connectionSourceMap[p.connection.id] = p.source[GROUP];\n _connectionTargetMap[p.connection.id] = p.source[GROUP];\n }\n else {\n if (p.source[GROUP] != null) {\n _ju.suggest(p.source[GROUP].connections.source, p.connection);\n _connectionSourceMap[p.connection.id] = p.source[GROUP];\n }\n if (p.target[GROUP] != null) {\n _ju.suggest(p.target[GROUP].connections.target, p.connection);\n _connectionTargetMap[p.connection.id] = p.target[GROUP];\n }\n }\n });\n\n function _cleanupDetachedConnection(conn) {\n delete conn.proxies;\n var group = _connectionSourceMap[conn.id], f;\n if (group != null) {\n f = function(c) { return c.id === conn.id; };\n _ju.removeWithFunction(group.connections.source, f);\n _ju.removeWithFunction(group.connections.target, f);\n delete _connectionSourceMap[conn.id];\n }\n\n group = _connectionTargetMap[conn.id];\n if (group != null) {\n f = function(c) { return c.id === conn.id; };\n _ju.removeWithFunction(group.connections.source, f);\n _ju.removeWithFunction(group.connections.target, f);\n delete _connectionTargetMap[conn.id];\n }\n }\n\n _jsPlumb.bind(EVT_INTERNAL_CONNECTION_DETACHED, function(p) {\n _cleanupDetachedConnection(p.connection);\n });\n\n _jsPlumb.bind(EVT_CONNECTION_MOVED, function(p) {\n var connMap = p.index === 0 ? _connectionSourceMap : _connectionTargetMap;\n var group = connMap[p.connection.id];\n if (group) {\n var list = group.connections[p.index === 0 ? \"source\" : \"target\"];\n var idx = list.indexOf(p.connection);\n if (idx !== -1) {\n list.splice(idx, 1);\n }\n }\n });\n\n this.addGroup = function(group) {\n _jsPlumb.addClass(group.getEl(), GROUP_EXPANDED_CLASS);\n _managedGroups[group.id] = group;\n group.manager = this;\n _updateConnectionsForGroup(group);\n _jsPlumb.fire(EVT_GROUP_ADDED, { group:group });\n };\n\n this.addToGroup = function(group, el, doNotFireEvent) {\n group = this.getGroup(group);\n if (group) {\n var groupEl = group.getEl();\n\n if (el._isJsPlumbGroup) {\n return;\n }\n var currentGroup = el._jsPlumbGroup;\n // if already a member of this group, do nothing\n if (currentGroup !== group) {\n var elpos = _jsPlumb.getOffset(el, true);\n var cpos = group.collapsed ? _jsPlumb.getOffset(groupEl, true) : _jsPlumb.getOffset(group.getDragArea(), true);\n\n // otherwise, transfer to this group.\n if (currentGroup != null) {\n currentGroup.remove(el, false, doNotFireEvent, false, group);\n self.updateConnectionsForGroup(currentGroup);\n }\n group.add(el, doNotFireEvent/*, currentGroup*/);\n\n var handleDroppedConnections = function (list, index) {\n var oidx = index === 0 ? 1 : 0;\n list.each(function (c) {\n c.setVisible(false);\n if (c.endpoints[oidx].element._jsPlumbGroup === group) {\n c.endpoints[oidx].setVisible(false);\n self.expandConnection(c, oidx, group);\n }\n else {\n c.endpoints[index].setVisible(false);\n self.collapseConnection(c, index, group);\n }\n });\n };\n\n if (group.collapsed) {\n handleDroppedConnections(_jsPlumb.select({source: el}), 0);\n handleDroppedConnections(_jsPlumb.select({target: el}), 1);\n }\n\n var elId = _jsPlumb.getId(el);\n _jsPlumb.dragManager.setParent(el, elId, groupEl, _jsPlumb.getId(groupEl), elpos);\n\n var newPosition = { left: elpos.left - cpos.left, top: elpos.top - cpos.top };\n\n _jsPlumb.setPosition(el, newPosition);\n\n _jsPlumb.dragManager.revalidateParent(el, elId, elpos);\n\n self.updateConnectionsForGroup(group);\n\n _jsPlumb.revalidate(elId);\n\n if (!doNotFireEvent) {\n var p = {group: group, el: el};\n if (currentGroup) {\n p.sourceGroup = currentGroup;\n }\n _jsPlumb.fire(EVT_CHILD_ADDED, p);\n }\n }\n }\n };\n\n this.removeFromGroup = function(group, el, doNotFireEvent) {\n group = this.getGroup(group);\n if (group) {\n group.remove(el, null, doNotFireEvent);\n }\n };\n\n this.getGroup = function(groupId) {\n var group = groupId;\n if (_ju.isString(groupId)) {\n group = _managedGroups[groupId];\n if (group == null) {\n throw new TypeError(\"No such group [\" + groupId + \"]\");\n }\n }\n return group;\n };\n\n this.getGroups = function() {\n var o = [];\n for (var g in _managedGroups) {\n o.push(_managedGroups[g]);\n }\n return o;\n };\n\n this.removeGroup = function(group, deleteMembers, manipulateDOM, doNotFireEvent) {\n group = this.getGroup(group);\n this.expandGroup(group, true); // this reinstates any original connections and removes all proxies, but does not fire an event.\n var newPositions = group[deleteMembers ? CMD_REMOVE_ALL : CMD_ORPHAN_ALL](manipulateDOM, doNotFireEvent);\n _jsPlumb.remove(group.getEl());\n delete _managedGroups[group.id];\n delete _jsPlumb._groups[group.id];\n _jsPlumb.fire(EVT_GROUP_REMOVED, { group:group });\n return newPositions; // this will be null in the case or remove, but be a map of {id->[x,y]} in the case of orphan\n };\n\n this.removeAllGroups = function(deleteMembers, manipulateDOM, doNotFireEvent) {\n for (var g in _managedGroups) {\n this.removeGroup(_managedGroups[g], deleteMembers, manipulateDOM, doNotFireEvent);\n }\n };\n\n function _setVisible(group, state) {\n var m = group.getMembers();\n for (var i = 0; i < m.length; i++) {\n _jsPlumb[state ? CMD_SHOW : CMD_HIDE](m[i], true);\n }\n }\n\n var _collapseConnection = this.collapseConnection = function(c, index, group) {\n\n var proxyEp, groupEl = group.getEl(), groupElId = _jsPlumb.getId(groupEl),\n originalElementId = c.endpoints[index].elementId;\n\n var otherEl = c.endpoints[index === 0 ? 1 : 0].element;\n if (otherEl[GROUP] && (!otherEl[GROUP].shouldProxy() && otherEl[GROUP].collapsed)) {\n return;\n }\n\n c.proxies = c.proxies || [];\n if(c.proxies[index]) {\n proxyEp = c.proxies[index].ep;\n }else {\n proxyEp = _jsPlumb.addEndpoint(groupEl, {\n endpoint:group.getEndpoint(c, index),\n anchor:group.getAnchor(c, index),\n parameters:{\n isProxyEndpoint:true\n }\n });\n }\n proxyEp.setDeleteOnEmpty(true);\n\n // for this index, stash proxy info: the new EP, the original EP.\n c.proxies[index] = { ep:proxyEp, originalEp: c.endpoints[index] };\n\n // and advise the anchor manager\n if (index === 0) {\n // TODO why are there two differently named methods? Why is there not one method that says \"some end of this\n // connection changed (you give the index), and here's the new element and element id.\"\n _jsPlumb.anchorManager.sourceChanged(originalElementId, groupElId, c, groupEl);\n }\n else {\n _jsPlumb.anchorManager.updateOtherEndpoint(c.endpoints[0].elementId, originalElementId, groupElId, c);\n c.target = groupEl;\n c.targetId = groupElId;\n }\n\n\n // detach the original EP from the connection.\n c.proxies[index].originalEp.detachFromConnection(c, null, true);\n\n // set the proxy as the new ep\n proxyEp.connections = [ c ];\n c.endpoints[index] = proxyEp;\n\n c.setVisible(true);\n };\n\n this.collapseGroup = function(group) {\n group = this.getGroup(group);\n if (group == null || group.collapsed) {\n return;\n }\n var groupEl = group.getEl();\n\n // todo remove old proxy endpoints first, just in case?\n //group.proxies.length = 0;\n\n // hide all connections\n _setVisible(group, false);\n\n if (group.shouldProxy()) {\n // collapses all connections in a group.\n var _collapseSet = function (conns, index) {\n for (var i = 0; i < conns.length; i++) {\n var c = conns[i];\n _collapseConnection(c, index, group);\n }\n };\n\n // setup proxies for sources and targets\n _collapseSet(group.connections.source, 0);\n _collapseSet(group.connections.target, 1);\n }\n\n group.collapsed = true;\n _jsPlumb.removeClass(groupEl, GROUP_EXPANDED_CLASS);\n _jsPlumb.addClass(groupEl, GROUP_COLLAPSED_CLASS);\n _jsPlumb.revalidate(groupEl);\n _jsPlumb.fire(EVT_COLLAPSE, { group:group });\n };\n\n var _expandConnection = this.expandConnection = function(c, index, group) {\n\n // if no proxies or none for this end of the connection, abort.\n if (c.proxies == null || c.proxies[index] == null) {\n return;\n }\n\n var groupElId = _jsPlumb.getId(group.getEl()),\n originalElement = c.proxies[index].originalEp.element,\n originalElementId = c.proxies[index].originalEp.elementId;\n\n c.endpoints[index] = c.proxies[index].originalEp;\n // and advise the anchor manager\n if (index === 0) {\n // TODO why are there two differently named methods? Why is there not one method that says \"some end of this\n // connection changed (you give the index), and here's the new element and element id.\"\n _jsPlumb.anchorManager.sourceChanged(groupElId, originalElementId, c, originalElement);\n }\n else {\n _jsPlumb.anchorManager.updateOtherEndpoint(c.endpoints[0].elementId, groupElId, originalElementId, c);\n c.target = originalElement;\n c.targetId = originalElementId;\n }\n\n // detach the proxy EP from the connection (which will cause it to be removed as we no longer need it)\n c.proxies[index].ep.detachFromConnection(c, null);\n\n c.proxies[index].originalEp.addConnection(c);\n\n // cleanup\n delete c.proxies[index];\n };\n\n this.expandGroup = function(group, doNotFireEvent) {\n\n group = this.getGroup(group);\n\n if (group == null || !group.collapsed) {\n return;\n }\n var groupEl = group.getEl();\n\n _setVisible(group, true);\n\n if (group.shouldProxy()) {\n // collapses all connections in a group.\n var _expandSet = function (conns, index) {\n for (var i = 0; i < conns.length; i++) {\n var c = conns[i];\n _expandConnection(c, index, group);\n }\n };\n\n // setup proxies for sources and targets\n _expandSet(group.connections.source, 0);\n _expandSet(group.connections.target, 1);\n }\n\n group.collapsed = false;\n _jsPlumb.addClass(groupEl, GROUP_EXPANDED_CLASS);\n _jsPlumb.removeClass(groupEl, GROUP_COLLAPSED_CLASS);\n _jsPlumb.revalidate(groupEl);\n this.repaintGroup(group);\n if (!doNotFireEvent) {\n _jsPlumb.fire(EVT_EXPAND, { group: group});\n }\n };\n\n this.repaintGroup = function(group) {\n group = this.getGroup(group);\n var m = group.getMembers();\n for (var i = 0; i < m.length; i++) {\n _jsPlumb.revalidate(m[i]);\n }\n };\n\n // TODO refactor this with the code that responds to `connection` events.\n function _updateConnectionsForGroup(group) {\n var members = group.getMembers();\n var c1 = _jsPlumb.getConnections({source:members, scope:\"*\"}, true);\n var c2 = _jsPlumb.getConnections({target:members, scope:\"*\"}, true);\n var processed = {};\n group.connections.source.length = 0;\n group.connections.target.length = 0;\n var oneSet = function(c) {\n for (var i = 0; i < c.length; i++) {\n if (processed[c[i].id]) {\n continue;\n }\n processed[c[i].id] = true;\n if (c[i].source._jsPlumbGroup === group) {\n if (c[i].target._jsPlumbGroup !== group) {\n group.connections.source.push(c[i]);\n }\n _connectionSourceMap[c[i].id] = group;\n }\n else if (c[i].target._jsPlumbGroup === group) {\n group.connections.target.push(c[i]);\n _connectionTargetMap[c[i].id] = group;\n }\n }\n };\n oneSet(c1); oneSet(c2);\n }\n\n this.updateConnectionsForGroup = _updateConnectionsForGroup;\n this.refreshAllGroups = function() {\n for (var g in _managedGroups) {\n _updateConnectionsForGroup(_managedGroups[g]);\n _jsPlumb.dragManager.updateOffsets(_jsPlumb.getId(_managedGroups[g].getEl()));\n }\n };\n };\n\n /**\n *\n * @param {jsPlumbInstance} _jsPlumb Associated jsPlumb instance.\n * @param {Object} params\n * @param {Element} params.el The DOM element representing the Group.\n * @param {String} [params.id] Optional ID for the Group. A UUID will be assigned as the Group's ID if you do not provide one.\n * @param {Boolean} [params.constrain=false] If true, child elements will not be able to be dragged outside of the Group container.\n * @param {Boolean} [params.revert=true] By default, child elements revert to the container if dragged outside. You can change this by setting `revert:false`. This behaviour is also overridden if you set `orphan` or `prune`.\n * @param {Boolean} [params.orphan=false] If true, child elements dropped outside of the Group container will be removed from the Group (but not from the DOM).\n * @param {Boolean} [params.prune=false] If true, child elements dropped outside of the Group container will be removed from the Group and also from the DOM.\n * @param {Boolean} [params.dropOverride=false] If true, a child element that has been dropped onto some other Group will not be subject to the controls imposed by `prune`, `revert` or `orphan`.\n * @constructor\n */\n var Group = function(_jsPlumb, params) {\n var self = this;\n var el = params.el;\n this.getEl = function() { return el; };\n this.id = params.id || _ju.uuid();\n el._isJsPlumbGroup = true;\n\n var getDragArea = this.getDragArea = function() {\n var da = _jsPlumb.getSelector(el, GROUP_CONTAINER_SELECTOR);\n return da && da.length > 0 ? da[0] : el;\n };\n\n var ghost = params.ghost === true;\n var constrain = ghost || (params.constrain === true);\n var revert = params.revert !== false;\n var orphan = params.orphan === true;\n var prune = params.prune === true;\n var dropOverride = params.dropOverride === true;\n var proxied = params.proxied !== false;\n var elements = [];\n this.connections = { source:[], target:[], internal:[] };\n\n // this function, and getEndpoint below, are stubs for a future setup in which we can choose endpoint\n // and anchor based upon the connection and the index (source/target) of the endpoint to be proxied.\n this.getAnchor = function(conn, endpointIndex) {\n return params.anchor || \"Continuous\";\n };\n\n this.getEndpoint = function(conn, endpointIndex) {\n return params.endpoint || [ \"Dot\", { radius:10 }];\n };\n\n this.collapsed = false;\n if (params.draggable !== false) {\n var opts = {\n stop:function(params) {\n _jsPlumb.fire(EVT_GROUP_DRAG_STOP, jsPlumb.extend(params, {group:self}));\n },\n scope:GROUP_DRAG_SCOPE\n };\n if (params.dragOptions) {\n root.jsPlumb.extend(opts, params.dragOptions);\n }\n _jsPlumb.draggable(params.el, opts);\n }\n if (params.droppable !== false) {\n _jsPlumb.droppable(params.el, {\n drop:function(p) {\n var el = p.drag.el;\n if (el._isJsPlumbGroup) {\n return;\n }\n var currentGroup = el._jsPlumbGroup;\n if (currentGroup !== self) {\n if (currentGroup != null) {\n if (currentGroup.overrideDrop(el, self)) {\n return;\n }\n }\n _jsPlumb.getGroupManager().addToGroup(self, el, false);\n }\n\n }\n });\n }\n var _each = function(_el, fn) {\n var els = _el.nodeType == null ? _el : [ _el ];\n for (var i = 0; i < els.length; i++) {\n fn(els[i]);\n }\n };\n\n this.overrideDrop = function(_el, targetGroup) {\n return dropOverride && (revert || prune || orphan);\n };\n\n this.add = function(_el, doNotFireEvent/*, sourceGroup*/) {\n var dragArea = getDragArea();\n _each(_el, function(__el) {\n\n if (__el._jsPlumbGroup != null) {\n if (__el._jsPlumbGroup === self) {\n return;\n } else {\n __el._jsPlumbGroup.remove(__el, true, doNotFireEvent, false);\n }\n }\n\n __el._jsPlumbGroup = self;\n elements.push(__el);\n // test if draggable and add handlers if so.\n if (_jsPlumb.isAlreadyDraggable(__el)) {\n _bindDragHandlers(__el);\n }\n\n if (__el.parentNode !== dragArea) {\n dragArea.appendChild(__el);\n }\n\n // if (!doNotFireEvent) {\n // var p = {group: self, el: __el};\n // if (sourceGroup) {\n // p.sourceGroup = sourceGroup;\n // }\n // //_jsPlumb.fire(EVT_CHILD_ADDED, p);\n // }\n });\n\n _jsPlumb.getGroupManager().updateConnectionsForGroup(self);\n };\n\n this.remove = function(el, manipulateDOM, doNotFireEvent, doNotUpdateConnections, targetGroup) {\n\n _each(el, function(__el) {\n delete __el._jsPlumbGroup;\n _ju.removeWithFunction(elements, function(e) {\n return e === __el;\n });\n\n if (manipulateDOM) {\n try { self.getDragArea().removeChild(__el); }\n catch (e) {\n jsPlumbUtil.log(\"Could not remove element from Group \" + e);\n }\n }\n _unbindDragHandlers(__el);\n if (!doNotFireEvent) {\n var p = {group: self, el: __el};\n if (targetGroup) {\n p.targetGroup = targetGroup;\n }\n _jsPlumb.fire(EVT_CHILD_REMOVED, p);\n }\n });\n if (!doNotUpdateConnections) {\n _jsPlumb.getGroupManager().updateConnectionsForGroup(self);\n }\n };\n this.removeAll = function(manipulateDOM, doNotFireEvent) {\n for (var i = 0, l = elements.length; i < l; i++) {\n var el = elements[0];\n self.remove(el, manipulateDOM, doNotFireEvent, true);\n _jsPlumb.remove(el, true);\n }\n elements.length = 0;\n _jsPlumb.getGroupManager().updateConnectionsForGroup(self);\n };\n this.orphanAll = function() {\n var orphanedPositions = {};\n for (var i = 0; i < elements.length; i++) {\n var newPosition = _orphan(elements[i]);\n orphanedPositions[newPosition[0]] = newPosition[1];\n }\n elements.length = 0;\n\n return orphanedPositions;\n };\n this.getMembers = function() { return elements; };\n\n el[GROUP] = this;\n\n _jsPlumb.bind(ELEMENT_DRAGGABLE_EVENT, function(dragParams) {\n // if its for the current group,\n if (dragParams.el._jsPlumbGroup === this) {\n _bindDragHandlers(dragParams.el);\n }\n }.bind(this));\n\n function _findParent(_el) {\n return _el.offsetParent;\n }\n\n function _isInsideParent(_el, pos) {\n var p = _findParent(_el),\n s = _jsPlumb.getSize(p),\n ss = _jsPlumb.getSize(_el),\n leftEdge = pos[0],\n rightEdge = leftEdge + ss[0],\n topEdge = pos[1],\n bottomEdge = topEdge + ss[1];\n\n return rightEdge > 0 && leftEdge < s[0] && bottomEdge > 0 && topEdge < s[1];\n }\n\n //\n // orphaning an element means taking it out of the group and adding it to the main jsplumb container.\n // we return the new calculated position from this method and the element's id.\n //\n function _orphan(_el) {\n var id = _jsPlumb.getId(_el);\n var pos = _jsPlumb.getOffset(_el);\n _el.parentNode.removeChild(_el);\n _jsPlumb.getContainer().appendChild(_el);\n _jsPlumb.setPosition(_el, pos);\n delete _el._jsPlumbGroup;\n _unbindDragHandlers(_el);\n _jsPlumb.dragManager.clearParent(_el, id);\n return [id, pos];\n }\n\n //\n // remove an element from the group, then either prune it from the jsplumb instance, or just orphan it.\n //\n function _pruneOrOrphan(p) {\n var orphanedPosition = null;\n if (!_isInsideParent(p.el, p.pos)) {\n var group = p.el._jsPlumbGroup;\n if (prune) {\n _jsPlumb.remove(p.el);\n } else {\n orphanedPosition = _orphan(p.el);\n }\n\n group.remove(p.el);\n }\n\n return orphanedPosition;\n }\n\n //\n // redraws the element\n //\n function _revalidate(_el) {\n var id = _jsPlumb.getId(_el);\n _jsPlumb.revalidate(_el);\n _jsPlumb.dragManager.revalidateParent(_el, id);\n }\n\n //\n // unbind the group specific drag/revert handlers.\n //\n function _unbindDragHandlers(_el) {\n if (!_el._katavorioDrag) {\n return;\n }\n if (prune || orphan) {\n _el._katavorioDrag.off(STOP, _pruneOrOrphan);\n }\n if (!prune && !orphan && revert) {\n _el._katavorioDrag.off(REVERT, _revalidate);\n _el._katavorioDrag.setRevert(null);\n }\n }\n\n function _bindDragHandlers(_el) {\n if (!_el._katavorioDrag) {\n return;\n }\n if (prune || orphan) {\n _el._katavorioDrag.on(STOP, _pruneOrOrphan);\n }\n\n if (constrain) {\n _el._katavorioDrag.setConstrain(true);\n }\n\n if (ghost) {\n _el._katavorioDrag.setUseGhostProxy(true);\n }\n\n if (!prune && !orphan && revert) {\n _el._katavorioDrag.on(REVERT, _revalidate);\n _el._katavorioDrag.setRevert(function(__el, pos) {\n return !_isInsideParent(__el, pos);\n });\n }\n }\n\n this.shouldProxy = function() {\n return proxied;\n };\n\n _jsPlumb.getGroupManager().addGroup(this);\n };\n\n /**\n * Adds a group to the jsPlumb instance.\n * @method addGroup\n * @param {Object} params\n * @return {Group} The newly created Group.\n */\n _jpi.prototype.addGroup = function(params) {\n var j = this;\n j._groups = j._groups || {};\n if (j._groups[params.id] != null) {\n throw new TypeError(\"cannot create Group [\" + params.id + \"]; a Group with that ID exists\");\n }\n if (params.el[GROUP] != null) {\n throw new TypeError(\"cannot create Group [\" + params.id + \"]; the given element is already a Group\");\n }\n var group = new Group(j, params);\n j._groups[group.id] = group;\n if (params.collapsed) {\n this.collapseGroup(group);\n }\n return group;\n };\n\n /**\n * Add an element to a group.\n * @method addToGroup\n * @param {String} group Group, or ID of the group, to add the element to.\n * @param {Element} el Element to add to the group.\n */\n _jpi.prototype.addToGroup = function(group, el, doNotFireEvent) {\n\n var _one = function(_el) {\n var id = this.getId(_el);\n this.manage(id, _el);\n this.getGroupManager().addToGroup(group, _el, doNotFireEvent);\n }.bind(this);\n\n if (Array.isArray(el)) {\n for (var i = 0; i < el.length; i++) {\n _one(el[i]);\n }\n } else {\n _one(el);\n }\n };\n\n /**\n * Remove an element from a group.\n * @method removeFromGroup\n * @param {String} group Group, or ID of the group, to remove the element from.\n * @param {Element} el Element to add to the group.\n */\n _jpi.prototype.removeFromGroup = function(group, el, doNotFireEvent) {\n this.getGroupManager().removeFromGroup(group, el, doNotFireEvent);\n };\n\n /**\n * Remove a group, and optionally remove its members from the jsPlumb instance.\n * @method removeGroup\n * @param {String|Group} group Group to delete, or ID of Group to delete.\n * @param {Boolean} [deleteMembers=false] If true, group members will be removed along with the group. Otherwise they will\n * just be 'orphaned' (returned to the main container).\n * @returns {Map[String, Position}} When deleteMembers is false, this method returns a map of {id->position}\n */\n _jpi.prototype.removeGroup = function(group, deleteMembers, manipulateDOM, doNotFireEvent) {\n return this.getGroupManager().removeGroup(group, deleteMembers, manipulateDOM, doNotFireEvent);\n };\n\n /**\n * Remove all groups, and optionally remove their members from the jsPlumb instance.\n * @method removeAllGroup\n * @param {Boolean} [deleteMembers=false] If true, group members will be removed along with the groups. Otherwise they will\n * just be 'orphaned' (returned to the main container).\n */\n _jpi.prototype.removeAllGroups = function(deleteMembers, manipulateDOM, doNotFireEvent) {\n this.getGroupManager().removeAllGroups(deleteMembers, manipulateDOM, doNotFireEvent);\n };\n\n /**\n * Get a Group\n * @method getGroup\n * @param {String} groupId ID of the group to get\n * @return {Group} Group with the given ID, null if not found.\n */\n _jpi.prototype.getGroup = function(groupId) {\n return this.getGroupManager().getGroup(groupId);\n };\n\n /**\n * Gets all the Groups managed by the jsPlumb instance.\n * @returns {Group[]} List of Groups. Empty if none.\n */\n _jpi.prototype.getGroups = function() {\n return this.getGroupManager().getGroups();\n };\n\n /**\n * Expands a group element. jsPlumb doesn't do \"everything\" for you here, because what it means to expand a Group\n * will vary from application to application. jsPlumb does these things:\n *\n * - Hides any connections that are internal to the group (connections between members, and connections from member of\n * the group to the group itself)\n * - Proxies all connections for which the source or target is a member of the group.\n * - Hides the proxied connections.\n * - Adds the jtk-group-expanded class to the group's element\n * - Removes the jtk-group-collapsed class from the group's element.\n *\n * @method expandGroup\n * @param {String|Group} group Group to expand, or ID of Group to expand.\n */\n _jpi.prototype.expandGroup = function(group) {\n this.getGroupManager().expandGroup(group);\n };\n\n /**\n * Collapses a group element. jsPlumb doesn't do \"everything\" for you here, because what it means to collapse a Group\n * will vary from application to application. jsPlumb does these things:\n *\n * - Shows any connections that are internal to the group (connections between members, and connections from member of\n * the group to the group itself)\n * - Removes proxies for all connections for which the source or target is a member of the group.\n * - Shows the previously proxied connections.\n * - Adds the jtk-group-collapsed class to the group's element\n * - Removes the jtk-group-expanded class from the group's element.\n *\n * @method expandGroup\n * @param {String|Group} group Group to expand, or ID of Group to expand.\n */\n _jpi.prototype.collapseGroup = function(groupId) {\n this.getGroupManager().collapseGroup(groupId);\n };\n\n\n _jpi.prototype.repaintGroup = function(group) {\n this.getGroupManager().repaintGroup(group);\n };\n\n /**\n * Collapses or expands a group element depending on its current state. See notes in the collapseGroup and expandGroup method.\n *\n * @method toggleGroup\n * @param {String|Group} group Group to expand/collapse, or ID of Group to expand/collapse.\n */\n _jpi.prototype.toggleGroup = function(group) {\n group = this.getGroupManager().getGroup(group);\n if (group != null) {\n this.getGroupManager()[group.collapsed ? \"expandGroup\" : \"collapseGroup\"](group);\n }\n };\n\n //\n // lazy init a group manager for the given jsplumb instance.\n //\n _jpi.prototype.getGroupManager = function() {\n var mgr = this[GROUP_MANAGER];\n if (mgr == null) {\n mgr = this[GROUP_MANAGER] = new GroupManager(this);\n }\n return mgr;\n };\n\n _jpi.prototype.removeGroupManager = function() {\n delete this[GROUP_MANAGER];\n };\n\n /**\n * Gets the Group that the given element belongs to, null if none.\n * @method getGroupFor\n * @param {String|Element} el Element, or element ID.\n * @returns {Group} A Group, if found, or null.\n */\n _jpi.prototype.getGroupFor = function(el) {\n el = this.getElement(el);\n if (el) {\n return el[GROUP];\n }\n };\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n\n/*\n * This file contains the 'flowchart' connectors, consisting of vertical and horizontal line segments.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n var STRAIGHT = \"Straight\";\n var ARC = \"Arc\";\n\n var Flowchart = function (params) {\n this.type = \"Flowchart\";\n params = params || {};\n params.stub = params.stub == null ? 30 : params.stub;\n var segments,\n _super = _jp.Connectors.AbstractConnector.apply(this, arguments),\n midpoint = params.midpoint == null ? 0.5 : params.midpoint,\n alwaysRespectStubs = params.alwaysRespectStubs === true,\n lastx = null, lasty = null, lastOrientation,\n cornerRadius = params.cornerRadius != null ? params.cornerRadius : 0,\n\n // TODO now common between this and AbstractBezierEditor; refactor into superclass?\n loopbackRadius = params.loopbackRadius || 25,\n isLoopbackCurrently = false,\n\n sgn = function (n) {\n return n < 0 ? -1 : n === 0 ? 0 : 1;\n },\n segmentDirections = function(segment) {\n return [\n sgn( segment[2] - segment[0] ),\n sgn( segment[3] - segment[1] )\n ];\n },\n /**\n * helper method to add a segment.\n */\n addSegment = function (segments, x, y, paintInfo) {\n if (lastx === x && lasty === y) {\n return;\n }\n var lx = lastx == null ? paintInfo.sx : lastx,\n ly = lasty == null ? paintInfo.sy : lasty,\n o = lx === x ? \"v\" : \"h\";\n\n lastx = x;\n lasty = y;\n segments.push([ lx, ly, x, y, o ]);\n },\n segLength = function (s) {\n return Math.sqrt(Math.pow(s[0] - s[2], 2) + Math.pow(s[1] - s[3], 2));\n },\n _cloneArray = function (a) {\n var _a = [];\n _a.push.apply(_a, a);\n return _a;\n },\n writeSegments = function (conn, segments, paintInfo) {\n var current = null, next, currentDirection, nextDirection;\n for (var i = 0; i < segments.length - 1; i++) {\n\n current = current || _cloneArray(segments[i]);\n next = _cloneArray(segments[i + 1]);\n\n currentDirection = segmentDirections(current);\n nextDirection = segmentDirections(next);\n\n if (cornerRadius > 0 && current[4] !== next[4]) {\n\n var minSegLength = Math.min(segLength(current), segLength(next));\n var radiusToUse = Math.min(cornerRadius, minSegLength / 2);\n\n current[2] -= currentDirection[0] * radiusToUse;\n current[3] -= currentDirection[1] * radiusToUse;\n next[0] += nextDirection[0] * radiusToUse;\n next[1] += nextDirection[1] * radiusToUse;\n\n var ac = (currentDirection[1] === nextDirection[0] && nextDirection[0] === 1) ||\n ((currentDirection[1] === nextDirection[0] && nextDirection[0] === 0) && currentDirection[0] !== nextDirection[1]) ||\n (currentDirection[1] === nextDirection[0] && nextDirection[0] === -1),\n sgny = next[1] > current[3] ? 1 : -1,\n sgnx = next[0] > current[2] ? 1 : -1,\n sgnEqual = sgny === sgnx,\n cx = (sgnEqual && ac || (!sgnEqual && !ac)) ? next[0] : current[2],\n cy = (sgnEqual && ac || (!sgnEqual && !ac)) ? current[3] : next[1];\n\n _super.addSegment(conn, STRAIGHT, {\n x1: current[0], y1: current[1], x2: current[2], y2: current[3]\n });\n\n _super.addSegment(conn, ARC, {\n r: radiusToUse,\n x1: current[2],\n y1: current[3],\n x2: next[0],\n y2: next[1],\n cx: cx,\n cy: cy,\n ac: ac\n });\n }\n else {\n // dx + dy are used to adjust for line width.\n var dx = (current[2] === current[0]) ? 0 : (current[2] > current[0]) ? (paintInfo.lw / 2) : -(paintInfo.lw / 2),\n dy = (current[3] === current[1]) ? 0 : (current[3] > current[1]) ? (paintInfo.lw / 2) : -(paintInfo.lw / 2);\n\n _super.addSegment(conn, STRAIGHT, {\n x1: current[0] - dx, y1: current[1] - dy, x2: current[2] + dx, y2: current[3] + dy\n });\n }\n current = next;\n }\n if (next != null) {\n // last segment\n _super.addSegment(conn, STRAIGHT, {\n x1: next[0], y1: next[1], x2: next[2], y2: next[3]\n });\n }\n };\n\n this._compute = function (paintInfo, params) {\n\n segments = [];\n lastx = null;\n lasty = null;\n lastOrientation = null;\n\n var commonStubCalculator = function () {\n return [paintInfo.startStubX, paintInfo.startStubY, paintInfo.endStubX, paintInfo.endStubY];\n },\n stubCalculators = {\n perpendicular: commonStubCalculator,\n orthogonal: commonStubCalculator,\n opposite: function (axis) {\n var pi = paintInfo,\n idx = axis === \"x\" ? 0 : 1,\n areInProximity = {\n \"x\": function () {\n return ( (pi.so[idx] === 1 && (\n ( (pi.startStubX > pi.endStubX) && (pi.tx > pi.startStubX) ) ||\n ( (pi.sx > pi.endStubX) && (pi.tx > pi.sx))))) ||\n\n ( (pi.so[idx] === -1 && (\n ( (pi.startStubX < pi.endStubX) && (pi.tx < pi.startStubX) ) ||\n ( (pi.sx < pi.endStubX) && (pi.tx < pi.sx)))));\n },\n \"y\": function () {\n return ( (pi.so[idx] === 1 && (\n ( (pi.startStubY > pi.endStubY) && (pi.ty > pi.startStubY) ) ||\n ( (pi.sy > pi.endStubY) && (pi.ty > pi.sy))))) ||\n\n ( (pi.so[idx] === -1 && (\n ( (pi.startStubY < pi.endStubY) && (pi.ty < pi.startStubY) ) ||\n ( (pi.sy < pi.endStubY) && (pi.ty < pi.sy)))));\n }\n };\n\n if (!alwaysRespectStubs && areInProximity[axis]()) {\n return {\n \"x\": [(paintInfo.sx + paintInfo.tx) / 2, paintInfo.startStubY, (paintInfo.sx + paintInfo.tx) / 2, paintInfo.endStubY],\n \"y\": [paintInfo.startStubX, (paintInfo.sy + paintInfo.ty) / 2, paintInfo.endStubX, (paintInfo.sy + paintInfo.ty) / 2]\n }[axis];\n }\n else {\n return [paintInfo.startStubX, paintInfo.startStubY, paintInfo.endStubX, paintInfo.endStubY];\n }\n }\n };\n\n // calculate Stubs.\n var stubs = stubCalculators[paintInfo.anchorOrientation](paintInfo.sourceAxis),\n idx = paintInfo.sourceAxis === \"x\" ? 0 : 1,\n oidx = paintInfo.sourceAxis === \"x\" ? 1 : 0,\n ss = stubs[idx],\n oss = stubs[oidx],\n es = stubs[idx + 2],\n oes = stubs[oidx + 2];\n\n // add the start stub segment. use stubs for loopback as it will look better, with the loop spaced\n // away from the element.\n addSegment(segments, stubs[0], stubs[1], paintInfo);\n\n // if its a loopback and we should treat it differently.\n // if (false && params.sourcePos[0] === params.targetPos[0] && params.sourcePos[1] === params.targetPos[1]) {\n //\n // // we use loopbackRadius here, as statemachine connectors do.\n // // so we go radius to the left from stubs[0], then upwards by 2*radius, to the right by 2*radius,\n // // down by 2*radius, left by radius.\n // addSegment(segments, stubs[0] - loopbackRadius, stubs[1], paintInfo);\n // addSegment(segments, stubs[0] - loopbackRadius, stubs[1] - (2 * loopbackRadius), paintInfo);\n // addSegment(segments, stubs[0] + loopbackRadius, stubs[1] - (2 * loopbackRadius), paintInfo);\n // addSegment(segments, stubs[0] + loopbackRadius, stubs[1], paintInfo);\n // addSegment(segments, stubs[0], stubs[1], paintInfo);\n //\n // }\n // else {\n\n\n var midx = paintInfo.startStubX + ((paintInfo.endStubX - paintInfo.startStubX) * midpoint),\n midy = paintInfo.startStubY + ((paintInfo.endStubY - paintInfo.startStubY) * midpoint);\n\n var orientations = {x: [0, 1], y: [1, 0]},\n lineCalculators = {\n perpendicular: function (axis) {\n var pi = paintInfo,\n sis = {\n x: [\n [[1, 2, 3, 4], null, [2, 1, 4, 3]],\n null,\n [[4, 3, 2, 1], null, [3, 4, 1, 2]]\n ],\n y: [\n [[3, 2, 1, 4], null, [2, 3, 4, 1]],\n null,\n [[4, 1, 2, 3], null, [1, 4, 3, 2]]\n ]\n },\n stubs = {\n x: [[pi.startStubX, pi.endStubX], null, [pi.endStubX, pi.startStubX]],\n y: [[pi.startStubY, pi.endStubY], null, [pi.endStubY, pi.startStubY]]\n },\n midLines = {\n x: [[midx, pi.startStubY], [midx, pi.endStubY]],\n y: [[pi.startStubX, midy], [pi.endStubX, midy]]\n },\n linesToEnd = {\n x: [[pi.endStubX, pi.startStubY]],\n y: [[pi.startStubX, pi.endStubY]]\n },\n startToEnd = {\n x: [[pi.startStubX, pi.endStubY], [pi.endStubX, pi.endStubY]],\n y: [[pi.endStubX, pi.startStubY], [pi.endStubX, pi.endStubY]]\n },\n startToMidToEnd = {\n x: [[pi.startStubX, midy], [pi.endStubX, midy], [pi.endStubX, pi.endStubY]],\n y: [[midx, pi.startStubY], [midx, pi.endStubY], [pi.endStubX, pi.endStubY]]\n },\n otherStubs = {\n x: [pi.startStubY, pi.endStubY],\n y: [pi.startStubX, pi.endStubX]\n },\n soIdx = orientations[axis][0], toIdx = orientations[axis][1],\n _so = pi.so[soIdx] + 1,\n _to = pi.to[toIdx] + 1,\n otherFlipped = (pi.to[toIdx] === -1 && (otherStubs[axis][1] < otherStubs[axis][0])) || (pi.to[toIdx] === 1 && (otherStubs[axis][1] > otherStubs[axis][0])),\n stub1 = stubs[axis][_so][0],\n stub2 = stubs[axis][_so][1],\n segmentIndexes = sis[axis][_so][_to];\n\n if (pi.segment === segmentIndexes[3] || (pi.segment === segmentIndexes[2] && otherFlipped)) {\n return midLines[axis];\n }\n else if (pi.segment === segmentIndexes[2] && stub2 < stub1) {\n return linesToEnd[axis];\n }\n else if ((pi.segment === segmentIndexes[2] && stub2 >= stub1) || (pi.segment === segmentIndexes[1] && !otherFlipped)) {\n return startToMidToEnd[axis];\n }\n else if (pi.segment === segmentIndexes[0] || (pi.segment === segmentIndexes[1] && otherFlipped)) {\n return startToEnd[axis];\n }\n },\n orthogonal: function (axis, startStub, otherStartStub, endStub, otherEndStub) {\n var pi = paintInfo,\n extent = {\n \"x\": pi.so[0] === -1 ? Math.min(startStub, endStub) : Math.max(startStub, endStub),\n \"y\": pi.so[1] === -1 ? Math.min(startStub, endStub) : Math.max(startStub, endStub)\n }[axis];\n\n return {\n \"x\": [\n [extent, otherStartStub],\n [extent, otherEndStub],\n [endStub, otherEndStub]\n ],\n \"y\": [\n [otherStartStub, extent],\n [otherEndStub, extent],\n [otherEndStub, endStub]\n ]\n }[axis];\n },\n opposite: function (axis, ss, oss, es) {\n var pi = paintInfo,\n otherAxis = {\"x\": \"y\", \"y\": \"x\"}[axis],\n dim = {\"x\": \"height\", \"y\": \"width\"}[axis],\n comparator = pi[\"is\" + axis.toUpperCase() + \"GreaterThanStubTimes2\"];\n\n if (params.sourceEndpoint.elementId === params.targetEndpoint.elementId) {\n var _val = oss + ((1 - params.sourceEndpoint.anchor[otherAxis]) * params.sourceInfo[dim]) + _super.maxStub;\n return {\n \"x\": [\n [ss, _val],\n [es, _val]\n ],\n \"y\": [\n [_val, ss],\n [_val, es]\n ]\n }[axis];\n\n }\n else if (!comparator || (pi.so[idx] === 1 && ss > es) || (pi.so[idx] === -1 && ss < es)) {\n return {\n \"x\": [\n [ss, midy],\n [es, midy]\n ],\n \"y\": [\n [midx, ss],\n [midx, es]\n ]\n }[axis];\n }\n else if ((pi.so[idx] === 1 && ss < es) || (pi.so[idx] === -1 && ss > es)) {\n return {\n \"x\": [\n [midx, pi.sy],\n [midx, pi.ty]\n ],\n \"y\": [\n [pi.sx, midy],\n [pi.tx, midy]\n ]\n }[axis];\n }\n }\n };\n\n // compute the rest of the line\n var p = lineCalculators[paintInfo.anchorOrientation](paintInfo.sourceAxis, ss, oss, es, oes);\n if (p) {\n for (var i = 0; i < p.length; i++) {\n addSegment(segments, p[i][0], p[i][1], paintInfo);\n }\n }\n\n // line to end stub\n addSegment(segments, stubs[2], stubs[3], paintInfo);\n\n //}\n\n // end stub to end (common)\n addSegment(segments, paintInfo.tx, paintInfo.ty, paintInfo);\n\n\n\n // write out the segments.\n writeSegments(this, segments, paintInfo);\n\n };\n };\n\n _jp.Connectors.Flowchart = Flowchart;\n _ju.extend(_jp.Connectors.Flowchart, _jp.Connectors.AbstractConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the code for the Bezier connector type.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n _jp.Connectors.AbstractBezierConnector = function(params) {\n params = params || {};\n var showLoopback = params.showLoopback !== false,\n curviness = params.curviness || 10,\n margin = params.margin || 5,\n proximityLimit = params.proximityLimit || 80,\n clockwise = params.orientation && params.orientation === \"clockwise\",\n loopbackRadius = params.loopbackRadius || 25,\n isLoopbackCurrently = false,\n _super;\n\n this._compute = function (paintInfo, p) {\n\n var sp = p.sourcePos,\n tp = p.targetPos,\n _w = Math.abs(sp[0] - tp[0]),\n _h = Math.abs(sp[1] - tp[1]);\n\n if (!showLoopback || (p.sourceEndpoint.elementId !== p.targetEndpoint.elementId)) {\n isLoopbackCurrently = false;\n this._computeBezier(paintInfo, p, sp, tp, _w, _h);\n } else {\n isLoopbackCurrently = true;\n // a loopback connector. draw an arc from one anchor to the other.\n var x1 = p.sourcePos[0], y1 = p.sourcePos[1] - margin,\n cx = x1, cy = y1 - loopbackRadius,\n // canvas sizing stuff, to ensure the whole painted area is visible.\n _x = cx - loopbackRadius,\n _y = cy - loopbackRadius;\n\n _w = 2 * loopbackRadius;\n _h = 2 * loopbackRadius;\n\n paintInfo.points[0] = _x;\n paintInfo.points[1] = _y;\n paintInfo.points[2] = _w;\n paintInfo.points[3] = _h;\n\n // ADD AN ARC SEGMENT.\n _super.addSegment(this, \"Arc\", {\n loopback: true,\n x1: (x1 - _x) + 4,\n y1: y1 - _y,\n startAngle: 0,\n endAngle: 2 * Math.PI,\n r: loopbackRadius,\n ac: !clockwise,\n x2: (x1 - _x) - 4,\n y2: y1 - _y,\n cx: cx - _x,\n cy: cy - _y\n });\n }\n };\n\n _super = _jp.Connectors.AbstractConnector.apply(this, arguments);\n return _super;\n };\n _ju.extend(_jp.Connectors.AbstractBezierConnector, _jp.Connectors.AbstractConnector);\n\n var Bezier = function (params) {\n params = params || {};\n this.type = \"Bezier\";\n\n var _super = _jp.Connectors.AbstractBezierConnector.apply(this, arguments),\n majorAnchor = params.curviness || 150,\n minorAnchor = 10;\n\n this.getCurviness = function () {\n return majorAnchor;\n };\n\n this._findControlPoint = function (point, sourceAnchorPosition, targetAnchorPosition, sourceEndpoint, targetEndpoint, soo, too) {\n // determine if the two anchors are perpendicular to each other in their orientation. we swap the control\n // points around if so (code could be tightened up)\n var perpendicular = soo[0] !== too[0] || soo[1] === too[1],\n p = [];\n\n if (!perpendicular) {\n if (soo[0] === 0) {\n p.push(sourceAnchorPosition[0] < targetAnchorPosition[0] ? point[0] + minorAnchor : point[0] - minorAnchor);\n }\n else {\n p.push(point[0] - (majorAnchor * soo[0]));\n }\n\n if (soo[1] === 0) {\n p.push(sourceAnchorPosition[1] < targetAnchorPosition[1] ? point[1] + minorAnchor : point[1] - minorAnchor);\n }\n else {\n p.push(point[1] + (majorAnchor * too[1]));\n }\n }\n else {\n if (too[0] === 0) {\n p.push(targetAnchorPosition[0] < sourceAnchorPosition[0] ? point[0] + minorAnchor : point[0] - minorAnchor);\n }\n else {\n p.push(point[0] + (majorAnchor * too[0]));\n }\n\n if (too[1] === 0) {\n p.push(targetAnchorPosition[1] < sourceAnchorPosition[1] ? point[1] + minorAnchor : point[1] - minorAnchor);\n }\n else {\n p.push(point[1] + (majorAnchor * soo[1]));\n }\n }\n\n return p;\n };\n\n this._computeBezier = function (paintInfo, p, sp, tp, _w, _h) {\n\n var _CP, _CP2,\n _sx = sp[0] < tp[0] ? _w : 0,\n _sy = sp[1] < tp[1] ? _h : 0,\n _tx = sp[0] < tp[0] ? 0 : _w,\n _ty = sp[1] < tp[1] ? 0 : _h;\n\n _CP = this._findControlPoint([_sx, _sy], sp, tp, p.sourceEndpoint, p.targetEndpoint, paintInfo.so, paintInfo.to);\n _CP2 = this._findControlPoint([_tx, _ty], tp, sp, p.targetEndpoint, p.sourceEndpoint, paintInfo.to, paintInfo.so);\n\n\n _super.addSegment(this, \"Bezier\", {\n x1: _sx, y1: _sy, x2: _tx, y2: _ty,\n cp1x: _CP[0], cp1y: _CP[1], cp2x: _CP2[0], cp2y: _CP2[1]\n });\n };\n\n\n };\n\n _jp.Connectors.Bezier = Bezier;\n _ju.extend(Bezier, _jp.Connectors.AbstractBezierConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the state machine connectors, which extend AbstractBezierConnector.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n var _segment = function (x1, y1, x2, y2) {\n if (x1 <= x2 && y2 <= y1) {\n return 1;\n }\n else if (x1 <= x2 && y1 <= y2) {\n return 2;\n }\n else if (x2 <= x1 && y2 >= y1) {\n return 3;\n }\n return 4;\n },\n\n // the control point we will use depends on the faces to which each end of the connection is assigned, specifically whether or not the\n // two faces are parallel or perpendicular. if they are parallel then the control point lies on the midpoint of the axis in which they\n // are parellel and varies only in the other axis; this variation is proportional to the distance that the anchor points lie from the\n // center of that face. if the two faces are perpendicular then the control point is at some distance from both the midpoints; the amount and\n // direction are dependent on the orientation of the two elements. 'seg', passed in to this method, tells you which segment the target element\n // lies in with respect to the source: 1 is top right, 2 is bottom right, 3 is bottom left, 4 is top left.\n //\n // sourcePos and targetPos are arrays of info about where on the source and target each anchor is located. their contents are:\n //\n // 0 - absolute x\n // 1 - absolute y\n // 2 - proportional x in element (0 is left edge, 1 is right edge)\n // 3 - proportional y in element (0 is top edge, 1 is bottom edge)\n //\n _findControlPoint = function (midx, midy, segment, sourceEdge, targetEdge, dx, dy, distance, proximityLimit) {\n // TODO (maybe)\n // - if anchor pos is 0.5, make the control point take into account the relative position of the elements.\n if (distance <= proximityLimit) {\n return [midx, midy];\n }\n\n if (segment === 1) {\n if (sourceEdge[3] <= 0 && targetEdge[3] >= 1) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] >= 1 && targetEdge[2] <= 0) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + (-1 * dx) , midy + (-1 * dy) ];\n }\n }\n else if (segment === 2) {\n if (sourceEdge[3] >= 1 && targetEdge[3] <= 0) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] >= 1 && targetEdge[2] <= 0) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + dx, midy + (-1 * dy) ];\n }\n }\n else if (segment === 3) {\n if (sourceEdge[3] >= 1 && targetEdge[3] <= 0) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] <= 0 && targetEdge[2] >= 1) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + (-1 * dx) , midy + (-1 * dy) ];\n }\n }\n else if (segment === 4) {\n if (sourceEdge[3] <= 0 && targetEdge[3] >= 1) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] <= 0 && targetEdge[2] >= 1) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + dx , midy + (-1 * dy) ];\n }\n }\n\n };\n\n var StateMachine = function (params) {\n params = params || {};\n this.type = \"StateMachine\";\n\n var _super = _jp.Connectors.AbstractBezierConnector.apply(this, arguments),\n curviness = params.curviness || 10,\n margin = params.margin || 5,\n proximityLimit = params.proximityLimit || 80,\n clockwise = params.orientation && params.orientation === \"clockwise\",\n _controlPoint;\n\n this._computeBezier = function(paintInfo, params, sp, tp, w, h) {\n var _sx = params.sourcePos[0] < params.targetPos[0] ? 0 : w,\n _sy = params.sourcePos[1] < params.targetPos[1] ? 0 : h,\n _tx = params.sourcePos[0] < params.targetPos[0] ? w : 0,\n _ty = params.sourcePos[1] < params.targetPos[1] ? h : 0;\n\n // now adjust for the margin\n if (params.sourcePos[2] === 0) {\n _sx -= margin;\n }\n if (params.sourcePos[2] === 1) {\n _sx += margin;\n }\n if (params.sourcePos[3] === 0) {\n _sy -= margin;\n }\n if (params.sourcePos[3] === 1) {\n _sy += margin;\n }\n if (params.targetPos[2] === 0) {\n _tx -= margin;\n }\n if (params.targetPos[2] === 1) {\n _tx += margin;\n }\n if (params.targetPos[3] === 0) {\n _ty -= margin;\n }\n if (params.targetPos[3] === 1) {\n _ty += margin;\n }\n\n //\n // these connectors are quadratic bezier curves, having a single control point. if both anchors\n // are located at 0.5 on their respective faces, the control point is set to the midpoint and you\n // get a straight line. this is also the case if the two anchors are within 'proximityLimit', since\n // it seems to make good aesthetic sense to do that. outside of that, the control point is positioned\n // at 'curviness' pixels away along the normal to the straight line connecting the two anchors.\n //\n // there may be two improvements to this. firstly, we might actually support the notion of avoiding nodes\n // in the UI, or at least making a good effort at doing so. if a connection would pass underneath some node,\n // for example, we might increase the distance the control point is away from the midpoint in a bid to\n // steer it around that node. this will work within limits, but i think those limits would also be the likely\n // limits for, once again, aesthetic good sense in the layout of a chart using these connectors.\n //\n // the second possible change is actually two possible changes: firstly, it is possible we should gradually\n // decrease the 'curviness' as the distance between the anchors decreases; start tailing it off to 0 at some\n // point (which should be configurable). secondly, we might slightly increase the 'curviness' for connectors\n // with respect to how far their anchor is from the center of its respective face. this could either look cool,\n // or stupid, and may indeed work only in a way that is so subtle as to have been a waste of time.\n //\n\n var _midx = (_sx + _tx) / 2,\n _midy = (_sy + _ty) / 2,\n segment = _segment(_sx, _sy, _tx, _ty),\n distance = Math.sqrt(Math.pow(_tx - _sx, 2) + Math.pow(_ty - _sy, 2)),\n cp1x, cp2x, cp1y, cp2y;\n\n\n // calculate the control point. this code will be where we'll put in a rudimentary element avoidance scheme; it\n // will work by extending the control point to force the curve to be, um, curvier.\n _controlPoint = _findControlPoint(_midx,\n _midy,\n segment,\n params.sourcePos,\n params.targetPos,\n curviness, curviness,\n distance,\n proximityLimit);\n\n cp1x = _controlPoint[0];\n cp2x = _controlPoint[0];\n cp1y = _controlPoint[1];\n cp2y = _controlPoint[1];\n\n _super.addSegment(this, \"Bezier\", {\n x1: _tx, y1: _ty, x2: _sx, y2: _sy,\n cp1x: cp1x, cp1y: cp1y,\n cp2x: cp2x, cp2y: cp2y\n });\n };\n };\n\n _jp.Connectors.StateMachine = StateMachine;\n _ju.extend(StateMachine, _jp.Connectors.AbstractBezierConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the 'flowchart' connectors, consisting of vertical and horizontal line segments.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n var STRAIGHT = \"Straight\";\n\n var Straight = function (params) {\n this.type = STRAIGHT;\n var _super = _jp.Connectors.AbstractConnector.apply(this, arguments);\n\n this._compute = function (paintInfo, _) {\n _super.addSegment(this, STRAIGHT, {x1: paintInfo.sx, y1: paintInfo.sy, x2: paintInfo.startStubX, y2: paintInfo.startStubY});\n _super.addSegment(this, STRAIGHT, {x1: paintInfo.startStubX, y1: paintInfo.startStubY, x2: paintInfo.endStubX, y2: paintInfo.endStubY});\n _super.addSegment(this, STRAIGHT, {x1: paintInfo.endStubX, y1: paintInfo.endStubY, x2: paintInfo.tx, y2: paintInfo.ty});\n };\n };\n\n _jp.Connectors.Straight = Straight;\n _ju.extend(Straight, _jp.Connectors.AbstractConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the SVG renderers.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n * \n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n// ************************** SVG utility methods ********************************************\t\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n var svgAttributeMap = {\n \"stroke-linejoin\": \"stroke-linejoin\",\n \"stroke-dashoffset\": \"stroke-dashoffset\",\n \"stroke-linecap\": \"stroke-linecap\"\n },\n STROKE_DASHARRAY = \"stroke-dasharray\",\n DASHSTYLE = \"dashstyle\",\n LINEAR_GRADIENT = \"linearGradient\",\n RADIAL_GRADIENT = \"radialGradient\",\n DEFS = \"defs\",\n FILL = \"fill\",\n STOP = \"stop\",\n STROKE = \"stroke\",\n STROKE_WIDTH = \"stroke-width\",\n STYLE = \"style\",\n NONE = \"none\",\n JSPLUMB_GRADIENT = \"jsplumb_gradient_\",\n LINE_WIDTH = \"strokeWidth\",\n ns = {\n svg: \"http://www.w3.org/2000/svg\"\n },\n _attr = function (node, attributes) {\n for (var i in attributes) {\n node.setAttribute(i, \"\" + attributes[i]);\n }\n },\n _node = function (name, attributes) {\n attributes = attributes || {};\n attributes.version = \"1.1\";\n attributes.xmlns = ns.svg;\n return _jp.createElementNS(ns.svg, name, null, null, attributes);\n },\n _pos = function (d) {\n return \"position:absolute;left:\" + d[0] + \"px;top:\" + d[1] + \"px\";\n },\n _clearGradient = function (parent) {\n var els = parent.querySelectorAll(\" defs,linearGradient,radialGradient\");\n for (var i = 0; i < els.length; i++) {\n els[i].parentNode.removeChild(els[i]);\n }\n },\n _updateGradient = function (parent, node, style, dimensions, uiComponent) {\n var id = JSPLUMB_GRADIENT + uiComponent._jsPlumb.instance.idstamp();\n // first clear out any existing gradient\n _clearGradient(parent);\n // this checks for an 'offset' property in the gradient, and in the absence of it, assumes\n // we want a linear gradient. if it's there, we create a radial gradient.\n // it is possible that a more explicit means of defining the gradient type would be\n // better. relying on 'offset' means that we can never have a radial gradient that uses\n // some default offset, for instance.\n // issue 244 suggested the 'gradientUnits' attribute; without this, straight/flowchart connectors with gradients would\n // not show gradients when the line was perfectly horizontal or vertical.\n var g;\n if (!style.gradient.offset) {\n g = _node(LINEAR_GRADIENT, {id: id, gradientUnits: \"userSpaceOnUse\"});\n }\n else {\n g = _node(RADIAL_GRADIENT, { id: id });\n }\n\n var defs = _node(DEFS);\n parent.appendChild(defs);\n defs.appendChild(g);\n\n // the svg radial gradient seems to treat stops in the reverse\n // order to how canvas does it. so we want to keep all the maths the same, but\n // iterate the actual style declarations in reverse order, if the x indexes are not in order.\n for (var i = 0; i < style.gradient.stops.length; i++) {\n var styleToUse = uiComponent.segment === 1 || uiComponent.segment === 2 ? i : style.gradient.stops.length - 1 - i,\n stopColor = style.gradient.stops[styleToUse][1],\n s = _node(STOP, {\"offset\": Math.floor(style.gradient.stops[i][0] * 100) + \"%\", \"stop-color\": stopColor});\n\n g.appendChild(s);\n }\n var applyGradientTo = style.stroke ? STROKE : FILL;\n node.setAttribute(applyGradientTo, \"url(#\" + id + \")\");\n },\n _applyStyles = function (parent, node, style, dimensions, uiComponent) {\n\n node.setAttribute(FILL, style.fill ? style.fill : NONE);\n node.setAttribute(STROKE, style.stroke ? style.stroke : NONE);\n\n if (style.gradient) {\n _updateGradient(parent, node, style, dimensions, uiComponent);\n }\n else {\n // make sure we clear any existing gradient\n _clearGradient(parent);\n node.setAttribute(STYLE, \"\");\n }\n\n if (style.strokeWidth) {\n node.setAttribute(STROKE_WIDTH, style.strokeWidth);\n }\n\n // in SVG there is a stroke-dasharray attribute we can set, and its syntax looks like\n // the syntax in VML but is actually kind of nasty: values are given in the pixel\n // coordinate space, whereas in VML they are multiples of the width of the stroked\n // line, which makes a lot more sense. for that reason, jsPlumb is supporting both\n // the native svg 'stroke-dasharray' attribute, and also the 'dashstyle' concept from\n // VML, which will be the preferred method. the code below this converts a dashstyle\n // attribute given in terms of stroke width into a pixel representation, by using the\n // stroke's lineWidth.\n if (style[DASHSTYLE] && style[LINE_WIDTH] && !style[STROKE_DASHARRAY]) {\n var sep = style[DASHSTYLE].indexOf(\",\") === -1 ? \" \" : \",\",\n parts = style[DASHSTYLE].split(sep),\n styleToUse = \"\";\n parts.forEach(function (p) {\n styleToUse += (Math.floor(p * style.strokeWidth) + sep);\n });\n node.setAttribute(STROKE_DASHARRAY, styleToUse);\n }\n else if (style[STROKE_DASHARRAY]) {\n node.setAttribute(STROKE_DASHARRAY, style[STROKE_DASHARRAY]);\n }\n\n // extra attributes such as join type, dash offset.\n for (var i in svgAttributeMap) {\n if (style[i]) {\n node.setAttribute(svgAttributeMap[i], style[i]);\n }\n }\n },\n _appendAtIndex = function (svg, path, idx) {\n if (svg.childNodes.length > idx) {\n svg.insertBefore(path, svg.childNodes[idx]);\n }\n else {\n svg.appendChild(path);\n }\n };\n\n /**\n utility methods for other objects to use.\n */\n _ju.svg = {\n node: _node,\n attr: _attr,\n pos: _pos\n };\n\n // ************************** / SVG utility methods ********************************************\n\n /*\n * Base class for SVG components.\n */\n var SvgComponent = function (params) {\n var pointerEventsSpec = params.pointerEventsSpec || \"all\", renderer = {};\n\n _jp.jsPlumbUIComponent.apply(this, params.originalArgs);\n this.canvas = null;\n this.path = null;\n this.svg = null;\n this.bgCanvas = null;\n\n var clazz = params.cssClass + \" \" + (params.originalArgs[0].cssClass || \"\"),\n svgParams = {\n \"style\": \"\",\n \"width\": 0,\n \"height\": 0,\n \"pointer-events\": pointerEventsSpec,\n \"position\": \"absolute\"\n };\n\n this.svg = _node(\"svg\", svgParams);\n\n if (params.useDivWrapper) {\n this.canvas = _jp.createElement(\"div\", { position : \"absolute\" });\n _ju.sizeElement(this.canvas, 0, 0, 1, 1);\n this.canvas.className = clazz;\n }\n else {\n _attr(this.svg, { \"class\": clazz });\n this.canvas = this.svg;\n }\n\n params._jsPlumb.appendElement(this.canvas, params.originalArgs[0].parent);\n if (params.useDivWrapper) {\n this.canvas.appendChild(this.svg);\n }\n\n var displayElements = [ this.canvas ];\n this.getDisplayElements = function () {\n return displayElements;\n };\n\n this.appendDisplayElement = function (el) {\n displayElements.push(el);\n };\n\n this.paint = function (style, anchor, extents) {\n if (style != null) {\n\n var xy = [ this.x, this.y ], wh = [ this.w, this.h ], p;\n if (extents != null) {\n if (extents.xmin < 0) {\n xy[0] += extents.xmin;\n }\n if (extents.ymin < 0) {\n xy[1] += extents.ymin;\n }\n wh[0] = extents.xmax + ((extents.xmin < 0) ? -extents.xmin : 0);\n wh[1] = extents.ymax + ((extents.ymin < 0) ? -extents.ymin : 0);\n }\n\n if (params.useDivWrapper) {\n _ju.sizeElement(this.canvas, xy[0], xy[1], wh[0], wh[1]);\n xy[0] = 0;\n xy[1] = 0;\n p = _pos([ 0, 0 ]);\n }\n else {\n p = _pos([ xy[0], xy[1] ]);\n }\n\n renderer.paint.apply(this, arguments);\n\n _attr(this.svg, {\n \"style\": p,\n \"width\": wh[0] || 0,\n \"height\": wh[1] || 0\n });\n }\n };\n\n return {\n renderer: renderer\n };\n };\n\n _ju.extend(SvgComponent, _jp.jsPlumbUIComponent, {\n cleanup: function (force) {\n if (force || this.typeId == null) {\n if (this.canvas) {\n this.canvas._jsPlumb = null;\n }\n if (this.svg) {\n this.svg._jsPlumb = null;\n }\n if (this.bgCanvas) {\n this.bgCanvas._jsPlumb = null;\n }\n\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n if (this.bgCanvas && this.bgCanvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n\n this.svg = null;\n this.canvas = null;\n this.path = null;\n this.group = null;\n }\n else {\n // if not a forced cleanup, just detach from DOM for now.\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n if (this.bgCanvas && this.bgCanvas.parentNode) {\n this.bgCanvas.parentNode.removeChild(this.bgCanvas);\n }\n }\n },\n reattach:function(instance) {\n var c = instance.getContainer();\n if (this.canvas && this.canvas.parentNode == null) {\n c.appendChild(this.canvas);\n }\n if (this.bgCanvas && this.bgCanvas.parentNode == null) {\n c.appendChild(this.bgCanvas);\n }\n },\n setVisible: function (v) {\n if (this.canvas) {\n this.canvas.style.display = v ? \"block\" : \"none\";\n }\n }\n });\n\n /*\n * Base class for SVG connectors.\n */\n _jp.ConnectorRenderers.svg = function (params) {\n var self = this,\n _super = SvgComponent.apply(this, [\n {\n cssClass: params._jsPlumb.connectorClass,\n originalArgs: arguments,\n pointerEventsSpec: \"none\",\n _jsPlumb: params._jsPlumb\n }\n ]);\n\n _super.renderer.paint = function (style, anchor, extents) {\n\n var segments = self.getSegments(), p = \"\", offset = [0, 0];\n if (extents.xmin < 0) {\n offset[0] = -extents.xmin;\n }\n if (extents.ymin < 0) {\n offset[1] = -extents.ymin;\n }\n\n if (segments.length > 0) {\n\n p = self.getPathData();\n\n var a = {\n d: p,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\",\n \"pointer-events\": params[\"pointer-events\"] || \"visibleStroke\"\n },\n outlineStyle = null,\n d = [self.x, self.y, self.w, self.h];\n\n // outline style. actually means drawing an svg object underneath the main one.\n if (style.outlineStroke) {\n var outlineWidth = style.outlineWidth || 1,\n outlineStrokeWidth = style.strokeWidth + (2 * outlineWidth);\n outlineStyle = _jp.extend({}, style);\n delete outlineStyle.gradient;\n outlineStyle.stroke = style.outlineStroke;\n outlineStyle.strokeWidth = outlineStrokeWidth;\n\n if (self.bgPath == null) {\n self.bgPath = _node(\"path\", a);\n _jp.addClass(self.bgPath, _jp.connectorOutlineClass);\n _appendAtIndex(self.svg, self.bgPath, 0);\n }\n else {\n _attr(self.bgPath, a);\n }\n\n _applyStyles(self.svg, self.bgPath, outlineStyle, d, self);\n }\n\n if (self.path == null) {\n self.path = _node(\"path\", a);\n _appendAtIndex(self.svg, self.path, style.outlineStroke ? 1 : 0);\n }\n else {\n _attr(self.path, a);\n }\n\n _applyStyles(self.svg, self.path, style, d, self);\n }\n };\n };\n _ju.extend(_jp.ConnectorRenderers.svg, SvgComponent);\n\n// ******************************* svg segment renderer *****************************************************\t\n\n\n// ******************************* /svg segments *****************************************************\n\n /*\n * Base class for SVG endpoints.\n */\n var SvgEndpoint = _jp.SvgEndpoint = function (params) {\n var _super = SvgComponent.apply(this, [\n {\n cssClass: params._jsPlumb.endpointClass,\n originalArgs: arguments,\n pointerEventsSpec: \"all\",\n useDivWrapper: true,\n _jsPlumb: params._jsPlumb\n }\n ]);\n\n _super.renderer.paint = function (style) {\n var s = _jp.extend({}, style);\n if (s.outlineStroke) {\n s.stroke = s.outlineStroke;\n }\n\n if (this.node == null) {\n this.node = this.makeNode(s);\n this.svg.appendChild(this.node);\n }\n else if (this.updateNode != null) {\n this.updateNode(this.node);\n }\n _applyStyles(this.svg, this.node, s, [ this.x, this.y, this.w, this.h ], this);\n _pos(this.node, [ this.x, this.y ]);\n }.bind(this);\n\n };\n _ju.extend(SvgEndpoint, SvgComponent);\n\n /*\n * SVG Dot Endpoint\n */\n _jp.Endpoints.svg.Dot = function () {\n _jp.Endpoints.Dot.apply(this, arguments);\n SvgEndpoint.apply(this, arguments);\n this.makeNode = function (style) {\n return _node(\"circle\", {\n \"cx\": this.w / 2,\n \"cy\": this.h / 2,\n \"r\": this.radius\n });\n };\n this.updateNode = function (node) {\n _attr(node, {\n \"cx\": this.w / 2,\n \"cy\": this.h / 2,\n \"r\": this.radius\n });\n };\n };\n _ju.extend(_jp.Endpoints.svg.Dot, [_jp.Endpoints.Dot, SvgEndpoint]);\n\n /*\n * SVG Rectangle Endpoint\n */\n _jp.Endpoints.svg.Rectangle = function () {\n _jp.Endpoints.Rectangle.apply(this, arguments);\n SvgEndpoint.apply(this, arguments);\n this.makeNode = function (style) {\n return _node(\"rect\", {\n \"width\": this.w,\n \"height\": this.h\n });\n };\n this.updateNode = function (node) {\n _attr(node, {\n \"width\": this.w,\n \"height\": this.h\n });\n };\n };\n _ju.extend(_jp.Endpoints.svg.Rectangle, [_jp.Endpoints.Rectangle, SvgEndpoint]);\n\n /*\n * SVG Image Endpoint is the default image endpoint.\n */\n _jp.Endpoints.svg.Image = _jp.Endpoints.Image;\n /*\n * Blank endpoint in svg renderer is the default Blank endpoint.\n */\n _jp.Endpoints.svg.Blank = _jp.Endpoints.Blank;\n /*\n * Label overlay in svg renderer is the default Label overlay.\n */\n _jp.Overlays.svg.Label = _jp.Overlays.Label;\n /*\n * Custom overlay in svg renderer is the default Custom overlay.\n */\n _jp.Overlays.svg.Custom = _jp.Overlays.Custom;\n\n var AbstractSvgArrowOverlay = function (superclass, originalArgs) {\n superclass.apply(this, originalArgs);\n _jp.jsPlumbUIComponent.apply(this, originalArgs);\n this.isAppendedAtTopLevel = false;\n var self = this;\n this.path = null;\n this.paint = function (params, containerExtents) {\n // only draws on connections, not endpoints.\n if (params.component.svg && containerExtents) {\n if (this.path == null) {\n this.path = _node(\"path\", {\n \"pointer-events\": \"all\"\n });\n params.component.svg.appendChild(this.path);\n if (this.elementCreated) {\n this.elementCreated(this.path, params.component);\n }\n\n this.canvas = params.component.svg; // for the sake of completeness; this behaves the same as other overlays\n }\n var clazz = originalArgs && (originalArgs.length === 1) ? (originalArgs[0].cssClass || \"\") : \"\",\n offset = [0, 0];\n\n if (containerExtents.xmin < 0) {\n offset[0] = -containerExtents.xmin;\n }\n if (containerExtents.ymin < 0) {\n offset[1] = -containerExtents.ymin;\n }\n\n _attr(this.path, {\n \"d\": makePath(params.d),\n \"class\": clazz,\n stroke: params.stroke ? params.stroke : null,\n fill: params.fill ? params.fill : null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n }\n };\n var makePath = function (d) {\n return (isNaN(d.cxy.x) || isNaN(d.cxy.y)) ? \"\" : \"M\" + d.hxy.x + \",\" + d.hxy.y +\n \" L\" + d.tail[0].x + \",\" + d.tail[0].y +\n \" L\" + d.cxy.x + \",\" + d.cxy.y +\n \" L\" + d.tail[1].x + \",\" + d.tail[1].y +\n \" L\" + d.hxy.x + \",\" + d.hxy.y;\n };\n this.transfer = function(target) {\n if (target.canvas && this.path && this.path.parentNode) {\n this.path.parentNode.removeChild(this.path);\n target.canvas.appendChild(this.path);\n }\n };\n };\n _ju.extend(AbstractSvgArrowOverlay, [_jp.jsPlumbUIComponent, _jp.Overlays.AbstractOverlay], {\n cleanup: function (force) {\n if (this.path != null) {\n if (force) {\n this._jsPlumb.instance.removeElement(this.path);\n }\n else {\n if (this.path.parentNode) {\n this.path.parentNode.removeChild(this.path);\n }\n }\n }\n },\n reattach:function(instance, component) {\n if (this.path && component.canvas) {\n component.canvas.appendChild(this.path);\n }\n },\n setVisible: function (v) {\n if (this.path != null) {\n (this.path.style.display = (v ? \"block\" : \"none\"));\n }\n }\n });\n\n _jp.Overlays.svg.Arrow = function () {\n AbstractSvgArrowOverlay.apply(this, [_jp.Overlays.Arrow, arguments]);\n };\n _ju.extend(_jp.Overlays.svg.Arrow, [ _jp.Overlays.Arrow, AbstractSvgArrowOverlay ]);\n\n _jp.Overlays.svg.PlainArrow = function () {\n AbstractSvgArrowOverlay.apply(this, [_jp.Overlays.PlainArrow, arguments]);\n };\n _ju.extend(_jp.Overlays.svg.PlainArrow, [ _jp.Overlays.PlainArrow, AbstractSvgArrowOverlay ]);\n\n _jp.Overlays.svg.Diamond = function () {\n AbstractSvgArrowOverlay.apply(this, [_jp.Overlays.Diamond, arguments]);\n };\n _ju.extend(_jp.Overlays.svg.Diamond, [ _jp.Overlays.Diamond, AbstractSvgArrowOverlay ]);\n\n // a test\n _jp.Overlays.svg.GuideLines = function () {\n var path = null, self = this, p1_1, p1_2;\n _jp.Overlays.GuideLines.apply(this, arguments);\n this.paint = function (params, containerExtents) {\n if (path == null) {\n path = _node(\"path\");\n params.connector.svg.appendChild(path);\n self.attachListeners(path, params.connector);\n self.attachListeners(path, self);\n\n p1_1 = _node(\"path\");\n params.connector.svg.appendChild(p1_1);\n self.attachListeners(p1_1, params.connector);\n self.attachListeners(p1_1, self);\n\n p1_2 = _node(\"path\");\n params.connector.svg.appendChild(p1_2);\n self.attachListeners(p1_2, params.connector);\n self.attachListeners(p1_2, self);\n }\n\n var offset = [0, 0];\n if (containerExtents.xmin < 0) {\n offset[0] = -containerExtents.xmin;\n }\n if (containerExtents.ymin < 0) {\n offset[1] = -containerExtents.ymin;\n }\n\n _attr(path, {\n \"d\": makePath(params.head, params.tail),\n stroke: \"red\",\n fill: null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n\n _attr(p1_1, {\n \"d\": makePath(params.tailLine[0], params.tailLine[1]),\n stroke: \"blue\",\n fill: null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n\n _attr(p1_2, {\n \"d\": makePath(params.headLine[0], params.headLine[1]),\n stroke: \"green\",\n fill: null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n };\n\n var makePath = function (d1, d2) {\n return \"M \" + d1.x + \",\" + d1.y +\n \" L\" + d2.x + \",\" + d2.y;\n };\n };\n _ju.extend(_jp.Overlays.svg.GuideLines, _jp.Overlays.GuideLines);\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains code used when jsPlumb is being rendered in a DOM.\n *\n * Copyright (c) 2010 - 2019 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil,\n _jk = root.Katavorio, _jg = root.Biltong;\n\n var _getEventManager = function(instance) {\n var e = instance._mottle;\n if (!e) {\n e = instance._mottle = new root.Mottle();\n }\n return e;\n };\n\n var _getDragManager = function (instance, category) {\n\n category = category || \"main\";\n var key = \"_katavorio_\" + category;\n var k = instance[key],\n e = instance.getEventManager();\n\n if (!k) {\n k = new _jk({\n bind: e.on,\n unbind: e.off,\n getSize: _jp.getSize,\n getConstrainingRectangle:function(el) {\n return [ el.parentNode.scrollWidth, el.parentNode.scrollHeight ];\n },\n getPosition: function (el, relativeToRoot) {\n // if this is a nested draggable then compute the offset against its own offsetParent, otherwise\n // compute against the Container's origin. see also the getUIPosition method below.\n var o = instance.getOffset(el, relativeToRoot, el._katavorioDrag ? el.offsetParent : null);\n return [o.left, o.top];\n },\n setPosition: function (el, xy) {\n el.style.left = xy[0] + \"px\";\n el.style.top = xy[1] + \"px\";\n },\n addClass: _jp.addClass,\n removeClass: _jp.removeClass,\n intersects: _jg.intersects,\n indexOf: function(l, i) { return l.indexOf(i); },\n scope:instance.getDefaultScope(),\n css: {\n noSelect: instance.dragSelectClass,\n droppable: \"jtk-droppable\",\n draggable: \"jtk-draggable\",\n drag: \"jtk-drag\",\n selected: \"jtk-drag-selected\",\n active: \"jtk-drag-active\",\n hover: \"jtk-drag-hover\",\n ghostProxy:\"jtk-ghost-proxy\"\n }\n });\n k.setZoom(instance.getZoom());\n instance[key] = k;\n instance.bind(\"zoom\", k.setZoom);\n }\n return k;\n };\n\n var _dragStart=function(params) {\n var options = params.el._jsPlumbDragOptions;\n var cont = true;\n if (options.canDrag) {\n cont = options.canDrag();\n }\n if (cont) {\n this.setHoverSuspended(true);\n this.select({source: params.el}).addClass(this.elementDraggingClass + \" \" + this.sourceElementDraggingClass, true);\n this.select({target: params.el}).addClass(this.elementDraggingClass + \" \" + this.targetElementDraggingClass, true);\n this.setConnectionBeingDragged(true);\n }\n return cont;\n };\n var _dragMove=function(params) {\n var ui = this.getUIPosition(arguments, this.getZoom());\n if (ui != null) {\n var o = params.el._jsPlumbDragOptions;\n this.draw(params.el, ui, null, true);\n if (o._dragging) {\n this.addClass(params.el, \"jtk-dragged\");\n }\n o._dragging = true;\n }\n };\n var _dragStop=function(params) {\n var elements = params.selection, uip;\n\n var _one = function (_e) {\n if (_e[1] != null) {\n // run the reported offset through the code that takes parent containers\n // into account, to adjust if necessary (issue 554)\n uip = this.getUIPosition([{\n el:_e[2].el,\n pos:[_e[1].left, _e[1].top]\n }]);\n this.draw(_e[2].el, uip);\n }\n\n delete _e[0]._jsPlumbDragOptions._dragging;\n\n this.removeClass(_e[0], \"jtk-dragged\");\n this.select({source: _e[2].el}).removeClass(this.elementDraggingClass + \" \" + this.sourceElementDraggingClass, true);\n this.select({target: _e[2].el}).removeClass(this.elementDraggingClass + \" \" + this.targetElementDraggingClass, true);\n this.getDragManager().dragEnded(_e[2].el);\n }.bind(this);\n\n for (var i = 0; i < elements.length; i++) {\n _one(elements[i]);\n }\n\n this.setHoverSuspended(false);\n this.setConnectionBeingDragged(false);\n };\n\n var _animProps = function (o, p) {\n var _one = function (pName) {\n if (p[pName] != null) {\n if (_ju.isString(p[pName])) {\n var m = p[pName].match(/-=/) ? -1 : 1,\n v = p[pName].substring(2);\n return o[pName] + (m * v);\n }\n else {\n return p[pName];\n }\n }\n else {\n return o[pName];\n }\n };\n return [ _one(\"left\"), _one(\"top\") ];\n };\n\n var _genLoc = function (prefix, e) {\n if (e == null) {\n return [ 0, 0 ];\n }\n var ts = _touches(e), t = _getTouch(ts, 0);\n return [t[prefix + \"X\"], t[prefix + \"Y\"]];\n },\n _pageLocation = _genLoc.bind(this, \"page\"),\n _screenLocation = _genLoc.bind(this, \"screen\"),\n _clientLocation = _genLoc.bind(this, \"client\"),\n _getTouch = function (touches, idx) {\n return touches.item ? touches.item(idx) : touches[idx];\n },\n _touches = function (e) {\n return e.touches && e.touches.length > 0 ? e.touches :\n e.changedTouches && e.changedTouches.length > 0 ? e.changedTouches :\n e.targetTouches && e.targetTouches.length > 0 ? e.targetTouches :\n [ e ];\n };\n\n /**\n Manages dragging for some instance of jsPlumb.\n\n TODO instead of this being accessed directly, it should subscribe to events on the jsPlumb instance: every method\n in here is called directly by jsPlumb. But what should happen is that we have unpublished events that this listens\n to. The only trick is getting one of these instantiated with every jsPlumb instance: it needs to have a hook somehow.\n Basically the general idea is to pull ALL the drag code out (prototype method registrations plus this) into a\n dedicated drag script), that does not necessarily need to be included.\n\n\n */\n var DragManager = function (_currentInstance) {\n var _draggables = {}, _dlist = [], _delements = {}, _elementsWithEndpoints = {},\n // elementids mapped to the draggable to which they belong.\n _draggablesForElements = {};\n\n /**\n register some element as draggable. right now the drag init stuff is done elsewhere, and it is\n possible that will continue to be the case.\n */\n this.register = function (el) {\n var id = _currentInstance.getId(el),\n parentOffset;\n\n if (!_draggables[id]) {\n _draggables[id] = el;\n _dlist.push(el);\n _delements[id] = {};\n }\n\n // look for child elements that have endpoints and register them against this draggable.\n var _oneLevel = function (p) {\n if (p) {\n for (var i = 0; i < p.childNodes.length; i++) {\n if (p.childNodes[i].nodeType !== 3 && p.childNodes[i].nodeType !== 8) {\n var cEl = jsPlumb.getElement(p.childNodes[i]),\n cid = _currentInstance.getId(p.childNodes[i], null, true);\n if (cid && _elementsWithEndpoints[cid] && _elementsWithEndpoints[cid] > 0) {\n if (!parentOffset) {\n parentOffset = _currentInstance.getOffset(el);\n }\n var cOff = _currentInstance.getOffset(cEl);\n _delements[id][cid] = {\n id: cid,\n offset: {\n left: cOff.left - parentOffset.left,\n top: cOff.top - parentOffset.top\n }\n };\n _draggablesForElements[cid] = id;\n }\n _oneLevel(p.childNodes[i]);\n }\n }\n }\n };\n\n _oneLevel(el);\n };\n\n // refresh the offsets for child elements of this element.\n this.updateOffsets = function (elId, childOffsetOverrides) {\n if (elId != null) {\n childOffsetOverrides = childOffsetOverrides || {};\n var domEl = jsPlumb.getElement(elId),\n id = _currentInstance.getId(domEl),\n children = _delements[id],\n parentOffset;\n\n if (children) {\n for (var i in children) {\n if (children.hasOwnProperty(i)) {\n var cel = jsPlumb.getElement(i),\n cOff = childOffsetOverrides[i] || _currentInstance.getOffset(cel);\n\n // do not update if we have a value already and we'd just be writing 0,0\n if (cel.offsetParent == null && _delements[id][i] != null) {\n continue;\n }\n\n if (!parentOffset) {\n parentOffset = _currentInstance.getOffset(domEl);\n }\n\n _delements[id][i] = {\n id: i,\n offset: {\n left: cOff.left - parentOffset.left,\n top: cOff.top - parentOffset.top\n }\n };\n _draggablesForElements[i] = id;\n }\n }\n }\n }\n };\n\n /**\n notification that an endpoint was added to the given el. we go up from that el's parent\n node, looking for a parent that has been registered as a draggable. if we find one, we add this\n el to that parent's list of elements to update on drag (if it is not there already)\n */\n this.endpointAdded = function (el, id) {\n\n id = id || _currentInstance.getId(el);\n\n var b = document.body,\n p = el.parentNode;\n\n _elementsWithEndpoints[id] = _elementsWithEndpoints[id] ? _elementsWithEndpoints[id] + 1 : 1;\n\n while (p != null && p !== b) {\n var pid = _currentInstance.getId(p, null, true);\n if (pid && _draggables[pid]) {\n var pLoc = _currentInstance.getOffset(p);\n\n if (_delements[pid][id] == null) {\n var cLoc = _currentInstance.getOffset(el);\n _delements[pid][id] = {\n id: id,\n offset: {\n left: cLoc.left - pLoc.left,\n top: cLoc.top - pLoc.top\n }\n };\n _draggablesForElements[id] = pid;\n }\n break;\n }\n p = p.parentNode;\n }\n };\n\n this.endpointDeleted = function (endpoint) {\n if (_elementsWithEndpoints[endpoint.elementId]) {\n _elementsWithEndpoints[endpoint.elementId]--;\n if (_elementsWithEndpoints[endpoint.elementId] <= 0) {\n for (var i in _delements) {\n if (_delements.hasOwnProperty(i) && _delements[i]) {\n delete _delements[i][endpoint.elementId];\n delete _draggablesForElements[endpoint.elementId];\n }\n }\n }\n }\n };\n\n this.changeId = function (oldId, newId) {\n _delements[newId] = _delements[oldId];\n _delements[oldId] = {};\n _draggablesForElements[newId] = _draggablesForElements[oldId];\n _draggablesForElements[oldId] = null;\n };\n\n this.getElementsForDraggable = function (id) {\n return _delements[id];\n };\n\n this.elementRemoved = function (elementId) {\n var elId = _draggablesForElements[elementId];\n if (elId) {\n delete _delements[elId][elementId];\n delete _draggablesForElements[elementId];\n }\n };\n\n this.reset = function () {\n _draggables = {};\n _dlist = [];\n _delements = {};\n _elementsWithEndpoints = {};\n };\n\n //\n // notification drag ended. We check automatically if need to update some\n // ancestor's offsets.\n //\n this.dragEnded = function (el) {\n if (el.offsetParent != null) {\n var id = _currentInstance.getId(el),\n ancestor = _draggablesForElements[id];\n\n if (ancestor) {\n this.updateOffsets(ancestor);\n }\n }\n };\n\n this.setParent = function (el, elId, p, pId, currentChildLocation) {\n var current = _draggablesForElements[elId];\n if (!_delements[pId]) {\n _delements[pId] = {};\n }\n var pLoc = _currentInstance.getOffset(p),\n cLoc = currentChildLocation || _currentInstance.getOffset(el);\n\n if (current && _delements[current]) {\n delete _delements[current][elId];\n }\n\n _delements[pId][elId] = {\n id:elId,\n offset : {\n left: cLoc.left - pLoc.left,\n top: cLoc.top - pLoc.top\n }\n };\n _draggablesForElements[elId] = pId;\n };\n\n this.clearParent = function(el, elId) {\n var current = _draggablesForElements[elId];\n if (current) {\n delete _delements[current][elId];\n delete _draggablesForElements[elId];\n }\n };\n\n this.revalidateParent = function(el, elId, childOffset) {\n var current = _draggablesForElements[elId];\n if (current) {\n var co = {};\n co[elId] = childOffset;\n this.updateOffsets(current, co);\n _currentInstance.revalidate(current);\n }\n };\n\n this.getDragAncestor = function (el) {\n var de = jsPlumb.getElement(el),\n id = _currentInstance.getId(de),\n aid = _draggablesForElements[id];\n\n if (aid) {\n return jsPlumb.getElement(aid);\n }\n else {\n return null;\n }\n };\n\n };\n\n var _setClassName = function (el, cn, classList) {\n cn = _ju.fastTrim(cn);\n if (typeof el.className.baseVal !== \"undefined\") {\n el.className.baseVal = cn;\n }\n else {\n el.className = cn;\n }\n\n // recent (i currently have 61.0.3163.100) version of chrome do not update classList when you set the base val\n // of an svg element's className. in the long run we'd like to move to just using classList anyway\n try {\n var cl = el.classList;\n if (cl != null) {\n while (cl.length > 0) {\n cl.remove(cl.item(0));\n }\n for (var i = 0; i < classList.length; i++) {\n if (classList[i]) {\n cl.add(classList[i]);\n }\n }\n }\n }\n catch(e) {\n // not fatal\n _ju.log(\"JSPLUMB: cannot set class list\", e);\n }\n },\n _getClassName = function (el) {\n return (typeof el.className.baseVal === \"undefined\") ? el.className : el.className.baseVal;\n },\n _classManip = function (el, classesToAdd, classesToRemove) {\n classesToAdd = classesToAdd == null ? [] : _ju.isArray(classesToAdd) ? classesToAdd : classesToAdd.split(/\\s+/);\n classesToRemove = classesToRemove == null ? [] : _ju.isArray(classesToRemove) ? classesToRemove : classesToRemove.split(/\\s+/);\n\n var className = _getClassName(el),\n curClasses = className.split(/\\s+/);\n\n var _oneSet = function (add, classes) {\n for (var i = 0; i < classes.length; i++) {\n if (add) {\n if (curClasses.indexOf(classes[i]) === -1) {\n curClasses.push(classes[i]);\n }\n }\n else {\n var idx = curClasses.indexOf(classes[i]);\n if (idx !== -1) {\n curClasses.splice(idx, 1);\n }\n }\n }\n };\n\n _oneSet(true, classesToAdd);\n _oneSet(false, classesToRemove);\n\n _setClassName(el, curClasses.join(\" \"), curClasses);\n };\n\n root.jsPlumb.extend(root.jsPlumbInstance.prototype, {\n\n headless: false,\n\n pageLocation: _pageLocation,\n screenLocation: _screenLocation,\n clientLocation: _clientLocation,\n\n getDragManager:function() {\n if (this.dragManager == null) {\n this.dragManager = new DragManager(this);\n }\n\n return this.dragManager;\n },\n\n recalculateOffsets:function(elId) {\n this.getDragManager().updateOffsets(elId);\n },\n\n createElement:function(tag, style, clazz, atts) {\n return this.createElementNS(null, tag, style, clazz, atts);\n },\n\n createElementNS:function(ns, tag, style, clazz, atts) {\n var e = ns == null ? document.createElement(tag) : document.createElementNS(ns, tag);\n var i;\n style = style || {};\n for (i in style) {\n e.style[i] = style[i];\n }\n\n if (clazz) {\n e.className = clazz;\n }\n\n atts = atts || {};\n for (i in atts) {\n e.setAttribute(i, \"\" + atts[i]);\n }\n\n return e;\n },\n\n getAttribute: function (el, attName) {\n return el.getAttribute != null ? el.getAttribute(attName) : null;\n },\n\n setAttribute: function (el, a, v) {\n if (el.setAttribute != null) {\n el.setAttribute(a, v);\n }\n },\n\n setAttributes: function (el, atts) {\n for (var i in atts) {\n if (atts.hasOwnProperty(i)) {\n el.setAttribute(i, atts[i]);\n }\n }\n },\n appendToRoot: function (node) {\n document.body.appendChild(node);\n },\n getRenderModes: function () {\n return [ \"svg\" ];\n },\n getClass:_getClassName,\n addClass: function (el, clazz) {\n jsPlumb.each(el, function (e) {\n _classManip(e, clazz);\n });\n },\n hasClass: function (el, clazz) {\n el = jsPlumb.getElement(el);\n if (el.classList) {\n return el.classList.contains(clazz);\n }\n else {\n return _getClassName(el).indexOf(clazz) !== -1;\n }\n },\n removeClass: function (el, clazz) {\n jsPlumb.each(el, function (e) {\n _classManip(e, null, clazz);\n });\n },\n toggleClass:function(el, clazz) {\n if (jsPlumb.hasClass(el, clazz)) {\n jsPlumb.removeClass(el, clazz);\n } else {\n jsPlumb.addClass(el, clazz);\n }\n },\n updateClasses: function (el, toAdd, toRemove) {\n jsPlumb.each(el, function (e) {\n _classManip(e, toAdd, toRemove);\n });\n },\n setClass: function (el, clazz) {\n if (clazz != null) {\n jsPlumb.each(el, function (e) {\n _setClassName(e, clazz, clazz.split(/\\s+/));\n });\n }\n },\n setPosition: function (el, p) {\n el.style.left = p.left + \"px\";\n el.style.top = p.top + \"px\";\n },\n getPosition: function (el) {\n var _one = function (prop) {\n var v = el.style[prop];\n return v ? v.substring(0, v.length - 2) : 0;\n };\n return {\n left: _one(\"left\"),\n top: _one(\"top\")\n };\n },\n getStyle:function(el, prop) {\n if (typeof window.getComputedStyle !== 'undefined') {\n return getComputedStyle(el, null).getPropertyValue(prop);\n } else {\n return el.currentStyle[prop];\n }\n },\n getSelector: function (ctx, spec) {\n var sel = null;\n if (arguments.length === 1) {\n sel = ctx.nodeType != null ? ctx : document.querySelectorAll(ctx);\n }\n else {\n sel = ctx.querySelectorAll(spec);\n }\n\n return sel;\n },\n getOffset:function(el, relativeToRoot, container) {\n el = jsPlumb.getElement(el);\n container = container || this.getContainer();\n var out = {\n left: el.offsetLeft,\n top: el.offsetTop\n },\n op = (relativeToRoot || (container != null && (el !== container && el.offsetParent !== container))) ? el.offsetParent : null,\n _maybeAdjustScroll = function(offsetParent) {\n if (offsetParent != null && offsetParent !== document.body && (offsetParent.scrollTop > 0 || offsetParent.scrollLeft > 0)) {\n out.left -= offsetParent.scrollLeft;\n out.top -= offsetParent.scrollTop;\n }\n }.bind(this);\n\n while (op != null) {\n out.left += op.offsetLeft;\n out.top += op.offsetTop;\n _maybeAdjustScroll(op);\n op = relativeToRoot ? op.offsetParent :\n op.offsetParent === container ? null : op.offsetParent;\n }\n\n // if container is scrolled and the element (or its offset parent) is not absolute or fixed, adjust accordingly.\n if (container != null && !relativeToRoot && (container.scrollTop > 0 || container.scrollLeft > 0)) {\n var pp = el.offsetParent != null ? this.getStyle(el.offsetParent, \"position\") : \"static\",\n p = this.getStyle(el, \"position\");\n if (p !== \"absolute\" && p !== \"fixed\" && pp !== \"absolute\" && pp !== \"fixed\") {\n out.left -= container.scrollLeft;\n out.top -= container.scrollTop;\n }\n }\n return out;\n },\n //\n // return x+y proportion of the given element's size corresponding to the location of the given event.\n //\n getPositionOnElement: function (evt, el, zoom) {\n var box = typeof el.getBoundingClientRect !== \"undefined\" ? el.getBoundingClientRect() : { left: 0, top: 0, width: 0, height: 0 },\n body = document.body,\n docElem = document.documentElement,\n scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop,\n scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft,\n clientTop = docElem.clientTop || body.clientTop || 0,\n clientLeft = docElem.clientLeft || body.clientLeft || 0,\n pst = 0,\n psl = 0,\n top = box.top + scrollTop - clientTop + (pst * zoom),\n left = box.left + scrollLeft - clientLeft + (psl * zoom),\n cl = jsPlumb.pageLocation(evt),\n w = box.width || (el.offsetWidth * zoom),\n h = box.height || (el.offsetHeight * zoom),\n x = (cl[0] - left) / w,\n y = (cl[1] - top) / h;\n\n return [ x, y ];\n },\n\n /**\n * Gets the absolute position of some element as read from the left/top properties in its style.\n * @method getAbsolutePosition\n * @param {Element} el The element to retrieve the absolute coordinates from. **Note** this is a DOM element, not a selector from the underlying library.\n * @return {Number[]} [left, top] pixel values.\n */\n getAbsolutePosition: function (el) {\n var _one = function (s) {\n var ss = el.style[s];\n if (ss) {\n return parseFloat(ss.substring(0, ss.length - 2));\n }\n };\n return [ _one(\"left\"), _one(\"top\") ];\n },\n\n /**\n * Sets the absolute position of some element by setting the left/top properties in its style.\n * @method setAbsolutePosition\n * @param {Element} el The element to set the absolute coordinates on. **Note** this is a DOM element, not a selector from the underlying library.\n * @param {Number[]} xy x and y coordinates\n * @param {Number[]} [animateFrom] Optional previous xy to animate from.\n * @param {Object} [animateOptions] Options for the animation.\n */\n setAbsolutePosition: function (el, xy, animateFrom, animateOptions) {\n if (animateFrom) {\n this.animate(el, {\n left: \"+=\" + (xy[0] - animateFrom[0]),\n top: \"+=\" + (xy[1] - animateFrom[1])\n }, animateOptions);\n }\n else {\n el.style.left = xy[0] + \"px\";\n el.style.top = xy[1] + \"px\";\n }\n },\n /**\n * gets the size for the element, in an array : [ width, height ].\n */\n getSize: function (el) {\n return [ el.offsetWidth, el.offsetHeight ];\n },\n getWidth: function (el) {\n return el.offsetWidth;\n },\n getHeight: function (el) {\n return el.offsetHeight;\n },\n getRenderMode : function() { return \"svg\"; },\n draggable : function (el, options) {\n var info;\n el = _ju.isArray(el) || (el.length != null && !_ju.isString(el)) ? el: [ el ];\n Array.prototype.slice.call(el).forEach(function(_el) {\n info = this.info(_el);\n if (info.el) {\n this._initDraggableIfNecessary(info.el, true, options, info.id, true);\n }\n }.bind(this));\n return this;\n },\n initDraggable: function (el, options, category) {\n _getDragManager(this, category).draggable(el, options);\n el._jsPlumbDragOptions = options;\n },\n destroyDraggable: function (el, category) {\n _getDragManager(this, category).destroyDraggable(el);\n delete el._jsPlumbDragOptions;\n },\n unbindDraggable: function (el, evt, fn, category) {\n _getDragManager(this, category).destroyDraggable(el, evt, fn);\n },\n setDraggable : function (element, draggable) {\n return jsPlumb.each(element, function (el) {\n if (this.isDragSupported(el)) {\n this._draggableStates[this.getAttribute(el, \"id\")] = draggable;\n this.setElementDraggable(el, draggable);\n }\n }.bind(this));\n },\n _draggableStates : {},\n /*\n * toggles the draggable state of the given element(s).\n * el is either an id, or an element object, or a list of ids/element objects.\n */\n toggleDraggable : function (el) {\n var state;\n jsPlumb.each(el, function (el) {\n var elId = this.getAttribute(el, \"id\");\n state = this._draggableStates[elId] == null ? false : this._draggableStates[elId];\n state = !state;\n this._draggableStates[elId] = state;\n this.setDraggable(el, state);\n return state;\n }.bind(this));\n return state;\n },\n _initDraggableIfNecessary : function (element, isDraggable, dragOptions, id, fireEvent) {\n // TODO FIRST: move to DragManager. including as much of the decision to init dragging as possible.\n if (!jsPlumb.headless) {\n var _draggable = isDraggable == null ? false : isDraggable;\n if (_draggable) {\n if (jsPlumb.isDragSupported(element, this)) {\n var options = dragOptions || this.Defaults.DragOptions;\n options = jsPlumb.extend({}, options); // make a copy.\n if (!jsPlumb.isAlreadyDraggable(element, this)) {\n var dragEvent = jsPlumb.dragEvents.drag,\n stopEvent = jsPlumb.dragEvents.stop,\n startEvent = jsPlumb.dragEvents.start;\n\n this.manage(id, element);\n\n options[startEvent] = _ju.wrap(options[startEvent], _dragStart.bind(this));\n\n options[dragEvent] = _ju.wrap(options[dragEvent], _dragMove.bind(this));\n\n options[stopEvent] = _ju.wrap(options[stopEvent], _dragStop.bind(this));\n\n var elId = this.getId(element); // need ID\n\n this._draggableStates[elId] = true;\n var draggable = this._draggableStates[elId];\n\n options.disabled = draggable == null ? false : !draggable;\n this.initDraggable(element, options);\n this.getDragManager().register(element);\n if (fireEvent) {\n this.fire(\"elementDraggable\", {el:element, options:options});\n }\n }\n else {\n // already draggable. attach any start, drag or stop listeners to the current Drag.\n if (dragOptions.force) {\n this.initDraggable(element, options);\n }\n }\n }\n }\n }\n },\n animationSupported:true,\n getElement: function (el) {\n if (el == null) {\n return null;\n }\n // here we pluck the first entry if el was a list of entries.\n // this is not my favourite thing to do, but previous versions of\n // jsplumb supported jquery selectors, and it is possible a selector\n // will be passed in here.\n el = typeof el === \"string\" ? el : el.length != null && el.enctype == null ? el[0] : el;\n return typeof el === \"string\" ? document.getElementById(el) : el;\n },\n removeElement: function (element) {\n _getDragManager(this).elementRemoved(element);\n this.getEventManager().remove(element);\n },\n //\n // this adapter supports a rudimentary animation function. no easing is supported. only\n // left/top properties are supported. property delta args are expected to be in the form\n //\n // +=x.xxxx\n //\n // or\n //\n // -=x.xxxx\n //\n doAnimate: function (el, properties, options) {\n options = options || {};\n var o = this.getOffset(el),\n ap = _animProps(o, properties),\n ldist = ap[0] - o.left,\n tdist = ap[1] - o.top,\n d = options.duration || 250,\n step = 15, steps = d / step,\n linc = (step / d) * ldist,\n tinc = (step / d) * tdist,\n idx = 0,\n _int = setInterval(function () {\n _jp.setPosition(el, {\n left: o.left + (linc * (idx + 1)),\n top: o.top + (tinc * (idx + 1))\n });\n if (options.step != null) {\n options.step(idx, Math.ceil(steps));\n }\n idx++;\n if (idx >= steps) {\n window.clearInterval(_int);\n if (options.complete != null) {\n options.complete();\n }\n }\n }, step);\n },\n // DRAG/DROP\n\n\n destroyDroppable: function (el, category) {\n _getDragManager(this, category).destroyDroppable(el);\n },\n unbindDroppable: function (el, evt, fn, category) {\n _getDragManager(this, category).destroyDroppable(el, evt, fn);\n },\n\n droppable :function(el, options) {\n el = _ju.isArray(el) || (el.length != null && !_ju.isString(el)) ? el: [ el ];\n var info;\n options = options || {};\n options.allowLoopback = false;\n Array.prototype.slice.call(el).forEach(function(_el) {\n info = this.info(_el);\n if (info.el) {\n this.initDroppable(info.el, options);\n }\n }.bind(this));\n return this;\n },\n\n initDroppable: function (el, options, category) {\n _getDragManager(this, category).droppable(el, options);\n },\n isAlreadyDraggable: function (el) {\n return el._katavorioDrag != null;\n },\n isDragSupported: function (el, options) {\n return true;\n },\n isDropSupported: function (el, options) {\n return true;\n },\n isElementDraggable: function (el) {\n el = _jp.getElement(el);\n return el._katavorioDrag && el._katavorioDrag.isEnabled();\n },\n getDragObject: function (eventArgs) {\n return eventArgs[0].drag.getDragElement();\n },\n getDragScope: function (el) {\n return el._katavorioDrag && el._katavorioDrag.scopes.join(\" \") || \"\";\n },\n getDropEvent: function (args) {\n return args[0].e;\n },\n getUIPosition: function (eventArgs, zoom) {\n // here the position reported to us by Katavorio is relative to the element's offsetParent. For top\n // level nodes that is fine, but if we have a nested draggable then its offsetParent is actually\n // not going to be the jsplumb container; it's going to be some child of that element. In that case\n // we want to adjust the UI position to account for the offsetParent's position relative to the Container\n // origin.\n var el = eventArgs[0].el;\n if (el.offsetParent == null) {\n return null;\n }\n var finalPos = eventArgs[0].finalPos || eventArgs[0].pos;\n var p = { left:finalPos[0], top:finalPos[1] };\n if (el._katavorioDrag && el.offsetParent !== this.getContainer()) {\n var oc = this.getOffset(el.offsetParent);\n p.left += oc.left;\n p.top += oc.top;\n }\n return p;\n },\n setDragFilter: function (el, filter, _exclude) {\n if (el._katavorioDrag) {\n el._katavorioDrag.setFilter(filter, _exclude);\n }\n },\n setElementDraggable: function (el, draggable) {\n el = _jp.getElement(el);\n if (el._katavorioDrag) {\n el._katavorioDrag.setEnabled(draggable);\n }\n },\n setDragScope: function (el, scope) {\n if (el._katavorioDrag) {\n el._katavorioDrag.k.setDragScope(el, scope);\n }\n },\n setDropScope:function(el, scope) {\n if (el._katavorioDrop && el._katavorioDrop.length > 0) {\n el._katavorioDrop[0].k.setDropScope(el, scope);\n }\n },\n addToPosse:function(el, spec) {\n var specs = Array.prototype.slice.call(arguments, 1);\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) {\n _el = [ _jp.getElement(_el) ];\n _el.push.apply(_el, specs );\n dm.addToPosse.apply(dm, _el);\n });\n },\n setPosse:function(el, spec) {\n var specs = Array.prototype.slice.call(arguments, 1);\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) {\n _el = [ _jp.getElement(_el) ];\n _el.push.apply(_el, specs );\n dm.setPosse.apply(dm, _el);\n });\n },\n removeFromPosse:function(el, posseId) {\n var specs = Array.prototype.slice.call(arguments, 1);\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) {\n _el = [ _jp.getElement(_el) ];\n _el.push.apply(_el, specs );\n dm.removeFromPosse.apply(dm, _el);\n });\n },\n removeFromAllPosses:function(el) {\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) { dm.removeFromAllPosses(_jp.getElement(_el)); });\n },\n setPosseState:function(el, posseId, state) {\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) { dm.setPosseState(_jp.getElement(_el), posseId, state); });\n },\n dragEvents: {\n 'start': 'start', 'stop': 'stop', 'drag': 'drag', 'step': 'step',\n 'over': 'over', 'out': 'out', 'drop': 'drop', 'complete': 'complete',\n 'beforeStart':'beforeStart'\n },\n animEvents: {\n 'step': \"step\", 'complete': 'complete'\n },\n stopDrag: function (el) {\n if (el._katavorioDrag) {\n el._katavorioDrag.abort();\n }\n },\n addToDragSelection: function (spec) {\n _getDragManager(this).select(spec);\n },\n removeFromDragSelection: function (spec) {\n _getDragManager(this).deselect(spec);\n },\n clearDragSelection: function () {\n _getDragManager(this).deselectAll();\n },\n trigger: function (el, event, originalEvent, payload) {\n this.getEventManager().trigger(el, event, originalEvent, payload);\n },\n doReset:function() {\n // look for katavorio instances and reset each one if found.\n for (var key in this) {\n if (key.indexOf(\"_katavorio_\") === 0) {\n this[key].reset();\n }\n }\n },\n getEventManager:function() {\n return _getEventManager(this);\n },\n on : function(el, event, callback) {\n // TODO: here we would like to map the tap event if we know its\n // an internal bind to a click. we have to know its internal because only\n // then can we be sure that the UP event wont be consumed (tap is a synthesized\n // event from a mousedown followed by a mouseup).\n //event = { \"click\":\"tap\", \"dblclick\":\"dbltap\"}[event] || event;\n this.getEventManager().on.apply(this, arguments);\n return this;\n },\n off : function(el, event, callback) {\n this.getEventManager().off.apply(this, arguments);\n return this;\n }\n\n });\n\n var ready = function (f) {\n var _do = function () {\n if (/complete|loaded|interactive/.test(document.readyState) && typeof(document.body) !== \"undefined\" && document.body != null) {\n f();\n }\n else {\n setTimeout(_do, 9);\n }\n };\n\n _do();\n };\n ready(_jp.init);\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/jsplumb/dist/js/jsplumb.js\n// module id = 721\n// module chunks = 3 4 5","\nimport i18n from '@/module/i18n'\n\n/**\n * cycle\n */\nconst cycleList = [\n {\n value: 'month',\n label: `${i18n.$t('月')}`\n },\n {\n value: 'week',\n label: `${i18n.$t('周')}`\n },\n {\n value: 'day',\n label: `${i18n.$t('日')}`\n },\n {\n value: 'hour',\n label: `${i18n.$t('时')}`\n }\n]\n\n/**\n * cycle value\n */\nconst dateValueList = {\n 'hour': [\n {\n value: 'last1Hour',\n label: `${i18n.$t('前1小时')}`\n },\n {\n value: 'last2Hours',\n label: `${i18n.$t('前2小时')}`\n },\n {\n value: 'last3Hours',\n label: `${i18n.$t('前3小时')}`\n }\n ],\n 'day': [\n {\n value: 'last1Days',\n label: `${i18n.$t('昨天')}`\n },\n {\n value: 'last2Days',\n label: `${i18n.$t('前两天')}`\n },\n {\n value: 'last3Days',\n label: `${i18n.$t('前三天')}`\n },\n {\n value: 'last7Days',\n label: `${i18n.$t('前七天')}`\n }\n ],\n 'week': [\n {\n value: 'lastWeek',\n label: `${i18n.$t('上周')}`\n },\n {\n value: 'lastMonday',\n label: `${i18n.$t('上周一')}`\n },\n {\n value: 'lastTuesday',\n label: `${i18n.$t('上周二')}`\n },\n {\n value: 'lastWednesday',\n label: `${i18n.$t('上周三')}`\n },\n {\n value: 'lastThursday',\n label: `${i18n.$t('上周四')}`\n },\n {\n value: 'lastFriday',\n label: `${i18n.$t('上周五')}`\n },\n {\n value: 'lastSaturday',\n label: `${i18n.$t('上周六')}`\n },\n {\n value: 'lastSunday',\n label: `${i18n.$t('上周日')}`\n }\n ],\n 'month': [\n {\n value: 'lastMonth',\n label: `${i18n.$t('上月')}`\n },\n {\n value: 'lastMonthBegin',\n label: `${i18n.$t('上月初')}`\n },\n {\n value: 'lastMonthEnd',\n label: `${i18n.$t('上月末')}`\n }\n ]\n}\n\n/**\n * direct\n */\nconst directList = [\n {\n id: 1,\n code: 'IN',\n disabled: false\n },\n {\n id: 2,\n code: 'OUT',\n disabled: false\n }\n]\n\n/**\n * type\n */\nconst typeList = [\n {\n id: 1,\n code: 'VARCHAR',\n disabled: false\n },\n {\n id: 2,\n code: 'INTEGER',\n disabled: false\n },\n {\n id: 3,\n code: 'LONG',\n disabled: false\n },\n {\n id: 4,\n code: 'FLOAT',\n disabled: false\n },\n {\n id: 5,\n code: 'DOUBLE',\n disabled: false\n },\n {\n id: 6,\n code: 'DATE',\n disabled: false\n },\n {\n id: 7,\n code: 'TIME',\n disabled: false\n },\n {\n id: 8,\n code: 'TIMESTAMP',\n disabled: false\n },\n {\n id: 9,\n code: 'BOOLEAN',\n disabled: false\n }\n]\n\n/**\n * sqlType\n */\nconst sqlTypeList = [\n {\n id: 0,\n code: `${i18n.$t('查询')}`\n },\n {\n id: 1,\n code: `${i18n.$t('非查询')}`\n }\n]\n\nexport {\n cycleList,\n dateValueList,\n typeList,\n directList,\n sqlTypeList\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/formModel/tasks/_source/commcon.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/log.vue","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var HINT_ELEMENT_CLASS = \"CodeMirror-hint\";\n var ACTIVE_HINT_ELEMENT_CLASS = \"CodeMirror-hint-active\";\n\n // This is the old interface, kept around for now to stay\n // backwards-compatible.\n CodeMirror.showHint = function(cm, getHints, options) {\n if (!getHints) return cm.showHint(options);\n if (options && options.async) getHints.async = true;\n var newOpts = {hint: getHints};\n if (options) for (var prop in options) newOpts[prop] = options[prop];\n return cm.showHint(newOpts);\n };\n\n CodeMirror.defineExtension(\"showHint\", function(options) {\n options = parseOptions(this, this.getCursor(\"start\"), options);\n var selections = this.listSelections()\n if (selections.length > 1) return;\n // By default, don't allow completion when something is selected.\n // A hint function can have a `supportsSelection` property to\n // indicate that it can handle selections.\n if (this.somethingSelected()) {\n if (!options.hint.supportsSelection) return;\n // Don't try with cross-line selections\n for (var i = 0; i < selections.length; i++)\n if (selections[i].head.line != selections[i].anchor.line) return;\n }\n\n if (this.state.completionActive) this.state.completionActive.close();\n var completion = this.state.completionActive = new Completion(this, options);\n if (!completion.options.hint) return;\n\n CodeMirror.signal(this, \"startCompletion\", this);\n completion.update(true);\n });\n\n CodeMirror.defineExtension(\"closeHint\", function() {\n if (this.state.completionActive) this.state.completionActive.close()\n })\n\n function Completion(cm, options) {\n this.cm = cm;\n this.options = options;\n this.widget = null;\n this.debounce = 0;\n this.tick = 0;\n this.startPos = this.cm.getCursor(\"start\");\n this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length;\n\n var self = this;\n cm.on(\"cursorActivity\", this.activityFunc = function() { self.cursorActivity(); });\n }\n\n var requestAnimationFrame = window.requestAnimationFrame || function(fn) {\n return setTimeout(fn, 1000/60);\n };\n var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;\n\n Completion.prototype = {\n close: function() {\n if (!this.active()) return;\n this.cm.state.completionActive = null;\n this.tick = null;\n this.cm.off(\"cursorActivity\", this.activityFunc);\n\n if (this.widget && this.data) CodeMirror.signal(this.data, \"close\");\n if (this.widget) this.widget.close();\n CodeMirror.signal(this.cm, \"endCompletion\", this.cm);\n },\n\n active: function() {\n return this.cm.state.completionActive == this;\n },\n\n pick: function(data, i) {\n var completion = data.list[i];\n if (completion.hint) completion.hint(this.cm, data, completion);\n else this.cm.replaceRange(getText(completion), completion.from || data.from,\n completion.to || data.to, \"complete\");\n CodeMirror.signal(data, \"pick\", completion);\n this.close();\n },\n\n cursorActivity: function() {\n if (this.debounce) {\n cancelAnimationFrame(this.debounce);\n this.debounce = 0;\n }\n\n var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line);\n if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch ||\n pos.ch < this.startPos.ch || this.cm.somethingSelected() ||\n (!pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {\n this.close();\n } else {\n var self = this;\n this.debounce = requestAnimationFrame(function() {self.update();});\n if (this.widget) this.widget.disable();\n }\n },\n\n update: function(first) {\n if (this.tick == null) return\n var self = this, myTick = ++this.tick\n fetchHints(this.options.hint, this.cm, this.options, function(data) {\n if (self.tick == myTick) self.finishUpdate(data, first)\n })\n },\n\n finishUpdate: function(data, first) {\n if (this.data) CodeMirror.signal(this.data, \"update\");\n\n var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);\n if (this.widget) this.widget.close();\n\n this.data = data;\n\n if (data && data.list.length) {\n if (picked && data.list.length == 1) {\n this.pick(data, 0);\n } else {\n this.widget = new Widget(this, data);\n CodeMirror.signal(data, \"shown\");\n }\n }\n }\n };\n\n function parseOptions(cm, pos, options) {\n var editor = cm.options.hintOptions;\n var out = {};\n for (var prop in defaultOptions) out[prop] = defaultOptions[prop];\n if (editor) for (var prop in editor)\n if (editor[prop] !== undefined) out[prop] = editor[prop];\n if (options) for (var prop in options)\n if (options[prop] !== undefined) out[prop] = options[prop];\n if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos)\n return out;\n }\n\n function getText(completion) {\n if (typeof completion == \"string\") return completion;\n else return completion.text;\n }\n\n function buildKeyMap(completion, handle) {\n var baseMap = {\n Up: function() {handle.moveFocus(-1);},\n Down: function() {handle.moveFocus(1);},\n PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);},\n PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);},\n Home: function() {handle.setFocus(0);},\n End: function() {handle.setFocus(handle.length - 1);},\n Enter: handle.pick,\n Tab: handle.pick,\n Esc: handle.close\n };\n\n var mac = /Mac/.test(navigator.platform);\n\n if (mac) {\n baseMap[\"Ctrl-P\"] = function() {handle.moveFocus(-1);};\n baseMap[\"Ctrl-N\"] = function() {handle.moveFocus(1);};\n }\n\n var custom = completion.options.customKeys;\n var ourMap = custom ? {} : baseMap;\n function addBinding(key, val) {\n var bound;\n if (typeof val != \"string\")\n bound = function(cm) { return val(cm, handle); };\n // This mechanism is deprecated\n else if (baseMap.hasOwnProperty(val))\n bound = baseMap[val];\n else\n bound = val;\n ourMap[key] = bound;\n }\n if (custom)\n for (var key in custom) if (custom.hasOwnProperty(key))\n addBinding(key, custom[key]);\n var extra = completion.options.extraKeys;\n if (extra)\n for (var key in extra) if (extra.hasOwnProperty(key))\n addBinding(key, extra[key]);\n return ourMap;\n }\n\n function getHintElement(hintsElement, el) {\n while (el && el != hintsElement) {\n if (el.nodeName.toUpperCase() === \"LI\" && el.parentNode == hintsElement) return el;\n el = el.parentNode;\n }\n }\n\n function Widget(completion, data) {\n this.completion = completion;\n this.data = data;\n this.picked = false;\n var widget = this, cm = completion.cm;\n var ownerDocument = cm.getInputField().ownerDocument;\n var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow;\n\n var hints = this.hints = ownerDocument.createElement(\"ul\");\n var theme = completion.cm.options.theme;\n hints.className = \"CodeMirror-hints \" + theme;\n this.selectedHint = data.selectedHint || 0;\n\n var completions = data.list;\n for (var i = 0; i < completions.length; ++i) {\n var elt = hints.appendChild(ownerDocument.createElement(\"li\")), cur = completions[i];\n var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? \"\" : \" \" + ACTIVE_HINT_ELEMENT_CLASS);\n if (cur.className != null) className = cur.className + \" \" + className;\n elt.className = className;\n if (cur.render) cur.render(elt, data, cur);\n else elt.appendChild(ownerDocument.createTextNode(cur.displayText || getText(cur)));\n elt.hintId = i;\n }\n\n var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);\n var left = pos.left, top = pos.bottom, below = true;\n hints.style.left = left + \"px\";\n hints.style.top = top + \"px\";\n // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.\n var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth);\n var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight);\n (completion.options.container || ownerDocument.body).appendChild(hints);\n var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH;\n var scrolls = hints.scrollHeight > hints.clientHeight + 1\n var startScroll = cm.getScrollInfo();\n\n if (overlapY > 0) {\n var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);\n if (curTop - height > 0) { // Fits above cursor\n hints.style.top = (top = pos.top - height) + \"px\";\n below = false;\n } else if (height > winH) {\n hints.style.height = (winH - 5) + \"px\";\n hints.style.top = (top = pos.bottom - box.top) + \"px\";\n var cursor = cm.getCursor();\n if (data.from.ch != cursor.ch) {\n pos = cm.cursorCoords(cursor);\n hints.style.left = (left = pos.left) + \"px\";\n box = hints.getBoundingClientRect();\n }\n }\n }\n var overlapX = box.right - winW;\n if (overlapX > 0) {\n if (box.right - box.left > winW) {\n hints.style.width = (winW - 5) + \"px\";\n overlapX -= (box.right - box.left) - winW;\n }\n hints.style.left = (left = pos.left - overlapX) + \"px\";\n }\n if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling)\n node.style.paddingRight = cm.display.nativeBarWidth + \"px\"\n\n cm.addKeyMap(this.keyMap = buildKeyMap(completion, {\n moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },\n setFocus: function(n) { widget.changeActive(n); },\n menuSize: function() { return widget.screenAmount(); },\n length: completions.length,\n close: function() { completion.close(); },\n pick: function() { widget.pick(); },\n data: data\n }));\n\n if (completion.options.closeOnUnfocus) {\n var closingOnBlur;\n cm.on(\"blur\", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });\n cm.on(\"focus\", this.onFocus = function() { clearTimeout(closingOnBlur); });\n }\n\n cm.on(\"scroll\", this.onScroll = function() {\n var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();\n var newTop = top + startScroll.top - curScroll.top;\n var point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop);\n if (!below) point += hints.offsetHeight;\n if (point <= editor.top || point >= editor.bottom) return completion.close();\n hints.style.top = newTop + \"px\";\n hints.style.left = (left + startScroll.left - curScroll.left) + \"px\";\n });\n\n CodeMirror.on(hints, \"dblclick\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}\n });\n\n CodeMirror.on(hints, \"click\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {\n widget.changeActive(t.hintId);\n if (completion.options.completeOnSingleClick) widget.pick();\n }\n });\n\n CodeMirror.on(hints, \"mousedown\", function() {\n setTimeout(function(){cm.focus();}, 20);\n });\n\n CodeMirror.signal(data, \"select\", completions[this.selectedHint], hints.childNodes[this.selectedHint]);\n return true;\n }\n\n Widget.prototype = {\n close: function() {\n if (this.completion.widget != this) return;\n this.completion.widget = null;\n this.hints.parentNode.removeChild(this.hints);\n this.completion.cm.removeKeyMap(this.keyMap);\n\n var cm = this.completion.cm;\n if (this.completion.options.closeOnUnfocus) {\n cm.off(\"blur\", this.onBlur);\n cm.off(\"focus\", this.onFocus);\n }\n cm.off(\"scroll\", this.onScroll);\n },\n\n disable: function() {\n this.completion.cm.removeKeyMap(this.keyMap);\n var widget = this;\n this.keyMap = {Enter: function() { widget.picked = true; }};\n this.completion.cm.addKeyMap(this.keyMap);\n },\n\n pick: function() {\n this.completion.pick(this.data, this.selectedHint);\n },\n\n changeActive: function(i, avoidWrap) {\n if (i >= this.data.list.length)\n i = avoidWrap ? this.data.list.length - 1 : 0;\n else if (i < 0)\n i = avoidWrap ? 0 : this.data.list.length - 1;\n if (this.selectedHint == i) return;\n var node = this.hints.childNodes[this.selectedHint];\n if (node) node.className = node.className.replace(\" \" + ACTIVE_HINT_ELEMENT_CLASS, \"\");\n node = this.hints.childNodes[this.selectedHint = i];\n node.className += \" \" + ACTIVE_HINT_ELEMENT_CLASS;\n if (node.offsetTop < this.hints.scrollTop)\n this.hints.scrollTop = node.offsetTop - 3;\n else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)\n this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3;\n CodeMirror.signal(this.data, \"select\", this.data.list[this.selectedHint], node);\n },\n\n screenAmount: function() {\n return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;\n }\n };\n\n function applicableHelpers(cm, helpers) {\n if (!cm.somethingSelected()) return helpers\n var result = []\n for (var i = 0; i < helpers.length; i++)\n if (helpers[i].supportsSelection) result.push(helpers[i])\n return result\n }\n\n function fetchHints(hint, cm, options, callback) {\n if (hint.async) {\n hint(cm, callback, options)\n } else {\n var result = hint(cm, options)\n if (result && result.then) result.then(callback)\n else callback(result)\n }\n }\n\n function resolveAutoHints(cm, pos) {\n var helpers = cm.getHelpers(pos, \"hint\"), words\n if (helpers.length) {\n var resolved = function(cm, callback, options) {\n var app = applicableHelpers(cm, helpers);\n function run(i) {\n if (i == app.length) return callback(null)\n fetchHints(app[i], cm, options, function(result) {\n if (result && result.list.length > 0) callback(result)\n else run(i + 1)\n })\n }\n run(0)\n }\n resolved.async = true\n resolved.supportsSelection = true\n return resolved\n } else if (words = cm.getHelper(cm.getCursor(), \"hintWords\")) {\n return function(cm) { return CodeMirror.hint.fromList(cm, {words: words}) }\n } else if (CodeMirror.hint.anyword) {\n return function(cm, options) { return CodeMirror.hint.anyword(cm, options) }\n } else {\n return function() {}\n }\n }\n\n CodeMirror.registerHelper(\"hint\", \"auto\", {\n resolve: resolveAutoHints\n });\n\n CodeMirror.registerHelper(\"hint\", \"fromList\", function(cm, options) {\n var cur = cm.getCursor(), token = cm.getTokenAt(cur)\n var term, from = CodeMirror.Pos(cur.line, token.start), to = cur\n if (token.start < cur.ch && /\\w/.test(token.string.charAt(cur.ch - token.start - 1))) {\n term = token.string.substr(0, cur.ch - token.start)\n } else {\n term = \"\"\n from = cur\n }\n var found = [];\n for (var i = 0; i < options.words.length; i++) {\n var word = options.words[i];\n if (word.slice(0, term.length) == term)\n found.push(word);\n }\n\n if (found.length) return {list: found, from: from, to: to};\n });\n\n CodeMirror.commands.autocomplete = CodeMirror.showHint;\n\n var defaultOptions = {\n hint: CodeMirror.hint.auto,\n completeSingle: true,\n alignWithWord: true,\n closeCharacters: /[\\s()\\[\\]{};:>,]/,\n closeOnUnfocus: true,\n completeOnSingleClick: true,\n container: null,\n customKeys: null,\n extraKeys: null\n };\n\n CodeMirror.defineOption(\"hintOptions\", null);\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/addon/hint/show-hint.js\n// module id = 725\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"../../mode/sql/sql\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"../../mode/sql/sql\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var tables;\n var defaultTable;\n var keywords;\n var identifierQuote;\n var CONS = {\n QUERY_DIV: \";\",\n ALIAS_KEYWORD: \"AS\"\n };\n var Pos = CodeMirror.Pos, cmpPos = CodeMirror.cmpPos;\n\n function isArray(val) { return Object.prototype.toString.call(val) == \"[object Array]\" }\n\n function getKeywords(editor) {\n var mode = editor.doc.modeOption;\n if (mode === \"sql\") mode = \"text/x-sql\";\n return CodeMirror.resolveMode(mode).keywords;\n }\n\n function getIdentifierQuote(editor) {\n var mode = editor.doc.modeOption;\n if (mode === \"sql\") mode = \"text/x-sql\";\n return CodeMirror.resolveMode(mode).identifierQuote || \"`\";\n }\n\n function getText(item) {\n return typeof item == \"string\" ? item : item.text;\n }\n\n function wrapTable(name, value) {\n if (isArray(value)) value = {columns: value}\n if (!value.text) value.text = name\n return value\n }\n\n function parseTables(input) {\n var result = {}\n if (isArray(input)) {\n for (var i = input.length - 1; i >= 0; i--) {\n var item = input[i]\n result[getText(item).toUpperCase()] = wrapTable(getText(item), item)\n }\n } else if (input) {\n for (var name in input)\n result[name.toUpperCase()] = wrapTable(name, input[name])\n }\n return result\n }\n\n function getTable(name) {\n return tables[name.toUpperCase()]\n }\n\n function shallowClone(object) {\n var result = {};\n for (var key in object) if (object.hasOwnProperty(key))\n result[key] = object[key];\n return result;\n }\n\n function match(string, word) {\n var len = string.length;\n var sub = getText(word).substr(0, len);\n return string.toUpperCase() === sub.toUpperCase();\n }\n\n function addMatches(result, search, wordlist, formatter) {\n if (isArray(wordlist)) {\n for (var i = 0; i < wordlist.length; i++)\n if (match(search, wordlist[i])) result.push(formatter(wordlist[i]))\n } else {\n for (var word in wordlist) if (wordlist.hasOwnProperty(word)) {\n var val = wordlist[word]\n if (!val || val === true)\n val = word\n else\n val = val.displayText ? {text: val.text, displayText: val.displayText} : val.text\n if (match(search, val)) result.push(formatter(val))\n }\n }\n }\n\n function cleanName(name) {\n // Get rid name from identifierQuote and preceding dot(.)\n if (name.charAt(0) == \".\") {\n name = name.substr(1);\n }\n // replace doublicated identifierQuotes with single identifierQuotes\n // and remove single identifierQuotes\n var nameParts = name.split(identifierQuote+identifierQuote);\n for (var i = 0; i < nameParts.length; i++)\n nameParts[i] = nameParts[i].replace(new RegExp(identifierQuote,\"g\"), \"\");\n return nameParts.join(identifierQuote);\n }\n\n function insertIdentifierQuotes(name) {\n var nameParts = getText(name).split(\".\");\n for (var i = 0; i < nameParts.length; i++)\n nameParts[i] = identifierQuote +\n // doublicate identifierQuotes\n nameParts[i].replace(new RegExp(identifierQuote,\"g\"), identifierQuote+identifierQuote) +\n identifierQuote;\n var escaped = nameParts.join(\".\");\n if (typeof name == \"string\") return escaped;\n name = shallowClone(name);\n name.text = escaped;\n return name;\n }\n\n function nameCompletion(cur, token, result, editor) {\n // Try to complete table, column names and return start position of completion\n var useIdentifierQuotes = false;\n var nameParts = [];\n var start = token.start;\n var cont = true;\n while (cont) {\n cont = (token.string.charAt(0) == \".\");\n useIdentifierQuotes = useIdentifierQuotes || (token.string.charAt(0) == identifierQuote);\n\n start = token.start;\n nameParts.unshift(cleanName(token.string));\n\n token = editor.getTokenAt(Pos(cur.line, token.start));\n if (token.string == \".\") {\n cont = true;\n token = editor.getTokenAt(Pos(cur.line, token.start));\n }\n }\n\n // Try to complete table names\n var string = nameParts.join(\".\");\n addMatches(result, string, tables, function(w) {\n return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;\n });\n\n // Try to complete columns from defaultTable\n addMatches(result, string, defaultTable, function(w) {\n return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;\n });\n\n // Try to complete columns\n string = nameParts.pop();\n var table = nameParts.join(\".\");\n\n var alias = false;\n var aliasTable = table;\n // Check if table is available. If not, find table by Alias\n if (!getTable(table)) {\n var oldTable = table;\n table = findTableByAlias(table, editor);\n if (table !== oldTable) alias = true;\n }\n\n var columns = getTable(table);\n if (columns && columns.columns)\n columns = columns.columns;\n\n if (columns) {\n addMatches(result, string, columns, function(w) {\n var tableInsert = table;\n if (alias == true) tableInsert = aliasTable;\n if (typeof w == \"string\") {\n w = tableInsert + \".\" + w;\n } else {\n w = shallowClone(w);\n w.text = tableInsert + \".\" + w.text;\n }\n return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;\n });\n }\n\n return start;\n }\n\n function eachWord(lineText, f) {\n var words = lineText.split(/\\s+/)\n for (var i = 0; i < words.length; i++)\n if (words[i]) f(words[i].replace(/[,;]/g, ''))\n }\n\n function findTableByAlias(alias, editor) {\n var doc = editor.doc;\n var fullQuery = doc.getValue();\n var aliasUpperCase = alias.toUpperCase();\n var previousWord = \"\";\n var table = \"\";\n var separator = [];\n var validRange = {\n start: Pos(0, 0),\n end: Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).length)\n };\n\n //add separator\n var indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV);\n while(indexOfSeparator != -1) {\n separator.push(doc.posFromIndex(indexOfSeparator));\n indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV, indexOfSeparator+1);\n }\n separator.unshift(Pos(0, 0));\n separator.push(Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).text.length));\n\n //find valid range\n var prevItem = null;\n var current = editor.getCursor()\n for (var i = 0; i < separator.length; i++) {\n if ((prevItem == null || cmpPos(current, prevItem) > 0) && cmpPos(current, separator[i]) <= 0) {\n validRange = {start: prevItem, end: separator[i]};\n break;\n }\n prevItem = separator[i];\n }\n\n if (validRange.start) {\n var query = doc.getRange(validRange.start, validRange.end, false);\n\n for (var i = 0; i < query.length; i++) {\n var lineText = query[i];\n eachWord(lineText, function(word) {\n var wordUpperCase = word.toUpperCase();\n if (wordUpperCase === aliasUpperCase && getTable(previousWord))\n table = previousWord;\n if (wordUpperCase !== CONS.ALIAS_KEYWORD)\n previousWord = word;\n });\n if (table) break;\n }\n }\n return table;\n }\n\n CodeMirror.registerHelper(\"hint\", \"sql\", function(editor, options) {\n tables = parseTables(options && options.tables)\n var defaultTableName = options && options.defaultTable;\n var disableKeywords = options && options.disableKeywords;\n defaultTable = defaultTableName && getTable(defaultTableName);\n keywords = getKeywords(editor);\n identifierQuote = getIdentifierQuote(editor);\n\n if (defaultTableName && !defaultTable)\n defaultTable = findTableByAlias(defaultTableName, editor);\n\n defaultTable = defaultTable || [];\n\n if (defaultTable.columns)\n defaultTable = defaultTable.columns;\n\n var cur = editor.getCursor();\n var result = [];\n var token = editor.getTokenAt(cur), start, end, search;\n if (token.end > cur.ch) {\n token.end = cur.ch;\n token.string = token.string.slice(0, cur.ch - token.start);\n }\n\n if (token.string.match(/^[.`\"\\w@]\\w*$/)) {\n search = token.string;\n start = token.start;\n end = token.end;\n } else {\n start = end = cur.ch;\n search = \"\";\n }\n if (search.charAt(0) == \".\" || search.charAt(0) == identifierQuote) {\n start = nameCompletion(cur, token, result, editor);\n } else {\n var objectOrClass = function(w, className) {\n if (typeof w === \"object\") {\n w.className = className;\n } else {\n w = { text: w, className: className };\n }\n return w;\n };\n addMatches(result, search, defaultTable, function(w) {\n return objectOrClass(w, \"CodeMirror-hint-table CodeMirror-hint-default-table\");\n });\n addMatches(\n result,\n search,\n tables, function(w) {\n return objectOrClass(w, \"CodeMirror-hint-table\");\n }\n );\n if (!disableKeywords)\n addMatches(result, search, keywords, function(w) {\n return objectOrClass(w.toUpperCase(), \"CodeMirror-hint-keyword\");\n });\n }\n\n return {list: result, from: Pos(cur.line, start), to: Pos(cur.line, end)};\n });\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/addon/hint/sql-hint.js\n// module id = 726\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var Pos = CodeMirror.Pos;\n\n function matches(hint, typed, matchInMiddle) {\n if (matchInMiddle) return hint.indexOf(typed) >= 0;\n else return hint.lastIndexOf(typed, 0) == 0;\n }\n\n function getHints(cm, options) {\n var tags = options && options.schemaInfo;\n var quote = (options && options.quoteChar) || '\"';\n var matchInMiddle = options && options.matchInMiddle;\n if (!tags) return;\n var cur = cm.getCursor(), token = cm.getTokenAt(cur);\n if (token.end > cur.ch) {\n token.end = cur.ch;\n token.string = token.string.slice(0, cur.ch - token.start);\n }\n var inner = CodeMirror.innerMode(cm.getMode(), token.state);\n if (inner.mode.name != \"xml\") return;\n var result = [], replaceToken = false, prefix;\n var tag = /\\btag\\b/.test(token.type) && !/>$/.test(token.string);\n var tagName = tag && /^\\w/.test(token.string), tagStart;\n\n if (tagName) {\n var before = cm.getLine(cur.line).slice(Math.max(0, token.start - 2), token.start);\n var tagType = /<\\/$/.test(before) ? \"close\" : /<$/.test(before) ? \"open\" : null;\n if (tagType) tagStart = token.start - (tagType == \"close\" ? 2 : 1);\n } else if (tag && token.string == \"<\") {\n tagType = \"open\";\n } else if (tag && token.string == \"\");\n } else {\n // Attribute completion\n var curTag = tags[inner.state.tagName], attrs = curTag && curTag.attrs;\n var globalAttrs = tags[\"!attrs\"];\n if (!attrs && !globalAttrs) return;\n if (!attrs) {\n attrs = globalAttrs;\n } else if (globalAttrs) { // Combine tag-local and global attributes\n var set = {};\n for (var nm in globalAttrs) if (globalAttrs.hasOwnProperty(nm)) set[nm] = globalAttrs[nm];\n for (var nm in attrs) if (attrs.hasOwnProperty(nm)) set[nm] = attrs[nm];\n attrs = set;\n }\n if (token.type == \"string\" || token.string == \"=\") { // A value\n var before = cm.getRange(Pos(cur.line, Math.max(0, cur.ch - 60)),\n Pos(cur.line, token.type == \"string\" ? token.start : token.end));\n var atName = before.match(/([^\\s\\u00a0=<>\\\"\\']+)=$/), atValues;\n if (!atName || !attrs.hasOwnProperty(atName[1]) || !(atValues = attrs[atName[1]])) return;\n if (typeof atValues == 'function') atValues = atValues.call(this, cm); // Functions can be used to supply values for autocomplete widget\n if (token.type == \"string\") {\n prefix = token.string;\n var n = 0;\n if (/['\"]/.test(token.string.charAt(0))) {\n quote = token.string.charAt(0);\n prefix = token.string.slice(1);\n n++;\n }\n var len = token.string.length;\n if (/['\"]/.test(token.string.charAt(len - 1))) {\n quote = token.string.charAt(len - 1);\n prefix = token.string.substr(n, len - 2);\n }\n replaceToken = true;\n }\n for (var i = 0; i < atValues.length; ++i) if (!prefix || matches(atValues[i], prefix, matchInMiddle))\n result.push(quote + atValues[i] + quote);\n } else { // An attribute name\n if (token.type == \"attribute\") {\n prefix = token.string;\n replaceToken = true;\n }\n for (var attr in attrs) if (attrs.hasOwnProperty(attr) && (!prefix || matches(attr, prefix, matchInMiddle)))\n result.push(attr);\n }\n }\n return {\n list: result,\n from: replaceToken ? Pos(cur.line, tagStart == null ? token.start : tagStart) : cur,\n to: replaceToken ? Pos(cur.line, token.end) : cur\n };\n }\n\n CodeMirror.registerHelper(\"hint\", \"xml\", getHints);\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/addon/hint/xml-hint.js\n// module id = 727\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n function wordRegexp(words) {\n return new RegExp(\"^((\" + words.join(\")|(\") + \"))\\\\b\");\n }\n\n var wordOperators = wordRegexp([\"and\", \"or\", \"not\", \"is\"]);\n var commonKeywords = [\"as\", \"assert\", \"break\", \"class\", \"continue\",\n \"def\", \"del\", \"elif\", \"else\", \"except\", \"finally\",\n \"for\", \"from\", \"global\", \"if\", \"import\",\n \"lambda\", \"pass\", \"raise\", \"return\",\n \"try\", \"while\", \"with\", \"yield\", \"in\"];\n var commonBuiltins = [\"abs\", \"all\", \"any\", \"bin\", \"bool\", \"bytearray\", \"callable\", \"chr\",\n \"classmethod\", \"compile\", \"complex\", \"delattr\", \"dict\", \"dir\", \"divmod\",\n \"enumerate\", \"eval\", \"filter\", \"float\", \"format\", \"frozenset\",\n \"getattr\", \"globals\", \"hasattr\", \"hash\", \"help\", \"hex\", \"id\",\n \"input\", \"int\", \"isinstance\", \"issubclass\", \"iter\", \"len\",\n \"list\", \"locals\", \"map\", \"max\", \"memoryview\", \"min\", \"next\",\n \"object\", \"oct\", \"open\", \"ord\", \"pow\", \"property\", \"range\",\n \"repr\", \"reversed\", \"round\", \"set\", \"setattr\", \"slice\",\n \"sorted\", \"staticmethod\", \"str\", \"sum\", \"super\", \"tuple\",\n \"type\", \"vars\", \"zip\", \"__import__\", \"NotImplemented\",\n \"Ellipsis\", \"__debug__\"];\n CodeMirror.registerHelper(\"hintWords\", \"python\", commonKeywords.concat(commonBuiltins));\n\n function top(state) {\n return state.scopes[state.scopes.length - 1];\n }\n\n CodeMirror.defineMode(\"python\", function(conf, parserConf) {\n var ERRORCLASS = \"error\";\n\n var delimiters = parserConf.delimiters || parserConf.singleDelimiters || /^[\\(\\)\\[\\]\\{\\}@,:`=;\\.\\\\]/;\n // (Backwards-compatiblity with old, cumbersome config system)\n var operators = [parserConf.singleOperators, parserConf.doubleOperators, parserConf.doubleDelimiters, parserConf.tripleDelimiters,\n parserConf.operators || /^([-+*/%\\/&|^]=?|[<>=]+|\\/\\/=?|\\*\\*=?|!=|[~!@])/]\n for (var i = 0; i < operators.length; i++) if (!operators[i]) operators.splice(i--, 1)\n\n var hangingIndent = parserConf.hangingIndent || conf.indentUnit;\n\n var myKeywords = commonKeywords, myBuiltins = commonBuiltins;\n if (parserConf.extra_keywords != undefined)\n myKeywords = myKeywords.concat(parserConf.extra_keywords);\n\n if (parserConf.extra_builtins != undefined)\n myBuiltins = myBuiltins.concat(parserConf.extra_builtins);\n\n var py3 = !(parserConf.version && Number(parserConf.version) < 3)\n if (py3) {\n // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator\n var identifiers = parserConf.identifiers|| /^[_A-Za-z\\u00A1-\\uFFFF][_A-Za-z0-9\\u00A1-\\uFFFF]*/;\n myKeywords = myKeywords.concat([\"nonlocal\", \"False\", \"True\", \"None\", \"async\", \"await\"]);\n myBuiltins = myBuiltins.concat([\"ascii\", \"bytes\", \"exec\", \"print\"]);\n var stringPrefixes = new RegExp(\"^(([rbuf]|(br)|(fr))?('{3}|\\\"{3}|['\\\"]))\", \"i\");\n } else {\n var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/;\n myKeywords = myKeywords.concat([\"exec\", \"print\"]);\n myBuiltins = myBuiltins.concat([\"apply\", \"basestring\", \"buffer\", \"cmp\", \"coerce\", \"execfile\",\n \"file\", \"intern\", \"long\", \"raw_input\", \"reduce\", \"reload\",\n \"unichr\", \"unicode\", \"xrange\", \"False\", \"True\", \"None\"]);\n var stringPrefixes = new RegExp(\"^(([rubf]|(ur)|(br))?('{3}|\\\"{3}|['\\\"]))\", \"i\");\n }\n var keywords = wordRegexp(myKeywords);\n var builtins = wordRegexp(myBuiltins);\n\n // tokenizers\n function tokenBase(stream, state) {\n var sol = stream.sol() && state.lastToken != \"\\\\\"\n if (sol) state.indent = stream.indentation()\n // Handle scope changes\n if (sol && top(state).type == \"py\") {\n var scopeOffset = top(state).offset;\n if (stream.eatSpace()) {\n var lineOffset = stream.indentation();\n if (lineOffset > scopeOffset)\n pushPyScope(state);\n else if (lineOffset < scopeOffset && dedent(stream, state) && stream.peek() != \"#\")\n state.errorToken = true;\n return null;\n } else {\n var style = tokenBaseInner(stream, state);\n if (scopeOffset > 0 && dedent(stream, state))\n style += \" \" + ERRORCLASS;\n return style;\n }\n }\n return tokenBaseInner(stream, state);\n }\n\n function tokenBaseInner(stream, state) {\n if (stream.eatSpace()) return null;\n\n // Handle Comments\n if (stream.match(/^#.*/)) return \"comment\";\n\n // Handle Number Literals\n if (stream.match(/^[0-9\\.]/, false)) {\n var floatLiteral = false;\n // Floats\n if (stream.match(/^[\\d_]*\\.\\d+(e[\\+\\-]?\\d+)?/i)) { floatLiteral = true; }\n if (stream.match(/^[\\d_]+\\.\\d*/)) { floatLiteral = true; }\n if (stream.match(/^\\.\\d+/)) { floatLiteral = true; }\n if (floatLiteral) {\n // Float literals may be \"imaginary\"\n stream.eat(/J/i);\n return \"number\";\n }\n // Integers\n var intLiteral = false;\n // Hex\n if (stream.match(/^0x[0-9a-f_]+/i)) intLiteral = true;\n // Binary\n if (stream.match(/^0b[01_]+/i)) intLiteral = true;\n // Octal\n if (stream.match(/^0o[0-7_]+/i)) intLiteral = true;\n // Decimal\n if (stream.match(/^[1-9][\\d_]*(e[\\+\\-]?[\\d_]+)?/)) {\n // Decimal literals may be \"imaginary\"\n stream.eat(/J/i);\n // TODO - Can you have imaginary longs?\n intLiteral = true;\n }\n // Zero by itself with no other piece of number.\n if (stream.match(/^0(?![\\dx])/i)) intLiteral = true;\n if (intLiteral) {\n // Integer literals may be \"long\"\n stream.eat(/L/i);\n return \"number\";\n }\n }\n\n // Handle Strings\n if (stream.match(stringPrefixes)) {\n var isFmtString = stream.current().toLowerCase().indexOf('f') !== -1;\n if (!isFmtString) {\n state.tokenize = tokenStringFactory(stream.current(), state.tokenize);\n return state.tokenize(stream, state);\n } else {\n state.tokenize = formatStringFactory(stream.current(), state.tokenize);\n return state.tokenize(stream, state);\n }\n }\n\n for (var i = 0; i < operators.length; i++)\n if (stream.match(operators[i])) return \"operator\"\n\n if (stream.match(delimiters)) return \"punctuation\";\n\n if (state.lastToken == \".\" && stream.match(identifiers))\n return \"property\";\n\n if (stream.match(keywords) || stream.match(wordOperators))\n return \"keyword\";\n\n if (stream.match(builtins))\n return \"builtin\";\n\n if (stream.match(/^(self|cls)\\b/))\n return \"variable-2\";\n\n if (stream.match(identifiers)) {\n if (state.lastToken == \"def\" || state.lastToken == \"class\")\n return \"def\";\n return \"variable\";\n }\n\n // Handle non-detected items\n stream.next();\n return ERRORCLASS;\n }\n\n function formatStringFactory(delimiter, tokenOuter) {\n while (\"rubf\".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)\n delimiter = delimiter.substr(1);\n\n var singleline = delimiter.length == 1;\n var OUTCLASS = \"string\";\n\n function tokenNestedExpr(depth) {\n return function(stream, state) {\n var inner = tokenBaseInner(stream, state)\n if (inner == \"punctuation\") {\n if (stream.current() == \"{\") {\n state.tokenize = tokenNestedExpr(depth + 1)\n } else if (stream.current() == \"}\") {\n if (depth > 1) state.tokenize = tokenNestedExpr(depth - 1)\n else state.tokenize = tokenString\n }\n }\n return inner\n }\n }\n\n function tokenString(stream, state) {\n while (!stream.eol()) {\n stream.eatWhile(/[^'\"\\{\\}\\\\]/);\n if (stream.eat(\"\\\\\")) {\n stream.next();\n if (singleline && stream.eol())\n return OUTCLASS;\n } else if (stream.match(delimiter)) {\n state.tokenize = tokenOuter;\n return OUTCLASS;\n } else if (stream.match('{{')) {\n // ignore {{ in f-str\n return OUTCLASS;\n } else if (stream.match('{', false)) {\n // switch to nested mode\n state.tokenize = tokenNestedExpr(0)\n if (stream.current()) return OUTCLASS;\n else return state.tokenize(stream, state)\n } else if (stream.match('}}')) {\n return OUTCLASS;\n } else if (stream.match('}')) {\n // single } in f-string is an error\n return ERRORCLASS;\n } else {\n stream.eat(/['\"]/);\n }\n }\n if (singleline) {\n if (parserConf.singleLineStringErrors)\n return ERRORCLASS;\n else\n state.tokenize = tokenOuter;\n }\n return OUTCLASS;\n }\n tokenString.isString = true;\n return tokenString;\n }\n\n function tokenStringFactory(delimiter, tokenOuter) {\n while (\"rubf\".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)\n delimiter = delimiter.substr(1);\n\n var singleline = delimiter.length == 1;\n var OUTCLASS = \"string\";\n\n function tokenString(stream, state) {\n while (!stream.eol()) {\n stream.eatWhile(/[^'\"\\\\]/);\n if (stream.eat(\"\\\\\")) {\n stream.next();\n if (singleline && stream.eol())\n return OUTCLASS;\n } else if (stream.match(delimiter)) {\n state.tokenize = tokenOuter;\n return OUTCLASS;\n } else {\n stream.eat(/['\"]/);\n }\n }\n if (singleline) {\n if (parserConf.singleLineStringErrors)\n return ERRORCLASS;\n else\n state.tokenize = tokenOuter;\n }\n return OUTCLASS;\n }\n tokenString.isString = true;\n return tokenString;\n }\n\n function pushPyScope(state) {\n while (top(state).type != \"py\") state.scopes.pop()\n state.scopes.push({offset: top(state).offset + conf.indentUnit,\n type: \"py\",\n align: null})\n }\n\n function pushBracketScope(stream, state, type) {\n var align = stream.match(/^([\\s\\[\\{\\(]|#.*)*$/, false) ? null : stream.column() + 1\n state.scopes.push({offset: state.indent + hangingIndent,\n type: type,\n align: align})\n }\n\n function dedent(stream, state) {\n var indented = stream.indentation();\n while (state.scopes.length > 1 && top(state).offset > indented) {\n if (top(state).type != \"py\") return true;\n state.scopes.pop();\n }\n return top(state).offset != indented;\n }\n\n function tokenLexer(stream, state) {\n if (stream.sol()) state.beginningOfLine = true;\n\n var style = state.tokenize(stream, state);\n var current = stream.current();\n\n // Handle decorators\n if (state.beginningOfLine && current == \"@\")\n return stream.match(identifiers, false) ? \"meta\" : py3 ? \"operator\" : ERRORCLASS;\n\n if (/\\S/.test(current)) state.beginningOfLine = false;\n\n if ((style == \"variable\" || style == \"builtin\")\n && state.lastToken == \"meta\")\n style = \"meta\";\n\n // Handle scope changes.\n if (current == \"pass\" || current == \"return\")\n state.dedent += 1;\n\n if (current == \"lambda\") state.lambda = true;\n if (current == \":\" && !state.lambda && top(state).type == \"py\")\n pushPyScope(state);\n\n if (current.length == 1 && !/string|comment/.test(style)) {\n var delimiter_index = \"[({\".indexOf(current);\n if (delimiter_index != -1)\n pushBracketScope(stream, state, \"])}\".slice(delimiter_index, delimiter_index+1));\n\n delimiter_index = \"])}\".indexOf(current);\n if (delimiter_index != -1) {\n if (top(state).type == current) state.indent = state.scopes.pop().offset - hangingIndent\n else return ERRORCLASS;\n }\n }\n if (state.dedent > 0 && stream.eol() && top(state).type == \"py\") {\n if (state.scopes.length > 1) state.scopes.pop();\n state.dedent -= 1;\n }\n\n return style;\n }\n\n var external = {\n startState: function(basecolumn) {\n return {\n tokenize: tokenBase,\n scopes: [{offset: basecolumn || 0, type: \"py\", align: null}],\n indent: basecolumn || 0,\n lastToken: null,\n lambda: false,\n dedent: 0\n };\n },\n\n token: function(stream, state) {\n var addErr = state.errorToken;\n if (addErr) state.errorToken = false;\n var style = tokenLexer(stream, state);\n\n if (style && style != \"comment\")\n state.lastToken = (style == \"keyword\" || style == \"punctuation\") ? stream.current() : style;\n if (style == \"punctuation\") style = null;\n\n if (stream.eol() && state.lambda)\n state.lambda = false;\n return addErr ? style + \" \" + ERRORCLASS : style;\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize != tokenBase)\n return state.tokenize.isString ? CodeMirror.Pass : 0;\n\n var scope = top(state), closing = scope.type == textAfter.charAt(0)\n if (scope.align != null)\n return scope.align - (closing ? 1 : 0)\n else\n return scope.offset - (closing ? hangingIndent : 0)\n },\n\n electricInput: /^\\s*[\\}\\]\\)]$/,\n closeBrackets: {triples: \"'\\\"\"},\n lineComment: \"#\",\n fold: \"indent\"\n };\n return external;\n });\n\n CodeMirror.defineMIME(\"text/x-python\", \"python\");\n\n var words = function(str) { return str.split(\" \"); };\n\n CodeMirror.defineMIME(\"text/x-cython\", {\n name: \"python\",\n extra_keywords: words(\"by cdef cimport cpdef ctypedef enum except \"+\n \"extern gil include nogil property public \"+\n \"readonly struct union DEF IF ELIF ELSE\")\n });\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/python/python.js\n// module id = 728\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nvar htmlConfig = {\n autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,\n 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,\n 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,\n 'track': true, 'wbr': true, 'menuitem': true},\n implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,\n 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,\n 'th': true, 'tr': true},\n contextGrabbers: {\n 'dd': {'dd': true, 'dt': true},\n 'dt': {'dd': true, 'dt': true},\n 'li': {'li': true},\n 'option': {'option': true, 'optgroup': true},\n 'optgroup': {'optgroup': true},\n 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,\n 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,\n 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,\n 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,\n 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},\n 'rp': {'rp': true, 'rt': true},\n 'rt': {'rp': true, 'rt': true},\n 'tbody': {'tbody': true, 'tfoot': true},\n 'td': {'td': true, 'th': true},\n 'tfoot': {'tbody': true},\n 'th': {'td': true, 'th': true},\n 'thead': {'tbody': true, 'tfoot': true},\n 'tr': {'tr': true}\n },\n doNotIndent: {\"pre\": true},\n allowUnquoted: true,\n allowMissing: true,\n caseFold: true\n}\n\nvar xmlConfig = {\n autoSelfClosers: {},\n implicitlyClosed: {},\n contextGrabbers: {},\n doNotIndent: {},\n allowUnquoted: false,\n allowMissing: false,\n allowMissingTagName: false,\n caseFold: false\n}\n\nCodeMirror.defineMode(\"xml\", function(editorConf, config_) {\n var indentUnit = editorConf.indentUnit\n var config = {}\n var defaults = config_.htmlMode ? htmlConfig : xmlConfig\n for (var prop in defaults) config[prop] = defaults[prop]\n for (var prop in config_) config[prop] = config_[prop]\n\n // Return variables for tokenizers\n var type, setStyle;\n\n function inText(stream, state) {\n function chain(parser) {\n state.tokenize = parser;\n return parser(stream, state);\n }\n\n var ch = stream.next();\n if (ch == \"<\") {\n if (stream.eat(\"!\")) {\n if (stream.eat(\"[\")) {\n if (stream.match(\"CDATA[\")) return chain(inBlock(\"atom\", \"]]>\"));\n else return null;\n } else if (stream.match(\"--\")) {\n return chain(inBlock(\"comment\", \"-->\"));\n } else if (stream.match(\"DOCTYPE\", true, true)) {\n stream.eatWhile(/[\\w\\._\\-]/);\n return chain(doctype(1));\n } else {\n return null;\n }\n } else if (stream.eat(\"?\")) {\n stream.eatWhile(/[\\w\\._\\-]/);\n state.tokenize = inBlock(\"meta\", \"?>\");\n return \"meta\";\n } else {\n type = stream.eat(\"/\") ? \"closeTag\" : \"openTag\";\n state.tokenize = inTag;\n return \"tag bracket\";\n }\n } else if (ch == \"&\") {\n var ok;\n if (stream.eat(\"#\")) {\n if (stream.eat(\"x\")) {\n ok = stream.eatWhile(/[a-fA-F\\d]/) && stream.eat(\";\");\n } else {\n ok = stream.eatWhile(/[\\d]/) && stream.eat(\";\");\n }\n } else {\n ok = stream.eatWhile(/[\\w\\.\\-:]/) && stream.eat(\";\");\n }\n return ok ? \"atom\" : \"error\";\n } else {\n stream.eatWhile(/[^&<]/);\n return null;\n }\n }\n inText.isInText = true;\n\n function inTag(stream, state) {\n var ch = stream.next();\n if (ch == \">\" || (ch == \"/\" && stream.eat(\">\"))) {\n state.tokenize = inText;\n type = ch == \">\" ? \"endTag\" : \"selfcloseTag\";\n return \"tag bracket\";\n } else if (ch == \"=\") {\n type = \"equals\";\n return null;\n } else if (ch == \"<\") {\n state.tokenize = inText;\n state.state = baseState;\n state.tagName = state.tagStart = null;\n var next = state.tokenize(stream, state);\n return next ? next + \" tag error\" : \"tag error\";\n } else if (/[\\'\\\"]/.test(ch)) {\n state.tokenize = inAttribute(ch);\n state.stringStartCol = stream.column();\n return state.tokenize(stream, state);\n } else {\n stream.match(/^[^\\s\\u00a0=<>\\\"\\']*[^\\s\\u00a0=<>\\\"\\'\\/]/);\n return \"word\";\n }\n }\n\n function inAttribute(quote) {\n var closure = function(stream, state) {\n while (!stream.eol()) {\n if (stream.next() == quote) {\n state.tokenize = inTag;\n break;\n }\n }\n return \"string\";\n };\n closure.isInAttribute = true;\n return closure;\n }\n\n function inBlock(style, terminator) {\n return function(stream, state) {\n while (!stream.eol()) {\n if (stream.match(terminator)) {\n state.tokenize = inText;\n break;\n }\n stream.next();\n }\n return style;\n }\n }\n\n function doctype(depth) {\n return function(stream, state) {\n var ch;\n while ((ch = stream.next()) != null) {\n if (ch == \"<\") {\n state.tokenize = doctype(depth + 1);\n return state.tokenize(stream, state);\n } else if (ch == \">\") {\n if (depth == 1) {\n state.tokenize = inText;\n break;\n } else {\n state.tokenize = doctype(depth - 1);\n return state.tokenize(stream, state);\n }\n }\n }\n return \"meta\";\n };\n }\n\n function Context(state, tagName, startOfLine) {\n this.prev = state.context;\n this.tagName = tagName;\n this.indent = state.indented;\n this.startOfLine = startOfLine;\n if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))\n this.noIndent = true;\n }\n function popContext(state) {\n if (state.context) state.context = state.context.prev;\n }\n function maybePopContext(state, nextTagName) {\n var parentTagName;\n while (true) {\n if (!state.context) {\n return;\n }\n parentTagName = state.context.tagName;\n if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||\n !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {\n return;\n }\n popContext(state);\n }\n }\n\n function baseState(type, stream, state) {\n if (type == \"openTag\") {\n state.tagStart = stream.column();\n return tagNameState;\n } else if (type == \"closeTag\") {\n return closeTagNameState;\n } else {\n return baseState;\n }\n }\n function tagNameState(type, stream, state) {\n if (type == \"word\") {\n state.tagName = stream.current();\n setStyle = \"tag\";\n return attrState;\n } else if (config.allowMissingTagName && type == \"endTag\") {\n setStyle = \"tag bracket\";\n return attrState(type, stream, state);\n } else {\n setStyle = \"error\";\n return tagNameState;\n }\n }\n function closeTagNameState(type, stream, state) {\n if (type == \"word\") {\n var tagName = stream.current();\n if (state.context && state.context.tagName != tagName &&\n config.implicitlyClosed.hasOwnProperty(state.context.tagName))\n popContext(state);\n if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {\n setStyle = \"tag\";\n return closeState;\n } else {\n setStyle = \"tag error\";\n return closeStateErr;\n }\n } else if (config.allowMissingTagName && type == \"endTag\") {\n setStyle = \"tag bracket\";\n return closeState(type, stream, state);\n } else {\n setStyle = \"error\";\n return closeStateErr;\n }\n }\n\n function closeState(type, _stream, state) {\n if (type != \"endTag\") {\n setStyle = \"error\";\n return closeState;\n }\n popContext(state);\n return baseState;\n }\n function closeStateErr(type, stream, state) {\n setStyle = \"error\";\n return closeState(type, stream, state);\n }\n\n function attrState(type, _stream, state) {\n if (type == \"word\") {\n setStyle = \"attribute\";\n return attrEqState;\n } else if (type == \"endTag\" || type == \"selfcloseTag\") {\n var tagName = state.tagName, tagStart = state.tagStart;\n state.tagName = state.tagStart = null;\n if (type == \"selfcloseTag\" ||\n config.autoSelfClosers.hasOwnProperty(tagName)) {\n maybePopContext(state, tagName);\n } else {\n maybePopContext(state, tagName);\n state.context = new Context(state, tagName, tagStart == state.indented);\n }\n return baseState;\n }\n setStyle = \"error\";\n return attrState;\n }\n function attrEqState(type, stream, state) {\n if (type == \"equals\") return attrValueState;\n if (!config.allowMissing) setStyle = \"error\";\n return attrState(type, stream, state);\n }\n function attrValueState(type, stream, state) {\n if (type == \"string\") return attrContinuedState;\n if (type == \"word\" && config.allowUnquoted) {setStyle = \"string\"; return attrState;}\n setStyle = \"error\";\n return attrState(type, stream, state);\n }\n function attrContinuedState(type, stream, state) {\n if (type == \"string\") return attrContinuedState;\n return attrState(type, stream, state);\n }\n\n return {\n startState: function(baseIndent) {\n var state = {tokenize: inText,\n state: baseState,\n indented: baseIndent || 0,\n tagName: null, tagStart: null,\n context: null}\n if (baseIndent != null) state.baseIndent = baseIndent\n return state\n },\n\n token: function(stream, state) {\n if (!state.tagName && stream.sol())\n state.indented = stream.indentation();\n\n if (stream.eatSpace()) return null;\n type = null;\n var style = state.tokenize(stream, state);\n if ((style || type) && style != \"comment\") {\n setStyle = null;\n state.state = state.state(type || style, stream, state);\n if (setStyle)\n style = setStyle == \"error\" ? style + \" error\" : setStyle;\n }\n return style;\n },\n\n indent: function(state, textAfter, fullLine) {\n var context = state.context;\n // Indent multi-line strings (e.g. css).\n if (state.tokenize.isInAttribute) {\n if (state.tagStart == state.indented)\n return state.stringStartCol + 1;\n else\n return state.indented + indentUnit;\n }\n if (context && context.noIndent) return CodeMirror.Pass;\n if (state.tokenize != inTag && state.tokenize != inText)\n return fullLine ? fullLine.match(/^(\\s*)/)[0].length : 0;\n // Indent the starts of attribute names.\n if (state.tagName) {\n if (config.multilineTagIndentPastTag !== false)\n return state.tagStart + state.tagName.length + 2;\n else\n return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);\n }\n if (config.alignCDATA && /$/,\n blockCommentStart: \"\",\n\n configuration: config.htmlMode ? \"html\" : \"xml\",\n helperType: config.htmlMode ? \"html\" : \"xml\",\n\n skipAttribute: function(state) {\n if (state.state == attrValueState)\n state.state = attrState\n }\n };\n});\n\nCodeMirror.defineMIME(\"text/xml\", \"xml\");\nCodeMirror.defineMIME(\"application/xml\", \"xml\");\nif (!CodeMirror.mimeModes.hasOwnProperty(\"text/html\"))\n CodeMirror.defineMIME(\"text/html\", {name: \"xml\", htmlMode: true});\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/xml/xml.js\n// module id = 729\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") { // CommonJS\n mod(require(\"../../lib/codemirror\"));\n } else if (typeof define == \"function\" && define.amd) { // AMD\n define([\"../../lib/codemirror\"], mod);\n } else { // Plain browser env\n mod(CodeMirror);\n }\n})(function(CodeMirror) {\n \"use strict\";\n\n var TOKEN_STYLES = {\n addition: \"positive\",\n attributes: \"attribute\",\n bold: \"strong\",\n cite: \"keyword\",\n code: \"atom\",\n definitionList: \"number\",\n deletion: \"negative\",\n div: \"punctuation\",\n em: \"em\",\n footnote: \"variable\",\n footCite: \"qualifier\",\n header: \"header\",\n html: \"comment\",\n image: \"string\",\n italic: \"em\",\n link: \"link\",\n linkDefinition: \"link\",\n list1: \"variable-2\",\n list2: \"variable-3\",\n list3: \"keyword\",\n notextile: \"string-2\",\n pre: \"operator\",\n p: \"property\",\n quote: \"bracket\",\n span: \"quote\",\n specialChar: \"tag\",\n strong: \"strong\",\n sub: \"builtin\",\n sup: \"builtin\",\n table: \"variable-3\",\n tableHeading: \"operator\"\n };\n\n function startNewLine(stream, state) {\n state.mode = Modes.newLayout;\n state.tableHeading = false;\n\n if (state.layoutType === \"definitionList\" && state.spanningLayout &&\n stream.match(RE(\"definitionListEnd\"), false))\n state.spanningLayout = false;\n }\n\n function handlePhraseModifier(stream, state, ch) {\n if (ch === \"_\") {\n if (stream.eat(\"_\"))\n return togglePhraseModifier(stream, state, \"italic\", /__/, 2);\n else\n return togglePhraseModifier(stream, state, \"em\", /_/, 1);\n }\n\n if (ch === \"*\") {\n if (stream.eat(\"*\")) {\n return togglePhraseModifier(stream, state, \"bold\", /\\*\\*/, 2);\n }\n return togglePhraseModifier(stream, state, \"strong\", /\\*/, 1);\n }\n\n if (ch === \"[\") {\n if (stream.match(/\\d+\\]/)) state.footCite = true;\n return tokenStyles(state);\n }\n\n if (ch === \"(\") {\n var spec = stream.match(/^(r|tm|c)\\)/);\n if (spec)\n return tokenStylesWith(state, TOKEN_STYLES.specialChar);\n }\n\n if (ch === \"<\" && stream.match(/(\\w+)[^>]+>[^<]+<\\/\\1>/))\n return tokenStylesWith(state, TOKEN_STYLES.html);\n\n if (ch === \"?\" && stream.eat(\"?\"))\n return togglePhraseModifier(stream, state, \"cite\", /\\?\\?/, 2);\n\n if (ch === \"=\" && stream.eat(\"=\"))\n return togglePhraseModifier(stream, state, \"notextile\", /==/, 2);\n\n if (ch === \"-\" && !stream.eat(\"-\"))\n return togglePhraseModifier(stream, state, \"deletion\", /-/, 1);\n\n if (ch === \"+\")\n return togglePhraseModifier(stream, state, \"addition\", /\\+/, 1);\n\n if (ch === \"~\")\n return togglePhraseModifier(stream, state, \"sub\", /~/, 1);\n\n if (ch === \"^\")\n return togglePhraseModifier(stream, state, \"sup\", /\\^/, 1);\n\n if (ch === \"%\")\n return togglePhraseModifier(stream, state, \"span\", /%/, 1);\n\n if (ch === \"@\")\n return togglePhraseModifier(stream, state, \"code\", /@/, 1);\n\n if (ch === \"!\") {\n var type = togglePhraseModifier(stream, state, \"image\", /(?:\\([^\\)]+\\))?!/, 1);\n stream.match(/^:\\S+/); // optional Url portion\n return type;\n }\n return tokenStyles(state);\n }\n\n function togglePhraseModifier(stream, state, phraseModifier, closeRE, openSize) {\n var charBefore = stream.pos > openSize ? stream.string.charAt(stream.pos - openSize - 1) : null;\n var charAfter = stream.peek();\n if (state[phraseModifier]) {\n if ((!charAfter || /\\W/.test(charAfter)) && charBefore && /\\S/.test(charBefore)) {\n var type = tokenStyles(state);\n state[phraseModifier] = false;\n return type;\n }\n } else if ((!charBefore || /\\W/.test(charBefore)) && charAfter && /\\S/.test(charAfter) &&\n stream.match(new RegExp(\"^.*\\\\S\" + closeRE.source + \"(?:\\\\W|$)\"), false)) {\n state[phraseModifier] = true;\n state.mode = Modes.attributes;\n }\n return tokenStyles(state);\n };\n\n function tokenStyles(state) {\n var disabled = textileDisabled(state);\n if (disabled) return disabled;\n\n var styles = [];\n if (state.layoutType) styles.push(TOKEN_STYLES[state.layoutType]);\n\n styles = styles.concat(activeStyles(\n state, \"addition\", \"bold\", \"cite\", \"code\", \"deletion\", \"em\", \"footCite\",\n \"image\", \"italic\", \"link\", \"span\", \"strong\", \"sub\", \"sup\", \"table\", \"tableHeading\"));\n\n if (state.layoutType === \"header\")\n styles.push(TOKEN_STYLES.header + \"-\" + state.header);\n\n return styles.length ? styles.join(\" \") : null;\n }\n\n function textileDisabled(state) {\n var type = state.layoutType;\n\n switch(type) {\n case \"notextile\":\n case \"code\":\n case \"pre\":\n return TOKEN_STYLES[type];\n default:\n if (state.notextile)\n return TOKEN_STYLES.notextile + (type ? (\" \" + TOKEN_STYLES[type]) : \"\");\n return null;\n }\n }\n\n function tokenStylesWith(state, extraStyles) {\n var disabled = textileDisabled(state);\n if (disabled) return disabled;\n\n var type = tokenStyles(state);\n if (extraStyles)\n return type ? (type + \" \" + extraStyles) : extraStyles;\n else\n return type;\n }\n\n function activeStyles(state) {\n var styles = [];\n for (var i = 1; i < arguments.length; ++i) {\n if (state[arguments[i]])\n styles.push(TOKEN_STYLES[arguments[i]]);\n }\n return styles;\n }\n\n function blankLine(state) {\n var spanningLayout = state.spanningLayout, type = state.layoutType;\n\n for (var key in state) if (state.hasOwnProperty(key))\n delete state[key];\n\n state.mode = Modes.newLayout;\n if (spanningLayout) {\n state.layoutType = type;\n state.spanningLayout = true;\n }\n }\n\n var REs = {\n cache: {},\n single: {\n bc: \"bc\",\n bq: \"bq\",\n definitionList: /- .*?:=+/,\n definitionListEnd: /.*=:\\s*$/,\n div: \"div\",\n drawTable: /\\|.*\\|/,\n foot: /fn\\d+/,\n header: /h[1-6]/,\n html: /\\s*<(?:\\/)?(\\w+)(?:[^>]+)?>(?:[^<]+<\\/\\1>)?/,\n link: /[^\"]+\":\\S/,\n linkDefinition: /\\[[^\\s\\]]+\\]\\S+/,\n list: /(?:#+|\\*+)/,\n notextile: \"notextile\",\n para: \"p\",\n pre: \"pre\",\n table: \"table\",\n tableCellAttributes: /[\\/\\\\]\\d+/,\n tableHeading: /\\|_\\./,\n tableText: /[^\"_\\*\\[\\(\\?\\+~\\^%@|-]+/,\n text: /[^!\"_=\\*\\[\\(<\\?\\+~\\^%@-]+/\n },\n attributes: {\n align: /(?:<>|<|>|=)/,\n selector: /\\([^\\(][^\\)]+\\)/,\n lang: /\\[[^\\[\\]]+\\]/,\n pad: /(?:\\(+|\\)+){1,2}/,\n css: /\\{[^\\}]+\\}/\n },\n createRe: function(name) {\n switch (name) {\n case \"drawTable\":\n return REs.makeRe(\"^\", REs.single.drawTable, \"$\");\n case \"html\":\n return REs.makeRe(\"^\", REs.single.html, \"(?:\", REs.single.html, \")*\", \"$\");\n case \"linkDefinition\":\n return REs.makeRe(\"^\", REs.single.linkDefinition, \"$\");\n case \"listLayout\":\n return REs.makeRe(\"^\", REs.single.list, RE(\"allAttributes\"), \"*\\\\s+\");\n case \"tableCellAttributes\":\n return REs.makeRe(\"^\", REs.choiceRe(REs.single.tableCellAttributes,\n RE(\"allAttributes\")), \"+\\\\.\");\n case \"type\":\n return REs.makeRe(\"^\", RE(\"allTypes\"));\n case \"typeLayout\":\n return REs.makeRe(\"^\", RE(\"allTypes\"), RE(\"allAttributes\"),\n \"*\\\\.\\\\.?\", \"(\\\\s+|$)\");\n case \"attributes\":\n return REs.makeRe(\"^\", RE(\"allAttributes\"), \"+\");\n\n case \"allTypes\":\n return REs.choiceRe(REs.single.div, REs.single.foot,\n REs.single.header, REs.single.bc, REs.single.bq,\n REs.single.notextile, REs.single.pre, REs.single.table,\n REs.single.para);\n\n case \"allAttributes\":\n return REs.choiceRe(REs.attributes.selector, REs.attributes.css,\n REs.attributes.lang, REs.attributes.align, REs.attributes.pad);\n\n default:\n return REs.makeRe(\"^\", REs.single[name]);\n }\n },\n makeRe: function() {\n var pattern = \"\";\n for (var i = 0; i < arguments.length; ++i) {\n var arg = arguments[i];\n pattern += (typeof arg === \"string\") ? arg : arg.source;\n }\n return new RegExp(pattern);\n },\n choiceRe: function() {\n var parts = [arguments[0]];\n for (var i = 1; i < arguments.length; ++i) {\n parts[i * 2 - 1] = \"|\";\n parts[i * 2] = arguments[i];\n }\n\n parts.unshift(\"(?:\");\n parts.push(\")\");\n return REs.makeRe.apply(null, parts);\n }\n };\n\n function RE(name) {\n return (REs.cache[name] || (REs.cache[name] = REs.createRe(name)));\n }\n\n var Modes = {\n newLayout: function(stream, state) {\n if (stream.match(RE(\"typeLayout\"), false)) {\n state.spanningLayout = false;\n return (state.mode = Modes.blockType)(stream, state);\n }\n var newMode;\n if (!textileDisabled(state)) {\n if (stream.match(RE(\"listLayout\"), false))\n newMode = Modes.list;\n else if (stream.match(RE(\"drawTable\"), false))\n newMode = Modes.table;\n else if (stream.match(RE(\"linkDefinition\"), false))\n newMode = Modes.linkDefinition;\n else if (stream.match(RE(\"definitionList\")))\n newMode = Modes.definitionList;\n else if (stream.match(RE(\"html\"), false))\n newMode = Modes.html;\n }\n return (state.mode = (newMode || Modes.text))(stream, state);\n },\n\n blockType: function(stream, state) {\n var match, type;\n state.layoutType = null;\n\n if (match = stream.match(RE(\"type\")))\n type = match[0];\n else\n return (state.mode = Modes.text)(stream, state);\n\n if (match = type.match(RE(\"header\"))) {\n state.layoutType = \"header\";\n state.header = parseInt(match[0][1]);\n } else if (type.match(RE(\"bq\"))) {\n state.layoutType = \"quote\";\n } else if (type.match(RE(\"bc\"))) {\n state.layoutType = \"code\";\n } else if (type.match(RE(\"foot\"))) {\n state.layoutType = \"footnote\";\n } else if (type.match(RE(\"notextile\"))) {\n state.layoutType = \"notextile\";\n } else if (type.match(RE(\"pre\"))) {\n state.layoutType = \"pre\";\n } else if (type.match(RE(\"div\"))) {\n state.layoutType = \"div\";\n } else if (type.match(RE(\"table\"))) {\n state.layoutType = \"table\";\n }\n\n state.mode = Modes.attributes;\n return tokenStyles(state);\n },\n\n text: function(stream, state) {\n if (stream.match(RE(\"text\"))) return tokenStyles(state);\n\n var ch = stream.next();\n if (ch === '\"')\n return (state.mode = Modes.link)(stream, state);\n return handlePhraseModifier(stream, state, ch);\n },\n\n attributes: function(stream, state) {\n state.mode = Modes.layoutLength;\n\n if (stream.match(RE(\"attributes\")))\n return tokenStylesWith(state, TOKEN_STYLES.attributes);\n else\n return tokenStyles(state);\n },\n\n layoutLength: function(stream, state) {\n if (stream.eat(\".\") && stream.eat(\".\"))\n state.spanningLayout = true;\n\n state.mode = Modes.text;\n return tokenStyles(state);\n },\n\n list: function(stream, state) {\n var match = stream.match(RE(\"list\"));\n state.listDepth = match[0].length;\n var listMod = (state.listDepth - 1) % 3;\n if (!listMod)\n state.layoutType = \"list1\";\n else if (listMod === 1)\n state.layoutType = \"list2\";\n else\n state.layoutType = \"list3\";\n\n state.mode = Modes.attributes;\n return tokenStyles(state);\n },\n\n link: function(stream, state) {\n state.mode = Modes.text;\n if (stream.match(RE(\"link\"))) {\n stream.match(/\\S+/);\n return tokenStylesWith(state, TOKEN_STYLES.link);\n }\n return tokenStyles(state);\n },\n\n linkDefinition: function(stream, state) {\n stream.skipToEnd();\n return tokenStylesWith(state, TOKEN_STYLES.linkDefinition);\n },\n\n definitionList: function(stream, state) {\n stream.match(RE(\"definitionList\"));\n\n state.layoutType = \"definitionList\";\n\n if (stream.match(/\\s*$/))\n state.spanningLayout = true;\n else\n state.mode = Modes.attributes;\n\n return tokenStyles(state);\n },\n\n html: function(stream, state) {\n stream.skipToEnd();\n return tokenStylesWith(state, TOKEN_STYLES.html);\n },\n\n table: function(stream, state) {\n state.layoutType = \"table\";\n return (state.mode = Modes.tableCell)(stream, state);\n },\n\n tableCell: function(stream, state) {\n if (stream.match(RE(\"tableHeading\")))\n state.tableHeading = true;\n else\n stream.eat(\"|\");\n\n state.mode = Modes.tableCellAttributes;\n return tokenStyles(state);\n },\n\n tableCellAttributes: function(stream, state) {\n state.mode = Modes.tableText;\n\n if (stream.match(RE(\"tableCellAttributes\")))\n return tokenStylesWith(state, TOKEN_STYLES.attributes);\n else\n return tokenStyles(state);\n },\n\n tableText: function(stream, state) {\n if (stream.match(RE(\"tableText\")))\n return tokenStyles(state);\n\n if (stream.peek() === \"|\") { // end of cell\n state.mode = Modes.tableCell;\n return tokenStyles(state);\n }\n return handlePhraseModifier(stream, state, stream.next());\n }\n };\n\n CodeMirror.defineMode(\"textile\", function() {\n return {\n startState: function() {\n return { mode: Modes.newLayout };\n },\n token: function(stream, state) {\n if (stream.sol()) startNewLine(stream, state);\n return state.mode(stream, state);\n },\n blankLine: blankLine\n };\n });\n\n CodeMirror.defineMIME(\"text/x-textile\", \"textile\");\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/textile/textile.js\n// module id = 730\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode('shell', function() {\n\n var words = {};\n function define(style, dict) {\n for(var i = 0; i < dict.length; i++) {\n words[dict[i]] = style;\n }\n };\n\n var commonAtoms = [\"true\", \"false\"];\n var commonKeywords = [\"if\", \"then\", \"do\", \"else\", \"elif\", \"while\", \"until\", \"for\", \"in\", \"esac\", \"fi\",\n \"fin\", \"fil\", \"done\", \"exit\", \"set\", \"unset\", \"export\", \"function\"];\n var commonCommands = [\"ab\", \"awk\", \"bash\", \"beep\", \"cat\", \"cc\", \"cd\", \"chown\", \"chmod\", \"chroot\", \"clear\",\n \"cp\", \"curl\", \"cut\", \"diff\", \"echo\", \"find\", \"gawk\", \"gcc\", \"get\", \"git\", \"grep\", \"hg\", \"kill\", \"killall\",\n \"ln\", \"ls\", \"make\", \"mkdir\", \"openssl\", \"mv\", \"nc\", \"nl\", \"node\", \"npm\", \"ping\", \"ps\", \"restart\", \"rm\",\n \"rmdir\", \"sed\", \"service\", \"sh\", \"shopt\", \"shred\", \"source\", \"sort\", \"sleep\", \"ssh\", \"start\", \"stop\",\n \"su\", \"sudo\", \"svn\", \"tee\", \"telnet\", \"top\", \"touch\", \"vi\", \"vim\", \"wall\", \"wc\", \"wget\", \"who\", \"write\",\n \"yes\", \"zsh\"];\n\n CodeMirror.registerHelper(\"hintWords\", \"shell\", commonAtoms.concat(commonKeywords, commonCommands));\n\n define('atom', commonAtoms);\n define('keyword', commonKeywords);\n define('builtin', commonCommands);\n\n function tokenBase(stream, state) {\n if (stream.eatSpace()) return null;\n\n var sol = stream.sol();\n var ch = stream.next();\n\n if (ch === '\\\\') {\n stream.next();\n return null;\n }\n if (ch === '\\'' || ch === '\"' || ch === '`') {\n state.tokens.unshift(tokenString(ch, ch === \"`\" ? \"quote\" : \"string\"));\n return tokenize(stream, state);\n }\n if (ch === '#') {\n if (sol && stream.eat('!')) {\n stream.skipToEnd();\n return 'meta'; // 'comment'?\n }\n stream.skipToEnd();\n return 'comment';\n }\n if (ch === '$') {\n state.tokens.unshift(tokenDollar);\n return tokenize(stream, state);\n }\n if (ch === '+' || ch === '=') {\n return 'operator';\n }\n if (ch === '-') {\n stream.eat('-');\n stream.eatWhile(/\\w/);\n return 'attribute';\n }\n if (/\\d/.test(ch)) {\n stream.eatWhile(/\\d/);\n if(stream.eol() || !/\\w/.test(stream.peek())) {\n return 'number';\n }\n }\n stream.eatWhile(/[\\w-]/);\n var cur = stream.current();\n if (stream.peek() === '=' && /\\w+/.test(cur)) return 'def';\n return words.hasOwnProperty(cur) ? words[cur] : null;\n }\n\n function tokenString(quote, style) {\n var close = quote == \"(\" ? \")\" : quote == \"{\" ? \"}\" : quote\n return function(stream, state) {\n var next, escaped = false;\n while ((next = stream.next()) != null) {\n if (next === close && !escaped) {\n state.tokens.shift();\n break;\n } else if (next === '$' && !escaped && quote !== \"'\" && stream.peek() != close) {\n escaped = true;\n stream.backUp(1);\n state.tokens.unshift(tokenDollar);\n break;\n } else if (!escaped && quote !== close && next === quote) {\n state.tokens.unshift(tokenString(quote, style))\n return tokenize(stream, state)\n } else if (!escaped && /['\"]/.test(next) && !/['\"]/.test(quote)) {\n state.tokens.unshift(tokenStringStart(next, \"string\"));\n stream.backUp(1);\n break;\n }\n escaped = !escaped && next === '\\\\';\n }\n return style;\n };\n };\n\n function tokenStringStart(quote, style) {\n return function(stream, state) {\n state.tokens[0] = tokenString(quote, style)\n stream.next()\n return tokenize(stream, state)\n }\n }\n\n var tokenDollar = function(stream, state) {\n if (state.tokens.length > 1) stream.eat('$');\n var ch = stream.next()\n if (/['\"({]/.test(ch)) {\n state.tokens[0] = tokenString(ch, ch == \"(\" ? \"quote\" : ch == \"{\" ? \"def\" : \"string\");\n return tokenize(stream, state);\n }\n if (!/\\d/.test(ch)) stream.eatWhile(/\\w/);\n state.tokens.shift();\n return 'def';\n };\n\n function tokenize(stream, state) {\n return (state.tokens[0] || tokenBase) (stream, state);\n };\n\n return {\n startState: function() {return {tokens:[]};},\n token: function(stream, state) {\n return tokenize(stream, state);\n },\n closeBrackets: \"()[]{}''\\\"\\\"``\",\n lineComment: '#',\n fold: \"brace\"\n };\n});\n\nCodeMirror.defineMIME('text/x-sh', 'shell');\n// Apache uses a slightly different Media Type for Shell scripts\n// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types\nCodeMirror.defineMIME('application/x-sh', 'shell');\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/shell/shell.js\n// module id = 731\n// module chunks = 3 4 5 7 8 14","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-17a2306c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./email.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./email.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./email.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-17a2306c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./email.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue\n// module id = 734\n// module chunks = 0 3 4 5 6","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/dag.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Vue from 'vue'\nimport $ from 'jquery'\nimport _ from 'lodash'\nimport i18n from '@/module/i18n'\nimport { jsPlumb } from 'jsplumb'\nimport DragZoom from './dragZoom'\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\nimport Permissions from '@/module/permissions'\nimport { uuid, findComponentDownward } from '@/module/util/'\nimport {\n tasksAll,\n rtTasksTpl,\n setSvgColor,\n saveTargetarr,\n rtTargetarrArr } from './util'\nimport mStart from '@/conf/home/pages/projects/pages/definition/pages/list/_source/start'\n\nlet JSP = function () {\n this.dag = {}\n this.selectedElement = {}\n\n this.config = {\n // Whether to drag\n isDrag: true,\n // Whether to allow connection\n isAttachment: false,\n // Whether to drag a new node\n isNewNodes: true,\n // Whether to support double-click node events\n isDblclick: true,\n // Whether to support right-click menu events\n isContextmenu: true,\n // Whether to allow click events\n isClick: false\n }\n}\n\n/**\n * dag init\n */\nJSP.prototype.init = function ({ dag, instance }) {\n // Get the dag component instance\n this.dag = dag\n // Get jsplumb instance\n this.JspInstance = instance\n // Register jsplumb connection type and configuration\n this.JspInstance.registerConnectionType('basic', {\n anchor: 'Continuous',\n connector: 'Straight' // Line type\n })\n\n // Initial configuration\n this.setConfig({\n isDrag: !store.state.dag.isDetails,\n isAttachment: false,\n isNewNodes: Permissions.getAuth() === false ? false : !store.state.dag.isDetails,\n isDblclick: true,\n isContextmenu: true,\n isClick: false\n })\n\n // Monitor line click\n this.JspInstance.bind('click', e => {\n if (this.config.isClick) {\n this.connectClick(e)\n }\n })\n\n // Drag and drop\n if (this.config.isNewNodes) {\n DragZoom.init()\n }\n}\n\n/**\n * set config attribute\n */\nJSP.prototype.setConfig = function (o) {\n this.config = Object.assign(this.config, {}, o)\n}\n\n/**\n * Node binding event\n */\nJSP.prototype.tasksEvent = function (selfId) {\n let tasks = $(`#${selfId}`)\n // Bind right event\n tasks.on('contextmenu', e => {\n this.tasksContextmenu(e)\n return false\n })\n\n // Binding double click event\n tasks.find('.icos').bind('dblclick', e => {\n this.tasksDblclick(e)\n })\n\n // Binding click event\n tasks.on('click', e => {\n this.tasksClick(e)\n })\n}\n\n/**\n * Dag node drag and drop processing\n */\nJSP.prototype.draggable = function () {\n if (this.config.isNewNodes) {\n let selfId\n let self = this\n $('.toolbar-btn .roundedRect').draggable({\n scope: 'plant',\n helper: 'clone',\n containment: $('.dag-model'),\n stop: function (e, ui) {\n self.tasksEvent(selfId)\n\n // Dom structure is not generated without pop-up form form\n if ($(`#${selfId}`).html()) {\n // dag event\n findComponentDownward(self.dag.$root, 'dag-chart')._createNodes({\n id: selfId\n })\n }\n },\n drag: function () {\n $('body').find('.tooltip.fade.top.in').remove()\n }\n })\n\n $('#canvas').droppable({\n scope: 'plant',\n drop: function (ev, ui) {\n let id = 'tasks-' + Math.ceil(Math.random() * 100000) // eslint-disable-line\n // Get mouse coordinates\n let left = parseInt(ui.offset.left - $(this).offset().left)\n let top = parseInt(ui.offset.top - $(this).offset().top) - 10\n if (top < 25) {\n top = 25\n }\n // Generate template node\n $('#canvas').append(rtTasksTpl({\n id: id,\n name: id,\n x: left,\n y: top,\n isAttachment: self.config.isAttachment,\n taskType: findComponentDownward(self.dag.$root, 'dag-chart').dagBarId\n }))\n\n // Get the generated node\n let thisDom = jsPlumb.getSelector('.statemachine-demo .w')\n\n // Generating a connection node\n self.JspInstance.batch(() => {\n self.initNode(thisDom[thisDom.length - 1])\n })\n selfId = id\n }\n })\n }\n}\n\n/**\n * Echo json processing and old data structure processing\n */\nJSP.prototype.jsonHandle = function ({ largeJson, locations }) {\n _.map(largeJson, v => {\n // Generate template\n $('#canvas').append(rtTasksTpl({\n id: v.id,\n name: v.name,\n x: locations[v.id]['x'],\n y: locations[v.id]['y'],\n targetarr: locations[v.id]['targetarr'],\n isAttachment: this.config.isAttachment,\n taskType: v.type,\n runFlag:v.runFlag\n }))\n\n // contextmenu event\n $(`#${v.id}`).on('contextmenu', e => {\n this.tasksContextmenu(e)\n return false\n })\n\n // dblclick event\n $(`#${v.id}`).find('.icos').bind('dblclick', e => {\n this.tasksDblclick(e)\n })\n\n // click event\n $(`#${v.id}`).bind('click', e => {\n this.tasksClick(e)\n })\n })\n}\n\n/**\n * Initialize a single node\n */\nJSP.prototype.initNode = function (el) {\n // Whether to drag\n if (this.config.isDrag) {\n this.JspInstance.draggable(el, {\n containment: 'dag-container'\n })\n }\n\n // Node attribute configuration\n this.JspInstance.makeSource(el, {\n filter: '.ep',\n anchor: 'Continuous',\n connectorStyle: {\n stroke: '#555',\n strokeWidth: 2,\n outlineStroke: 'transparent',\n outlineWidth: 4\n },\n // This place is leaking\n // connectionType: \"basic\",\n extract: {\n action: 'the-action'\n },\n maxConnections: -1\n })\n\n // Node connection property configuration\n this.JspInstance.makeTarget(el, {\n dropOptions: { hoverClass: 'dragHover' },\n anchor: 'Continuous',\n allowLoopback: false // Forbid yourself to connect yourself\n })\n this.JspInstance.fire('jsPlumbDemoNodeAdded', el)\n}\n\n/**\n * Node right click menu\n */\nJSP.prototype.tasksContextmenu = function (event) {\n if (this.config.isContextmenu) {\n let routerName = router.history.current.name\n // state\n let isOne = routerName === 'projects-definition-details' && this.dag.releaseState !== 'NOT_RELEASE'\n // hide\n let isTwo = store.state.dag.isDetails\n\n let html = [\n `${i18n.$t('开始运行')}`,\n `${i18n.$t('编辑节点')}`,\n `${i18n.$t('复制节点')}`,\n `${i18n.$t('删除节点')}`\n ]\n\n let operationHtml = () => {\n return html.splice(',')\n }\n\n let e = event\n let $id = e.currentTarget.id\n let $contextmenu = $('#contextmenu')\n let $name = $(`#${$id}`).find('.name-p').text()\n let $left = e.pageX + document.body.scrollLeft - 5\n let $top = e.pageY + document.body.scrollTop - 5\n $contextmenu.css({\n left: $left,\n top: $top,\n visibility: 'visible'\n })\n // Action bar\n $contextmenu.html('').append(operationHtml)\n\n if (isOne) {\n // start run\n $('#startRunning').on('click', () => {\n let id = router.history.current.params.id\n store.dispatch('dag/getStartCheck', { processDefinitionId: id }).then(res => {\n let modal = Vue.$modal.dialog({\n closable: false,\n showMask: true,\n escClose: true,\n className: 'v-modal-custom',\n transitionName: 'opacityp',\n render (h) {\n return h(mStart, {\n on: {\n onUpdate () {\n modal.remove()\n },\n close () {\n modal.remove()\n }\n },\n props: {\n item: {\n id: id\n },\n startNodeList: $name,\n sourceType: 'contextmenu'\n }\n })\n }\n })\n }).catch(e => {\n Vue.$message.error(e.msg || '')\n })\n })\n }\n if (!isTwo) {\n // edit node\n $(`#editNodes`).click(ev => {\n findComponentDownward(this.dag.$root, 'dag-chart')._createNodes({\n id: $id,\n type: $(`#${$id}`).attr('data-tasks-type')\n })\n })\n // delete node\n $('#removeNodes').click(ev => {\n this.removeNodes($id)\n })\n\n // copy node\n $('#copyNodes').click(res => {\n this.copyNodes($id)\n })\n }\n }\n}\n\n/**\n * Node double click event\n */\nJSP.prototype.tasksDblclick = function (e) {\n // Untie event\n if (this.config.isDblclick) {\n let id = $(e.currentTarget.offsetParent).attr('id')\n\n findComponentDownward(this.dag.$root, 'dag-chart')._createNodes({\n id: id,\n type: $(`#${id}`).attr('data-tasks-type')\n })\n }\n}\n\n/**\n * Node click event\n */\nJSP.prototype.tasksClick = function (e) {\n let $id\n let self = this\n let $body = $(`body`)\n if (this.config.isClick) {\n let $connect = this.selectedElement.connect\n $('.w').removeClass('jtk-tasks-active')\n $(e.currentTarget).addClass('jtk-tasks-active')\n if ($connect) {\n setSvgColor($connect, '#555')\n this.selectedElement.connect = null\n }\n this.selectedElement.id = $(e.currentTarget).attr('id')\n\n // Unbind copy and paste events\n $body.unbind('copy').unbind('paste')\n // Copy binding id\n $id = self.selectedElement.id\n\n $body.bind({\n copy: function () {\n $id = self.selectedElement.id\n },\n paste: function () {\n $id && self.copyNodes($id)\n }\n })\n }\n}\n\n/**\n * Remove binding events\n * paste\n */\nJSP.prototype.removePaste = function () {\n let $body = $(`body`)\n // Unbind copy and paste events\n $body.unbind('copy').unbind('paste')\n // Remove selected node parameters\n this.selectedElement.id = null\n // Remove node selection effect\n $('.w').removeClass('jtk-tasks-active')\n}\n\n/**\n * Line click event\n */\nJSP.prototype.connectClick = function (e) {\n // Set svg color\n setSvgColor(e, '#0097e0')\n let $id = this.selectedElement.id\n if ($id) {\n $(`#${$id}`).removeClass('jtk-tasks-active')\n this.selectedElement.id = null\n }\n this.selectedElement.connect = e\n}\n\n/**\n * toolbarEvent\n * @param {Pointer}\n */\nJSP.prototype.handleEventPointer = function (is) {\n let wDom = $('.w')\n this.setConfig({\n isClick: is,\n isAttachment: false\n })\n wDom.removeClass('jtk-ep')\n if (!is) {\n wDom.removeClass('jtk-tasks-active')\n this.selectedElement = {}\n _.map($('#canvas svg'), v => {\n if ($(v).attr('class')) {\n _.map($(v).find('path'), v1 => {\n $(v1).attr('fill', '#555')\n $(v1).attr('stroke', '#555')\n })\n }\n })\n }\n}\n\n/**\n * toolbarEvent\n * @param {Line}\n */\nJSP.prototype.handleEventLine = function (is) {\n let wDom = $('.w')\n this.setConfig({\n isAttachment: is\n })\n is ? wDom.addClass('jtk-ep') : wDom.removeClass('jtk-ep')\n}\n\n/**\n * toolbarEvent\n * @param {Remove}\n */\nJSP.prototype.handleEventRemove = function () {\n let $id = this.selectedElement.id || null\n let $connect = this.selectedElement.connect || null\n if ($id) {\n this.removeNodes(this.selectedElement.id)\n } else {\n this.removeConnect($connect)\n }\n\n // Monitor whether to edit DAG\n store.commit('dag/setIsEditDag', true)\n}\n\n/**\n * Delete node\n */\nJSP.prototype.removeNodes = function ($id) {\n // Delete node processing(data-targetarr)\n _.map(tasksAll(), v => {\n let targetarr = v.targetarr.split(',')\n if (targetarr.length) {\n let newArr = _.filter(targetarr, v1 => v1 !== $id)\n $(`#${v.id}`).attr('data-targetarr', newArr.toString())\n }\n })\n // delete node\n this.JspInstance.remove($id)\n}\n\n/**\n * Delete connection\n */\nJSP.prototype.removeConnect = function ($connect) {\n if (!$connect) {\n return\n }\n // Remove connections and remove node and node dependencies\n let targetId = $connect.targetId\n let sourceId = $connect.sourceId\n let targetarr = rtTargetarrArr(targetId)\n if (targetarr.length) {\n targetarr = _.filter(targetarr, v => v !== sourceId)\n $(`#${targetId}`).attr('data-targetarr', targetarr.toString())\n }\n this.JspInstance.deleteConnection($connect)\n\n this.selectedElement = {}\n}\n\n/**\n * Copy node\n */\nJSP.prototype.copyNodes = function ($id) {\n let newNodeInfo = _.cloneDeep(_.find(store.state.dag.tasks, v => v.id === $id))\n let newNodePors = store.state.dag.locations[$id]\n // Unstored nodes do not allow replication\n if (!newNodePors) {\n return\n }\n // Generate random id\n let newUuId = `${uuid() + uuid()}`\n let id = newNodeInfo.id.length > 8 ? newNodeInfo.id.substr(0, 7) : newNodeInfo.id\n let name = newNodeInfo.name.length > 8 ? newNodeInfo.name.substr(0, 7) : newNodeInfo.name\n\n // new id\n let newId = `${id || ''}-${newUuId}`\n // new name\n let newName = `${name || ''}-${newUuId}`\n // coordinate x\n let newX = newNodePors.x + 100\n // coordinate y\n let newY = newNodePors.y + 40\n\n // Generate template node\n $('#canvas').append(rtTasksTpl({\n id: newId,\n name: newName,\n x: newX,\n y: newY,\n isAttachment: this.config.isAttachment,\n taskType: newNodeInfo.type\n }))\n\n // Get the generated node\n let thisDom = jsPlumb.getSelector('.statemachine-demo .w')\n\n // Copy node information\n newNodeInfo = Object.assign(newNodeInfo, {\n id: newId,\n name: newName\n })\n\n // Add new node\n store.commit('dag/addTasks', newNodeInfo)\n // Add node location information\n store.commit('dag/setLocations', {\n [newId]: {\n name: newName,\n targetarr: '',\n x: newX,\n y: newY\n }\n })\n\n // Generating a connection node\n this.JspInstance.batch(() => {\n this.initNode(thisDom[thisDom.length - 1])\n // Add events to nodes\n this.tasksEvent(newId)\n })\n}\n/**\n * toolbarEvent\n * @param {Screen}\n */\nJSP.prototype.handleEventScreen = function ({ item, is }) {\n let screenOpen = true\n if (is) {\n item.icon = ''\n screenOpen = true\n } else {\n item.icon = ''\n screenOpen = false\n }\n let $mainLayoutModel = $('.main-layout-model')\n if (screenOpen) {\n $mainLayoutModel.addClass('dag-screen')\n } else {\n $mainLayoutModel.removeClass('dag-screen')\n }\n}\n/**\n * save task\n * @param tasks\n * @param locations\n * @param connects\n */\nJSP.prototype.saveStore = function () {\n return new Promise((resolve, reject) => {\n let connects = []\n let locations = {}\n let tasks = []\n\n let is = (id) => {\n return !!_.filter(tasksAll(), v => v.id === id).length\n }\n\n // task\n _.map(_.cloneDeep(store.state.dag.tasks), v => {\n if (is(v.id)) {\n let preTasks = []\n let id = $(`#${v.id}`)\n let tar = id.attr('data-targetarr')\n let idDep = tar ? id.attr('data-targetarr').split(',') : []\n if (idDep.length) {\n _.map(idDep, v1 => {\n preTasks.push($(`#${v1}`).find('.name-p').text())\n })\n }\n\n let tasksParam = _.assign(v, {\n preTasks: preTasks\n })\n\n // Sub-workflow has no retries and interval\n if (v.type === 'SUB_PROCESS') {\n tasksParam = _.omit(tasksParam, ['maxRetryTimes', 'retryInterval'])\n }\n\n tasks.push(tasksParam)\n }\n })\n\n _.map(this.JspInstance.getConnections(), v => {\n connects.push({\n 'endPointSourceId': v.sourceId,\n 'endPointTargetId': v.targetId\n })\n })\n\n _.map(tasksAll(), v => {\n locations[v.id] = {\n name: v.name,\n targetarr: v.targetarr,\n x: v.x,\n y: v.y\n }\n })\n\n // Storage node\n store.commit('dag/setTasks', tasks)\n // Store coordinate information\n store.commit('dag/setLocations', locations)\n // Storage line dependence\n store.commit('dag/setConnects', connects)\n\n resolve({\n connects: connects,\n tasks: tasks,\n locations: locations\n })\n })\n}\n/**\n * Event processing\n */\nJSP.prototype.handleEvent = function () {\n this.JspInstance.bind('beforeDrop', function (info) {\n let sourceId = info['sourceId']// 出\n let targetId = info['targetId']// 入\n\n /**\n * Recursive search for nodes\n */\n let recursiveVal\n const recursiveTargetarr = (arr, targetId) => {\n for (var i in arr) {\n if (arr[i] === targetId) {\n recursiveVal = targetId\n } else {\n let recTargetarrArr = rtTargetarrArr(arr[i])\n if (recTargetarrArr.length) {\n recursiveTargetarr(recTargetarrArr, targetId)\n } else {\n return recursiveTargetarr(targetId)\n }\n }\n }\n return recursiveVal\n }\n\n // Connection to connected nodes is not allowed\n if (_.findIndex(rtTargetarrArr(targetId), v => v === sourceId) !== -1) {\n return false\n }\n\n // Recursive form to find if the target Targetarr has a sourceId\n if (recursiveTargetarr(rtTargetarrArr(sourceId), targetId)) {\n // setRecursiveVal(null)\n return false\n }\n\n // Storage node dependency information\n saveTargetarr(sourceId, targetId)\n\n // Monitor whether to edit DAG\n store.commit('dag/setIsEditDag', true)\n\n return true\n })\n}\n/**\n * Backfill data processing\n */\nJSP.prototype.jspBackfill = function ({ connects, locations, largeJson }) {\n // Backfill nodes\n this.jsonHandle({\n largeJson: largeJson,\n locations: locations\n })\n\n let wNodes = jsPlumb.getSelector('.statemachine-demo .w')\n\n // Backfill line\n this.JspInstance.batch(() => {\n for (let i = 0; i < wNodes.length; i++) {\n this.initNode(wNodes[i])\n }\n _.map(connects, v => {\n let sourceId = v.endPointSourceId.split('-')\n let targetId = v.endPointTargetId.split('-')\n if (sourceId.length === 4 && targetId.length === 4) {\n sourceId = `${sourceId[0]}-${sourceId[1]}-${sourceId[2]}`\n targetId = `${targetId[0]}-${targetId[1]}-${targetId[2]}`\n } else {\n sourceId = v.endPointSourceId\n targetId = v.endPointTargetId\n }\n\n this.JspInstance.connect({\n source: sourceId,\n target: targetId,\n type: 'basic',\n paintStyle: { strokeWidth: 2, stroke: '#555' }\n })\n })\n })\n\n jsPlumb.fire('jsPlumbDemoLoaded', this.JspInstance)\n\n // Connection monitoring\n this.handleEvent()\n\n // Drag and drop new nodes\n this.draggable()\n}\n\nexport default new JSP()\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/udp/udp.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/localParams.vue","\nimport Vue from 'vue'\nimport mAffirm from './jumpAffirm'\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\nimport { uuid, findComponentDownward } from '@/module/util/'\n\nlet Affirm = {}\nlet $root = {}\nlet $routerType = ''\nlet $isPop = true\n\n/**\n * Listen for route changes\n */\nrouter.beforeEach((to, from, next) => {\n if (from.name === 'projects-definition-details' || from.name === 'projects-instance-details' || from.name === 'definition-create') {\n if (!Affirm.paramVerification(from.name)) {\n Affirm.isPop(() => {\n next()\n })\n } else {\n next()\n }\n } else {\n next()\n }\n})\n\n/**\n * Get judgment initialization data\n */\nAffirm.init = (root) => {\n $isPop = true\n $root = root\n $routerType = router.history.current.name\n}\n\n/**\n * Parameter verification\n */\nAffirm.paramVerification = (name) => {\n if (!$isPop) {\n return true\n }\n let dagStore = store.state.dag\n let flag = false\n if ($routerType === 'definition-create') {\n // No nodes jump out directly\n if (dagStore.tasks.length) {\n if (!dagStore.name) {\n store.commit('dag/setName', `${uuid('dag_')}${uuid() + uuid()}`)\n }\n flag = false\n } else {\n flag = true\n }\n } else {\n // View history direct jump\n flag = name === 'projects-instance-details' ? true : !dagStore.isEditDag\n }\n return flag\n}\n\n/**\n * Pop-up judgment\n */\nAffirm.isPop = (fn) => {\n Vue.$modal.dialog({\n closable: false,\n showMask: true,\n escClose: true,\n className: 'v-modal-custom',\n transitionName: 'opacityp',\n render (h) {\n return h(mAffirm, {\n on: {\n ok () {\n // save\n findComponentDownward($root, 'dag-chart')._save('affirm').then(() => {\n fn()\n Vue.$modal.destroy()\n }).catch(() => {\n fn()\n Vue.$modal.destroy()\n })\n },\n close () {\n fn()\n Vue.$modal.destroy()\n }\n },\n props: {\n }\n })\n }\n })\n}\n\n/**\n * Whether the external setting pops up\n */\nAffirm.setIsPop = (is) => {\n $isPop = is\n}\n\nexport default Affirm\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/jumpAffirm/index.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/jumpAffirm/jumpAffirm.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/formModel.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/listBox.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/resources.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/udfs.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/sqlType.vue","var normalizeComponent = require(\"!../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./datasource.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./datasource.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-62aa87e3\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./datasource.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/dag/_source/formModel/tasks/_source/datasource.vue\n// module id = 786\n// module chunks = 3 4 5","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/datasource.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/procedure.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/dependItemList.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/sub_process.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/_source/selectInput.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/_source/timeoutAlarm.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-2175c153\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./start.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./start.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./start.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-2175c153\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./start.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue\n// module id = 798\n// module chunks = 0 3 4 5","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/instance/pages/details/index.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/instanceDetails.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/variable/index.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/variable/variablesView.vue","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\n\nexport default {\n data () {\n return {\n router,\n store,\n isDetails: false\n }\n },\n created () {\n this.isDetails = this.store.state.dag.isDetails\n },\n methods: {\n },\n computed: {\n _isDetails () {\n return this.isDetails ? 'icon-disabled' : ''\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/module/mixin/disabledState.js","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n// This is CodeMirror (https://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\//.test(userAgent);\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\\/\\w+/.test(userAgent);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt() {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var activeElement;\n try {\n activeElement = document.activeElement;\n } catch(e) {\n activeElement = document.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {this.id = null;};\n Delayed.prototype.set = function (ms, f) {\n clearTimeout(this.id);\n this.id = setTimeout(f, ms);\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 30;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\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]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n input.init(d);\n }\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n // Add a span to a line.\n function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers || (emitter._handlers = {});\n map$$1[type] = (map$$1[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers, arr = map$$1 && map$$1[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map$$1[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range$$1;\n try {range$$1 = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range$$1 || range$$1.parentElement() != te) { return false }\n return range$$1.compareEndPoints(\"StartToEnd\", range$$1) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var this$1 = this;\n\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n var this$1 = this;\n\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this$1.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\s)\" + lineClass[2] + \"(?:$|\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {\n var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (node.className == \"CodeMirror-linewidget\")\n { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\");\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map$$1, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map$$1.length; i += 3) {\n mStart = map$$1[i];\n mEnd = map$$1[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map$$1.length - 3 || ch == mEnd && map$$1[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map$$1[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map$$1[i - 2] == map$$1[i - 3] && map$$1[i - 1].insertLeft) {\n node = map$$1[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map$$1.length - 3 && map$$1[i + 3] == map$$1[i + 4] && !map$$1[i + 5].insertLeft) {\n node = map$$1[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX() {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }\n return window.pageXOffset || (document.documentElement || document.body).scrollLeft\n }\n function pageScrollY() {\n if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }\n return window.pageYOffset || (document.documentElement || document.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var height = 0;\n if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above)\n { height += widgetHeight(lineObj.widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = true; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo$$1, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight$$1 = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo$$1, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight$$1; box.bottom += widgetHeight$$1;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight$$1 <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo$$1, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top || y >= coords.bottom;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo$$1, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo$$1, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo$$1, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo$$1, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range$$1 = doc.sel.ranges[i];\n if (range$$1.from().line >= cm.display.viewTo || range$$1.to().line < cm.display.viewFrom) { continue }\n var collapsed = range$$1.empty();\n if (collapsed || cm.options.showCursorWhenSelecting)\n { drawSelectionCursor(cm, range$$1.head, curFragment); }\n if (!collapsed)\n { drawSelectionRange(cm, range$$1, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\"; },\n cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n onBlur(cm);\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range$$1) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range$$1;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val);\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.pointerEvents = this.vert.style.pointerEvents = \"none\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.pointerEvents = \"auto\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt$$1 = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt$$1 != bar) { bar.style.pointerEvents = \"none\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt();\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this$1.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt();\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = window.getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }\n snapshot.activeElt.focus();\n if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var sel = window.getSelection(), range$$1 = document.createRange();\n range$$1.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range$$1.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range$$1);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(cm) {\n var width = cm.display.gutters.offsetWidth;\n cm.display.sizer.style.marginLeft = width + \"px\";\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }\n\n // Make sure the gutters options contains the element\n // \"CodeMirror-linenumbers\" when the lineNumbers option is true.\n function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && wheelPixelsPerUnit != null) {\n var pixels = dy * wheelPixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n var this$1 = this;\n\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this$1.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var this$1 = this;\n\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this$1.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n var this$1 = this;\n\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this$1.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(startGen) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = startGen || 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm)\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n var this$1 = this;\n\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this$1;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n var this$1 = this;\n\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this$1.lines[i];\n this$1.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var e = at + n; at < e; ++at)\n { if (op(this$1.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n var this$1 = this;\n\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this$1;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n var this$1 = this;\n\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this$1.height -= oldHeight - child.height;\n if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this$1.children.splice(++i, 0, leaf);\n leaf.parent = this$1;\n }\n child.lines = child.lines.slice(0, remaining);\n this$1.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n var this$1 = this;\n\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this$1[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var this$1 = this;\n\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n var this$1 = this;\n\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null));\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n var this$1 = this;\n\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this$1; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this$1.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range$$1 = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range$$1.head; }\n else if (start == \"anchor\") { pos = range$$1.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range$$1.to(); }\n else { pos = range$$1.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n var this$1 = this;\n\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this$1, ranges[i].anchor),\n clipPos(this$1, ranges[i].head)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var this$1 = this;\n\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var this$1 = this;\n\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var this$1 = this;\n\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range$$1 = sel.ranges[i];\n changes[i] = {from: range$$1.from(), to: range$$1.to(), text: this$1.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this$1, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {this.history = new History(this.history.maxGeneration);},\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history.maxGeneration);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo$$1 = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo$$1 == from.line && from.ch >= span.to ||\n span.from == null && lineNo$$1 != from.line ||\n span.from != null && lineNo$$1 == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo$$1;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo$$1 = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo$$1;\n });\n return clipPos(this, Pos(lineNo$$1, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n var this$1 = this;\n\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this$1.linked[i];\n if (link.doc != other) { continue }\n this$1.linked.splice(i, 1);\n other.unlinkDoc(this$1);\n detachSharedMarkers(findSharedMarkers(this$1));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var loadFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1)\n { return }\n\n var reader = new FileReader;\n reader.onload = operation(cm, function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) { content = \"\"; }\n text[i] = content;\n if (++read == n) {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)));\n }\n });\n reader.readAsText(file);\n };\n for (var i = 0; i < n; ++i) { loadFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 127: \"Delete\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Alt-F\": \"goWordRight\", \"Alt-B\": \"goWordLeft\", \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\",\n \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\", \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\",\n \"Alt-D\": \"delWordAfter\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\", \"Ctrl-T\": \"transposeChars\",\n \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map$$1, handle, context) {\n map$$1 = getKeyMap(map$$1);\n var found = map$$1.call ? map$$1.call(key, context) : map$$1[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map$$1.fallthrough) {\n if (Object.prototype.toString.call(map$$1.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map$$1.fallthrough, handle, context) }\n for (var i = 0; i < map$$1.fallthrough.length; i++) {\n var result = lookupKey(key, map$$1.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Cmd\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"char\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(0, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n cm.curOp.focus = activeElt();\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if (webkit || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n delayBlurEvent(cm);\n setTimeout(function () { return display.input.focus(); }, 20);\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.options.gutters.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.options.gutters[i];\n signal(cm, type, cm, line, gutter, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b-\\u200f\\u2028\\u2029\\ufeff]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n guttersChanged(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"firstLineNumber\", 1, guttersChanged, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, guttersChanged, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function guttersChanged(cm) {\n updateGutters(cm);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n setGuttersForLineNumbers(options);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input);\n display.wrapper.CodeMirror = this;\n updateGutters(this);\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(bind(onFocus, this), 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this$1, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range$$1 = sel.ranges[i$1];\n var from = range$$1.from(), to = range$$1.to();\n if (range$$1.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == inserted)\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput)\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range$$1 = sel.ranges[i];\n if (range$$1.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range$$1.head.line)) { continue }\n var mode = cm.getModeAt(range$$1.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range$$1.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range$$1.head.line).text.slice(0, range$$1.head.ch)))\n { indented = indentLine(cm, range$$1.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range$$1.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", !!autocorrect);\n field.setAttribute(\"autocapitalize\", !!autocapitalize);\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n disableBrowserMagic(te);\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map$$1, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n },\n removeKeyMap: function(map$$1) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this$1.state.modeGen++;\n regChange(this$1);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range$$1 = ranges[i];\n if (!range$$1.empty()) {\n var from = range$$1.from(), to = range$$1.to();\n var start = Math.max(end, from.line);\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how); }\n var newRanges = this$1.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range$$1.head.line > end) {\n indentLine(this$1, range$$1.head.line, how, true);\n end = range$$1.head.line;\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range$$1 = this.doc.sel.primary();\n if (start == null) { pos = range$$1.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range$$1.from() : range$$1.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range$$1) {\n if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range$$1) {\n var other = findPosH(doc, range$$1.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this$1, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range$$1) {\n if (collapse)\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range$$1 == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range$$1, margin) {\n if (range$$1 == null) {\n range$$1 = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range$$1 == \"number\") {\n range$$1 = {from: Pos(range$$1, 0), to: null};\n } else if (range$$1.from == null) {\n range$$1 = {from: range$$1, to: null};\n }\n if (!range$$1.to) { range$$1.to = range$$1.from; }\n range$$1.margin = margin || 0;\n\n if (range$$1.from.line != null) {\n scrollToRange(this, range$$1);\n } else {\n scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo$$1 = this.display.viewFrom;\n this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n ++lineNo$$1;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"char\", \"column\" (like char, but doesn't\n // cross line boundaries), \"word\" (across next word), or \"group\" (to\n // the start of next group of word or non-word-non-whitespace\n // chars). The visually param controls whether, in right-to-left\n // text, direction 1 means to move towards the next index in the\n // string, or towards the character to the right of the current\n // position. The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n function findNextLine() {\n var l = pos.line + dir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n on(div, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = document.activeElement;\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = this.cm.state.focused;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map$$1 = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map$$1[map$$1.length - 1], offset: map$$1[map$$1.length - 2] - map$$1[map$$1.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor())\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var input = this;\n if (this.selectionInEditor())\n { this.pollSelection(); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range$$1;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range$$1 = found[0].find(0)))\n { addText(getBetween(cm.doc, range$$1.from, range$$1.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map$$1 = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map$$1.length; j += 3) {\n var curNode = map$$1[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map$$1[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map$$1[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing) { return }\n var cm = this.cm;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt() != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { window.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt();\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, …*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.45.0\";\n\n return CodeMirror;\n\n})));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/lib/codemirror.js\n// module id = 644\n// module chunks = 3 4 5 7 8 14","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-f72bdd3a\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./secondaryMenu.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./secondaryMenu.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./secondaryMenu.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-f72bdd3a\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./secondaryMenu.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/secondaryMenu/secondaryMenu.vue\n// module id = 654\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 25 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/priority/priority.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport _ from 'lodash'\nimport $ from 'jquery'\nimport i18n from '@/module/i18n'\nimport store from '@/conf/home/store'\n\n/**\n * Node, to array\n */\nconst rtTargetarrArr = (id) => {\n let a = $(`#${id}`).attr('data-targetarr')\n return a ? a.split(',') : []\n}\n\n/**\n * Store node id to targetarr\n */\nconst saveTargetarr = (valId, domId) => {\n let $target = $(`#${domId}`)\n let targetStr = $target.attr('data-targetarr') ? $target.attr('data-targetarr') + `,${valId}` : `${valId}`\n $target.attr('data-targetarr', targetStr)\n}\n\nconst rtBantpl = () => {\n return ``\n}\n\n/**\n * return node html\n */\nconst rtTasksTpl = ({ id, name, x, y, targetarr, isAttachment, taskType,runFlag }) => {\n let tpl = ``\n tpl += `
`\n tpl += `
`\n tpl += `
`\n tpl += `
`\n tpl += `${name}`\n tpl += `
`\n tpl += `
`\n tpl += `
`\n if (runFlag === 'FORBIDDEN') {\n tpl += rtBantpl()\n }\n tpl += `
`\n tpl += `
`\n\n return tpl\n}\n\n/**\n * Get all tasks nodes\n */\nconst tasksAll = () => {\n let a = []\n $('#canvas .w').each(function (idx, elem) {\n let e = $(elem)\n a.push({\n id: e.attr('id'),\n name: e.find('.name-p').text(),\n targetarr: e.attr('data-targetarr') || '',\n x: parseInt(e.css('left'), 10),\n y: parseInt(e.css('top'), 10)\n })\n })\n return a\n}\n\n/**\n * Determine if name is in the current dag map\n * rely dom / backfill\n */\nconst isNameExDag = (name, rely) => {\n if (rely === 'dom') {\n return _.findIndex(tasksAll(), v => v.name === name) !== -1\n } else {\n return _.findIndex(store.state.dag.tasks, v => v.name === name) !== -1\n }\n}\n\n/**\n * Change svg line color\n */\nconst setSvgColor = (e, color) => {\n // Traverse clear all colors\n $('.jtk-connector').each((i, o) => {\n _.map($(o)[0].childNodes, v => {\n $(v).attr('fill', '#555').attr('stroke', '#555').attr('stroke-width', 2)\n })\n })\n\n // Add color to the selection\n _.map($(e.canvas)[0].childNodes, (v, i) => {\n $(v).attr('fill', color).attr('stroke', color)\n if ($(v).attr('class')) {\n $(v).attr('stroke-width', 2)\n }\n })\n}\n\n/**\n * Get all node ids\n */\nconst allNodesId = () => {\n let idArr = []\n $('.w').each((i, o) => {\n let $obj = $(o)\n let $span = $obj.find('.name-p').text()\n if ($span) {\n idArr.push({\n id: $obj.attr('id'),\n name: $span\n })\n }\n })\n return idArr\n}\n\nexport {\n rtTargetarrArr,\n saveTargetarr,\n rtTasksTpl,\n tasksAll,\n isNameExDag,\n setSvgColor,\n allNodesId,\n rtBantpl\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/plugIn/util.js","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-5b25ea8f\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./resources.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./resources.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./resources.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-5b25ea8f\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./resources.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/dag/_source/formModel/tasks/_source/resources.vue\n// module id = 699\n// module chunks = 3 4 5","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-6a4fc01c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./priority.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./priority.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./priority.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-6a4fc01c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./priority.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/priority/priority.vue\n// module id = 700\n// module chunks = 0 3 4 5 6","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport i18n from '@/module/i18n'\n/**\n * download file\n */\nlet downloadFile = ($url, $obj) => {\n let param = {\n url: $url,\n obj: $obj\n }\n\n if (!param.url) {\n this.$message.warning(`${i18n.$t('无下载url无法下载')}`)\n return\n }\n\n let generatorInput = function (obj) {\n let result = ''\n let keyArr = Object.keys(obj)\n keyArr.forEach(function (key) {\n result += \"\"\n })\n return result\n }\n $(`
${generatorInput(param.obj)}
`).appendTo('body').submit().remove()\n}\n\nexport { downloadFile }\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/module/download/index.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue","/**\n * jsBezier\n *\n * Copyright (c) 2010 - 2017 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * licensed under the MIT license.\n *\n * a set of Bezier curve functions that deal with Beziers, used by jsPlumb, and perhaps useful for other people. These functions work with Bezier\n * curves of arbitrary degree.\n *\n * - functions are all in the 'jsBezier' namespace.\n *\n * - all input points should be in the format {x:.., y:..}. all output points are in this format too.\n *\n * - all input curves should be in the format [ {x:.., y:..}, {x:.., y:..}, {x:.., y:..}, {x:.., y:..} ]\n *\n * - 'location' as used as an input here refers to a decimal in the range 0-1 inclusive, which indicates a point some proportion along the length\n * of the curve. location as output has the same format and meaning.\n *\n *\n * Function List:\n * --------------\n *\n * distanceFromCurve(point, curve)\n *\n * \tCalculates the distance that the given point lies from the given Bezier. Note that it is computed relative to the center of the Bezier,\n * so if you have stroked the curve with a wide pen you may wish to take that into account! The distance returned is relative to the values\n * of the curve and the point - it will most likely be pixels.\n *\n * gradientAtPoint(curve, location)\n *\n * \tCalculates the gradient to the curve at the given location, as a decimal between 0 and 1 inclusive.\n *\n * gradientAtPointAlongCurveFrom (curve, location)\n *\n *\tCalculates the gradient at the point on the given curve that is 'distance' units from location.\n *\n * nearestPointOnCurve(point, curve)\n *\n *\tCalculates the nearest point to the given point on the given curve. The return value of this is a JS object literal, containing both the\n *point's coordinates and also the 'location' of the point (see above), for example: { point:{x:551,y:150}, location:0.263365 }.\n *\n * pointOnCurve(curve, location)\n *\n * \tCalculates the coordinates of the point on the given Bezier curve at the given location.\n *\n * pointAlongCurveFrom(curve, location, distance)\n *\n * \tCalculates the coordinates of the point on the given curve that is 'distance' units from location. 'distance' should be in the same coordinate\n * space as that used to construct the Bezier curve. For an HTML Canvas usage, for example, distance would be a measure of pixels.\n *\n * locationAlongCurveFrom(curve, location, distance)\n *\n * \tCalculates the location on the given curve that is 'distance' units from location. 'distance' should be in the same coordinate\n * space as that used to construct the Bezier curve. For an HTML Canvas usage, for example, distance would be a measure of pixels.\n *\n * perpendicularToCurveAt(curve, location, length, distance)\n *\n * \tCalculates the perpendicular to the given curve at the given location. length is the length of the line you wish for (it will be centered\n * on the point at 'location'). distance is optional, and allows you to specify a point along the path from the given location as the center of\n * the perpendicular returned. The return value of this is an array of two points: [ {x:...,y:...}, {x:...,y:...} ].\n *\n *\n */\n\n(function() {\n\n var root = this;\n\n if(typeof Math.sgn == \"undefined\") {\n Math.sgn = function(x) { return x == 0 ? 0 : x > 0 ? 1 :-1; };\n }\n\n var Vectors = {\n subtract \t: \tfunction(v1, v2) { return {x:v1.x - v2.x, y:v1.y - v2.y }; },\n dotProduct\t: \tfunction(v1, v2) { return (v1.x * v2.x) + (v1.y * v2.y); },\n square\t\t:\tfunction(v) { return Math.sqrt((v.x * v.x) + (v.y * v.y)); },\n scale\t\t:\tfunction(v, s) { return {x:v.x * s, y:v.y * s }; }\n },\n\n maxRecursion = 64,\n flatnessTolerance = Math.pow(2.0,-maxRecursion-1);\n\n /**\n * Calculates the distance that the point lies from the curve.\n *\n * @param point a point in the form {x:567, y:3342}\n * @param curve a Bezier curve in the form [{x:..., y:...}, {x:..., y:...}, {x:..., y:...}, {x:..., y:...}]. note that this is currently\n * hardcoded to assume cubiz beziers, but would be better off supporting any degree.\n * @return a JS object literal containing location and distance, for example: {location:0.35, distance:10}. Location is analogous to the location\n * argument you pass to the pointOnPath function: it is a ratio of distance travelled along the curve. Distance is the distance in pixels from\n * the point to the curve.\n */\n var _distanceFromCurve = function(point, curve) {\n var candidates = [],\n w = _convertToBezier(point, curve),\n degree = curve.length - 1, higherDegree = (2 * degree) - 1,\n numSolutions = _findRoots(w, higherDegree, candidates, 0),\n v = Vectors.subtract(point, curve[0]), dist = Vectors.square(v), t = 0.0;\n\n for (var i = 0; i < numSolutions; i++) {\n v = Vectors.subtract(point, _bezier(curve, degree, candidates[i], null, null));\n var newDist = Vectors.square(v);\n if (newDist < dist) {\n dist = newDist;\n t = candidates[i];\n }\n }\n v = Vectors.subtract(point, curve[degree]);\n newDist = Vectors.square(v);\n if (newDist < dist) {\n dist = newDist;\n t = 1.0;\n }\n return {location:t, distance:dist};\n };\n /**\n * finds the nearest point on the curve to the given point.\n */\n var _nearestPointOnCurve = function(point, curve) {\n var td = _distanceFromCurve(point, curve);\n return {point:_bezier(curve, curve.length - 1, td.location, null, null), location:td.location};\n };\n var _convertToBezier = function(point, curve) {\n var degree = curve.length - 1, higherDegree = (2 * degree) - 1,\n c = [], d = [], cdTable = [], w = [],\n z = [ [1.0, 0.6, 0.3, 0.1], [0.4, 0.6, 0.6, 0.4], [0.1, 0.3, 0.6, 1.0] ];\n\n for (var i = 0; i <= degree; i++) c[i] = Vectors.subtract(curve[i], point);\n for (var i = 0; i <= degree - 1; i++) {\n d[i] = Vectors.subtract(curve[i+1], curve[i]);\n d[i] = Vectors.scale(d[i], 3.0);\n }\n for (var row = 0; row <= degree - 1; row++) {\n for (var column = 0; column <= degree; column++) {\n if (!cdTable[row]) cdTable[row] = [];\n cdTable[row][column] = Vectors.dotProduct(d[row], c[column]);\n }\n }\n for (i = 0; i <= higherDegree; i++) {\n if (!w[i]) w[i] = [];\n w[i].y = 0.0;\n w[i].x = parseFloat(i) / higherDegree;\n }\n var n = degree, m = degree-1;\n for (var k = 0; k <= n + m; k++) {\n var lb = Math.max(0, k - m),\n ub = Math.min(k, n);\n for (i = lb; i <= ub; i++) {\n var j = k - i;\n w[i+j].y += cdTable[j][i] * z[j][i];\n }\n }\n return w;\n };\n /**\n * counts how many roots there are.\n */\n var _findRoots = function(w, degree, t, depth) {\n var left = [], right = [],\n left_count, right_count,\n left_t = [], right_t = [];\n\n switch (_getCrossingCount(w, degree)) {\n case 0 : {\n return 0;\n }\n case 1 : {\n if (depth >= maxRecursion) {\n t[0] = (w[0].x + w[degree].x) / 2.0;\n return 1;\n }\n if (_isFlatEnough(w, degree)) {\n t[0] = _computeXIntercept(w, degree);\n return 1;\n }\n break;\n }\n }\n _bezier(w, degree, 0.5, left, right);\n left_count = _findRoots(left, degree, left_t, depth+1);\n right_count = _findRoots(right, degree, right_t, depth+1);\n for (var i = 0; i < left_count; i++) t[i] = left_t[i];\n for (var i = 0; i < right_count; i++) t[i+left_count] = right_t[i];\n return (left_count+right_count);\n };\n var _getCrossingCount = function(curve, degree) {\n var n_crossings = 0, sign, old_sign;\n sign = old_sign = Math.sgn(curve[0].y);\n for (var i = 1; i <= degree; i++) {\n sign = Math.sgn(curve[i].y);\n if (sign != old_sign) n_crossings++;\n old_sign = sign;\n }\n return n_crossings;\n };\n var _isFlatEnough = function(curve, degree) {\n var error,\n intercept_1, intercept_2, left_intercept, right_intercept,\n a, b, c, det, dInv, a1, b1, c1, a2, b2, c2;\n a = curve[0].y - curve[degree].y;\n b = curve[degree].x - curve[0].x;\n c = curve[0].x * curve[degree].y - curve[degree].x * curve[0].y;\n\n var max_distance_above, max_distance_below;\n max_distance_above = max_distance_below = 0.0;\n\n for (var i = 1; i < degree; i++) {\n var value = a * curve[i].x + b * curve[i].y + c;\n if (value > max_distance_above)\n max_distance_above = value;\n else if (value < max_distance_below)\n max_distance_below = value;\n }\n\n a1 = 0.0; b1 = 1.0; c1 = 0.0; a2 = a; b2 = b;\n c2 = c - max_distance_above;\n det = a1 * b2 - a2 * b1;\n dInv = 1.0/det;\n intercept_1 = (b1 * c2 - b2 * c1) * dInv;\n a2 = a; b2 = b; c2 = c - max_distance_below;\n det = a1 * b2 - a2 * b1;\n dInv = 1.0/det;\n intercept_2 = (b1 * c2 - b2 * c1) * dInv;\n left_intercept = Math.min(intercept_1, intercept_2);\n right_intercept = Math.max(intercept_1, intercept_2);\n error = right_intercept - left_intercept;\n return (error < flatnessTolerance)? 1 : 0;\n };\n var _computeXIntercept = function(curve, degree) {\n var XLK = 1.0, YLK = 0.0,\n XNM = curve[degree].x - curve[0].x, YNM = curve[degree].y - curve[0].y,\n XMK = curve[0].x - 0.0, YMK = curve[0].y - 0.0,\n det = XNM*YLK - YNM*XLK, detInv = 1.0/det,\n S = (XNM*YMK - YNM*XMK) * detInv;\n return 0.0 + XLK * S;\n };\n var _bezier = function(curve, degree, t, left, right) {\n var temp = [[]];\n for (var j =0; j <= degree; j++) temp[0][j] = curve[j];\n for (var i = 1; i <= degree; i++) {\n for (var j =0 ; j <= degree - i; j++) {\n if (!temp[i]) temp[i] = [];\n if (!temp[i][j]) temp[i][j] = {};\n temp[i][j].x = (1.0 - t) * temp[i-1][j].x + t * temp[i-1][j+1].x;\n temp[i][j].y = (1.0 - t) * temp[i-1][j].y + t * temp[i-1][j+1].y;\n }\n }\n if (left != null)\n for (j = 0; j <= degree; j++) left[j] = temp[j][0];\n if (right != null)\n for (j = 0; j <= degree; j++) right[j] = temp[degree-j][j];\n\n return (temp[degree][0]);\n };\n\n var _curveFunctionCache = {};\n var _getCurveFunctions = function(order) {\n var fns = _curveFunctionCache[order];\n if (!fns) {\n fns = [];\n var f_term = function() { return function(t) { return Math.pow(t, order); }; },\n l_term = function() { return function(t) { return Math.pow((1-t), order); }; },\n c_term = function(c) { return function(t) { return c; }; },\n t_term = function() { return function(t) { return t; }; },\n one_minus_t_term = function() { return function(t) { return 1-t; }; },\n _termFunc = function(terms) {\n return function(t) {\n var p = 1;\n for (var i = 0; i < terms.length; i++) p = p * terms[i](t);\n return p;\n };\n };\n\n fns.push(new f_term()); // first is t to the power of the curve order\n for (var i = 1; i < order; i++) {\n var terms = [new c_term(order)];\n for (var j = 0 ; j < (order - i); j++) terms.push(new t_term());\n for (var j = 0 ; j < i; j++) terms.push(new one_minus_t_term());\n fns.push(new _termFunc(terms));\n }\n fns.push(new l_term()); // last is (1-t) to the power of the curve order\n\n _curveFunctionCache[order] = fns;\n }\n\n return fns;\n };\n\n\n /**\n * calculates a point on the curve, for a Bezier of arbitrary order.\n * @param curve an array of control points, eg [{x:10,y:20}, {x:50,y:50}, {x:100,y:100}, {x:120,y:100}]. For a cubic bezier this should have four points.\n * @param location a decimal indicating the distance along the curve the point should be located at. this is the distance along the curve as it travels, taking the way it bends into account. should be a number from 0 to 1, inclusive.\n */\n var _pointOnPath = function(curve, location) {\n var cc = _getCurveFunctions(curve.length - 1),\n _x = 0, _y = 0;\n for (var i = 0; i < curve.length ; i++) {\n _x = _x + (curve[i].x * cc[i](location));\n _y = _y + (curve[i].y * cc[i](location));\n }\n\n return {x:_x, y:_y};\n };\n\n var _dist = function(p1,p2) {\n return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));\n };\n\n var _isPoint = function(curve) {\n return curve[0].x === curve[1].x && curve[0].y === curve[1].y;\n };\n\n /**\n * finds the point that is 'distance' along the path from 'location'. this method returns both the x,y location of the point and also\n * its 'location' (proportion of travel along the path); the method below - _pointAlongPathFrom - calls this method and just returns the\n * point.\n */\n var _pointAlongPath = function(curve, location, distance) {\n\n if (_isPoint(curve)) {\n return {\n point:curve[0],\n location:location\n };\n }\n\n var prev = _pointOnPath(curve, location),\n tally = 0,\n curLoc = location,\n direction = distance > 0 ? 1 : -1,\n cur = null;\n\n while (tally < Math.abs(distance)) {\n curLoc += (0.005 * direction);\n cur = _pointOnPath(curve, curLoc);\n tally += _dist(cur, prev);\n prev = cur;\n }\n return {point:cur, location:curLoc};\n };\n\n var _length = function(curve) {\n if (_isPoint(curve)) return 0;\n\n var prev = _pointOnPath(curve, 0),\n tally = 0,\n curLoc = 0,\n direction = 1,\n cur = null;\n\n while (curLoc < 1) {\n curLoc += (0.005 * direction);\n cur = _pointOnPath(curve, curLoc);\n tally += _dist(cur, prev);\n prev = cur;\n }\n return tally;\n };\n\n /**\n * finds the point that is 'distance' along the path from 'location'.\n */\n var _pointAlongPathFrom = function(curve, location, distance) {\n return _pointAlongPath(curve, location, distance).point;\n };\n\n /**\n * finds the location that is 'distance' along the path from 'location'.\n */\n var _locationAlongPathFrom = function(curve, location, distance) {\n return _pointAlongPath(curve, location, distance).location;\n };\n\n /**\n * returns the gradient of the curve at the given location, which is a decimal between 0 and 1 inclusive.\n *\n * thanks // http://bimixual.org/AnimationLibrary/beziertangents.html\n */\n var _gradientAtPoint = function(curve, location) {\n var p1 = _pointOnPath(curve, location),\n p2 = _pointOnPath(curve.slice(0, curve.length - 1), location),\n dy = p2.y - p1.y, dx = p2.x - p1.x;\n return dy === 0 ? Infinity : Math.atan(dy / dx);\n };\n\n /**\n returns the gradient of the curve at the point which is 'distance' from the given location.\n if this point is greater than location 1, the gradient at location 1 is returned.\n if this point is less than location 0, the gradient at location 0 is returned.\n */\n var _gradientAtPointAlongPathFrom = function(curve, location, distance) {\n var p = _pointAlongPath(curve, location, distance);\n if (p.location > 1) p.location = 1;\n if (p.location < 0) p.location = 0;\n return _gradientAtPoint(curve, p.location);\n };\n\n /**\n * calculates a line that is 'length' pixels long, perpendicular to, and centered on, the path at 'distance' pixels from the given location.\n * if distance is not supplied, the perpendicular for the given location is computed (ie. we set distance to zero).\n */\n var _perpendicularToPathAt = function(curve, location, length, distance) {\n distance = distance == null ? 0 : distance;\n var p = _pointAlongPath(curve, location, distance),\n m = _gradientAtPoint(curve, p.location),\n _theta2 = Math.atan(-1 / m),\n y = length / 2 * Math.sin(_theta2),\n x = length / 2 * Math.cos(_theta2);\n return [{x:p.point.x + x, y:p.point.y + y}, {x:p.point.x - x, y:p.point.y - y}];\n };\n\n /**\n * Calculates all intersections of the given line with the given curve.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param curve\n * @returns {Array}\n */\n var _lineIntersection = function(x1, y1, x2, y2, curve) {\n var a = y2 - y1,\n b = x1 - x2,\n c = (x1 * (y1 - y2)) + (y1 * (x2-x1)),\n coeffs = _computeCoefficients(curve),\n p = [\n (a*coeffs[0][0]) + (b * coeffs[1][0]),\n (a*coeffs[0][1])+(b*coeffs[1][1]),\n (a*coeffs[0][2])+(b*coeffs[1][2]),\n (a*coeffs[0][3])+(b*coeffs[1][3]) + c\n ],\n r = _cubicRoots.apply(null, p),\n intersections = [];\n\n if (r != null) {\n\n for (var i = 0; i < 3; i++) {\n var t = r[i],\n t2 = Math.pow(t, 2),\n t3 = Math.pow(t, 3),\n x = [\n (coeffs[0][0] * t3) + (coeffs[0][1] * t2) + (coeffs[0][2] * t) + coeffs[0][3],\n (coeffs[1][0] * t3) + (coeffs[1][1] * t2) + (coeffs[1][2] * t) + coeffs[1][3]\n ];\n\n // check bounds of the line\n var s;\n if ((x2 - x1) !== 0) {\n s = (x[0] - x1) / (x2 - x1);\n }\n else {\n s = (x[1] - y1) / (y2 - y1);\n }\n\n if (t >= 0 && t <= 1.0 && s >= 0 && s <= 1.0) {\n intersections.push(x);\n }\n }\n }\n\n return intersections;\n };\n\n /**\n * Calculates all intersections of the given box with the given curve.\n * @param x X position of top left corner of box\n * @param y Y position of top left corner of box\n * @param w width of box\n * @param h height of box\n * @param curve\n * @returns {Array}\n */\n var _boxIntersection = function(x, y, w, h, curve) {\n var i = [];\n i.push.apply(i, _lineIntersection(x, y, x + w, y, curve));\n i.push.apply(i, _lineIntersection(x + w, y, x + w, y + h, curve));\n i.push.apply(i, _lineIntersection(x + w, y + h, x, y + h, curve));\n i.push.apply(i, _lineIntersection(x, y + h, x, y, curve));\n return i;\n };\n\n /**\n * Calculates all intersections of the given bounding box with the given curve.\n * @param boundingBox Bounding box, in { x:.., y:..., w:..., h:... } format.\n * @param curve\n * @returns {Array}\n */\n var _boundingBoxIntersection = function(boundingBox, curve) {\n var i = [];\n i.push.apply(i, _lineIntersection(boundingBox.x, boundingBox.y, boundingBox.x + boundingBox.w, boundingBox.y, curve));\n i.push.apply(i, _lineIntersection(boundingBox.x + boundingBox.w, boundingBox.y, boundingBox.x + boundingBox.w, boundingBox.y + boundingBox.h, curve));\n i.push.apply(i, _lineIntersection(boundingBox.x + boundingBox.w, boundingBox.y + boundingBox.h, boundingBox.x, boundingBox.y + boundingBox.h, curve));\n i.push.apply(i, _lineIntersection(boundingBox.x, boundingBox.y + boundingBox.h, boundingBox.x, boundingBox.y, curve));\n return i;\n };\n\n\n function _computeCoefficientsForAxis(curve, axis) {\n return [\n -(curve[0][axis]) + (3*curve[1][axis]) + (-3 * curve[2][axis]) + curve[3][axis],\n (3*(curve[0][axis])) - (6*(curve[1][axis])) + (3*(curve[2][axis])),\n -3*curve[0][axis] + 3*curve[1][axis],\n curve[0][axis]\n ];\n }\n\n function _computeCoefficients(curve)\n {\n return [\n _computeCoefficientsForAxis(curve, \"x\"),\n _computeCoefficientsForAxis(curve, \"y\")\n ];\n }\n\n function sgn(x) {\n return x < 0 ? -1 : x > 0 ? 1 : 0;\n }\n\n function _cubicRoots(a, b, c, d) {\n var A = b / a,\n B = c / a,\n C = d / a,\n Q = (3*B - Math.pow(A, 2))/9,\n R = (9*A*B - 27*C - 2*Math.pow(A, 3))/54,\n D = Math.pow(Q, 3) + Math.pow(R, 2),\n S,\n T,\n t = [];\n\n if (D >= 0) // complex or duplicate roots\n {\n S = sgn(R + Math.sqrt(D))*Math.pow(Math.abs(R + Math.sqrt(D)),(1/3));\n T = sgn(R - Math.sqrt(D))*Math.pow(Math.abs(R - Math.sqrt(D)),(1/3));\n\n t[0] = -A/3 + (S + T);\n t[1] = -A/3 - (S + T)/2;\n t[2] = -A/3 - (S + T)/2;\n\n /*discard complex roots*/\n if (Math.abs(Math.sqrt(3)*(S - T)/2) !== 0) {\n t[1] = -1;\n t[2] = -1;\n }\n }\n else // distinct real roots\n {\n var th = Math.acos(R/Math.sqrt(-Math.pow(Q, 3)));\n t[0] = 2*Math.sqrt(-Q)*Math.cos(th/3) - A/3;\n t[1] = 2*Math.sqrt(-Q)*Math.cos((th + 2*Math.PI)/3) - A/3;\n t[2] = 2*Math.sqrt(-Q)*Math.cos((th + 4*Math.PI)/3) - A/3;\n }\n\n // discard out of spec roots\n for (var i = 0; i < 3; i++) {\n if (t[i] < 0 || t[i] > 1.0) {\n t[i] = -1;\n }\n }\n\n return t;\n }\n\n var jsBezier = this.jsBezier = {\n distanceFromCurve : _distanceFromCurve,\n gradientAtPoint : _gradientAtPoint,\n gradientAtPointAlongCurveFrom : _gradientAtPointAlongPathFrom,\n nearestPointOnCurve : _nearestPointOnCurve,\n pointOnCurve : _pointOnPath,\n pointAlongCurveFrom : _pointAlongPathFrom,\n perpendicularToCurveAt : _perpendicularToPathAt,\n locationAlongCurveFrom:_locationAlongPathFrom,\n getLength:_length,\n lineIntersection:_lineIntersection,\n boxIntersection:_boxIntersection,\n boundingBoxIntersection:_boundingBoxIntersection,\n version:\"0.9.0\"\n };\n\n if (typeof exports !== \"undefined\") {\n exports.jsBezier = jsBezier;\n }\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/**\n * Biltong v0.4.0\n *\n * Various geometry functions written as part of jsPlumb and perhaps useful for others.\n *\n * Copyright (c) 2017 jsPlumb\n * https://jsplumbtoolkit.com\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n;(function() {\n\n \"use strict\";\n var root = this;\n\n var Biltong = root.Biltong = {\n version:\"0.4.0\"\n };\n\n if (typeof exports !== \"undefined\") {\n exports.Biltong = Biltong;\n }\n\n var _isa = function(a) { return Object.prototype.toString.call(a) === \"[object Array]\"; },\n _pointHelper = function(p1, p2, fn) {\n p1 = _isa(p1) ? p1 : [p1.x, p1.y];\n p2 = _isa(p2) ? p2 : [p2.x, p2.y];\n return fn(p1, p2);\n },\n /**\n * @name Biltong.gradient\n * @function\n * @desc Calculates the gradient of a line between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The gradient of a line between the two points.\n */\n _gradient = Biltong.gradient = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n if (_p2[0] == _p1[0])\n return _p2[1] > _p1[1] ? Infinity : -Infinity;\n else if (_p2[1] == _p1[1])\n return _p2[0] > _p1[0] ? 0 : -0;\n else\n return (_p2[1] - _p1[1]) / (_p2[0] - _p1[0]);\n });\n },\n /**\n * @name Biltong.normal\n * @function\n * @desc Calculates the gradient of a normal to a line between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The gradient of a normal to a line between the two points.\n */\n _normal = Biltong.normal = function(p1, p2) {\n return -1 / _gradient(p1, p2);\n },\n /**\n * @name Biltong.lineLength\n * @function\n * @desc Calculates the length of a line between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The length of a line between the two points.\n */\n _lineLength = Biltong.lineLength = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n return Math.sqrt(Math.pow(_p2[1] - _p1[1], 2) + Math.pow(_p2[0] - _p1[0], 2));\n });\n },\n /**\n * @name Biltong.quadrant\n * @function\n * @desc Calculates the quadrant in which the angle between the two points lies.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Integer} The quadrant - 1 for upper right, 2 for lower right, 3 for lower left, 4 for upper left.\n */\n _quadrant = Biltong.quadrant = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n if (_p2[0] > _p1[0]) {\n return (_p2[1] > _p1[1]) ? 2 : 1;\n }\n else if (_p2[0] == _p1[0]) {\n return _p2[1] > _p1[1] ? 2 : 1;\n }\n else {\n return (_p2[1] > _p1[1]) ? 3 : 4;\n }\n });\n },\n /**\n * @name Biltong.theta\n * @function\n * @desc Calculates the angle between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The angle between the two points.\n */\n _theta = Biltong.theta = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n var m = _gradient(_p1, _p2),\n t = Math.atan(m),\n s = _quadrant(_p1, _p2);\n if ((s == 4 || s== 3)) t += Math.PI;\n if (t < 0) t += (2 * Math.PI);\n\n return t;\n });\n },\n /**\n * @name Biltong.intersects\n * @function\n * @desc Calculates whether or not the two rectangles intersect.\n * @param {Rectangle} r1 First rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @param {Rectangle} r2 Second rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @return {Boolean} True if the rectangles intersect, false otherwise.\n */\n _intersects = Biltong.intersects = function(r1, r2) {\n var x1 = r1.x, x2 = r1.x + r1.w, y1 = r1.y, y2 = r1.y + r1.h,\n a1 = r2.x, a2 = r2.x + r2.w, b1 = r2.y, b2 = r2.y + r2.h;\n\n return ( (x1 <= a1 && a1 <= x2) && (y1 <= b1 && b1 <= y2) ) ||\n ( (x1 <= a2 && a2 <= x2) && (y1 <= b1 && b1 <= y2) ) ||\n ( (x1 <= a1 && a1 <= x2) && (y1 <= b2 && b2 <= y2) ) ||\n ( (x1 <= a2 && a1 <= x2) && (y1 <= b2 && b2 <= y2) ) ||\n ( (a1 <= x1 && x1 <= a2) && (b1 <= y1 && y1 <= b2) ) ||\n ( (a1 <= x2 && x2 <= a2) && (b1 <= y1 && y1 <= b2) ) ||\n ( (a1 <= x1 && x1 <= a2) && (b1 <= y2 && y2 <= b2) ) ||\n ( (a1 <= x2 && x1 <= a2) && (b1 <= y2 && y2 <= b2) );\n },\n /**\n * @name Biltong.encloses\n * @function\n * @desc Calculates whether or not r2 is completely enclosed by r1.\n * @param {Rectangle} r1 First rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @param {Rectangle} r2 Second rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @param {Boolean} [allowSharedEdges=false] If true, the concept of enclosure allows for one or more edges to be shared by the two rectangles.\n * @return {Boolean} True if r1 encloses r2, false otherwise.\n */\n _encloses = Biltong.encloses = function(r1, r2, allowSharedEdges) {\n var x1 = r1.x, x2 = r1.x + r1.w, y1 = r1.y, y2 = r1.y + r1.h,\n a1 = r2.x, a2 = r2.x + r2.w, b1 = r2.y, b2 = r2.y + r2.h,\n c = function(v1, v2, v3, v4) { return allowSharedEdges ? v1 <= v2 && v3>= v4 : v1 < v2 && v3 > v4; };\n\n return c(x1,a1,x2,a2) && c(y1,b1,y2,b2);\n },\n _segmentMultipliers = [null, [1, -1], [1, 1], [-1, 1], [-1, -1] ],\n _inverseSegmentMultipliers = [null, [-1, -1], [-1, 1], [1, 1], [1, -1] ],\n /**\n * @name Biltong.pointOnLine\n * @function\n * @desc Calculates a point on the line from `fromPoint` to `toPoint` that is `distance` units along the length of the line.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Point} Point on the line, in the form `{ x:..., y:... }`.\n */\n _pointOnLine = Biltong.pointOnLine = function(fromPoint, toPoint, distance) {\n var m = _gradient(fromPoint, toPoint),\n s = _quadrant(fromPoint, toPoint),\n segmentMultiplier = distance > 0 ? _segmentMultipliers[s] : _inverseSegmentMultipliers[s],\n theta = Math.atan(m),\n y = Math.abs(distance * Math.sin(theta)) * segmentMultiplier[1],\n x = Math.abs(distance * Math.cos(theta)) * segmentMultiplier[0];\n return { x:fromPoint.x + x, y:fromPoint.y + y };\n },\n /**\n * @name Biltong.perpendicularLineTo\n * @function\n * @desc Calculates a line of length `length` that is perpendicular to the line from `fromPoint` to `toPoint` and passes through `toPoint`.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Line} Perpendicular line, in the form `[ { x:..., y:... }, { x:..., y:... } ]`.\n */\n _perpendicularLineTo = Biltong.perpendicularLineTo = function(fromPoint, toPoint, length) {\n var m = _gradient(fromPoint, toPoint),\n theta2 = Math.atan(-1 / m),\n y = length / 2 * Math.sin(theta2),\n x = length / 2 * Math.cos(theta2);\n return [{x:toPoint.x + x, y:toPoint.y + y}, {x:toPoint.x - x, y:toPoint.y - y}];\n };\n}).call(typeof window !== 'undefined' ? window : this);\n;\n(function () {\n\n \"use strict\";\n\n /**\n * Creates a Touch object.\n * @param view\n * @param target\n * @param pageX\n * @param pageY\n * @param screenX\n * @param screenY\n * @param clientX\n * @param clientY\n * @returns {Touch}\n * @private\n */\n function _touch(view, target, pageX, pageY, screenX, screenY, clientX, clientY) {\n\n return new Touch({\n target:target,\n identifier:_uuid(),\n pageX: pageX,\n pageY: pageY,\n screenX: screenX,\n screenY: screenY,\n clientX: clientX || screenX,\n clientY: clientY || screenY\n });\n }\n\n /**\n * Create a synthetic touch list from the given list of Touch objects.\n * @returns {Array}\n * @private\n */\n function _touchList() {\n var list = [];\n Array.prototype.push.apply(list, arguments);\n list.item = function(index) { return this[index]; };\n return list;\n }\n\n /**\n * Create a Touch object and then insert it into a synthetic touch list, returning the list.s\n * @param view\n * @param target\n * @param pageX\n * @param pageY\n * @param screenX\n * @param screenY\n * @param clientX\n * @param clientY\n * @returns {Array}\n * @private\n */\n function _touchAndList(view, target, pageX, pageY, screenX, screenY, clientX, clientY) {\n return _touchList(_touch.apply(null, arguments));\n }\n\n var root = this,\n matchesSelector = function (el, selector, ctx) {\n ctx = ctx || el.parentNode;\n var possibles = ctx.querySelectorAll(selector);\n for (var i = 0; i < possibles.length; i++) {\n if (possibles[i] === el) {\n return true;\n }\n }\n return false;\n },\n _gel = function (el) {\n return (typeof el == \"string\" || el.constructor === String) ? document.getElementById(el) : el;\n },\n _t = function (e) {\n return e.srcElement || e.target;\n },\n //\n // gets path info for the given event - the path from target to obj, in the event's bubble chain. if doCompute\n // is false we just return target for the path.\n //\n _pi = function(e, target, obj, doCompute) {\n if (!doCompute) return { path:[target], end:1 };\n else if (typeof e.path !== \"undefined\" && e.path.indexOf) {\n return { path: e.path, end: e.path.indexOf(obj) };\n } else {\n var out = { path:[], end:-1 }, _one = function(el) {\n out.path.push(el);\n if (el === obj) {\n out.end = out.path.length - 1;\n }\n else if (el.parentNode != null) {\n _one(el.parentNode)\n }\n };\n _one(target);\n return out;\n }\n },\n _d = function (l, fn) {\n for (var i = 0, j = l.length; i < j; i++) {\n if (l[i] == fn) break;\n }\n if (i < l.length) l.splice(i, 1);\n },\n guid = 1,\n //\n // this function generates a guid for every handler, sets it on the handler, then adds\n // it to the associated object's map of handlers for the given event. this is what enables us\n // to unbind all events of some type, or all events (the second of which can be requested by the user,\n // but it also used by Mottle when an element is removed.)\n _store = function (obj, event, fn) {\n var g = guid++;\n obj.__ta = obj.__ta || {};\n obj.__ta[event] = obj.__ta[event] || {};\n // store each handler with a unique guid.\n obj.__ta[event][g] = fn;\n // set the guid on the handler.\n fn.__tauid = g;\n return g;\n },\n _unstore = function (obj, event, fn) {\n obj.__ta && obj.__ta[event] && delete obj.__ta[event][fn.__tauid];\n // a handler might have attached extra functions, so we unbind those too.\n if (fn.__taExtra) {\n for (var i = 0; i < fn.__taExtra.length; i++) {\n _unbind(obj, fn.__taExtra[i][0], fn.__taExtra[i][1]);\n }\n fn.__taExtra.length = 0;\n }\n // a handler might have attached an unstore callback\n fn.__taUnstore && fn.__taUnstore();\n },\n _curryChildFilter = function (children, obj, fn, evt) {\n if (children == null) return fn;\n else {\n var c = children.split(\",\"),\n _fn = function (e) {\n _fn.__tauid = fn.__tauid;\n var t = _t(e), target = t; // t is the target element on which the event occurred. it is the\n // element we will wish to pass to any callbacks.\n var pathInfo = _pi(e, t, obj, children != null)\n if (pathInfo.end != -1) {\n for (var p = 0; p < pathInfo.end; p++) {\n target = pathInfo.path[p];\n for (var i = 0; i < c.length; i++) {\n if (matchesSelector(target, c[i], obj)) {\n fn.apply(target, arguments);\n }\n }\n }\n }\n };\n registerExtraFunction(fn, evt, _fn);\n return _fn;\n }\n },\n //\n // registers an 'extra' function on some event listener function we were given - a function that we\n // created and bound to the element as part of our housekeeping, and which we want to unbind and remove\n // whenever the given function is unbound.\n registerExtraFunction = function (fn, evt, newFn) {\n fn.__taExtra = fn.__taExtra || [];\n fn.__taExtra.push([evt, newFn]);\n },\n DefaultHandler = function (obj, evt, fn, children) {\n if (isTouchDevice && touchMap[evt]) {\n var tfn = _curryChildFilter(children, obj, fn, touchMap[evt]);\n _bind(obj, touchMap[evt], tfn , fn);\n }\n if (evt === \"focus\" && obj.getAttribute(\"tabindex\") == null) {\n obj.setAttribute(\"tabindex\", \"1\");\n }\n _bind(obj, evt, _curryChildFilter(children, obj, fn, evt), fn);\n },\n SmartClickHandler = function (obj, evt, fn, children) {\n if (obj.__taSmartClicks == null) {\n var down = function (e) {\n obj.__tad = _pageLocation(e);\n },\n up = function (e) {\n obj.__tau = _pageLocation(e);\n },\n click = function (e) {\n if (obj.__tad && obj.__tau && obj.__tad[0] === obj.__tau[0] && obj.__tad[1] === obj.__tau[1]) {\n for (var i = 0; i < obj.__taSmartClicks.length; i++)\n obj.__taSmartClicks[i].apply(_t(e), [ e ]);\n }\n };\n DefaultHandler(obj, \"mousedown\", down, children);\n DefaultHandler(obj, \"mouseup\", up, children);\n DefaultHandler(obj, \"click\", click, children);\n obj.__taSmartClicks = [];\n }\n\n // store in the list of callbacks\n obj.__taSmartClicks.push(fn);\n // the unstore function removes this function from the object's listener list for this type.\n fn.__taUnstore = function () {\n _d(obj.__taSmartClicks, fn);\n };\n },\n _tapProfiles = {\n \"tap\": {touches: 1, taps: 1},\n \"dbltap\": {touches: 1, taps: 2},\n \"contextmenu\": {touches: 2, taps: 1}\n },\n TapHandler = function (clickThreshold, dblClickThreshold) {\n return function (obj, evt, fn, children) {\n // if event is contextmenu, for devices which are mouse only, we want to\n // use the default bind.\n if (evt == \"contextmenu\" && isMouseDevice)\n DefaultHandler(obj, evt, fn, children);\n else {\n // the issue here is that this down handler gets registered only for the\n // child nodes in the first registration. in fact it should be registered with\n // no child selector and then on down we should cycle through the registered\n // functions to see if one of them matches. on mouseup we should execute ALL of\n // the functions whose children are either null or match the element.\n if (obj.__taTapHandler == null) {\n var tt = obj.__taTapHandler = {\n tap: [],\n dbltap: [],\n contextmenu: [],\n down: false,\n taps: 0,\n downSelectors: []\n };\n var down = function (e) {\n var target = _t(e), pathInfo = _pi(e, target, obj, children != null), finished = false;\n for (var p = 0; p < pathInfo.end; p++) {\n if (finished) return;\n target = pathInfo.path[p];\n for (var i = 0; i < tt.downSelectors.length; i++) {\n if (tt.downSelectors[i] == null || matchesSelector(target, tt.downSelectors[i], obj)) {\n tt.down = true;\n setTimeout(clearSingle, clickThreshold);\n setTimeout(clearDouble, dblClickThreshold);\n finished = true;\n break; // we only need one match on mousedown\n }\n }\n }\n },\n up = function (e) {\n if (tt.down) {\n var target = _t(e), currentTarget, pathInfo;\n tt.taps++;\n var tc = _touchCount(e);\n for (var eventId in _tapProfiles) {\n if (_tapProfiles.hasOwnProperty(eventId)) {\n var p = _tapProfiles[eventId];\n if (p.touches === tc && (p.taps === 1 || p.taps === tt.taps)) {\n for (var i = 0; i < tt[eventId].length; i++) {\n pathInfo = _pi(e, target, obj, tt[eventId][i][1] != null);\n for (var pLoop = 0; pLoop < pathInfo.end; pLoop++) {\n currentTarget = pathInfo.path[pLoop];\n // this is a single event registration handler.\n if (tt[eventId][i][1] == null || matchesSelector(currentTarget, tt[eventId][i][1], obj)) {\n tt[eventId][i][0].apply(currentTarget, [ e ]);\n break;\n }\n }\n }\n }\n }\n }\n }\n },\n clearSingle = function () {\n tt.down = false;\n },\n clearDouble = function () {\n tt.taps = 0;\n };\n\n DefaultHandler(obj, \"mousedown\", down);\n DefaultHandler(obj, \"mouseup\", up);\n }\n // add this child selector (it can be null, that's fine).\n obj.__taTapHandler.downSelectors.push(children);\n\n obj.__taTapHandler[evt].push([fn, children]);\n // the unstore function removes this function from the object's listener list for this type.\n fn.__taUnstore = function () {\n _d(obj.__taTapHandler[evt], fn);\n };\n }\n };\n },\n meeHelper = function (type, evt, obj, target) {\n for (var i in obj.__tamee[type]) {\n if (obj.__tamee[type].hasOwnProperty(i)) {\n obj.__tamee[type][i].apply(target, [ evt ]);\n }\n }\n },\n MouseEnterExitHandler = function () {\n var activeElements = [];\n return function (obj, evt, fn, children) {\n if (!obj.__tamee) {\n // __tamee holds a flag saying whether the mouse is currently \"in\" the element, and a list of\n // both mouseenter and mouseexit functions.\n obj.__tamee = { over: false, mouseenter: [], mouseexit: [] };\n // register over and out functions\n var over = function (e) {\n var t = _t(e);\n if ((children == null && (t == obj && !obj.__tamee.over)) || (matchesSelector(t, children, obj) && (t.__tamee == null || !t.__tamee.over))) {\n meeHelper(\"mouseenter\", e, obj, t);\n t.__tamee = t.__tamee || {};\n t.__tamee.over = true;\n activeElements.push(t);\n }\n },\n out = function (e) {\n var t = _t(e);\n // is the current target one of the activeElements? and is the\n // related target NOT a descendant of it?\n for (var i = 0; i < activeElements.length; i++) {\n if (t == activeElements[i] && !matchesSelector((e.relatedTarget || e.toElement), \"*\", t)) {\n t.__tamee.over = false;\n activeElements.splice(i, 1);\n meeHelper(\"mouseexit\", e, obj, t);\n }\n }\n };\n\n _bind(obj, \"mouseover\", _curryChildFilter(children, obj, over, \"mouseover\"), over);\n _bind(obj, \"mouseout\", _curryChildFilter(children, obj, out, \"mouseout\"), out);\n }\n\n fn.__taUnstore = function () {\n delete obj.__tamee[evt][fn.__tauid];\n };\n\n _store(obj, evt, fn);\n obj.__tamee[evt][fn.__tauid] = fn;\n };\n },\n isTouchDevice = \"ontouchstart\" in document.documentElement,\n isMouseDevice = \"onmousedown\" in document.documentElement,\n touchMap = { \"mousedown\": \"touchstart\", \"mouseup\": \"touchend\", \"mousemove\": \"touchmove\" },\n touchstart = \"touchstart\", touchend = \"touchend\", touchmove = \"touchmove\",\n iev = (function () {\n var rv = -1;\n if (navigator.appName == 'Microsoft Internet Explorer') {\n var ua = navigator.userAgent,\n re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n return rv;\n })(),\n isIELT9 = iev > -1 && iev < 9,\n _genLoc = function (e, prefix) {\n if (e == null) return [ 0, 0 ];\n var ts = _touches(e), t = _getTouch(ts, 0);\n return [t[prefix + \"X\"], t[prefix + \"Y\"]];\n },\n _pageLocation = function (e) {\n if (e == null) return [ 0, 0 ];\n if (isIELT9) {\n return [ e.clientX + document.documentElement.scrollLeft, e.clientY + document.documentElement.scrollTop ];\n }\n else {\n return _genLoc(e, \"page\");\n }\n },\n _screenLocation = function (e) {\n return _genLoc(e, \"screen\");\n },\n _clientLocation = function (e) {\n return _genLoc(e, \"client\");\n },\n _getTouch = function (touches, idx) {\n return touches.item ? touches.item(idx) : touches[idx];\n },\n _touches = function (e) {\n return e.touches && e.touches.length > 0 ? e.touches :\n e.changedTouches && e.changedTouches.length > 0 ? e.changedTouches :\n e.targetTouches && e.targetTouches.length > 0 ? e.targetTouches :\n [ e ];\n },\n _touchCount = function (e) {\n return _touches(e).length;\n },\n //http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html\n _bind = function (obj, type, fn, originalFn) {\n _store(obj, type, fn);\n originalFn.__tauid = fn.__tauid;\n if (obj.addEventListener)\n obj.addEventListener(type, fn, false);\n else if (obj.attachEvent) {\n var key = type + fn.__tauid;\n obj[\"e\" + key] = fn;\n // TODO look at replacing with .call(..)\n obj[key] = function () {\n obj[\"e\" + key] && obj[\"e\" + key](window.event);\n };\n obj.attachEvent(\"on\" + type, obj[key]);\n }\n },\n _unbind = function (obj, type, fn) {\n if (fn == null) return;\n _each(obj, function () {\n var _el = _gel(this);\n _unstore(_el, type, fn);\n // it has been bound if there is a tauid. otherwise it was not bound and we can ignore it.\n if (fn.__tauid != null) {\n if (_el.removeEventListener) {\n _el.removeEventListener(type, fn, false);\n if (isTouchDevice && touchMap[type]) _el.removeEventListener(touchMap[type], fn, false);\n }\n else if (this.detachEvent) {\n var key = type + fn.__tauid;\n _el[key] && _el.detachEvent(\"on\" + type, _el[key]);\n _el[key] = null;\n _el[\"e\" + key] = null;\n }\n }\n\n // if a touch event was also registered, deregister now.\n if (fn.__taTouchProxy) {\n _unbind(obj, fn.__taTouchProxy[1], fn.__taTouchProxy[0]);\n }\n });\n },\n _each = function (obj, fn) {\n if (obj == null) return;\n // if a list (or list-like), use it. if a string, get a list\n // by running the string through querySelectorAll. else, assume\n // it's an Element.\n // obj.top is \"unknown\" in IE8.\n obj = (typeof Window !== \"undefined\" && (typeof obj.top !== \"unknown\" && obj == obj.top)) ? [ obj ] :\n (typeof obj !== \"string\") && (obj.tagName == null && obj.length != null) ? obj :\n typeof obj === \"string\" ? document.querySelectorAll(obj)\n : [ obj ];\n\n for (var i = 0; i < obj.length; i++)\n fn.apply(obj[i]);\n },\n _uuid = function () {\n return ('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n }));\n };\n\n /**\n * Mottle offers support for abstracting out the differences\n * between touch and mouse devices, plus \"smart click\" functionality\n * (don't fire click if the mouse has moved between mousedown and mouseup),\n * and synthesized click/tap events.\n * @class Mottle\n * @constructor\n * @param {Object} params Constructor params\n * @param {Number} [params.clickThreshold=250] Threshold, in milliseconds beyond which a touchstart followed by a touchend is not considered to be a click.\n * @param {Number} [params.dblClickThreshold=450] Threshold, in milliseconds beyond which two successive tap events are not considered to be a click.\n * @param {Boolean} [params.smartClicks=false] If true, won't fire click events if the mouse has moved between mousedown and mouseup. Note that this functionality\n * requires that Mottle consume the mousedown event, and so may not be viable in all use cases.\n */\n root.Mottle = function (params) {\n params = params || {};\n var clickThreshold = params.clickThreshold || 250,\n dblClickThreshold = params.dblClickThreshold || 450,\n mouseEnterExitHandler = new MouseEnterExitHandler(),\n tapHandler = new TapHandler(clickThreshold, dblClickThreshold),\n _smartClicks = params.smartClicks,\n _doBind = function (obj, evt, fn, children) {\n if (fn == null) return;\n _each(obj, function () {\n var _el = _gel(this);\n if (_smartClicks && evt === \"click\")\n SmartClickHandler(_el, evt, fn, children);\n else if (evt === \"tap\" || evt === \"dbltap\" || evt === \"contextmenu\") {\n tapHandler(_el, evt, fn, children);\n }\n else if (evt === \"mouseenter\" || evt == \"mouseexit\")\n mouseEnterExitHandler(_el, evt, fn, children);\n else\n DefaultHandler(_el, evt, fn, children);\n });\n };\n\n /**\n * Removes an element from the DOM, and deregisters all event handlers for it. You should use this\n * to ensure you don't leak memory.\n * @method remove\n * @param {String|Element} el Element, or id of the element, to remove.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.remove = function (el) {\n _each(el, function () {\n var _el = _gel(this);\n if (_el.__ta) {\n for (var evt in _el.__ta) {\n if (_el.__ta.hasOwnProperty(evt)) {\n for (var h in _el.__ta[evt]) {\n if (_el.__ta[evt].hasOwnProperty(h))\n _unbind(_el, evt, _el.__ta[evt][h]);\n }\n }\n }\n }\n _el.parentNode && _el.parentNode.removeChild(_el);\n });\n return this;\n };\n\n /**\n * Register an event handler, optionally as a delegate for some set of descendant elements. Note\n * that this method takes either 3 or 4 arguments - if you supply 3 arguments it is assumed you have\n * omitted the `children` parameter, and that the event handler should be bound directly to the given element.\n * @method on\n * @param {Element[]|Element|String} el Either an Element, or a CSS spec for a list of elements, or an array of Elements.\n * @param {String} [children] Comma-delimited list of selectors identifying allowed children.\n * @param {String} event Event ID.\n * @param {Function} fn Event handler function.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.on = function (el, event, children, fn) {\n var _el = arguments[0],\n _c = arguments.length == 4 ? arguments[2] : null,\n _e = arguments[1],\n _f = arguments[arguments.length - 1];\n\n _doBind(_el, _e, _f, _c);\n return this;\n };\n\n /**\n * Cancel delegate event handling for the given function. Note that unlike with 'on' you do not supply\n * a list of child selectors here: it removes event delegation from all of the child selectors for which the\n * given function was registered (if any).\n * @method off\n * @param {Element[]|Element|String} el Element - or ID of element - from which to remove event listener.\n * @param {String} event Event ID.\n * @param {Function} fn Event handler function.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.off = function (el, event, fn) {\n _unbind(el, event, fn);\n return this;\n };\n\n /**\n * Triggers some event for a given element.\n * @method trigger\n * @param {Element} el Element for which to trigger the event.\n * @param {String} event Event ID.\n * @param {Event} originalEvent The original event. Should be optional of course, but currently is not, due\n * to the jsPlumb use case that caused this method to be added.\n * @param {Object} [payload] Optional object to set as `payload` on the generated event; useful for message passing.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.trigger = function (el, event, originalEvent, payload) {\n // MouseEvent undefined in old IE; that's how we know it's a mouse event. A fine Microsoft paradox.\n var originalIsMouse = isMouseDevice && (typeof MouseEvent === \"undefined\" || originalEvent == null || originalEvent.constructor === MouseEvent);\n\n var eventToBind = (isTouchDevice && !isMouseDevice && touchMap[event]) ? touchMap[event] : event,\n bindingAMouseEvent = !(isTouchDevice && !isMouseDevice && touchMap[event]);\n\n var pl = _pageLocation(originalEvent), sl = _screenLocation(originalEvent), cl = _clientLocation(originalEvent);\n _each(el, function () {\n var _el = _gel(this), evt;\n originalEvent = originalEvent || {\n screenX: sl[0],\n screenY: sl[1],\n clientX: cl[0],\n clientY: cl[1]\n };\n\n var _decorate = function (_evt) {\n if (payload) _evt.payload = payload;\n };\n\n var eventGenerators = {\n \"TouchEvent\": function (evt) {\n\n var touchList = _touchAndList(window, _el, 0, pl[0], pl[1], sl[0], sl[1], cl[0], cl[1]),\n init = evt.initTouchEvent || evt.initEvent;\n\n init(eventToBind, true, true, window, null, sl[0], sl[1],\n cl[0], cl[1], false, false, false, false,\n touchList, touchList, touchList, 1, 0);\n },\n \"MouseEvents\": function (evt) {\n evt.initMouseEvent(eventToBind, true, true, window, 0,\n sl[0], sl[1],\n cl[0], cl[1],\n false, false, false, false, 1, _el);\n }\n };\n\n if (document.createEvent) {\n\n var ite = !bindingAMouseEvent && !originalIsMouse && (isTouchDevice && touchMap[event]),\n evtName = ite ? \"TouchEvent\" : \"MouseEvents\";\n\n evt = document.createEvent(evtName);\n eventGenerators[evtName](evt);\n _decorate(evt);\n _el.dispatchEvent(evt);\n }\n else if (document.createEventObject) {\n evt = document.createEventObject();\n evt.eventType = evt.eventName = eventToBind;\n evt.screenX = sl[0];\n evt.screenY = sl[1];\n evt.clientX = cl[0];\n evt.clientY = cl[1];\n _decorate(evt);\n _el.fireEvent('on' + eventToBind, evt);\n }\n });\n return this;\n }\n };\n\n /**\n * Static method to assist in 'consuming' an element: uses `stopPropagation` where available, or sets\n * `e.returnValue=false` where it is not.\n * @method Mottle.consume\n * @param {Event} e Event to consume\n * @param {Boolean} [doNotPreventDefault=false] If true, does not call `preventDefault()` on the event.\n */\n root.Mottle.consume = function (e, doNotPreventDefault) {\n if (e.stopPropagation)\n e.stopPropagation();\n else\n e.returnValue = false;\n\n if (!doNotPreventDefault && e.preventDefault)\n e.preventDefault();\n };\n\n /**\n * Gets the page location corresponding to the given event. For touch events this means get the page location of the first touch.\n * @method Mottle.pageLocation\n * @param {Event} e Event to get page location for.\n * @return {Number[]} [left, top] for the given event.\n */\n root.Mottle.pageLocation = _pageLocation;\n\n /**\n * Forces touch events to be turned \"on\". Useful for testing: even if you don't have a touch device, you can still\n * trigger a touch event when this is switched on and it will be captured and acted on.\n * @method setForceTouchEvents\n * @param {Boolean} value If true, force touch events to be on.\n */\n root.Mottle.setForceTouchEvents = function (value) {\n isTouchDevice = value;\n };\n\n /**\n * Forces mouse events to be turned \"on\". Useful for testing: even if you don't have a mouse, you can still\n * trigger a mouse event when this is switched on and it will be captured and acted on.\n * @method setForceMouseEvents\n * @param {Boolean} value If true, force mouse events to be on.\n */\n root.Mottle.setForceMouseEvents = function (value) {\n isMouseDevice = value;\n };\n\n root.Mottle.version = \"0.8.0\";\n\n if (typeof exports !== \"undefined\") {\n exports.Mottle = root.Mottle;\n }\n\n}).call(typeof window === \"undefined\" ? this : window);\n\n/**\n drag/drop functionality for use with jsPlumb but with\n no knowledge of jsPlumb. supports multiple scopes (separated by whitespace), dragging\n multiple elements, constrain to parent, drop filters, drag start filters, custom\n css classes.\n\n a lot of the functionality of this script is expected to be plugged in:\n\n addClass\n removeClass\n\n addEvent\n removeEvent\n\n getPosition\n setPosition\n getSize\n\n indexOf\n intersects\n\n the name came from here:\n\n http://mrsharpoblunto.github.io/foswig.js/\n\n copyright 2016 jsPlumb\n */\n\n;(function() {\n\n \"use strict\";\n var root = this;\n\n var _suggest = function(list, item, head) {\n if (list.indexOf(item) === -1) {\n head ? list.unshift(item) : list.push(item);\n return true;\n }\n return false;\n };\n\n var _vanquish = function(list, item) {\n var idx = list.indexOf(item);\n if (idx !== -1) list.splice(idx, 1);\n };\n\n var _difference = function(l1, l2) {\n var d = [];\n for (var i = 0; i < l1.length; i++) {\n if (l2.indexOf(l1[i]) === -1)\n d.push(l1[i]);\n }\n return d;\n };\n\n var _isString = function(f) {\n return f == null ? false : (typeof f === \"string\" || f.constructor === String);\n };\n\n var getOffsetRect = function (elem) {\n // (1)\n var box = elem.getBoundingClientRect(),\n body = document.body,\n docElem = document.documentElement,\n // (2)\n scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop,\n scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft,\n // (3)\n clientTop = docElem.clientTop || body.clientTop || 0,\n clientLeft = docElem.clientLeft || body.clientLeft || 0,\n // (4)\n top = box.top + scrollTop - clientTop,\n left = box.left + scrollLeft - clientLeft;\n\n return { top: Math.round(top), left: Math.round(left) };\n };\n\n var matchesSelector = function(el, selector, ctx) {\n ctx = ctx || el.parentNode;\n var possibles = ctx.querySelectorAll(selector);\n for (var i = 0; i < possibles.length; i++) {\n if (possibles[i] === el)\n return true;\n }\n return false;\n };\n\n var findDelegateElement = function(parentElement, childElement, selector) {\n if (matchesSelector(childElement, selector, parentElement)) {\n return childElement;\n } else {\n var currentParent = childElement.parentNode;\n while (currentParent != null && currentParent !== parentElement) {\n if (matchesSelector(currentParent, selector, parentElement)) {\n return currentParent;\n } else {\n currentParent = currentParent.parentNode;\n }\n }\n }\n };\n\n var iev = (function() {\n var rv = -1;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var ua = navigator.userAgent,\n re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n return rv;\n })(),\n DEFAULT_GRID_X = 10,\n DEFAULT_GRID_Y = 10,\n isIELT9 = iev > -1 && iev < 9,\n isIE9 = iev === 9,\n _pl = function(e) {\n if (isIELT9) {\n return [ e.clientX + document.documentElement.scrollLeft, e.clientY + document.documentElement.scrollTop ];\n }\n else {\n var ts = _touches(e), t = _getTouch(ts, 0);\n // for IE9 pageX might be null if the event was synthesized. We try for pageX/pageY first,\n // falling back to clientX/clientY if necessary. In every other browser we want to use pageX/pageY.\n return isIE9 ? [t.pageX || t.clientX, t.pageY || t.clientY] : [t.pageX, t.pageY];\n }\n },\n _getTouch = function(touches, idx) { return touches.item ? touches.item(idx) : touches[idx]; },\n _touches = function(e) {\n return e.touches && e.touches.length > 0 ? e.touches :\n e.changedTouches && e.changedTouches.length > 0 ? e.changedTouches :\n e.targetTouches && e.targetTouches.length > 0 ? e.targetTouches :\n [ e ];\n },\n _classes = {\n draggable:\"katavorio-draggable\", // draggable elements\n droppable:\"katavorio-droppable\", // droppable elements\n drag : \"katavorio-drag\", // elements currently being dragged\n selected:\"katavorio-drag-selected\", // elements in current drag selection\n active : \"katavorio-drag-active\", // droppables that are targets of a currently dragged element\n hover : \"katavorio-drag-hover\", // droppables over which a matching drag element is hovering\n noSelect : \"katavorio-drag-no-select\", // added to the body to provide a hook to suppress text selection\n ghostProxy:\"katavorio-ghost-proxy\", // added to a ghost proxy element in use when a drag has exited the bounds of its parent.\n clonedDrag:\"katavorio-clone-drag\" // added to a node that is a clone of an element created at the start of a drag\n },\n _defaultScope = \"katavorio-drag-scope\",\n _events = [ \"stop\", \"start\", \"drag\", \"drop\", \"over\", \"out\", \"beforeStart\" ],\n _devNull = function() {},\n _true = function() { return true; },\n _foreach = function(l, fn, from) {\n for (var i = 0; i < l.length; i++) {\n if (l[i] != from)\n fn(l[i]);\n }\n },\n _setDroppablesActive = function(dd, val, andHover, drag) {\n _foreach(dd, function(e) {\n e.setActive(val);\n if (val) e.updatePosition();\n if (andHover) e.setHover(drag, val);\n });\n },\n _each = function(obj, fn) {\n if (obj == null) return;\n obj = !_isString(obj) && (obj.tagName == null && obj.length != null) ? obj : [ obj ];\n for (var i = 0; i < obj.length; i++)\n fn.apply(obj[i], [ obj[i] ]);\n },\n _consume = function(e) {\n if (e.stopPropagation) {\n e.stopPropagation();\n e.preventDefault();\n }\n else {\n e.returnValue = false;\n }\n },\n _defaultInputFilterSelector = \"input,textarea,select,button,option\",\n //\n // filters out events on all input elements, like textarea, checkbox, input, select.\n _inputFilter = function(e, el, _katavorio) {\n var t = e.srcElement || e.target;\n return !matchesSelector(t, _katavorio.getInputFilterSelector(), el);\n };\n\n var Super = function(el, params, css, scope) {\n this.params = params || {};\n this.el = el;\n this.params.addClass(this.el, this._class);\n this.uuid = _uuid();\n var enabled = true;\n this.setEnabled = function(e) { enabled = e; };\n this.isEnabled = function() { return enabled; };\n this.toggleEnabled = function() { enabled = !enabled; };\n this.setScope = function(scopes) {\n this.scopes = scopes ? scopes.split(/\\s+/) : [ scope ];\n };\n this.addScope = function(scopes) {\n var m = {};\n _each(this.scopes, function(s) { m[s] = true;});\n _each(scopes ? scopes.split(/\\s+/) : [], function(s) { m[s] = true;});\n this.scopes = [];\n for (var i in m) this.scopes.push(i);\n };\n this.removeScope = function(scopes) {\n var m = {};\n _each(this.scopes, function(s) { m[s] = true;});\n _each(scopes ? scopes.split(/\\s+/) : [], function(s) { delete m[s];});\n this.scopes = [];\n for (var i in m) this.scopes.push(i);\n };\n this.toggleScope = function(scopes) {\n var m = {};\n _each(this.scopes, function(s) { m[s] = true;});\n _each(scopes ? scopes.split(/\\s+/) : [], function(s) {\n if (m[s]) delete m[s];\n else m[s] = true;\n });\n this.scopes = [];\n for (var i in m) this.scopes.push(i);\n };\n this.setScope(params.scope);\n this.k = params.katavorio;\n return params.katavorio;\n };\n\n var TRUE = function() { return true; };\n var FALSE = function() { return false; };\n\n var Drag = function(el, params, css, scope) {\n this._class = css.draggable;\n var k = Super.apply(this, arguments);\n this.rightButtonCanDrag = this.params.rightButtonCanDrag;\n var downAt = [0,0], posAtDown = null, pagePosAtDown = null, pageDelta = [0,0], moving = false, initialScroll = [0,0],\n consumeStartEvent = this.params.consumeStartEvent !== false,\n dragEl = this.el,\n clone = this.params.clone,\n scroll = this.params.scroll,\n _multipleDrop = params.multipleDrop !== false,\n isConstrained = false,\n useGhostProxy = params.ghostProxy === true ? TRUE : params.ghostProxy && typeof params.ghostProxy === \"function\" ? params.ghostProxy : FALSE,\n ghostProxy = function(el) { return el.cloneNode(true); },\n selector = params.selector,\n elementToDrag = null;\n\n var snapThreshold = params.snapThreshold,\n _snap = function(pos, gridX, gridY, thresholdX, thresholdY) {\n var _dx = Math.floor(pos[0] / gridX),\n _dxl = gridX * _dx,\n _dxt = _dxl + gridX,\n _x = Math.abs(pos[0] - _dxl) <= thresholdX ? _dxl : Math.abs(_dxt - pos[0]) <= thresholdX ? _dxt : pos[0];\n\n var _dy = Math.floor(pos[1] / gridY),\n _dyl = gridY * _dy,\n _dyt = _dyl + gridY,\n _y = Math.abs(pos[1] - _dyl) <= thresholdY ? _dyl : Math.abs(_dyt - pos[1]) <= thresholdY ? _dyt : pos[1];\n\n return [ _x, _y];\n };\n\n this.posses = [];\n this.posseRoles = {};\n\n this.toGrid = function(pos) {\n if (this.params.grid == null) {\n return pos;\n }\n else {\n var tx = this.params.grid ? this.params.grid[0] / 2 : snapThreshold ? snapThreshold : DEFAULT_GRID_X / 2,\n ty = this.params.grid ? this.params.grid[1] / 2 : snapThreshold ? snapThreshold : DEFAULT_GRID_Y / 2;\n\n return _snap(pos, this.params.grid[0], this.params.grid[1], tx, ty);\n }\n };\n\n this.snap = function(x, y) {\n if (dragEl == null) return;\n x = x || (this.params.grid ? this.params.grid[0] : DEFAULT_GRID_X);\n y = y || (this.params.grid ? this.params.grid[1] : DEFAULT_GRID_Y);\n var p = this.params.getPosition(dragEl),\n tx = this.params.grid ? this.params.grid[0] / 2 : snapThreshold,\n ty = this.params.grid ? this.params.grid[1] / 2 : snapThreshold;\n\n this.params.setPosition(dragEl, _snap(p, x, y, tx, ty));\n };\n\n this.setUseGhostProxy = function(val) {\n useGhostProxy = val ? TRUE : FALSE;\n };\n\n var constrain;\n var negativeFilter = function(pos) {\n return (params.allowNegative === false) ? [ Math.max (0, pos[0]), Math.max(0, pos[1]) ] : pos;\n };\n\n var _setConstrain = function(value) {\n constrain = typeof value === \"function\" ? value : value ? function(pos, dragEl, _constrainRect, _size) {\n return negativeFilter([\n Math.max(0, Math.min(_constrainRect.w - _size[0], pos[0])),\n Math.max(0, Math.min(_constrainRect.h - _size[1], pos[1]))\n ]);\n }.bind(this) : function(pos) { return negativeFilter(pos); };\n }.bind(this);\n\n _setConstrain(typeof this.params.constrain === \"function\" ? this.params.constrain : (this.params.constrain || this.params.containment));\n\n\n /**\n * Sets whether or not the Drag is constrained. A value of 'true' means constrain to parent bounds; a function\n * will be executed and returns true if the position is allowed.\n * @param value\n */\n this.setConstrain = function(value) {\n _setConstrain(value);\n };\n\n var revertFunction;\n /**\n * Sets a function to call on drag stop, which, if it returns true, indicates that the given element should\n * revert to its position before the previous drag.\n * @param fn\n */\n this.setRevert = function(fn) {\n revertFunction = fn;\n };\n\n var _assignId = function(obj) {\n if (typeof obj === \"function\") {\n obj._katavorioId = _uuid();\n return obj._katavorioId;\n } else {\n return obj;\n }\n },\n // a map of { spec -> [ fn, exclusion ] } entries.\n _filters = {},\n _testFilter = function(e) {\n for (var key in _filters) {\n var f = _filters[key];\n var rv = f[0](e);\n if (f[1]) rv = !rv;\n if (!rv) return false;\n }\n return true;\n },\n _setFilter = this.setFilter = function(f, _exclude) {\n if (f) {\n var key = _assignId(f);\n _filters[key] = [\n function(e) {\n var t = e.srcElement || e.target, m;\n if (_isString(f)) {\n m = matchesSelector(t, f, el);\n }\n else if (typeof f === \"function\") {\n m = f(e, el);\n }\n return m;\n },\n _exclude !== false\n ];\n\n }\n },\n _addFilter = this.addFilter = _setFilter,\n _removeFilter = this.removeFilter = function(f) {\n var key = typeof f === \"function\" ? f._katavorioId : f;\n delete _filters[key];\n };\n\n this.clearAllFilters = function() {\n _filters = {};\n };\n\n this.canDrag = this.params.canDrag || _true;\n\n var constrainRect,\n matchingDroppables = [],\n intersectingDroppables = [];\n\n this.downListener = function(e) {\n var isNotRightClick = this.rightButtonCanDrag || (e.which !== 3 && e.button !== 2);\n if (isNotRightClick && this.isEnabled() && this.canDrag()) {\n\n var _f = _testFilter(e) && _inputFilter(e, this.el, this.k);\n if (_f) {\n\n if (selector) {\n elementToDrag = findDelegateElement(this.el, e.target || e.srcElement, selector);\n if(elementToDrag == null) {\n return;\n }\n }\n else {\n elementToDrag = this.el;\n }\n\n if (clone) {\n dragEl = elementToDrag.cloneNode(true);\n this.params.addClass(dragEl, _classes.clonedDrag);\n\n dragEl.setAttribute(\"id\", null);\n dragEl.style.position = \"absolute\";\n\n if (this.params.parent != null) {\n var p = this.params.getPosition(this.el);\n dragEl.style.left = p[0] + \"px\";\n dragEl.style.top = p[1] + \"px\";\n this.params.parent.appendChild(dragEl);\n } else {\n // the clone node is added to the body; getOffsetRect gives us a value\n // relative to the body.\n var b = getOffsetRect(elementToDrag);\n dragEl.style.left = b.left + \"px\";\n dragEl.style.top = b.top + \"px\";\n\n document.body.appendChild(dragEl);\n }\n\n } else {\n dragEl = elementToDrag;\n }\n\n consumeStartEvent && _consume(e);\n downAt = _pl(e);\n if (dragEl && dragEl.parentNode)\n {\n initialScroll = [dragEl.parentNode.scrollLeft, dragEl.parentNode.scrollTop];\n }\n //\n this.params.bind(document, \"mousemove\", this.moveListener);\n this.params.bind(document, \"mouseup\", this.upListener);\n k.markSelection(this);\n k.markPosses(this);\n this.params.addClass(document.body, css.noSelect);\n _dispatch(\"beforeStart\", {el:this.el, pos:posAtDown, e:e, drag:this});\n }\n else if (this.params.consumeFilteredEvents) {\n _consume(e);\n }\n }\n }.bind(this);\n\n this.moveListener = function(e) {\n if (downAt) {\n if (!moving) {\n var _continue = _dispatch(\"start\", {el:this.el, pos:posAtDown, e:e, drag:this});\n if (_continue !== false) {\n if (!downAt) {\n return;\n }\n this.mark(true);\n moving = true;\n } else {\n this.abort();\n }\n }\n\n // it is possible that the start event caused the drag to be aborted. So we check\n // again that we are currently dragging.\n if (downAt) {\n intersectingDroppables.length = 0;\n var pos = _pl(e), dx = pos[0] - downAt[0], dy = pos[1] - downAt[1],\n z = this.params.ignoreZoom ? 1 : k.getZoom();\n if (dragEl && dragEl.parentNode)\n {\n dx += dragEl.parentNode.scrollLeft - initialScroll[0];\n dy += dragEl.parentNode.scrollTop - initialScroll[1];\n }\n dx /= z;\n dy /= z;\n this.moveBy(dx, dy, e);\n k.updateSelection(dx, dy, this);\n k.updatePosses(dx, dy, this);\n }\n }\n }.bind(this);\n\n this.upListener = function(e) {\n if (downAt) {\n downAt = null;\n this.params.unbind(document, \"mousemove\", this.moveListener);\n this.params.unbind(document, \"mouseup\", this.upListener);\n this.params.removeClass(document.body, css.noSelect);\n this.unmark(e);\n k.unmarkSelection(this, e);\n k.unmarkPosses(this, e);\n this.stop(e);\n\n //k.notifySelectionDragStop(this, e); removed in 1.1.0 under the \"leave it for one release in case it breaks\" rule.\n // it isnt necessary to fire this as the normal stop event now includes a `selection` member that has every dragged element.\n // firing this event causes consumers who use the `selection` array to process a lot more drag stop events than is necessary\n\n k.notifyPosseDragStop(this, e);\n moving = false;\n if (clone) {\n dragEl && dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n dragEl = null;\n }\n\n intersectingDroppables.length = 0;\n\n if (revertFunction && revertFunction(this.el, this.params.getPosition(this.el)) === true) {\n this.params.setPosition(this.el, posAtDown);\n _dispatch(\"revert\", this.el);\n }\n }\n }.bind(this);\n\n this.getFilters = function() { return _filters; };\n\n this.abort = function() {\n if (downAt != null) {\n this.upListener();\n }\n };\n\n /**\n * Returns the element that was last dragged. This may be some original element from the DOM, or if `clone` is\n * set, then its actually a copy of some original DOM element. In some client calls to this method, it is the\n * actual element that was dragged that is desired. In others, it is the original DOM element that the user\n * wishes to get - in which case, pass true for `retrieveOriginalElement`.\n *\n * @returns {*}\n */\n this.getDragElement = function(retrieveOriginalElement) {\n return retrieveOriginalElement ? elementToDrag || this.el : dragEl || this.el;\n };\n\n var listeners = {\"start\":[], \"drag\":[], \"stop\":[], \"over\":[], \"out\":[], \"beforeStart\":[], \"revert\":[] };\n if (params.events.start) listeners.start.push(params.events.start);\n if (params.events.beforeStart) listeners.beforeStart.push(params.events.beforeStart);\n if (params.events.stop) listeners.stop.push(params.events.stop);\n if (params.events.drag) listeners.drag.push(params.events.drag);\n if (params.events.revert) listeners.revert.push(params.events.revert);\n\n this.on = function(evt, fn) {\n if (listeners[evt]) listeners[evt].push(fn);\n };\n\n this.off = function(evt, fn) {\n if (listeners[evt]) {\n var l = [];\n for (var i = 0; i < listeners[evt].length; i++) {\n if (listeners[evt][i] !== fn) l.push(listeners[evt][i]);\n }\n listeners[evt] = l;\n }\n };\n\n var _dispatch = function(evt, value) {\n var result = null;\n if (listeners[evt]) {\n for (var i = 0; i < listeners[evt].length; i++) {\n try {\n var v = listeners[evt][i](value);\n if (v != null) {\n result = v;\n }\n }\n catch (e) { }\n }\n }\n return result;\n };\n\n this.notifyStart = function(e) {\n _dispatch(\"start\", {el:this.el, pos:this.params.getPosition(dragEl), e:e, drag:this});\n };\n\n this.stop = function(e, force) {\n if (force || moving) {\n var positions = [],\n sel = k.getSelection(),\n dPos = this.params.getPosition(dragEl);\n\n if (sel.length > 1) {\n for (var i = 0; i < sel.length; i++) {\n var p = this.params.getPosition(sel[i].el);\n positions.push([ sel[i].el, { left: p[0], top: p[1] }, sel[i] ]);\n }\n }\n else {\n positions.push([ dragEl, {left:dPos[0], top:dPos[1]}, this ]);\n }\n\n _dispatch(\"stop\", {\n el: dragEl,\n pos: ghostProxyOffsets || dPos,\n finalPos:dPos,\n e: e,\n drag: this,\n selection:positions\n });\n }\n };\n\n this.mark = function(andNotify) {\n posAtDown = this.params.getPosition(dragEl);\n pagePosAtDown = this.params.getPosition(dragEl, true);\n pageDelta = [pagePosAtDown[0] - posAtDown[0], pagePosAtDown[1] - posAtDown[1]];\n this.size = this.params.getSize(dragEl);\n matchingDroppables = k.getMatchingDroppables(this);\n _setDroppablesActive(matchingDroppables, true, false, this);\n this.params.addClass(dragEl, this.params.dragClass || css.drag);\n\n var cs;\n if (this.params.getConstrainingRectangle) {\n cs = this.params.getConstrainingRectangle(dragEl)\n } else {\n cs = this.params.getSize(dragEl.parentNode);\n }\n constrainRect = {w: cs[0], h: cs[1]};\n\n if (andNotify) {\n k.notifySelectionDragStart(this);\n }\n };\n var ghostProxyOffsets;\n this.unmark = function(e, doNotCheckDroppables) {\n _setDroppablesActive(matchingDroppables, false, true, this);\n\n if (isConstrained && useGhostProxy(elementToDrag)) {\n ghostProxyOffsets = [dragEl.offsetLeft, dragEl.offsetTop];\n elementToDrag.parentNode.removeChild(dragEl);\n dragEl = elementToDrag;\n }\n else {\n ghostProxyOffsets = null;\n }\n\n this.params.removeClass(dragEl, this.params.dragClass || css.drag);\n matchingDroppables.length = 0;\n isConstrained = false;\n if (!doNotCheckDroppables) {\n if (intersectingDroppables.length > 0 && ghostProxyOffsets) {\n params.setPosition(elementToDrag, ghostProxyOffsets);\n }\n intersectingDroppables.sort(_rankSort);\n for (var i = 0; i < intersectingDroppables.length; i++) {\n var retVal = intersectingDroppables[i].drop(this, e);\n if (retVal === true) break;\n }\n }\n };\n this.moveBy = function(dx, dy, e) {\n intersectingDroppables.length = 0;\n var desiredLoc = this.toGrid([posAtDown[0] + dx, posAtDown[1] + dy]),\n cPos = constrain(desiredLoc, dragEl, constrainRect, this.size);\n\n if (useGhostProxy(this.el)) {\n if (desiredLoc[0] !== cPos[0] || desiredLoc[1] !== cPos[1]) {\n if (!isConstrained) {\n var gp = ghostProxy(elementToDrag);\n params.addClass(gp, _classes.ghostProxy);\n elementToDrag.parentNode.appendChild(gp);\n dragEl = gp;\n isConstrained = true;\n }\n cPos = desiredLoc;\n }\n else {\n if (isConstrained) {\n elementToDrag.parentNode.removeChild(dragEl);\n dragEl = elementToDrag;\n isConstrained = false;\n }\n }\n }\n\n var rect = { x:cPos[0], y:cPos[1], w:this.size[0], h:this.size[1]},\n pageRect = { x:rect.x + pageDelta[0], y:rect.y + pageDelta[1], w:rect.w, h:rect.h},\n focusDropElement = null;\n\n this.params.setPosition(dragEl, cPos);\n for (var i = 0; i < matchingDroppables.length; i++) {\n var r2 = { x:matchingDroppables[i].pagePosition[0], y:matchingDroppables[i].pagePosition[1], w:matchingDroppables[i].size[0], h:matchingDroppables[i].size[1]};\n if (this.params.intersects(pageRect, r2) && (_multipleDrop || focusDropElement == null || focusDropElement === matchingDroppables[i].el) && matchingDroppables[i].canDrop(this)) {\n if (!focusDropElement) focusDropElement = matchingDroppables[i].el;\n intersectingDroppables.push(matchingDroppables[i]);\n matchingDroppables[i].setHover(this, true, e);\n }\n else if (matchingDroppables[i].isHover()) {\n matchingDroppables[i].setHover(this, false, e);\n }\n }\n\n _dispatch(\"drag\", {el:this.el, pos:cPos, e:e, drag:this});\n\n /* test to see if the parent needs to be scrolled (future)\n if (scroll) {\n var pnsl = dragEl.parentNode.scrollLeft, pnst = dragEl.parentNode.scrollTop;\n console.log(\"scroll!\", pnsl, pnst);\n }*/\n };\n this.destroy = function() {\n this.params.unbind(this.el, \"mousedown\", this.downListener);\n this.params.unbind(document, \"mousemove\", this.moveListener);\n this.params.unbind(document, \"mouseup\", this.upListener);\n this.downListener = null;\n this.upListener = null;\n this.moveListener = null;\n };\n\n // init:register mousedown, and perhaps set a filter\n this.params.bind(this.el, \"mousedown\", this.downListener);\n\n // if handle provded, use that. otherwise, try to set a filter.\n // note that a `handle` selector always results in filterExclude being set to false, ie.\n // the selector defines the handle element(s).\n if (this.params.handle)\n _setFilter(this.params.handle, false);\n else\n _setFilter(this.params.filter, this.params.filterExclude);\n };\n\n var Drop = function(el, params, css, scope) {\n this._class = css.droppable;\n this.params = params || {};\n this.rank = params.rank || 0;\n this._activeClass = this.params.activeClass || css.active;\n this._hoverClass = this.params.hoverClass || css.hover;\n Super.apply(this, arguments);\n var hover = false;\n this.allowLoopback = this.params.allowLoopback !== false;\n\n this.setActive = function(val) {\n this.params[val ? \"addClass\" : \"removeClass\"](this.el, this._activeClass);\n };\n\n this.updatePosition = function() {\n this.position = this.params.getPosition(this.el);\n this.pagePosition = this.params.getPosition(this.el, true);\n this.size = this.params.getSize(this.el);\n };\n\n this.canDrop = this.params.canDrop || function(drag) {\n return true;\n };\n\n this.isHover = function() { return hover; };\n\n this.setHover = function(drag, val, e) {\n // if turning off hover but this was not the drag that caused the hover, ignore.\n if (val || this.el._katavorioDragHover == null || this.el._katavorioDragHover === drag.el._katavorio) {\n this.params[val ? \"addClass\" : \"removeClass\"](this.el, this._hoverClass);\n this.el._katavorioDragHover = val ? drag.el._katavorio : null;\n if (hover !== val) {\n this.params.events[val ? \"over\" : \"out\"]({el: this.el, e: e, drag: drag, drop: this});\n }\n hover = val;\n }\n };\n\n /**\n * A drop event. `drag` is the corresponding Drag object, which may be a Drag for some specific element, or it\n * may be a Drag on some element acting as a delegate for elements contained within it.\n * @param drag\n * @param event\n * @returns {*}\n */\n this.drop = function(drag, event) {\n return this.params.events[\"drop\"]({ drag:drag, e:event, drop:this });\n };\n\n this.destroy = function() {\n this._class = null;\n this._activeClass = null;\n this._hoverClass = null;\n hover = null;\n };\n };\n\n var _uuid = function() {\n return ('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random()*16|0, v = c === 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n }));\n };\n\n var _rankSort = function(a,b) {\n return a.rank < b.rank ? 1 : a.rank > b.rank ? -1 : 0;\n };\n\n var _gel = function(el) {\n if (el == null) return null;\n el = (typeof el === \"string\" || el.constructor === String) ? document.getElementById(el) : el;\n if (el == null) return null;\n el._katavorio = el._katavorio || _uuid();\n return el;\n };\n\n root.Katavorio = function(katavorioParams) {\n\n var _selection = [],\n _selectionMap = {};\n\n this._dragsByScope = {};\n this._dropsByScope = {};\n var _zoom = 1,\n _reg = function(obj, map) {\n _each(obj, function(_obj) {\n for(var i = 0; i < _obj.scopes.length; i++) {\n map[_obj.scopes[i]] = map[_obj.scopes[i]] || [];\n map[_obj.scopes[i]].push(_obj);\n }\n });\n },\n _unreg = function(obj, map) {\n var c = 0;\n _each(obj, function(_obj) {\n for(var i = 0; i < _obj.scopes.length; i++) {\n if (map[_obj.scopes[i]]) {\n var idx = katavorioParams.indexOf(map[_obj.scopes[i]], _obj);\n if (idx !== -1) {\n map[_obj.scopes[i]].splice(idx, 1);\n c++;\n }\n }\n }\n });\n\n return c > 0 ;\n },\n _getMatchingDroppables = this.getMatchingDroppables = function(drag) {\n var dd = [], _m = {};\n for (var i = 0; i < drag.scopes.length; i++) {\n var _dd = this._dropsByScope[drag.scopes[i]];\n if (_dd) {\n for (var j = 0; j < _dd.length; j++) {\n if (_dd[j].canDrop(drag) && !_m[_dd[j].uuid] && (_dd[j].allowLoopback || _dd[j].el !== drag.el)) {\n _m[_dd[j].uuid] = true;\n dd.push(_dd[j]);\n }\n }\n }\n }\n dd.sort(_rankSort);\n return dd;\n },\n _prepareParams = function(p) {\n p = p || {};\n var _p = {\n events:{}\n }, i;\n for (i in katavorioParams) _p[i] = katavorioParams[i];\n for (i in p) _p[i] = p[i];\n // events\n\n for (i = 0; i < _events.length; i++) {\n _p.events[_events[i]] = p[_events[i]] || _devNull;\n }\n _p.katavorio = this;\n return _p;\n }.bind(this),\n _mistletoe = function(existingDrag, params) {\n for (var i = 0; i < _events.length; i++) {\n if (params[_events[i]]) {\n existingDrag.on(_events[i], params[_events[i]]);\n }\n }\n }.bind(this),\n _css = {},\n overrideCss = katavorioParams.css || {},\n _scope = katavorioParams.scope || _defaultScope;\n\n // prepare map of css classes based on defaults frst, then optional overrides\n for (var i in _classes) _css[i] = _classes[i];\n for (var i in overrideCss) _css[i] = overrideCss[i];\n\n var inputFilterSelector = katavorioParams.inputFilterSelector || _defaultInputFilterSelector;\n /**\n * Gets the selector identifying which input elements to filter from drag events.\n * @method getInputFilterSelector\n * @return {String} Current input filter selector.\n */\n this.getInputFilterSelector = function() { return inputFilterSelector; };\n\n /**\n * Sets the selector identifying which input elements to filter from drag events.\n * @method setInputFilterSelector\n * @param {String} selector Input filter selector to set.\n * @return {Katavorio} Current instance; method may be chained.\n */\n this.setInputFilterSelector = function(selector) {\n inputFilterSelector = selector;\n return this;\n };\n\n /**\n * Either makes the given element draggable, or identifies it as an element inside which some identified list\n * of elements may be draggable.\n * @param el\n * @param params\n * @returns {Array}\n */\n this.draggable = function(el, params) {\n var o = [];\n _each(el, function (_el) {\n _el = _gel(_el);\n if (_el != null) {\n if (_el._katavorioDrag == null) {\n var p = _prepareParams(params);\n _el._katavorioDrag = new Drag(_el, p, _css, _scope);\n _reg(_el._katavorioDrag, this._dragsByScope);\n o.push(_el._katavorioDrag);\n katavorioParams.addClass(_el, _css.draggable);\n }\n else {\n _mistletoe(_el._katavorioDrag, params);\n }\n }\n }.bind(this));\n return o;\n };\n\n this.droppable = function(el, params) {\n var o = [];\n _each(el, function(_el) {\n _el = _gel(_el);\n if (_el != null) {\n var drop = new Drop(_el, _prepareParams(params), _css, _scope);\n _el._katavorioDrop = _el._katavorioDrop || [];\n _el._katavorioDrop.push(drop);\n _reg(drop, this._dropsByScope);\n o.push(drop);\n katavorioParams.addClass(_el, _css.droppable);\n }\n }.bind(this));\n return o;\n };\n\n /**\n * @name Katavorio#select\n * @function\n * @desc Adds an element to the current selection (for multiple node drag)\n * @param {Element|String} DOM element - or id of the element - to add.\n */\n this.select = function(el) {\n _each(el, function() {\n var _el = _gel(this);\n if (_el && _el._katavorioDrag) {\n if (!_selectionMap[_el._katavorio]) {\n _selection.push(_el._katavorioDrag);\n _selectionMap[_el._katavorio] = [ _el, _selection.length - 1 ];\n katavorioParams.addClass(_el, _css.selected);\n }\n }\n });\n return this;\n };\n\n /**\n * @name Katavorio#deselect\n * @function\n * @desc Removes an element from the current selection (for multiple node drag)\n * @param {Element|String} DOM element - or id of the element - to remove.\n */\n this.deselect = function(el) {\n _each(el, function() {\n var _el = _gel(this);\n if (_el && _el._katavorio) {\n var e = _selectionMap[_el._katavorio];\n if (e) {\n var _s = [];\n for (var i = 0; i < _selection.length; i++)\n if (_selection[i].el !== _el) _s.push(_selection[i]);\n _selection = _s;\n delete _selectionMap[_el._katavorio];\n katavorioParams.removeClass(_el, _css.selected);\n }\n }\n });\n return this;\n };\n\n this.deselectAll = function() {\n for (var i in _selectionMap) {\n var d = _selectionMap[i];\n katavorioParams.removeClass(d[0], _css.selected);\n }\n\n _selection.length = 0;\n _selectionMap = {};\n };\n\n this.markSelection = function(drag) {\n _foreach(_selection, function(e) { e.mark(); }, drag);\n };\n\n this.markPosses = function(drag) {\n if (drag.posses) {\n _each(drag.posses, function(p) {\n if (drag.posseRoles[p] && _posses[p]) {\n _foreach(_posses[p].members, function (d) {\n d.mark();\n }, drag);\n }\n })\n }\n };\n\n this.unmarkSelection = function(drag, event) {\n _foreach(_selection, function(e) { e.unmark(event); }, drag);\n };\n\n this.unmarkPosses = function(drag, event) {\n if (drag.posses) {\n _each(drag.posses, function(p) {\n if (drag.posseRoles[p] && _posses[p]) {\n _foreach(_posses[p].members, function (d) {\n d.unmark(event, true);\n }, drag);\n }\n });\n }\n };\n\n this.getSelection = function() { return _selection.slice(0); };\n\n this.updateSelection = function(dx, dy, drag) {\n _foreach(_selection, function(e) { e.moveBy(dx, dy); }, drag);\n };\n\n var _posseAction = function(fn, drag) {\n if (drag.posses) {\n _each(drag.posses, function(p) {\n if (drag.posseRoles[p] && _posses[p]) {\n _foreach(_posses[p].members, function (e) {\n fn(e);\n }, drag);\n }\n });\n }\n };\n\n this.updatePosses = function(dx, dy, drag) {\n _posseAction(function(e) { e.moveBy(dx, dy); }, drag);\n };\n\n this.notifyPosseDragStop = function(drag, evt) {\n _posseAction(function(e) { e.stop(evt, true); }, drag);\n };\n\n this.notifySelectionDragStop = function(drag, evt) {\n _foreach(_selection, function(e) { e.stop(evt, true); }, drag);\n };\n\n this.notifySelectionDragStart = function(drag, evt) {\n _foreach(_selection, function(e) { e.notifyStart(evt);}, drag);\n };\n\n this.setZoom = function(z) { _zoom = z; };\n this.getZoom = function() { return _zoom; };\n\n // does the work of changing scopes\n var _scopeManip = function(kObj, scopes, map, fn) {\n _each(kObj, function(_kObj) {\n _unreg(_kObj, map); // deregister existing scopes\n _kObj[fn](scopes); // set scopes\n _reg(_kObj, map); // register new ones\n });\n };\n\n _each([ \"set\", \"add\", \"remove\", \"toggle\"], function(v) {\n this[v + \"Scope\"] = function(el, scopes) {\n _scopeManip(el._katavorioDrag, scopes, this._dragsByScope, v + \"Scope\");\n _scopeManip(el._katavorioDrop, scopes, this._dropsByScope, v + \"Scope\");\n }.bind(this);\n this[v + \"DragScope\"] = function(el, scopes) {\n _scopeManip(el.constructor === Drag ? el : el._katavorioDrag, scopes, this._dragsByScope, v + \"Scope\");\n }.bind(this);\n this[v + \"DropScope\"] = function(el, scopes) {\n _scopeManip(el.constructor === Drop ? el : el._katavorioDrop, scopes, this._dropsByScope, v + \"Scope\");\n }.bind(this);\n }.bind(this));\n\n this.snapToGrid = function(x, y) {\n for (var s in this._dragsByScope) {\n _foreach(this._dragsByScope[s], function(d) { d.snap(x, y); });\n }\n };\n\n this.getDragsForScope = function(s) { return this._dragsByScope[s]; };\n this.getDropsForScope = function(s) { return this._dropsByScope[s]; };\n\n var _destroy = function(el, type, map) {\n el = _gel(el);\n if (el[type]) {\n\n // remove from selection, if present.\n var selIdx = _selection.indexOf(el[type]);\n if (selIdx >= 0) {\n _selection.splice(selIdx, 1);\n }\n\n if (_unreg(el[type], map)) {\n _each(el[type], function(kObj) { kObj.destroy() });\n }\n\n delete el[type];\n }\n };\n\n var _removeListener = function(el, type, evt, fn) {\n el = _gel(el);\n if (el[type]) {\n el[type].off(evt, fn);\n }\n };\n\n this.elementRemoved = function(el) {\n this.destroyDraggable(el);\n this.destroyDroppable(el);\n };\n\n /**\n * Either completely remove drag functionality from the given element, or remove a specific event handler. If you\n * call this method with a single argument - the element - all drag functionality is removed from it. Otherwise, if\n * you provide an event name and listener function, this function is de-registered (if found).\n * @param el Element to update\n * @param {string} [evt] Optional event name to unsubscribe\n * @param {Function} [fn] Optional function to unsubscribe\n */\n this.destroyDraggable = function(el, evt, fn) {\n if (arguments.length === 1) {\n _destroy(el, \"_katavorioDrag\", this._dragsByScope);\n } else {\n _removeListener(el, \"_katavorioDrag\", evt, fn);\n }\n };\n\n /**\n * Either completely remove drop functionality from the given element, or remove a specific event handler. If you\n * call this method with a single argument - the element - all drop functionality is removed from it. Otherwise, if\n * you provide an event name and listener function, this function is de-registered (if found).\n * @param el Element to update\n * @param {string} [evt] Optional event name to unsubscribe\n * @param {Function} [fn] Optional function to unsubscribe\n */\n this.destroyDroppable = function(el, evt, fn) {\n if (arguments.length === 1) {\n _destroy(el, \"_katavorioDrop\", this._dropsByScope);\n } else {\n _removeListener(el, \"_katavorioDrop\", evt, fn);\n }\n };\n\n this.reset = function() {\n this._dragsByScope = {};\n this._dropsByScope = {};\n _selection = [];\n _selectionMap = {};\n _posses = {};\n };\n\n // ----- groups\n var _posses = {};\n\n var _processOneSpec = function(el, _spec, dontAddExisting) {\n var posseId = _isString(_spec) ? _spec : _spec.id;\n var active = _isString(_spec) ? true : _spec.active !== false;\n var posse = _posses[posseId] || (function() {\n var g = {name:posseId, members:[]};\n _posses[posseId] = g;\n return g;\n })();\n _each(el, function(_el) {\n if (_el._katavorioDrag) {\n\n if (dontAddExisting && _el._katavorioDrag.posseRoles[posse.name] != null) return;\n\n _suggest(posse.members, _el._katavorioDrag);\n _suggest(_el._katavorioDrag.posses, posse.name);\n _el._katavorioDrag.posseRoles[posse.name] = active;\n }\n });\n return posse;\n };\n\n /**\n * Add the given element to the posse with the given id, creating the group if it at first does not exist.\n * @method addToPosse\n * @param {Element} el Element to add.\n * @param {String...|Object...} spec Variable args parameters. Each argument can be a either a String, indicating\n * the ID of a Posse to which the element should be added as an active participant, or an Object containing\n * `{ id:\"posseId\", active:false/true}`. In the latter case, if `active` is not provided it is assumed to be\n * true.\n * @returns {Posse|Posse[]} The Posse(s) to which the element(s) was/were added.\n */\n this.addToPosse = function(el, spec) {\n\n var posses = [];\n\n for (var i = 1; i < arguments.length; i++) {\n posses.push(_processOneSpec(el, arguments[i]));\n }\n\n return posses.length === 1 ? posses[0] : posses;\n };\n\n /**\n * Sets the posse(s) for the element with the given id, creating those that do not yet exist, and removing from\n * the element any current Posses that are not specified by this method call. This method will not change the\n * active/passive state if it is given a posse in which the element is already a member.\n * @method setPosse\n * @param {Element} el Element to set posse(s) on.\n * @param {String...|Object...} spec Variable args parameters. Each argument can be a either a String, indicating\n * the ID of a Posse to which the element should be added as an active participant, or an Object containing\n * `{ id:\"posseId\", active:false/true}`. In the latter case, if `active` is not provided it is assumed to be\n * true.\n * @returns {Posse|Posse[]} The Posse(s) to which the element(s) now belongs.\n */\n this.setPosse = function(el, spec) {\n\n var posses = [];\n\n for (var i = 1; i < arguments.length; i++) {\n posses.push(_processOneSpec(el, arguments[i], true).name);\n }\n\n _each(el, function(_el) {\n if (_el._katavorioDrag) {\n var diff = _difference(_el._katavorioDrag.posses, posses);\n var p = [];\n Array.prototype.push.apply(p, _el._katavorioDrag.posses);\n for (var i = 0; i < diff.length; i++) {\n this.removeFromPosse(_el, diff[i]);\n }\n }\n }.bind(this));\n\n return posses.length === 1 ? posses[0] : posses;\n };\n\n /**\n * Remove the given element from the given posse(s).\n * @method removeFromPosse\n * @param {Element} el Element to remove.\n * @param {String...} posseId Varargs parameter: one value for each posse to remove the element from.\n */\n this.removeFromPosse = function(el, posseId) {\n if (arguments.length < 2) throw new TypeError(\"No posse id provided for remove operation\");\n for(var i = 1; i < arguments.length; i++) {\n posseId = arguments[i];\n _each(el, function (_el) {\n if (_el._katavorioDrag && _el._katavorioDrag.posses) {\n var d = _el._katavorioDrag;\n _each(posseId, function (p) {\n _vanquish(_posses[p].members, d);\n _vanquish(d.posses, p);\n delete d.posseRoles[p];\n });\n }\n });\n }\n };\n\n /**\n * Remove the given element from all Posses to which it belongs.\n * @method removeFromAllPosses\n * @param {Element|Element[]} el Element to remove from Posses.\n */\n this.removeFromAllPosses = function(el) {\n _each(el, function(_el) {\n if (_el._katavorioDrag && _el._katavorioDrag.posses) {\n var d = _el._katavorioDrag;\n _each(d.posses, function(p) {\n _vanquish(_posses[p].members, d);\n });\n d.posses.length = 0;\n d.posseRoles = {};\n }\n });\n };\n\n /**\n * Changes the participation state for the element in the Posse with the given ID.\n * @param {Element|Element[]} el Element(s) to change state for.\n * @param {String} posseId ID of the Posse to change element state for.\n * @param {Boolean} state True to make active, false to make passive.\n */\n this.setPosseState = function(el, posseId, state) {\n var posse = _posses[posseId];\n if (posse) {\n _each(el, function(_el) {\n if (_el._katavorioDrag && _el._katavorioDrag.posses) {\n _el._katavorioDrag.posseRoles[posse.name] = state;\n }\n });\n }\n };\n\n };\n\n root.Katavorio.version = \"1.0.0\";\n\n if (typeof exports !== \"undefined\") {\n exports.Katavorio = root.Katavorio;\n }\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n\n(function() {\n\n var root = this;\n root.jsPlumbUtil = root.jsPlumbUtil || {};\n var jsPlumbUtil = root.jsPlumbUtil;\n\n if (typeof exports !=='undefined') { exports.jsPlumbUtil = jsPlumbUtil;}\n\n\n function isArray(a) {\n return Object.prototype.toString.call(a) === \"[object Array]\";\n }\n jsPlumbUtil.isArray = isArray;\n function isNumber(n) {\n return Object.prototype.toString.call(n) === \"[object Number]\";\n }\n jsPlumbUtil.isNumber = isNumber;\n function isString(s) {\n return typeof s === \"string\";\n }\n jsPlumbUtil.isString = isString;\n function isBoolean(s) {\n return typeof s === \"boolean\";\n }\n jsPlumbUtil.isBoolean = isBoolean;\n function isNull(s) {\n return s == null;\n }\n jsPlumbUtil.isNull = isNull;\n function isObject(o) {\n return o == null ? false : Object.prototype.toString.call(o) === \"[object Object]\";\n }\n jsPlumbUtil.isObject = isObject;\n function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n }\n jsPlumbUtil.isDate = isDate;\n function isFunction(o) {\n return Object.prototype.toString.call(o) === \"[object Function]\";\n }\n jsPlumbUtil.isFunction = isFunction;\n function isNamedFunction(o) {\n return isFunction(o) && o.name != null && o.name.length > 0;\n }\n jsPlumbUtil.isNamedFunction = isNamedFunction;\n function isEmpty(o) {\n for (var i in o) {\n if (o.hasOwnProperty(i)) {\n return false;\n }\n }\n return true;\n }\n jsPlumbUtil.isEmpty = isEmpty;\n function clone(a) {\n if (isString(a)) {\n return \"\" + a;\n }\n else if (isBoolean(a)) {\n return !!a;\n }\n else if (isDate(a)) {\n return new Date(a.getTime());\n }\n else if (isFunction(a)) {\n return a;\n }\n else if (isArray(a)) {\n var b = [];\n for (var i = 0; i < a.length; i++) {\n b.push(clone(a[i]));\n }\n return b;\n }\n else if (isObject(a)) {\n var c = {};\n for (var j in a) {\n c[j] = clone(a[j]);\n }\n return c;\n }\n else {\n return a;\n }\n }\n jsPlumbUtil.clone = clone;\n function merge(a, b, collations, overwrites) {\n // first change the collations array - if present - into a lookup table, because its faster.\n var cMap = {}, ar, i, oMap = {};\n collations = collations || [];\n overwrites = overwrites || [];\n for (i = 0; i < collations.length; i++) {\n cMap[collations[i]] = true;\n }\n for (i = 0; i < overwrites.length; i++) {\n oMap[overwrites[i]] = true;\n }\n var c = clone(a);\n for (i in b) {\n if (c[i] == null || oMap[i]) {\n c[i] = b[i];\n }\n else if (isString(b[i]) || isBoolean(b[i])) {\n if (!cMap[i]) {\n c[i] = b[i]; // if we dont want to collate, just copy it in.\n }\n else {\n ar = [];\n // if c's object is also an array we can keep its values.\n ar.push.apply(ar, isArray(c[i]) ? c[i] : [c[i]]);\n ar.push.apply(ar, isBoolean(b[i]) ? b[i] : [b[i]]);\n c[i] = ar;\n }\n }\n else {\n if (isArray(b[i])) {\n ar = [];\n // if c's object is also an array we can keep its values.\n if (isArray(c[i])) {\n ar.push.apply(ar, c[i]);\n }\n ar.push.apply(ar, b[i]);\n c[i] = ar;\n }\n else if (isObject(b[i])) {\n // overwrite c's value with an object if it is not already one.\n if (!isObject(c[i])) {\n c[i] = {};\n }\n for (var j in b[i]) {\n c[i][j] = b[i][j];\n }\n }\n }\n }\n return c;\n }\n jsPlumbUtil.merge = merge;\n function replace(inObj, path, value) {\n if (inObj == null) {\n return;\n }\n var q = inObj, t = q;\n path.replace(/([^\\.])+/g, function (term, lc, pos, str) {\n var array = term.match(/([^\\[0-9]+){1}(\\[)([0-9+])/), last = pos + term.length >= str.length, _getArray = function () {\n return t[array[1]] || (function () {\n t[array[1]] = [];\n return t[array[1]];\n })();\n };\n if (last) {\n // set term = value on current t, creating term as array if necessary.\n if (array) {\n _getArray()[array[3]] = value;\n }\n else {\n t[term] = value;\n }\n }\n else {\n // set to current t[term], creating t[term] if necessary.\n if (array) {\n var a_1 = _getArray();\n t = a_1[array[3]] || (function () {\n a_1[array[3]] = {};\n return a_1[array[3]];\n })();\n }\n else {\n t = t[term] || (function () {\n t[term] = {};\n return t[term];\n })();\n }\n }\n return \"\";\n });\n return inObj;\n }\n jsPlumbUtil.replace = replace;\n //\n // chain a list of functions, supplied by [ object, method name, args ], and return on the first\n // one that returns the failValue. if none return the failValue, return the successValue.\n //\n function functionChain(successValue, failValue, fns) {\n for (var i = 0; i < fns.length; i++) {\n var o = fns[i][0][fns[i][1]].apply(fns[i][0], fns[i][2]);\n if (o === failValue) {\n return o;\n }\n }\n return successValue;\n }\n jsPlumbUtil.functionChain = functionChain;\n /**\n *\n * Take the given model and expand out any parameters. 'functionPrefix' is optional, and if present, helps jsplumb figure out what to do if a value is a Function.\n * if you do not provide it (and doNotExpandFunctions is null, or false), jsplumb will run the given values through any functions it finds, and use the function's\n * output as the value in the result. if you do provide the prefix, only functions that are named and have this prefix\n * will be executed; other functions will be passed as values to the output.\n *\n * @param model\n * @param values\n * @param functionPrefix\n * @param doNotExpandFunctions\n * @returns {any}\n */\n function populate(model, values, functionPrefix, doNotExpandFunctions) {\n // for a string, see if it has parameter matches, and if so, try to make the substitutions.\n var getValue = function (fromString) {\n var matches = fromString.match(/(\\${.*?})/g);\n if (matches != null) {\n for (var i = 0; i < matches.length; i++) {\n var val = values[matches[i].substring(2, matches[i].length - 1)] || \"\";\n if (val != null) {\n fromString = fromString.replace(matches[i], val);\n }\n }\n }\n return fromString;\n };\n // process one entry.\n var _one = function (d) {\n if (d != null) {\n if (isString(d)) {\n return getValue(d);\n }\n else if (isFunction(d) && !doNotExpandFunctions && (functionPrefix == null || (d.name || \"\").indexOf(functionPrefix) === 0)) {\n return d(values);\n }\n else if (isArray(d)) {\n var r = [];\n for (var i = 0; i < d.length; i++) {\n r.push(_one(d[i]));\n }\n return r;\n }\n else if (isObject(d)) {\n var s = {};\n for (var j in d) {\n s[j] = _one(d[j]);\n }\n return s;\n }\n else {\n return d;\n }\n }\n };\n return _one(model);\n }\n jsPlumbUtil.populate = populate;\n function findWithFunction(a, f) {\n if (a) {\n for (var i = 0; i < a.length; i++) {\n if (f(a[i])) {\n return i;\n }\n }\n }\n return -1;\n }\n jsPlumbUtil.findWithFunction = findWithFunction;\n function removeWithFunction(a, f) {\n var idx = findWithFunction(a, f);\n if (idx > -1) {\n a.splice(idx, 1);\n }\n return idx !== -1;\n }\n jsPlumbUtil.removeWithFunction = removeWithFunction;\n function remove(l, v) {\n var idx = l.indexOf(v);\n if (idx > -1) {\n l.splice(idx, 1);\n }\n return idx !== -1;\n }\n jsPlumbUtil.remove = remove;\n function addWithFunction(list, item, hashFunction) {\n if (findWithFunction(list, hashFunction) === -1) {\n list.push(item);\n }\n }\n jsPlumbUtil.addWithFunction = addWithFunction;\n function addToList(map, key, value, insertAtStart) {\n var l = map[key];\n if (l == null) {\n l = [];\n map[key] = l;\n }\n l[insertAtStart ? \"unshift\" : \"push\"](value);\n return l;\n }\n jsPlumbUtil.addToList = addToList;\n function suggest(list, item, insertAtHead) {\n if (list.indexOf(item) === -1) {\n if (insertAtHead) {\n list.unshift(item);\n }\n else {\n list.push(item);\n }\n return true;\n }\n return false;\n }\n jsPlumbUtil.suggest = suggest;\n //\n // extends the given obj (which can be an array) with the given constructor function, prototype functions, and\n // class members, any of which may be null.\n //\n function extend(child, parent, _protoFn) {\n var i;\n parent = isArray(parent) ? parent : [parent];\n var _copyProtoChain = function (focus) {\n var proto = focus.__proto__;\n while (proto != null) {\n if (proto.prototype != null) {\n for (var j in proto.prototype) {\n if (proto.prototype.hasOwnProperty(j) && !child.prototype.hasOwnProperty(j)) {\n child.prototype[j] = proto.prototype[j];\n }\n }\n proto = proto.prototype.__proto__;\n }\n else {\n proto = null;\n }\n }\n };\n for (i = 0; i < parent.length; i++) {\n for (var j in parent[i].prototype) {\n if (parent[i].prototype.hasOwnProperty(j) && !child.prototype.hasOwnProperty(j)) {\n child.prototype[j] = parent[i].prototype[j];\n }\n }\n _copyProtoChain(parent[i]);\n }\n var _makeFn = function (name, protoFn) {\n return function () {\n for (i = 0; i < parent.length; i++) {\n if (parent[i].prototype[name]) {\n parent[i].prototype[name].apply(this, arguments);\n }\n }\n return protoFn.apply(this, arguments);\n };\n };\n var _oneSet = function (fns) {\n for (var k in fns) {\n child.prototype[k] = _makeFn(k, fns[k]);\n }\n };\n if (arguments.length > 2) {\n for (i = 2; i < arguments.length; i++) {\n _oneSet(arguments[i]);\n }\n }\n return child;\n }\n jsPlumbUtil.extend = extend;\n function uuid() {\n return ('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n }));\n }\n jsPlumbUtil.uuid = uuid;\n function fastTrim(s) {\n if (s == null) {\n return null;\n }\n var str = s.replace(/^\\s\\s*/, ''), ws = /\\s/, i = str.length;\n while (ws.test(str.charAt(--i))) {\n }\n return str.slice(0, i + 1);\n }\n jsPlumbUtil.fastTrim = fastTrim;\n function each(obj, fn) {\n obj = obj.length == null || typeof obj === \"string\" ? [obj] : obj;\n for (var i = 0; i < obj.length; i++) {\n fn(obj[i]);\n }\n }\n jsPlumbUtil.each = each;\n function map(obj, fn) {\n var o = [];\n for (var i = 0; i < obj.length; i++) {\n o.push(fn(obj[i]));\n }\n return o;\n }\n jsPlumbUtil.map = map;\n function mergeWithParents(type, map, parentAttribute) {\n parentAttribute = parentAttribute || \"parent\";\n var _def = function (id) {\n return id ? map[id] : null;\n };\n var _parent = function (def) {\n return def ? _def(def[parentAttribute]) : null;\n };\n var _one = function (parent, def) {\n if (parent == null) {\n return def;\n }\n else {\n var d_1 = merge(parent, def);\n return _one(_parent(parent), d_1);\n }\n };\n var _getDef = function (t) {\n if (t == null) {\n return {};\n }\n if (typeof t === \"string\") {\n return _def(t);\n }\n else if (t.length) {\n var done = false, i = 0, _dd = void 0;\n while (!done && i < t.length) {\n _dd = _getDef(t[i]);\n if (_dd) {\n done = true;\n }\n else {\n i++;\n }\n }\n return _dd;\n }\n };\n var d = _getDef(type);\n if (d) {\n return _one(_parent(d), d);\n }\n else {\n return {};\n }\n }\n jsPlumbUtil.mergeWithParents = mergeWithParents;\n jsPlumbUtil.logEnabled = true;\n function log() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (jsPlumbUtil.logEnabled && typeof console !== \"undefined\") {\n try {\n var msg = arguments[arguments.length - 1];\n console.log(msg);\n }\n catch (e) {\n }\n }\n }\n jsPlumbUtil.log = log;\n /**\n * Wraps one function with another, creating a placeholder for the\n * wrapped function if it was null. this is used to wrap the various\n * drag/drop event functions - to allow jsPlumb to be notified of\n * important lifecycle events without imposing itself on the user's\n * drag/drop functionality.\n * @method jsPlumbUtil.wrap\n * @param {Function} wrappedFunction original function to wrap; may be null.\n * @param {Function} newFunction function to wrap the original with.\n * @param {Object} [returnOnThisValue] Optional. Indicates that the wrappedFunction should\n * not be executed if the newFunction returns a value matching 'returnOnThisValue'.\n * note that this is a simple comparison and only works for primitives right now.\n */\n function wrap(wrappedFunction, newFunction, returnOnThisValue) {\n return function () {\n var r = null;\n try {\n if (newFunction != null) {\n r = newFunction.apply(this, arguments);\n }\n }\n catch (e) {\n log(\"jsPlumb function failed : \" + e);\n }\n if ((wrappedFunction != null) && (returnOnThisValue == null || (r !== returnOnThisValue))) {\n try {\n r = wrappedFunction.apply(this, arguments);\n }\n catch (e) {\n log(\"wrapped function failed : \" + e);\n }\n }\n return r;\n };\n }\n jsPlumbUtil.wrap = wrap;\n var EventGenerator = /** @class */ (function () {\n function EventGenerator() {\n var _this = this;\n this._listeners = {};\n this.eventsSuspended = false;\n this.tick = false;\n // this is a list of events that should re-throw any errors that occur during their dispatch.\n this.eventsToDieOn = { \"ready\": true };\n this.queue = [];\n this.bind = function (event, listener, insertAtStart) {\n var _one = function (evt) {\n addToList(_this._listeners, evt, listener, insertAtStart);\n listener.__jsPlumb = listener.__jsPlumb || {};\n listener.__jsPlumb[uuid()] = evt;\n };\n if (typeof event === \"string\") {\n _one(event);\n }\n else if (event.length != null) {\n for (var i = 0; i < event.length; i++) {\n _one(event[i]);\n }\n }\n return _this;\n };\n this.fire = function (event, value, originalEvent) {\n if (!this.tick) {\n this.tick = true;\n if (!this.eventsSuspended && this._listeners[event]) {\n var l = this._listeners[event].length, i = 0, _gone = false, ret = null;\n if (!this.shouldFireEvent || this.shouldFireEvent(event, value, originalEvent)) {\n while (!_gone && i < l && ret !== false) {\n // doing it this way rather than catching and then possibly re-throwing means that an error propagated by this\n // method will have the whole call stack available in the debugger.\n if (this.eventsToDieOn[event]) {\n this._listeners[event][i].apply(this, [value, originalEvent]);\n }\n else {\n try {\n ret = this._listeners[event][i].apply(this, [value, originalEvent]);\n }\n catch (e) {\n log(\"jsPlumb: fire failed for event \" + event + \" : \" + e);\n }\n }\n i++;\n if (this._listeners == null || this._listeners[event] == null) {\n _gone = true;\n }\n }\n }\n }\n this.tick = false;\n this._drain();\n }\n else {\n this.queue.unshift(arguments);\n }\n return this;\n };\n this._drain = function () {\n var n = _this.queue.pop();\n if (n) {\n _this.fire.apply(_this, n);\n }\n };\n this.unbind = function (eventOrListener, listener) {\n if (arguments.length === 0) {\n this._listeners = {};\n }\n else if (arguments.length === 1) {\n if (typeof eventOrListener === \"string\") {\n delete this._listeners[eventOrListener];\n }\n else if (eventOrListener.__jsPlumb) {\n var evt = void 0;\n for (var i in eventOrListener.__jsPlumb) {\n evt = eventOrListener.__jsPlumb[i];\n remove(this._listeners[evt] || [], eventOrListener);\n }\n }\n }\n else if (arguments.length === 2) {\n remove(this._listeners[eventOrListener] || [], listener);\n }\n return this;\n };\n this.getListener = function (forEvent) {\n return _this._listeners[forEvent];\n };\n this.setSuspendEvents = function (val) {\n _this.eventsSuspended = val;\n };\n this.isSuspendEvents = function () {\n return _this.eventsSuspended;\n };\n this.silently = function (fn) {\n _this.setSuspendEvents(true);\n try {\n fn();\n }\n catch (e) {\n log(\"Cannot execute silent function \" + e);\n }\n _this.setSuspendEvents(false);\n };\n this.cleanupListeners = function () {\n for (var i in _this._listeners) {\n _this._listeners[i] = null;\n }\n };\n }\n return EventGenerator;\n }());\n jsPlumbUtil.EventGenerator = EventGenerator;\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains utility functions that run in browsers only.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n ;(function() {\n\n \"use strict\";\n\n var root = this;\n\n root.jsPlumbUtil.matchesSelector = function(el, selector, ctx) {\n ctx = ctx || el.parentNode;\n var possibles = ctx.querySelectorAll(selector);\n for (var i = 0; i < possibles.length; i++) {\n if (possibles[i] === el) {\n return true;\n }\n }\n return false;\n };\n\n root.jsPlumbUtil.consume = function(e, doNotPreventDefault) {\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n else {\n e.returnValue = false;\n }\n\n if (!doNotPreventDefault && e.preventDefault){\n e.preventDefault();\n }\n };\n\n /*\n * Function: sizeElement\n * Helper to size and position an element. You would typically use\n * this when writing your own Connector or Endpoint implementation.\n *\n * Parameters:\n * x - [int] x position for the element origin\n * y - [int] y position for the element origin\n * w - [int] width of the element\n * h - [int] height of the element\n *\n */\n root.jsPlumbUtil.sizeElement = function(el, x, y, w, h) {\n if (el) {\n el.style.height = h + \"px\";\n el.height = h;\n el.style.width = w + \"px\";\n el.width = w;\n el.style.left = x + \"px\";\n el.style.top = y + \"px\";\n }\n };\n\n }).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the core code.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function () {\n\n \"use strict\";\n\n var root = this;\n\n var _ju = root.jsPlumbUtil,\n\n /**\n * creates a timestamp, using milliseconds since 1970, but as a string.\n */\n _timestamp = function () {\n return \"\" + (new Date()).getTime();\n },\n\n // helper method to update the hover style whenever it, or paintStyle, changes.\n // we use paintStyle as the foundation and merge hoverPaintStyle over the\n // top.\n _updateHoverStyle = function (component) {\n if (component._jsPlumb.paintStyle && component._jsPlumb.hoverPaintStyle) {\n var mergedHoverStyle = {};\n jsPlumb.extend(mergedHoverStyle, component._jsPlumb.paintStyle);\n jsPlumb.extend(mergedHoverStyle, component._jsPlumb.hoverPaintStyle);\n delete component._jsPlumb.hoverPaintStyle;\n // we want the fill of paintStyle to override a gradient, if possible.\n if (mergedHoverStyle.gradient && component._jsPlumb.paintStyle.fill) {\n delete mergedHoverStyle.gradient;\n }\n component._jsPlumb.hoverPaintStyle = mergedHoverStyle;\n }\n },\n events = [\"tap\", \"dbltap\", \"click\", \"dblclick\", \"mouseover\", \"mouseout\", \"mousemove\", \"mousedown\", \"mouseup\", \"contextmenu\" ],\n eventFilters = { \"mouseout\": \"mouseleave\", \"mouseexit\": \"mouseleave\" },\n _updateAttachedElements = function (component, state, timestamp, sourceElement) {\n var affectedElements = component.getAttachedElements();\n if (affectedElements) {\n for (var i = 0, j = affectedElements.length; i < j; i++) {\n if (!sourceElement || sourceElement !== affectedElements[i]) {\n affectedElements[i].setHover(state, true, timestamp);\t\t\t// tell the attached elements not to inform their own attached elements.\n }\n }\n }\n },\n _splitType = function (t) {\n return t == null ? null : t.split(\" \");\n },\n _mapType = function(map, obj, typeId) {\n for (var i in obj) {\n map[i] = typeId;\n }\n },\n _each = function(fn, obj) {\n obj = _ju.isArray(obj) || (obj.length != null && !_ju.isString(obj)) ? obj : [ obj ];\n for (var i = 0; i < obj.length; i++) {\n try {\n fn.apply(obj[i], [ obj[i] ]);\n }\n catch (e) {\n _ju.log(\".each iteration failed : \" + e);\n }\n }\n },\n _applyTypes = function (component, params, doNotRepaint) {\n if (component.getDefaultType) {\n var td = component.getTypeDescriptor(), map = {};\n var defType = component.getDefaultType();\n var o = _ju.merge({}, defType);\n _mapType(map, defType, \"__default\");\n for (var i = 0, j = component._jsPlumb.types.length; i < j; i++) {\n var tid = component._jsPlumb.types[i];\n if (tid !== \"__default\") {\n var _t = component._jsPlumb.instance.getType(tid, td);\n if (_t != null) {\n o = _ju.merge(o, _t, [ \"cssClass\" ], [ \"connector\" ]);\n _mapType(map, _t, tid);\n }\n }\n }\n\n if (params) {\n o = _ju.populate(o, params, \"_\");\n }\n\n component.applyType(o, doNotRepaint, map);\n if (!doNotRepaint) {\n component.repaint();\n }\n }\n },\n\n// ------------------------------ BEGIN jsPlumbUIComponent --------------------------------------------\n\n jsPlumbUIComponent = root.jsPlumbUIComponent = function (params) {\n\n _ju.EventGenerator.apply(this, arguments);\n\n var self = this,\n a = arguments,\n idPrefix = self.idPrefix,\n id = idPrefix + (new Date()).getTime();\n\n this._jsPlumb = {\n instance: params._jsPlumb,\n parameters: params.parameters || {},\n paintStyle: null,\n hoverPaintStyle: null,\n paintStyleInUse: null,\n hover: false,\n beforeDetach: params.beforeDetach,\n beforeDrop: params.beforeDrop,\n overlayPlacements: [],\n hoverClass: params.hoverClass || params._jsPlumb.Defaults.HoverClass,\n types: [],\n typeCache:{}\n };\n\n this.cacheTypeItem = function(key, item, typeId) {\n this._jsPlumb.typeCache[typeId] = this._jsPlumb.typeCache[typeId] || {};\n this._jsPlumb.typeCache[typeId][key] = item;\n };\n this.getCachedTypeItem = function(key, typeId) {\n return this._jsPlumb.typeCache[typeId] ? this._jsPlumb.typeCache[typeId][key] : null;\n };\n\n this.getId = function () {\n return id;\n };\n\n// ----------------------------- default type --------------------------------------------\n\n\n var o = params.overlays || [], oo = {};\n if (this.defaultOverlayKeys) {\n for (var i = 0; i < this.defaultOverlayKeys.length; i++) {\n Array.prototype.push.apply(o, this._jsPlumb.instance.Defaults[this.defaultOverlayKeys[i]] || []);\n }\n\n for (i = 0; i < o.length; i++) {\n // if a string, convert to object representation so that we can store the typeid on it.\n // also assign an id.\n var fo = jsPlumb.convertToFullOverlaySpec(o[i]);\n oo[fo[1].id] = fo;\n }\n }\n\n var _defaultType = {\n overlays:oo,\n parameters: params.parameters || {},\n scope: params.scope || this._jsPlumb.instance.getDefaultScope()\n };\n this.getDefaultType = function() {\n return _defaultType;\n };\n this.appendToDefaultType = function(obj) {\n for (var i in obj) {\n _defaultType[i] = obj[i];\n }\n };\n\n// ----------------------------- end default type --------------------------------------------\n\n // all components can generate events\n\n if (params.events) {\n for (var evtName in params.events) {\n self.bind(evtName, params.events[evtName]);\n }\n }\n\n // all components get this clone function.\n // TODO issue 116 showed a problem with this - it seems 'a' that is in\n // the clone function's scope is shared by all invocations of it, the classic\n // JS closure problem. for now, jsPlumb does a version of this inline where\n // it used to call clone. but it would be nice to find some time to look\n // further at this.\n this.clone = function () {\n var o = Object.create(this.constructor.prototype);\n this.constructor.apply(o, a);\n return o;\n }.bind(this);\n\n // user can supply a beforeDetach callback, which will be executed before a detach\n // is performed; returning false prevents the detach.\n this.isDetachAllowed = function (connection) {\n var r = true;\n if (this._jsPlumb.beforeDetach) {\n try {\n r = this._jsPlumb.beforeDetach(connection);\n }\n catch (e) {\n _ju.log(\"jsPlumb: beforeDetach callback failed\", e);\n }\n }\n return r;\n };\n\n // user can supply a beforeDrop callback, which will be executed before a dropped\n // connection is confirmed. user can return false to reject connection.\n this.isDropAllowed = function (sourceId, targetId, scope, connection, dropEndpoint, source, target) {\n var r = this._jsPlumb.instance.checkCondition(\"beforeDrop\", {\n sourceId: sourceId,\n targetId: targetId,\n scope: scope,\n connection: connection,\n dropEndpoint: dropEndpoint,\n source: source, target: target\n });\n if (this._jsPlumb.beforeDrop) {\n try {\n r = this._jsPlumb.beforeDrop({\n sourceId: sourceId,\n targetId: targetId,\n scope: scope,\n connection: connection,\n dropEndpoint: dropEndpoint,\n source: source, target: target\n });\n }\n catch (e) {\n _ju.log(\"jsPlumb: beforeDrop callback failed\", e);\n }\n }\n return r;\n };\n\n var domListeners = [];\n\n // sets the component associated with listener events. for instance, an overlay delegates\n // its events back to a connector. but if the connector is swapped on the underlying connection,\n // then this component must be changed. This is called by setConnector in the Connection class.\n this.setListenerComponent = function (c) {\n for (var i = 0; i < domListeners.length; i++) {\n domListeners[i][3] = c;\n }\n };\n\n\n };\n\n var _removeTypeCssHelper = function (component, typeIndex) {\n var typeId = component._jsPlumb.types[typeIndex],\n type = component._jsPlumb.instance.getType(typeId, component.getTypeDescriptor());\n\n if (type != null && type.cssClass && component.canvas) {\n component._jsPlumb.instance.removeClass(component.canvas, type.cssClass);\n }\n };\n\n _ju.extend(root.jsPlumbUIComponent, _ju.EventGenerator, {\n\n getParameter: function (name) {\n return this._jsPlumb.parameters[name];\n },\n\n setParameter: function (name, value) {\n this._jsPlumb.parameters[name] = value;\n },\n\n getParameters: function () {\n return this._jsPlumb.parameters;\n },\n\n setParameters: function (p) {\n this._jsPlumb.parameters = p;\n },\n\n getClass:function() {\n return jsPlumb.getClass(this.canvas);\n },\n\n hasClass:function(clazz) {\n return jsPlumb.hasClass(this.canvas, clazz);\n },\n\n addClass: function (clazz) {\n jsPlumb.addClass(this.canvas, clazz);\n },\n\n removeClass: function (clazz) {\n jsPlumb.removeClass(this.canvas, clazz);\n },\n\n updateClasses: function (classesToAdd, classesToRemove) {\n jsPlumb.updateClasses(this.canvas, classesToAdd, classesToRemove);\n },\n\n setType: function (typeId, params, doNotRepaint) {\n this.clearTypes();\n this._jsPlumb.types = _splitType(typeId) || [];\n _applyTypes(this, params, doNotRepaint);\n },\n\n getType: function () {\n return this._jsPlumb.types;\n },\n\n reapplyTypes: function (params, doNotRepaint) {\n _applyTypes(this, params, doNotRepaint);\n },\n\n hasType: function (typeId) {\n return this._jsPlumb.types.indexOf(typeId) !== -1;\n },\n\n addType: function (typeId, params, doNotRepaint) {\n var t = _splitType(typeId), _cont = false;\n if (t != null) {\n for (var i = 0, j = t.length; i < j; i++) {\n if (!this.hasType(t[i])) {\n this._jsPlumb.types.push(t[i]);\n _cont = true;\n }\n }\n if (_cont) {\n _applyTypes(this, params, doNotRepaint);\n }\n }\n },\n\n removeType: function (typeId, params, doNotRepaint) {\n var t = _splitType(typeId), _cont = false, _one = function (tt) {\n var idx = this._jsPlumb.types.indexOf(tt);\n if (idx !== -1) {\n // remove css class if necessary\n _removeTypeCssHelper(this, idx);\n this._jsPlumb.types.splice(idx, 1);\n return true;\n }\n return false;\n }.bind(this);\n\n if (t != null) {\n for (var i = 0, j = t.length; i < j; i++) {\n _cont = _one(t[i]) || _cont;\n }\n if (_cont) {\n _applyTypes(this, params, doNotRepaint);\n }\n }\n },\n clearTypes: function (params, doNotRepaint) {\n var i = this._jsPlumb.types.length;\n for (var j = 0; j < i; j++) {\n _removeTypeCssHelper(this, 0);\n this._jsPlumb.types.splice(0, 1);\n }\n _applyTypes(this, params, doNotRepaint);\n },\n\n toggleType: function (typeId, params, doNotRepaint) {\n var t = _splitType(typeId);\n if (t != null) {\n for (var i = 0, j = t.length; i < j; i++) {\n var idx = this._jsPlumb.types.indexOf(t[i]);\n if (idx !== -1) {\n _removeTypeCssHelper(this, idx);\n this._jsPlumb.types.splice(idx, 1);\n }\n else {\n this._jsPlumb.types.push(t[i]);\n }\n }\n\n _applyTypes(this, params, doNotRepaint);\n }\n },\n applyType: function (t, doNotRepaint) {\n this.setPaintStyle(t.paintStyle, doNotRepaint);\n this.setHoverPaintStyle(t.hoverPaintStyle, doNotRepaint);\n if (t.parameters) {\n for (var i in t.parameters) {\n this.setParameter(i, t.parameters[i]);\n }\n }\n this._jsPlumb.paintStyleInUse = this.getPaintStyle();\n },\n setPaintStyle: function (style, doNotRepaint) {\n // this._jsPlumb.paintStyle = jsPlumb.extend({}, style);\n // TODO figure out if we want components to clone paintStyle so as not to share it.\n this._jsPlumb.paintStyle = style;\n this._jsPlumb.paintStyleInUse = this._jsPlumb.paintStyle;\n _updateHoverStyle(this);\n if (!doNotRepaint) {\n this.repaint();\n }\n },\n getPaintStyle: function () {\n return this._jsPlumb.paintStyle;\n },\n setHoverPaintStyle: function (style, doNotRepaint) {\n //this._jsPlumb.hoverPaintStyle = jsPlumb.extend({}, style);\n // TODO figure out if we want components to clone paintStyle so as not to share it.\n this._jsPlumb.hoverPaintStyle = style;\n _updateHoverStyle(this);\n if (!doNotRepaint) {\n this.repaint();\n }\n },\n getHoverPaintStyle: function () {\n return this._jsPlumb.hoverPaintStyle;\n },\n destroy: function (force) {\n if (force || this.typeId == null) {\n this.cleanupListeners(); // this is on EventGenerator\n this.clone = null;\n this._jsPlumb = null;\n }\n },\n\n isHover: function () {\n return this._jsPlumb.hover;\n },\n\n setHover: function (hover, ignoreAttachedElements, timestamp) {\n // while dragging, we ignore these events. this keeps the UI from flashing and\n // swishing and whatevering.\n if (this._jsPlumb && !this._jsPlumb.instance.currentlyDragging && !this._jsPlumb.instance.isHoverSuspended()) {\n\n this._jsPlumb.hover = hover;\n var method = hover ? \"addClass\" : \"removeClass\";\n\n if (this.canvas != null) {\n if (this._jsPlumb.instance.hoverClass != null) {\n this._jsPlumb.instance[method](this.canvas, this._jsPlumb.instance.hoverClass);\n }\n if (this._jsPlumb.hoverClass != null) {\n this._jsPlumb.instance[method](this.canvas, this._jsPlumb.hoverClass);\n }\n }\n if (this._jsPlumb.hoverPaintStyle != null) {\n this._jsPlumb.paintStyleInUse = hover ? this._jsPlumb.hoverPaintStyle : this._jsPlumb.paintStyle;\n if (!this._jsPlumb.instance.isSuspendDrawing()) {\n timestamp = timestamp || _timestamp();\n this.repaint({timestamp: timestamp, recalc: false});\n }\n }\n // get the list of other affected elements, if supported by this component.\n // for a connection, its the endpoints. for an endpoint, its the connections! surprise.\n if (this.getAttachedElements && !ignoreAttachedElements) {\n _updateAttachedElements(this, hover, _timestamp(), this);\n }\n }\n }\n });\n\n// ------------------------------ END jsPlumbUIComponent --------------------------------------------\n\n var _jsPlumbInstanceIndex = 0,\n getInstanceIndex = function () {\n var i = _jsPlumbInstanceIndex + 1;\n _jsPlumbInstanceIndex++;\n return i;\n };\n\n var jsPlumbInstance = root.jsPlumbInstance = function (_defaults) {\n\n this.version = \"2.9.0\";\n\n this.Defaults = {\n Anchor: \"Bottom\",\n Anchors: [ null, null ],\n ConnectionsDetachable: true,\n ConnectionOverlays: [ ],\n Connector: \"Bezier\",\n Container: null,\n DoNotThrowErrors: false,\n DragOptions: { },\n DropOptions: { },\n Endpoint: \"Dot\",\n EndpointOverlays: [ ],\n Endpoints: [ null, null ],\n EndpointStyle: { fill: \"#456\" },\n EndpointStyles: [ null, null ],\n EndpointHoverStyle: null,\n EndpointHoverStyles: [ null, null ],\n HoverPaintStyle: null,\n LabelStyle: { color: \"black\" },\n LogEnabled: false,\n Overlays: [ ],\n MaxConnections: 1,\n PaintStyle: { \"stroke-width\": 4, stroke: \"#456\" },\n ReattachConnections: false,\n RenderMode: \"svg\",\n Scope: \"jsPlumb_DefaultScope\"\n };\n\n if (_defaults) {\n jsPlumb.extend(this.Defaults, _defaults);\n }\n\n this.logEnabled = this.Defaults.LogEnabled;\n this._connectionTypes = {};\n this._endpointTypes = {};\n\n _ju.EventGenerator.apply(this);\n\n var _currentInstance = this,\n _instanceIndex = getInstanceIndex(),\n _bb = _currentInstance.bind,\n _initialDefaults = {},\n _zoom = 1,\n _info = function (el) {\n if (el == null) {\n return null;\n }\n else if (el.nodeType === 3 || el.nodeType === 8) {\n return { el:el, text:true };\n }\n else {\n var _el = _currentInstance.getElement(el);\n return { el: _el, id: (_ju.isString(el) && _el == null) ? el : _getId(_el) };\n }\n };\n\n this.getInstanceIndex = function () {\n return _instanceIndex;\n };\n\n // CONVERTED\n this.setZoom = function (z, repaintEverything) {\n _zoom = z;\n _currentInstance.fire(\"zoom\", _zoom);\n if (repaintEverything) {\n _currentInstance.repaintEverything();\n }\n return true;\n };\n // CONVERTED\n this.getZoom = function () {\n return _zoom;\n };\n\n for (var i in this.Defaults) {\n _initialDefaults[i] = this.Defaults[i];\n }\n\n var _container, _containerDelegations = [];\n this.unbindContainer = function() {\n if (_container != null && _containerDelegations.length > 0) {\n for (var i = 0; i < _containerDelegations.length; i++) {\n _currentInstance.off(_container, _containerDelegations[i][0], _containerDelegations[i][1]);\n }\n }\n };\n this.setContainer = function (c) {\n\n this.unbindContainer();\n\n // get container as dom element.\n c = this.getElement(c);\n // move existing connections and endpoints, if any.\n this.select().each(function (conn) {\n conn.moveParent(c);\n });\n this.selectEndpoints().each(function (ep) {\n ep.moveParent(c);\n });\n\n // set container.\n var previousContainer = _container;\n _container = c;\n _containerDelegations.length = 0;\n var eventAliases = {\n \"endpointclick\":\"endpointClick\",\n \"endpointdblclick\":\"endpointDblClick\"\n };\n\n var _oneDelegateHandler = function (id, e, componentType) {\n var t = e.srcElement || e.target,\n jp = (t && t.parentNode ? t.parentNode._jsPlumb : null) || (t ? t._jsPlumb : null) || (t && t.parentNode && t.parentNode.parentNode ? t.parentNode.parentNode._jsPlumb : null);\n if (jp) {\n jp.fire(id, jp, e);\n var alias = componentType ? eventAliases[componentType + id] || id : id;\n // jsplumb also fires every event coming from components/overlays. That's what the test for `jp.component` is for.\n _currentInstance.fire(alias, jp.component || jp, e);\n }\n };\n\n var _addOneDelegate = function(eventId, selector, fn) {\n _containerDelegations.push([eventId, fn]);\n _currentInstance.on(_container, eventId, selector, fn);\n };\n\n // delegate one event on the container to jsplumb elements. it might be possible to\n // abstract this out: each of endpoint, connection and overlay could register themselves with\n // jsplumb as \"component types\" or whatever, and provide a suitable selector. this would be\n // done by the renderer (although admittedly from 2.0 onwards we're not supporting vml anymore)\n var _oneDelegate = function (id) {\n // connections.\n _addOneDelegate(id, \".jtk-connector\", function (e) {\n _oneDelegateHandler(id, e);\n });\n // endpoints. note they can have an enclosing div, or not.\n _addOneDelegate(id, \".jtk-endpoint\", function (e) {\n _oneDelegateHandler(id, e, \"endpoint\");\n });\n // overlays\n _addOneDelegate(id, \".jtk-overlay\", function (e) {\n _oneDelegateHandler(id, e);\n });\n };\n\n for (var i = 0; i < events.length; i++) {\n _oneDelegate(events[i]);\n }\n\n // managed elements\n for (var elId in managedElements) {\n var el = managedElements[elId].el;\n if (el.parentNode === previousContainer) {\n previousContainer.removeChild(el);\n _container.appendChild(el);\n }\n }\n\n };\n this.getContainer = function () {\n return _container;\n };\n\n this.bind = function (event, fn) {\n if (\"ready\" === event && initialized) {\n fn();\n }\n else {\n _bb.apply(_currentInstance, [event, fn]);\n }\n };\n\n _currentInstance.importDefaults = function (d) {\n for (var i in d) {\n _currentInstance.Defaults[i] = d[i];\n }\n if (d.Container) {\n _currentInstance.setContainer(d.Container);\n }\n\n return _currentInstance;\n };\n\n _currentInstance.restoreDefaults = function () {\n _currentInstance.Defaults = jsPlumb.extend({}, _initialDefaults);\n return _currentInstance;\n };\n\n var log = null,\n initialized = false,\n // TODO remove from window scope\n connections = [],\n // map of element id -> endpoint lists. an element can have an arbitrary\n // number of endpoints on it, and not all of them have to be connected\n // to anything.\n endpointsByElement = {},\n endpointsByUUID = {},\n managedElements = {},\n offsets = {},\n offsetTimestamps = {},\n draggableStates = {},\n connectionBeingDragged = false,\n sizes = [],\n _suspendDrawing = false,\n _suspendedAt = null,\n DEFAULT_SCOPE = this.Defaults.Scope,\n _curIdStamp = 1,\n _idstamp = function () {\n return \"\" + _curIdStamp++;\n },\n\n //\n // appends an element to some other element, which is calculated as follows:\n //\n // 1. if Container exists, use that element.\n // 2. if the 'parent' parameter exists, use that.\n // 3. otherwise just use the root element.\n //\n //\n _appendElement = function (el, parent) {\n if (_container) {\n _container.appendChild(el);\n }\n else if (!parent) {\n this.appendToRoot(el);\n }\n else {\n this.getElement(parent).appendChild(el);\n }\n }.bind(this),\n\n //\n // Draws an endpoint and its connections. this is the main entry point into drawing connections as well\n // as endpoints, since jsPlumb is endpoint-centric under the hood.\n //\n // @param element element to draw (of type library specific element object)\n // @param ui UI object from current library's event system. optional.\n // @param timestamp timestamp for this paint cycle. used to speed things up a little by cutting down the amount of offset calculations we do.\n // @param clearEdits defaults to false; indicates that mouse edits for connectors should be cleared\n ///\n _draw = function (element, ui, timestamp, clearEdits) {\n\n if (!_suspendDrawing) {\n var id = _getId(element),\n repaintEls,\n dm = _currentInstance.getDragManager();\n\n if (dm) {\n repaintEls = dm.getElementsForDraggable(id);\n }\n\n if (timestamp == null) {\n timestamp = _timestamp();\n }\n\n // update the offset of everything _before_ we try to draw anything.\n var o = _updateOffset({ elId: id, offset: ui, recalc: false, timestamp: timestamp });\n\n if (repaintEls && o && o.o) {\n for (var i in repaintEls) {\n _updateOffset({\n elId: repaintEls[i].id,\n offset: {\n left: o.o.left + repaintEls[i].offset.left,\n top: o.o.top + repaintEls[i].offset.top\n },\n recalc: false,\n timestamp: timestamp\n });\n }\n }\n\n _currentInstance.anchorManager.redraw(id, ui, timestamp, null, clearEdits);\n\n if (repaintEls) {\n for (var j in repaintEls) {\n _currentInstance.anchorManager.redraw(repaintEls[j].id, ui, timestamp, repaintEls[j].offset, clearEdits, true);\n }\n }\n }\n },\n\n //\n // gets an Endpoint by uuid.\n //\n _getEndpoint = function (uuid) {\n return endpointsByUUID[uuid];\n },\n\n /**\n * inits a draggable if it's not already initialised.\n * TODO: somehow abstract this to the adapter, because the concept of \"draggable\" has no\n * place on the server.\n */\n\n\n _scopeMatch = function (e1, e2) {\n var s1 = e1.scope.split(/\\s/), s2 = e2.scope.split(/\\s/);\n for (var i = 0; i < s1.length; i++) {\n for (var j = 0; j < s2.length; j++) {\n if (s2[j] === s1[i]) {\n return true;\n }\n }\n }\n\n return false;\n },\n\n _mergeOverrides = function (def, values) {\n var m = jsPlumb.extend({}, def);\n for (var i in values) {\n if (values[i]) {\n m[i] = values[i];\n }\n }\n return m;\n },\n\n /*\n * prepares a final params object that can be passed to _newConnection, taking into account defaults, events, etc.\n */\n _prepareConnectionParams = function (params, referenceParams) {\n var _p = jsPlumb.extend({ }, params);\n if (referenceParams) {\n jsPlumb.extend(_p, referenceParams);\n }\n\n // hotwire endpoints passed as source or target to sourceEndpoint/targetEndpoint, respectively.\n if (_p.source) {\n if (_p.source.endpoint) {\n _p.sourceEndpoint = _p.source;\n }\n else {\n _p.source = _currentInstance.getElement(_p.source);\n }\n }\n if (_p.target) {\n if (_p.target.endpoint) {\n _p.targetEndpoint = _p.target;\n }\n else {\n _p.target = _currentInstance.getElement(_p.target);\n }\n }\n\n // test for endpoint uuids to connect\n if (params.uuids) {\n _p.sourceEndpoint = _getEndpoint(params.uuids[0]);\n _p.targetEndpoint = _getEndpoint(params.uuids[1]);\n }\n\n // now ensure that if we do have Endpoints already, they're not full.\n // source:\n if (_p.sourceEndpoint && _p.sourceEndpoint.isFull()) {\n _ju.log(_currentInstance, \"could not add connection; source endpoint is full\");\n return;\n }\n\n // target:\n if (_p.targetEndpoint && _p.targetEndpoint.isFull()) {\n _ju.log(_currentInstance, \"could not add connection; target endpoint is full\");\n return;\n }\n\n // if source endpoint mandates connection type and nothing specified in our params, use it.\n if (!_p.type && _p.sourceEndpoint) {\n _p.type = _p.sourceEndpoint.connectionType;\n }\n\n // copy in any connectorOverlays that were specified on the source endpoint.\n // it doesnt copy target endpoint overlays. i'm not sure if we want it to or not.\n if (_p.sourceEndpoint && _p.sourceEndpoint.connectorOverlays) {\n _p.overlays = _p.overlays || [];\n for (var i = 0, j = _p.sourceEndpoint.connectorOverlays.length; i < j; i++) {\n _p.overlays.push(_p.sourceEndpoint.connectorOverlays[i]);\n }\n }\n\n // scope\n if (_p.sourceEndpoint && _p.sourceEndpoint.scope) {\n _p.scope = _p.sourceEndpoint.scope;\n }\n\n // pointer events\n if (!_p[\"pointer-events\"] && _p.sourceEndpoint && _p.sourceEndpoint.connectorPointerEvents) {\n _p[\"pointer-events\"] = _p.sourceEndpoint.connectorPointerEvents;\n }\n\n\n var _addEndpoint = function (el, def, idx) {\n return _currentInstance.addEndpoint(el, _mergeOverrides(def, {\n anchor: _p.anchors ? _p.anchors[idx] : _p.anchor,\n endpoint: _p.endpoints ? _p.endpoints[idx] : _p.endpoint,\n paintStyle: _p.endpointStyles ? _p.endpointStyles[idx] : _p.endpointStyle,\n hoverPaintStyle: _p.endpointHoverStyles ? _p.endpointHoverStyles[idx] : _p.endpointHoverStyle\n }));\n };\n\n // check for makeSource/makeTarget specs.\n\n var _oneElementDef = function (type, idx, defs, matchType) {\n if (_p[type] && !_p[type].endpoint && !_p[type + \"Endpoint\"] && !_p.newConnection) {\n var tid = _getId(_p[type]), tep = defs[tid];\n\n tep = tep ? tep[matchType] : null;\n\n if (tep) {\n // if not enabled, return.\n if (!tep.enabled) {\n return false;\n }\n var newEndpoint = tep.endpoint != null && tep.endpoint._jsPlumb ? tep.endpoint : _addEndpoint(_p[type], tep.def, idx);\n if (newEndpoint.isFull()) {\n return false;\n }\n _p[type + \"Endpoint\"] = newEndpoint;\n if (!_p.scope && tep.def.scope) {\n _p.scope = tep.def.scope;\n } // provide scope if not already provided and endpoint def has one.\n if (tep.uniqueEndpoint) {\n if (!tep.endpoint) {\n tep.endpoint = newEndpoint;\n newEndpoint.setDeleteOnEmpty(false);\n }\n else {\n newEndpoint.finalEndpoint = tep.endpoint;\n }\n } else {\n newEndpoint.setDeleteOnEmpty(true);\n }\n\n //\n // copy in connector overlays if present on the source definition.\n //\n if (idx === 0 && tep.def.connectorOverlays) {\n _p.overlays = _p.overlays || [];\n Array.prototype.push.apply(_p.overlays, tep.def.connectorOverlays);\n }\n }\n }\n };\n\n if (_oneElementDef(\"source\", 0, this.sourceEndpointDefinitions, _p.type || \"default\") === false) {\n return;\n }\n if (_oneElementDef(\"target\", 1, this.targetEndpointDefinitions, _p.type || \"default\") === false) {\n return;\n }\n\n // last, ensure scopes match\n if (_p.sourceEndpoint && _p.targetEndpoint) {\n if (!_scopeMatch(_p.sourceEndpoint, _p.targetEndpoint)) {\n _p = null;\n }\n }\n\n return _p;\n }.bind(_currentInstance),\n\n _newConnection = function (params) {\n var connectionFunc = _currentInstance.Defaults.ConnectionType || _currentInstance.getDefaultConnectionType();\n\n params._jsPlumb = _currentInstance;\n params.newConnection = _newConnection;\n params.newEndpoint = _newEndpoint;\n params.endpointsByUUID = endpointsByUUID;\n params.endpointsByElement = endpointsByElement;\n params.finaliseConnection = _finaliseConnection;\n params.id = \"con_\" + _idstamp();\n var con = new connectionFunc(params);\n\n // if the connection is draggable, then maybe we need to tell the target endpoint to init the\n // dragging code. it won't run again if it already configured to be draggable.\n if (con.isDetachable()) {\n con.endpoints[0].initDraggable(\"_jsPlumbSource\");\n con.endpoints[1].initDraggable(\"_jsPlumbTarget\");\n }\n\n return con;\n },\n\n //\n // adds the connection to the backing model, fires an event if necessary and then redraws\n //\n _finaliseConnection = _currentInstance.finaliseConnection = function (jpc, params, originalEvent, doInformAnchorManager) {\n params = params || {};\n // add to list of connections (by scope).\n if (!jpc.suspendedEndpoint) {\n connections.push(jpc);\n }\n\n jpc.pending = null;\n\n // turn off isTemporarySource on the source endpoint (only viable on first draw)\n jpc.endpoints[0].isTemporarySource = false;\n\n // always inform the anchor manager\n // except that if jpc has a suspended endpoint it's not true to say the\n // connection is new; it has just (possibly) moved. the question is whether\n // to make that call here or in the anchor manager. i think perhaps here.\n if (doInformAnchorManager !== false) {\n _currentInstance.anchorManager.newConnection(jpc);\n }\n\n // force a paint\n _draw(jpc.source);\n\n // fire an event\n if (!params.doNotFireConnectionEvent && params.fireEvent !== false) {\n\n var eventArgs = {\n connection: jpc,\n source: jpc.source, target: jpc.target,\n sourceId: jpc.sourceId, targetId: jpc.targetId,\n sourceEndpoint: jpc.endpoints[0], targetEndpoint: jpc.endpoints[1]\n };\n\n _currentInstance.fire(\"connection\", eventArgs, originalEvent);\n }\n },\n\n /*\n factory method to prepare a new endpoint. this should always be used instead of creating Endpoints\n manually, since this method attaches event listeners and an id.\n */\n _newEndpoint = function (params, id) {\n var endpointFunc = _currentInstance.Defaults.EndpointType || jsPlumb.Endpoint;\n var _p = jsPlumb.extend({}, params);\n _p._jsPlumb = _currentInstance;\n _p.newConnection = _newConnection;\n _p.newEndpoint = _newEndpoint;\n _p.endpointsByUUID = endpointsByUUID;\n _p.endpointsByElement = endpointsByElement;\n _p.fireDetachEvent = fireDetachEvent;\n _p.elementId = id || _getId(_p.source);\n var ep = new endpointFunc(_p);\n ep.id = \"ep_\" + _idstamp();\n _manage(_p.elementId, _p.source);\n\n if (!jsPlumb.headless) {\n _currentInstance.getDragManager().endpointAdded(_p.source, id);\n }\n\n return ep;\n },\n\n /*\n * performs the given function operation on all the connections found\n * for the given element id; this means we find all the endpoints for\n * the given element, and then for each endpoint find the connectors\n * connected to it. then we pass each connection in to the given\n * function.\n */\n _operation = function (elId, func, endpointFunc) {\n var endpoints = endpointsByElement[elId];\n if (endpoints && endpoints.length) {\n for (var i = 0, ii = endpoints.length; i < ii; i++) {\n for (var j = 0, jj = endpoints[i].connections.length; j < jj; j++) {\n var retVal = func(endpoints[i].connections[j]);\n // if the function passed in returns true, we exit.\n // most functions return false.\n if (retVal) {\n return;\n }\n }\n if (endpointFunc) {\n endpointFunc(endpoints[i]);\n }\n }\n }\n },\n\n _setDraggable = function (element, draggable) {\n return jsPlumb.each(element, function (el) {\n if (_currentInstance.isDragSupported(el)) {\n draggableStates[_currentInstance.getAttribute(el, \"id\")] = draggable;\n _currentInstance.setElementDraggable(el, draggable);\n }\n });\n },\n /*\n * private method to do the business of hiding/showing.\n *\n * @param el\n * either Id of the element in question or a library specific\n * object for the element.\n * @param state\n * String specifying a value for the css 'display' property\n * ('block' or 'none').\n */\n _setVisible = function (el, state, alsoChangeEndpoints) {\n state = state === \"block\";\n var endpointFunc = null;\n if (alsoChangeEndpoints) {\n endpointFunc = function (ep) {\n ep.setVisible(state, true, true);\n };\n }\n var info = _info(el);\n _operation(info.id, function (jpc) {\n if (state && alsoChangeEndpoints) {\n // this test is necessary because this functionality is new, and i wanted to maintain backwards compatibility.\n // this block will only set a connection to be visible if the other endpoint in the connection is also visible.\n var oidx = jpc.sourceId === info.id ? 1 : 0;\n if (jpc.endpoints[oidx].isVisible()) {\n jpc.setVisible(true);\n }\n }\n else { // the default behaviour for show, and what always happens for hide, is to just set the visibility without getting clever.\n jpc.setVisible(state);\n }\n }, endpointFunc);\n },\n /**\n * private method to do the business of toggling hiding/showing.\n */\n _toggleVisible = function (elId, changeEndpoints) {\n var endpointFunc = null;\n if (changeEndpoints) {\n endpointFunc = function (ep) {\n var state = ep.isVisible();\n ep.setVisible(!state);\n };\n }\n _operation(elId, function (jpc) {\n var state = jpc.isVisible();\n jpc.setVisible(!state);\n }, endpointFunc);\n },\n\n // TODO comparison performance\n _getCachedData = function (elId) {\n var o = offsets[elId];\n if (!o) {\n return _updateOffset({elId: elId});\n }\n else {\n return {o: o, s: sizes[elId]};\n }\n },\n\n /**\n * gets an id for the given element, creating and setting one if\n * necessary. the id is of the form\n *\n * jsPlumb__\n *\n * where \"index in instance\" is a monotonically increasing integer that starts at 0,\n * for each instance. this method is used not only to assign ids to elements that do not\n * have them but also to connections and endpoints.\n */\n _getId = function (element, uuid, doNotCreateIfNotFound) {\n if (_ju.isString(element)) {\n return element;\n }\n if (element == null) {\n return null;\n }\n var id = _currentInstance.getAttribute(element, \"id\");\n if (!id || id === \"undefined\") {\n // check if fixed uuid parameter is given\n if (arguments.length === 2 && arguments[1] !== undefined) {\n id = uuid;\n }\n else if (arguments.length === 1 || (arguments.length === 3 && !arguments[2])) {\n id = \"jsPlumb_\" + _instanceIndex + \"_\" + _idstamp();\n }\n\n if (!doNotCreateIfNotFound) {\n _currentInstance.setAttribute(element, \"id\", id);\n }\n }\n return id;\n };\n\n this.setConnectionBeingDragged = function (v) {\n connectionBeingDragged = v;\n };\n this.isConnectionBeingDragged = function () {\n return connectionBeingDragged;\n };\n\n /**\n * Returns a map of all the elements this jsPlumbInstance is currently managing.\n * @returns {Object} Map of [id-> {el, endpoint[], connection, position}] information.\n */\n this.getManagedElements = function() {\n return managedElements;\n };\n\n this.connectorClass = \"jtk-connector\";\n this.connectorOutlineClass = \"jtk-connector-outline\";\n this.connectedClass = \"jtk-connected\";\n this.hoverClass = \"jtk-hover\";\n this.endpointClass = \"jtk-endpoint\";\n this.endpointConnectedClass = \"jtk-endpoint-connected\";\n this.endpointFullClass = \"jtk-endpoint-full\";\n this.endpointDropAllowedClass = \"jtk-endpoint-drop-allowed\";\n this.endpointDropForbiddenClass = \"jtk-endpoint-drop-forbidden\";\n this.overlayClass = \"jtk-overlay\";\n this.draggingClass = \"jtk-dragging\";// CONVERTED\n this.elementDraggingClass = \"jtk-element-dragging\";// CONVERTED\n this.sourceElementDraggingClass = \"jtk-source-element-dragging\"; // CONVERTED\n this.targetElementDraggingClass = \"jtk-target-element-dragging\";// CONVERTED\n this.endpointAnchorClassPrefix = \"jtk-endpoint-anchor\";\n this.hoverSourceClass = \"jtk-source-hover\";\n this.hoverTargetClass = \"jtk-target-hover\";\n this.dragSelectClass = \"jtk-drag-select\";\n\n this.Anchors = {};\n this.Connectors = { \"svg\": {} };\n this.Endpoints = { \"svg\": {} };\n this.Overlays = { \"svg\": {} } ;\n this.ConnectorRenderers = {};\n this.SVG = \"svg\";\n\n// --------------------------- jsPlumbInstance public API ---------------------------------------------------------\n\n\n this.addEndpoint = function (el, params, referenceParams) {\n referenceParams = referenceParams || {};\n var p = jsPlumb.extend({}, referenceParams);\n jsPlumb.extend(p, params);\n p.endpoint = p.endpoint || _currentInstance.Defaults.Endpoint;\n p.paintStyle = p.paintStyle || _currentInstance.Defaults.EndpointStyle;\n\n var results = [],\n inputs = (_ju.isArray(el) || (el.length != null && !_ju.isString(el))) ? el : [ el ];\n\n for (var i = 0, j = inputs.length; i < j; i++) {\n p.source = _currentInstance.getElement(inputs[i]);\n _ensureContainer(p.source);\n\n var id = _getId(p.source), e = _newEndpoint(p, id);\n\n // ensure element is managed.\n var myOffset = _manage(id, p.source).info.o;\n _ju.addToList(endpointsByElement, id, e);\n\n if (!_suspendDrawing) {\n e.paint({\n anchorLoc: e.anchor.compute({ xy: [ myOffset.left, myOffset.top ], wh: sizes[id], element: e, timestamp: _suspendedAt }),\n timestamp: _suspendedAt\n });\n }\n\n results.push(e);\n }\n\n return results.length === 1 ? results[0] : results;\n };\n\n this.addEndpoints = function (el, endpoints, referenceParams) {\n var results = [];\n for (var i = 0, j = endpoints.length; i < j; i++) {\n var e = _currentInstance.addEndpoint(el, endpoints[i], referenceParams);\n if (_ju.isArray(e)) {\n Array.prototype.push.apply(results, e);\n }\n else {\n results.push(e);\n }\n }\n return results;\n };\n\n this.animate = function (el, properties, options) {\n if (!this.animationSupported) {\n return false;\n }\n\n options = options || {};\n var del = _currentInstance.getElement(el),\n id = _getId(del),\n stepFunction = jsPlumb.animEvents.step,\n completeFunction = jsPlumb.animEvents.complete;\n\n options[stepFunction] = _ju.wrap(options[stepFunction], function () {\n _currentInstance.revalidate(id);\n });\n\n // onComplete repaints, just to make sure everything looks good at the end of the animation.\n options[completeFunction] = _ju.wrap(options[completeFunction], function () {\n _currentInstance.revalidate(id);\n });\n\n _currentInstance.doAnimate(del, properties, options);\n };\n\n /**\n * checks for a listener for the given condition, executing it if found, passing in the given value.\n * condition listeners would have been attached using \"bind\" (which is, you could argue, now overloaded, since\n * firing click events etc is a bit different to what this does). i thought about adding a \"bindCondition\"\n * or something, but decided against it, for the sake of simplicity. jsPlumb will never fire one of these\n * condition events anyway.\n */\n this.checkCondition = function (conditionName, args) {\n var l = _currentInstance.getListener(conditionName),\n r = true;\n\n if (l && l.length > 0) {\n var values = Array.prototype.slice.call(arguments, 1);\n try {\n for (var i = 0, j = l.length; i < j; i++) {\n r = r && l[i].apply(l[i], values);\n }\n }\n catch (e) {\n _ju.log(_currentInstance, \"cannot check condition [\" + conditionName + \"]\" + e);\n }\n }\n return r;\n };\n\n this.connect = function (params, referenceParams) {\n // prepare a final set of parameters to create connection with\n var _p = _prepareConnectionParams(params, referenceParams), jpc;\n // TODO probably a nicer return value if the connection was not made. _prepareConnectionParams\n // will return null (and log something) if either endpoint was full. what would be nicer is to\n // create a dedicated 'error' object.\n if (_p) {\n if (_p.source == null && _p.sourceEndpoint == null) {\n _ju.log(\"Cannot establish connection - source does not exist\");\n return;\n }\n if (_p.target == null && _p.targetEndpoint == null) {\n _ju.log(\"Cannot establish connection - target does not exist\");\n return;\n }\n _ensureContainer(_p.source);\n // create the connection. it is not yet registered\n jpc = _newConnection(_p);\n // now add it the model, fire an event, and redraw\n _finaliseConnection(jpc, _p);\n }\n return jpc;\n };\n\n var stTypes = [\n { el: \"source\", elId: \"sourceId\", epDefs: \"sourceEndpointDefinitions\" },\n { el: \"target\", elId: \"targetId\", epDefs: \"targetEndpointDefinitions\" }\n ];\n\n var _set = function (c, el, idx, doNotRepaint) {\n var ep, _st = stTypes[idx], cId = c[_st.elId], cEl = c[_st.el], sid, sep,\n oldEndpoint = c.endpoints[idx];\n\n var evtParams = {\n index: idx,\n originalSourceId: idx === 0 ? cId : c.sourceId,\n newSourceId: c.sourceId,\n originalTargetId: idx === 1 ? cId : c.targetId,\n newTargetId: c.targetId,\n connection: c\n };\n\n if (el.constructor === jsPlumb.Endpoint) {\n ep = el;\n ep.addConnection(c);\n el = ep.element;\n }\n else {\n sid = _getId(el);\n sep = this[_st.epDefs][sid];\n\n if (sid === c[_st.elId]) {\n ep = null; // dont change source/target if the element is already the one given.\n }\n else if (sep) {\n for (var t in sep) {\n if (!sep[t].enabled) {\n return;\n }\n ep = sep[t].endpoint != null && sep[t].endpoint._jsPlumb ? sep[t].endpoint : this.addEndpoint(el, sep[t].def);\n if (sep[t].uniqueEndpoint) {\n sep[t].endpoint = ep;\n }\n ep.addConnection(c);\n }\n }\n else {\n ep = c.makeEndpoint(idx === 0, el, sid);\n }\n }\n\n if (ep != null) {\n oldEndpoint.detachFromConnection(c);\n c.endpoints[idx] = ep;\n c[_st.el] = ep.element;\n c[_st.elId] = ep.elementId;\n evtParams[idx === 0 ? \"newSourceId\" : \"newTargetId\"] = ep.elementId;\n\n fireMoveEvent(evtParams);\n\n if (!doNotRepaint) {\n c.repaint();\n }\n }\n\n evtParams.element = el;\n return evtParams;\n\n }.bind(this);\n\n this.setSource = function (connection, el, doNotRepaint) {\n var p = _set(connection, el, 0, doNotRepaint);\n this.anchorManager.sourceChanged(p.originalSourceId, p.newSourceId, connection, p.el);\n };\n this.setTarget = function (connection, el, doNotRepaint) {\n var p = _set(connection, el, 1, doNotRepaint);\n this.anchorManager.updateOtherEndpoint(p.originalSourceId, p.originalTargetId, p.newTargetId, connection);\n };\n\n this.deleteEndpoint = function (object, dontUpdateHover, deleteAttachedObjects) {\n var endpoint = (typeof object === \"string\") ? endpointsByUUID[object] : object;\n if (endpoint) {\n _currentInstance.deleteObject({ endpoint: endpoint, dontUpdateHover: dontUpdateHover, deleteAttachedObjects:deleteAttachedObjects });\n }\n return _currentInstance;\n };\n\n this.deleteEveryEndpoint = function () {\n var _is = _currentInstance.setSuspendDrawing(true);\n for (var id in endpointsByElement) {\n var endpoints = endpointsByElement[id];\n if (endpoints && endpoints.length) {\n for (var i = 0, j = endpoints.length; i < j; i++) {\n _currentInstance.deleteEndpoint(endpoints[i], true);\n }\n }\n }\n endpointsByElement = {};\n managedElements = {};\n endpointsByUUID = {};\n offsets = {};\n offsetTimestamps = {};\n _currentInstance.anchorManager.reset();\n var dm = _currentInstance.getDragManager();\n if (dm) {\n dm.reset();\n }\n if (!_is) {\n _currentInstance.setSuspendDrawing(false);\n }\n return _currentInstance;\n };\n\n var fireDetachEvent = function (jpc, doFireEvent, originalEvent) {\n // may have been given a connection, or in special cases, an object\n var connType = _currentInstance.Defaults.ConnectionType || _currentInstance.getDefaultConnectionType(),\n argIsConnection = jpc.constructor === connType,\n params = argIsConnection ? {\n connection: jpc,\n source: jpc.source, target: jpc.target,\n sourceId: jpc.sourceId, targetId: jpc.targetId,\n sourceEndpoint: jpc.endpoints[0], targetEndpoint: jpc.endpoints[1]\n } : jpc;\n\n if (doFireEvent) {\n _currentInstance.fire(\"connectionDetached\", params, originalEvent);\n }\n\n // always fire this. used by internal jsplumb stuff.\n _currentInstance.fire(\"internal.connectionDetached\", params, originalEvent);\n\n _currentInstance.anchorManager.connectionDetached(params);\n };\n\n var fireMoveEvent = _currentInstance.fireMoveEvent = function (params, evt) {\n _currentInstance.fire(\"connectionMoved\", params, evt);\n };\n\n this.unregisterEndpoint = function (endpoint) {\n if (endpoint._jsPlumb.uuid) {\n endpointsByUUID[endpoint._jsPlumb.uuid] = null;\n }\n _currentInstance.anchorManager.deleteEndpoint(endpoint);\n // TODO at least replace this with a removeWithFunction call.\n for (var e in endpointsByElement) {\n var endpoints = endpointsByElement[e];\n if (endpoints) {\n var newEndpoints = [];\n for (var i = 0, j = endpoints.length; i < j; i++) {\n if (endpoints[i] !== endpoint) {\n newEndpoints.push(endpoints[i]);\n }\n }\n\n endpointsByElement[e] = newEndpoints;\n }\n if (endpointsByElement[e].length < 1) {\n delete endpointsByElement[e];\n }\n }\n };\n\n var IS_DETACH_ALLOWED = \"isDetachAllowed\";\n var BEFORE_DETACH = \"beforeDetach\";\n var CHECK_CONDITION = \"checkCondition\";\n\n /**\n * Deletes a Connection.\n * @method deleteConnection\n * @param connection Connection to delete\n * @param {Object} [params] Optional delete parameters\n * @param {Boolean} [params.doNotFireEvent=false] If true, a connection detached event will not be fired. Otherwise one will.\n * @param {Boolean} [params.force=false] If true, the connection will be deleted even if a beforeDetach interceptor tries to stop the deletion.\n * @returns {Boolean} True if the connection was deleted, false otherwise.\n */\n this.deleteConnection = function(connection, params) {\n\n if (connection != null) {\n params = params || {};\n\n if (params.force || _ju.functionChain(true, false, [\n [ connection.endpoints[0], IS_DETACH_ALLOWED, [ connection ] ],\n [ connection.endpoints[1], IS_DETACH_ALLOWED, [ connection ] ],\n [ connection, IS_DETACH_ALLOWED, [ connection ] ],\n [ _currentInstance, CHECK_CONDITION, [ BEFORE_DETACH, connection ] ]\n ])) {\n\n connection.setHover(false);\n fireDetachEvent(connection, !connection.pending && params.fireEvent !== false, params.originalEvent);\n\n connection.endpoints[0].detachFromConnection(connection);\n connection.endpoints[1].detachFromConnection(connection);\n _ju.removeWithFunction(connections, function (_c) {\n return connection.id === _c.id;\n });\n\n connection.cleanup();\n connection.destroy();\n return true;\n }\n }\n return false;\n };\n\n /**\n * Remove all Connections from all elements, but leaves Endpoints in place ((unless a connection is set to auto delete its Endpoints).\n * @method deleteEveryConnection\n * @param {Object} [params] optional params object for the call\n * @param {Boolean} [params.fireEvent=true] Whether or not to fire detach events\n * @param {Boolean} [params.forceDetach=false] If true, this call will ignore any `beforeDetach` interceptors.\n * @returns {Number} The number of connections that were deleted.\n */\n this.deleteEveryConnection = function (params) {\n params = params || {};\n var count = connections.length, deletedCount = 0;\n _currentInstance.batch(function () {\n for (var i = 0; i < count; i++) {\n deletedCount += _currentInstance.deleteConnection(connections[0], params) ? 1 : 0;\n }\n });\n return deletedCount;\n };\n\n /**\n * Removes all an element's Connections.\n * @method deleteConnectionsForElement\n * @param {Object} el Either the id of the element, or a selector for the element.\n * @param {Object} [params] Optional parameters.\n * @param {Boolean} [params.fireEvent=true] Whether or not to fire the detach event.\n * @param {Boolean} [params.forceDetach=false] If true, this call will ignore any `beforeDetach` interceptors.\n * @return {jsPlumbInstance} The current jsPlumb instance.\n */\n this.deleteConnectionsForElement = function (el, params) {\n params = params || {};\n el = _currentInstance.getElement(el);\n var id = _getId(el), endpoints = endpointsByElement[id];\n if (endpoints && endpoints.length) {\n for (var i = 0, j = endpoints.length; i < j; i++) {\n endpoints[i].deleteEveryConnection(params);\n }\n }\n return _currentInstance;\n };\n\n /// not public. but of course its exposed. how to change this.\n this.deleteObject = function (params) {\n var result = {\n endpoints: {},\n connections: {},\n endpointCount: 0,\n connectionCount: 0\n },\n deleteAttachedObjects = params.deleteAttachedObjects !== false;\n\n var unravelConnection = function (connection) {\n if (connection != null && result.connections[connection.id] == null) {\n if (!params.dontUpdateHover && connection._jsPlumb != null) {\n connection.setHover(false);\n }\n result.connections[connection.id] = connection;\n result.connectionCount++;\n }\n };\n var unravelEndpoint = function (endpoint) {\n if (endpoint != null && result.endpoints[endpoint.id] == null) {\n if (!params.dontUpdateHover && endpoint._jsPlumb != null) {\n endpoint.setHover(false);\n }\n result.endpoints[endpoint.id] = endpoint;\n result.endpointCount++;\n\n if (deleteAttachedObjects) {\n for (var i = 0; i < endpoint.connections.length; i++) {\n var c = endpoint.connections[i];\n unravelConnection(c);\n }\n }\n }\n };\n\n if (params.connection) {\n unravelConnection(params.connection);\n }\n else {\n unravelEndpoint(params.endpoint);\n }\n\n // loop through connections\n for (var i in result.connections) {\n var c = result.connections[i];\n if (c._jsPlumb) {\n _ju.removeWithFunction(connections, function (_c) {\n return c.id === _c.id;\n });\n\n fireDetachEvent(c, params.fireEvent === false ? false : !c.pending, params.originalEvent);\n var doNotCleanup = params.deleteAttachedObjects == null ? null : !params.deleteAttachedObjects;\n\n c.endpoints[0].detachFromConnection(c, null, doNotCleanup);\n c.endpoints[1].detachFromConnection(c, null, doNotCleanup);\n\n c.cleanup(true);\n c.destroy(true);\n }\n }\n\n // loop through endpoints\n for (var j in result.endpoints) {\n var e = result.endpoints[j];\n if (e._jsPlumb) {\n _currentInstance.unregisterEndpoint(e);\n // FIRE some endpoint deleted event?\n e.cleanup(true);\n e.destroy(true);\n }\n }\n\n return result;\n };\n\n\n // helpers for select/selectEndpoints\n var _setOperation = function (list, func, args, selector) {\n for (var i = 0, j = list.length; i < j; i++) {\n list[i][func].apply(list[i], args);\n }\n return selector(list);\n },\n _getOperation = function (list, func, args) {\n var out = [];\n for (var i = 0, j = list.length; i < j; i++) {\n out.push([ list[i][func].apply(list[i], args), list[i] ]);\n }\n return out;\n },\n setter = function (list, func, selector) {\n return function () {\n return _setOperation(list, func, arguments, selector);\n };\n },\n getter = function (list, func) {\n return function () {\n return _getOperation(list, func, arguments);\n };\n },\n prepareList = function (input, doNotGetIds) {\n var r = [];\n if (input) {\n if (typeof input === 'string') {\n if (input === \"*\") {\n return input;\n }\n r.push(input);\n }\n else {\n if (doNotGetIds) {\n r = input;\n }\n else {\n if (input.length) {\n for (var i = 0, j = input.length; i < j; i++) {\n r.push(_info(input[i]).id);\n }\n }\n else {\n r.push(_info(input).id);\n }\n }\n }\n }\n return r;\n },\n filterList = function (list, value, missingIsFalse) {\n if (list === \"*\") {\n return true;\n }\n return list.length > 0 ? list.indexOf(value) !== -1 : !missingIsFalse;\n };\n\n // get some connections, specifying source/target/scope\n this.getConnections = function (options, flat) {\n if (!options) {\n options = {};\n } else if (options.constructor === String) {\n options = { \"scope\": options };\n }\n var scope = options.scope || _currentInstance.getDefaultScope(),\n scopes = prepareList(scope, true),\n sources = prepareList(options.source),\n targets = prepareList(options.target),\n results = (!flat && scopes.length > 1) ? {} : [],\n _addOne = function (scope, obj) {\n if (!flat && scopes.length > 1) {\n var ss = results[scope];\n if (ss == null) {\n ss = results[scope] = [];\n }\n ss.push(obj);\n } else {\n results.push(obj);\n }\n };\n\n for (var j = 0, jj = connections.length; j < jj; j++) {\n var c = connections[j],\n sourceId = c.proxies && c.proxies[0] ? c.proxies[0].originalEp.elementId : c.sourceId,\n targetId = c.proxies && c.proxies[1] ? c.proxies[1].originalEp.elementId : c.targetId;\n\n if (filterList(scopes, c.scope) && filterList(sources, sourceId) && filterList(targets, targetId)) {\n _addOne(c.scope, c);\n }\n }\n\n return results;\n };\n\n var _curryEach = function (list, executor) {\n return function (f) {\n for (var i = 0, ii = list.length; i < ii; i++) {\n f(list[i]);\n }\n return executor(list);\n };\n },\n _curryGet = function (list) {\n return function (idx) {\n return list[idx];\n };\n };\n\n var _makeCommonSelectHandler = function (list, executor) {\n var out = {\n length: list.length,\n each: _curryEach(list, executor),\n get: _curryGet(list)\n },\n setters = [\"setHover\", \"removeAllOverlays\", \"setLabel\", \"addClass\", \"addOverlay\", \"removeOverlay\",\n \"removeOverlays\", \"showOverlay\", \"hideOverlay\", \"showOverlays\", \"hideOverlays\", \"setPaintStyle\",\n \"setHoverPaintStyle\", \"setSuspendEvents\", \"setParameter\", \"setParameters\", \"setVisible\",\n \"repaint\", \"addType\", \"toggleType\", \"removeType\", \"removeClass\", \"setType\", \"bind\", \"unbind\" ],\n\n getters = [\"getLabel\", \"getOverlay\", \"isHover\", \"getParameter\", \"getParameters\", \"getPaintStyle\",\n \"getHoverPaintStyle\", \"isVisible\", \"hasType\", \"getType\", \"isSuspendEvents\" ],\n i, ii;\n\n for (i = 0, ii = setters.length; i < ii; i++) {\n out[setters[i]] = setter(list, setters[i], executor);\n }\n\n for (i = 0, ii = getters.length; i < ii; i++) {\n out[getters[i]] = getter(list, getters[i]);\n }\n\n return out;\n };\n\n var _makeConnectionSelectHandler = function (list) {\n var common = _makeCommonSelectHandler(list, _makeConnectionSelectHandler);\n return jsPlumb.extend(common, {\n // setters\n setDetachable: setter(list, \"setDetachable\", _makeConnectionSelectHandler),\n setReattach: setter(list, \"setReattach\", _makeConnectionSelectHandler),\n setConnector: setter(list, \"setConnector\", _makeConnectionSelectHandler),\n delete: function () {\n for (var i = 0, ii = list.length; i < ii; i++) {\n _currentInstance.deleteConnection(list[i]);\n }\n },\n // getters\n isDetachable: getter(list, \"isDetachable\"),\n isReattach: getter(list, \"isReattach\")\n });\n };\n\n var _makeEndpointSelectHandler = function (list) {\n var common = _makeCommonSelectHandler(list, _makeEndpointSelectHandler);\n return jsPlumb.extend(common, {\n setEnabled: setter(list, \"setEnabled\", _makeEndpointSelectHandler),\n setAnchor: setter(list, \"setAnchor\", _makeEndpointSelectHandler),\n isEnabled: getter(list, \"isEnabled\"),\n deleteEveryConnection: function () {\n for (var i = 0, ii = list.length; i < ii; i++) {\n list[i].deleteEveryConnection();\n }\n },\n \"delete\": function () {\n for (var i = 0, ii = list.length; i < ii; i++) {\n _currentInstance.deleteEndpoint(list[i]);\n }\n }\n });\n };\n\n this.select = function (params) {\n params = params || {};\n params.scope = params.scope || \"*\";\n return _makeConnectionSelectHandler(params.connections || _currentInstance.getConnections(params, true));\n };\n\n this.selectEndpoints = function (params) {\n params = params || {};\n params.scope = params.scope || \"*\";\n var noElementFilters = !params.element && !params.source && !params.target,\n elements = noElementFilters ? \"*\" : prepareList(params.element),\n sources = noElementFilters ? \"*\" : prepareList(params.source),\n targets = noElementFilters ? \"*\" : prepareList(params.target),\n scopes = prepareList(params.scope, true);\n\n var ep = [];\n\n for (var el in endpointsByElement) {\n var either = filterList(elements, el, true),\n source = filterList(sources, el, true),\n sourceMatchExact = sources !== \"*\",\n target = filterList(targets, el, true),\n targetMatchExact = targets !== \"*\";\n\n // if they requested 'either' then just match scope. otherwise if they requested 'source' (not as a wildcard) then we have to match only endpoints that have isSource set to to true, and the same thing with isTarget.\n if (either || source || target) {\n inner:\n for (var i = 0, ii = endpointsByElement[el].length; i < ii; i++) {\n var _ep = endpointsByElement[el][i];\n if (filterList(scopes, _ep.scope, true)) {\n\n var noMatchSource = (sourceMatchExact && sources.length > 0 && !_ep.isSource),\n noMatchTarget = (targetMatchExact && targets.length > 0 && !_ep.isTarget);\n\n if (noMatchSource || noMatchTarget) {\n continue inner;\n }\n\n ep.push(_ep);\n }\n }\n }\n }\n\n return _makeEndpointSelectHandler(ep);\n };\n\n // get all connections managed by the instance of jsplumb.\n this.getAllConnections = function () {\n return connections;\n };\n this.getDefaultScope = function () {\n return DEFAULT_SCOPE;\n };\n // get an endpoint by uuid.\n this.getEndpoint = _getEndpoint;\n /**\n * Gets the list of Endpoints for a given element.\n * @method getEndpoints\n * @param {String|Element|Selector} el The element to get endpoints for.\n * @return {Endpoint[]} An array of Endpoints for the specified element.\n */\n this.getEndpoints = function (el) {\n return endpointsByElement[_info(el).id] || [];\n };\n // gets the default endpoint type. used when subclassing. see wiki.\n this.getDefaultEndpointType = function () {\n return jsPlumb.Endpoint;\n };\n // gets the default connection type. used when subclassing. see wiki.\n this.getDefaultConnectionType = function () {\n return jsPlumb.Connection;\n };\n /*\n * Gets an element's id, creating one if necessary. really only exposed\n * for the lib-specific functionality to access; would be better to pass\n * the current instance into the lib-specific code (even though this is\n * a static call. i just don't want to expose it to the public API).\n */\n this.getId = _getId;\n this.draw = _draw;\n this.info = _info;\n\n this.appendElement = _appendElement;\n\n var _hoverSuspended = false;\n this.isHoverSuspended = function () {\n return _hoverSuspended;\n };\n this.setHoverSuspended = function (s) {\n _hoverSuspended = s;\n };\n\n // set an element's connections to be hidden\n this.hide = function (el, changeEndpoints) {\n _setVisible(el, \"none\", changeEndpoints);\n return _currentInstance;\n };\n\n // exposed for other objects to use to get a unique id.\n this.idstamp = _idstamp;\n\n // ensure that, if the current container exists, it is a DOM element and not a selector.\n // if it does not exist and `candidate` is supplied, the offset parent of that element will be set as the Container.\n // this is used to do a better default behaviour for the case that the user has not set a container:\n // addEndpoint, makeSource, makeTarget and connect all call this method with the offsetParent of the\n // element in question (for connect it is the source element). So if no container is set, it is inferred\n // to be the offsetParent of the first element the user tries to connect.\n var _ensureContainer = function (candidate) {\n if (!_container && candidate) {\n var can = _currentInstance.getElement(candidate);\n if (can.offsetParent) {\n _currentInstance.setContainer(can.offsetParent);\n }\n }\n };\n\n var _getContainerFromDefaults = function () {\n if (_currentInstance.Defaults.Container) {\n _currentInstance.setContainer(_currentInstance.Defaults.Container);\n }\n };\n\n // check if a given element is managed or not. if not, add to our map. if drawing is not suspended then\n // we'll also stash its dimensions; otherwise we'll do this in a lazy way through updateOffset.\n var _manage = _currentInstance.manage = function (id, element, _transient) {\n if (!managedElements[id]) {\n managedElements[id] = {\n el: element,\n endpoints: [],\n connections: []\n };\n\n managedElements[id].info = _updateOffset({ elId: id, timestamp: _suspendedAt });\n _currentInstance.addClass(element, \"jtk-managed\");\n if (!_transient) {\n _currentInstance.fire(\"manageElement\", { id:id, info:managedElements[id].info, el:element });\n }\n }\n\n return managedElements[id];\n };\n\n var _unmanage = _currentInstance.unmanage = function(id) {\n if (managedElements[id]) {\n _currentInstance.removeClass(managedElements[id].el, \"jtk-managed\");\n delete managedElements[id];\n _currentInstance.fire(\"unmanageElement\", id);\n }\n };\n\n /**\n * updates the offset and size for a given element, and stores the\n * values. if 'offset' is not null we use that (it would have been\n * passed in from a drag call) because it's faster; but if it is null,\n * or if 'recalc' is true in order to force a recalculation, we get the current values.\n * @method updateOffset\n */\n var _updateOffset = function (params) {\n\n var timestamp = params.timestamp, recalc = params.recalc, offset = params.offset, elId = params.elId, s;\n if (_suspendDrawing && !timestamp) {\n timestamp = _suspendedAt;\n }\n if (!recalc) {\n if (timestamp && timestamp === offsetTimestamps[elId]) {\n return {o: params.offset || offsets[elId], s: sizes[elId]};\n }\n }\n if (recalc || (!offset && offsets[elId] == null)) { // if forced repaint or no offset available, we recalculate.\n\n // get the current size and offset, and store them\n s = managedElements[elId] ? managedElements[elId].el : null;\n if (s != null) {\n sizes[elId] = _currentInstance.getSize(s);\n offsets[elId] = _currentInstance.getOffset(s);\n offsetTimestamps[elId] = timestamp;\n }\n } else {\n offsets[elId] = offset || offsets[elId];\n if (sizes[elId] == null) {\n s = managedElements[elId].el;\n if (s != null) {\n sizes[elId] = _currentInstance.getSize(s);\n }\n }\n offsetTimestamps[elId] = timestamp;\n }\n\n if (offsets[elId] && !offsets[elId].right) {\n offsets[elId].right = offsets[elId].left + sizes[elId][0];\n offsets[elId].bottom = offsets[elId].top + sizes[elId][1];\n offsets[elId].width = sizes[elId][0];\n offsets[elId].height = sizes[elId][1];\n offsets[elId].centerx = offsets[elId].left + (offsets[elId].width / 2);\n offsets[elId].centery = offsets[elId].top + (offsets[elId].height / 2);\n }\n\n return {o: offsets[elId], s: sizes[elId]};\n };\n\n this.updateOffset = _updateOffset;\n\n /**\n * callback from the current library to tell us to prepare ourselves (attach\n * mouse listeners etc; can't do that until the library has provided a bind method)\n */\n this.init = function () {\n if (!initialized) {\n _getContainerFromDefaults();\n _currentInstance.anchorManager = new root.jsPlumb.AnchorManager({jsPlumbInstance: _currentInstance});\n initialized = true;\n _currentInstance.fire(\"ready\", _currentInstance);\n }\n }.bind(this);\n\n this.log = log;\n this.jsPlumbUIComponent = jsPlumbUIComponent;\n\n /*\n * Creates an anchor with the given params.\n *\n *\n * Returns: The newly created Anchor.\n * Throws: an error if a named anchor was not found.\n */\n this.makeAnchor = function () {\n var pp, _a = function (t, p) {\n if (root.jsPlumb.Anchors[t]) {\n return new root.jsPlumb.Anchors[t](p);\n }\n if (!_currentInstance.Defaults.DoNotThrowErrors) {\n throw { msg: \"jsPlumb: unknown anchor type '\" + t + \"'\" };\n }\n };\n if (arguments.length === 0) {\n return null;\n }\n var specimen = arguments[0], elementId = arguments[1], jsPlumbInstance = arguments[2], newAnchor = null;\n // if it appears to be an anchor already...\n if (specimen.compute && specimen.getOrientation) {\n return specimen;\n } //TODO hazy here about whether it should be added or is already added somehow.\n // is it the name of an anchor type?\n else if (typeof specimen === \"string\") {\n newAnchor = _a(arguments[0], {elementId: elementId, jsPlumbInstance: _currentInstance});\n }\n // is it an array? it will be one of:\n // an array of [spec, params] - this defines a single anchor, which may be dynamic, but has parameters.\n // an array of arrays - this defines some dynamic anchors\n // an array of numbers - this defines a single anchor.\n else if (_ju.isArray(specimen)) {\n if (_ju.isArray(specimen[0]) || _ju.isString(specimen[0])) {\n // if [spec, params] format\n if (specimen.length === 2 && _ju.isObject(specimen[1])) {\n // if first arg is a string, its a named anchor with params\n if (_ju.isString(specimen[0])) {\n pp = root.jsPlumb.extend({elementId: elementId, jsPlumbInstance: _currentInstance}, specimen[1]);\n newAnchor = _a(specimen[0], pp);\n }\n // otherwise first arg is array, second is params. we treat as a dynamic anchor, which is fine\n // even if the first arg has only one entry. you could argue all anchors should be implicitly dynamic in fact.\n else {\n pp = root.jsPlumb.extend({elementId: elementId, jsPlumbInstance: _currentInstance, anchors: specimen[0]}, specimen[1]);\n newAnchor = new root.jsPlumb.DynamicAnchor(pp);\n }\n }\n else {\n newAnchor = new jsPlumb.DynamicAnchor({anchors: specimen, selector: null, elementId: elementId, jsPlumbInstance: _currentInstance});\n }\n\n }\n else {\n var anchorParams = {\n x: specimen[0], y: specimen[1],\n orientation: (specimen.length >= 4) ? [ specimen[2], specimen[3] ] : [0, 0],\n offsets: (specimen.length >= 6) ? [ specimen[4], specimen[5] ] : [ 0, 0 ],\n elementId: elementId,\n jsPlumbInstance: _currentInstance,\n cssClass: specimen.length === 7 ? specimen[6] : null\n };\n newAnchor = new root.jsPlumb.Anchor(anchorParams);\n newAnchor.clone = function () {\n return new root.jsPlumb.Anchor(anchorParams);\n };\n }\n }\n\n if (!newAnchor.id) {\n newAnchor.id = \"anchor_\" + _idstamp();\n }\n return newAnchor;\n };\n\n /**\n * makes a list of anchors from the given list of types or coords, eg\n * [\"TopCenter\", \"RightMiddle\", \"BottomCenter\", [0, 1, -1, -1] ]\n */\n this.makeAnchors = function (types, elementId, jsPlumbInstance) {\n var r = [];\n for (var i = 0, ii = types.length; i < ii; i++) {\n if (typeof types[i] === \"string\") {\n r.push(root.jsPlumb.Anchors[types[i]]({elementId: elementId, jsPlumbInstance: jsPlumbInstance}));\n }\n else if (_ju.isArray(types[i])) {\n r.push(_currentInstance.makeAnchor(types[i], elementId, jsPlumbInstance));\n }\n }\n return r;\n };\n\n /**\n * Makes a dynamic anchor from the given list of anchors (which may be in shorthand notation as strings or dimension arrays, or Anchor\n * objects themselves) and the given, optional, anchorSelector function (jsPlumb uses a default if this is not provided; most people will\n * not need to provide this - i think).\n */\n this.makeDynamicAnchor = function (anchors, anchorSelector) {\n return new root.jsPlumb.DynamicAnchor({anchors: anchors, selector: anchorSelector, elementId: null, jsPlumbInstance: _currentInstance});\n };\n\n// --------------------- makeSource/makeTarget ----------------------------------------------\n\n this.targetEndpointDefinitions = {};\n this.sourceEndpointDefinitions = {};\n\n var selectorFilter = function (evt, _el, selector, _instance, negate) {\n var t = evt.target || evt.srcElement, ok = false,\n sel = _instance.getSelector(_el, selector);\n for (var j = 0; j < sel.length; j++) {\n if (sel[j] === t) {\n ok = true;\n break;\n }\n }\n return negate ? !ok : ok;\n };\n\n var _makeElementDropHandler = function (elInfo, p, dropOptions, isSource, isTarget) {\n var proxyComponent = new jsPlumbUIComponent(p);\n var _drop = p._jsPlumb.EndpointDropHandler({\n jsPlumb: _currentInstance,\n enabled: function () {\n return elInfo.def.enabled;\n },\n isFull: function () {\n var targetCount = _currentInstance.select({target: elInfo.id}).length;\n return elInfo.def.maxConnections > 0 && targetCount >= elInfo.def.maxConnections;\n },\n element: elInfo.el,\n elementId: elInfo.id,\n isSource: isSource,\n isTarget: isTarget,\n addClass: function (clazz) {\n _currentInstance.addClass(elInfo.el, clazz);\n },\n removeClass: function (clazz) {\n _currentInstance.removeClass(elInfo.el, clazz);\n },\n onDrop: function (jpc) {\n var source = jpc.endpoints[0];\n source.anchor.unlock();\n },\n isDropAllowed: function () {\n return proxyComponent.isDropAllowed.apply(proxyComponent, arguments);\n },\n isRedrop:function(jpc) {\n return (jpc.suspendedElement != null && jpc.suspendedEndpoint != null && jpc.suspendedEndpoint.element === elInfo.el);\n },\n getEndpoint: function (jpc) {\n\n // make a new Endpoint for the target, or get it from the cache if uniqueEndpoint\n // is set. if its a redrop the new endpoint will be immediately cleaned up.\n\n var newEndpoint = elInfo.def.endpoint;\n\n // if no cached endpoint, or there was one but it has been cleaned up\n // (ie. detached), create a new one\n if (newEndpoint == null || newEndpoint._jsPlumb == null) {\n var eps = _currentInstance.deriveEndpointAndAnchorSpec(jpc.getType().join(\" \"), true);\n var pp = eps.endpoints ? root.jsPlumb.extend(p, {\n endpoint:elInfo.def.def.endpoint || eps.endpoints[1]\n }) :p;\n if (eps.anchors) {\n pp = root.jsPlumb.extend(pp, {\n anchor:elInfo.def.def.anchor || eps.anchors[1]\n });\n }\n newEndpoint = _currentInstance.addEndpoint(elInfo.el, pp);\n newEndpoint._mtNew = true;\n }\n\n if (p.uniqueEndpoint) {\n elInfo.def.endpoint = newEndpoint;\n }\n\n newEndpoint.setDeleteOnEmpty(true);\n\n // if connection is detachable, init the new endpoint to be draggable, to support that happening.\n if (jpc.isDetachable()) {\n newEndpoint.initDraggable();\n }\n\n // if the anchor has a 'positionFinder' set, then delegate to that function to find\n // out where to locate the anchor.\n if (newEndpoint.anchor.positionFinder != null) {\n var dropPosition = _currentInstance.getUIPosition(arguments, _currentInstance.getZoom()),\n elPosition = _currentInstance.getOffset(elInfo.el),\n elSize = _currentInstance.getSize(elInfo.el),\n ap = dropPosition == null ? [0,0] : newEndpoint.anchor.positionFinder(dropPosition, elPosition, elSize, newEndpoint.anchor.constructorParams);\n\n newEndpoint.anchor.x = ap[0];\n newEndpoint.anchor.y = ap[1];\n // now figure an orientation for it..kind of hard to know what to do actually. probably the best thing i can do is to\n // support specifying an orientation in the anchor's spec. if one is not supplied then i will make the orientation\n // be what will cause the most natural link to the source: it will be pointing at the source, but it needs to be\n // specified in one axis only, and so how to make that choice? i think i will use whichever axis is the one in which\n // the target is furthest away from the source.\n }\n\n return newEndpoint;\n },\n maybeCleanup: function (ep) {\n if (ep._mtNew && ep.connections.length === 0) {\n _currentInstance.deleteObject({endpoint: ep});\n }\n else {\n delete ep._mtNew;\n }\n }\n });\n\n // wrap drop events as needed and initialise droppable\n var dropEvent = root.jsPlumb.dragEvents.drop;\n dropOptions.scope = dropOptions.scope || (p.scope || _currentInstance.Defaults.Scope);\n dropOptions[dropEvent] = _ju.wrap(dropOptions[dropEvent], _drop, true);\n dropOptions.rank = p.rank || 0;\n\n // if target, return true from the over event. this will cause katavorio to stop setting drops to hover\n // if multipleDrop is set to false.\n if (isTarget) {\n dropOptions[root.jsPlumb.dragEvents.over] = function () { return true; };\n }\n\n // vanilla jsplumb only\n if (p.allowLoopback === false) {\n dropOptions.canDrop = function (_drag) {\n var de = _drag.getDragElement()._jsPlumbRelatedElement;\n return de !== elInfo.el;\n };\n }\n _currentInstance.initDroppable(elInfo.el, dropOptions, \"internal\");\n\n return _drop;\n\n };\n\n // see API docs\n this.makeTarget = function (el, params, referenceParams) {\n\n // put jsplumb ref into params without altering the params passed in\n var p = root.jsPlumb.extend({_jsPlumb: this}, referenceParams);\n root.jsPlumb.extend(p, params);\n\n var maxConnections = p.maxConnections || -1,\n\n _doOne = function (el) {\n\n // get the element's id and store the endpoint definition for it. jsPlumb.connect calls will look for one of these,\n // and use the endpoint definition if found.\n // decode the info for this element (id and element)\n var elInfo = _info(el),\n elid = elInfo.id,\n dropOptions = root.jsPlumb.extend({}, p.dropOptions || {}),\n type = p.connectionType || \"default\";\n\n this.targetEndpointDefinitions[elid] = this.targetEndpointDefinitions[elid] || {};\n\n _ensureContainer(elid);\n\n // if this is a group and the user has not mandated a rank, set to -1 so that Nodes takes\n // precedence.\n if (elInfo.el._isJsPlumbGroup && dropOptions.rank == null) {\n dropOptions.rank = -1;\n }\n\n // store the definition\n var _def = {\n def: root.jsPlumb.extend({}, p),\n uniqueEndpoint: p.uniqueEndpoint,\n maxConnections: maxConnections,\n enabled: true\n };\n\n if (p.createEndpoint) {\n _def.uniqueEndpoint = true;\n _def.endpoint = _currentInstance.addEndpoint(el, _def.def);\n _def.endpoint.setDeleteOnEmpty(false);\n }\n\n elInfo.def = _def;\n this.targetEndpointDefinitions[elid][type] = _def;\n _makeElementDropHandler(elInfo, p, dropOptions, p.isSource === true, true);\n // stash the definition on the drop\n elInfo.el._katavorioDrop[elInfo.el._katavorioDrop.length - 1].targetDef = _def;\n\n }.bind(this);\n\n // make an array if only given one element\n var inputs = el.length && el.constructor !== String ? el : [ el ];\n\n // register each one in the list.\n for (var i = 0, ii = inputs.length; i < ii; i++) {\n _doOne(inputs[i]);\n }\n\n return this;\n };\n\n // see api docs\n this.unmakeTarget = function (el, doNotClearArrays) {\n var info = _info(el);\n _currentInstance.destroyDroppable(info.el, \"internal\");\n if (!doNotClearArrays) {\n delete this.targetEndpointDefinitions[info.id];\n }\n\n return this;\n };\n\n // see api docs\n this.makeSource = function (el, params, referenceParams) {\n var p = root.jsPlumb.extend({_jsPlumb: this}, referenceParams);\n root.jsPlumb.extend(p, params);\n var type = p.connectionType || \"default\";\n var aae = _currentInstance.deriveEndpointAndAnchorSpec(type);\n p.endpoint = p.endpoint || aae.endpoints[0];\n p.anchor = p.anchor || aae.anchors[0];\n var maxConnections = p.maxConnections || -1,\n onMaxConnections = p.onMaxConnections,\n _doOne = function (elInfo) {\n // get the element's id and store the endpoint definition for it. jsPlumb.connect calls will look for one of these,\n // and use the endpoint definition if found.\n var elid = elInfo.id,\n _del = this.getElement(elInfo.el);\n\n this.sourceEndpointDefinitions[elid] = this.sourceEndpointDefinitions[elid] || {};\n _ensureContainer(elid);\n\n var _def = {\n def:root.jsPlumb.extend({}, p),\n uniqueEndpoint: p.uniqueEndpoint,\n maxConnections: maxConnections,\n enabled: true\n };\n\n if (p.createEndpoint) {\n _def.uniqueEndpoint = true;\n _def.endpoint = _currentInstance.addEndpoint(el, _def.def);\n _def.endpoint.setDeleteOnEmpty(false);\n }\n\n this.sourceEndpointDefinitions[elid][type] = _def;\n elInfo.def = _def;\n\n var stopEvent = root.jsPlumb.dragEvents.stop,\n dragEvent = root.jsPlumb.dragEvents.drag,\n dragOptions = root.jsPlumb.extend({ }, p.dragOptions || {}),\n existingDrag = dragOptions.drag,\n existingStop = dragOptions.stop,\n ep = null,\n endpointAddedButNoDragYet = false;\n\n // set scope if its not set in dragOptions but was passed in in params\n dragOptions.scope = dragOptions.scope || p.scope;\n\n dragOptions[dragEvent] = _ju.wrap(dragOptions[dragEvent], function () {\n if (existingDrag) {\n existingDrag.apply(this, arguments);\n }\n endpointAddedButNoDragYet = false;\n });\n\n dragOptions[stopEvent] = _ju.wrap(dragOptions[stopEvent], function () {\n\n if (existingStop) {\n existingStop.apply(this, arguments);\n }\n this.currentlyDragging = false;\n if (ep._jsPlumb != null) { // if not cleaned up...\n\n // reset the anchor to the anchor that was initially provided. the one we were using to drag\n // the connection was just a placeholder that was located at the place the user pressed the\n // mouse button to initiate the drag.\n var anchorDef = p.anchor || this.Defaults.Anchor,\n oldAnchor = ep.anchor,\n oldConnection = ep.connections[0];\n\n var newAnchor = this.makeAnchor(anchorDef, elid, this),\n _el = ep.element;\n\n // if the anchor has a 'positionFinder' set, then delegate to that function to find\n // out where to locate the anchor. issue 117.\n if (newAnchor.positionFinder != null) {\n var elPosition = _currentInstance.getOffset(_el),\n elSize = this.getSize(_el),\n dropPosition = { left: elPosition.left + (oldAnchor.x * elSize[0]), top: elPosition.top + (oldAnchor.y * elSize[1]) },\n ap = newAnchor.positionFinder(dropPosition, elPosition, elSize, newAnchor.constructorParams);\n\n newAnchor.x = ap[0];\n newAnchor.y = ap[1];\n }\n\n ep.setAnchor(newAnchor, true);\n ep.repaint();\n this.repaint(ep.elementId);\n if (oldConnection != null) {\n this.repaint(oldConnection.targetId);\n }\n }\n }.bind(this));\n\n // when the user presses the mouse, add an Endpoint, if we are enabled.\n var mouseDownListener = function (e) {\n // on right mouse button, abort.\n if (e.which === 3 || e.button === 2) {\n return;\n }\n\n // TODO store def on element.\n var def = this.sourceEndpointDefinitions[elid][type];\n\n // if disabled, return.\n if (!def.enabled) {\n return;\n }\n\n elid = this.getId(this.getElement(elInfo.el)); // elid might have changed since this method was called to configure the element.\n\n // if a filter was given, run it, and return if it says no.\n if (p.filter) {\n var r = _ju.isString(p.filter) ? selectorFilter(e, elInfo.el, p.filter, this, p.filterExclude) : p.filter(e, elInfo.el);\n if (r === false) {\n return;\n }\n }\n\n // if maxConnections reached\n var sourceCount = this.select({source: elid}).length;\n if (def.maxConnections >= 0 && (sourceCount >= def.maxConnections)) {\n if (onMaxConnections) {\n onMaxConnections({\n element: elInfo.el,\n maxConnections: maxConnections\n }, e);\n }\n return false;\n }\n\n // find the position on the element at which the mouse was pressed; this is where the endpoint\n // will be located.\n var elxy = root.jsPlumb.getPositionOnElement(e, _del, _zoom);\n\n // we need to override the anchor in here, and force 'isSource', but we don't want to mess with\n // the params passed in, because after a connection is established we're going to reset the endpoint\n // to have the anchor we were given.\n var tempEndpointParams = {};\n root.jsPlumb.extend(tempEndpointParams, p);\n tempEndpointParams.isTemporarySource = true;\n tempEndpointParams.anchor = [ elxy[0], elxy[1] , 0, 0];\n tempEndpointParams.dragOptions = dragOptions;\n\n if (def.def.scope) {\n tempEndpointParams.scope = def.def.scope;\n }\n\n ep = this.addEndpoint(elid, tempEndpointParams);\n endpointAddedButNoDragYet = true;\n ep.setDeleteOnEmpty(true);\n\n // if unique endpoint and it's already been created, push it onto the endpoint we create. at the end\n // of a successful connection we'll switch to that endpoint.\n // TODO this is the same code as the programmatic endpoints create on line 1050 ish\n if (def.uniqueEndpoint) {\n if (!def.endpoint) {\n def.endpoint = ep;\n ep.setDeleteOnEmpty(false);\n }\n else {\n ep.finalEndpoint = def.endpoint;\n }\n }\n\n var _delTempEndpoint = function () {\n // this mouseup event is fired only if no dragging occurred, by jquery and yui, but for mootools\n // it is fired even if dragging has occurred, in which case we would blow away a perfectly\n // legitimate endpoint, were it not for this check. the flag is set after adding an\n // endpoint and cleared in a drag listener we set in the dragOptions above.\n _currentInstance.off(ep.canvas, \"mouseup\", _delTempEndpoint);\n _currentInstance.off(elInfo.el, \"mouseup\", _delTempEndpoint);\n if (endpointAddedButNoDragYet) {\n endpointAddedButNoDragYet = false;\n _currentInstance.deleteEndpoint(ep);\n }\n };\n\n _currentInstance.on(ep.canvas, \"mouseup\", _delTempEndpoint);\n _currentInstance.on(elInfo.el, \"mouseup\", _delTempEndpoint);\n\n // optionally check for attributes to extract from the source element\n var payload = {};\n if (def.def.extract) {\n for (var att in def.def.extract) {\n var v = (e.srcElement || e.target).getAttribute(att);\n if (v) {\n payload[def.def.extract[att]] = v;\n }\n }\n }\n\n // and then trigger its mousedown event, which will kick off a drag, which will start dragging\n // a new connection from this endpoint.\n _currentInstance.trigger(ep.canvas, \"mousedown\", e, payload);\n\n _ju.consume(e);\n\n }.bind(this);\n\n this.on(elInfo.el, \"mousedown\", mouseDownListener);\n _def.trigger = mouseDownListener;\n\n // if a filter was provided, set it as a dragFilter on the element,\n // to prevent the element drag function from kicking in when we want to\n // drag a new connection\n if (p.filter && (_ju.isString(p.filter) || _ju.isFunction(p.filter))) {\n _currentInstance.setDragFilter(elInfo.el, p.filter);\n }\n\n var dropOptions = root.jsPlumb.extend({}, p.dropOptions || {});\n\n _makeElementDropHandler(elInfo, p, dropOptions, true, p.isTarget === true);\n\n }.bind(this);\n\n var inputs = el.length && el.constructor !== String ? el : [ el ];\n for (var i = 0, ii = inputs.length; i < ii; i++) {\n _doOne(_info(inputs[i]));\n }\n\n return this;\n };\n\n // see api docs\n this.unmakeSource = function (el, connectionType, doNotClearArrays) {\n var info = _info(el);\n _currentInstance.destroyDroppable(info.el, \"internal\");\n var eldefs = this.sourceEndpointDefinitions[info.id];\n if (eldefs) {\n for (var def in eldefs) {\n if (connectionType == null || connectionType === def) {\n var mouseDownListener = eldefs[def].trigger;\n if (mouseDownListener) {\n _currentInstance.off(info.el, \"mousedown\", mouseDownListener);\n }\n if (!doNotClearArrays) {\n delete this.sourceEndpointDefinitions[info.id][def];\n }\n }\n }\n }\n\n return this;\n };\n\n // see api docs\n this.unmakeEverySource = function () {\n for (var i in this.sourceEndpointDefinitions) {\n _currentInstance.unmakeSource(i, null, true);\n }\n\n this.sourceEndpointDefinitions = {};\n return this;\n };\n\n var _getScope = function (el, types, connectionType) {\n types = _ju.isArray(types) ? types : [ types ];\n var id = _getId(el);\n connectionType = connectionType || \"default\";\n for (var i = 0; i < types.length; i++) {\n var eldefs = this[types[i]][id];\n if (eldefs && eldefs[connectionType]) {\n return eldefs[connectionType].def.scope || this.Defaults.Scope;\n }\n }\n }.bind(this);\n\n var _setScope = function (el, scope, types, connectionType) {\n types = _ju.isArray(types) ? types : [ types ];\n var id = _getId(el);\n connectionType = connectionType || \"default\";\n for (var i = 0; i < types.length; i++) {\n var eldefs = this[types[i]][id];\n if (eldefs && eldefs[connectionType]) {\n eldefs[connectionType].def.scope = scope;\n }\n }\n\n }.bind(this);\n\n this.getScope = function (el, scope) {\n return _getScope(el, [ \"sourceEndpointDefinitions\", \"targetEndpointDefinitions\" ]);\n };\n this.getSourceScope = function (el) {\n return _getScope(el, \"sourceEndpointDefinitions\");\n };\n this.getTargetScope = function (el) {\n return _getScope(el, \"targetEndpointDefinitions\");\n };\n this.setScope = function (el, scope, connectionType) {\n this.setSourceScope(el, scope, connectionType);\n this.setTargetScope(el, scope, connectionType);\n };\n this.setSourceScope = function (el, scope, connectionType) {\n _setScope(el, scope, \"sourceEndpointDefinitions\", connectionType);\n // we get the source scope during the mousedown event, but we also want to set this.\n this.setDragScope(el, scope);\n };\n this.setTargetScope = function (el, scope, connectionType) {\n _setScope(el, scope, \"targetEndpointDefinitions\", connectionType);\n this.setDropScope(el, scope);\n };\n\n // see api docs\n this.unmakeEveryTarget = function () {\n for (var i in this.targetEndpointDefinitions) {\n _currentInstance.unmakeTarget(i, true);\n }\n\n this.targetEndpointDefinitions = {};\n return this;\n };\n\n // does the work of setting a source enabled or disabled.\n var _setEnabled = function (type, el, state, toggle, connectionType) {\n var a = type === \"source\" ? this.sourceEndpointDefinitions : this.targetEndpointDefinitions,\n originalState, info, newState;\n\n connectionType = connectionType || \"default\";\n\n // a selector or an array\n if (el.length && !_ju.isString(el)) {\n originalState = [];\n for (var i = 0, ii = el.length; i < ii; i++) {\n info = _info(el[i]);\n if (a[info.id] && a[info.id][connectionType]) {\n originalState[i] = a[info.id][connectionType].enabled;\n newState = toggle ? !originalState[i] : state;\n a[info.id][connectionType].enabled = newState;\n _currentInstance[newState ? \"removeClass\" : \"addClass\"](info.el, \"jtk-\" + type + \"-disabled\");\n }\n }\n }\n // otherwise a DOM element or a String ID.\n else {\n info = _info(el);\n var id = info.id;\n if (a[id] && a[id][connectionType]) {\n originalState = a[id][connectionType].enabled;\n newState = toggle ? !originalState : state;\n a[id][connectionType].enabled = newState;\n _currentInstance[newState ? \"removeClass\" : \"addClass\"](info.el, \"jtk-\" + type + \"-disabled\");\n }\n }\n return originalState;\n }.bind(this);\n\n var _first = function (el, fn) {\n if (_ju.isString(el) || !el.length) {\n return fn.apply(this, [ el ]);\n }\n else if (el.length) {\n return fn.apply(this, [ el[0] ]);\n }\n\n }.bind(this);\n\n this.toggleSourceEnabled = function (el, connectionType) {\n _setEnabled(\"source\", el, null, true, connectionType);\n return this.isSourceEnabled(el, connectionType);\n };\n\n this.setSourceEnabled = function (el, state, connectionType) {\n return _setEnabled(\"source\", el, state, null, connectionType);\n };\n this.isSource = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var eldefs = this.sourceEndpointDefinitions[_info(_el).id];\n return eldefs != null && eldefs[connectionType] != null;\n }.bind(this));\n };\n this.isSourceEnabled = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var sep = this.sourceEndpointDefinitions[_info(_el).id];\n return sep && sep[connectionType] && sep[connectionType].enabled === true;\n }.bind(this));\n };\n\n this.toggleTargetEnabled = function (el, connectionType) {\n _setEnabled(\"target\", el, null, true, connectionType);\n return this.isTargetEnabled(el, connectionType);\n };\n\n this.isTarget = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var eldefs = this.targetEndpointDefinitions[_info(_el).id];\n return eldefs != null && eldefs[connectionType] != null;\n }.bind(this));\n };\n this.isTargetEnabled = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var tep = this.targetEndpointDefinitions[_info(_el).id];\n return tep && tep[connectionType] && tep[connectionType].enabled === true;\n }.bind(this));\n };\n this.setTargetEnabled = function (el, state, connectionType) {\n return _setEnabled(\"target\", el, state, null, connectionType);\n };\n\n// --------------------- end makeSource/makeTarget ----------------------------------------------\n\n this.ready = function (fn) {\n _currentInstance.bind(\"ready\", fn);\n };\n\n var _elEach = function(el, fn) {\n // support both lists...\n if (typeof el === 'object' && el.length) {\n for (var i = 0, ii = el.length; i < ii; i++) {\n fn(el[i]);\n }\n }\n else {// ...and single strings or elements.\n fn(el);\n }\n\n return _currentInstance;\n };\n\n // repaint some element's endpoints and connections\n this.repaint = function (el, ui, timestamp) {\n return _elEach(el, function(_el) {\n _draw(_el, ui, timestamp);\n });\n };\n\n this.revalidate = function (el, timestamp, isIdAlready) {\n return _elEach(el, function(_el) {\n var elId = isIdAlready ? _el : _currentInstance.getId(_el);\n _currentInstance.updateOffset({ elId: elId, recalc: true, timestamp:timestamp });\n var dm = _currentInstance.getDragManager();\n if (dm) {\n dm.updateOffsets(elId);\n }\n _currentInstance.repaint(_el);\n });\n };\n\n // repaint every endpoint and connection.\n this.repaintEverything = function () {\n // TODO this timestamp causes continuous anchors to not repaint properly.\n // fix this. do not just take out the timestamp. it runs a lot faster with\n // the timestamp included.\n var timestamp = _timestamp(), elId;\n\n for (elId in endpointsByElement) {\n _currentInstance.updateOffset({ elId: elId, recalc: true, timestamp: timestamp });\n }\n\n for (elId in endpointsByElement) {\n _draw(elId, null, timestamp);\n }\n\n return this;\n };\n\n this.removeAllEndpoints = function (el, recurse, affectedElements) {\n affectedElements = affectedElements || [];\n var _one = function (_el) {\n var info = _info(_el),\n ebe = endpointsByElement[info.id],\n i, ii;\n\n if (ebe) {\n affectedElements.push(info);\n for (i = 0, ii = ebe.length; i < ii; i++) {\n _currentInstance.deleteEndpoint(ebe[i], false);\n }\n }\n delete endpointsByElement[info.id];\n\n if (recurse) {\n if (info.el && info.el.nodeType !== 3 && info.el.nodeType !== 8) {\n for (i = 0, ii = info.el.childNodes.length; i < ii; i++) {\n _one(info.el.childNodes[i]);\n }\n }\n }\n\n };\n _one(el);\n return this;\n };\n\n var _doRemove = function(info, affectedElements) {\n _currentInstance.removeAllEndpoints(info.id, true, affectedElements);\n var dm = _currentInstance.getDragManager();\n var _one = function(_info) {\n\n if (dm) {\n dm.elementRemoved(_info.id);\n }\n _currentInstance.anchorManager.clearFor(_info.id);\n _currentInstance.anchorManager.removeFloatingConnection(_info.id);\n\n if (_currentInstance.isSource(_info.el)) {\n _currentInstance.unmakeSource(_info.el);\n }\n if (_currentInstance.isTarget(_info.el)) {\n _currentInstance.unmakeTarget(_info.el);\n }\n _currentInstance.destroyDraggable(_info.el);\n _currentInstance.destroyDroppable(_info.el);\n\n\n delete _currentInstance.floatingConnections[_info.id];\n delete managedElements[_info.id];\n delete offsets[_info.id];\n if (_info.el) {\n _currentInstance.removeElement(_info.el);\n _info.el._jsPlumb = null;\n }\n };\n\n // remove all affected child elements\n for (var ae = 1; ae < affectedElements.length; ae++) {\n _one(affectedElements[ae]);\n }\n // and always remove the requested one from the dom.\n _one(info);\n };\n\n /**\n * Remove the given element, including cleaning up all endpoints registered for it.\n * This is exposed in the public API but also used internally by jsPlumb when removing the\n * element associated with a connection drag.\n */\n this.remove = function (el, doNotRepaint) {\n var info = _info(el), affectedElements = [];\n if (info.text) {\n info.el.parentNode.removeChild(info.el);\n }\n else if (info.id) {\n _currentInstance.batch(function () {\n _doRemove(info, affectedElements);\n }, doNotRepaint === true);\n }\n return _currentInstance;\n };\n\n this.empty = function (el, doNotRepaint) {\n var affectedElements = [];\n var _one = function(el, dontRemoveFocus) {\n var info = _info(el);\n if (info.text) {\n info.el.parentNode.removeChild(info.el);\n }\n else if (info.el) {\n while(info.el.childNodes.length > 0) {\n _one(info.el.childNodes[0]);\n }\n if (!dontRemoveFocus) {\n _doRemove(info, affectedElements);\n }\n }\n };\n\n _currentInstance.batch(function() {\n _one(el, true);\n }, doNotRepaint === false);\n\n return _currentInstance;\n };\n\n this.reset = function (doNotUnbindInstanceEventListeners) {\n _currentInstance.silently(function() {\n _hoverSuspended = false;\n _currentInstance.removeAllGroups();\n _currentInstance.removeGroupManager();\n _currentInstance.deleteEveryEndpoint();\n if (!doNotUnbindInstanceEventListeners) {\n _currentInstance.unbind();\n }\n this.targetEndpointDefinitions = {};\n this.sourceEndpointDefinitions = {};\n connections.length = 0;\n if (this.doReset) {\n this.doReset();\n }\n }.bind(this));\n };\n\n var _clearObject = function (obj) {\n if (obj.canvas && obj.canvas.parentNode) {\n obj.canvas.parentNode.removeChild(obj.canvas);\n }\n obj.cleanup();\n obj.destroy();\n };\n\n this.clear = function () {\n _currentInstance.select().each(_clearObject);\n _currentInstance.selectEndpoints().each(_clearObject);\n\n endpointsByElement = {};\n endpointsByUUID = {};\n };\n\n this.setDefaultScope = function (scope) {\n DEFAULT_SCOPE = scope;\n return _currentInstance;\n };\n\n this.deriveEndpointAndAnchorSpec = function(type, dontPrependDefault) {\n var bits = ((dontPrependDefault ? \"\" : \"default \") + type).split(/[\\s]/), eps = null, ep = null, a = null, as = null;\n for (var i = 0; i < bits.length; i++) {\n var _t = _currentInstance.getType(bits[i], \"connection\");\n if (_t) {\n if (_t.endpoints) {\n eps = _t.endpoints;\n }\n if (_t.endpoint) {\n ep = _t.endpoint;\n }\n if (_t.anchors) {\n as = _t.anchors;\n }\n if (_t.anchor) {\n a = _t.anchor;\n }\n }\n }\n return { endpoints: eps ? eps : [ ep, ep ], anchors: as ? as : [a, a ]};\n };\n\n // sets the id of some element, changing whatever we need to to keep track.\n this.setId = function (el, newId, doNotSetAttribute) {\n //\n var id;\n\n if (_ju.isString(el)) {\n id = el;\n }\n else {\n el = this.getElement(el);\n id = this.getId(el);\n }\n\n var sConns = this.getConnections({source: id, scope: '*'}, true),\n tConns = this.getConnections({target: id, scope: '*'}, true);\n\n newId = \"\" + newId;\n\n if (!doNotSetAttribute) {\n el = this.getElement(id);\n this.setAttribute(el, \"id\", newId);\n }\n else {\n el = this.getElement(newId);\n }\n\n endpointsByElement[newId] = endpointsByElement[id] || [];\n for (var i = 0, ii = endpointsByElement[newId].length; i < ii; i++) {\n endpointsByElement[newId][i].setElementId(newId);\n endpointsByElement[newId][i].setReferenceElement(el);\n }\n delete endpointsByElement[id];\n\n this.sourceEndpointDefinitions[newId] = this.sourceEndpointDefinitions[id];\n delete this.sourceEndpointDefinitions[id];\n this.targetEndpointDefinitions[newId] = this.targetEndpointDefinitions[id];\n delete this.targetEndpointDefinitions[id];\n\n this.anchorManager.changeId(id, newId);\n var dm = this.getDragManager();\n if (dm) {\n dm.changeId(id, newId);\n }\n managedElements[newId] = managedElements[id];\n delete managedElements[id];\n\n var _conns = function (list, epIdx, type) {\n for (var i = 0, ii = list.length; i < ii; i++) {\n list[i].endpoints[epIdx].setElementId(newId);\n list[i].endpoints[epIdx].setReferenceElement(el);\n list[i][type + \"Id\"] = newId;\n list[i][type] = el;\n }\n };\n _conns(sConns, 0, \"source\");\n _conns(tConns, 1, \"target\");\n\n this.repaint(newId);\n };\n\n this.setDebugLog = function (debugLog) {\n log = debugLog;\n };\n\n this.setSuspendDrawing = function (val, repaintAfterwards) {\n var curVal = _suspendDrawing;\n _suspendDrawing = val;\n if (val) {\n _suspendedAt = new Date().getTime();\n } else {\n _suspendedAt = null;\n }\n if (repaintAfterwards) {\n this.repaintEverything();\n }\n return curVal;\n };\n\n // returns whether or not drawing is currently suspended.\n this.isSuspendDrawing = function () {\n return _suspendDrawing;\n };\n\n // return timestamp for when drawing was suspended.\n this.getSuspendedAt = function () {\n return _suspendedAt;\n };\n\n this.batch = function (fn, doNotRepaintAfterwards) {\n var _wasSuspended = this.isSuspendDrawing();\n if (!_wasSuspended) {\n this.setSuspendDrawing(true);\n }\n try {\n fn();\n }\n catch (e) {\n _ju.log(\"Function run while suspended failed\", e);\n }\n if (!_wasSuspended) {\n this.setSuspendDrawing(false, !doNotRepaintAfterwards);\n }\n };\n\n this.doWhileSuspended = this.batch;\n\n this.getCachedData = _getCachedData;\n this.timestamp = _timestamp;\n this.show = function (el, changeEndpoints) {\n _setVisible(el, \"block\", changeEndpoints);\n return _currentInstance;\n };\n\n // TODO: update this method to return the current state.\n this.toggleVisible = _toggleVisible;\n this.addListener = this.bind;\n\n var floatingConnections = [];\n this.registerFloatingConnection = function(info, conn, ep) {\n floatingConnections[info.id] = conn;\n // only register for the target endpoint; we will not be dragging the source at any time\n // before this connection is either discarded or made into a permanent connection.\n _ju.addToList(endpointsByElement, info.id, ep);\n };\n this.getFloatingConnectionFor = function(id) {\n return floatingConnections[id];\n };\n };\n\n _ju.extend(root.jsPlumbInstance, _ju.EventGenerator, {\n setAttribute: function (el, a, v) {\n this.setAttribute(el, a, v);\n },\n getAttribute: function (el, a) {\n return this.getAttribute(root.jsPlumb.getElement(el), a);\n },\n convertToFullOverlaySpec: function(spec) {\n if (_ju.isString(spec)) {\n spec = [ spec, { } ];\n }\n spec[1].id = spec[1].id || _ju.uuid();\n return spec;\n },\n registerConnectionType: function (id, type) {\n this._connectionTypes[id] = root.jsPlumb.extend({}, type);\n if (type.overlays) {\n var to = {};\n for (var i = 0; i < type.overlays.length; i++) {\n // if a string, convert to object representation so that we can store the typeid on it.\n // also assign an id.\n var fo = this.convertToFullOverlaySpec(type.overlays[i]);\n to[fo[1].id] = fo;\n }\n this._connectionTypes[id].overlays = to;\n }\n },\n registerConnectionTypes: function (types) {\n for (var i in types) {\n this.registerConnectionType(i, types[i]);\n }\n },\n registerEndpointType: function (id, type) {\n this._endpointTypes[id] = root.jsPlumb.extend({}, type);\n if (type.overlays) {\n var to = {};\n for (var i = 0; i < type.overlays.length; i++) {\n // if a string, convert to object representation so that we can store the typeid on it.\n // also assign an id.\n var fo = this.convertToFullOverlaySpec(type.overlays[i]);\n to[fo[1].id] = fo;\n }\n this._endpointTypes[id].overlays = to;\n }\n },\n registerEndpointTypes: function (types) {\n for (var i in types) {\n this.registerEndpointType(i, types[i]);\n }\n },\n getType: function (id, typeDescriptor) {\n return typeDescriptor === \"connection\" ? this._connectionTypes[id] : this._endpointTypes[id];\n },\n setIdChanged: function (oldId, newId) {\n this.setId(oldId, newId, true);\n },\n // set parent: change the parent for some node and update all the registrations we need to.\n setParent: function (el, newParent) {\n var _dom = this.getElement(el),\n _id = this.getId(_dom),\n _pdom = this.getElement(newParent),\n _pid = this.getId(_pdom),\n dm = this.getDragManager();\n\n _dom.parentNode.removeChild(_dom);\n _pdom.appendChild(_dom);\n if (dm) {\n dm.setParent(_dom, _id, _pdom, _pid);\n }\n },\n extend: function (o1, o2, names) {\n var i;\n if (names) {\n for (i = 0; i < names.length; i++) {\n o1[names[i]] = o2[names[i]];\n }\n }\n else {\n for (i in o2) {\n o1[i] = o2[i];\n }\n }\n\n return o1;\n },\n floatingConnections: {},\n getFloatingAnchorIndex: function (jpc) {\n return jpc.endpoints[0].isFloating() ? 0 : jpc.endpoints[1].isFloating() ? 1 : -1;\n }\n });\n\n// --------------------- static instance + module registration -------------------------------------------\n\n// create static instance and assign to window if window exists.\n var jsPlumb = new jsPlumbInstance();\n // register on 'root' (lets us run on server or browser)\n root.jsPlumb = jsPlumb;\n // add 'getInstance' method to static instance\n jsPlumb.getInstance = function (_defaults, overrideFns) {\n var j = new jsPlumbInstance(_defaults);\n if (overrideFns) {\n for (var ovf in overrideFns) {\n j[ovf] = overrideFns[ovf];\n }\n }\n j.init();\n return j;\n };\n jsPlumb.each = function (spec, fn) {\n if (spec == null) {\n return;\n }\n if (typeof spec === \"string\") {\n fn(jsPlumb.getElement(spec));\n }\n else if (spec.length != null) {\n for (var i = 0; i < spec.length; i++) {\n fn(jsPlumb.getElement(spec[i]));\n }\n }\n else {\n fn(spec);\n } // assume it's an element.\n };\n\n // CommonJS\n if (typeof exports !== 'undefined') {\n exports.jsPlumb = jsPlumb;\n }\n\n// --------------------- end static instance + AMD registration -------------------------------------------\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function() {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n // ------------------------------ BEGIN OverlayCapablejsPlumbUIComponent --------------------------------------------\n\n var _internalLabelOverlayId = \"__label\",\n // this is a shortcut helper method to let people add a label as\n // overlay.\n _makeLabelOverlay = function (component, params) {\n\n var _params = {\n cssClass: params.cssClass,\n labelStyle: component.labelStyle,\n id: _internalLabelOverlayId,\n component: component,\n _jsPlumb: component._jsPlumb.instance // TODO not necessary, since the instance can be accessed through the component.\n },\n mergedParams = _jp.extend(_params, params);\n\n return new _jp.Overlays[component._jsPlumb.instance.getRenderMode()].Label(mergedParams);\n },\n _processOverlay = function (component, o) {\n var _newOverlay = null;\n if (_ju.isArray(o)) {\t// this is for the shorthand [\"Arrow\", { width:50 }] syntax\n // there's also a three arg version:\n // [\"Arrow\", { width:50 }, {location:0.7}]\n // which merges the 3rd arg into the 2nd.\n var type = o[0],\n // make a copy of the object so as not to mess up anyone else's reference...\n p = _jp.extend({component: component, _jsPlumb: component._jsPlumb.instance}, o[1]);\n if (o.length === 3) {\n _jp.extend(p, o[2]);\n }\n _newOverlay = new _jp.Overlays[component._jsPlumb.instance.getRenderMode()][type](p);\n } else if (o.constructor === String) {\n _newOverlay = new _jp.Overlays[component._jsPlumb.instance.getRenderMode()][o]({component: component, _jsPlumb: component._jsPlumb.instance});\n } else {\n _newOverlay = o;\n }\n\n _newOverlay.id = _newOverlay.id || _ju.uuid();\n component.cacheTypeItem(\"overlay\", _newOverlay, _newOverlay.id);\n component._jsPlumb.overlays[_newOverlay.id] = _newOverlay;\n\n return _newOverlay;\n };\n\n _jp.OverlayCapableJsPlumbUIComponent = function (params) {\n\n root.jsPlumbUIComponent.apply(this, arguments);\n this._jsPlumb.overlays = {};\n this._jsPlumb.overlayPositions = {};\n\n if (params.label) {\n this.getDefaultType().overlays[_internalLabelOverlayId] = [\"Label\", {\n label: params.label,\n location: params.labelLocation || this.defaultLabelLocation || 0.5,\n labelStyle: params.labelStyle || this._jsPlumb.instance.Defaults.LabelStyle,\n id:_internalLabelOverlayId\n }];\n }\n\n this.setListenerComponent = function (c) {\n if (this._jsPlumb) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].setListenerComponent(c);\n }\n }\n };\n };\n\n _jp.OverlayCapableJsPlumbUIComponent.applyType = function (component, t) {\n if (t.overlays) {\n // loop through the ones in the type. if already present on the component,\n // dont remove or re-add.\n var keep = {}, i;\n\n for (i in t.overlays) {\n\n var existing = component._jsPlumb.overlays[t.overlays[i][1].id];\n if (existing) {\n // maybe update from data, if there were parameterised values for instance.\n existing.updateFrom(t.overlays[i][1]);\n keep[t.overlays[i][1].id] = true;\n }\n else {\n var c = component.getCachedTypeItem(\"overlay\", t.overlays[i][1].id);\n if (c != null) {\n c.reattach(component._jsPlumb.instance, component);\n c.setVisible(true);\n // maybe update from data, if there were parameterised values for instance.\n c.updateFrom(t.overlays[i][1]);\n component._jsPlumb.overlays[c.id] = c;\n }\n else {\n c = component.addOverlay(t.overlays[i], true);\n }\n keep[c.id] = true;\n }\n }\n\n // now loop through the full overlays and remove those that we dont want to keep\n for (i in component._jsPlumb.overlays) {\n if (keep[component._jsPlumb.overlays[i].id] == null) {\n component.removeOverlay(component._jsPlumb.overlays[i].id, true); // remove overlay but dont clean it up.\n // that would remove event listeners etc; overlays are never discarded by the types stuff, they are\n // just detached/reattached.\n }\n }\n }\n };\n\n _ju.extend(_jp.OverlayCapableJsPlumbUIComponent, root.jsPlumbUIComponent, {\n\n setHover: function (hover, ignoreAttachedElements) {\n if (this._jsPlumb && !this._jsPlumb.instance.isConnectionBeingDragged()) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i][hover ? \"addClass\" : \"removeClass\"](this._jsPlumb.instance.hoverClass);\n }\n }\n },\n addOverlay: function (overlay, doNotRepaint) {\n var o = _processOverlay(this, overlay);\n if (!doNotRepaint) {\n this.repaint();\n }\n return o;\n },\n getOverlay: function (id) {\n return this._jsPlumb.overlays[id];\n },\n getOverlays: function () {\n return this._jsPlumb.overlays;\n },\n hideOverlay: function (id) {\n var o = this.getOverlay(id);\n if (o) {\n o.hide();\n }\n },\n hideOverlays: function () {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].hide();\n }\n },\n showOverlay: function (id) {\n var o = this.getOverlay(id);\n if (o) {\n o.show();\n }\n },\n showOverlays: function () {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].show();\n }\n },\n removeAllOverlays: function (doNotRepaint) {\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays[i].cleanup) {\n this._jsPlumb.overlays[i].cleanup();\n }\n }\n\n this._jsPlumb.overlays = {};\n this._jsPlumb.overlayPositions = null;\n this._jsPlumb.overlayPlacements= {};\n if (!doNotRepaint) {\n this.repaint();\n }\n },\n removeOverlay: function (overlayId, dontCleanup) {\n var o = this._jsPlumb.overlays[overlayId];\n if (o) {\n o.setVisible(false);\n if (!dontCleanup && o.cleanup) {\n o.cleanup();\n }\n delete this._jsPlumb.overlays[overlayId];\n if (this._jsPlumb.overlayPositions) {\n delete this._jsPlumb.overlayPositions[overlayId];\n }\n\n if (this._jsPlumb.overlayPlacements) {\n delete this._jsPlumb.overlayPlacements[overlayId];\n }\n }\n },\n removeOverlays: function () {\n for (var i = 0, j = arguments.length; i < j; i++) {\n this.removeOverlay(arguments[i]);\n }\n },\n moveParent: function (newParent) {\n if (this.bgCanvas) {\n this.bgCanvas.parentNode.removeChild(this.bgCanvas);\n newParent.appendChild(this.bgCanvas);\n }\n\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n newParent.appendChild(this.canvas);\n\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays[i].isAppendedAtTopLevel) {\n var el = this._jsPlumb.overlays[i].getElement();\n el.parentNode.removeChild(el);\n newParent.appendChild(el);\n }\n }\n }\n },\n getLabel: function () {\n var lo = this.getOverlay(_internalLabelOverlayId);\n return lo != null ? lo.getLabel() : null;\n },\n getLabelOverlay: function () {\n return this.getOverlay(_internalLabelOverlayId);\n },\n setLabel: function (l) {\n var lo = this.getOverlay(_internalLabelOverlayId);\n if (!lo) {\n var params = l.constructor === String || l.constructor === Function ? { label: l } : l;\n lo = _makeLabelOverlay(this, params);\n this._jsPlumb.overlays[_internalLabelOverlayId] = lo;\n }\n else {\n if (l.constructor === String || l.constructor === Function) {\n lo.setLabel(l);\n }\n else {\n if (l.label) {\n lo.setLabel(l.label);\n }\n if (l.location) {\n lo.setLocation(l.location);\n }\n }\n }\n\n if (!this._jsPlumb.instance.isSuspendDrawing()) {\n this.repaint();\n }\n },\n cleanup: function (force) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].cleanup(force);\n this._jsPlumb.overlays[i].destroy(force);\n }\n if (force) {\n this._jsPlumb.overlays = {};\n this._jsPlumb.overlayPositions = null;\n }\n },\n setVisible: function (v) {\n this[v ? \"showOverlays\" : \"hideOverlays\"]();\n },\n setAbsoluteOverlayPosition: function (overlay, xy) {\n this._jsPlumb.overlayPositions[overlay.id] = xy;\n },\n getAbsoluteOverlayPosition: function (overlay) {\n return this._jsPlumb.overlayPositions ? this._jsPlumb.overlayPositions[overlay.id] : null;\n },\n _clazzManip:function(action, clazz, dontUpdateOverlays) {\n if (!dontUpdateOverlays) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i][action + \"Class\"](clazz);\n }\n }\n },\n addClass:function(clazz, dontUpdateOverlays) {\n this._clazzManip(\"add\", clazz, dontUpdateOverlays);\n },\n removeClass:function(clazz, dontUpdateOverlays) {\n this._clazzManip(\"remove\", clazz, dontUpdateOverlays);\n }\n });\n\n// ------------------------------ END OverlayCapablejsPlumbUIComponent --------------------------------------------\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the code for Endpoints.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n * \n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n // create the drag handler for a connection\n var _makeConnectionDragHandler = function (endpoint, placeholder, _jsPlumb) {\n var stopped = false;\n return {\n drag: function () {\n if (stopped) {\n stopped = false;\n return true;\n }\n\n if (placeholder.element) {\n var _ui = _jsPlumb.getUIPosition(arguments, _jsPlumb.getZoom());\n if (_ui != null) {\n _jsPlumb.setPosition(placeholder.element, _ui);\n }\n _jsPlumb.repaint(placeholder.element, _ui);\n // always repaint the source endpoint, because only continuous/dynamic anchors cause the endpoint\n // to be repainted, so static anchors need to be told (or the endpoint gets dragged around)\n endpoint.paint({anchorPoint:endpoint.anchor.getCurrentLocation({element:endpoint})});\n }\n },\n stopDrag: function () {\n stopped = true;\n }\n };\n };\n\n // creates a placeholder div for dragging purposes, adds it, and pre-computes its offset.\n var _makeDraggablePlaceholder = function (placeholder, _jsPlumb, ipco, ips) {\n var n = _jsPlumb.createElement(\"div\", { position : \"absolute\" });\n _jsPlumb.appendElement(n);\n var id = _jsPlumb.getId(n);\n _jsPlumb.setPosition(n, ipco);\n n.style.width = ips[0] + \"px\";\n n.style.height = ips[1] + \"px\";\n _jsPlumb.manage(id, n, true); // TRANSIENT MANAGE\n // create and assign an id, and initialize the offset.\n placeholder.id = id;\n placeholder.element = n;\n };\n\n // create a floating endpoint (for drag connections)\n var _makeFloatingEndpoint = function (paintStyle, referenceAnchor, endpoint, referenceCanvas, sourceElement, _jsPlumb, _newEndpoint, scope) {\n var floatingAnchor = new _jp.FloatingAnchor({ reference: referenceAnchor, referenceCanvas: referenceCanvas, jsPlumbInstance: _jsPlumb });\n //setting the scope here should not be the way to fix that mootools issue. it should be fixed by not\n // adding the floating endpoint as a droppable. that makes more sense anyway!\n // TRANSIENT MANAGE\n return _newEndpoint({\n paintStyle: paintStyle,\n endpoint: endpoint,\n anchor: floatingAnchor,\n source: sourceElement,\n scope: scope\n });\n };\n\n var typeParameters = [ \"connectorStyle\", \"connectorHoverStyle\", \"connectorOverlays\",\n \"connector\", \"connectionType\", \"connectorClass\", \"connectorHoverClass\" ];\n\n // a helper function that tries to find a connection to the given element, and returns it if so. if elementWithPrecedence is null,\n // or no connection to it is found, we return the first connection in our list.\n var findConnectionToUseForDynamicAnchor = function (ep, elementWithPrecedence) {\n var idx = 0;\n if (elementWithPrecedence != null) {\n for (var i = 0; i < ep.connections.length; i++) {\n if (ep.connections[i].sourceId === elementWithPrecedence || ep.connections[i].targetId === elementWithPrecedence) {\n idx = i;\n break;\n }\n }\n }\n\n return ep.connections[idx];\n };\n\n _jp.Endpoint = function (params) {\n var _jsPlumb = params._jsPlumb,\n _newConnection = params.newConnection,\n _newEndpoint = params.newEndpoint;\n\n this.idPrefix = \"_jsplumb_e_\";\n this.defaultLabelLocation = [ 0.5, 0.5 ];\n this.defaultOverlayKeys = [\"Overlays\", \"EndpointOverlays\"];\n _jp.OverlayCapableJsPlumbUIComponent.apply(this, arguments);\n\n// TYPE\n\n this.appendToDefaultType({\n connectionType:params.connectionType,\n maxConnections: params.maxConnections == null ? this._jsPlumb.instance.Defaults.MaxConnections : params.maxConnections, // maximum number of connections this endpoint can be the source of.,\n paintStyle: params.endpointStyle || params.paintStyle || params.style || this._jsPlumb.instance.Defaults.EndpointStyle || _jp.Defaults.EndpointStyle,\n hoverPaintStyle: params.endpointHoverStyle || params.hoverPaintStyle || this._jsPlumb.instance.Defaults.EndpointHoverStyle || _jp.Defaults.EndpointHoverStyle,\n connectorStyle: params.connectorStyle,\n connectorHoverStyle: params.connectorHoverStyle,\n connectorClass: params.connectorClass,\n connectorHoverClass: params.connectorHoverClass,\n connectorOverlays: params.connectorOverlays,\n connector: params.connector,\n connectorTooltip: params.connectorTooltip\n });\n\n// END TYPE\n\n this._jsPlumb.enabled = !(params.enabled === false);\n this._jsPlumb.visible = true;\n this.element = _jp.getElement(params.source);\n this._jsPlumb.uuid = params.uuid;\n this._jsPlumb.floatingEndpoint = null;\n var inPlaceCopy = null;\n if (this._jsPlumb.uuid) {\n params.endpointsByUUID[this._jsPlumb.uuid] = this;\n }\n this.elementId = params.elementId;\n this.dragProxy = params.dragProxy;\n\n this._jsPlumb.connectionCost = params.connectionCost;\n this._jsPlumb.connectionsDirected = params.connectionsDirected;\n this._jsPlumb.currentAnchorClass = \"\";\n this._jsPlumb.events = {};\n\n var deleteOnEmpty = params.deleteOnEmpty === true;\n this.setDeleteOnEmpty = function(d) {\n deleteOnEmpty = d;\n };\n\n var _updateAnchorClass = function () {\n // stash old, get new\n var oldAnchorClass = _jsPlumb.endpointAnchorClassPrefix + \"-\" + this._jsPlumb.currentAnchorClass;\n this._jsPlumb.currentAnchorClass = this.anchor.getCssClass();\n var anchorClass = _jsPlumb.endpointAnchorClassPrefix + (this._jsPlumb.currentAnchorClass ? \"-\" + this._jsPlumb.currentAnchorClass : \"\");\n\n this.removeClass(oldAnchorClass);\n this.addClass(anchorClass);\n // add and remove at the same time to reduce the number of reflows.\n _jp.updateClasses(this.element, anchorClass, oldAnchorClass);\n }.bind(this);\n\n this.prepareAnchor = function(anchorParams) {\n var a = this._jsPlumb.instance.makeAnchor(anchorParams, this.elementId, _jsPlumb);\n a.bind(\"anchorChanged\", function (currentAnchor) {\n this.fire(\"anchorChanged\", {endpoint: this, anchor: currentAnchor});\n _updateAnchorClass();\n }.bind(this));\n return a;\n };\n\n this.setPreparedAnchor = function(anchor, doNotRepaint) {\n this._jsPlumb.instance.continuousAnchorFactory.clear(this.elementId);\n this.anchor = anchor;\n _updateAnchorClass();\n\n if (!doNotRepaint) {\n this._jsPlumb.instance.repaint(this.elementId);\n }\n\n return this;\n };\n\n this.setAnchor = function (anchorParams, doNotRepaint) {\n var a = this.prepareAnchor(anchorParams);\n this.setPreparedAnchor(a, doNotRepaint);\n return this;\n };\n\n var internalHover = function (state) {\n if (this.connections.length > 0) {\n for (var i = 0; i < this.connections.length; i++) {\n this.connections[i].setHover(state, false);\n }\n }\n else {\n this.setHover(state);\n }\n }.bind(this);\n\n this.bind(\"mouseover\", function () {\n internalHover(true);\n });\n this.bind(\"mouseout\", function () {\n internalHover(false);\n });\n\n // ANCHOR MANAGER\n if (!params._transient) { // in place copies, for example, are transient. they will never need to be retrieved during a paint cycle, because they dont move, and then they are deleted.\n this._jsPlumb.instance.anchorManager.add(this, this.elementId);\n }\n\n this.prepareEndpoint = function(ep, typeId) {\n var _e = function (t, p) {\n var rm = _jsPlumb.getRenderMode();\n if (_jp.Endpoints[rm][t]) {\n return new _jp.Endpoints[rm][t](p);\n }\n if (!_jsPlumb.Defaults.DoNotThrowErrors) {\n throw { msg: \"jsPlumb: unknown endpoint type '\" + t + \"'\" };\n }\n };\n\n var endpointArgs = {\n _jsPlumb: this._jsPlumb.instance,\n cssClass: params.cssClass,\n container: params.container,\n tooltip: params.tooltip,\n connectorTooltip: params.connectorTooltip,\n endpoint: this\n };\n\n var endpoint;\n\n if (_ju.isString(ep)) {\n endpoint = _e(ep, endpointArgs);\n }\n else if (_ju.isArray(ep)) {\n endpointArgs = _ju.merge(ep[1], endpointArgs);\n endpoint = _e(ep[0], endpointArgs);\n }\n else {\n endpoint = ep.clone();\n }\n\n // assign a clone function using a copy of endpointArgs. this is used when a drag starts: the endpoint that was dragged is cloned,\n // and the clone is left in its place while the original one goes off on a magical journey.\n // the copy is to get around a closure problem, in which endpointArgs ends up getting shared by\n // the whole world.\n //var argsForClone = jsPlumb.extend({}, endpointArgs);\n endpoint.clone = function () {\n // TODO this, and the code above, can be refactored to be more dry.\n if (_ju.isString(ep)) {\n return _e(ep, endpointArgs);\n }\n else if (_ju.isArray(ep)) {\n endpointArgs = _ju.merge(ep[1], endpointArgs);\n return _e(ep[0], endpointArgs);\n }\n }.bind(this);\n\n endpoint.typeId = typeId;\n return endpoint;\n };\n\n this.setEndpoint = function(ep, doNotRepaint) {\n var _ep = this.prepareEndpoint(ep);\n this.setPreparedEndpoint(_ep, true);\n };\n\n this.setPreparedEndpoint = function (ep, doNotRepaint) {\n if (this.endpoint != null) {\n this.endpoint.cleanup();\n this.endpoint.destroy();\n }\n this.endpoint = ep;\n this.type = this.endpoint.type;\n this.canvas = this.endpoint.canvas;\n };\n\n _jp.extend(this, params, typeParameters);\n\n this.isSource = params.isSource || false;\n this.isTemporarySource = params.isTemporarySource || false;\n this.isTarget = params.isTarget || false;\n\n this.connections = params.connections || [];\n this.connectorPointerEvents = params[\"connector-pointer-events\"];\n\n this.scope = params.scope || _jsPlumb.getDefaultScope();\n this.timestamp = null;\n this.reattachConnections = params.reattach || _jsPlumb.Defaults.ReattachConnections;\n this.connectionsDetachable = _jsPlumb.Defaults.ConnectionsDetachable;\n if (params.connectionsDetachable === false || params.detachable === false) {\n this.connectionsDetachable = false;\n }\n this.dragAllowedWhenFull = params.dragAllowedWhenFull !== false;\n\n if (params.onMaxConnections) {\n this.bind(\"maxConnections\", params.onMaxConnections);\n }\n\n //\n // add a connection. not part of public API.\n //\n this.addConnection = function (connection) {\n this.connections.push(connection);\n this[(this.connections.length > 0 ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointConnectedClass);\n this[(this.isFull() ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointFullClass);\n };\n\n this.detachFromConnection = function (connection, idx, doNotCleanup) {\n idx = idx == null ? this.connections.indexOf(connection) : idx;\n if (idx >= 0) {\n this.connections.splice(idx, 1);\n this[(this.connections.length > 0 ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointConnectedClass);\n this[(this.isFull() ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointFullClass);\n }\n\n if (!doNotCleanup && deleteOnEmpty && this.connections.length === 0) {\n _jsPlumb.deleteObject({\n endpoint: this,\n fireEvent: false,\n deleteAttachedObjects: doNotCleanup !== true\n });\n }\n };\n\n this.deleteEveryConnection = function(params) {\n var c = this.connections.length;\n for (var i = 0; i < c; i++) {\n _jsPlumb.deleteConnection(this.connections[0], params);\n }\n };\n\n this.detachFrom = function (targetEndpoint, fireEvent, originalEvent) {\n var c = [];\n for (var i = 0; i < this.connections.length; i++) {\n if (this.connections[i].endpoints[1] === targetEndpoint || this.connections[i].endpoints[0] === targetEndpoint) {\n c.push(this.connections[i]);\n }\n }\n for (var j = 0, count = c.length; j < count; j++) {\n _jsPlumb.deleteConnection(c[0]);\n }\n return this;\n };\n\n this.getElement = function () {\n return this.element;\n };\n\n this.setElement = function (el) {\n var parentId = this._jsPlumb.instance.getId(el),\n curId = this.elementId;\n // remove the endpoint from the list for the current endpoint's element\n _ju.removeWithFunction(params.endpointsByElement[this.elementId], function (e) {\n return e.id === this.id;\n }.bind(this));\n this.element = _jp.getElement(el);\n this.elementId = _jsPlumb.getId(this.element);\n _jsPlumb.anchorManager.rehomeEndpoint(this, curId, this.element);\n _jsPlumb.dragManager.endpointAdded(this.element);\n _ju.addToList(params.endpointsByElement, parentId, this);\n return this;\n };\n\n /**\n * private but must be exposed.\n */\n this.makeInPlaceCopy = function () {\n var loc = this.anchor.getCurrentLocation({element: this}),\n o = this.anchor.getOrientation(this),\n acc = this.anchor.getCssClass(),\n inPlaceAnchor = {\n bind: function () {\n },\n compute: function () {\n return [ loc[0], loc[1] ];\n },\n getCurrentLocation: function () {\n return [ loc[0], loc[1] ];\n },\n getOrientation: function () {\n return o;\n },\n getCssClass: function () {\n return acc;\n }\n };\n\n return _newEndpoint({\n dropOptions: params.dropOptions,\n anchor: inPlaceAnchor,\n source: this.element,\n paintStyle: this.getPaintStyle(),\n endpoint: params.hideOnDrag ? \"Blank\" : this.endpoint,\n _transient: true,\n scope: this.scope,\n reference:this\n });\n };\n\n /**\n * returns a connection from the pool; used when dragging starts. just gets the head of the array if it can.\n */\n this.connectorSelector = function () {\n return this.connections[0];\n };\n\n this.setStyle = this.setPaintStyle;\n\n this.paint = function (params) {\n params = params || {};\n var timestamp = params.timestamp, recalc = !(params.recalc === false);\n if (!timestamp || this.timestamp !== timestamp) {\n\n var info = _jsPlumb.updateOffset({ elId: this.elementId, timestamp: timestamp });\n\n var xy = params.offset ? params.offset.o : info.o;\n if (xy != null) {\n var ap = params.anchorPoint, connectorPaintStyle = params.connectorPaintStyle;\n if (ap == null) {\n var wh = params.dimensions || info.s,\n anchorParams = { xy: [ xy.left, xy.top ], wh: wh, element: this, timestamp: timestamp };\n if (recalc && this.anchor.isDynamic && this.connections.length > 0) {\n var c = findConnectionToUseForDynamicAnchor(this, params.elementWithPrecedence),\n oIdx = c.endpoints[0] === this ? 1 : 0,\n oId = oIdx === 0 ? c.sourceId : c.targetId,\n oInfo = _jsPlumb.getCachedData(oId),\n oOffset = oInfo.o, oWH = oInfo.s;\n\n anchorParams.index = oIdx === 0 ? 1 : 0;\n anchorParams.connection = c;\n anchorParams.txy = [ oOffset.left, oOffset.top ];\n anchorParams.twh = oWH;\n anchorParams.tElement = c.endpoints[oIdx];\n } else if (this.connections.length > 0) {\n anchorParams.connection = this.connections[0];\n }\n ap = this.anchor.compute(anchorParams);\n }\n\n this.endpoint.compute(ap, this.anchor.getOrientation(this), this._jsPlumb.paintStyleInUse, connectorPaintStyle || this.paintStyleInUse);\n this.endpoint.paint(this._jsPlumb.paintStyleInUse, this.anchor);\n this.timestamp = timestamp;\n\n // paint overlays\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays.hasOwnProperty(i)) {\n var o = this._jsPlumb.overlays[i];\n if (o.isVisible()) {\n this._jsPlumb.overlayPlacements[i] = o.draw(this.endpoint, this._jsPlumb.paintStyleInUse);\n o.paint(this._jsPlumb.overlayPlacements[i]);\n }\n }\n }\n }\n }\n };\n\n this.getTypeDescriptor = function () {\n return \"endpoint\";\n };\n this.isVisible = function () {\n return this._jsPlumb.visible;\n };\n\n this.repaint = this.paint;\n\n var draggingInitialised = false;\n this.initDraggable = function () {\n\n // is this a connection source? we make it draggable and have the\n // drag listener maintain a connection with a floating endpoint.\n if (!draggingInitialised && _jp.isDragSupported(this.element)) {\n var placeholderInfo = { id: null, element: null },\n jpc = null,\n existingJpc = false,\n existingJpcParams = null,\n _dragHandler = _makeConnectionDragHandler(this, placeholderInfo, _jsPlumb),\n dragOptions = params.dragOptions || {},\n defaultOpts = {},\n startEvent = _jp.dragEvents.start,\n stopEvent = _jp.dragEvents.stop,\n dragEvent = _jp.dragEvents.drag,\n beforeStartEvent = _jp.dragEvents.beforeStart,\n payload;\n\n // respond to beforeStart from katavorio; this will have, optionally, a payload of attribute values\n // that were placed there by the makeSource mousedown listener.\n var beforeStart = function(beforeStartParams) {\n payload = beforeStartParams.e.payload || {};\n };\n\n var start = function (startParams) {\n\n// ------------- first, get a connection to drag. this may be null, in which case we are dragging a new one.\n\n jpc = this.connectorSelector();\n\n// -------------------------------- now a bunch of tests about whether or not to proceed -------------------------\n\n var _continue = true;\n // if not enabled, return\n if (!this.isEnabled()) {\n _continue = false;\n }\n // if no connection and we're not a source - or temporarily a source, as is the case with makeSource - return.\n if (jpc == null && !this.isSource && !this.isTemporarySource) {\n _continue = false;\n }\n // otherwise if we're full and not allowed to drag, also return false.\n if (this.isSource && this.isFull() && !(jpc != null && this.dragAllowedWhenFull)) {\n _continue = false;\n }\n // if the connection was setup as not detachable or one of its endpoints\n // was setup as connectionsDetachable = false, or Defaults.ConnectionsDetachable\n // is set to false...\n if (jpc != null && !jpc.isDetachable(this)) {\n // .. and the endpoint is full\n if (this.isFull()) {\n _continue = false;\n } else {\n // otherwise, if not full, set the connection to null, and we will now proceed\n // to drag a new connection.\n jpc = null;\n }\n }\n\n var beforeDrag = _jsPlumb.checkCondition(jpc == null ? \"beforeDrag\" : \"beforeStartDetach\", {\n endpoint:this,\n source:this.element,\n sourceId:this.elementId,\n connection:jpc\n });\n if (beforeDrag === false) {\n _continue = false;\n }\n // else we might have been given some data. we'll pass it in to a new connection as 'data'.\n // here we also merge in the optional payload we were given on mousedown.\n else if (typeof beforeDrag === \"object\") {\n _jp.extend(beforeDrag, payload || {});\n }\n else {\n // or if no beforeDrag data, maybe use the payload on its own.\n beforeDrag = payload || {};\n }\n\n if (_continue === false) {\n // this is for mootools and yui. returning false from this causes jquery to stop drag.\n // the events are wrapped in both mootools and yui anyway, but i don't think returning\n // false from the start callback would stop a drag.\n if (_jsPlumb.stopDrag) {\n _jsPlumb.stopDrag(this.canvas);\n }\n _dragHandler.stopDrag();\n return false;\n }\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n // ok to proceed.\n\n // clear hover for all connections for this endpoint before continuing.\n for (var i = 0; i < this.connections.length; i++) {\n this.connections[i].setHover(false);\n }\n\n this.addClass(\"endpointDrag\");\n _jsPlumb.setConnectionBeingDragged(true);\n\n // if we're not full but there was a connection, make it null. we'll create a new one.\n if (jpc && !this.isFull() && this.isSource) {\n jpc = null;\n }\n\n _jsPlumb.updateOffset({ elId: this.elementId });\n\n// ---------------- make the element we will drag around, and position it -----------------------------\n\n var ipco = this._jsPlumb.instance.getOffset(this.canvas),\n canvasElement = this.canvas,\n ips = this._jsPlumb.instance.getSize(this.canvas);\n\n _makeDraggablePlaceholder(placeholderInfo, _jsPlumb, ipco, ips);\n\n // store the id of the dragging div and the source element. the drop function will pick these up. \n _jsPlumb.setAttributes(this.canvas, {\n \"dragId\": placeholderInfo.id,\n \"elId\": this.elementId\n });\n\n// ------------------- create an endpoint that will be our floating endpoint ------------------------------------\n\n var endpointToFloat = this.dragProxy || this.endpoint;\n if (this.dragProxy == null && this.connectionType != null) {\n var aae = this._jsPlumb.instance.deriveEndpointAndAnchorSpec(this.connectionType);\n if (aae.endpoints[1]) {\n endpointToFloat = aae.endpoints[1];\n }\n }\n var centerAnchor = this._jsPlumb.instance.makeAnchor(\"Center\");\n centerAnchor.isFloating = true;\n this._jsPlumb.floatingEndpoint = _makeFloatingEndpoint(this.getPaintStyle(), centerAnchor, endpointToFloat, this.canvas, placeholderInfo.element, _jsPlumb, _newEndpoint, this.scope);\n var _savedAnchor = this._jsPlumb.floatingEndpoint.anchor;\n\n\n if (jpc == null) {\n\n this.setHover(false, false);\n // create a connection. one end is this endpoint, the other is a floating endpoint. \n jpc = _newConnection({\n sourceEndpoint: this,\n targetEndpoint: this._jsPlumb.floatingEndpoint,\n source: this.element, // for makeSource with parent option. ensure source element is represented correctly.\n target: placeholderInfo.element,\n anchors: [ this.anchor, this._jsPlumb.floatingEndpoint.anchor ],\n paintStyle: params.connectorStyle, // this can be null. Connection will use the default.\n hoverPaintStyle: params.connectorHoverStyle,\n connector: params.connector, // this can also be null. Connection will use the default.\n overlays: params.connectorOverlays,\n type: this.connectionType,\n cssClass: this.connectorClass,\n hoverClass: this.connectorHoverClass,\n scope:params.scope,\n data:beforeDrag\n });\n jpc.pending = true;\n jpc.addClass(_jsPlumb.draggingClass);\n this._jsPlumb.floatingEndpoint.addClass(_jsPlumb.draggingClass);\n this._jsPlumb.floatingEndpoint.anchor = _savedAnchor;\n // fire an event that informs that a connection is being dragged\n _jsPlumb.fire(\"connectionDrag\", jpc);\n\n // register the new connection on the drag manager. This connection, at this point, is 'pending',\n // and has as its target a temporary element (the 'placeholder'). If the connection subsequently\n // becomes established, the anchor manager is informed that the target of the connection has\n // changed.\n\n _jsPlumb.anchorManager.newConnection(jpc);\n\n } else {\n existingJpc = true;\n jpc.setHover(false);\n // new anchor idx\n var anchorIdx = jpc.endpoints[0].id === this.id ? 0 : 1;\n this.detachFromConnection(jpc, null, true); // detach from the connection while dragging is occurring. but dont cleanup automatically.\n\n // store the original scope (issue 57)\n var dragScope = _jsPlumb.getDragScope(canvasElement);\n _jsPlumb.setAttribute(this.canvas, \"originalScope\", dragScope);\n\n // fire an event that informs that a connection is being dragged. we do this before\n // replacing the original target with the floating element info.\n _jsPlumb.fire(\"connectionDrag\", jpc);\n\n // now we replace ourselves with the temporary div we created above:\n if (anchorIdx === 0) {\n existingJpcParams = [ jpc.source, jpc.sourceId, canvasElement, dragScope ];\n _jsPlumb.anchorManager.sourceChanged(jpc.endpoints[anchorIdx].elementId, placeholderInfo.id, jpc, placeholderInfo.element);\n\n } else {\n existingJpcParams = [ jpc.target, jpc.targetId, canvasElement, dragScope ];\n jpc.target = placeholderInfo.element;\n jpc.targetId = placeholderInfo.id;\n\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.endpoints[anchorIdx].elementId, jpc.targetId, jpc);\n }\n\n // store the original endpoint and assign the new floating endpoint for the drag.\n jpc.suspendedEndpoint = jpc.endpoints[anchorIdx];\n\n // PROVIDE THE SUSPENDED ELEMENT, BE IT A SOURCE OR TARGET (ISSUE 39)\n jpc.suspendedElement = jpc.endpoints[anchorIdx].getElement();\n jpc.suspendedElementId = jpc.endpoints[anchorIdx].elementId;\n jpc.suspendedElementType = anchorIdx === 0 ? \"source\" : \"target\";\n\n jpc.suspendedEndpoint.setHover(false);\n this._jsPlumb.floatingEndpoint.referenceEndpoint = jpc.suspendedEndpoint;\n jpc.endpoints[anchorIdx] = this._jsPlumb.floatingEndpoint;\n\n jpc.addClass(_jsPlumb.draggingClass);\n this._jsPlumb.floatingEndpoint.addClass(_jsPlumb.draggingClass);\n }\n\n _jsPlumb.registerFloatingConnection(placeholderInfo, jpc, this._jsPlumb.floatingEndpoint);\n\n // // register it and register connection on it.\n // _jsPlumb.floatingConnections[placeholderInfo.id] = jpc;\n //\n // // only register for the target endpoint; we will not be dragging the source at any time\n // // before this connection is either discarded or made into a permanent connection.\n // _ju.addToList(params.endpointsByElement, placeholderInfo.id, this._jsPlumb.floatingEndpoint);\n\n\n // tell jsplumb about it\n _jsPlumb.currentlyDragging = true;\n }.bind(this);\n\n var stop = function () {\n _jsPlumb.setConnectionBeingDragged(false);\n\n if (jpc && jpc.endpoints != null) {\n // get the actual drop event (decode from library args to stop function)\n var originalEvent = _jsPlumb.getDropEvent(arguments);\n // unlock the other endpoint (if it is dynamic, it would have been locked at drag start)\n var idx = _jsPlumb.getFloatingAnchorIndex(jpc);\n jpc.endpoints[idx === 0 ? 1 : 0].anchor.unlock();\n // TODO: Dont want to know about css classes inside jsplumb, ideally.\n jpc.removeClass(_jsPlumb.draggingClass);\n\n // if we have the floating endpoint then the connection has not been dropped\n // on another endpoint. If it is a new connection we throw it away. If it is an\n // existing connection we check to see if we should reattach it, throwing it away\n // if not.\n if (this._jsPlumb && (jpc.deleteConnectionNow || jpc.endpoints[idx] === this._jsPlumb.floatingEndpoint)) {\n // 6a. if the connection was an existing one...\n if (existingJpc && jpc.suspendedEndpoint) {\n // fix for issue35, thanks Sylvain Gizard: when firing the detach event make sure the\n // floating endpoint has been replaced.\n if (idx === 0) {\n jpc.floatingElement = jpc.source;\n jpc.floatingId = jpc.sourceId;\n jpc.floatingEndpoint = jpc.endpoints[0];\n jpc.floatingIndex = 0;\n jpc.source = existingJpcParams[0];\n jpc.sourceId = existingJpcParams[1];\n } else {\n // keep a copy of the floating element; the anchor manager will want to clean up.\n jpc.floatingElement = jpc.target;\n jpc.floatingId = jpc.targetId;\n jpc.floatingEndpoint = jpc.endpoints[1];\n jpc.floatingIndex = 1;\n jpc.target = existingJpcParams[0];\n jpc.targetId = existingJpcParams[1];\n }\n\n var fe = this._jsPlumb.floatingEndpoint; // store for later removal.\n // restore the original scope (issue 57)\n _jsPlumb.setDragScope(existingJpcParams[2], existingJpcParams[3]);\n jpc.endpoints[idx] = jpc.suspendedEndpoint;\n // if the connection should be reattached, or the other endpoint refuses detach, then\n // reset the connection to its original state\n if (jpc.isReattach() || jpc._forceReattach || jpc._forceDetach || !_jsPlumb.deleteConnection(jpc, {originalEvent: originalEvent})) {\n\n jpc.setHover(false);\n jpc._forceDetach = null;\n jpc._forceReattach = null;\n this._jsPlumb.floatingEndpoint.detachFromConnection(jpc);\n jpc.suspendedEndpoint.addConnection(jpc);\n\n // TODO this code is duplicated in lots of places...and there is nothing external\n // in the code; it all refers to the connection itself. we could add a\n // `checkSanity(connection)` method to anchorManager that did this.\n if (idx === 1) {\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.floatingId, jpc.targetId, jpc);\n }\n else {\n _jsPlumb.anchorManager.sourceChanged(jpc.floatingId, jpc.sourceId, jpc, jpc.source);\n }\n\n _jsPlumb.repaint(existingJpcParams[1]);\n }\n else {\n _jsPlumb.deleteObject({endpoint: fe});\n }\n }\n }\n\n // makeTargets sets this flag, to tell us we have been replaced and should delete this object.\n if (this.deleteAfterDragStop) {\n _jsPlumb.deleteObject({endpoint: this});\n }\n else {\n if (this._jsPlumb) {\n this.paint({recalc: false});\n }\n }\n\n // although the connection is no longer valid, there are use cases where this is useful.\n _jsPlumb.fire(\"connectionDragStop\", jpc, originalEvent);\n // fire this event to give people more fine-grained control (connectionDragStop fires a lot)\n if (jpc.pending) {\n _jsPlumb.fire(\"connectionAborted\", jpc, originalEvent);\n }\n // tell jsplumb that dragging is finished.\n _jsPlumb.currentlyDragging = false;\n jpc.suspendedElement = null;\n jpc.suspendedEndpoint = null;\n jpc = null;\n }\n\n // if no endpoints, jpc already cleaned up. but still we want to ensure we're reset properly.\n // remove the element associated with the floating endpoint\n // (and its associated floating endpoint and visual artefacts)\n if (placeholderInfo && placeholderInfo.element) {\n _jsPlumb.remove(placeholderInfo.element, false, false);\n }\n // remove the inplace copy\n if (inPlaceCopy) {\n _jsPlumb.deleteObject({endpoint: inPlaceCopy});\n }\n\n if (this._jsPlumb) {\n // make our canvas visible (TODO: hand off to library; we should not know about DOM)\n this.canvas.style.visibility = \"visible\";\n // unlock our anchor\n this.anchor.unlock();\n // clear floating anchor.\n this._jsPlumb.floatingEndpoint = null;\n }\n\n }.bind(this);\n\n dragOptions = _jp.extend(defaultOpts, dragOptions);\n dragOptions.scope = this.scope || dragOptions.scope;\n dragOptions[beforeStartEvent] = _ju.wrap(dragOptions[beforeStartEvent], beforeStart, false);\n dragOptions[startEvent] = _ju.wrap(dragOptions[startEvent], start, false);\n // extracted drag handler function so can be used by makeSource\n dragOptions[dragEvent] = _ju.wrap(dragOptions[dragEvent], _dragHandler.drag);\n dragOptions[stopEvent] = _ju.wrap(dragOptions[stopEvent], stop);\n dragOptions.multipleDrop = false;\n\n dragOptions.canDrag = function () {\n return this.isSource || this.isTemporarySource || (this.connections.length > 0 && this.connectionsDetachable !== false);\n }.bind(this);\n\n _jsPlumb.initDraggable(this.canvas, dragOptions, \"internal\");\n\n this.canvas._jsPlumbRelatedElement = this.element;\n\n draggingInitialised = true;\n }\n };\n\n var ep = params.endpoint || this._jsPlumb.instance.Defaults.Endpoint || _jp.Defaults.Endpoint;\n this.setEndpoint(ep, true);\n var anchorParamsToUse = params.anchor ? params.anchor : params.anchors ? params.anchors : (_jsPlumb.Defaults.Anchor || \"Top\");\n this.setAnchor(anchorParamsToUse, true);\n\n // finally, set type if it was provided\n var type = [ \"default\", (params.type || \"\")].join(\" \");\n this.addType(type, params.data, true);\n this.canvas = this.endpoint.canvas;\n this.canvas._jsPlumb = this;\n\n this.initDraggable();\n\n // pulled this out into a function so we can reuse it for the inPlaceCopy canvas; you can now drop detached connections\n // back onto the endpoint you detached it from.\n var _initDropTarget = function (canvas, isTransient, endpoint, referenceEndpoint) {\n\n if (_jp.isDropSupported(this.element)) {\n var dropOptions = params.dropOptions || _jsPlumb.Defaults.DropOptions || _jp.Defaults.DropOptions;\n dropOptions = _jp.extend({}, dropOptions);\n dropOptions.scope = dropOptions.scope || this.scope;\n var dropEvent = _jp.dragEvents.drop,\n overEvent = _jp.dragEvents.over,\n outEvent = _jp.dragEvents.out,\n _ep = this,\n drop = _jsPlumb.EndpointDropHandler({\n getEndpoint: function () {\n return _ep;\n },\n jsPlumb: _jsPlumb,\n enabled: function () {\n return endpoint != null ? endpoint.isEnabled() : true;\n },\n isFull: function () {\n return endpoint.isFull();\n },\n element: this.element,\n elementId: this.elementId,\n isSource: this.isSource,\n isTarget: this.isTarget,\n addClass: function (clazz) {\n _ep.addClass(clazz);\n },\n removeClass: function (clazz) {\n _ep.removeClass(clazz);\n },\n isDropAllowed: function () {\n return _ep.isDropAllowed.apply(_ep, arguments);\n },\n reference:referenceEndpoint,\n isRedrop:function(jpc, dhParams) {\n return jpc.suspendedEndpoint && dhParams.reference && (jpc.suspendedEndpoint.id === dhParams.reference.id);\n }\n });\n\n dropOptions[dropEvent] = _ju.wrap(dropOptions[dropEvent], drop, true);\n dropOptions[overEvent] = _ju.wrap(dropOptions[overEvent], function () {\n var draggable = _jp.getDragObject(arguments),\n id = _jsPlumb.getAttribute(_jp.getElement(draggable), \"dragId\"),\n _jpc = _jsPlumb.getFloatingConnectionFor(id);//_jsPlumb.floatingConnections[id];\n\n if (_jpc != null) {\n var idx = _jsPlumb.getFloatingAnchorIndex(_jpc);\n // here we should fire the 'over' event if we are a target and this is a new connection,\n // or we are the same as the floating endpoint.\n var _cont = (this.isTarget && idx !== 0) || (_jpc.suspendedEndpoint && this.referenceEndpoint && this.referenceEndpoint.id === _jpc.suspendedEndpoint.id);\n if (_cont) {\n var bb = _jsPlumb.checkCondition(\"checkDropAllowed\", {\n sourceEndpoint: _jpc.endpoints[idx],\n targetEndpoint: this,\n connection: _jpc\n });\n this[(bb ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointDropAllowedClass);\n this[(bb ? \"remove\" : \"add\") + \"Class\"](_jsPlumb.endpointDropForbiddenClass);\n _jpc.endpoints[idx].anchor.over(this.anchor, this);\n }\n }\n }.bind(this));\n\n dropOptions[outEvent] = _ju.wrap(dropOptions[outEvent], function () {\n var draggable = _jp.getDragObject(arguments),\n id = draggable == null ? null : _jsPlumb.getAttribute(_jp.getElement(draggable), \"dragId\"),\n _jpc = id ? _jsPlumb.getFloatingConnectionFor(id) : null;\n\n if (_jpc != null) {\n var idx = _jsPlumb.getFloatingAnchorIndex(_jpc);\n var _cont = (this.isTarget && idx !== 0) || (_jpc.suspendedEndpoint && this.referenceEndpoint && this.referenceEndpoint.id === _jpc.suspendedEndpoint.id);\n if (_cont) {\n this.removeClass(_jsPlumb.endpointDropAllowedClass);\n this.removeClass(_jsPlumb.endpointDropForbiddenClass);\n _jpc.endpoints[idx].anchor.out();\n }\n }\n }.bind(this));\n\n _jsPlumb.initDroppable(canvas, dropOptions, \"internal\", isTransient);\n }\n }.bind(this);\n\n // Initialise the endpoint's canvas as a drop target. The drop handler will take care of the logic of whether\n // something can actually be dropped.\n if (!this.anchor.isFloating) {\n _initDropTarget(this.canvas, !(params._transient || this.anchor.isFloating), this, params.reference);\n }\n\n return this;\n };\n\n _ju.extend(_jp.Endpoint, _jp.OverlayCapableJsPlumbUIComponent, {\n\n setVisible: function (v, doNotChangeConnections, doNotNotifyOtherEndpoint) {\n this._jsPlumb.visible = v;\n if (this.canvas) {\n this.canvas.style.display = v ? \"block\" : \"none\";\n }\n this[v ? \"showOverlays\" : \"hideOverlays\"]();\n if (!doNotChangeConnections) {\n for (var i = 0; i < this.connections.length; i++) {\n this.connections[i].setVisible(v);\n if (!doNotNotifyOtherEndpoint) {\n var oIdx = this === this.connections[i].endpoints[0] ? 1 : 0;\n // only change the other endpoint if this is its only connection.\n if (this.connections[i].endpoints[oIdx].connections.length === 1) {\n this.connections[i].endpoints[oIdx].setVisible(v, true, true);\n }\n }\n }\n }\n },\n getAttachedElements: function () {\n return this.connections;\n },\n applyType: function (t, doNotRepaint) {\n this.setPaintStyle(t.endpointStyle || t.paintStyle, doNotRepaint);\n this.setHoverPaintStyle(t.endpointHoverStyle || t.hoverPaintStyle, doNotRepaint);\n if (t.maxConnections != null) {\n this._jsPlumb.maxConnections = t.maxConnections;\n }\n if (t.scope) {\n this.scope = t.scope;\n }\n _jp.extend(this, t, typeParameters);\n if (t.cssClass != null && this.canvas) {\n this._jsPlumb.instance.addClass(this.canvas, t.cssClass);\n }\n _jp.OverlayCapableJsPlumbUIComponent.applyType(this, t);\n },\n isEnabled: function () {\n return this._jsPlumb.enabled;\n },\n setEnabled: function (e) {\n this._jsPlumb.enabled = e;\n },\n cleanup: function () {\n var anchorClass = this._jsPlumb.instance.endpointAnchorClassPrefix + (this._jsPlumb.currentAnchorClass ? \"-\" + this._jsPlumb.currentAnchorClass : \"\");\n _jp.removeClass(this.element, anchorClass);\n this.anchor = null;\n this.endpoint.cleanup(true);\n this.endpoint.destroy();\n this.endpoint = null;\n // drag/drop\n this._jsPlumb.instance.destroyDraggable(this.canvas, \"internal\");\n this._jsPlumb.instance.destroyDroppable(this.canvas, \"internal\");\n },\n setHover: function (h) {\n if (this.endpoint && this._jsPlumb && !this._jsPlumb.instance.isConnectionBeingDragged()) {\n this.endpoint.setHover(h);\n }\n },\n isFull: function () {\n return this._jsPlumb.maxConnections === 0 ? true : !(this.isFloating() || this._jsPlumb.maxConnections < 0 || this.connections.length < this._jsPlumb.maxConnections);\n },\n /**\n * private but needs to be exposed.\n */\n isFloating: function () {\n return this.anchor != null && this.anchor.isFloating;\n },\n isConnectedTo: function (endpoint) {\n var found = false;\n if (endpoint) {\n for (var i = 0; i < this.connections.length; i++) {\n if (this.connections[i].endpoints[1] === endpoint || this.connections[i].endpoints[0] === endpoint) {\n found = true;\n break;\n }\n }\n }\n return found;\n },\n getConnectionCost: function () {\n return this._jsPlumb.connectionCost;\n },\n setConnectionCost: function (c) {\n this._jsPlumb.connectionCost = c;\n },\n areConnectionsDirected: function () {\n return this._jsPlumb.connectionsDirected;\n },\n setConnectionsDirected: function (b) {\n this._jsPlumb.connectionsDirected = b;\n },\n setElementId: function (_elId) {\n this.elementId = _elId;\n this.anchor.elementId = _elId;\n },\n setReferenceElement: function (_el) {\n this.element = _jp.getElement(_el);\n },\n setDragAllowedWhenFull: function (allowed) {\n this.dragAllowedWhenFull = allowed;\n },\n equals: function (endpoint) {\n return this.anchor.equals(endpoint.anchor);\n },\n getUuid: function () {\n return this._jsPlumb.uuid;\n },\n computeAnchor: function (params) {\n return this.anchor.compute(params);\n }\n });\n\n root.jsPlumbInstance.prototype.EndpointDropHandler = function (dhParams) {\n return function (e) {\n\n var _jsPlumb = dhParams.jsPlumb;\n\n // remove the classes that are added dynamically. drop is neither forbidden nor allowed now that\n // the drop is finishing.\n dhParams.removeClass(_jsPlumb.endpointDropAllowedClass);\n dhParams.removeClass(_jsPlumb.endpointDropForbiddenClass);\n\n var originalEvent = _jsPlumb.getDropEvent(arguments),\n draggable = _jsPlumb.getDragObject(arguments),\n id = _jsPlumb.getAttribute(draggable, \"dragId\"),\n elId = _jsPlumb.getAttribute(draggable, \"elId\"),\n scope = _jsPlumb.getAttribute(draggable, \"originalScope\"),\n jpc = _jsPlumb.getFloatingConnectionFor(id);\n\n // if no active connection, bail.\n if (jpc == null) {\n return;\n }\n\n // calculate if this is an existing connection.\n var existingConnection = jpc.suspendedEndpoint != null;\n\n // if suspended endpoint exists but has been cleaned up, bail. This means it's an existing connection\n // that has been detached and will shortly be discarded.\n if (existingConnection && jpc.suspendedEndpoint._jsPlumb == null) {\n return;\n }\n\n // get the drop endpoint. for a normal connection this is just the one that would replace the currently\n // floating endpoint. for a makeTarget this is a new endpoint that is created on drop. But we leave that to\n // the handler to figure out.\n var _ep = dhParams.getEndpoint(jpc);\n\n // If we're not given an endpoint to use, bail.\n if (_ep == null) {\n return;\n }\n\n // if this is a drop back where the connection came from, mark it force reattach and\n // return; the stop handler will reattach. without firing an event.\n if (dhParams.isRedrop(jpc, dhParams)) {\n jpc._forceReattach = true;\n jpc.setHover(false);\n if (dhParams.maybeCleanup) {\n dhParams.maybeCleanup(_ep);\n }\n return;\n }\n\n // ensure we dont bother trying to drop sources on non-source eps, and same for target.\n var idx = _jsPlumb.getFloatingAnchorIndex(jpc);\n if ((idx === 0 && !dhParams.isSource)|| (idx === 1 && !dhParams.isTarget)){\n if (dhParams.maybeCleanup) {\n dhParams.maybeCleanup(_ep);\n }\n return;\n }\n\n if (dhParams.onDrop) {\n dhParams.onDrop(jpc);\n }\n\n // restore the original scope if necessary (issue 57)\n if (scope) {\n _jsPlumb.setDragScope(draggable, scope);\n }\n\n // if the target of the drop is full, fire an event (we abort below)\n // makeTarget: keep.\n var isFull = dhParams.isFull(e);\n if (isFull) {\n _ep.fire(\"maxConnections\", {\n endpoint: this,\n connection: jpc,\n maxConnections: _ep._jsPlumb.maxConnections\n }, originalEvent);\n }\n //\n // if endpoint enabled, not full, and matches the index of the floating endpoint...\n if (!isFull && dhParams.enabled()) {\n var _doContinue = true;\n\n // before testing for beforeDrop, reset the connection's source/target to be the actual DOM elements\n // involved (that is, stash any temporary stuff used for dragging. but we need to keep it around in\n // order that the anchor manager can clean things up properly).\n if (idx === 0) {\n jpc.floatingElement = jpc.source;\n jpc.floatingId = jpc.sourceId;\n jpc.floatingEndpoint = jpc.endpoints[0];\n jpc.floatingIndex = 0;\n jpc.source = dhParams.element;\n jpc.sourceId = dhParams.elementId;\n } else {\n jpc.floatingElement = jpc.target;\n jpc.floatingId = jpc.targetId;\n jpc.floatingEndpoint = jpc.endpoints[1];\n jpc.floatingIndex = 1;\n jpc.target = dhParams.element;\n jpc.targetId = dhParams.elementId;\n }\n\n // if this is an existing connection and detach is not allowed we won't continue. The connection's\n // endpoints have been reinstated; everything is back to how it was.\n if (existingConnection && jpc.suspendedEndpoint.id !== _ep.id) {\n if (!jpc.isDetachAllowed(jpc) || !jpc.endpoints[idx].isDetachAllowed(jpc) || !jpc.suspendedEndpoint.isDetachAllowed(jpc) || !_jsPlumb.checkCondition(\"beforeDetach\", jpc)) {\n _doContinue = false;\n }\n }\n\n// ------------ wrap the execution path in a function so we can support asynchronous beforeDrop\n\n var continueFunction = function (optionalData) {\n // remove this jpc from the current endpoint, which is a floating endpoint that we will\n // subsequently discard.\n jpc.endpoints[idx].detachFromConnection(jpc);\n\n // if there's a suspended endpoint, detach it from the connection.\n if (jpc.suspendedEndpoint) {\n jpc.suspendedEndpoint.detachFromConnection(jpc);\n }\n\n jpc.endpoints[idx] = _ep;\n _ep.addConnection(jpc);\n\n // copy our parameters in to the connection:\n var params = _ep.getParameters();\n for (var aParam in params) {\n jpc.setParameter(aParam, params[aParam]);\n }\n\n if (!existingConnection) {\n // if not an existing connection and\n if (params.draggable) {\n _jsPlumb.initDraggable(this.element, dhParams.dragOptions, \"internal\", _jsPlumb);\n }\n }\n else {\n var suspendedElementId = jpc.suspendedEndpoint.elementId;\n _jsPlumb.fireMoveEvent({\n index: idx,\n originalSourceId: idx === 0 ? suspendedElementId : jpc.sourceId,\n newSourceId: idx === 0 ? _ep.elementId : jpc.sourceId,\n originalTargetId: idx === 1 ? suspendedElementId : jpc.targetId,\n newTargetId: idx === 1 ? _ep.elementId : jpc.targetId,\n originalSourceEndpoint: idx === 0 ? jpc.suspendedEndpoint : jpc.endpoints[0],\n newSourceEndpoint: idx === 0 ? _ep : jpc.endpoints[0],\n originalTargetEndpoint: idx === 1 ? jpc.suspendedEndpoint : jpc.endpoints[1],\n newTargetEndpoint: idx === 1 ? _ep : jpc.endpoints[1],\n connection: jpc\n }, originalEvent);\n }\n\n if (idx === 1) {\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.floatingId, jpc.targetId, jpc);\n }\n else {\n _jsPlumb.anchorManager.sourceChanged(jpc.floatingId, jpc.sourceId, jpc, jpc.source);\n }\n\n // when makeSource has uniqueEndpoint:true, we want to create connections with new endpoints\n // that are subsequently deleted. So makeSource sets `finalEndpoint`, which is the Endpoint to\n // which the connection should be attached. The `detachFromConnection` call below results in the\n // temporary endpoint being cleaned up.\n if (jpc.endpoints[0].finalEndpoint) {\n var _toDelete = jpc.endpoints[0];\n _toDelete.detachFromConnection(jpc);\n jpc.endpoints[0] = jpc.endpoints[0].finalEndpoint;\n jpc.endpoints[0].addConnection(jpc);\n }\n\n // if optionalData was given, merge it onto the connection's data.\n if (_ju.isObject(optionalData)) {\n jpc.mergeData(optionalData);\n }\n // finalise will inform the anchor manager and also add to\n // connectionsByScope if necessary.\n _jsPlumb.finaliseConnection(jpc, null, originalEvent, false);\n jpc.setHover(false);\n\n // SP continuous anchor flush\n _jsPlumb.revalidate(jpc.endpoints[0].element);\n\n }.bind(this);\n\n var dontContinueFunction = function () {\n // otherwise just put it back on the endpoint it was on before the drag.\n if (jpc.suspendedEndpoint) {\n jpc.endpoints[idx] = jpc.suspendedEndpoint;\n jpc.setHover(false);\n jpc._forceDetach = true;\n if (idx === 0) {\n jpc.source = jpc.suspendedEndpoint.element;\n jpc.sourceId = jpc.suspendedEndpoint.elementId;\n } else {\n jpc.target = jpc.suspendedEndpoint.element;\n jpc.targetId = jpc.suspendedEndpoint.elementId;\n }\n jpc.suspendedEndpoint.addConnection(jpc);\n\n // TODO checkSanity\n if (idx === 1) {\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.floatingId, jpc.targetId, jpc);\n }\n else {\n _jsPlumb.anchorManager.sourceChanged(jpc.floatingId, jpc.sourceId, jpc, jpc.source);\n }\n\n _jsPlumb.repaint(jpc.sourceId);\n jpc._forceDetach = false;\n }\n };\n\n// --------------------------------------\n // now check beforeDrop. this will be available only on Endpoints that are setup to\n // have a beforeDrop condition (although, secretly, under the hood all Endpoints and\n // the Connection have them, because they are on jsPlumbUIComponent. shhh!), because\n // it only makes sense to have it on a target endpoint.\n _doContinue = _doContinue && dhParams.isDropAllowed(jpc.sourceId, jpc.targetId, jpc.scope, jpc, _ep);// && jpc.pending;\n\n if (_doContinue) {\n continueFunction(_doContinue);\n return true;\n }\n else {\n dontContinueFunction();\n }\n }\n\n if (dhParams.maybeCleanup) {\n dhParams.maybeCleanup(_ep);\n }\n\n _jsPlumb.currentlyDragging = false;\n };\n };\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the code for Connections.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this,\n _jp = root.jsPlumb,\n _ju = root.jsPlumbUtil;\n\n var makeConnector = function (_jsPlumb, renderMode, connectorName, connectorArgs, forComponent) {\n // first make sure we have a cache for the specified renderer\n _jp.Connectors[renderMode] = _jp.Connectors[renderMode] || {};\n\n // now see if the one we want exists; if not we will try to make it\n if (_jp.Connectors[renderMode][connectorName] == null) {\n\n if (_jp.Connectors[connectorName] == null) {\n if (!_jsPlumb.Defaults.DoNotThrowErrors) {\n throw new TypeError(\"jsPlumb: unknown connector type '\" + connectorName + \"'\");\n } else {\n return null;\n }\n }\n\n _jp.Connectors[renderMode][connectorName] = function() {\n _jp.Connectors[connectorName].apply(this, arguments);\n _jp.ConnectorRenderers[renderMode].apply(this, arguments);\n };\n\n _ju.extend(_jp.Connectors[renderMode][connectorName], [ _jp.Connectors[connectorName], _jp.ConnectorRenderers[renderMode]]);\n\n }\n\n return new _jp.Connectors[renderMode][connectorName](connectorArgs, forComponent);\n },\n _makeAnchor = function (anchorParams, elementId, _jsPlumb) {\n return (anchorParams) ? _jsPlumb.makeAnchor(anchorParams, elementId, _jsPlumb) : null;\n },\n _updateConnectedClass = function (conn, element, _jsPlumb, remove) {\n if (element != null) {\n element._jsPlumbConnections = element._jsPlumbConnections || {};\n if (remove) {\n delete element._jsPlumbConnections[conn.id];\n }\n else {\n element._jsPlumbConnections[conn.id] = true;\n }\n\n if (_ju.isEmpty(element._jsPlumbConnections)) {\n _jsPlumb.removeClass(element, _jsPlumb.connectedClass);\n }\n else {\n _jsPlumb.addClass(element, _jsPlumb.connectedClass);\n }\n }\n };\n\n _jp.Connection = function (params) {\n var _newEndpoint = params.newEndpoint;\n\n this.id = params.id;\n this.connector = null;\n this.idPrefix = \"_jsplumb_c_\";\n this.defaultLabelLocation = 0.5;\n this.defaultOverlayKeys = [\"Overlays\", \"ConnectionOverlays\"];\n // if a new connection is the result of moving some existing connection, params.previousConnection\n // will have that Connection in it. listeners for the jsPlumbConnection event can look for that\n // member and take action if they need to.\n this.previousConnection = params.previousConnection;\n this.source = _jp.getElement(params.source);\n this.target = _jp.getElement(params.target);\n\n\n _jp.OverlayCapableJsPlumbUIComponent.apply(this, arguments);\n\n // sourceEndpoint and targetEndpoint override source/target, if they are present. but \n // source is not overridden if the Endpoint has declared it is not the final target of a connection;\n // instead we use the source that the Endpoint declares will be the final source element.\n if (params.sourceEndpoint) {\n this.source = params.sourceEndpoint.getElement();\n this.sourceId = params.sourceEndpoint.elementId;\n } else {\n this.sourceId = this._jsPlumb.instance.getId(this.source);\n }\n\n if (params.targetEndpoint) {\n this.target = params.targetEndpoint.getElement();\n this.targetId = params.targetEndpoint.elementId;\n } else {\n this.targetId = this._jsPlumb.instance.getId(this.target);\n }\n\n\n this.scope = params.scope; // scope may have been passed in to the connect call. if it wasn't, we will pull it from the source endpoint, after having initialised the endpoints. \n this.endpoints = [];\n this.endpointStyles = [];\n\n var _jsPlumb = this._jsPlumb.instance;\n\n _jsPlumb.manage(this.sourceId, this.source);\n _jsPlumb.manage(this.targetId, this.target);\n\n this._jsPlumb.visible = true;\n\n this._jsPlumb.params = {\n cssClass: params.cssClass,\n container: params.container,\n \"pointer-events\": params[\"pointer-events\"],\n editorParams: params.editorParams,\n overlays: params.overlays\n };\n this._jsPlumb.lastPaintedAt = null;\n\n // listen to mouseover and mouseout events passed from the container delegate.\n this.bind(\"mouseover\", function () {\n this.setHover(true);\n }.bind(this));\n this.bind(\"mouseout\", function () {\n this.setHover(false);\n }.bind(this));\n\n\n// INITIALISATION CODE\n\n this.makeEndpoint = function (isSource, el, elId, ep) {\n elId = elId || this._jsPlumb.instance.getId(el);\n return this.prepareEndpoint(_jsPlumb, _newEndpoint, this, ep, isSource ? 0 : 1, params, el, elId);\n };\n\n // if type given, get the endpoint definitions mapping to that type from the jsplumb instance, and use those.\n // we apply types at the end of this constructor but endpoints are only honoured in a type definition at\n // create time.\n if (params.type) {\n params.endpoints = params.endpoints || this._jsPlumb.instance.deriveEndpointAndAnchorSpec(params.type).endpoints;\n }\n\n var eS = this.makeEndpoint(true, this.source, this.sourceId, params.sourceEndpoint),\n eT = this.makeEndpoint(false, this.target, this.targetId, params.targetEndpoint);\n\n if (eS) {\n _ju.addToList(params.endpointsByElement, this.sourceId, eS);\n }\n if (eT) {\n _ju.addToList(params.endpointsByElement, this.targetId, eT);\n }\n // if scope not set, set it to be the scope for the source endpoint.\n if (!this.scope) {\n this.scope = this.endpoints[0].scope;\n }\n\n // if explicitly told to (or not to) delete endpoints when empty, override endpoint's preferences\n if (params.deleteEndpointsOnEmpty != null) {\n this.endpoints[0].setDeleteOnEmpty(params.deleteEndpointsOnEmpty);\n this.endpoints[1].setDeleteOnEmpty(params.deleteEndpointsOnEmpty);\n }\n\n// -------------------------- DEFAULT TYPE ---------------------------------------------\n\n // DETACHABLE\n var _detachable = _jsPlumb.Defaults.ConnectionsDetachable;\n if (params.detachable === false) {\n _detachable = false;\n }\n if (this.endpoints[0].connectionsDetachable === false) {\n _detachable = false;\n }\n if (this.endpoints[1].connectionsDetachable === false) {\n _detachable = false;\n }\n // REATTACH\n var _reattach = params.reattach || this.endpoints[0].reattachConnections || this.endpoints[1].reattachConnections || _jsPlumb.Defaults.ReattachConnections;\n\n this.appendToDefaultType({\n detachable: _detachable,\n reattach: _reattach,\n paintStyle:this.endpoints[0].connectorStyle || this.endpoints[1].connectorStyle || params.paintStyle || _jsPlumb.Defaults.PaintStyle || _jp.Defaults.PaintStyle,\n hoverPaintStyle:this.endpoints[0].connectorHoverStyle || this.endpoints[1].connectorHoverStyle || params.hoverPaintStyle || _jsPlumb.Defaults.HoverPaintStyle || _jp.Defaults.HoverPaintStyle\n });\n\n var _suspendedAt = _jsPlumb.getSuspendedAt();\n if (!_jsPlumb.isSuspendDrawing()) {\n // paint the endpoints\n var myInfo = _jsPlumb.getCachedData(this.sourceId),\n myOffset = myInfo.o, myWH = myInfo.s,\n otherInfo = _jsPlumb.getCachedData(this.targetId),\n otherOffset = otherInfo.o,\n otherWH = otherInfo.s,\n initialTimestamp = _suspendedAt || _jsPlumb.timestamp(),\n anchorLoc = this.endpoints[0].anchor.compute({\n xy: [ myOffset.left, myOffset.top ], wh: myWH, element: this.endpoints[0],\n elementId: this.endpoints[0].elementId,\n txy: [ otherOffset.left, otherOffset.top ], twh: otherWH, tElement: this.endpoints[1],\n timestamp: initialTimestamp\n });\n\n this.endpoints[0].paint({ anchorLoc: anchorLoc, timestamp: initialTimestamp });\n\n anchorLoc = this.endpoints[1].anchor.compute({\n xy: [ otherOffset.left, otherOffset.top ], wh: otherWH, element: this.endpoints[1],\n elementId: this.endpoints[1].elementId,\n txy: [ myOffset.left, myOffset.top ], twh: myWH, tElement: this.endpoints[0],\n timestamp: initialTimestamp\n });\n this.endpoints[1].paint({ anchorLoc: anchorLoc, timestamp: initialTimestamp });\n }\n\n this.getTypeDescriptor = function () {\n return \"connection\";\n };\n this.getAttachedElements = function () {\n return this.endpoints;\n };\n\n this.isDetachable = function (ep) {\n return this._jsPlumb.detachable === false ? false : ep != null ? ep.connectionsDetachable === true : this._jsPlumb.detachable === true;\n };\n this.setDetachable = function (detachable) {\n this._jsPlumb.detachable = detachable === true;\n };\n this.isReattach = function () {\n return this._jsPlumb.reattach === true || this.endpoints[0].reattachConnections === true || this.endpoints[1].reattachConnections === true;\n };\n this.setReattach = function (reattach) {\n this._jsPlumb.reattach = reattach === true;\n };\n\n// END INITIALISATION CODE\n\n\n// COST + DIRECTIONALITY\n // if cost not supplied, try to inherit from source endpoint\n this._jsPlumb.cost = params.cost || this.endpoints[0].getConnectionCost();\n this._jsPlumb.directed = params.directed;\n // inherit directed flag if set no source endpoint\n if (params.directed == null) {\n this._jsPlumb.directed = this.endpoints[0].areConnectionsDirected();\n }\n// END COST + DIRECTIONALITY\n\n// PARAMETERS\n // merge all the parameters objects into the connection. parameters set\n // on the connection take precedence; then source endpoint params, then\n // finally target endpoint params.\n var _p = _jp.extend({}, this.endpoints[1].getParameters());\n _jp.extend(_p, this.endpoints[0].getParameters());\n _jp.extend(_p, this.getParameters());\n this.setParameters(_p);\n// END PARAMETERS\n\n// PAINTING\n\n this.setConnector(this.endpoints[0].connector || this.endpoints[1].connector || params.connector || _jsPlumb.Defaults.Connector || _jp.Defaults.Connector, true);\n var data = params.data == null || !_ju.isObject(params.data) ? {} : params.data;\n this.getData = function() { return data; };\n this.setData = function(d) { data = d || {}; };\n this.mergeData = function(d) { data = _jp.extend(data, d); };\n\n // the very last thing we do is apply types, if there are any.\n var _types = [ \"default\", this.endpoints[0].connectionType, this.endpoints[1].connectionType, params.type ].join(\" \");\n if (/[^\\s]/.test(_types)) {\n this.addType(_types, params.data, true);\n }\n\n this.updateConnectedClass();\n\n// END PAINTING \n };\n\n _ju.extend(_jp.Connection, _jp.OverlayCapableJsPlumbUIComponent, {\n applyType: function (t, doNotRepaint, typeMap) {\n\n var _connector = null;\n if (t.connector != null) {\n _connector = this.getCachedTypeItem(\"connector\", typeMap.connector);\n if (_connector == null) {\n _connector = this.prepareConnector(t.connector, typeMap.connector);\n this.cacheTypeItem(\"connector\", _connector, typeMap.connector);\n }\n this.setPreparedConnector(_connector);\n }\n\n // none of these things result in the creation of objects so can be ignored.\n if (t.detachable != null) {\n this.setDetachable(t.detachable);\n }\n if (t.reattach != null) {\n this.setReattach(t.reattach);\n }\n if (t.scope) {\n this.scope = t.scope;\n }\n\n if (t.cssClass != null && this.canvas) {\n this._jsPlumb.instance.addClass(this.canvas, t.cssClass);\n }\n\n var _anchors = null;\n // this also results in the creation of objects.\n if (t.anchor) {\n // note that even if the param was anchor, we store `anchors`.\n _anchors = this.getCachedTypeItem(\"anchors\", typeMap.anchor);\n if (_anchors == null) {\n _anchors = [ this._jsPlumb.instance.makeAnchor(t.anchor), this._jsPlumb.instance.makeAnchor(t.anchor) ];\n this.cacheTypeItem(\"anchors\", _anchors, typeMap.anchor);\n }\n }\n else if (t.anchors) {\n _anchors = this.getCachedTypeItem(\"anchors\", typeMap.anchors);\n if (_anchors == null) {\n _anchors = [\n this._jsPlumb.instance.makeAnchor(t.anchors[0]),\n this._jsPlumb.instance.makeAnchor(t.anchors[1])\n ];\n this.cacheTypeItem(\"anchors\", _anchors, typeMap.anchors);\n }\n }\n if (_anchors != null) {\n this.endpoints[0].anchor = _anchors[0];\n this.endpoints[1].anchor = _anchors[1];\n if (this.endpoints[1].anchor.isDynamic) {\n this._jsPlumb.instance.repaint(this.endpoints[1].elementId);\n }\n }\n\n _jp.OverlayCapableJsPlumbUIComponent.applyType(this, t);\n },\n addClass: function (c, informEndpoints) {\n if (informEndpoints) {\n this.endpoints[0].addClass(c);\n this.endpoints[1].addClass(c);\n if (this.suspendedEndpoint) {\n this.suspendedEndpoint.addClass(c);\n }\n }\n if (this.connector) {\n this.connector.addClass(c);\n }\n },\n removeClass: function (c, informEndpoints) {\n if (informEndpoints) {\n this.endpoints[0].removeClass(c);\n this.endpoints[1].removeClass(c);\n if (this.suspendedEndpoint) {\n this.suspendedEndpoint.removeClass(c);\n }\n }\n if (this.connector) {\n this.connector.removeClass(c);\n }\n },\n isVisible: function () {\n return this._jsPlumb.visible;\n },\n setVisible: function (v) {\n this._jsPlumb.visible = v;\n if (this.connector) {\n this.connector.setVisible(v);\n }\n this.repaint();\n },\n cleanup: function () {\n this.updateConnectedClass(true);\n this.endpoints = null;\n this.source = null;\n this.target = null;\n if (this.connector != null) {\n this.connector.cleanup(true);\n this.connector.destroy(true);\n }\n this.connector = null;\n },\n updateConnectedClass:function(remove) {\n if (this._jsPlumb) {\n _updateConnectedClass(this, this.source, this._jsPlumb.instance, remove);\n _updateConnectedClass(this, this.target, this._jsPlumb.instance, remove);\n }\n },\n setHover: function (state) {\n if (this.connector && this._jsPlumb && !this._jsPlumb.instance.isConnectionBeingDragged()) {\n this.connector.setHover(state);\n root.jsPlumb[state ? \"addClass\" : \"removeClass\"](this.source, this._jsPlumb.instance.hoverSourceClass);\n root.jsPlumb[state ? \"addClass\" : \"removeClass\"](this.target, this._jsPlumb.instance.hoverTargetClass);\n }\n },\n getUuids:function() {\n return [ this.endpoints[0].getUuid(), this.endpoints[1].getUuid() ];\n },\n getCost: function () {\n return this._jsPlumb ? this._jsPlumb.cost : -Infinity;\n },\n setCost: function (c) {\n this._jsPlumb.cost = c;\n },\n isDirected: function () {\n return this._jsPlumb.directed;\n },\n getConnector: function () {\n return this.connector;\n },\n prepareConnector:function(connectorSpec, typeId) {\n var connectorArgs = {\n _jsPlumb: this._jsPlumb.instance,\n cssClass: this._jsPlumb.params.cssClass,\n container: this._jsPlumb.params.container,\n \"pointer-events\": this._jsPlumb.params[\"pointer-events\"]\n },\n renderMode = this._jsPlumb.instance.getRenderMode(),\n connector;\n\n if (_ju.isString(connectorSpec)) {\n connector = makeConnector(this._jsPlumb.instance, renderMode, connectorSpec, connectorArgs, this);\n } // lets you use a string as shorthand.\n else if (_ju.isArray(connectorSpec)) {\n if (connectorSpec.length === 1) {\n connector = makeConnector(this._jsPlumb.instance, renderMode, connectorSpec[0], connectorArgs, this);\n }\n else {\n connector = makeConnector(this._jsPlumb.instance, renderMode, connectorSpec[0], _ju.merge(connectorSpec[1], connectorArgs), this);\n }\n }\n if (typeId != null) {\n connector.typeId = typeId;\n }\n return connector;\n },\n setPreparedConnector: function(connector, doNotRepaint, doNotChangeListenerComponent, typeId) {\n\n if (this.connector !== connector) {\n\n var previous, previousClasses = \"\";\n // the connector will not be cleaned up if it was set as part of a type, because `typeId` will be set on it\n // and we havent passed in `true` for \"force\" here.\n if (this.connector != null) {\n previous = this.connector;\n previousClasses = previous.getClass();\n this.connector.cleanup();\n this.connector.destroy();\n }\n\n this.connector = connector;\n if (typeId) {\n this.cacheTypeItem(\"connector\", connector, typeId);\n }\n\n this.canvas = this.connector.canvas;\n this.bgCanvas = this.connector.bgCanvas;\n\n // put classes from prior connector onto the canvas\n this.addClass(previousClasses);\n\n // new: instead of binding listeners per connector, we now just have one delegate on the container.\n // so for that handler we set the connection as the '_jsPlumb' member of the canvas element, and\n // bgCanvas, if it exists, which it does right now in the VML renderer, so it won't from v 2.0.0 onwards.\n if (this.canvas) {\n this.canvas._jsPlumb = this;\n }\n if (this.bgCanvas) {\n this.bgCanvas._jsPlumb = this;\n }\n\n if (previous != null) {\n var o = this.getOverlays();\n for (var i = 0; i < o.length; i++) {\n if (o[i].transfer) {\n o[i].transfer(this.connector);\n }\n }\n }\n\n if (!doNotChangeListenerComponent) {\n this.setListenerComponent(this.connector);\n }\n if (!doNotRepaint) {\n this.repaint();\n }\n }\n },\n setConnector: function (connectorSpec, doNotRepaint, doNotChangeListenerComponent, typeId) {\n var connector = this.prepareConnector(connectorSpec, typeId);\n this.setPreparedConnector(connector, doNotRepaint, doNotChangeListenerComponent, typeId);\n },\n paint: function (params) {\n\n if (!this._jsPlumb.instance.isSuspendDrawing() && this._jsPlumb.visible) {\n params = params || {};\n var timestamp = params.timestamp,\n // if the moving object is not the source we must transpose the two references.\n swap = false,\n tId = swap ? this.sourceId : this.targetId, sId = swap ? this.targetId : this.sourceId,\n tIdx = swap ? 0 : 1, sIdx = swap ? 1 : 0;\n\n if (timestamp == null || timestamp !== this._jsPlumb.lastPaintedAt) {\n var sourceInfo = this._jsPlumb.instance.updateOffset({elId:sId}).o,\n targetInfo = this._jsPlumb.instance.updateOffset({elId:tId}).o,\n sE = this.endpoints[sIdx], tE = this.endpoints[tIdx];\n\n var sAnchorP = sE.anchor.getCurrentLocation({xy: [sourceInfo.left, sourceInfo.top], wh: [sourceInfo.width, sourceInfo.height], element: sE, timestamp: timestamp}),\n tAnchorP = tE.anchor.getCurrentLocation({xy: [targetInfo.left, targetInfo.top], wh: [targetInfo.width, targetInfo.height], element: tE, timestamp: timestamp});\n\n this.connector.resetBounds();\n\n this.connector.compute({\n sourcePos: sAnchorP,\n targetPos: tAnchorP,\n sourceOrientation:sE.anchor.getOrientation(sE),\n targetOrientation:tE.anchor.getOrientation(tE),\n sourceEndpoint: this.endpoints[sIdx],\n targetEndpoint: this.endpoints[tIdx],\n \"stroke-width\": this._jsPlumb.paintStyleInUse.strokeWidth,\n sourceInfo: sourceInfo,\n targetInfo: targetInfo\n });\n\n var overlayExtents = { minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity };\n\n // compute overlays. we do this first so we can get their placements, and adjust the\n // container if needs be (if an overlay would be clipped)\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays.hasOwnProperty(i)) {\n var o = this._jsPlumb.overlays[i];\n if (o.isVisible()) {\n this._jsPlumb.overlayPlacements[i] = o.draw(this.connector, this._jsPlumb.paintStyleInUse, this.getAbsoluteOverlayPosition(o));\n overlayExtents.minX = Math.min(overlayExtents.minX, this._jsPlumb.overlayPlacements[i].minX);\n overlayExtents.maxX = Math.max(overlayExtents.maxX, this._jsPlumb.overlayPlacements[i].maxX);\n overlayExtents.minY = Math.min(overlayExtents.minY, this._jsPlumb.overlayPlacements[i].minY);\n overlayExtents.maxY = Math.max(overlayExtents.maxY, this._jsPlumb.overlayPlacements[i].maxY);\n }\n }\n }\n\n var lineWidth = parseFloat(this._jsPlumb.paintStyleInUse.strokeWidth || 1) / 2,\n outlineWidth = parseFloat(this._jsPlumb.paintStyleInUse.strokeWidth || 0),\n extents = {\n xmin: Math.min(this.connector.bounds.minX - (lineWidth + outlineWidth), overlayExtents.minX),\n ymin: Math.min(this.connector.bounds.minY - (lineWidth + outlineWidth), overlayExtents.minY),\n xmax: Math.max(this.connector.bounds.maxX + (lineWidth + outlineWidth), overlayExtents.maxX),\n ymax: Math.max(this.connector.bounds.maxY + (lineWidth + outlineWidth), overlayExtents.maxY)\n };\n // paint the connector.\n this.connector.paint(this._jsPlumb.paintStyleInUse, null, extents);\n // and then the overlays\n for (var j in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays.hasOwnProperty(j)) {\n var p = this._jsPlumb.overlays[j];\n if (p.isVisible()) {\n p.paint(this._jsPlumb.overlayPlacements[j], extents);\n }\n }\n }\n }\n this._jsPlumb.lastPaintedAt = timestamp;\n }\n },\n repaint: function (params) {\n var p = jsPlumb.extend(params || {}, {});\n p.elId = this.sourceId;\n this.paint(p);\n },\n prepareEndpoint: function (_jsPlumb, _newEndpoint, conn, existing, index, params, element, elementId) {\n var e;\n if (existing) {\n conn.endpoints[index] = existing;\n existing.addConnection(conn);\n } else {\n if (!params.endpoints) {\n params.endpoints = [ null, null ];\n }\n var ep = params.endpoints[index] || params.endpoint || _jsPlumb.Defaults.Endpoints[index] || _jp.Defaults.Endpoints[index] || _jsPlumb.Defaults.Endpoint || _jp.Defaults.Endpoint;\n if (!params.endpointStyles) {\n params.endpointStyles = [ null, null ];\n }\n if (!params.endpointHoverStyles) {\n params.endpointHoverStyles = [ null, null ];\n }\n var es = params.endpointStyles[index] || params.endpointStyle || _jsPlumb.Defaults.EndpointStyles[index] || _jp.Defaults.EndpointStyles[index] || _jsPlumb.Defaults.EndpointStyle || _jp.Defaults.EndpointStyle;\n // Endpoints derive their fill from the connector's stroke, if no fill was specified.\n if (es.fill == null && params.paintStyle != null) {\n es.fill = params.paintStyle.stroke;\n }\n\n if (es.outlineStroke == null && params.paintStyle != null) {\n es.outlineStroke = params.paintStyle.outlineStroke;\n }\n if (es.outlineWidth == null && params.paintStyle != null) {\n es.outlineWidth = params.paintStyle.outlineWidth;\n }\n\n var ehs = params.endpointHoverStyles[index] || params.endpointHoverStyle || _jsPlumb.Defaults.EndpointHoverStyles[index] || _jp.Defaults.EndpointHoverStyles[index] || _jsPlumb.Defaults.EndpointHoverStyle || _jp.Defaults.EndpointHoverStyle;\n // endpoint hover fill style is derived from connector's hover stroke style\n if (params.hoverPaintStyle != null) {\n if (ehs == null) {\n ehs = {};\n }\n if (ehs.fill == null) {\n ehs.fill = params.hoverPaintStyle.stroke;\n }\n }\n var a = params.anchors ? params.anchors[index] :\n params.anchor ? params.anchor :\n _makeAnchor(_jsPlumb.Defaults.Anchors[index], elementId, _jsPlumb) ||\n _makeAnchor(_jp.Defaults.Anchors[index], elementId, _jsPlumb) ||\n _makeAnchor(_jsPlumb.Defaults.Anchor, elementId, _jsPlumb) ||\n _makeAnchor(_jp.Defaults.Anchor, elementId, _jsPlumb),\n u = params.uuids ? params.uuids[index] : null;\n\n e = _newEndpoint({\n paintStyle: es, hoverPaintStyle: ehs, endpoint: ep, connections: [ conn ],\n uuid: u, anchor: a, source: element, scope: params.scope,\n reattach: params.reattach || _jsPlumb.Defaults.ReattachConnections,\n detachable: params.detachable || _jsPlumb.Defaults.ConnectionsDetachable\n });\n if (existing == null) {\n e.setDeleteOnEmpty(true);\n }\n conn.endpoints[index] = e;\n\n if (params.drawEndpoints === false) {\n e.setVisible(false, true, true);\n }\n\n }\n return e;\n }\n\n }); // END Connection class \n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the code for creating and manipulating anchors.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n\n var root = this,\n _ju = root.jsPlumbUtil,\n _jp = root.jsPlumb;\n\n //\n // manages anchors for all elements.\n //\n _jp.AnchorManager = function (params) {\n var _amEndpoints = {},\n continuousAnchorLocations = {},\n continuousAnchorOrientations = {},\n connectionsByElementId = {},\n self = this,\n anchorLists = {},\n jsPlumbInstance = params.jsPlumbInstance,\n floatingConnections = {},\n // used by placeAnchors function\n placeAnchorsOnLine = function (desc, elementDimensions, elementPosition, connections, horizontal, otherMultiplier, reverse) {\n var a = [], step = elementDimensions[horizontal ? 0 : 1] / (connections.length + 1);\n\n for (var i = 0; i < connections.length; i++) {\n var val = (i + 1) * step, other = otherMultiplier * elementDimensions[horizontal ? 1 : 0];\n if (reverse) {\n val = elementDimensions[horizontal ? 0 : 1] - val;\n }\n\n var dx = (horizontal ? val : other), x = elementPosition[0] + dx, xp = dx / elementDimensions[0],\n dy = (horizontal ? other : val), y = elementPosition[1] + dy, yp = dy / elementDimensions[1];\n\n a.push([ x, y, xp, yp, connections[i][1], connections[i][2] ]);\n }\n\n return a;\n },\n // used by edgeSortFunctions\n currySort = function (reverseAngles) {\n return function (a, b) {\n var r = true;\n if (reverseAngles) {\n r = a[0][0] < b[0][0];\n }\n else {\n r = a[0][0] > b[0][0];\n }\n return r === false ? -1 : 1;\n };\n },\n // used by edgeSortFunctions\n leftSort = function (a, b) {\n // first get adjusted values\n var p1 = a[0][0] < 0 ? -Math.PI - a[0][0] : Math.PI - a[0][0],\n p2 = b[0][0] < 0 ? -Math.PI - b[0][0] : Math.PI - b[0][0];\n if (p1 > p2) {\n return 1;\n }\n else {\n return -1;\n }\n },\n // used by placeAnchors\n edgeSortFunctions = {\n \"top\": function (a, b) {\n return a[0] > b[0] ? 1 : -1;\n },\n \"right\": currySort(true),\n \"bottom\": currySort(true),\n \"left\": leftSort\n },\n // used by placeAnchors\n _sortHelper = function (_array, _fn) {\n return _array.sort(_fn);\n },\n // used by AnchorManager.redraw\n placeAnchors = function (elementId, _anchorLists) {\n var cd = jsPlumbInstance.getCachedData(elementId), sS = cd.s, sO = cd.o,\n placeSomeAnchors = function (desc, elementDimensions, elementPosition, unsortedConnections, isHorizontal, otherMultiplier, orientation) {\n if (unsortedConnections.length > 0) {\n var sc = _sortHelper(unsortedConnections, edgeSortFunctions[desc]), // puts them in order based on the target element's pos on screen\n reverse = desc === \"right\" || desc === \"top\",\n anchors = placeAnchorsOnLine(desc, elementDimensions,\n elementPosition, sc,\n isHorizontal, otherMultiplier, reverse);\n\n // takes a computed anchor position and adjusts it for parent offset and scroll, then stores it.\n var _setAnchorLocation = function (endpoint, anchorPos) {\n continuousAnchorLocations[endpoint.id] = [ anchorPos[0], anchorPos[1], anchorPos[2], anchorPos[3] ];\n continuousAnchorOrientations[endpoint.id] = orientation;\n };\n\n for (var i = 0; i < anchors.length; i++) {\n var c = anchors[i][4], weAreSource = c.endpoints[0].elementId === elementId, weAreTarget = c.endpoints[1].elementId === elementId;\n if (weAreSource) {\n _setAnchorLocation(c.endpoints[0], anchors[i]);\n }\n if (weAreTarget) {\n _setAnchorLocation(c.endpoints[1], anchors[i]);\n }\n }\n }\n };\n\n placeSomeAnchors(\"bottom\", sS, [sO.left, sO.top], _anchorLists.bottom, true, 1, [0, 1]);\n placeSomeAnchors(\"top\", sS, [sO.left, sO.top], _anchorLists.top, true, 0, [0, -1]);\n placeSomeAnchors(\"left\", sS, [sO.left, sO.top], _anchorLists.left, false, 0, [-1, 0]);\n placeSomeAnchors(\"right\", sS, [sO.left, sO.top], _anchorLists.right, false, 1, [1, 0]);\n };\n\n this.reset = function () {\n _amEndpoints = {};\n connectionsByElementId = {};\n anchorLists = {};\n };\n this.addFloatingConnection = function (key, conn) {\n floatingConnections[key] = conn;\n };\n this.removeFloatingConnection = function (key) {\n delete floatingConnections[key];\n };\n this.newConnection = function (conn) {\n var sourceId = conn.sourceId, targetId = conn.targetId,\n ep = conn.endpoints,\n doRegisterTarget = true,\n registerConnection = function (otherIndex, otherEndpoint, otherAnchor, elId, c) {\n if ((sourceId === targetId) && otherAnchor.isContinuous) {\n // remove the target endpoint's canvas. we dont need it.\n conn._jsPlumb.instance.removeElement(ep[1].canvas);\n doRegisterTarget = false;\n }\n _ju.addToList(connectionsByElementId, elId, [c, otherEndpoint, otherAnchor.constructor === _jp.DynamicAnchor]);\n };\n\n registerConnection(0, ep[0], ep[0].anchor, targetId, conn);\n if (doRegisterTarget) {\n registerConnection(1, ep[1], ep[1].anchor, sourceId, conn);\n }\n };\n var removeEndpointFromAnchorLists = function (endpoint) {\n (function (list, eId) {\n if (list) { // transient anchors dont get entries in this list.\n var f = function (e) {\n return e[4] === eId;\n };\n _ju.removeWithFunction(list.top, f);\n _ju.removeWithFunction(list.left, f);\n _ju.removeWithFunction(list.bottom, f);\n _ju.removeWithFunction(list.right, f);\n }\n })(anchorLists[endpoint.elementId], endpoint.id);\n };\n this.connectionDetached = function (connInfo, doNotRedraw) {\n var connection = connInfo.connection || connInfo,\n sourceId = connInfo.sourceId,\n targetId = connInfo.targetId,\n ep = connection.endpoints,\n removeConnection = function (otherIndex, otherEndpoint, otherAnchor, elId, c) {\n _ju.removeWithFunction(connectionsByElementId[elId], function (_c) {\n return _c[0].id === c.id;\n });\n };\n\n removeConnection(1, ep[1], ep[1].anchor, sourceId, connection);\n removeConnection(0, ep[0], ep[0].anchor, targetId, connection);\n if (connection.floatingId) {\n removeConnection(connection.floatingIndex, connection.floatingEndpoint, connection.floatingEndpoint.anchor, connection.floatingId, connection);\n removeEndpointFromAnchorLists(connection.floatingEndpoint);\n }\n\n // remove from anchorLists\n removeEndpointFromAnchorLists(connection.endpoints[0]);\n removeEndpointFromAnchorLists(connection.endpoints[1]);\n\n if (!doNotRedraw) {\n self.redraw(connection.sourceId);\n if (connection.targetId !== connection.sourceId) {\n self.redraw(connection.targetId);\n }\n }\n };\n this.add = function (endpoint, elementId) {\n _ju.addToList(_amEndpoints, elementId, endpoint);\n };\n this.changeId = function (oldId, newId) {\n connectionsByElementId[newId] = connectionsByElementId[oldId];\n _amEndpoints[newId] = _amEndpoints[oldId];\n delete connectionsByElementId[oldId];\n delete _amEndpoints[oldId];\n };\n this.getConnectionsFor = function (elementId) {\n return connectionsByElementId[elementId] || [];\n };\n this.getEndpointsFor = function (elementId) {\n return _amEndpoints[elementId] || [];\n };\n this.deleteEndpoint = function (endpoint) {\n _ju.removeWithFunction(_amEndpoints[endpoint.elementId], function (e) {\n return e.id === endpoint.id;\n });\n removeEndpointFromAnchorLists(endpoint);\n };\n this.clearFor = function (elementId) {\n delete _amEndpoints[elementId];\n _amEndpoints[elementId] = [];\n };\n // updates the given anchor list by either updating an existing anchor's info, or adding it. this function\n // also removes the anchor from its previous list, if the edge it is on has changed.\n // all connections found along the way (those that are connected to one of the faces this function\n // operates on) are added to the connsToPaint list, as are their endpoints. in this way we know to repaint\n // them wthout having to calculate anything else about them.\n var _updateAnchorList = function (lists, theta, order, conn, aBoolean, otherElId, idx, reverse, edgeId, elId, connsToPaint, endpointsToPaint) {\n // first try to find the exact match, but keep track of the first index of a matching element id along the way.s\n var exactIdx = -1,\n firstMatchingElIdx = -1,\n endpoint = conn.endpoints[idx],\n endpointId = endpoint.id,\n oIdx = [1, 0][idx],\n values = [\n [ theta, order ],\n conn,\n aBoolean,\n otherElId,\n endpointId\n ],\n listToAddTo = lists[edgeId],\n listToRemoveFrom = endpoint._continuousAnchorEdge ? lists[endpoint._continuousAnchorEdge] : null,\n i,\n candidate;\n\n if (listToRemoveFrom) {\n var rIdx = _ju.findWithFunction(listToRemoveFrom, function (e) {\n return e[4] === endpointId;\n });\n if (rIdx !== -1) {\n listToRemoveFrom.splice(rIdx, 1);\n // get all connections from this list\n for (i = 0; i < listToRemoveFrom.length; i++) {\n candidate = listToRemoveFrom[i][1];\n _ju.addWithFunction(connsToPaint, candidate, function (c) {\n return c.id === candidate.id;\n });\n _ju.addWithFunction(endpointsToPaint, listToRemoveFrom[i][1].endpoints[idx], function (e) {\n return e.id === candidate.endpoints[idx].id;\n });\n _ju.addWithFunction(endpointsToPaint, listToRemoveFrom[i][1].endpoints[oIdx], function (e) {\n return e.id === candidate.endpoints[oIdx].id;\n });\n }\n }\n }\n\n for (i = 0; i < listToAddTo.length; i++) {\n candidate = listToAddTo[i][1];\n if (params.idx === 1 && listToAddTo[i][3] === otherElId && firstMatchingElIdx === -1) {\n firstMatchingElIdx = i;\n }\n _ju.addWithFunction(connsToPaint, candidate, function (c) {\n return c.id === candidate.id;\n });\n _ju.addWithFunction(endpointsToPaint, listToAddTo[i][1].endpoints[idx], function (e) {\n return e.id === candidate.endpoints[idx].id;\n });\n _ju.addWithFunction(endpointsToPaint, listToAddTo[i][1].endpoints[oIdx], function (e) {\n return e.id === candidate.endpoints[oIdx].id;\n });\n }\n if (exactIdx !== -1) {\n listToAddTo[exactIdx] = values;\n }\n else {\n var insertIdx = reverse ? firstMatchingElIdx !== -1 ? firstMatchingElIdx : 0 : listToAddTo.length; // of course we will get this from having looked through the array shortly.\n listToAddTo.splice(insertIdx, 0, values);\n }\n\n // store this for next time.\n endpoint._continuousAnchorEdge = edgeId;\n };\n\n //\n // find the entry in an endpoint's list for this connection and update its target endpoint\n // with the current target in the connection.\n // This method and sourceChanged need to be folder into one.\n //\n this.updateOtherEndpoint = function (sourceElId, oldTargetId, newTargetId, connection) {\n var sIndex = _ju.findWithFunction(connectionsByElementId[sourceElId], function (i) {\n return i[0].id === connection.id;\n }),\n tIndex = _ju.findWithFunction(connectionsByElementId[oldTargetId], function (i) {\n return i[0].id === connection.id;\n });\n\n // update or add data for source\n if (sIndex !== -1) {\n connectionsByElementId[sourceElId][sIndex][0] = connection;\n connectionsByElementId[sourceElId][sIndex][1] = connection.endpoints[1];\n connectionsByElementId[sourceElId][sIndex][2] = connection.endpoints[1].anchor.constructor === _jp.DynamicAnchor;\n }\n\n // remove entry for previous target (if there)\n if (tIndex > -1) {\n connectionsByElementId[oldTargetId].splice(tIndex, 1);\n // add entry for new target\n _ju.addToList(connectionsByElementId, newTargetId, [connection, connection.endpoints[0], connection.endpoints[0].anchor.constructor === _jp.DynamicAnchor]);\n }\n\n connection.updateConnectedClass();\n };\n\n //\n // notification that the connection given has changed source from the originalId to the newId.\n // This involves:\n // 1. removing the connection from the list of connections stored for the originalId\n // 2. updating the source information for the target of the connection\n // 3. re-registering the connection in connectionsByElementId with the newId\n //\n this.sourceChanged = function (originalId, newId, connection, newElement) {\n if (originalId !== newId) {\n\n connection.sourceId = newId;\n connection.source = newElement;\n\n // remove the entry that points from the old source to the target\n _ju.removeWithFunction(connectionsByElementId[originalId], function (info) {\n return info[0].id === connection.id;\n });\n // find entry for target and update it\n var tIdx = _ju.findWithFunction(connectionsByElementId[connection.targetId], function (i) {\n return i[0].id === connection.id;\n });\n if (tIdx > -1) {\n connectionsByElementId[connection.targetId][tIdx][0] = connection;\n connectionsByElementId[connection.targetId][tIdx][1] = connection.endpoints[0];\n connectionsByElementId[connection.targetId][tIdx][2] = connection.endpoints[0].anchor.constructor === _jp.DynamicAnchor;\n }\n // add entry for new source\n _ju.addToList(connectionsByElementId, newId, [connection, connection.endpoints[1], connection.endpoints[1].anchor.constructor === _jp.DynamicAnchor]);\n\n // TODO SP not final on this yet. when a user drags an existing connection and it turns into a self\n // loop, then this code hides the target endpoint (by removing it from the DOM) But I think this should\n // occur only if the anchor is Continuous\n if (connection.endpoints[1].anchor.isContinuous) {\n if (connection.source === connection.target) {\n connection._jsPlumb.instance.removeElement(connection.endpoints[1].canvas);\n }\n else {\n if (connection.endpoints[1].canvas.parentNode == null) {\n connection._jsPlumb.instance.appendElement(connection.endpoints[1].canvas);\n }\n }\n }\n\n connection.updateConnectedClass();\n }\n };\n\n //\n // moves the given endpoint from `currentId` to `element`.\n // This involves:\n //\n // 1. changing the key in _amEndpoints under which the endpoint is stored\n // 2. changing the source or target values in all of the endpoint's connections\n // 3. changing the array in connectionsByElementId in which the endpoint's connections\n // are stored (done by either sourceChanged or updateOtherEndpoint)\n //\n this.rehomeEndpoint = function (ep, currentId, element) {\n var eps = _amEndpoints[currentId] || [],\n elementId = jsPlumbInstance.getId(element);\n\n if (elementId !== currentId) {\n var idx = eps.indexOf(ep);\n if (idx > -1) {\n var _ep = eps.splice(idx, 1)[0];\n self.add(_ep, elementId);\n }\n }\n\n for (var i = 0; i < ep.connections.length; i++) {\n if (ep.connections[i].sourceId === currentId) {\n self.sourceChanged(currentId, ep.elementId, ep.connections[i], ep.element);\n }\n else if (ep.connections[i].targetId === currentId) {\n ep.connections[i].targetId = ep.elementId;\n ep.connections[i].target = ep.element;\n self.updateOtherEndpoint(ep.connections[i].sourceId, currentId, ep.elementId, ep.connections[i]);\n }\n }\n };\n\n this.redraw = function (elementId, ui, timestamp, offsetToUI, clearEdits, doNotRecalcEndpoint) {\n\n if (!jsPlumbInstance.isSuspendDrawing()) {\n // get all the endpoints for this element\n var ep = _amEndpoints[elementId] || [],\n endpointConnections = connectionsByElementId[elementId] || [],\n connectionsToPaint = [],\n endpointsToPaint = [],\n anchorsToUpdate = [];\n\n timestamp = timestamp || jsPlumbInstance.timestamp();\n // offsetToUI are values that would have been calculated in the dragManager when registering\n // an endpoint for an element that had a parent (somewhere in the hierarchy) that had been\n // registered as draggable.\n offsetToUI = offsetToUI || {left: 0, top: 0};\n if (ui) {\n ui = {\n left: ui.left + offsetToUI.left,\n top: ui.top + offsetToUI.top\n };\n }\n\n // valid for one paint cycle.\n var myOffset = jsPlumbInstance.updateOffset({ elId: elementId, offset: ui, recalc: false, timestamp: timestamp }),\n orientationCache = {};\n\n // actually, first we should compute the orientation of this element to all other elements to which\n // this element is connected with a continuous anchor (whether both ends of the connection have\n // a continuous anchor or just one)\n\n for (var i = 0; i < endpointConnections.length; i++) {\n var conn = endpointConnections[i][0],\n sourceId = conn.sourceId,\n targetId = conn.targetId,\n sourceContinuous = conn.endpoints[0].anchor.isContinuous,\n targetContinuous = conn.endpoints[1].anchor.isContinuous;\n\n if (sourceContinuous || targetContinuous) {\n var oKey = sourceId + \"_\" + targetId,\n o = orientationCache[oKey],\n oIdx = conn.sourceId === elementId ? 1 : 0;\n\n if (sourceContinuous && !anchorLists[sourceId]) {\n anchorLists[sourceId] = { top: [], right: [], bottom: [], left: [] };\n }\n if (targetContinuous && !anchorLists[targetId]) {\n anchorLists[targetId] = { top: [], right: [], bottom: [], left: [] };\n }\n\n if (elementId !== targetId) {\n jsPlumbInstance.updateOffset({ elId: targetId, timestamp: timestamp });\n }\n if (elementId !== sourceId) {\n jsPlumbInstance.updateOffset({ elId: sourceId, timestamp: timestamp });\n }\n\n var td = jsPlumbInstance.getCachedData(targetId),\n sd = jsPlumbInstance.getCachedData(sourceId);\n\n if (targetId === sourceId && (sourceContinuous || targetContinuous)) {\n // here we may want to improve this by somehow determining the face we'd like\n // to put the connector on. ideally, when drawing, the face should be calculated\n // by determining which face is closest to the point at which the mouse button\n // was released. for now, we're putting it on the top face.\n _updateAnchorList( anchorLists[sourceId], -Math.PI / 2, 0, conn, false, targetId, 0, false, \"top\", sourceId, connectionsToPaint, endpointsToPaint);\n _updateAnchorList( anchorLists[targetId], -Math.PI / 2, 0, conn, false, sourceId, 1, false, \"top\", targetId, connectionsToPaint, endpointsToPaint);\n }\n else {\n if (!o) {\n o = this.calculateOrientation(sourceId, targetId, sd.o, td.o, conn.endpoints[0].anchor, conn.endpoints[1].anchor, conn);\n orientationCache[oKey] = o;\n // this would be a performance enhancement, but the computed angles need to be clamped to\n //the (-PI/2 -> PI/2) range in order for the sorting to work properly.\n /* orientationCache[oKey2] = {\n orientation:o.orientation,\n a:[o.a[1], o.a[0]],\n theta:o.theta + Math.PI,\n theta2:o.theta2 + Math.PI\n };*/\n }\n if (sourceContinuous) {\n _updateAnchorList(anchorLists[sourceId], o.theta, 0, conn, false, targetId, 0, false, o.a[0], sourceId, connectionsToPaint, endpointsToPaint);\n }\n if (targetContinuous) {\n _updateAnchorList(anchorLists[targetId], o.theta2, -1, conn, true, sourceId, 1, true, o.a[1], targetId, connectionsToPaint, endpointsToPaint);\n }\n }\n\n if (sourceContinuous) {\n _ju.addWithFunction(anchorsToUpdate, sourceId, function (a) {\n return a === sourceId;\n });\n }\n if (targetContinuous) {\n _ju.addWithFunction(anchorsToUpdate, targetId, function (a) {\n return a === targetId;\n });\n }\n _ju.addWithFunction(connectionsToPaint, conn, function (c) {\n return c.id === conn.id;\n });\n if ((sourceContinuous && oIdx === 0) || (targetContinuous && oIdx === 1)) {\n _ju.addWithFunction(endpointsToPaint, conn.endpoints[oIdx], function (e) {\n return e.id === conn.endpoints[oIdx].id;\n });\n }\n }\n }\n\n // place Endpoints whose anchors are continuous but have no Connections\n for (i = 0; i < ep.length; i++) {\n if (ep[i].connections.length === 0 && ep[i].anchor.isContinuous) {\n if (!anchorLists[elementId]) {\n anchorLists[elementId] = { top: [], right: [], bottom: [], left: [] };\n }\n _updateAnchorList(anchorLists[elementId], -Math.PI / 2, 0, {endpoints: [ep[i], ep[i]], paint: function () {\n }}, false, elementId, 0, false, ep[i].anchor.getDefaultFace(), elementId, connectionsToPaint, endpointsToPaint);\n _ju.addWithFunction(anchorsToUpdate, elementId, function (a) {\n return a === elementId;\n });\n }\n }\n\n // now place all the continuous anchors we need to;\n for (i = 0; i < anchorsToUpdate.length; i++) {\n placeAnchors(anchorsToUpdate[i], anchorLists[anchorsToUpdate[i]]);\n }\n\n // now that continuous anchors have been placed, paint all the endpoints for this element\n for (i = 0; i < ep.length; i++) {\n ep[i].paint({ timestamp: timestamp, offset: myOffset, dimensions: myOffset.s, recalc: doNotRecalcEndpoint !== true });\n }\n\n // ... and any other endpoints we came across as a result of the continuous anchors.\n for (i = 0; i < endpointsToPaint.length; i++) {\n var cd = jsPlumbInstance.getCachedData(endpointsToPaint[i].elementId);\n //endpointsToPaint[i].paint({ timestamp: timestamp, offset: cd, dimensions: cd.s });\n endpointsToPaint[i].paint({ timestamp: null, offset: cd, dimensions: cd.s });\n }\n\n // paint all the standard and \"dynamic connections\", which are connections whose other anchor is\n // static and therefore does need to be recomputed; we make sure that happens only one time.\n\n // TODO we could have compiled a list of these in the first pass through connections; might save some time.\n for (i = 0; i < endpointConnections.length; i++) {\n var otherEndpoint = endpointConnections[i][1];\n if (otherEndpoint.anchor.constructor === _jp.DynamicAnchor) {\n otherEndpoint.paint({ elementWithPrecedence: elementId, timestamp: timestamp });\n _ju.addWithFunction(connectionsToPaint, endpointConnections[i][0], function (c) {\n return c.id === endpointConnections[i][0].id;\n });\n // all the connections for the other endpoint now need to be repainted\n for (var k = 0; k < otherEndpoint.connections.length; k++) {\n if (otherEndpoint.connections[k] !== endpointConnections[i][0]) {\n _ju.addWithFunction(connectionsToPaint, otherEndpoint.connections[k], function (c) {\n return c.id === otherEndpoint.connections[k].id;\n });\n }\n }\n } else {\n _ju.addWithFunction(connectionsToPaint, endpointConnections[i][0], function (c) {\n return c.id === endpointConnections[i][0].id;\n });\n }\n }\n\n // paint current floating connection for this element, if there is one.\n var fc = floatingConnections[elementId];\n if (fc) {\n fc.paint({timestamp: timestamp, recalc: false, elId: elementId});\n }\n\n // paint all the connections\n for (i = 0; i < connectionsToPaint.length; i++) {\n connectionsToPaint[i].paint({elId: elementId, timestamp: null, recalc: false, clearEdits: clearEdits});\n }\n }\n };\n\n var ContinuousAnchor = function (anchorParams) {\n _ju.EventGenerator.apply(this);\n this.type = \"Continuous\";\n this.isDynamic = true;\n this.isContinuous = true;\n var faces = anchorParams.faces || [\"top\", \"right\", \"bottom\", \"left\"],\n clockwise = !(anchorParams.clockwise === false),\n availableFaces = { },\n opposites = { \"top\": \"bottom\", \"right\": \"left\", \"left\": \"right\", \"bottom\": \"top\" },\n clockwiseOptions = { \"top\": \"right\", \"right\": \"bottom\", \"left\": \"top\", \"bottom\": \"left\" },\n antiClockwiseOptions = { \"top\": \"left\", \"right\": \"top\", \"left\": \"bottom\", \"bottom\": \"right\" },\n secondBest = clockwise ? clockwiseOptions : antiClockwiseOptions,\n lastChoice = clockwise ? antiClockwiseOptions : clockwiseOptions,\n cssClass = anchorParams.cssClass || \"\",\n _currentFace = null, _lockedFace = null, X_AXIS_FACES = [\"left\", \"right\"], Y_AXIS_FACES = [\"top\", \"bottom\"],\n _lockedAxis = null;\n\n for (var i = 0; i < faces.length; i++) {\n availableFaces[faces[i]] = true;\n }\n\n this.getDefaultFace = function () {\n return faces.length === 0 ? \"top\" : faces[0];\n };\n\n this.isRelocatable = function() { return true; };\n this.isSnapOnRelocate = function() { return true; };\n\n // if the given edge is supported, returns it. otherwise looks for a substitute that _is_\n // supported. if none supported we also return the request edge.\n this.verifyEdge = function (edge) {\n if (availableFaces[edge]) {\n return edge;\n }\n else if (availableFaces[opposites[edge]]) {\n return opposites[edge];\n }\n else if (availableFaces[secondBest[edge]]) {\n return secondBest[edge];\n }\n else if (availableFaces[lastChoice[edge]]) {\n return lastChoice[edge];\n }\n return edge; // we have to give them something.\n };\n\n this.isEdgeSupported = function (edge) {\n return _lockedAxis == null ?\n\n (_lockedFace == null ? availableFaces[edge] === true : _lockedFace === edge)\n\n : _lockedAxis.indexOf(edge) !== -1;\n };\n\n this.setCurrentFace = function(face, overrideLock) {\n _currentFace = face;\n // if currently locked, and the user wants to override, do that.\n if (overrideLock && _lockedFace != null) {\n _lockedFace = _currentFace;\n }\n };\n\n this.getCurrentFace = function() { return _currentFace; };\n this.getSupportedFaces = function() {\n var af = [];\n for (var k in availableFaces) {\n if (availableFaces[k]) {\n af.push(k);\n }\n }\n return af;\n };\n\n this.lock = function() {\n _lockedFace = _currentFace;\n };\n this.unlock = function() {\n _lockedFace = null;\n };\n this.isLocked = function() {\n return _lockedFace != null;\n };\n\n this.lockCurrentAxis = function() {\n if (_currentFace != null) {\n _lockedAxis = (_currentFace === \"left\" || _currentFace === \"right\") ? X_AXIS_FACES : Y_AXIS_FACES;\n }\n };\n\n this.unlockCurrentAxis = function() {\n _lockedAxis = null;\n };\n\n this.compute = function (params) {\n return continuousAnchorLocations[params.element.id] || [0, 0];\n };\n this.getCurrentLocation = function (params) {\n return continuousAnchorLocations[params.element.id] || [0, 0];\n };\n this.getOrientation = function (endpoint) {\n return continuousAnchorOrientations[endpoint.id] || [0, 0];\n };\n this.getCssClass = function () {\n return cssClass;\n };\n };\n\n // continuous anchors\n jsPlumbInstance.continuousAnchorFactory = {\n get: function (params) {\n return new ContinuousAnchor(params);\n },\n clear: function (elementId) {\n delete continuousAnchorLocations[elementId];\n }\n };\n };\n\n _jp.AnchorManager.prototype.calculateOrientation = function (sourceId, targetId, sd, td, sourceAnchor, targetAnchor) {\n\n var Orientation = { HORIZONTAL: \"horizontal\", VERTICAL: \"vertical\", DIAGONAL: \"diagonal\", IDENTITY: \"identity\" },\n axes = [\"left\", \"top\", \"right\", \"bottom\"];\n\n if (sourceId === targetId) {\n return {\n orientation: Orientation.IDENTITY,\n a: [\"top\", \"top\"]\n };\n }\n\n var theta = Math.atan2((td.centery - sd.centery), (td.centerx - sd.centerx)),\n theta2 = Math.atan2((sd.centery - td.centery), (sd.centerx - td.centerx));\n\n// --------------------------------------------------------------------------------------\n\n // improved face calculation. get midpoints of each face for source and target, then put in an array with all combinations of\n // source/target faces. sort this array by distance between midpoints. the entry at index 0 is our preferred option. we can\n // go through the array one by one until we find an entry in which each requested face is supported.\n var candidates = [], midpoints = { };\n (function (types, dim) {\n for (var i = 0; i < types.length; i++) {\n midpoints[types[i]] = {\n \"left\": [ dim[i].left, dim[i].centery ],\n \"right\": [ dim[i].right, dim[i].centery ],\n \"top\": [ dim[i].centerx, dim[i].top ],\n \"bottom\": [ dim[i].centerx , dim[i].bottom]\n };\n }\n })([ \"source\", \"target\" ], [ sd, td ]);\n\n for (var sf = 0; sf < axes.length; sf++) {\n for (var tf = 0; tf < axes.length; tf++) {\n candidates.push({\n source: axes[sf],\n target: axes[tf],\n dist: Biltong.lineLength(midpoints.source[axes[sf]], midpoints.target[axes[tf]])\n });\n }\n }\n\n candidates.sort(function (a, b) {\n return a.dist < b.dist ? -1 : a.dist > b.dist ? 1 : 0;\n });\n\n // now go through this list and try to get an entry that satisfies both (there will be one, unless one of the anchors\n // declares no available faces)\n var sourceEdge = candidates[0].source, targetEdge = candidates[0].target;\n for (var i = 0; i < candidates.length; i++) {\n\n if (!sourceAnchor.isContinuous || sourceAnchor.isEdgeSupported(candidates[i].source)) {\n sourceEdge = candidates[i].source;\n }\n else {\n sourceEdge = null;\n }\n\n if (!targetAnchor.isContinuous || targetAnchor.isEdgeSupported(candidates[i].target)) {\n targetEdge = candidates[i].target;\n }\n else {\n targetEdge = null;\n }\n\n if (sourceEdge != null && targetEdge != null) {\n break;\n }\n }\n\n if (sourceAnchor.isContinuous) {\n sourceAnchor.setCurrentFace(sourceEdge);\n }\n\n if (targetAnchor.isContinuous) {\n targetAnchor.setCurrentFace(targetEdge);\n }\n\n// --------------------------------------------------------------------------------------\n\n return {\n a: [ sourceEdge, targetEdge ],\n theta: theta,\n theta2: theta2\n };\n };\n\n /**\n * Anchors model a position on some element at which an Endpoint may be located. They began as a first class citizen of jsPlumb, ie. a user\n * was required to create these themselves, but over time this has been replaced by the concept of referring to them either by name (eg. \"TopMiddle\"),\n * or by an array describing their coordinates (eg. [ 0, 0.5, 0, -1 ], which is the same as \"TopMiddle\"). jsPlumb now handles all of the\n * creation of Anchors without user intervention.\n */\n _jp.Anchor = function (params) {\n this.x = params.x || 0;\n this.y = params.y || 0;\n this.elementId = params.elementId;\n this.cssClass = params.cssClass || \"\";\n this.userDefinedLocation = null;\n this.orientation = params.orientation || [ 0, 0 ];\n this.lastReturnValue = null;\n this.offsets = params.offsets || [ 0, 0 ];\n this.timestamp = null;\n\n var relocatable = params.relocatable !== false;\n this.isRelocatable = function() { return relocatable; };\n this.setRelocatable = function(_relocatable) { relocatable = _relocatable; };\n var snapOnRelocate = params.snapOnRelocate !== false;\n this.isSnapOnRelocate = function() { return snapOnRelocate; };\n\n var locked = false;\n this.lock = function() { locked = true; };\n this.unlock = function() { locked = false; };\n this.isLocked = function() { return locked; };\n\n _ju.EventGenerator.apply(this);\n\n this.compute = function (params) {\n\n var xy = params.xy, wh = params.wh, timestamp = params.timestamp;\n\n if (params.clearUserDefinedLocation) {\n this.userDefinedLocation = null;\n }\n\n if (timestamp && timestamp === this.timestamp) {\n return this.lastReturnValue;\n }\n\n if (this.userDefinedLocation != null) {\n this.lastReturnValue = this.userDefinedLocation;\n }\n else {\n this.lastReturnValue = [ xy[0] + (this.x * wh[0]) + this.offsets[0], xy[1] + (this.y * wh[1]) + this.offsets[1], this.x, this.y ];\n }\n\n this.timestamp = timestamp;\n return this.lastReturnValue;\n };\n\n this.getCurrentLocation = function (params) {\n params = params || {};\n return (this.lastReturnValue == null || (params.timestamp != null && this.timestamp !== params.timestamp)) ? this.compute(params) : this.lastReturnValue;\n };\n\n this.setPosition = function(x, y, ox, oy, overrideLock) {\n if (!locked || overrideLock) {\n this.x = x;\n this.y = y;\n this.orientation = [ ox, oy ];\n this.lastReturnValue = null;\n }\n };\n };\n _ju.extend(_jp.Anchor, _ju.EventGenerator, {\n equals: function (anchor) {\n if (!anchor) {\n return false;\n }\n var ao = anchor.getOrientation(),\n o = this.getOrientation();\n return this.x === anchor.x && this.y === anchor.y && this.offsets[0] === anchor.offsets[0] && this.offsets[1] === anchor.offsets[1] && o[0] === ao[0] && o[1] === ao[1];\n },\n getUserDefinedLocation: function () {\n return this.userDefinedLocation;\n },\n setUserDefinedLocation: function (l) {\n this.userDefinedLocation = l;\n },\n clearUserDefinedLocation: function () {\n this.userDefinedLocation = null;\n },\n getOrientation: function () {\n return this.orientation;\n },\n getCssClass: function () {\n return this.cssClass;\n }\n });\n\n /**\n * An Anchor that floats. its orientation is computed dynamically from\n * its position relative to the anchor it is floating relative to. It is used when creating\n * a connection through drag and drop.\n *\n * TODO FloatingAnchor could totally be refactored to extend Anchor just slightly.\n */\n _jp.FloatingAnchor = function (params) {\n\n _jp.Anchor.apply(this, arguments);\n\n // this is the anchor that this floating anchor is referenced to for\n // purposes of calculating the orientation.\n var ref = params.reference,\n // the canvas this refers to.\n refCanvas = params.referenceCanvas,\n size = _jp.getSize(refCanvas),\n // these are used to store the current relative position of our\n // anchor wrt the reference anchor. they only indicate\n // direction, so have a value of 1 or -1 (or, very rarely, 0). these\n // values are written by the compute method, and read\n // by the getOrientation method.\n xDir = 0, yDir = 0,\n // temporary member used to store an orientation when the floating\n // anchor is hovering over another anchor.\n orientation = null,\n _lastResult = null;\n\n // clear from parent. we want floating anchor orientation to always be computed.\n this.orientation = null;\n\n // set these to 0 each; they are used by certain types of connectors in the loopback case,\n // when the connector is trying to clear the element it is on. but for floating anchor it's not\n // very important.\n this.x = 0;\n this.y = 0;\n\n this.isFloating = true;\n\n this.compute = function (params) {\n var xy = params.xy,\n result = [ xy[0] + (size[0] / 2), xy[1] + (size[1] / 2) ]; // return origin of the element. we may wish to improve this so that any object can be the drag proxy.\n _lastResult = result;\n return result;\n };\n\n this.getOrientation = function (_endpoint) {\n if (orientation) {\n return orientation;\n }\n else {\n var o = ref.getOrientation(_endpoint);\n // here we take into account the orientation of the other\n // anchor: if it declares zero for some direction, we declare zero too. this might not be the most awesome. perhaps we can come\n // up with a better way. it's just so that the line we draw looks like it makes sense. maybe this wont make sense.\n return [ Math.abs(o[0]) * xDir * -1,\n Math.abs(o[1]) * yDir * -1 ];\n }\n };\n\n /**\n * notification the endpoint associated with this anchor is hovering\n * over another anchor; we want to assume that anchor's orientation\n * for the duration of the hover.\n */\n this.over = function (anchor, endpoint) {\n orientation = anchor.getOrientation(endpoint);\n };\n\n /**\n * notification the endpoint associated with this anchor is no\n * longer hovering over another anchor; we should resume calculating\n * orientation as we normally do.\n */\n this.out = function () {\n orientation = null;\n };\n\n this.getCurrentLocation = function (params) {\n return _lastResult == null ? this.compute(params) : _lastResult;\n };\n };\n _ju.extend(_jp.FloatingAnchor, _jp.Anchor);\n\n var _convertAnchor = function (anchor, jsPlumbInstance, elementId) {\n return anchor.constructor === _jp.Anchor ? anchor : jsPlumbInstance.makeAnchor(anchor, elementId, jsPlumbInstance);\n };\n\n /* \n * A DynamicAnchor is an Anchor that contains a list of other Anchors, which it cycles\n * through at compute time to find the one that is located closest to\n * the center of the target element, and returns that Anchor's compute\n * method result. this causes endpoints to follow each other with\n * respect to the orientation of their target elements, which is a useful\n * feature for some applications.\n * \n */\n _jp.DynamicAnchor = function (params) {\n _jp.Anchor.apply(this, arguments);\n\n this.isDynamic = true;\n this.anchors = [];\n this.elementId = params.elementId;\n this.jsPlumbInstance = params.jsPlumbInstance;\n\n for (var i = 0; i < params.anchors.length; i++) {\n this.anchors[i] = _convertAnchor(params.anchors[i], this.jsPlumbInstance, this.elementId);\n }\n\n this.getAnchors = function () {\n return this.anchors;\n };\n\n var _curAnchor = this.anchors.length > 0 ? this.anchors[0] : null,\n _lastAnchor = _curAnchor,\n self = this,\n\n // helper method to calculate the distance between the centers of the two elements.\n _distance = function (anchor, cx, cy, xy, wh) {\n var ax = xy[0] + (anchor.x * wh[0]), ay = xy[1] + (anchor.y * wh[1]),\n acx = xy[0] + (wh[0] / 2), acy = xy[1] + (wh[1] / 2);\n return (Math.sqrt(Math.pow(cx - ax, 2) + Math.pow(cy - ay, 2)) +\n Math.sqrt(Math.pow(acx - ax, 2) + Math.pow(acy - ay, 2)));\n },\n // default method uses distance between element centers. you can provide your own method in the dynamic anchor\n // constructor (and also to jsPlumb.makeDynamicAnchor). the arguments to it are four arrays:\n // xy - xy loc of the anchor's element\n // wh - anchor's element's dimensions\n // txy - xy loc of the element of the other anchor in the connection\n // twh - dimensions of the element of the other anchor in the connection.\n // anchors - the list of selectable anchors\n _anchorSelector = params.selector || function (xy, wh, txy, twh, anchors) {\n var cx = txy[0] + (twh[0] / 2), cy = txy[1] + (twh[1] / 2);\n var minIdx = -1, minDist = Infinity;\n for (var i = 0; i < anchors.length; i++) {\n var d = _distance(anchors[i], cx, cy, xy, wh);\n if (d < minDist) {\n minIdx = i + 0;\n minDist = d;\n }\n }\n return anchors[minIdx];\n };\n\n this.compute = function (params) {\n var xy = params.xy, wh = params.wh, txy = params.txy, twh = params.twh;\n\n this.timestamp = params.timestamp;\n\n var udl = self.getUserDefinedLocation();\n if (udl != null) {\n return udl;\n }\n\n // if anchor is locked or an opposite element was not given, we\n // maintain our state. anchor will be locked\n // if it is the source of a drag and drop.\n if (this.isLocked() || txy == null || twh == null) {\n return _curAnchor.compute(params);\n }\n else {\n params.timestamp = null; // otherwise clear this, i think. we want the anchor to compute.\n }\n\n _curAnchor = _anchorSelector(xy, wh, txy, twh, this.anchors);\n this.x = _curAnchor.x;\n this.y = _curAnchor.y;\n\n if (_curAnchor !== _lastAnchor) {\n this.fire(\"anchorChanged\", _curAnchor);\n }\n\n _lastAnchor = _curAnchor;\n\n return _curAnchor.compute(params);\n };\n\n this.getCurrentLocation = function (params) {\n return this.getUserDefinedLocation() || (_curAnchor != null ? _curAnchor.getCurrentLocation(params) : null);\n };\n\n this.getOrientation = function (_endpoint) {\n return _curAnchor != null ? _curAnchor.getOrientation(_endpoint) : [ 0, 0 ];\n };\n this.over = function (anchor, endpoint) {\n if (_curAnchor != null) {\n _curAnchor.over(anchor, endpoint);\n }\n };\n this.out = function () {\n if (_curAnchor != null) {\n _curAnchor.out();\n }\n };\n\n this.setAnchor = function(a) {\n _curAnchor = a;\n };\n\n this.getCssClass = function () {\n return (_curAnchor && _curAnchor.getCssClass()) || \"\";\n };\n\n /**\n * Attempt to match an anchor with the given coordinates and then set it.\n * @param coords\n * @returns true if matching anchor found, false otherwise.\n */\n this.setAnchorCoordinates = function(coords) {\n var idx = jsPlumbUtil.findWithFunction(this.anchors, function(a) {\n return a.x === coords[0] && a.y === coords[1];\n });\n if (idx !== -1) {\n this.setAnchor(this.anchors[idx]);\n return true;\n } else {\n return false;\n }\n };\n };\n _ju.extend(_jp.DynamicAnchor, _jp.Anchor);\n\n// -------- basic anchors ------------------ \n var _curryAnchor = function (x, y, ox, oy, type, fnInit) {\n _jp.Anchors[type] = function (params) {\n var a = params.jsPlumbInstance.makeAnchor([ x, y, ox, oy, 0, 0 ], params.elementId, params.jsPlumbInstance);\n a.type = type;\n if (fnInit) {\n fnInit(a, params);\n }\n return a;\n };\n };\n\n _curryAnchor(0.5, 0, 0, -1, \"TopCenter\");\n _curryAnchor(0.5, 1, 0, 1, \"BottomCenter\");\n _curryAnchor(0, 0.5, -1, 0, \"LeftMiddle\");\n _curryAnchor(1, 0.5, 1, 0, \"RightMiddle\");\n\n _curryAnchor(0.5, 0, 0, -1, \"Top\");\n _curryAnchor(0.5, 1, 0, 1, \"Bottom\");\n _curryAnchor(0, 0.5, -1, 0, \"Left\");\n _curryAnchor(1, 0.5, 1, 0, \"Right\");\n _curryAnchor(0.5, 0.5, 0, 0, \"Center\");\n _curryAnchor(1, 0, 0, -1, \"TopRight\");\n _curryAnchor(1, 1, 0, 1, \"BottomRight\");\n _curryAnchor(0, 0, 0, -1, \"TopLeft\");\n _curryAnchor(0, 1, 0, 1, \"BottomLeft\");\n\n// ------- dynamic anchors ------------------- \n\n // default dynamic anchors chooses from Top, Right, Bottom, Left\n _jp.Defaults.DynamicAnchors = function (params) {\n return params.jsPlumbInstance.makeAnchors([\"TopCenter\", \"RightMiddle\", \"BottomCenter\", \"LeftMiddle\"], params.elementId, params.jsPlumbInstance);\n };\n\n // default dynamic anchors bound to name 'AutoDefault'\n _jp.Anchors.AutoDefault = function (params) {\n var a = params.jsPlumbInstance.makeDynamicAnchor(_jp.Defaults.DynamicAnchors(params));\n a.type = \"AutoDefault\";\n return a;\n };\n\n// ------- continuous anchors ------------------- \n\n var _curryContinuousAnchor = function (type, faces) {\n _jp.Anchors[type] = function (params) {\n var a = params.jsPlumbInstance.makeAnchor([\"Continuous\", { faces: faces }], params.elementId, params.jsPlumbInstance);\n a.type = type;\n return a;\n };\n };\n\n _jp.Anchors.Continuous = function (params) {\n return params.jsPlumbInstance.continuousAnchorFactory.get(params);\n };\n\n _curryContinuousAnchor(\"ContinuousLeft\", [\"left\"]);\n _curryContinuousAnchor(\"ContinuousTop\", [\"top\"]);\n _curryContinuousAnchor(\"ContinuousBottom\", [\"bottom\"]);\n _curryContinuousAnchor(\"ContinuousRight\", [\"right\"]);\n\n// ------- position assign anchors ------------------- \n\n // this anchor type lets you assign the position at connection time.\n _curryAnchor(0, 0, 0, 0, \"Assign\", function (anchor, params) {\n // find what to use as the \"position finder\". the user may have supplied a String which represents\n // the id of a position finder in jsPlumb.AnchorPositionFinders, or the user may have supplied the\n // position finder as a function. we find out what to use and then set it on the anchor.\n var pf = params.position || \"Fixed\";\n anchor.positionFinder = pf.constructor === String ? params.jsPlumbInstance.AnchorPositionFinders[pf] : pf;\n // always set the constructor params; the position finder might need them later (the Grid one does,\n // for example)\n anchor.constructorParams = params;\n });\n\n // these are the default anchor positions finders, which are used by the makeTarget function. supplying\n // a position finder argument to that function allows you to specify where the resulting anchor will\n // be located\n root.jsPlumbInstance.prototype.AnchorPositionFinders = {\n \"Fixed\": function (dp, ep, es) {\n return [ (dp.left - ep.left) / es[0], (dp.top - ep.top) / es[1] ];\n },\n \"Grid\": function (dp, ep, es, params) {\n var dx = dp.left - ep.left, dy = dp.top - ep.top,\n gx = es[0] / (params.grid[0]), gy = es[1] / (params.grid[1]),\n mx = Math.floor(dx / gx), my = Math.floor(dy / gy);\n return [ ((mx * gx) + (gx / 2)) / es[0], ((my * gy) + (gy / 2)) / es[1] ];\n }\n };\n\n// ------- perimeter anchors ------------------- \n\n _jp.Anchors.Perimeter = function (params) {\n params = params || {};\n var anchorCount = params.anchorCount || 60,\n shape = params.shape;\n\n if (!shape) {\n throw new Error(\"no shape supplied to Perimeter Anchor type\");\n }\n\n var _circle = function () {\n var r = 0.5, step = Math.PI * 2 / anchorCount, current = 0, a = [];\n for (var i = 0; i < anchorCount; i++) {\n var x = r + (r * Math.sin(current)),\n y = r + (r * Math.cos(current));\n a.push([ x, y, 0, 0 ]);\n current += step;\n }\n return a;\n },\n _path = function (segments) {\n var anchorsPerFace = anchorCount / segments.length, a = [],\n _computeFace = function (x1, y1, x2, y2, fractionalLength) {\n anchorsPerFace = anchorCount * fractionalLength;\n var dx = (x2 - x1) / anchorsPerFace, dy = (y2 - y1) / anchorsPerFace;\n for (var i = 0; i < anchorsPerFace; i++) {\n a.push([\n x1 + (dx * i),\n y1 + (dy * i),\n 0,\n 0\n ]);\n }\n };\n\n for (var i = 0; i < segments.length; i++) {\n _computeFace.apply(null, segments[i]);\n }\n\n return a;\n },\n _shape = function (faces) {\n var s = [];\n for (var i = 0; i < faces.length; i++) {\n s.push([faces[i][0], faces[i][1], faces[i][2], faces[i][3], 1 / faces.length]);\n }\n return _path(s);\n },\n _rectangle = function () {\n return _shape([\n [ 0, 0, 1, 0 ],\n [ 1, 0, 1, 1 ],\n [ 1, 1, 0, 1 ],\n [ 0, 1, 0, 0 ]\n ]);\n };\n\n var _shapes = {\n \"Circle\": _circle,\n \"Ellipse\": _circle,\n \"Diamond\": function () {\n return _shape([\n [ 0.5, 0, 1, 0.5 ],\n [ 1, 0.5, 0.5, 1 ],\n [ 0.5, 1, 0, 0.5 ],\n [ 0, 0.5, 0.5, 0 ]\n ]);\n },\n \"Rectangle\": _rectangle,\n \"Square\": _rectangle,\n \"Triangle\": function () {\n return _shape([\n [ 0.5, 0, 1, 1 ],\n [ 1, 1, 0, 1 ],\n [ 0, 1, 0.5, 0]\n ]);\n },\n \"Path\": function (params) {\n var points = params.points, p = [], tl = 0;\n for (var i = 0; i < points.length - 1; i++) {\n var l = Math.sqrt(Math.pow(points[i][2] - points[i][0]) + Math.pow(points[i][3] - points[i][1]));\n tl += l;\n p.push([points[i][0], points[i][1], points[i + 1][0], points[i + 1][1], l]);\n }\n for (var j = 0; j < p.length; j++) {\n p[j][4] = p[j][4] / tl;\n }\n return _path(p);\n }\n },\n _rotate = function (points, amountInDegrees) {\n var o = [], theta = amountInDegrees / 180 * Math.PI;\n for (var i = 0; i < points.length; i++) {\n var _x = points[i][0] - 0.5,\n _y = points[i][1] - 0.5;\n\n o.push([\n 0.5 + ((_x * Math.cos(theta)) - (_y * Math.sin(theta))),\n 0.5 + ((_x * Math.sin(theta)) + (_y * Math.cos(theta))),\n points[i][2],\n points[i][3]\n ]);\n }\n return o;\n };\n\n if (!_shapes[shape]) {\n throw new Error(\"Shape [\" + shape + \"] is unknown by Perimeter Anchor type\");\n }\n\n var da = _shapes[shape](params);\n if (params.rotation) {\n da = _rotate(da, params.rotation);\n }\n var a = params.jsPlumbInstance.makeDynamicAnchor(da);\n a.type = \"Perimeter\";\n return a;\n };\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the default Connectors, Endpoint and Overlay definitions.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n * \n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil, _jg = root.Biltong;\n\n _jp.Segments = {\n\n /*\n * Class: AbstractSegment\n * A Connector is made up of 1..N Segments, each of which has a Type, such as 'Straight', 'Arc',\n * 'Bezier'. This is new from 1.4.2, and gives us a lot more flexibility when drawing connections: things such\n * as rounded corners for flowchart connectors, for example, or a straight line stub for Bezier connections, are\n * much easier to do now.\n *\n * A Segment is responsible for providing coordinates for painting it, and also must be able to report its length.\n * \n */\n AbstractSegment: function (params) {\n this.params = params;\n\n /**\n * Function: findClosestPointOnPath\n * Finds the closest point on this segment to the given [x, y],\n * returning both the x and y of the point plus its distance from\n * the supplied point, and its location along the length of the\n * path inscribed by the segment. This implementation returns\n * Infinity for distance and null values for everything else;\n * subclasses are expected to override.\n */\n this.findClosestPointOnPath = function (x, y) {\n return {\n d: Infinity,\n x: null,\n y: null,\n l: null\n };\n };\n\n this.getBounds = function () {\n return {\n minX: Math.min(params.x1, params.x2),\n minY: Math.min(params.y1, params.y2),\n maxX: Math.max(params.x1, params.x2),\n maxY: Math.max(params.y1, params.y2)\n };\n };\n\n /**\n * Computes the list of points on the segment that intersect the given line.\n * @method lineIntersection\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @returns {Array<[number, number]>}\n */\n this.lineIntersection = function(x1, y1, x2, y2) {\n return [];\n };\n\n /**\n * Computes the list of points on the segment that intersect the box with the given origin and size.\n * @method boxIntersection\n * @param {number} x1\n * @param {number} y1\n * @param {number} w\n * @param {number} h\n * @returns {Array<[number, number]>}\n */\n this.boxIntersection = function(x, y, w, h) {\n var a = [];\n a.push.apply(a, this.lineIntersection(x, y, x + w, y));\n a.push.apply(a, this.lineIntersection(x + w, y, x + w, y + h));\n a.push.apply(a, this.lineIntersection(x + w, y + h, x, y + h));\n a.push.apply(a, this.lineIntersection(x, y + h, x, y));\n return a;\n };\n\n /**\n * Computes the list of points on the segment that intersect the given bounding box, which is an object of the form { x:.., y:.., w:.., h:.. }.\n * @method lineIntersection\n * @param {BoundingRectangle} box\n * @returns {Array<[number, number]>}\n */\n this.boundingBoxIntersection = function(box) {\n return this.boxIntersection(box.x, box.y, box.w, box.y);\n };\n },\n Straight: function (params) {\n var _super = _jp.Segments.AbstractSegment.apply(this, arguments),\n length, m, m2, x1, x2, y1, y2,\n _recalc = function () {\n length = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n m = _jg.gradient({x: x1, y: y1}, {x: x2, y: y2});\n m2 = -1 / m;\n };\n\n this.type = \"Straight\";\n\n this.getLength = function () {\n return length;\n };\n this.getGradient = function () {\n return m;\n };\n\n this.getCoordinates = function () {\n return { x1: x1, y1: y1, x2: x2, y2: y2 };\n };\n this.setCoordinates = function (coords) {\n x1 = coords.x1;\n y1 = coords.y1;\n x2 = coords.x2;\n y2 = coords.y2;\n _recalc();\n };\n this.setCoordinates({x1: params.x1, y1: params.y1, x2: params.x2, y2: params.y2});\n\n this.getBounds = function () {\n return {\n minX: Math.min(x1, x2),\n minY: Math.min(y1, y2),\n maxX: Math.max(x1, x2),\n maxY: Math.max(y1, y2)\n };\n };\n\n /**\n * returns the point on the segment's path that is 'location' along the length of the path, where 'location' is a decimal from\n * 0 to 1 inclusive. for the straight line segment this is simple maths.\n */\n this.pointOnPath = function (location, absolute) {\n if (location === 0 && !absolute) {\n return { x: x1, y: y1 };\n }\n else if (location === 1 && !absolute) {\n return { x: x2, y: y2 };\n }\n else {\n var l = absolute ? location > 0 ? location : length + location : location * length;\n return _jg.pointOnLine({x: x1, y: y1}, {x: x2, y: y2}, l);\n }\n };\n\n /**\n * returns the gradient of the segment at the given point - which for us is constant.\n */\n this.gradientAtPoint = function (_) {\n return m;\n };\n\n /**\n * returns the point on the segment's path that is 'distance' along the length of the path from 'location', where\n * 'location' is a decimal from 0 to 1 inclusive, and 'distance' is a number of pixels.\n * this hands off to jsPlumbUtil to do the maths, supplying two points and the distance.\n */\n this.pointAlongPathFrom = function (location, distance, absolute) {\n var p = this.pointOnPath(location, absolute),\n farAwayPoint = distance <= 0 ? {x: x1, y: y1} : {x: x2, y: y2 };\n\n /*\n location == 1 ? {\n x:x1 + ((x2 - x1) * 10),\n y:y1 + ((y1 - y2) * 10)\n } :\n */\n\n if (distance <= 0 && Math.abs(distance) > 1) {\n distance *= -1;\n }\n\n return _jg.pointOnLine(p, farAwayPoint, distance);\n };\n\n // is c between a and b?\n var within = function (a, b, c) {\n return c >= Math.min(a, b) && c <= Math.max(a, b);\n };\n // find which of a and b is closest to c\n var closest = function (a, b, c) {\n return Math.abs(c - a) < Math.abs(c - b) ? a : b;\n };\n\n /**\n Function: findClosestPointOnPath\n Finds the closest point on this segment to [x,y]. See\n notes on this method in AbstractSegment.\n */\n this.findClosestPointOnPath = function (x, y) {\n var out = {\n d: Infinity,\n x: null,\n y: null,\n l: null,\n x1: x1,\n x2: x2,\n y1: y1,\n y2: y2\n };\n\n if (m === 0) {\n out.y = y1;\n out.x = within(x1, x2, x) ? x : closest(x1, x2, x);\n }\n else if (m === Infinity || m === -Infinity) {\n out.x = x1;\n out.y = within(y1, y2, y) ? y : closest(y1, y2, y);\n }\n else {\n // closest point lies on normal from given point to this line. \n var b = y1 - (m * x1),\n b2 = y - (m2 * x),\n // y1 = m.x1 + b and y1 = m2.x1 + b2\n // so m.x1 + b = m2.x1 + b2\n // x1(m - m2) = b2 - b\n // x1 = (b2 - b) / (m - m2)\n _x1 = (b2 - b) / (m - m2),\n _y1 = (m * _x1) + b;\n\n out.x = within(x1, x2, _x1) ? _x1 : closest(x1, x2, _x1);//_x1;\n out.y = within(y1, y2, _y1) ? _y1 : closest(y1, y2, _y1);//_y1;\n }\n\n var fractionInSegment = _jg.lineLength([ out.x, out.y ], [ x1, y1 ]);\n out.d = _jg.lineLength([x, y], [out.x, out.y]);\n out.l = fractionInSegment / length;\n return out;\n };\n\n var _pointLiesBetween = function(q, p1, p2) {\n return (p2 > p1) ? (p1 <= q && q <= p2) : (p1 >= q && q >= p2);\n }, _plb = _pointLiesBetween;\n\n /**\n * Calculates all intersections of the given line with this segment.\n * @param _x1\n * @param _y1\n * @param _x2\n * @param _y2\n * @returns {Array}\n */\n this.lineIntersection = function(_x1, _y1, _x2, _y2) {\n var m2 = Math.abs(_jg.gradient({x: _x1, y: _y1}, {x: _x2, y: _y2})),\n m1 = Math.abs(m),\n b = m1 === Infinity ? x1 : y1 - (m1 * x1),\n out = [],\n b2 = m2 === Infinity ? _x1 : _y1 - (m2 * _x1);\n\n // if lines parallel, no intersection\n if (m2 !== m1) {\n // perpendicular, segment horizontal\n if(m2 === Infinity && m1 === 0) {\n if (_plb(_x1, x1, x2) && _plb(y1, _y1, _y2)) {\n out = [ _x1, y1 ]; // we return X on the incident line and Y from the segment\n }\n } else if(m2 === 0 && m1 === Infinity) {\n // perpendicular, segment vertical\n if(_plb(_y1, y1, y2) && _plb(x1, _x1, _x2)) {\n out = [x1, _y1]; // we return X on the segment and Y from the incident line\n }\n } else {\n var X, Y;\n if (m2 === Infinity) {\n // test line is a vertical line. where does it cross the segment?\n X = _x1;\n if (_plb(X, x1, x2)) {\n Y = (m1 * _x1) + b;\n if (_plb(Y, _y1, _y2)) {\n out = [ X, Y ];\n }\n }\n } else if (m2 === 0) {\n Y = _y1;\n // test line is a horizontal line. where does it cross the segment?\n if (_plb(Y, y1, y2)) {\n X = (_y1 - b) / m1;\n if (_plb(X, _x1, _x2)) {\n out = [ X, Y ];\n }\n }\n } else {\n // mX + b = m2X + b2\n // mX - m2X = b2 - b\n // X(m - m2) = b2 - b\n // X = (b2 - b) / (m - m2)\n // Y = mX + b\n X = (b2 - b) / (m1 - m2);\n Y = (m1 * X) + b;\n if(_plb(X, x1, x2) && _plb(Y, y1, y2)) {\n out = [ X, Y];\n }\n }\n }\n }\n\n return out;\n };\n\n /**\n * Calculates all intersections of the given box with this segment. By default this method simply calls `lineIntersection` with each of the four\n * faces of the box; subclasses can override this if they think there's a faster way to compute the entire box at once.\n * @param x X position of top left corner of box\n * @param y Y position of top left corner of box\n * @param w width of box\n * @param h height of box\n * @returns {Array}\n */\n this.boxIntersection = function(x, y, w, h) {\n var a = [];\n a.push.apply(a, this.lineIntersection(x, y, x + w, y));\n a.push.apply(a, this.lineIntersection(x + w, y, x + w, y + h));\n a.push.apply(a, this.lineIntersection(x + w, y + h, x, y + h));\n a.push.apply(a, this.lineIntersection(x, y + h, x, y));\n return a;\n };\n\n /**\n * Calculates all intersections of the given bounding box with this segment. By default this method simply calls `lineIntersection` with each of the four\n * faces of the box; subclasses can override this if they think there's a faster way to compute the entire box at once.\n * @param box Bounding box, in { x:.., y:..., w:..., h:... } format.\n * @returns {Array}\n */\n this.boundingBoxIntersection = function(box) {\n return this.boxIntersection(box.x, box.y, box.w, box.h);\n };\n },\n\n /*\n Arc Segment. You need to supply:\n\n r - radius\n cx - center x for the arc\n cy - center y for the arc\n ac - whether the arc is anticlockwise or not. default is clockwise.\n\n and then either:\n\n startAngle - startAngle for the arc.\n endAngle - endAngle for the arc.\n\n or:\n\n x1 - x for start point\n y1 - y for start point\n x2 - x for end point\n y2 - y for end point\n\n */\n Arc: function (params) {\n var _super = _jp.Segments.AbstractSegment.apply(this, arguments),\n _calcAngle = function (_x, _y) {\n return _jg.theta([params.cx, params.cy], [_x, _y]);\n },\n _calcAngleForLocation = function (segment, location) {\n if (segment.anticlockwise) {\n var sa = segment.startAngle < segment.endAngle ? segment.startAngle + TWO_PI : segment.startAngle,\n s = Math.abs(sa - segment.endAngle);\n return sa - (s * location);\n }\n else {\n var ea = segment.endAngle < segment.startAngle ? segment.endAngle + TWO_PI : segment.endAngle,\n ss = Math.abs(ea - segment.startAngle);\n\n return segment.startAngle + (ss * location);\n }\n },\n TWO_PI = 2 * Math.PI;\n\n this.radius = params.r;\n this.anticlockwise = params.ac;\n this.type = \"Arc\";\n\n if (params.startAngle && params.endAngle) {\n this.startAngle = params.startAngle;\n this.endAngle = params.endAngle;\n this.x1 = params.cx + (this.radius * Math.cos(params.startAngle));\n this.y1 = params.cy + (this.radius * Math.sin(params.startAngle));\n this.x2 = params.cx + (this.radius * Math.cos(params.endAngle));\n this.y2 = params.cy + (this.radius * Math.sin(params.endAngle));\n }\n else {\n this.startAngle = _calcAngle(params.x1, params.y1);\n this.endAngle = _calcAngle(params.x2, params.y2);\n this.x1 = params.x1;\n this.y1 = params.y1;\n this.x2 = params.x2;\n this.y2 = params.y2;\n }\n\n if (this.endAngle < 0) {\n this.endAngle += TWO_PI;\n }\n if (this.startAngle < 0) {\n this.startAngle += TWO_PI;\n }\n\n // segment is used by vml \n //this.segment = _jg.quadrant([this.x1, this.y1], [this.x2, this.y2]);\n\n // we now have startAngle and endAngle as positive numbers, meaning the\n // absolute difference (|d|) between them is the sweep (s) of this arc, unless the\n // arc is 'anticlockwise' in which case 's' is given by 2PI - |d|.\n\n var ea = this.endAngle < this.startAngle ? this.endAngle + TWO_PI : this.endAngle;\n this.sweep = Math.abs(ea - this.startAngle);\n if (this.anticlockwise) {\n this.sweep = TWO_PI - this.sweep;\n }\n var circumference = 2 * Math.PI * this.radius,\n frac = this.sweep / TWO_PI,\n length = circumference * frac;\n\n this.getLength = function () {\n return length;\n };\n\n this.getBounds = function () {\n return {\n minX: params.cx - params.r,\n maxX: params.cx + params.r,\n minY: params.cy - params.r,\n maxY: params.cy + params.r\n };\n };\n\n var VERY_SMALL_VALUE = 0.0000000001,\n gentleRound = function (n) {\n var f = Math.floor(n), r = Math.ceil(n);\n if (n - f < VERY_SMALL_VALUE) {\n return f;\n }\n else if (r - n < VERY_SMALL_VALUE) {\n return r;\n }\n return n;\n };\n\n /**\n * returns the point on the segment's path that is 'location' along the length of the path, where 'location' is a decimal from\n * 0 to 1 inclusive.\n */\n this.pointOnPath = function (location, absolute) {\n\n if (location === 0) {\n return { x: this.x1, y: this.y1, theta: this.startAngle };\n }\n else if (location === 1) {\n return { x: this.x2, y: this.y2, theta: this.endAngle };\n }\n\n if (absolute) {\n location = location / length;\n }\n\n var angle = _calcAngleForLocation(this, location),\n _x = params.cx + (params.r * Math.cos(angle)),\n _y = params.cy + (params.r * Math.sin(angle));\n\n return { x: gentleRound(_x), y: gentleRound(_y), theta: angle };\n };\n\n /**\n * returns the gradient of the segment at the given point.\n */\n this.gradientAtPoint = function (location, absolute) {\n var p = this.pointOnPath(location, absolute);\n var m = _jg.normal([ params.cx, params.cy ], [p.x, p.y ]);\n if (!this.anticlockwise && (m === Infinity || m === -Infinity)) {\n m *= -1;\n }\n return m;\n };\n\n this.pointAlongPathFrom = function (location, distance, absolute) {\n var p = this.pointOnPath(location, absolute),\n arcSpan = distance / circumference * 2 * Math.PI,\n dir = this.anticlockwise ? -1 : 1,\n startAngle = p.theta + (dir * arcSpan),\n startX = params.cx + (this.radius * Math.cos(startAngle)),\n startY = params.cy + (this.radius * Math.sin(startAngle));\n\n return {x: startX, y: startY};\n };\n\n // TODO: lineIntersection\n },\n\n Bezier: function (params) {\n this.curve = [\n { x: params.x1, y: params.y1},\n { x: params.cp1x, y: params.cp1y },\n { x: params.cp2x, y: params.cp2y },\n { x: params.x2, y: params.y2 }\n ];\n\n var _super = _jp.Segments.AbstractSegment.apply(this, arguments);\n // although this is not a strictly rigorous determination of bounds\n // of a bezier curve, it works for the types of curves that this segment\n // type produces.\n this.bounds = {\n minX: Math.min(params.x1, params.x2, params.cp1x, params.cp2x),\n minY: Math.min(params.y1, params.y2, params.cp1y, params.cp2y),\n maxX: Math.max(params.x1, params.x2, params.cp1x, params.cp2x),\n maxY: Math.max(params.y1, params.y2, params.cp1y, params.cp2y)\n };\n\n this.type = \"Bezier\";\n\n var _translateLocation = function (_curve, location, absolute) {\n if (absolute) {\n location = root.jsBezier.locationAlongCurveFrom(_curve, location > 0 ? 0 : 1, location);\n }\n\n return location;\n };\n\n /**\n * returns the point on the segment's path that is 'location' along the length of the path, where 'location' is a decimal from\n * 0 to 1 inclusive.\n */\n this.pointOnPath = function (location, absolute) {\n location = _translateLocation(this.curve, location, absolute);\n return root.jsBezier.pointOnCurve(this.curve, location);\n };\n\n /**\n * returns the gradient of the segment at the given point.\n */\n this.gradientAtPoint = function (location, absolute) {\n location = _translateLocation(this.curve, location, absolute);\n return root.jsBezier.gradientAtPoint(this.curve, location);\n };\n\n this.pointAlongPathFrom = function (location, distance, absolute) {\n location = _translateLocation(this.curve, location, absolute);\n return root.jsBezier.pointAlongCurveFrom(this.curve, location, distance);\n };\n\n this.getLength = function () {\n return root.jsBezier.getLength(this.curve);\n };\n\n this.getBounds = function () {\n return this.bounds;\n };\n\n this.findClosestPointOnPath = function (x, y) {\n var p = root.jsBezier.nearestPointOnCurve({x:x,y:y}, this.curve);\n return {\n d:Math.sqrt(Math.pow(p.point.x - x, 2) + Math.pow(p.point.y - y, 2)),\n x:p.point.x,\n y:p.point.y,\n l:p.location,\n s:this\n };\n };\n\n this.lineIntersection = function(x1, y1, x2, y2) {\n return root.jsBezier.lineIntersection(x1, y1, x2, y2, this.curve);\n };\n }\n };\n\n _jp.SegmentRenderer = {\n getPath: function (segment, isFirstSegment) {\n return ({\n \"Straight\": function (isFirstSegment) {\n var d = segment.getCoordinates();\n return (isFirstSegment ? \"M \" + d.x1 + \" \" + d.y1 + \" \" : \"\") + \"L \" + d.x2 + \" \" + d.y2;\n },\n \"Bezier\": function (isFirstSegment) {\n var d = segment.params;\n return (isFirstSegment ? \"M \" + d.x2 + \" \" + d.y2 + \" \" : \"\") +\n \"C \" + d.cp2x + \" \" + d.cp2y + \" \" + d.cp1x + \" \" + d.cp1y + \" \" + d.x1 + \" \" + d.y1;\n },\n \"Arc\": function (isFirstSegment) {\n var d = segment.params,\n laf = segment.sweep > Math.PI ? 1 : 0,\n sf = segment.anticlockwise ? 0 : 1;\n\n return (isFirstSegment ? \"M\" + segment.x1 + \" \" + segment.y1 + \" \" : \"\") + \"A \" + segment.radius + \" \" + d.r + \" 0 \" + laf + \",\" + sf + \" \" + segment.x2 + \" \" + segment.y2;\n }\n })[segment.type](isFirstSegment);\n }\n };\n\n /*\n Class: UIComponent\n Superclass for Connector and AbstractEndpoint.\n */\n var AbstractComponent = function () {\n this.resetBounds = function () {\n this.bounds = { minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity };\n };\n this.resetBounds();\n };\n\n /*\n * Class: Connector\n * Superclass for all Connectors; here is where Segments are managed. This is exposed on jsPlumb just so it\n * can be accessed from other files. You should not try to instantiate one of these directly.\n *\n * When this class is asked for a pointOnPath, or gradient etc, it must first figure out which segment to dispatch\n * that request to. This is done by keeping track of the total connector length as segments are added, and also\n * their cumulative ratios to the total length. Then when the right segment is found it is a simple case of dispatching\n * the request to it (and adjusting 'location' so that it is relative to the beginning of that segment.)\n */\n _jp.Connectors.AbstractConnector = function (params) {\n\n AbstractComponent.apply(this, arguments);\n\n var segments = [],\n totalLength = 0,\n segmentProportions = [],\n segmentProportionalLengths = [],\n stub = params.stub || 0,\n sourceStub = _ju.isArray(stub) ? stub[0] : stub,\n targetStub = _ju.isArray(stub) ? stub[1] : stub,\n gap = params.gap || 0,\n sourceGap = _ju.isArray(gap) ? gap[0] : gap,\n targetGap = _ju.isArray(gap) ? gap[1] : gap,\n userProvidedSegments = null,\n paintInfo = null;\n\n this.getPathData = function() {\n var p = \"\";\n for (var i = 0; i < segments.length; i++) {\n p += _jp.SegmentRenderer.getPath(segments[i], i === 0);\n p += \" \";\n }\n return p;\n };\n\n /**\n * Function: findSegmentForPoint\n * Returns the segment that is closest to the given [x,y],\n * null if nothing found. This function returns a JS\n * object with:\n *\n * d - distance from segment\n * l - proportional location in segment\n * x - x point on the segment\n * y - y point on the segment\n * s - the segment itself.\n */\n this.findSegmentForPoint = function (x, y) {\n var out = { d: Infinity, s: null, x: null, y: null, l: null };\n for (var i = 0; i < segments.length; i++) {\n var _s = segments[i].findClosestPointOnPath(x, y);\n if (_s.d < out.d) {\n out.d = _s.d;\n out.l = _s.l;\n out.x = _s.x;\n out.y = _s.y;\n out.s = segments[i];\n out.x1 = _s.x1;\n out.x2 = _s.x2;\n out.y1 = _s.y1;\n out.y2 = _s.y2;\n out.index = i;\n }\n }\n\n return out;\n };\n\n this.lineIntersection = function(x1, y1, x2, y2) {\n var out = [];\n for (var i = 0; i < segments.length; i++) {\n out.push.apply(out, segments[i].lineIntersection(x1, y1, x2, y2));\n }\n return out;\n };\n\n this.boxIntersection = function(x, y, w, h) {\n var out = [];\n for (var i = 0; i < segments.length; i++) {\n out.push.apply(out, segments[i].boxIntersection(x, y, w, h));\n }\n return out;\n };\n\n this.boundingBoxIntersection = function(box) {\n var out = [];\n for (var i = 0; i < segments.length; i++) {\n out.push.apply(out, segments[i].boundingBoxIntersection(box));\n }\n return out;\n };\n\n var _updateSegmentProportions = function () {\n var curLoc = 0;\n for (var i = 0; i < segments.length; i++) {\n var sl = segments[i].getLength();\n segmentProportionalLengths[i] = sl / totalLength;\n segmentProportions[i] = [curLoc, (curLoc += (sl / totalLength)) ];\n }\n },\n\n /**\n * returns [segment, proportion of travel in segment, segment index] for the segment\n * that contains the point which is 'location' distance along the entire path, where\n * 'location' is a decimal between 0 and 1 inclusive. in this connector type, paths\n * are made up of a list of segments, each of which contributes some fraction to\n * the total length.\n * From 1.3.10 this also supports the 'absolute' property, which lets us specify a location\n * as the absolute distance in pixels, rather than a proportion of the total path.\n */\n _findSegmentForLocation = function (location, absolute) {\n if (absolute) {\n location = location > 0 ? location / totalLength : (totalLength + location) / totalLength;\n }\n var idx = segmentProportions.length - 1, inSegmentProportion = 1;\n for (var i = 0; i < segmentProportions.length; i++) {\n if (segmentProportions[i][1] >= location) {\n idx = i;\n // todo is this correct for all connector path types?\n inSegmentProportion = location === 1 ? 1 : location === 0 ? 0 : (location - segmentProportions[i][0]) / segmentProportionalLengths[i];\n break;\n }\n }\n return { segment: segments[idx], proportion: inSegmentProportion, index: idx };\n },\n _addSegment = function (conn, type, params) {\n if (params.x1 === params.x2 && params.y1 === params.y2) {\n return;\n }\n var s = new _jp.Segments[type](params);\n segments.push(s);\n totalLength += s.getLength();\n conn.updateBounds(s);\n },\n _clearSegments = function () {\n totalLength = segments.length = segmentProportions.length = segmentProportionalLengths.length = 0;\n };\n\n this.setSegments = function (_segs) {\n userProvidedSegments = [];\n totalLength = 0;\n for (var i = 0; i < _segs.length; i++) {\n userProvidedSegments.push(_segs[i]);\n totalLength += _segs[i].getLength();\n }\n };\n\n this.getLength = function() {\n return totalLength;\n };\n\n var _prepareCompute = function (params) {\n this.strokeWidth = params.strokeWidth;\n var segment = _jg.quadrant(params.sourcePos, params.targetPos),\n swapX = params.targetPos[0] < params.sourcePos[0],\n swapY = params.targetPos[1] < params.sourcePos[1],\n lw = params.strokeWidth || 1,\n so = params.sourceEndpoint.anchor.getOrientation(params.sourceEndpoint),\n to = params.targetEndpoint.anchor.getOrientation(params.targetEndpoint),\n x = swapX ? params.targetPos[0] : params.sourcePos[0],\n y = swapY ? params.targetPos[1] : params.sourcePos[1],\n w = Math.abs(params.targetPos[0] - params.sourcePos[0]),\n h = Math.abs(params.targetPos[1] - params.sourcePos[1]);\n\n // if either anchor does not have an orientation set, we derive one from their relative\n // positions. we fix the axis to be the one in which the two elements are further apart, and\n // point each anchor at the other element. this is also used when dragging a new connection.\n if (so[0] === 0 && so[1] === 0 || to[0] === 0 && to[1] === 0) {\n var index = w > h ? 0 : 1, oIndex = [1, 0][index];\n so = [];\n to = [];\n so[index] = params.sourcePos[index] > params.targetPos[index] ? -1 : 1;\n to[index] = params.sourcePos[index] > params.targetPos[index] ? 1 : -1;\n so[oIndex] = 0;\n to[oIndex] = 0;\n }\n\n var sx = swapX ? w + (sourceGap * so[0]) : sourceGap * so[0],\n sy = swapY ? h + (sourceGap * so[1]) : sourceGap * so[1],\n tx = swapX ? targetGap * to[0] : w + (targetGap * to[0]),\n ty = swapY ? targetGap * to[1] : h + (targetGap * to[1]),\n oProduct = ((so[0] * to[0]) + (so[1] * to[1]));\n\n var result = {\n sx: sx, sy: sy, tx: tx, ty: ty, lw: lw,\n xSpan: Math.abs(tx - sx),\n ySpan: Math.abs(ty - sy),\n mx: (sx + tx) / 2,\n my: (sy + ty) / 2,\n so: so, to: to, x: x, y: y, w: w, h: h,\n segment: segment,\n startStubX: sx + (so[0] * sourceStub),\n startStubY: sy + (so[1] * sourceStub),\n endStubX: tx + (to[0] * targetStub),\n endStubY: ty + (to[1] * targetStub),\n isXGreaterThanStubTimes2: Math.abs(sx - tx) > (sourceStub + targetStub),\n isYGreaterThanStubTimes2: Math.abs(sy - ty) > (sourceStub + targetStub),\n opposite: oProduct === -1,\n perpendicular: oProduct === 0,\n orthogonal: oProduct === 1,\n sourceAxis: so[0] === 0 ? \"y\" : \"x\",\n points: [x, y, w, h, sx, sy, tx, ty ],\n stubs:[sourceStub, targetStub]\n };\n result.anchorOrientation = result.opposite ? \"opposite\" : result.orthogonal ? \"orthogonal\" : \"perpendicular\";\n return result;\n };\n\n this.getSegments = function () {\n return segments;\n };\n\n this.updateBounds = function (segment) {\n var segBounds = segment.getBounds();\n this.bounds.minX = Math.min(this.bounds.minX, segBounds.minX);\n this.bounds.maxX = Math.max(this.bounds.maxX, segBounds.maxX);\n this.bounds.minY = Math.min(this.bounds.minY, segBounds.minY);\n this.bounds.maxY = Math.max(this.bounds.maxY, segBounds.maxY);\n };\n\n var dumpSegmentsToConsole = function () {\n console.log(\"SEGMENTS:\");\n for (var i = 0; i < segments.length; i++) {\n console.log(segments[i].type, segments[i].getLength(), segmentProportions[i]);\n }\n };\n\n this.pointOnPath = function (location, absolute) {\n var seg = _findSegmentForLocation(location, absolute);\n return seg.segment && seg.segment.pointOnPath(seg.proportion, false) || [0, 0];\n };\n\n this.gradientAtPoint = function (location, absolute) {\n var seg = _findSegmentForLocation(location, absolute);\n return seg.segment && seg.segment.gradientAtPoint(seg.proportion, false) || 0;\n };\n\n this.pointAlongPathFrom = function (location, distance, absolute) {\n var seg = _findSegmentForLocation(location, absolute);\n // TODO what happens if this crosses to the next segment?\n return seg.segment && seg.segment.pointAlongPathFrom(seg.proportion, distance, false) || [0, 0];\n };\n\n this.compute = function (params) {\n paintInfo = _prepareCompute.call(this, params);\n\n _clearSegments();\n this._compute(paintInfo, params);\n this.x = paintInfo.points[0];\n this.y = paintInfo.points[1];\n this.w = paintInfo.points[2];\n this.h = paintInfo.points[3];\n this.segment = paintInfo.segment;\n _updateSegmentProportions();\n };\n\n return {\n addSegment: _addSegment,\n prepareCompute: _prepareCompute,\n sourceStub: sourceStub,\n targetStub: targetStub,\n maxStub: Math.max(sourceStub, targetStub),\n sourceGap: sourceGap,\n targetGap: targetGap,\n maxGap: Math.max(sourceGap, targetGap)\n };\n };\n _ju.extend(_jp.Connectors.AbstractConnector, AbstractComponent);\n\n\n // ********************************* END OF CONNECTOR TYPES *******************************************************************\n\n // ********************************* ENDPOINT TYPES *******************************************************************\n\n _jp.Endpoints.AbstractEndpoint = function (params) {\n AbstractComponent.apply(this, arguments);\n var compute = this.compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n var out = this._compute.apply(this, arguments);\n this.x = out[0];\n this.y = out[1];\n this.w = out[2];\n this.h = out[3];\n this.bounds.minX = this.x;\n this.bounds.minY = this.y;\n this.bounds.maxX = this.x + this.w;\n this.bounds.maxY = this.y + this.h;\n return out;\n };\n return {\n compute: compute,\n cssClass: params.cssClass\n };\n };\n _ju.extend(_jp.Endpoints.AbstractEndpoint, AbstractComponent);\n\n /**\n * Class: Endpoints.Dot\n * A round endpoint, with default radius 10 pixels.\n */\n\n /**\n * Function: Constructor\n *\n * Parameters:\n *\n * radius - radius of the endpoint. defaults to 10 pixels.\n */\n _jp.Endpoints.Dot = function (params) {\n this.type = \"Dot\";\n var _super = _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n params = params || {};\n this.radius = params.radius || 10;\n this.defaultOffset = 0.5 * this.radius;\n this.defaultInnerRadius = this.radius / 3;\n\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n this.radius = endpointStyle.radius || this.radius;\n var x = anchorPoint[0] - this.radius,\n y = anchorPoint[1] - this.radius,\n w = this.radius * 2,\n h = this.radius * 2;\n\n if (endpointStyle.stroke) {\n var lw = endpointStyle.strokeWidth || 1;\n x -= lw;\n y -= lw;\n w += (lw * 2);\n h += (lw * 2);\n }\n return [ x, y, w, h, this.radius ];\n };\n };\n _ju.extend(_jp.Endpoints.Dot, _jp.Endpoints.AbstractEndpoint);\n\n _jp.Endpoints.Rectangle = function (params) {\n this.type = \"Rectangle\";\n var _super = _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n params = params || {};\n this.width = params.width || 20;\n this.height = params.height || 20;\n\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n var width = endpointStyle.width || this.width,\n height = endpointStyle.height || this.height,\n x = anchorPoint[0] - (width / 2),\n y = anchorPoint[1] - (height / 2);\n\n return [ x, y, width, height];\n };\n };\n _ju.extend(_jp.Endpoints.Rectangle, _jp.Endpoints.AbstractEndpoint);\n\n var DOMElementEndpoint = function (params) {\n _jp.jsPlumbUIComponent.apply(this, arguments);\n this._jsPlumb.displayElements = [];\n };\n _ju.extend(DOMElementEndpoint, _jp.jsPlumbUIComponent, {\n getDisplayElements: function () {\n return this._jsPlumb.displayElements;\n },\n appendDisplayElement: function (el) {\n this._jsPlumb.displayElements.push(el);\n }\n });\n\n /**\n * Class: Endpoints.Image\n * Draws an image as the Endpoint.\n */\n /**\n * Function: Constructor\n *\n * Parameters:\n *\n * src - location of the image to use.\n\n TODO: multiple references to self. not sure quite how to get rid of them entirely. perhaps self = null in the cleanup\n function will suffice\n\n TODO this class still might leak memory.\n\n */\n _jp.Endpoints.Image = function (params) {\n\n this.type = \"Image\";\n DOMElementEndpoint.apply(this, arguments);\n _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n\n var _onload = params.onload,\n src = params.src || params.url,\n clazz = params.cssClass ? \" \" + params.cssClass : \"\";\n\n this._jsPlumb.img = new Image();\n this._jsPlumb.ready = false;\n this._jsPlumb.initialized = false;\n this._jsPlumb.deleted = false;\n this._jsPlumb.widthToUse = params.width;\n this._jsPlumb.heightToUse = params.height;\n this._jsPlumb.endpoint = params.endpoint;\n\n this._jsPlumb.img.onload = function () {\n if (this._jsPlumb != null) {\n this._jsPlumb.ready = true;\n this._jsPlumb.widthToUse = this._jsPlumb.widthToUse || this._jsPlumb.img.width;\n this._jsPlumb.heightToUse = this._jsPlumb.heightToUse || this._jsPlumb.img.height;\n if (_onload) {\n _onload(this);\n }\n }\n }.bind(this);\n\n /*\n Function: setImage\n Sets the Image to use in this Endpoint.\n\n Parameters:\n img - may be a URL or an Image object\n onload - optional; a callback to execute once the image has loaded.\n */\n this._jsPlumb.endpoint.setImage = function (_img, onload) {\n var s = _img.constructor === String ? _img : _img.src;\n _onload = onload;\n this._jsPlumb.img.src = s;\n\n if (this.canvas != null) {\n this.canvas.setAttribute(\"src\", this._jsPlumb.img.src);\n }\n }.bind(this);\n\n this._jsPlumb.endpoint.setImage(src, _onload);\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n this.anchorPoint = anchorPoint;\n if (this._jsPlumb.ready) {\n return [anchorPoint[0] - this._jsPlumb.widthToUse / 2, anchorPoint[1] - this._jsPlumb.heightToUse / 2,\n this._jsPlumb.widthToUse, this._jsPlumb.heightToUse];\n }\n else {\n return [0, 0, 0, 0];\n }\n };\n\n this.canvas = _jp.createElement(\"img\", {\n position:\"absolute\",\n margin:0,\n padding:0,\n outline:0\n }, this._jsPlumb.instance.endpointClass + clazz);\n\n if (this._jsPlumb.widthToUse) {\n this.canvas.setAttribute(\"width\", this._jsPlumb.widthToUse);\n }\n if (this._jsPlumb.heightToUse) {\n this.canvas.setAttribute(\"height\", this._jsPlumb.heightToUse);\n }\n this._jsPlumb.instance.appendElement(this.canvas);\n\n this.actuallyPaint = function (d, style, anchor) {\n if (!this._jsPlumb.deleted) {\n if (!this._jsPlumb.initialized) {\n this.canvas.setAttribute(\"src\", this._jsPlumb.img.src);\n this.appendDisplayElement(this.canvas);\n this._jsPlumb.initialized = true;\n }\n var x = this.anchorPoint[0] - (this._jsPlumb.widthToUse / 2),\n y = this.anchorPoint[1] - (this._jsPlumb.heightToUse / 2);\n _ju.sizeElement(this.canvas, x, y, this._jsPlumb.widthToUse, this._jsPlumb.heightToUse);\n }\n };\n\n this.paint = function (style, anchor) {\n if (this._jsPlumb != null) { // may have been deleted\n if (this._jsPlumb.ready) {\n this.actuallyPaint(style, anchor);\n }\n else {\n root.setTimeout(function () {\n this.paint(style, anchor);\n }.bind(this), 200);\n }\n }\n };\n };\n _ju.extend(_jp.Endpoints.Image, [ DOMElementEndpoint, _jp.Endpoints.AbstractEndpoint ], {\n cleanup: function (force) {\n if (force) {\n this._jsPlumb.deleted = true;\n if (this.canvas) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n this.canvas = null;\n }\n }\n });\n\n /*\n * Class: Endpoints.Blank\n * An Endpoint that paints nothing (visible) on the screen. Supports cssClass and hoverClass parameters like all Endpoints.\n */\n _jp.Endpoints.Blank = function (params) {\n var _super = _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n this.type = \"Blank\";\n DOMElementEndpoint.apply(this, arguments);\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n return [anchorPoint[0], anchorPoint[1], 10, 0];\n };\n\n var clazz = params.cssClass ? \" \" + params.cssClass : \"\";\n\n this.canvas = _jp.createElement(\"div\", {\n display: \"block\",\n width: \"1px\",\n height: \"1px\",\n background: \"transparent\",\n position: \"absolute\"\n }, this._jsPlumb.instance.endpointClass + clazz);\n\n this._jsPlumb.instance.appendElement(this.canvas);\n\n this.paint = function (style, anchor) {\n _ju.sizeElement(this.canvas, this.x, this.y, this.w, this.h);\n };\n };\n _ju.extend(_jp.Endpoints.Blank, [_jp.Endpoints.AbstractEndpoint, DOMElementEndpoint], {\n cleanup: function () {\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n }\n });\n\n /*\n * Class: Endpoints.Triangle\n * A triangular Endpoint.\n */\n /*\n * Function: Constructor\n *\n * Parameters:\n *\n * width width of the triangle's base. defaults to 55 pixels.\n * height height of the triangle from base to apex. defaults to 55 pixels.\n */\n _jp.Endpoints.Triangle = function (params) {\n this.type = \"Triangle\";\n _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n var self = this;\n params = params || { };\n params.width = params.width || 55;\n params.height = params.height || 55;\n this.width = params.width;\n this.height = params.height;\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n var width = endpointStyle.width || self.width,\n height = endpointStyle.height || self.height,\n x = anchorPoint[0] - (width / 2),\n y = anchorPoint[1] - (height / 2);\n return [ x, y, width, height ];\n };\n };\n// ********************************* END OF ENDPOINT TYPES *******************************************************************\n\n\n// ********************************* OVERLAY DEFINITIONS *********************************************************************** \n\n var AbstractOverlay = _jp.Overlays.AbstractOverlay = function (params) {\n this.visible = true;\n this.isAppendedAtTopLevel = true;\n this.component = params.component;\n this.loc = params.location == null ? 0.5 : params.location;\n this.endpointLoc = params.endpointLocation == null ? [ 0.5, 0.5] : params.endpointLocation;\n this.visible = params.visible !== false;\n };\n AbstractOverlay.prototype = {\n cleanup: function (force) {\n if (force) {\n this.component = null;\n this.canvas = null;\n this.endpointLoc = null;\n }\n },\n reattach:function(instance, component) { },\n setVisible: function (val) {\n this.visible = val;\n this.component.repaint();\n },\n isVisible: function () {\n return this.visible;\n },\n hide: function () {\n this.setVisible(false);\n },\n show: function () {\n this.setVisible(true);\n },\n incrementLocation: function (amount) {\n this.loc += amount;\n this.component.repaint();\n },\n setLocation: function (l) {\n this.loc = l;\n this.component.repaint();\n },\n getLocation: function () {\n return this.loc;\n },\n updateFrom:function() { }\n };\n\n\n /*\n * Class: Overlays.Arrow\n *\n * An arrow overlay, defined by four points: the head, the two sides of the tail, and a 'foldback' point at some distance along the length\n * of the arrow that lines from each tail point converge into. The foldback point is defined using a decimal that indicates some fraction\n * of the length of the arrow and has a default value of 0.623. A foldback point value of 1 would mean that the arrow had a straight line\n * across the tail.\n */\n /*\n * @constructor\n *\n * @param {Object} params Constructor params.\n * @param {Number} [params.length] Distance in pixels from head to tail baseline. default 20.\n * @param {Number} [params.width] Width in pixels of the tail baseline. default 20.\n * @param {String} [params.fill] Style to use when filling the arrow. defaults to \"black\".\n * @param {String} [params.stroke] Style to use when stroking the arrow. defaults to null, which means the arrow is not stroked.\n * @param {Number} [params.stroke-width] Line width to use when stroking the arrow. defaults to 1, but only used if stroke is not null.\n * @param {Number} [params.foldback] Distance (as a decimal from 0 to 1 inclusive) along the length of the arrow marking the point the tail points should fold back to. defaults to 0.623.\n * @param {Number} [params.location] Distance (as a decimal from 0 to 1 inclusive) marking where the arrow should sit on the connector. defaults to 0.5.\n * @param {NUmber} [params.direction] Indicates the direction the arrow points in. valid values are -1 and 1; 1 is default.\n */\n _jp.Overlays.Arrow = function (params) {\n this.type = \"Arrow\";\n AbstractOverlay.apply(this, arguments);\n this.isAppendedAtTopLevel = false;\n params = params || {};\n var self = this;\n\n this.length = params.length || 20;\n this.width = params.width || 20;\n this.id = params.id;\n var direction = (params.direction || 1) < 0 ? -1 : 1,\n paintStyle = params.paintStyle || { \"stroke-width\": 1 },\n // how far along the arrow the lines folding back in come to. default is 62.3%.\n foldback = params.foldback || 0.623;\n\n this.computeMaxSize = function () {\n return self.width * 1.5;\n };\n\n this.elementCreated = function(p, component) {\n this.path = p;\n if (params.events) {\n for (var i in params.events) {\n _jp.on(p, i, params.events[i]);\n }\n }\n };\n\n this.draw = function (component, currentConnectionPaintStyle) {\n\n var hxy, mid, txy, tail, cxy;\n if (component.pointAlongPathFrom) {\n\n if (_ju.isString(this.loc) || this.loc > 1 || this.loc < 0) {\n var l = parseInt(this.loc, 10),\n fromLoc = this.loc < 0 ? 1 : 0;\n hxy = component.pointAlongPathFrom(fromLoc, l, false);\n mid = component.pointAlongPathFrom(fromLoc, l - (direction * this.length / 2), false);\n txy = _jg.pointOnLine(hxy, mid, this.length);\n }\n else if (this.loc === 1) {\n hxy = component.pointOnPath(this.loc);\n mid = component.pointAlongPathFrom(this.loc, -(this.length));\n txy = _jg.pointOnLine(hxy, mid, this.length);\n\n if (direction === -1) {\n var _ = txy;\n txy = hxy;\n hxy = _;\n }\n }\n else if (this.loc === 0) {\n txy = component.pointOnPath(this.loc);\n mid = component.pointAlongPathFrom(this.loc, this.length);\n hxy = _jg.pointOnLine(txy, mid, this.length);\n if (direction === -1) {\n var __ = txy;\n txy = hxy;\n hxy = __;\n }\n }\n else {\n hxy = component.pointAlongPathFrom(this.loc, direction * this.length / 2);\n mid = component.pointOnPath(this.loc);\n txy = _jg.pointOnLine(hxy, mid, this.length);\n }\n\n tail = _jg.perpendicularLineTo(hxy, txy, this.width);\n cxy = _jg.pointOnLine(hxy, txy, foldback * this.length);\n\n var d = { hxy: hxy, tail: tail, cxy: cxy },\n stroke = paintStyle.stroke || currentConnectionPaintStyle.stroke,\n fill = paintStyle.fill || currentConnectionPaintStyle.stroke,\n lineWidth = paintStyle.strokeWidth || currentConnectionPaintStyle.strokeWidth;\n\n return {\n component: component,\n d: d,\n \"stroke-width\": lineWidth,\n stroke: stroke,\n fill: fill,\n minX: Math.min(hxy.x, tail[0].x, tail[1].x),\n maxX: Math.max(hxy.x, tail[0].x, tail[1].x),\n minY: Math.min(hxy.y, tail[0].y, tail[1].y),\n maxY: Math.max(hxy.y, tail[0].y, tail[1].y)\n };\n }\n else {\n return {component: component, minX: 0, maxX: 0, minY: 0, maxY: 0};\n }\n };\n };\n _ju.extend(_jp.Overlays.Arrow, AbstractOverlay, {\n updateFrom:function(d) {\n this.length = d.length || this.length;\n this.width = d.width|| this.width;\n this.direction = d.direction != null ? d.direction : this.direction;\n this.foldback = d.foldback|| this.foldback;\n },\n cleanup:function() {\n if (this.path && this.canvas) {\n this.canvas.removeChild(this.path);\n }\n }\n });\n\n /*\n * Class: Overlays.PlainArrow\n *\n * A basic arrow. This is in fact just one instance of the more generic case in which the tail folds back on itself to some\n * point along the length of the arrow: in this case, that foldback point is the full length of the arrow. so it just does\n * a 'call' to Arrow with foldback set appropriately.\n */\n /*\n * Function: Constructor\n * See for allowed parameters for this overlay.\n */\n _jp.Overlays.PlainArrow = function (params) {\n params = params || {};\n var p = _jp.extend(params, {foldback: 1});\n _jp.Overlays.Arrow.call(this, p);\n this.type = \"PlainArrow\";\n };\n _ju.extend(_jp.Overlays.PlainArrow, _jp.Overlays.Arrow);\n\n /*\n * Class: Overlays.Diamond\n * \n * A diamond. Like PlainArrow, this is a concrete case of the more generic case of the tail points converging on some point...it just\n * happens that in this case, that point is greater than the length of the the arrow.\n *\n * this could probably do with some help with positioning...due to the way it reuses the Arrow paint code, what Arrow thinks is the\n * center is actually 1/4 of the way along for this guy. but we don't have any knowledge of pixels at this point, so we're kind of\n * stuck when it comes to helping out the Arrow class. possibly we could pass in a 'transpose' parameter or something. the value\n * would be -l/4 in this case - move along one quarter of the total length.\n */\n /*\n * Function: Constructor\n * See for allowed parameters for this overlay.\n */\n _jp.Overlays.Diamond = function (params) {\n params = params || {};\n var l = params.length || 40,\n p = _jp.extend(params, {length: l / 2, foldback: 2});\n _jp.Overlays.Arrow.call(this, p);\n this.type = \"Diamond\";\n };\n _ju.extend(_jp.Overlays.Diamond, _jp.Overlays.Arrow);\n\n var _getDimensions = function (component, forceRefresh) {\n if (component._jsPlumb.cachedDimensions == null || forceRefresh) {\n component._jsPlumb.cachedDimensions = component.getDimensions();\n }\n return component._jsPlumb.cachedDimensions;\n };\n\n // abstract superclass for overlays that add an element to the DOM.\n var AbstractDOMOverlay = function (params) {\n _jp.jsPlumbUIComponent.apply(this, arguments);\n AbstractOverlay.apply(this, arguments);\n\n // hand off fired events to associated component.\n var _f = this.fire;\n this.fire = function () {\n _f.apply(this, arguments);\n if (this.component) {\n this.component.fire.apply(this.component, arguments);\n }\n };\n\n this.detached=false;\n this.id = params.id;\n this._jsPlumb.div = null;\n this._jsPlumb.initialised = false;\n this._jsPlumb.component = params.component;\n this._jsPlumb.cachedDimensions = null;\n this._jsPlumb.create = params.create;\n this._jsPlumb.initiallyInvisible = params.visible === false;\n\n this.getElement = function () {\n if (this._jsPlumb.div == null) {\n var div = this._jsPlumb.div = _jp.getElement(this._jsPlumb.create(this._jsPlumb.component));\n div.style.position = \"absolute\";\n jsPlumb.addClass(div, this._jsPlumb.instance.overlayClass + \" \" +\n (this.cssClass ? this.cssClass :\n params.cssClass ? params.cssClass : \"\"));\n this._jsPlumb.instance.appendElement(div);\n this._jsPlumb.instance.getId(div);\n this.canvas = div;\n\n // in IE the top left corner is what it placed at the desired location. This will not\n // be fixed. IE8 is not going to be supported for much longer.\n var ts = \"translate(-50%, -50%)\";\n div.style.webkitTransform = ts;\n div.style.mozTransform = ts;\n div.style.msTransform = ts;\n div.style.oTransform = ts;\n div.style.transform = ts;\n\n // write the related component into the created element\n div._jsPlumb = this;\n\n if (params.visible === false) {\n div.style.display = \"none\";\n }\n }\n return this._jsPlumb.div;\n };\n\n this.draw = function (component, currentConnectionPaintStyle, absolutePosition) {\n var td = _getDimensions(this);\n if (td != null && td.length === 2) {\n var cxy = { x: 0, y: 0 };\n\n // absolutePosition would have been set by a call to connection.setAbsoluteOverlayPosition.\n if (absolutePosition) {\n cxy = { x: absolutePosition[0], y: absolutePosition[1] };\n }\n else if (component.pointOnPath) {\n var loc = this.loc, absolute = false;\n if (_ju.isString(this.loc) || this.loc < 0 || this.loc > 1) {\n loc = parseInt(this.loc, 10);\n absolute = true;\n }\n cxy = component.pointOnPath(loc, absolute); // a connection\n }\n else {\n var locToUse = this.loc.constructor === Array ? this.loc : this.endpointLoc;\n cxy = { x: locToUse[0] * component.w,\n y: locToUse[1] * component.h };\n }\n\n var minx = cxy.x - (td[0] / 2),\n miny = cxy.y - (td[1] / 2);\n\n return {\n component: component,\n d: { minx: minx, miny: miny, td: td, cxy: cxy },\n minX: minx,\n maxX: minx + td[0],\n minY: miny,\n maxY: miny + td[1]\n };\n }\n else {\n return {minX: 0, maxX: 0, minY: 0, maxY: 0};\n }\n };\n };\n _ju.extend(AbstractDOMOverlay, [_jp.jsPlumbUIComponent, AbstractOverlay], {\n getDimensions: function () {\n return [1,1];\n },\n setVisible: function (state) {\n if (this._jsPlumb.div) {\n this._jsPlumb.div.style.display = state ? \"block\" : \"none\";\n // if initially invisible, dimensions are 0,0 and never get updated\n if (state && this._jsPlumb.initiallyInvisible) {\n _getDimensions(this, true);\n this.component.repaint();\n this._jsPlumb.initiallyInvisible = false;\n }\n }\n },\n /*\n * Function: clearCachedDimensions\n * Clears the cached dimensions for the label. As a performance enhancement, label dimensions are\n * cached from 1.3.12 onwards. The cache is cleared when you change the label text, of course, but\n * there are other reasons why the text dimensions might change - if you make a change through CSS, for\n * example, you might change the font size. in that case you should explicitly call this method.\n */\n clearCachedDimensions: function () {\n this._jsPlumb.cachedDimensions = null;\n },\n cleanup: function (force) {\n if (force) {\n if (this._jsPlumb.div != null) {\n this._jsPlumb.div._jsPlumb = null;\n this._jsPlumb.instance.removeElement(this._jsPlumb.div);\n }\n }\n else {\n // if not a forced cleanup, just detach child from parent for now.\n if (this._jsPlumb && this._jsPlumb.div && this._jsPlumb.div.parentNode) {\n this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div);\n }\n this.detached = true;\n }\n\n },\n reattach:function(instance, component) {\n if (this._jsPlumb.div != null) {\n instance.getContainer().appendChild(this._jsPlumb.div);\n }\n this.detached = false;\n },\n computeMaxSize: function () {\n var td = _getDimensions(this);\n return Math.max(td[0], td[1]);\n },\n paint: function (p, containerExtents) {\n if (!this._jsPlumb.initialised) {\n this.getElement();\n p.component.appendDisplayElement(this._jsPlumb.div);\n this._jsPlumb.initialised = true;\n if (this.detached) {\n this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div);\n }\n }\n this._jsPlumb.div.style.left = (p.component.x + p.d.minx) + \"px\";\n this._jsPlumb.div.style.top = (p.component.y + p.d.miny) + \"px\";\n }\n });\n\n /*\n * Class: Overlays.Custom\n * A Custom overlay. You supply a 'create' function which returns some DOM element, and jsPlumb positions it.\n * The 'create' function is passed a Connection or Endpoint.\n */\n /*\n * Function: Constructor\n * \n * Parameters:\n * create - function for jsPlumb to call that returns a DOM element.\n * location - distance (as a decimal from 0 to 1 inclusive) marking where the label should sit on the connector. defaults to 0.5.\n * id - optional id to use for later retrieval of this overlay.\n *\n */\n _jp.Overlays.Custom = function (params) {\n this.type = \"Custom\";\n AbstractDOMOverlay.apply(this, arguments);\n };\n _ju.extend(_jp.Overlays.Custom, AbstractDOMOverlay);\n\n _jp.Overlays.GuideLines = function () {\n var self = this;\n self.length = 50;\n self.strokeWidth = 5;\n this.type = \"GuideLines\";\n AbstractOverlay.apply(this, arguments);\n _jp.jsPlumbUIComponent.apply(this, arguments);\n this.draw = function (connector, currentConnectionPaintStyle) {\n\n var head = connector.pointAlongPathFrom(self.loc, self.length / 2),\n mid = connector.pointOnPath(self.loc),\n tail = _jg.pointOnLine(head, mid, self.length),\n tailLine = _jg.perpendicularLineTo(head, tail, 40),\n headLine = _jg.perpendicularLineTo(tail, head, 20);\n\n return {\n connector: connector,\n head: head,\n tail: tail,\n headLine: headLine,\n tailLine: tailLine,\n minX: Math.min(head.x, tail.x, headLine[0].x, headLine[1].x),\n minY: Math.min(head.y, tail.y, headLine[0].y, headLine[1].y),\n maxX: Math.max(head.x, tail.x, headLine[0].x, headLine[1].x),\n maxY: Math.max(head.y, tail.y, headLine[0].y, headLine[1].y)\n };\n };\n\n // this.cleanup = function() { }; // nothing to clean up for GuideLines\n };\n\n /*\n * Class: Overlays.Label\n\n */\n /*\n * Function: Constructor\n * \n * Parameters:\n * cssClass - optional css class string to append to css class. This string is appended \"as-is\", so you can of course have multiple classes\n * defined. This parameter is preferred to using labelStyle, borderWidth and borderStyle.\n * label - the label to paint. May be a string or a function that returns a string. Nothing will be painted if your label is null or your\n * label function returns null. empty strings _will_ be painted.\n * location - distance (as a decimal from 0 to 1 inclusive) marking where the label should sit on the connector. defaults to 0.5.\n * id - optional id to use for later retrieval of this overlay.\n * \n *\n */\n _jp.Overlays.Label = function (params) {\n this.labelStyle = params.labelStyle;\n\n var labelWidth = null, labelHeight = null, labelText = null, labelPadding = null;\n this.cssClass = this.labelStyle != null ? this.labelStyle.cssClass : null;\n var p = _jp.extend({\n create: function () {\n return _jp.createElement(\"div\");\n }}, params);\n _jp.Overlays.Custom.call(this, p);\n this.type = \"Label\";\n this.label = params.label || \"\";\n this.labelText = null;\n if (this.labelStyle) {\n var el = this.getElement();\n this.labelStyle.font = this.labelStyle.font || \"12px sans-serif\";\n el.style.font = this.labelStyle.font;\n el.style.color = this.labelStyle.color || \"black\";\n if (this.labelStyle.fill) {\n el.style.background = this.labelStyle.fill;\n }\n if (this.labelStyle.borderWidth > 0) {\n var dStyle = this.labelStyle.borderStyle ? this.labelStyle.borderStyle : \"black\";\n el.style.border = this.labelStyle.borderWidth + \"px solid \" + dStyle;\n }\n if (this.labelStyle.padding) {\n el.style.padding = this.labelStyle.padding;\n }\n }\n\n };\n _ju.extend(_jp.Overlays.Label, _jp.Overlays.Custom, {\n cleanup: function (force) {\n if (force) {\n this.div = null;\n this.label = null;\n this.labelText = null;\n this.cssClass = null;\n this.labelStyle = null;\n }\n },\n getLabel: function () {\n return this.label;\n },\n /*\n * Function: setLabel\n * sets the label's, um, label. you would think i'd call this function\n * 'setText', but you can pass either a Function or a String to this, so\n * it makes more sense as 'setLabel'. This uses innerHTML on the label div, so keep\n * that in mind if you need escaped HTML.\n */\n setLabel: function (l) {\n this.label = l;\n this.labelText = null;\n this.clearCachedDimensions();\n this.update();\n this.component.repaint();\n },\n getDimensions: function () {\n this.update();\n return AbstractDOMOverlay.prototype.getDimensions.apply(this, arguments);\n },\n update: function () {\n if (typeof this.label === \"function\") {\n var lt = this.label(this);\n this.getElement().innerHTML = lt.replace(/\\r\\n/g, \"
\");\n }\n else {\n if (this.labelText == null) {\n this.labelText = this.label;\n this.getElement().innerHTML = this.labelText.replace(/\\r\\n/g, \"
\");\n }\n }\n },\n updateFrom:function(d) {\n if(d.label != null){\n this.setLabel(d.label);\n }\n }\n });\n\n // ********************************* END OF OVERLAY DEFINITIONS ***********************************************************************\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function() {\n \"use strict\";\n\n var root = this,\n _ju = root.jsPlumbUtil,\n _jpi = root.jsPlumbInstance;\n\n var GROUP_COLLAPSED_CLASS = \"jtk-group-collapsed\";\n var GROUP_EXPANDED_CLASS = \"jtk-group-expanded\";\n var GROUP_CONTAINER_SELECTOR = \"[jtk-group-content]\";\n var ELEMENT_DRAGGABLE_EVENT = \"elementDraggable\";\n var STOP = \"stop\";\n var REVERT = \"revert\";\n var GROUP_MANAGER = \"_groupManager\";\n var GROUP = \"_jsPlumbGroup\";\n var GROUP_DRAG_SCOPE = \"_jsPlumbGroupDrag\";\n var EVT_CHILD_ADDED = \"group:addMember\";\n var EVT_CHILD_REMOVED = \"group:removeMember\";\n var EVT_GROUP_ADDED = \"group:add\";\n var EVT_GROUP_REMOVED = \"group:remove\";\n var EVT_EXPAND = \"group:expand\";\n var EVT_COLLAPSE = \"group:collapse\";\n var EVT_GROUP_DRAG_STOP = \"groupDragStop\";\n var EVT_CONNECTION_MOVED = \"connectionMoved\";\n var EVT_INTERNAL_CONNECTION_DETACHED = \"internal.connectionDetached\";\n\n var CMD_REMOVE_ALL = \"removeAll\";\n var CMD_ORPHAN_ALL = \"orphanAll\";\n var CMD_SHOW = \"show\";\n var CMD_HIDE = \"hide\";\n\n var GroupManager = function(_jsPlumb) {\n var _managedGroups = {}, _connectionSourceMap = {}, _connectionTargetMap = {}, self = this;\n\n _jsPlumb.bind(\"connection\", function(p) {\n if (p.source[GROUP] != null && p.target[GROUP] != null && p.source[GROUP] === p.target[GROUP]) {\n _connectionSourceMap[p.connection.id] = p.source[GROUP];\n _connectionTargetMap[p.connection.id] = p.source[GROUP];\n }\n else {\n if (p.source[GROUP] != null) {\n _ju.suggest(p.source[GROUP].connections.source, p.connection);\n _connectionSourceMap[p.connection.id] = p.source[GROUP];\n }\n if (p.target[GROUP] != null) {\n _ju.suggest(p.target[GROUP].connections.target, p.connection);\n _connectionTargetMap[p.connection.id] = p.target[GROUP];\n }\n }\n });\n\n function _cleanupDetachedConnection(conn) {\n delete conn.proxies;\n var group = _connectionSourceMap[conn.id], f;\n if (group != null) {\n f = function(c) { return c.id === conn.id; };\n _ju.removeWithFunction(group.connections.source, f);\n _ju.removeWithFunction(group.connections.target, f);\n delete _connectionSourceMap[conn.id];\n }\n\n group = _connectionTargetMap[conn.id];\n if (group != null) {\n f = function(c) { return c.id === conn.id; };\n _ju.removeWithFunction(group.connections.source, f);\n _ju.removeWithFunction(group.connections.target, f);\n delete _connectionTargetMap[conn.id];\n }\n }\n\n _jsPlumb.bind(EVT_INTERNAL_CONNECTION_DETACHED, function(p) {\n _cleanupDetachedConnection(p.connection);\n });\n\n _jsPlumb.bind(EVT_CONNECTION_MOVED, function(p) {\n var connMap = p.index === 0 ? _connectionSourceMap : _connectionTargetMap;\n var group = connMap[p.connection.id];\n if (group) {\n var list = group.connections[p.index === 0 ? \"source\" : \"target\"];\n var idx = list.indexOf(p.connection);\n if (idx !== -1) {\n list.splice(idx, 1);\n }\n }\n });\n\n this.addGroup = function(group) {\n _jsPlumb.addClass(group.getEl(), GROUP_EXPANDED_CLASS);\n _managedGroups[group.id] = group;\n group.manager = this;\n _updateConnectionsForGroup(group);\n _jsPlumb.fire(EVT_GROUP_ADDED, { group:group });\n };\n\n this.addToGroup = function(group, el, doNotFireEvent) {\n group = this.getGroup(group);\n if (group) {\n var groupEl = group.getEl();\n\n if (el._isJsPlumbGroup) {\n return;\n }\n var currentGroup = el._jsPlumbGroup;\n // if already a member of this group, do nothing\n if (currentGroup !== group) {\n var elpos = _jsPlumb.getOffset(el, true);\n var cpos = group.collapsed ? _jsPlumb.getOffset(groupEl, true) : _jsPlumb.getOffset(group.getDragArea(), true);\n\n // otherwise, transfer to this group.\n if (currentGroup != null) {\n currentGroup.remove(el, false, doNotFireEvent, false, group);\n self.updateConnectionsForGroup(currentGroup);\n }\n group.add(el, doNotFireEvent/*, currentGroup*/);\n\n var handleDroppedConnections = function (list, index) {\n var oidx = index === 0 ? 1 : 0;\n list.each(function (c) {\n c.setVisible(false);\n if (c.endpoints[oidx].element._jsPlumbGroup === group) {\n c.endpoints[oidx].setVisible(false);\n self.expandConnection(c, oidx, group);\n }\n else {\n c.endpoints[index].setVisible(false);\n self.collapseConnection(c, index, group);\n }\n });\n };\n\n if (group.collapsed) {\n handleDroppedConnections(_jsPlumb.select({source: el}), 0);\n handleDroppedConnections(_jsPlumb.select({target: el}), 1);\n }\n\n var elId = _jsPlumb.getId(el);\n _jsPlumb.dragManager.setParent(el, elId, groupEl, _jsPlumb.getId(groupEl), elpos);\n\n var newPosition = { left: elpos.left - cpos.left, top: elpos.top - cpos.top };\n\n _jsPlumb.setPosition(el, newPosition);\n\n _jsPlumb.dragManager.revalidateParent(el, elId, elpos);\n\n self.updateConnectionsForGroup(group);\n\n _jsPlumb.revalidate(elId);\n\n if (!doNotFireEvent) {\n var p = {group: group, el: el};\n if (currentGroup) {\n p.sourceGroup = currentGroup;\n }\n _jsPlumb.fire(EVT_CHILD_ADDED, p);\n }\n }\n }\n };\n\n this.removeFromGroup = function(group, el, doNotFireEvent) {\n group = this.getGroup(group);\n if (group) {\n group.remove(el, null, doNotFireEvent);\n }\n };\n\n this.getGroup = function(groupId) {\n var group = groupId;\n if (_ju.isString(groupId)) {\n group = _managedGroups[groupId];\n if (group == null) {\n throw new TypeError(\"No such group [\" + groupId + \"]\");\n }\n }\n return group;\n };\n\n this.getGroups = function() {\n var o = [];\n for (var g in _managedGroups) {\n o.push(_managedGroups[g]);\n }\n return o;\n };\n\n this.removeGroup = function(group, deleteMembers, manipulateDOM, doNotFireEvent) {\n group = this.getGroup(group);\n this.expandGroup(group, true); // this reinstates any original connections and removes all proxies, but does not fire an event.\n var newPositions = group[deleteMembers ? CMD_REMOVE_ALL : CMD_ORPHAN_ALL](manipulateDOM, doNotFireEvent);\n _jsPlumb.remove(group.getEl());\n delete _managedGroups[group.id];\n delete _jsPlumb._groups[group.id];\n _jsPlumb.fire(EVT_GROUP_REMOVED, { group:group });\n return newPositions; // this will be null in the case or remove, but be a map of {id->[x,y]} in the case of orphan\n };\n\n this.removeAllGroups = function(deleteMembers, manipulateDOM, doNotFireEvent) {\n for (var g in _managedGroups) {\n this.removeGroup(_managedGroups[g], deleteMembers, manipulateDOM, doNotFireEvent);\n }\n };\n\n function _setVisible(group, state) {\n var m = group.getMembers();\n for (var i = 0; i < m.length; i++) {\n _jsPlumb[state ? CMD_SHOW : CMD_HIDE](m[i], true);\n }\n }\n\n var _collapseConnection = this.collapseConnection = function(c, index, group) {\n\n var proxyEp, groupEl = group.getEl(), groupElId = _jsPlumb.getId(groupEl),\n originalElementId = c.endpoints[index].elementId;\n\n var otherEl = c.endpoints[index === 0 ? 1 : 0].element;\n if (otherEl[GROUP] && (!otherEl[GROUP].shouldProxy() && otherEl[GROUP].collapsed)) {\n return;\n }\n\n c.proxies = c.proxies || [];\n if(c.proxies[index]) {\n proxyEp = c.proxies[index].ep;\n }else {\n proxyEp = _jsPlumb.addEndpoint(groupEl, {\n endpoint:group.getEndpoint(c, index),\n anchor:group.getAnchor(c, index),\n parameters:{\n isProxyEndpoint:true\n }\n });\n }\n proxyEp.setDeleteOnEmpty(true);\n\n // for this index, stash proxy info: the new EP, the original EP.\n c.proxies[index] = { ep:proxyEp, originalEp: c.endpoints[index] };\n\n // and advise the anchor manager\n if (index === 0) {\n // TODO why are there two differently named methods? Why is there not one method that says \"some end of this\n // connection changed (you give the index), and here's the new element and element id.\"\n _jsPlumb.anchorManager.sourceChanged(originalElementId, groupElId, c, groupEl);\n }\n else {\n _jsPlumb.anchorManager.updateOtherEndpoint(c.endpoints[0].elementId, originalElementId, groupElId, c);\n c.target = groupEl;\n c.targetId = groupElId;\n }\n\n\n // detach the original EP from the connection.\n c.proxies[index].originalEp.detachFromConnection(c, null, true);\n\n // set the proxy as the new ep\n proxyEp.connections = [ c ];\n c.endpoints[index] = proxyEp;\n\n c.setVisible(true);\n };\n\n this.collapseGroup = function(group) {\n group = this.getGroup(group);\n if (group == null || group.collapsed) {\n return;\n }\n var groupEl = group.getEl();\n\n // todo remove old proxy endpoints first, just in case?\n //group.proxies.length = 0;\n\n // hide all connections\n _setVisible(group, false);\n\n if (group.shouldProxy()) {\n // collapses all connections in a group.\n var _collapseSet = function (conns, index) {\n for (var i = 0; i < conns.length; i++) {\n var c = conns[i];\n _collapseConnection(c, index, group);\n }\n };\n\n // setup proxies for sources and targets\n _collapseSet(group.connections.source, 0);\n _collapseSet(group.connections.target, 1);\n }\n\n group.collapsed = true;\n _jsPlumb.removeClass(groupEl, GROUP_EXPANDED_CLASS);\n _jsPlumb.addClass(groupEl, GROUP_COLLAPSED_CLASS);\n _jsPlumb.revalidate(groupEl);\n _jsPlumb.fire(EVT_COLLAPSE, { group:group });\n };\n\n var _expandConnection = this.expandConnection = function(c, index, group) {\n\n // if no proxies or none for this end of the connection, abort.\n if (c.proxies == null || c.proxies[index] == null) {\n return;\n }\n\n var groupElId = _jsPlumb.getId(group.getEl()),\n originalElement = c.proxies[index].originalEp.element,\n originalElementId = c.proxies[index].originalEp.elementId;\n\n c.endpoints[index] = c.proxies[index].originalEp;\n // and advise the anchor manager\n if (index === 0) {\n // TODO why are there two differently named methods? Why is there not one method that says \"some end of this\n // connection changed (you give the index), and here's the new element and element id.\"\n _jsPlumb.anchorManager.sourceChanged(groupElId, originalElementId, c, originalElement);\n }\n else {\n _jsPlumb.anchorManager.updateOtherEndpoint(c.endpoints[0].elementId, groupElId, originalElementId, c);\n c.target = originalElement;\n c.targetId = originalElementId;\n }\n\n // detach the proxy EP from the connection (which will cause it to be removed as we no longer need it)\n c.proxies[index].ep.detachFromConnection(c, null);\n\n c.proxies[index].originalEp.addConnection(c);\n\n // cleanup\n delete c.proxies[index];\n };\n\n this.expandGroup = function(group, doNotFireEvent) {\n\n group = this.getGroup(group);\n\n if (group == null || !group.collapsed) {\n return;\n }\n var groupEl = group.getEl();\n\n _setVisible(group, true);\n\n if (group.shouldProxy()) {\n // collapses all connections in a group.\n var _expandSet = function (conns, index) {\n for (var i = 0; i < conns.length; i++) {\n var c = conns[i];\n _expandConnection(c, index, group);\n }\n };\n\n // setup proxies for sources and targets\n _expandSet(group.connections.source, 0);\n _expandSet(group.connections.target, 1);\n }\n\n group.collapsed = false;\n _jsPlumb.addClass(groupEl, GROUP_EXPANDED_CLASS);\n _jsPlumb.removeClass(groupEl, GROUP_COLLAPSED_CLASS);\n _jsPlumb.revalidate(groupEl);\n this.repaintGroup(group);\n if (!doNotFireEvent) {\n _jsPlumb.fire(EVT_EXPAND, { group: group});\n }\n };\n\n this.repaintGroup = function(group) {\n group = this.getGroup(group);\n var m = group.getMembers();\n for (var i = 0; i < m.length; i++) {\n _jsPlumb.revalidate(m[i]);\n }\n };\n\n // TODO refactor this with the code that responds to `connection` events.\n function _updateConnectionsForGroup(group) {\n var members = group.getMembers();\n var c1 = _jsPlumb.getConnections({source:members, scope:\"*\"}, true);\n var c2 = _jsPlumb.getConnections({target:members, scope:\"*\"}, true);\n var processed = {};\n group.connections.source.length = 0;\n group.connections.target.length = 0;\n var oneSet = function(c) {\n for (var i = 0; i < c.length; i++) {\n if (processed[c[i].id]) {\n continue;\n }\n processed[c[i].id] = true;\n if (c[i].source._jsPlumbGroup === group) {\n if (c[i].target._jsPlumbGroup !== group) {\n group.connections.source.push(c[i]);\n }\n _connectionSourceMap[c[i].id] = group;\n }\n else if (c[i].target._jsPlumbGroup === group) {\n group.connections.target.push(c[i]);\n _connectionTargetMap[c[i].id] = group;\n }\n }\n };\n oneSet(c1); oneSet(c2);\n }\n\n this.updateConnectionsForGroup = _updateConnectionsForGroup;\n this.refreshAllGroups = function() {\n for (var g in _managedGroups) {\n _updateConnectionsForGroup(_managedGroups[g]);\n _jsPlumb.dragManager.updateOffsets(_jsPlumb.getId(_managedGroups[g].getEl()));\n }\n };\n };\n\n /**\n *\n * @param {jsPlumbInstance} _jsPlumb Associated jsPlumb instance.\n * @param {Object} params\n * @param {Element} params.el The DOM element representing the Group.\n * @param {String} [params.id] Optional ID for the Group. A UUID will be assigned as the Group's ID if you do not provide one.\n * @param {Boolean} [params.constrain=false] If true, child elements will not be able to be dragged outside of the Group container.\n * @param {Boolean} [params.revert=true] By default, child elements revert to the container if dragged outside. You can change this by setting `revert:false`. This behaviour is also overridden if you set `orphan` or `prune`.\n * @param {Boolean} [params.orphan=false] If true, child elements dropped outside of the Group container will be removed from the Group (but not from the DOM).\n * @param {Boolean} [params.prune=false] If true, child elements dropped outside of the Group container will be removed from the Group and also from the DOM.\n * @param {Boolean} [params.dropOverride=false] If true, a child element that has been dropped onto some other Group will not be subject to the controls imposed by `prune`, `revert` or `orphan`.\n * @constructor\n */\n var Group = function(_jsPlumb, params) {\n var self = this;\n var el = params.el;\n this.getEl = function() { return el; };\n this.id = params.id || _ju.uuid();\n el._isJsPlumbGroup = true;\n\n var getDragArea = this.getDragArea = function() {\n var da = _jsPlumb.getSelector(el, GROUP_CONTAINER_SELECTOR);\n return da && da.length > 0 ? da[0] : el;\n };\n\n var ghost = params.ghost === true;\n var constrain = ghost || (params.constrain === true);\n var revert = params.revert !== false;\n var orphan = params.orphan === true;\n var prune = params.prune === true;\n var dropOverride = params.dropOverride === true;\n var proxied = params.proxied !== false;\n var elements = [];\n this.connections = { source:[], target:[], internal:[] };\n\n // this function, and getEndpoint below, are stubs for a future setup in which we can choose endpoint\n // and anchor based upon the connection and the index (source/target) of the endpoint to be proxied.\n this.getAnchor = function(conn, endpointIndex) {\n return params.anchor || \"Continuous\";\n };\n\n this.getEndpoint = function(conn, endpointIndex) {\n return params.endpoint || [ \"Dot\", { radius:10 }];\n };\n\n this.collapsed = false;\n if (params.draggable !== false) {\n var opts = {\n stop:function(params) {\n _jsPlumb.fire(EVT_GROUP_DRAG_STOP, jsPlumb.extend(params, {group:self}));\n },\n scope:GROUP_DRAG_SCOPE\n };\n if (params.dragOptions) {\n root.jsPlumb.extend(opts, params.dragOptions);\n }\n _jsPlumb.draggable(params.el, opts);\n }\n if (params.droppable !== false) {\n _jsPlumb.droppable(params.el, {\n drop:function(p) {\n var el = p.drag.el;\n if (el._isJsPlumbGroup) {\n return;\n }\n var currentGroup = el._jsPlumbGroup;\n if (currentGroup !== self) {\n if (currentGroup != null) {\n if (currentGroup.overrideDrop(el, self)) {\n return;\n }\n }\n _jsPlumb.getGroupManager().addToGroup(self, el, false);\n }\n\n }\n });\n }\n var _each = function(_el, fn) {\n var els = _el.nodeType == null ? _el : [ _el ];\n for (var i = 0; i < els.length; i++) {\n fn(els[i]);\n }\n };\n\n this.overrideDrop = function(_el, targetGroup) {\n return dropOverride && (revert || prune || orphan);\n };\n\n this.add = function(_el, doNotFireEvent/*, sourceGroup*/) {\n var dragArea = getDragArea();\n _each(_el, function(__el) {\n\n if (__el._jsPlumbGroup != null) {\n if (__el._jsPlumbGroup === self) {\n return;\n } else {\n __el._jsPlumbGroup.remove(__el, true, doNotFireEvent, false);\n }\n }\n\n __el._jsPlumbGroup = self;\n elements.push(__el);\n // test if draggable and add handlers if so.\n if (_jsPlumb.isAlreadyDraggable(__el)) {\n _bindDragHandlers(__el);\n }\n\n if (__el.parentNode !== dragArea) {\n dragArea.appendChild(__el);\n }\n\n // if (!doNotFireEvent) {\n // var p = {group: self, el: __el};\n // if (sourceGroup) {\n // p.sourceGroup = sourceGroup;\n // }\n // //_jsPlumb.fire(EVT_CHILD_ADDED, p);\n // }\n });\n\n _jsPlumb.getGroupManager().updateConnectionsForGroup(self);\n };\n\n this.remove = function(el, manipulateDOM, doNotFireEvent, doNotUpdateConnections, targetGroup) {\n\n _each(el, function(__el) {\n delete __el._jsPlumbGroup;\n _ju.removeWithFunction(elements, function(e) {\n return e === __el;\n });\n\n if (manipulateDOM) {\n try { self.getDragArea().removeChild(__el); }\n catch (e) {\n jsPlumbUtil.log(\"Could not remove element from Group \" + e);\n }\n }\n _unbindDragHandlers(__el);\n if (!doNotFireEvent) {\n var p = {group: self, el: __el};\n if (targetGroup) {\n p.targetGroup = targetGroup;\n }\n _jsPlumb.fire(EVT_CHILD_REMOVED, p);\n }\n });\n if (!doNotUpdateConnections) {\n _jsPlumb.getGroupManager().updateConnectionsForGroup(self);\n }\n };\n this.removeAll = function(manipulateDOM, doNotFireEvent) {\n for (var i = 0, l = elements.length; i < l; i++) {\n var el = elements[0];\n self.remove(el, manipulateDOM, doNotFireEvent, true);\n _jsPlumb.remove(el, true);\n }\n elements.length = 0;\n _jsPlumb.getGroupManager().updateConnectionsForGroup(self);\n };\n this.orphanAll = function() {\n var orphanedPositions = {};\n for (var i = 0; i < elements.length; i++) {\n var newPosition = _orphan(elements[i]);\n orphanedPositions[newPosition[0]] = newPosition[1];\n }\n elements.length = 0;\n\n return orphanedPositions;\n };\n this.getMembers = function() { return elements; };\n\n el[GROUP] = this;\n\n _jsPlumb.bind(ELEMENT_DRAGGABLE_EVENT, function(dragParams) {\n // if its for the current group,\n if (dragParams.el._jsPlumbGroup === this) {\n _bindDragHandlers(dragParams.el);\n }\n }.bind(this));\n\n function _findParent(_el) {\n return _el.offsetParent;\n }\n\n function _isInsideParent(_el, pos) {\n var p = _findParent(_el),\n s = _jsPlumb.getSize(p),\n ss = _jsPlumb.getSize(_el),\n leftEdge = pos[0],\n rightEdge = leftEdge + ss[0],\n topEdge = pos[1],\n bottomEdge = topEdge + ss[1];\n\n return rightEdge > 0 && leftEdge < s[0] && bottomEdge > 0 && topEdge < s[1];\n }\n\n //\n // orphaning an element means taking it out of the group and adding it to the main jsplumb container.\n // we return the new calculated position from this method and the element's id.\n //\n function _orphan(_el) {\n var id = _jsPlumb.getId(_el);\n var pos = _jsPlumb.getOffset(_el);\n _el.parentNode.removeChild(_el);\n _jsPlumb.getContainer().appendChild(_el);\n _jsPlumb.setPosition(_el, pos);\n delete _el._jsPlumbGroup;\n _unbindDragHandlers(_el);\n _jsPlumb.dragManager.clearParent(_el, id);\n return [id, pos];\n }\n\n //\n // remove an element from the group, then either prune it from the jsplumb instance, or just orphan it.\n //\n function _pruneOrOrphan(p) {\n var orphanedPosition = null;\n if (!_isInsideParent(p.el, p.pos)) {\n var group = p.el._jsPlumbGroup;\n if (prune) {\n _jsPlumb.remove(p.el);\n } else {\n orphanedPosition = _orphan(p.el);\n }\n\n group.remove(p.el);\n }\n\n return orphanedPosition;\n }\n\n //\n // redraws the element\n //\n function _revalidate(_el) {\n var id = _jsPlumb.getId(_el);\n _jsPlumb.revalidate(_el);\n _jsPlumb.dragManager.revalidateParent(_el, id);\n }\n\n //\n // unbind the group specific drag/revert handlers.\n //\n function _unbindDragHandlers(_el) {\n if (!_el._katavorioDrag) {\n return;\n }\n if (prune || orphan) {\n _el._katavorioDrag.off(STOP, _pruneOrOrphan);\n }\n if (!prune && !orphan && revert) {\n _el._katavorioDrag.off(REVERT, _revalidate);\n _el._katavorioDrag.setRevert(null);\n }\n }\n\n function _bindDragHandlers(_el) {\n if (!_el._katavorioDrag) {\n return;\n }\n if (prune || orphan) {\n _el._katavorioDrag.on(STOP, _pruneOrOrphan);\n }\n\n if (constrain) {\n _el._katavorioDrag.setConstrain(true);\n }\n\n if (ghost) {\n _el._katavorioDrag.setUseGhostProxy(true);\n }\n\n if (!prune && !orphan && revert) {\n _el._katavorioDrag.on(REVERT, _revalidate);\n _el._katavorioDrag.setRevert(function(__el, pos) {\n return !_isInsideParent(__el, pos);\n });\n }\n }\n\n this.shouldProxy = function() {\n return proxied;\n };\n\n _jsPlumb.getGroupManager().addGroup(this);\n };\n\n /**\n * Adds a group to the jsPlumb instance.\n * @method addGroup\n * @param {Object} params\n * @return {Group} The newly created Group.\n */\n _jpi.prototype.addGroup = function(params) {\n var j = this;\n j._groups = j._groups || {};\n if (j._groups[params.id] != null) {\n throw new TypeError(\"cannot create Group [\" + params.id + \"]; a Group with that ID exists\");\n }\n if (params.el[GROUP] != null) {\n throw new TypeError(\"cannot create Group [\" + params.id + \"]; the given element is already a Group\");\n }\n var group = new Group(j, params);\n j._groups[group.id] = group;\n if (params.collapsed) {\n this.collapseGroup(group);\n }\n return group;\n };\n\n /**\n * Add an element to a group.\n * @method addToGroup\n * @param {String} group Group, or ID of the group, to add the element to.\n * @param {Element} el Element to add to the group.\n */\n _jpi.prototype.addToGroup = function(group, el, doNotFireEvent) {\n\n var _one = function(_el) {\n var id = this.getId(_el);\n this.manage(id, _el);\n this.getGroupManager().addToGroup(group, _el, doNotFireEvent);\n }.bind(this);\n\n if (Array.isArray(el)) {\n for (var i = 0; i < el.length; i++) {\n _one(el[i]);\n }\n } else {\n _one(el);\n }\n };\n\n /**\n * Remove an element from a group.\n * @method removeFromGroup\n * @param {String} group Group, or ID of the group, to remove the element from.\n * @param {Element} el Element to add to the group.\n */\n _jpi.prototype.removeFromGroup = function(group, el, doNotFireEvent) {\n this.getGroupManager().removeFromGroup(group, el, doNotFireEvent);\n };\n\n /**\n * Remove a group, and optionally remove its members from the jsPlumb instance.\n * @method removeGroup\n * @param {String|Group} group Group to delete, or ID of Group to delete.\n * @param {Boolean} [deleteMembers=false] If true, group members will be removed along with the group. Otherwise they will\n * just be 'orphaned' (returned to the main container).\n * @returns {Map[String, Position}} When deleteMembers is false, this method returns a map of {id->position}\n */\n _jpi.prototype.removeGroup = function(group, deleteMembers, manipulateDOM, doNotFireEvent) {\n return this.getGroupManager().removeGroup(group, deleteMembers, manipulateDOM, doNotFireEvent);\n };\n\n /**\n * Remove all groups, and optionally remove their members from the jsPlumb instance.\n * @method removeAllGroup\n * @param {Boolean} [deleteMembers=false] If true, group members will be removed along with the groups. Otherwise they will\n * just be 'orphaned' (returned to the main container).\n */\n _jpi.prototype.removeAllGroups = function(deleteMembers, manipulateDOM, doNotFireEvent) {\n this.getGroupManager().removeAllGroups(deleteMembers, manipulateDOM, doNotFireEvent);\n };\n\n /**\n * Get a Group\n * @method getGroup\n * @param {String} groupId ID of the group to get\n * @return {Group} Group with the given ID, null if not found.\n */\n _jpi.prototype.getGroup = function(groupId) {\n return this.getGroupManager().getGroup(groupId);\n };\n\n /**\n * Gets all the Groups managed by the jsPlumb instance.\n * @returns {Group[]} List of Groups. Empty if none.\n */\n _jpi.prototype.getGroups = function() {\n return this.getGroupManager().getGroups();\n };\n\n /**\n * Expands a group element. jsPlumb doesn't do \"everything\" for you here, because what it means to expand a Group\n * will vary from application to application. jsPlumb does these things:\n *\n * - Hides any connections that are internal to the group (connections between members, and connections from member of\n * the group to the group itself)\n * - Proxies all connections for which the source or target is a member of the group.\n * - Hides the proxied connections.\n * - Adds the jtk-group-expanded class to the group's element\n * - Removes the jtk-group-collapsed class from the group's element.\n *\n * @method expandGroup\n * @param {String|Group} group Group to expand, or ID of Group to expand.\n */\n _jpi.prototype.expandGroup = function(group) {\n this.getGroupManager().expandGroup(group);\n };\n\n /**\n * Collapses a group element. jsPlumb doesn't do \"everything\" for you here, because what it means to collapse a Group\n * will vary from application to application. jsPlumb does these things:\n *\n * - Shows any connections that are internal to the group (connections between members, and connections from member of\n * the group to the group itself)\n * - Removes proxies for all connections for which the source or target is a member of the group.\n * - Shows the previously proxied connections.\n * - Adds the jtk-group-collapsed class to the group's element\n * - Removes the jtk-group-expanded class from the group's element.\n *\n * @method expandGroup\n * @param {String|Group} group Group to expand, or ID of Group to expand.\n */\n _jpi.prototype.collapseGroup = function(groupId) {\n this.getGroupManager().collapseGroup(groupId);\n };\n\n\n _jpi.prototype.repaintGroup = function(group) {\n this.getGroupManager().repaintGroup(group);\n };\n\n /**\n * Collapses or expands a group element depending on its current state. See notes in the collapseGroup and expandGroup method.\n *\n * @method toggleGroup\n * @param {String|Group} group Group to expand/collapse, or ID of Group to expand/collapse.\n */\n _jpi.prototype.toggleGroup = function(group) {\n group = this.getGroupManager().getGroup(group);\n if (group != null) {\n this.getGroupManager()[group.collapsed ? \"expandGroup\" : \"collapseGroup\"](group);\n }\n };\n\n //\n // lazy init a group manager for the given jsplumb instance.\n //\n _jpi.prototype.getGroupManager = function() {\n var mgr = this[GROUP_MANAGER];\n if (mgr == null) {\n mgr = this[GROUP_MANAGER] = new GroupManager(this);\n }\n return mgr;\n };\n\n _jpi.prototype.removeGroupManager = function() {\n delete this[GROUP_MANAGER];\n };\n\n /**\n * Gets the Group that the given element belongs to, null if none.\n * @method getGroupFor\n * @param {String|Element} el Element, or element ID.\n * @returns {Group} A Group, if found, or null.\n */\n _jpi.prototype.getGroupFor = function(el) {\n el = this.getElement(el);\n if (el) {\n return el[GROUP];\n }\n };\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n\n/*\n * This file contains the 'flowchart' connectors, consisting of vertical and horizontal line segments.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n var STRAIGHT = \"Straight\";\n var ARC = \"Arc\";\n\n var Flowchart = function (params) {\n this.type = \"Flowchart\";\n params = params || {};\n params.stub = params.stub == null ? 30 : params.stub;\n var segments,\n _super = _jp.Connectors.AbstractConnector.apply(this, arguments),\n midpoint = params.midpoint == null ? 0.5 : params.midpoint,\n alwaysRespectStubs = params.alwaysRespectStubs === true,\n lastx = null, lasty = null, lastOrientation,\n cornerRadius = params.cornerRadius != null ? params.cornerRadius : 0,\n\n // TODO now common between this and AbstractBezierEditor; refactor into superclass?\n loopbackRadius = params.loopbackRadius || 25,\n isLoopbackCurrently = false,\n\n sgn = function (n) {\n return n < 0 ? -1 : n === 0 ? 0 : 1;\n },\n segmentDirections = function(segment) {\n return [\n sgn( segment[2] - segment[0] ),\n sgn( segment[3] - segment[1] )\n ];\n },\n /**\n * helper method to add a segment.\n */\n addSegment = function (segments, x, y, paintInfo) {\n if (lastx === x && lasty === y) {\n return;\n }\n var lx = lastx == null ? paintInfo.sx : lastx,\n ly = lasty == null ? paintInfo.sy : lasty,\n o = lx === x ? \"v\" : \"h\";\n\n lastx = x;\n lasty = y;\n segments.push([ lx, ly, x, y, o ]);\n },\n segLength = function (s) {\n return Math.sqrt(Math.pow(s[0] - s[2], 2) + Math.pow(s[1] - s[3], 2));\n },\n _cloneArray = function (a) {\n var _a = [];\n _a.push.apply(_a, a);\n return _a;\n },\n writeSegments = function (conn, segments, paintInfo) {\n var current = null, next, currentDirection, nextDirection;\n for (var i = 0; i < segments.length - 1; i++) {\n\n current = current || _cloneArray(segments[i]);\n next = _cloneArray(segments[i + 1]);\n\n currentDirection = segmentDirections(current);\n nextDirection = segmentDirections(next);\n\n if (cornerRadius > 0 && current[4] !== next[4]) {\n\n var minSegLength = Math.min(segLength(current), segLength(next));\n var radiusToUse = Math.min(cornerRadius, minSegLength / 2);\n\n current[2] -= currentDirection[0] * radiusToUse;\n current[3] -= currentDirection[1] * radiusToUse;\n next[0] += nextDirection[0] * radiusToUse;\n next[1] += nextDirection[1] * radiusToUse;\n\n var ac = (currentDirection[1] === nextDirection[0] && nextDirection[0] === 1) ||\n ((currentDirection[1] === nextDirection[0] && nextDirection[0] === 0) && currentDirection[0] !== nextDirection[1]) ||\n (currentDirection[1] === nextDirection[0] && nextDirection[0] === -1),\n sgny = next[1] > current[3] ? 1 : -1,\n sgnx = next[0] > current[2] ? 1 : -1,\n sgnEqual = sgny === sgnx,\n cx = (sgnEqual && ac || (!sgnEqual && !ac)) ? next[0] : current[2],\n cy = (sgnEqual && ac || (!sgnEqual && !ac)) ? current[3] : next[1];\n\n _super.addSegment(conn, STRAIGHT, {\n x1: current[0], y1: current[1], x2: current[2], y2: current[3]\n });\n\n _super.addSegment(conn, ARC, {\n r: radiusToUse,\n x1: current[2],\n y1: current[3],\n x2: next[0],\n y2: next[1],\n cx: cx,\n cy: cy,\n ac: ac\n });\n }\n else {\n // dx + dy are used to adjust for line width.\n var dx = (current[2] === current[0]) ? 0 : (current[2] > current[0]) ? (paintInfo.lw / 2) : -(paintInfo.lw / 2),\n dy = (current[3] === current[1]) ? 0 : (current[3] > current[1]) ? (paintInfo.lw / 2) : -(paintInfo.lw / 2);\n\n _super.addSegment(conn, STRAIGHT, {\n x1: current[0] - dx, y1: current[1] - dy, x2: current[2] + dx, y2: current[3] + dy\n });\n }\n current = next;\n }\n if (next != null) {\n // last segment\n _super.addSegment(conn, STRAIGHT, {\n x1: next[0], y1: next[1], x2: next[2], y2: next[3]\n });\n }\n };\n\n this._compute = function (paintInfo, params) {\n\n segments = [];\n lastx = null;\n lasty = null;\n lastOrientation = null;\n\n var commonStubCalculator = function () {\n return [paintInfo.startStubX, paintInfo.startStubY, paintInfo.endStubX, paintInfo.endStubY];\n },\n stubCalculators = {\n perpendicular: commonStubCalculator,\n orthogonal: commonStubCalculator,\n opposite: function (axis) {\n var pi = paintInfo,\n idx = axis === \"x\" ? 0 : 1,\n areInProximity = {\n \"x\": function () {\n return ( (pi.so[idx] === 1 && (\n ( (pi.startStubX > pi.endStubX) && (pi.tx > pi.startStubX) ) ||\n ( (pi.sx > pi.endStubX) && (pi.tx > pi.sx))))) ||\n\n ( (pi.so[idx] === -1 && (\n ( (pi.startStubX < pi.endStubX) && (pi.tx < pi.startStubX) ) ||\n ( (pi.sx < pi.endStubX) && (pi.tx < pi.sx)))));\n },\n \"y\": function () {\n return ( (pi.so[idx] === 1 && (\n ( (pi.startStubY > pi.endStubY) && (pi.ty > pi.startStubY) ) ||\n ( (pi.sy > pi.endStubY) && (pi.ty > pi.sy))))) ||\n\n ( (pi.so[idx] === -1 && (\n ( (pi.startStubY < pi.endStubY) && (pi.ty < pi.startStubY) ) ||\n ( (pi.sy < pi.endStubY) && (pi.ty < pi.sy)))));\n }\n };\n\n if (!alwaysRespectStubs && areInProximity[axis]()) {\n return {\n \"x\": [(paintInfo.sx + paintInfo.tx) / 2, paintInfo.startStubY, (paintInfo.sx + paintInfo.tx) / 2, paintInfo.endStubY],\n \"y\": [paintInfo.startStubX, (paintInfo.sy + paintInfo.ty) / 2, paintInfo.endStubX, (paintInfo.sy + paintInfo.ty) / 2]\n }[axis];\n }\n else {\n return [paintInfo.startStubX, paintInfo.startStubY, paintInfo.endStubX, paintInfo.endStubY];\n }\n }\n };\n\n // calculate Stubs.\n var stubs = stubCalculators[paintInfo.anchorOrientation](paintInfo.sourceAxis),\n idx = paintInfo.sourceAxis === \"x\" ? 0 : 1,\n oidx = paintInfo.sourceAxis === \"x\" ? 1 : 0,\n ss = stubs[idx],\n oss = stubs[oidx],\n es = stubs[idx + 2],\n oes = stubs[oidx + 2];\n\n // add the start stub segment. use stubs for loopback as it will look better, with the loop spaced\n // away from the element.\n addSegment(segments, stubs[0], stubs[1], paintInfo);\n\n // if its a loopback and we should treat it differently.\n // if (false && params.sourcePos[0] === params.targetPos[0] && params.sourcePos[1] === params.targetPos[1]) {\n //\n // // we use loopbackRadius here, as statemachine connectors do.\n // // so we go radius to the left from stubs[0], then upwards by 2*radius, to the right by 2*radius,\n // // down by 2*radius, left by radius.\n // addSegment(segments, stubs[0] - loopbackRadius, stubs[1], paintInfo);\n // addSegment(segments, stubs[0] - loopbackRadius, stubs[1] - (2 * loopbackRadius), paintInfo);\n // addSegment(segments, stubs[0] + loopbackRadius, stubs[1] - (2 * loopbackRadius), paintInfo);\n // addSegment(segments, stubs[0] + loopbackRadius, stubs[1], paintInfo);\n // addSegment(segments, stubs[0], stubs[1], paintInfo);\n //\n // }\n // else {\n\n\n var midx = paintInfo.startStubX + ((paintInfo.endStubX - paintInfo.startStubX) * midpoint),\n midy = paintInfo.startStubY + ((paintInfo.endStubY - paintInfo.startStubY) * midpoint);\n\n var orientations = {x: [0, 1], y: [1, 0]},\n lineCalculators = {\n perpendicular: function (axis) {\n var pi = paintInfo,\n sis = {\n x: [\n [[1, 2, 3, 4], null, [2, 1, 4, 3]],\n null,\n [[4, 3, 2, 1], null, [3, 4, 1, 2]]\n ],\n y: [\n [[3, 2, 1, 4], null, [2, 3, 4, 1]],\n null,\n [[4, 1, 2, 3], null, [1, 4, 3, 2]]\n ]\n },\n stubs = {\n x: [[pi.startStubX, pi.endStubX], null, [pi.endStubX, pi.startStubX]],\n y: [[pi.startStubY, pi.endStubY], null, [pi.endStubY, pi.startStubY]]\n },\n midLines = {\n x: [[midx, pi.startStubY], [midx, pi.endStubY]],\n y: [[pi.startStubX, midy], [pi.endStubX, midy]]\n },\n linesToEnd = {\n x: [[pi.endStubX, pi.startStubY]],\n y: [[pi.startStubX, pi.endStubY]]\n },\n startToEnd = {\n x: [[pi.startStubX, pi.endStubY], [pi.endStubX, pi.endStubY]],\n y: [[pi.endStubX, pi.startStubY], [pi.endStubX, pi.endStubY]]\n },\n startToMidToEnd = {\n x: [[pi.startStubX, midy], [pi.endStubX, midy], [pi.endStubX, pi.endStubY]],\n y: [[midx, pi.startStubY], [midx, pi.endStubY], [pi.endStubX, pi.endStubY]]\n },\n otherStubs = {\n x: [pi.startStubY, pi.endStubY],\n y: [pi.startStubX, pi.endStubX]\n },\n soIdx = orientations[axis][0], toIdx = orientations[axis][1],\n _so = pi.so[soIdx] + 1,\n _to = pi.to[toIdx] + 1,\n otherFlipped = (pi.to[toIdx] === -1 && (otherStubs[axis][1] < otherStubs[axis][0])) || (pi.to[toIdx] === 1 && (otherStubs[axis][1] > otherStubs[axis][0])),\n stub1 = stubs[axis][_so][0],\n stub2 = stubs[axis][_so][1],\n segmentIndexes = sis[axis][_so][_to];\n\n if (pi.segment === segmentIndexes[3] || (pi.segment === segmentIndexes[2] && otherFlipped)) {\n return midLines[axis];\n }\n else if (pi.segment === segmentIndexes[2] && stub2 < stub1) {\n return linesToEnd[axis];\n }\n else if ((pi.segment === segmentIndexes[2] && stub2 >= stub1) || (pi.segment === segmentIndexes[1] && !otherFlipped)) {\n return startToMidToEnd[axis];\n }\n else if (pi.segment === segmentIndexes[0] || (pi.segment === segmentIndexes[1] && otherFlipped)) {\n return startToEnd[axis];\n }\n },\n orthogonal: function (axis, startStub, otherStartStub, endStub, otherEndStub) {\n var pi = paintInfo,\n extent = {\n \"x\": pi.so[0] === -1 ? Math.min(startStub, endStub) : Math.max(startStub, endStub),\n \"y\": pi.so[1] === -1 ? Math.min(startStub, endStub) : Math.max(startStub, endStub)\n }[axis];\n\n return {\n \"x\": [\n [extent, otherStartStub],\n [extent, otherEndStub],\n [endStub, otherEndStub]\n ],\n \"y\": [\n [otherStartStub, extent],\n [otherEndStub, extent],\n [otherEndStub, endStub]\n ]\n }[axis];\n },\n opposite: function (axis, ss, oss, es) {\n var pi = paintInfo,\n otherAxis = {\"x\": \"y\", \"y\": \"x\"}[axis],\n dim = {\"x\": \"height\", \"y\": \"width\"}[axis],\n comparator = pi[\"is\" + axis.toUpperCase() + \"GreaterThanStubTimes2\"];\n\n if (params.sourceEndpoint.elementId === params.targetEndpoint.elementId) {\n var _val = oss + ((1 - params.sourceEndpoint.anchor[otherAxis]) * params.sourceInfo[dim]) + _super.maxStub;\n return {\n \"x\": [\n [ss, _val],\n [es, _val]\n ],\n \"y\": [\n [_val, ss],\n [_val, es]\n ]\n }[axis];\n\n }\n else if (!comparator || (pi.so[idx] === 1 && ss > es) || (pi.so[idx] === -1 && ss < es)) {\n return {\n \"x\": [\n [ss, midy],\n [es, midy]\n ],\n \"y\": [\n [midx, ss],\n [midx, es]\n ]\n }[axis];\n }\n else if ((pi.so[idx] === 1 && ss < es) || (pi.so[idx] === -1 && ss > es)) {\n return {\n \"x\": [\n [midx, pi.sy],\n [midx, pi.ty]\n ],\n \"y\": [\n [pi.sx, midy],\n [pi.tx, midy]\n ]\n }[axis];\n }\n }\n };\n\n // compute the rest of the line\n var p = lineCalculators[paintInfo.anchorOrientation](paintInfo.sourceAxis, ss, oss, es, oes);\n if (p) {\n for (var i = 0; i < p.length; i++) {\n addSegment(segments, p[i][0], p[i][1], paintInfo);\n }\n }\n\n // line to end stub\n addSegment(segments, stubs[2], stubs[3], paintInfo);\n\n //}\n\n // end stub to end (common)\n addSegment(segments, paintInfo.tx, paintInfo.ty, paintInfo);\n\n\n\n // write out the segments.\n writeSegments(this, segments, paintInfo);\n\n };\n };\n\n _jp.Connectors.Flowchart = Flowchart;\n _ju.extend(_jp.Connectors.Flowchart, _jp.Connectors.AbstractConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the code for the Bezier connector type.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n _jp.Connectors.AbstractBezierConnector = function(params) {\n params = params || {};\n var showLoopback = params.showLoopback !== false,\n curviness = params.curviness || 10,\n margin = params.margin || 5,\n proximityLimit = params.proximityLimit || 80,\n clockwise = params.orientation && params.orientation === \"clockwise\",\n loopbackRadius = params.loopbackRadius || 25,\n isLoopbackCurrently = false,\n _super;\n\n this._compute = function (paintInfo, p) {\n\n var sp = p.sourcePos,\n tp = p.targetPos,\n _w = Math.abs(sp[0] - tp[0]),\n _h = Math.abs(sp[1] - tp[1]);\n\n if (!showLoopback || (p.sourceEndpoint.elementId !== p.targetEndpoint.elementId)) {\n isLoopbackCurrently = false;\n this._computeBezier(paintInfo, p, sp, tp, _w, _h);\n } else {\n isLoopbackCurrently = true;\n // a loopback connector. draw an arc from one anchor to the other.\n var x1 = p.sourcePos[0], y1 = p.sourcePos[1] - margin,\n cx = x1, cy = y1 - loopbackRadius,\n // canvas sizing stuff, to ensure the whole painted area is visible.\n _x = cx - loopbackRadius,\n _y = cy - loopbackRadius;\n\n _w = 2 * loopbackRadius;\n _h = 2 * loopbackRadius;\n\n paintInfo.points[0] = _x;\n paintInfo.points[1] = _y;\n paintInfo.points[2] = _w;\n paintInfo.points[3] = _h;\n\n // ADD AN ARC SEGMENT.\n _super.addSegment(this, \"Arc\", {\n loopback: true,\n x1: (x1 - _x) + 4,\n y1: y1 - _y,\n startAngle: 0,\n endAngle: 2 * Math.PI,\n r: loopbackRadius,\n ac: !clockwise,\n x2: (x1 - _x) - 4,\n y2: y1 - _y,\n cx: cx - _x,\n cy: cy - _y\n });\n }\n };\n\n _super = _jp.Connectors.AbstractConnector.apply(this, arguments);\n return _super;\n };\n _ju.extend(_jp.Connectors.AbstractBezierConnector, _jp.Connectors.AbstractConnector);\n\n var Bezier = function (params) {\n params = params || {};\n this.type = \"Bezier\";\n\n var _super = _jp.Connectors.AbstractBezierConnector.apply(this, arguments),\n majorAnchor = params.curviness || 150,\n minorAnchor = 10;\n\n this.getCurviness = function () {\n return majorAnchor;\n };\n\n this._findControlPoint = function (point, sourceAnchorPosition, targetAnchorPosition, sourceEndpoint, targetEndpoint, soo, too) {\n // determine if the two anchors are perpendicular to each other in their orientation. we swap the control\n // points around if so (code could be tightened up)\n var perpendicular = soo[0] !== too[0] || soo[1] === too[1],\n p = [];\n\n if (!perpendicular) {\n if (soo[0] === 0) {\n p.push(sourceAnchorPosition[0] < targetAnchorPosition[0] ? point[0] + minorAnchor : point[0] - minorAnchor);\n }\n else {\n p.push(point[0] - (majorAnchor * soo[0]));\n }\n\n if (soo[1] === 0) {\n p.push(sourceAnchorPosition[1] < targetAnchorPosition[1] ? point[1] + minorAnchor : point[1] - minorAnchor);\n }\n else {\n p.push(point[1] + (majorAnchor * too[1]));\n }\n }\n else {\n if (too[0] === 0) {\n p.push(targetAnchorPosition[0] < sourceAnchorPosition[0] ? point[0] + minorAnchor : point[0] - minorAnchor);\n }\n else {\n p.push(point[0] + (majorAnchor * too[0]));\n }\n\n if (too[1] === 0) {\n p.push(targetAnchorPosition[1] < sourceAnchorPosition[1] ? point[1] + minorAnchor : point[1] - minorAnchor);\n }\n else {\n p.push(point[1] + (majorAnchor * soo[1]));\n }\n }\n\n return p;\n };\n\n this._computeBezier = function (paintInfo, p, sp, tp, _w, _h) {\n\n var _CP, _CP2,\n _sx = sp[0] < tp[0] ? _w : 0,\n _sy = sp[1] < tp[1] ? _h : 0,\n _tx = sp[0] < tp[0] ? 0 : _w,\n _ty = sp[1] < tp[1] ? 0 : _h;\n\n _CP = this._findControlPoint([_sx, _sy], sp, tp, p.sourceEndpoint, p.targetEndpoint, paintInfo.so, paintInfo.to);\n _CP2 = this._findControlPoint([_tx, _ty], tp, sp, p.targetEndpoint, p.sourceEndpoint, paintInfo.to, paintInfo.so);\n\n\n _super.addSegment(this, \"Bezier\", {\n x1: _sx, y1: _sy, x2: _tx, y2: _ty,\n cp1x: _CP[0], cp1y: _CP[1], cp2x: _CP2[0], cp2y: _CP2[1]\n });\n };\n\n\n };\n\n _jp.Connectors.Bezier = Bezier;\n _ju.extend(Bezier, _jp.Connectors.AbstractBezierConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the state machine connectors, which extend AbstractBezierConnector.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n var _segment = function (x1, y1, x2, y2) {\n if (x1 <= x2 && y2 <= y1) {\n return 1;\n }\n else if (x1 <= x2 && y1 <= y2) {\n return 2;\n }\n else if (x2 <= x1 && y2 >= y1) {\n return 3;\n }\n return 4;\n },\n\n // the control point we will use depends on the faces to which each end of the connection is assigned, specifically whether or not the\n // two faces are parallel or perpendicular. if they are parallel then the control point lies on the midpoint of the axis in which they\n // are parellel and varies only in the other axis; this variation is proportional to the distance that the anchor points lie from the\n // center of that face. if the two faces are perpendicular then the control point is at some distance from both the midpoints; the amount and\n // direction are dependent on the orientation of the two elements. 'seg', passed in to this method, tells you which segment the target element\n // lies in with respect to the source: 1 is top right, 2 is bottom right, 3 is bottom left, 4 is top left.\n //\n // sourcePos and targetPos are arrays of info about where on the source and target each anchor is located. their contents are:\n //\n // 0 - absolute x\n // 1 - absolute y\n // 2 - proportional x in element (0 is left edge, 1 is right edge)\n // 3 - proportional y in element (0 is top edge, 1 is bottom edge)\n //\n _findControlPoint = function (midx, midy, segment, sourceEdge, targetEdge, dx, dy, distance, proximityLimit) {\n // TODO (maybe)\n // - if anchor pos is 0.5, make the control point take into account the relative position of the elements.\n if (distance <= proximityLimit) {\n return [midx, midy];\n }\n\n if (segment === 1) {\n if (sourceEdge[3] <= 0 && targetEdge[3] >= 1) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] >= 1 && targetEdge[2] <= 0) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + (-1 * dx) , midy + (-1 * dy) ];\n }\n }\n else if (segment === 2) {\n if (sourceEdge[3] >= 1 && targetEdge[3] <= 0) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] >= 1 && targetEdge[2] <= 0) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + dx, midy + (-1 * dy) ];\n }\n }\n else if (segment === 3) {\n if (sourceEdge[3] >= 1 && targetEdge[3] <= 0) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] <= 0 && targetEdge[2] >= 1) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + (-1 * dx) , midy + (-1 * dy) ];\n }\n }\n else if (segment === 4) {\n if (sourceEdge[3] <= 0 && targetEdge[3] >= 1) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] <= 0 && targetEdge[2] >= 1) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + dx , midy + (-1 * dy) ];\n }\n }\n\n };\n\n var StateMachine = function (params) {\n params = params || {};\n this.type = \"StateMachine\";\n\n var _super = _jp.Connectors.AbstractBezierConnector.apply(this, arguments),\n curviness = params.curviness || 10,\n margin = params.margin || 5,\n proximityLimit = params.proximityLimit || 80,\n clockwise = params.orientation && params.orientation === \"clockwise\",\n _controlPoint;\n\n this._computeBezier = function(paintInfo, params, sp, tp, w, h) {\n var _sx = params.sourcePos[0] < params.targetPos[0] ? 0 : w,\n _sy = params.sourcePos[1] < params.targetPos[1] ? 0 : h,\n _tx = params.sourcePos[0] < params.targetPos[0] ? w : 0,\n _ty = params.sourcePos[1] < params.targetPos[1] ? h : 0;\n\n // now adjust for the margin\n if (params.sourcePos[2] === 0) {\n _sx -= margin;\n }\n if (params.sourcePos[2] === 1) {\n _sx += margin;\n }\n if (params.sourcePos[3] === 0) {\n _sy -= margin;\n }\n if (params.sourcePos[3] === 1) {\n _sy += margin;\n }\n if (params.targetPos[2] === 0) {\n _tx -= margin;\n }\n if (params.targetPos[2] === 1) {\n _tx += margin;\n }\n if (params.targetPos[3] === 0) {\n _ty -= margin;\n }\n if (params.targetPos[3] === 1) {\n _ty += margin;\n }\n\n //\n // these connectors are quadratic bezier curves, having a single control point. if both anchors\n // are located at 0.5 on their respective faces, the control point is set to the midpoint and you\n // get a straight line. this is also the case if the two anchors are within 'proximityLimit', since\n // it seems to make good aesthetic sense to do that. outside of that, the control point is positioned\n // at 'curviness' pixels away along the normal to the straight line connecting the two anchors.\n //\n // there may be two improvements to this. firstly, we might actually support the notion of avoiding nodes\n // in the UI, or at least making a good effort at doing so. if a connection would pass underneath some node,\n // for example, we might increase the distance the control point is away from the midpoint in a bid to\n // steer it around that node. this will work within limits, but i think those limits would also be the likely\n // limits for, once again, aesthetic good sense in the layout of a chart using these connectors.\n //\n // the second possible change is actually two possible changes: firstly, it is possible we should gradually\n // decrease the 'curviness' as the distance between the anchors decreases; start tailing it off to 0 at some\n // point (which should be configurable). secondly, we might slightly increase the 'curviness' for connectors\n // with respect to how far their anchor is from the center of its respective face. this could either look cool,\n // or stupid, and may indeed work only in a way that is so subtle as to have been a waste of time.\n //\n\n var _midx = (_sx + _tx) / 2,\n _midy = (_sy + _ty) / 2,\n segment = _segment(_sx, _sy, _tx, _ty),\n distance = Math.sqrt(Math.pow(_tx - _sx, 2) + Math.pow(_ty - _sy, 2)),\n cp1x, cp2x, cp1y, cp2y;\n\n\n // calculate the control point. this code will be where we'll put in a rudimentary element avoidance scheme; it\n // will work by extending the control point to force the curve to be, um, curvier.\n _controlPoint = _findControlPoint(_midx,\n _midy,\n segment,\n params.sourcePos,\n params.targetPos,\n curviness, curviness,\n distance,\n proximityLimit);\n\n cp1x = _controlPoint[0];\n cp2x = _controlPoint[0];\n cp1y = _controlPoint[1];\n cp2y = _controlPoint[1];\n\n _super.addSegment(this, \"Bezier\", {\n x1: _tx, y1: _ty, x2: _sx, y2: _sy,\n cp1x: cp1x, cp1y: cp1y,\n cp2x: cp2x, cp2y: cp2y\n });\n };\n };\n\n _jp.Connectors.StateMachine = StateMachine;\n _ju.extend(StateMachine, _jp.Connectors.AbstractBezierConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the 'flowchart' connectors, consisting of vertical and horizontal line segments.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n var STRAIGHT = \"Straight\";\n\n var Straight = function (params) {\n this.type = STRAIGHT;\n var _super = _jp.Connectors.AbstractConnector.apply(this, arguments);\n\n this._compute = function (paintInfo, _) {\n _super.addSegment(this, STRAIGHT, {x1: paintInfo.sx, y1: paintInfo.sy, x2: paintInfo.startStubX, y2: paintInfo.startStubY});\n _super.addSegment(this, STRAIGHT, {x1: paintInfo.startStubX, y1: paintInfo.startStubY, x2: paintInfo.endStubX, y2: paintInfo.endStubY});\n _super.addSegment(this, STRAIGHT, {x1: paintInfo.endStubX, y1: paintInfo.endStubY, x2: paintInfo.tx, y2: paintInfo.ty});\n };\n };\n\n _jp.Connectors.Straight = Straight;\n _ju.extend(Straight, _jp.Connectors.AbstractConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the SVG renderers.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n * \n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n// ************************** SVG utility methods ********************************************\t\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n var svgAttributeMap = {\n \"stroke-linejoin\": \"stroke-linejoin\",\n \"stroke-dashoffset\": \"stroke-dashoffset\",\n \"stroke-linecap\": \"stroke-linecap\"\n },\n STROKE_DASHARRAY = \"stroke-dasharray\",\n DASHSTYLE = \"dashstyle\",\n LINEAR_GRADIENT = \"linearGradient\",\n RADIAL_GRADIENT = \"radialGradient\",\n DEFS = \"defs\",\n FILL = \"fill\",\n STOP = \"stop\",\n STROKE = \"stroke\",\n STROKE_WIDTH = \"stroke-width\",\n STYLE = \"style\",\n NONE = \"none\",\n JSPLUMB_GRADIENT = \"jsplumb_gradient_\",\n LINE_WIDTH = \"strokeWidth\",\n ns = {\n svg: \"http://www.w3.org/2000/svg\"\n },\n _attr = function (node, attributes) {\n for (var i in attributes) {\n node.setAttribute(i, \"\" + attributes[i]);\n }\n },\n _node = function (name, attributes) {\n attributes = attributes || {};\n attributes.version = \"1.1\";\n attributes.xmlns = ns.svg;\n return _jp.createElementNS(ns.svg, name, null, null, attributes);\n },\n _pos = function (d) {\n return \"position:absolute;left:\" + d[0] + \"px;top:\" + d[1] + \"px\";\n },\n _clearGradient = function (parent) {\n var els = parent.querySelectorAll(\" defs,linearGradient,radialGradient\");\n for (var i = 0; i < els.length; i++) {\n els[i].parentNode.removeChild(els[i]);\n }\n },\n _updateGradient = function (parent, node, style, dimensions, uiComponent) {\n var id = JSPLUMB_GRADIENT + uiComponent._jsPlumb.instance.idstamp();\n // first clear out any existing gradient\n _clearGradient(parent);\n // this checks for an 'offset' property in the gradient, and in the absence of it, assumes\n // we want a linear gradient. if it's there, we create a radial gradient.\n // it is possible that a more explicit means of defining the gradient type would be\n // better. relying on 'offset' means that we can never have a radial gradient that uses\n // some default offset, for instance.\n // issue 244 suggested the 'gradientUnits' attribute; without this, straight/flowchart connectors with gradients would\n // not show gradients when the line was perfectly horizontal or vertical.\n var g;\n if (!style.gradient.offset) {\n g = _node(LINEAR_GRADIENT, {id: id, gradientUnits: \"userSpaceOnUse\"});\n }\n else {\n g = _node(RADIAL_GRADIENT, { id: id });\n }\n\n var defs = _node(DEFS);\n parent.appendChild(defs);\n defs.appendChild(g);\n\n // the svg radial gradient seems to treat stops in the reverse\n // order to how canvas does it. so we want to keep all the maths the same, but\n // iterate the actual style declarations in reverse order, if the x indexes are not in order.\n for (var i = 0; i < style.gradient.stops.length; i++) {\n var styleToUse = uiComponent.segment === 1 || uiComponent.segment === 2 ? i : style.gradient.stops.length - 1 - i,\n stopColor = style.gradient.stops[styleToUse][1],\n s = _node(STOP, {\"offset\": Math.floor(style.gradient.stops[i][0] * 100) + \"%\", \"stop-color\": stopColor});\n\n g.appendChild(s);\n }\n var applyGradientTo = style.stroke ? STROKE : FILL;\n node.setAttribute(applyGradientTo, \"url(#\" + id + \")\");\n },\n _applyStyles = function (parent, node, style, dimensions, uiComponent) {\n\n node.setAttribute(FILL, style.fill ? style.fill : NONE);\n node.setAttribute(STROKE, style.stroke ? style.stroke : NONE);\n\n if (style.gradient) {\n _updateGradient(parent, node, style, dimensions, uiComponent);\n }\n else {\n // make sure we clear any existing gradient\n _clearGradient(parent);\n node.setAttribute(STYLE, \"\");\n }\n\n if (style.strokeWidth) {\n node.setAttribute(STROKE_WIDTH, style.strokeWidth);\n }\n\n // in SVG there is a stroke-dasharray attribute we can set, and its syntax looks like\n // the syntax in VML but is actually kind of nasty: values are given in the pixel\n // coordinate space, whereas in VML they are multiples of the width of the stroked\n // line, which makes a lot more sense. for that reason, jsPlumb is supporting both\n // the native svg 'stroke-dasharray' attribute, and also the 'dashstyle' concept from\n // VML, which will be the preferred method. the code below this converts a dashstyle\n // attribute given in terms of stroke width into a pixel representation, by using the\n // stroke's lineWidth.\n if (style[DASHSTYLE] && style[LINE_WIDTH] && !style[STROKE_DASHARRAY]) {\n var sep = style[DASHSTYLE].indexOf(\",\") === -1 ? \" \" : \",\",\n parts = style[DASHSTYLE].split(sep),\n styleToUse = \"\";\n parts.forEach(function (p) {\n styleToUse += (Math.floor(p * style.strokeWidth) + sep);\n });\n node.setAttribute(STROKE_DASHARRAY, styleToUse);\n }\n else if (style[STROKE_DASHARRAY]) {\n node.setAttribute(STROKE_DASHARRAY, style[STROKE_DASHARRAY]);\n }\n\n // extra attributes such as join type, dash offset.\n for (var i in svgAttributeMap) {\n if (style[i]) {\n node.setAttribute(svgAttributeMap[i], style[i]);\n }\n }\n },\n _appendAtIndex = function (svg, path, idx) {\n if (svg.childNodes.length > idx) {\n svg.insertBefore(path, svg.childNodes[idx]);\n }\n else {\n svg.appendChild(path);\n }\n };\n\n /**\n utility methods for other objects to use.\n */\n _ju.svg = {\n node: _node,\n attr: _attr,\n pos: _pos\n };\n\n // ************************** / SVG utility methods ********************************************\n\n /*\n * Base class for SVG components.\n */\n var SvgComponent = function (params) {\n var pointerEventsSpec = params.pointerEventsSpec || \"all\", renderer = {};\n\n _jp.jsPlumbUIComponent.apply(this, params.originalArgs);\n this.canvas = null;\n this.path = null;\n this.svg = null;\n this.bgCanvas = null;\n\n var clazz = params.cssClass + \" \" + (params.originalArgs[0].cssClass || \"\"),\n svgParams = {\n \"style\": \"\",\n \"width\": 0,\n \"height\": 0,\n \"pointer-events\": pointerEventsSpec,\n \"position\": \"absolute\"\n };\n\n this.svg = _node(\"svg\", svgParams);\n\n if (params.useDivWrapper) {\n this.canvas = _jp.createElement(\"div\", { position : \"absolute\" });\n _ju.sizeElement(this.canvas, 0, 0, 1, 1);\n this.canvas.className = clazz;\n }\n else {\n _attr(this.svg, { \"class\": clazz });\n this.canvas = this.svg;\n }\n\n params._jsPlumb.appendElement(this.canvas, params.originalArgs[0].parent);\n if (params.useDivWrapper) {\n this.canvas.appendChild(this.svg);\n }\n\n var displayElements = [ this.canvas ];\n this.getDisplayElements = function () {\n return displayElements;\n };\n\n this.appendDisplayElement = function (el) {\n displayElements.push(el);\n };\n\n this.paint = function (style, anchor, extents) {\n if (style != null) {\n\n var xy = [ this.x, this.y ], wh = [ this.w, this.h ], p;\n if (extents != null) {\n if (extents.xmin < 0) {\n xy[0] += extents.xmin;\n }\n if (extents.ymin < 0) {\n xy[1] += extents.ymin;\n }\n wh[0] = extents.xmax + ((extents.xmin < 0) ? -extents.xmin : 0);\n wh[1] = extents.ymax + ((extents.ymin < 0) ? -extents.ymin : 0);\n }\n\n if (params.useDivWrapper) {\n _ju.sizeElement(this.canvas, xy[0], xy[1], wh[0], wh[1]);\n xy[0] = 0;\n xy[1] = 0;\n p = _pos([ 0, 0 ]);\n }\n else {\n p = _pos([ xy[0], xy[1] ]);\n }\n\n renderer.paint.apply(this, arguments);\n\n _attr(this.svg, {\n \"style\": p,\n \"width\": wh[0] || 0,\n \"height\": wh[1] || 0\n });\n }\n };\n\n return {\n renderer: renderer\n };\n };\n\n _ju.extend(SvgComponent, _jp.jsPlumbUIComponent, {\n cleanup: function (force) {\n if (force || this.typeId == null) {\n if (this.canvas) {\n this.canvas._jsPlumb = null;\n }\n if (this.svg) {\n this.svg._jsPlumb = null;\n }\n if (this.bgCanvas) {\n this.bgCanvas._jsPlumb = null;\n }\n\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n if (this.bgCanvas && this.bgCanvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n\n this.svg = null;\n this.canvas = null;\n this.path = null;\n this.group = null;\n }\n else {\n // if not a forced cleanup, just detach from DOM for now.\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n if (this.bgCanvas && this.bgCanvas.parentNode) {\n this.bgCanvas.parentNode.removeChild(this.bgCanvas);\n }\n }\n },\n reattach:function(instance) {\n var c = instance.getContainer();\n if (this.canvas && this.canvas.parentNode == null) {\n c.appendChild(this.canvas);\n }\n if (this.bgCanvas && this.bgCanvas.parentNode == null) {\n c.appendChild(this.bgCanvas);\n }\n },\n setVisible: function (v) {\n if (this.canvas) {\n this.canvas.style.display = v ? \"block\" : \"none\";\n }\n }\n });\n\n /*\n * Base class for SVG connectors.\n */\n _jp.ConnectorRenderers.svg = function (params) {\n var self = this,\n _super = SvgComponent.apply(this, [\n {\n cssClass: params._jsPlumb.connectorClass,\n originalArgs: arguments,\n pointerEventsSpec: \"none\",\n _jsPlumb: params._jsPlumb\n }\n ]);\n\n _super.renderer.paint = function (style, anchor, extents) {\n\n var segments = self.getSegments(), p = \"\", offset = [0, 0];\n if (extents.xmin < 0) {\n offset[0] = -extents.xmin;\n }\n if (extents.ymin < 0) {\n offset[1] = -extents.ymin;\n }\n\n if (segments.length > 0) {\n\n p = self.getPathData();\n\n var a = {\n d: p,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\",\n \"pointer-events\": params[\"pointer-events\"] || \"visibleStroke\"\n },\n outlineStyle = null,\n d = [self.x, self.y, self.w, self.h];\n\n // outline style. actually means drawing an svg object underneath the main one.\n if (style.outlineStroke) {\n var outlineWidth = style.outlineWidth || 1,\n outlineStrokeWidth = style.strokeWidth + (2 * outlineWidth);\n outlineStyle = _jp.extend({}, style);\n delete outlineStyle.gradient;\n outlineStyle.stroke = style.outlineStroke;\n outlineStyle.strokeWidth = outlineStrokeWidth;\n\n if (self.bgPath == null) {\n self.bgPath = _node(\"path\", a);\n _jp.addClass(self.bgPath, _jp.connectorOutlineClass);\n _appendAtIndex(self.svg, self.bgPath, 0);\n }\n else {\n _attr(self.bgPath, a);\n }\n\n _applyStyles(self.svg, self.bgPath, outlineStyle, d, self);\n }\n\n if (self.path == null) {\n self.path = _node(\"path\", a);\n _appendAtIndex(self.svg, self.path, style.outlineStroke ? 1 : 0);\n }\n else {\n _attr(self.path, a);\n }\n\n _applyStyles(self.svg, self.path, style, d, self);\n }\n };\n };\n _ju.extend(_jp.ConnectorRenderers.svg, SvgComponent);\n\n// ******************************* svg segment renderer *****************************************************\t\n\n\n// ******************************* /svg segments *****************************************************\n\n /*\n * Base class for SVG endpoints.\n */\n var SvgEndpoint = _jp.SvgEndpoint = function (params) {\n var _super = SvgComponent.apply(this, [\n {\n cssClass: params._jsPlumb.endpointClass,\n originalArgs: arguments,\n pointerEventsSpec: \"all\",\n useDivWrapper: true,\n _jsPlumb: params._jsPlumb\n }\n ]);\n\n _super.renderer.paint = function (style) {\n var s = _jp.extend({}, style);\n if (s.outlineStroke) {\n s.stroke = s.outlineStroke;\n }\n\n if (this.node == null) {\n this.node = this.makeNode(s);\n this.svg.appendChild(this.node);\n }\n else if (this.updateNode != null) {\n this.updateNode(this.node);\n }\n _applyStyles(this.svg, this.node, s, [ this.x, this.y, this.w, this.h ], this);\n _pos(this.node, [ this.x, this.y ]);\n }.bind(this);\n\n };\n _ju.extend(SvgEndpoint, SvgComponent);\n\n /*\n * SVG Dot Endpoint\n */\n _jp.Endpoints.svg.Dot = function () {\n _jp.Endpoints.Dot.apply(this, arguments);\n SvgEndpoint.apply(this, arguments);\n this.makeNode = function (style) {\n return _node(\"circle\", {\n \"cx\": this.w / 2,\n \"cy\": this.h / 2,\n \"r\": this.radius\n });\n };\n this.updateNode = function (node) {\n _attr(node, {\n \"cx\": this.w / 2,\n \"cy\": this.h / 2,\n \"r\": this.radius\n });\n };\n };\n _ju.extend(_jp.Endpoints.svg.Dot, [_jp.Endpoints.Dot, SvgEndpoint]);\n\n /*\n * SVG Rectangle Endpoint\n */\n _jp.Endpoints.svg.Rectangle = function () {\n _jp.Endpoints.Rectangle.apply(this, arguments);\n SvgEndpoint.apply(this, arguments);\n this.makeNode = function (style) {\n return _node(\"rect\", {\n \"width\": this.w,\n \"height\": this.h\n });\n };\n this.updateNode = function (node) {\n _attr(node, {\n \"width\": this.w,\n \"height\": this.h\n });\n };\n };\n _ju.extend(_jp.Endpoints.svg.Rectangle, [_jp.Endpoints.Rectangle, SvgEndpoint]);\n\n /*\n * SVG Image Endpoint is the default image endpoint.\n */\n _jp.Endpoints.svg.Image = _jp.Endpoints.Image;\n /*\n * Blank endpoint in svg renderer is the default Blank endpoint.\n */\n _jp.Endpoints.svg.Blank = _jp.Endpoints.Blank;\n /*\n * Label overlay in svg renderer is the default Label overlay.\n */\n _jp.Overlays.svg.Label = _jp.Overlays.Label;\n /*\n * Custom overlay in svg renderer is the default Custom overlay.\n */\n _jp.Overlays.svg.Custom = _jp.Overlays.Custom;\n\n var AbstractSvgArrowOverlay = function (superclass, originalArgs) {\n superclass.apply(this, originalArgs);\n _jp.jsPlumbUIComponent.apply(this, originalArgs);\n this.isAppendedAtTopLevel = false;\n var self = this;\n this.path = null;\n this.paint = function (params, containerExtents) {\n // only draws on connections, not endpoints.\n if (params.component.svg && containerExtents) {\n if (this.path == null) {\n this.path = _node(\"path\", {\n \"pointer-events\": \"all\"\n });\n params.component.svg.appendChild(this.path);\n if (this.elementCreated) {\n this.elementCreated(this.path, params.component);\n }\n\n this.canvas = params.component.svg; // for the sake of completeness; this behaves the same as other overlays\n }\n var clazz = originalArgs && (originalArgs.length === 1) ? (originalArgs[0].cssClass || \"\") : \"\",\n offset = [0, 0];\n\n if (containerExtents.xmin < 0) {\n offset[0] = -containerExtents.xmin;\n }\n if (containerExtents.ymin < 0) {\n offset[1] = -containerExtents.ymin;\n }\n\n _attr(this.path, {\n \"d\": makePath(params.d),\n \"class\": clazz,\n stroke: params.stroke ? params.stroke : null,\n fill: params.fill ? params.fill : null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n }\n };\n var makePath = function (d) {\n return (isNaN(d.cxy.x) || isNaN(d.cxy.y)) ? \"\" : \"M\" + d.hxy.x + \",\" + d.hxy.y +\n \" L\" + d.tail[0].x + \",\" + d.tail[0].y +\n \" L\" + d.cxy.x + \",\" + d.cxy.y +\n \" L\" + d.tail[1].x + \",\" + d.tail[1].y +\n \" L\" + d.hxy.x + \",\" + d.hxy.y;\n };\n this.transfer = function(target) {\n if (target.canvas && this.path && this.path.parentNode) {\n this.path.parentNode.removeChild(this.path);\n target.canvas.appendChild(this.path);\n }\n };\n };\n _ju.extend(AbstractSvgArrowOverlay, [_jp.jsPlumbUIComponent, _jp.Overlays.AbstractOverlay], {\n cleanup: function (force) {\n if (this.path != null) {\n if (force) {\n this._jsPlumb.instance.removeElement(this.path);\n }\n else {\n if (this.path.parentNode) {\n this.path.parentNode.removeChild(this.path);\n }\n }\n }\n },\n reattach:function(instance, component) {\n if (this.path && component.canvas) {\n component.canvas.appendChild(this.path);\n }\n },\n setVisible: function (v) {\n if (this.path != null) {\n (this.path.style.display = (v ? \"block\" : \"none\"));\n }\n }\n });\n\n _jp.Overlays.svg.Arrow = function () {\n AbstractSvgArrowOverlay.apply(this, [_jp.Overlays.Arrow, arguments]);\n };\n _ju.extend(_jp.Overlays.svg.Arrow, [ _jp.Overlays.Arrow, AbstractSvgArrowOverlay ]);\n\n _jp.Overlays.svg.PlainArrow = function () {\n AbstractSvgArrowOverlay.apply(this, [_jp.Overlays.PlainArrow, arguments]);\n };\n _ju.extend(_jp.Overlays.svg.PlainArrow, [ _jp.Overlays.PlainArrow, AbstractSvgArrowOverlay ]);\n\n _jp.Overlays.svg.Diamond = function () {\n AbstractSvgArrowOverlay.apply(this, [_jp.Overlays.Diamond, arguments]);\n };\n _ju.extend(_jp.Overlays.svg.Diamond, [ _jp.Overlays.Diamond, AbstractSvgArrowOverlay ]);\n\n // a test\n _jp.Overlays.svg.GuideLines = function () {\n var path = null, self = this, p1_1, p1_2;\n _jp.Overlays.GuideLines.apply(this, arguments);\n this.paint = function (params, containerExtents) {\n if (path == null) {\n path = _node(\"path\");\n params.connector.svg.appendChild(path);\n self.attachListeners(path, params.connector);\n self.attachListeners(path, self);\n\n p1_1 = _node(\"path\");\n params.connector.svg.appendChild(p1_1);\n self.attachListeners(p1_1, params.connector);\n self.attachListeners(p1_1, self);\n\n p1_2 = _node(\"path\");\n params.connector.svg.appendChild(p1_2);\n self.attachListeners(p1_2, params.connector);\n self.attachListeners(p1_2, self);\n }\n\n var offset = [0, 0];\n if (containerExtents.xmin < 0) {\n offset[0] = -containerExtents.xmin;\n }\n if (containerExtents.ymin < 0) {\n offset[1] = -containerExtents.ymin;\n }\n\n _attr(path, {\n \"d\": makePath(params.head, params.tail),\n stroke: \"red\",\n fill: null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n\n _attr(p1_1, {\n \"d\": makePath(params.tailLine[0], params.tailLine[1]),\n stroke: \"blue\",\n fill: null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n\n _attr(p1_2, {\n \"d\": makePath(params.headLine[0], params.headLine[1]),\n stroke: \"green\",\n fill: null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n };\n\n var makePath = function (d1, d2) {\n return \"M \" + d1.x + \",\" + d1.y +\n \" L\" + d2.x + \",\" + d2.y;\n };\n };\n _ju.extend(_jp.Overlays.svg.GuideLines, _jp.Overlays.GuideLines);\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains code used when jsPlumb is being rendered in a DOM.\n *\n * Copyright (c) 2010 - 2019 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil,\n _jk = root.Katavorio, _jg = root.Biltong;\n\n var _getEventManager = function(instance) {\n var e = instance._mottle;\n if (!e) {\n e = instance._mottle = new root.Mottle();\n }\n return e;\n };\n\n var _getDragManager = function (instance, category) {\n\n category = category || \"main\";\n var key = \"_katavorio_\" + category;\n var k = instance[key],\n e = instance.getEventManager();\n\n if (!k) {\n k = new _jk({\n bind: e.on,\n unbind: e.off,\n getSize: _jp.getSize,\n getConstrainingRectangle:function(el) {\n return [ el.parentNode.scrollWidth, el.parentNode.scrollHeight ];\n },\n getPosition: function (el, relativeToRoot) {\n // if this is a nested draggable then compute the offset against its own offsetParent, otherwise\n // compute against the Container's origin. see also the getUIPosition method below.\n var o = instance.getOffset(el, relativeToRoot, el._katavorioDrag ? el.offsetParent : null);\n return [o.left, o.top];\n },\n setPosition: function (el, xy) {\n el.style.left = xy[0] + \"px\";\n el.style.top = xy[1] + \"px\";\n },\n addClass: _jp.addClass,\n removeClass: _jp.removeClass,\n intersects: _jg.intersects,\n indexOf: function(l, i) { return l.indexOf(i); },\n scope:instance.getDefaultScope(),\n css: {\n noSelect: instance.dragSelectClass,\n droppable: \"jtk-droppable\",\n draggable: \"jtk-draggable\",\n drag: \"jtk-drag\",\n selected: \"jtk-drag-selected\",\n active: \"jtk-drag-active\",\n hover: \"jtk-drag-hover\",\n ghostProxy:\"jtk-ghost-proxy\"\n }\n });\n k.setZoom(instance.getZoom());\n instance[key] = k;\n instance.bind(\"zoom\", k.setZoom);\n }\n return k;\n };\n\n var _dragStart=function(params) {\n var options = params.el._jsPlumbDragOptions;\n var cont = true;\n if (options.canDrag) {\n cont = options.canDrag();\n }\n if (cont) {\n this.setHoverSuspended(true);\n this.select({source: params.el}).addClass(this.elementDraggingClass + \" \" + this.sourceElementDraggingClass, true);\n this.select({target: params.el}).addClass(this.elementDraggingClass + \" \" + this.targetElementDraggingClass, true);\n this.setConnectionBeingDragged(true);\n }\n return cont;\n };\n var _dragMove=function(params) {\n var ui = this.getUIPosition(arguments, this.getZoom());\n if (ui != null) {\n var o = params.el._jsPlumbDragOptions;\n this.draw(params.el, ui, null, true);\n if (o._dragging) {\n this.addClass(params.el, \"jtk-dragged\");\n }\n o._dragging = true;\n }\n };\n var _dragStop=function(params) {\n var elements = params.selection, uip;\n\n var _one = function (_e) {\n if (_e[1] != null) {\n // run the reported offset through the code that takes parent containers\n // into account, to adjust if necessary (issue 554)\n uip = this.getUIPosition([{\n el:_e[2].el,\n pos:[_e[1].left, _e[1].top]\n }]);\n this.draw(_e[2].el, uip);\n }\n\n delete _e[0]._jsPlumbDragOptions._dragging;\n\n this.removeClass(_e[0], \"jtk-dragged\");\n this.select({source: _e[2].el}).removeClass(this.elementDraggingClass + \" \" + this.sourceElementDraggingClass, true);\n this.select({target: _e[2].el}).removeClass(this.elementDraggingClass + \" \" + this.targetElementDraggingClass, true);\n this.getDragManager().dragEnded(_e[2].el);\n }.bind(this);\n\n for (var i = 0; i < elements.length; i++) {\n _one(elements[i]);\n }\n\n this.setHoverSuspended(false);\n this.setConnectionBeingDragged(false);\n };\n\n var _animProps = function (o, p) {\n var _one = function (pName) {\n if (p[pName] != null) {\n if (_ju.isString(p[pName])) {\n var m = p[pName].match(/-=/) ? -1 : 1,\n v = p[pName].substring(2);\n return o[pName] + (m * v);\n }\n else {\n return p[pName];\n }\n }\n else {\n return o[pName];\n }\n };\n return [ _one(\"left\"), _one(\"top\") ];\n };\n\n var _genLoc = function (prefix, e) {\n if (e == null) {\n return [ 0, 0 ];\n }\n var ts = _touches(e), t = _getTouch(ts, 0);\n return [t[prefix + \"X\"], t[prefix + \"Y\"]];\n },\n _pageLocation = _genLoc.bind(this, \"page\"),\n _screenLocation = _genLoc.bind(this, \"screen\"),\n _clientLocation = _genLoc.bind(this, \"client\"),\n _getTouch = function (touches, idx) {\n return touches.item ? touches.item(idx) : touches[idx];\n },\n _touches = function (e) {\n return e.touches && e.touches.length > 0 ? e.touches :\n e.changedTouches && e.changedTouches.length > 0 ? e.changedTouches :\n e.targetTouches && e.targetTouches.length > 0 ? e.targetTouches :\n [ e ];\n };\n\n /**\n Manages dragging for some instance of jsPlumb.\n\n TODO instead of this being accessed directly, it should subscribe to events on the jsPlumb instance: every method\n in here is called directly by jsPlumb. But what should happen is that we have unpublished events that this listens\n to. The only trick is getting one of these instantiated with every jsPlumb instance: it needs to have a hook somehow.\n Basically the general idea is to pull ALL the drag code out (prototype method registrations plus this) into a\n dedicated drag script), that does not necessarily need to be included.\n\n\n */\n var DragManager = function (_currentInstance) {\n var _draggables = {}, _dlist = [], _delements = {}, _elementsWithEndpoints = {},\n // elementids mapped to the draggable to which they belong.\n _draggablesForElements = {};\n\n /**\n register some element as draggable. right now the drag init stuff is done elsewhere, and it is\n possible that will continue to be the case.\n */\n this.register = function (el) {\n var id = _currentInstance.getId(el),\n parentOffset;\n\n if (!_draggables[id]) {\n _draggables[id] = el;\n _dlist.push(el);\n _delements[id] = {};\n }\n\n // look for child elements that have endpoints and register them against this draggable.\n var _oneLevel = function (p) {\n if (p) {\n for (var i = 0; i < p.childNodes.length; i++) {\n if (p.childNodes[i].nodeType !== 3 && p.childNodes[i].nodeType !== 8) {\n var cEl = jsPlumb.getElement(p.childNodes[i]),\n cid = _currentInstance.getId(p.childNodes[i], null, true);\n if (cid && _elementsWithEndpoints[cid] && _elementsWithEndpoints[cid] > 0) {\n if (!parentOffset) {\n parentOffset = _currentInstance.getOffset(el);\n }\n var cOff = _currentInstance.getOffset(cEl);\n _delements[id][cid] = {\n id: cid,\n offset: {\n left: cOff.left - parentOffset.left,\n top: cOff.top - parentOffset.top\n }\n };\n _draggablesForElements[cid] = id;\n }\n _oneLevel(p.childNodes[i]);\n }\n }\n }\n };\n\n _oneLevel(el);\n };\n\n // refresh the offsets for child elements of this element.\n this.updateOffsets = function (elId, childOffsetOverrides) {\n if (elId != null) {\n childOffsetOverrides = childOffsetOverrides || {};\n var domEl = jsPlumb.getElement(elId),\n id = _currentInstance.getId(domEl),\n children = _delements[id],\n parentOffset;\n\n if (children) {\n for (var i in children) {\n if (children.hasOwnProperty(i)) {\n var cel = jsPlumb.getElement(i),\n cOff = childOffsetOverrides[i] || _currentInstance.getOffset(cel);\n\n // do not update if we have a value already and we'd just be writing 0,0\n if (cel.offsetParent == null && _delements[id][i] != null) {\n continue;\n }\n\n if (!parentOffset) {\n parentOffset = _currentInstance.getOffset(domEl);\n }\n\n _delements[id][i] = {\n id: i,\n offset: {\n left: cOff.left - parentOffset.left,\n top: cOff.top - parentOffset.top\n }\n };\n _draggablesForElements[i] = id;\n }\n }\n }\n }\n };\n\n /**\n notification that an endpoint was added to the given el. we go up from that el's parent\n node, looking for a parent that has been registered as a draggable. if we find one, we add this\n el to that parent's list of elements to update on drag (if it is not there already)\n */\n this.endpointAdded = function (el, id) {\n\n id = id || _currentInstance.getId(el);\n\n var b = document.body,\n p = el.parentNode;\n\n _elementsWithEndpoints[id] = _elementsWithEndpoints[id] ? _elementsWithEndpoints[id] + 1 : 1;\n\n while (p != null && p !== b) {\n var pid = _currentInstance.getId(p, null, true);\n if (pid && _draggables[pid]) {\n var pLoc = _currentInstance.getOffset(p);\n\n if (_delements[pid][id] == null) {\n var cLoc = _currentInstance.getOffset(el);\n _delements[pid][id] = {\n id: id,\n offset: {\n left: cLoc.left - pLoc.left,\n top: cLoc.top - pLoc.top\n }\n };\n _draggablesForElements[id] = pid;\n }\n break;\n }\n p = p.parentNode;\n }\n };\n\n this.endpointDeleted = function (endpoint) {\n if (_elementsWithEndpoints[endpoint.elementId]) {\n _elementsWithEndpoints[endpoint.elementId]--;\n if (_elementsWithEndpoints[endpoint.elementId] <= 0) {\n for (var i in _delements) {\n if (_delements.hasOwnProperty(i) && _delements[i]) {\n delete _delements[i][endpoint.elementId];\n delete _draggablesForElements[endpoint.elementId];\n }\n }\n }\n }\n };\n\n this.changeId = function (oldId, newId) {\n _delements[newId] = _delements[oldId];\n _delements[oldId] = {};\n _draggablesForElements[newId] = _draggablesForElements[oldId];\n _draggablesForElements[oldId] = null;\n };\n\n this.getElementsForDraggable = function (id) {\n return _delements[id];\n };\n\n this.elementRemoved = function (elementId) {\n var elId = _draggablesForElements[elementId];\n if (elId) {\n delete _delements[elId][elementId];\n delete _draggablesForElements[elementId];\n }\n };\n\n this.reset = function () {\n _draggables = {};\n _dlist = [];\n _delements = {};\n _elementsWithEndpoints = {};\n };\n\n //\n // notification drag ended. We check automatically if need to update some\n // ancestor's offsets.\n //\n this.dragEnded = function (el) {\n if (el.offsetParent != null) {\n var id = _currentInstance.getId(el),\n ancestor = _draggablesForElements[id];\n\n if (ancestor) {\n this.updateOffsets(ancestor);\n }\n }\n };\n\n this.setParent = function (el, elId, p, pId, currentChildLocation) {\n var current = _draggablesForElements[elId];\n if (!_delements[pId]) {\n _delements[pId] = {};\n }\n var pLoc = _currentInstance.getOffset(p),\n cLoc = currentChildLocation || _currentInstance.getOffset(el);\n\n if (current && _delements[current]) {\n delete _delements[current][elId];\n }\n\n _delements[pId][elId] = {\n id:elId,\n offset : {\n left: cLoc.left - pLoc.left,\n top: cLoc.top - pLoc.top\n }\n };\n _draggablesForElements[elId] = pId;\n };\n\n this.clearParent = function(el, elId) {\n var current = _draggablesForElements[elId];\n if (current) {\n delete _delements[current][elId];\n delete _draggablesForElements[elId];\n }\n };\n\n this.revalidateParent = function(el, elId, childOffset) {\n var current = _draggablesForElements[elId];\n if (current) {\n var co = {};\n co[elId] = childOffset;\n this.updateOffsets(current, co);\n _currentInstance.revalidate(current);\n }\n };\n\n this.getDragAncestor = function (el) {\n var de = jsPlumb.getElement(el),\n id = _currentInstance.getId(de),\n aid = _draggablesForElements[id];\n\n if (aid) {\n return jsPlumb.getElement(aid);\n }\n else {\n return null;\n }\n };\n\n };\n\n var _setClassName = function (el, cn, classList) {\n cn = _ju.fastTrim(cn);\n if (typeof el.className.baseVal !== \"undefined\") {\n el.className.baseVal = cn;\n }\n else {\n el.className = cn;\n }\n\n // recent (i currently have 61.0.3163.100) version of chrome do not update classList when you set the base val\n // of an svg element's className. in the long run we'd like to move to just using classList anyway\n try {\n var cl = el.classList;\n if (cl != null) {\n while (cl.length > 0) {\n cl.remove(cl.item(0));\n }\n for (var i = 0; i < classList.length; i++) {\n if (classList[i]) {\n cl.add(classList[i]);\n }\n }\n }\n }\n catch(e) {\n // not fatal\n _ju.log(\"JSPLUMB: cannot set class list\", e);\n }\n },\n _getClassName = function (el) {\n return (typeof el.className.baseVal === \"undefined\") ? el.className : el.className.baseVal;\n },\n _classManip = function (el, classesToAdd, classesToRemove) {\n classesToAdd = classesToAdd == null ? [] : _ju.isArray(classesToAdd) ? classesToAdd : classesToAdd.split(/\\s+/);\n classesToRemove = classesToRemove == null ? [] : _ju.isArray(classesToRemove) ? classesToRemove : classesToRemove.split(/\\s+/);\n\n var className = _getClassName(el),\n curClasses = className.split(/\\s+/);\n\n var _oneSet = function (add, classes) {\n for (var i = 0; i < classes.length; i++) {\n if (add) {\n if (curClasses.indexOf(classes[i]) === -1) {\n curClasses.push(classes[i]);\n }\n }\n else {\n var idx = curClasses.indexOf(classes[i]);\n if (idx !== -1) {\n curClasses.splice(idx, 1);\n }\n }\n }\n };\n\n _oneSet(true, classesToAdd);\n _oneSet(false, classesToRemove);\n\n _setClassName(el, curClasses.join(\" \"), curClasses);\n };\n\n root.jsPlumb.extend(root.jsPlumbInstance.prototype, {\n\n headless: false,\n\n pageLocation: _pageLocation,\n screenLocation: _screenLocation,\n clientLocation: _clientLocation,\n\n getDragManager:function() {\n if (this.dragManager == null) {\n this.dragManager = new DragManager(this);\n }\n\n return this.dragManager;\n },\n\n recalculateOffsets:function(elId) {\n this.getDragManager().updateOffsets(elId);\n },\n\n createElement:function(tag, style, clazz, atts) {\n return this.createElementNS(null, tag, style, clazz, atts);\n },\n\n createElementNS:function(ns, tag, style, clazz, atts) {\n var e = ns == null ? document.createElement(tag) : document.createElementNS(ns, tag);\n var i;\n style = style || {};\n for (i in style) {\n e.style[i] = style[i];\n }\n\n if (clazz) {\n e.className = clazz;\n }\n\n atts = atts || {};\n for (i in atts) {\n e.setAttribute(i, \"\" + atts[i]);\n }\n\n return e;\n },\n\n getAttribute: function (el, attName) {\n return el.getAttribute != null ? el.getAttribute(attName) : null;\n },\n\n setAttribute: function (el, a, v) {\n if (el.setAttribute != null) {\n el.setAttribute(a, v);\n }\n },\n\n setAttributes: function (el, atts) {\n for (var i in atts) {\n if (atts.hasOwnProperty(i)) {\n el.setAttribute(i, atts[i]);\n }\n }\n },\n appendToRoot: function (node) {\n document.body.appendChild(node);\n },\n getRenderModes: function () {\n return [ \"svg\" ];\n },\n getClass:_getClassName,\n addClass: function (el, clazz) {\n jsPlumb.each(el, function (e) {\n _classManip(e, clazz);\n });\n },\n hasClass: function (el, clazz) {\n el = jsPlumb.getElement(el);\n if (el.classList) {\n return el.classList.contains(clazz);\n }\n else {\n return _getClassName(el).indexOf(clazz) !== -1;\n }\n },\n removeClass: function (el, clazz) {\n jsPlumb.each(el, function (e) {\n _classManip(e, null, clazz);\n });\n },\n toggleClass:function(el, clazz) {\n if (jsPlumb.hasClass(el, clazz)) {\n jsPlumb.removeClass(el, clazz);\n } else {\n jsPlumb.addClass(el, clazz);\n }\n },\n updateClasses: function (el, toAdd, toRemove) {\n jsPlumb.each(el, function (e) {\n _classManip(e, toAdd, toRemove);\n });\n },\n setClass: function (el, clazz) {\n if (clazz != null) {\n jsPlumb.each(el, function (e) {\n _setClassName(e, clazz, clazz.split(/\\s+/));\n });\n }\n },\n setPosition: function (el, p) {\n el.style.left = p.left + \"px\";\n el.style.top = p.top + \"px\";\n },\n getPosition: function (el) {\n var _one = function (prop) {\n var v = el.style[prop];\n return v ? v.substring(0, v.length - 2) : 0;\n };\n return {\n left: _one(\"left\"),\n top: _one(\"top\")\n };\n },\n getStyle:function(el, prop) {\n if (typeof window.getComputedStyle !== 'undefined') {\n return getComputedStyle(el, null).getPropertyValue(prop);\n } else {\n return el.currentStyle[prop];\n }\n },\n getSelector: function (ctx, spec) {\n var sel = null;\n if (arguments.length === 1) {\n sel = ctx.nodeType != null ? ctx : document.querySelectorAll(ctx);\n }\n else {\n sel = ctx.querySelectorAll(spec);\n }\n\n return sel;\n },\n getOffset:function(el, relativeToRoot, container) {\n el = jsPlumb.getElement(el);\n container = container || this.getContainer();\n var out = {\n left: el.offsetLeft,\n top: el.offsetTop\n },\n op = (relativeToRoot || (container != null && (el !== container && el.offsetParent !== container))) ? el.offsetParent : null,\n _maybeAdjustScroll = function(offsetParent) {\n if (offsetParent != null && offsetParent !== document.body && (offsetParent.scrollTop > 0 || offsetParent.scrollLeft > 0)) {\n out.left -= offsetParent.scrollLeft;\n out.top -= offsetParent.scrollTop;\n }\n }.bind(this);\n\n while (op != null) {\n out.left += op.offsetLeft;\n out.top += op.offsetTop;\n _maybeAdjustScroll(op);\n op = relativeToRoot ? op.offsetParent :\n op.offsetParent === container ? null : op.offsetParent;\n }\n\n // if container is scrolled and the element (or its offset parent) is not absolute or fixed, adjust accordingly.\n if (container != null && !relativeToRoot && (container.scrollTop > 0 || container.scrollLeft > 0)) {\n var pp = el.offsetParent != null ? this.getStyle(el.offsetParent, \"position\") : \"static\",\n p = this.getStyle(el, \"position\");\n if (p !== \"absolute\" && p !== \"fixed\" && pp !== \"absolute\" && pp !== \"fixed\") {\n out.left -= container.scrollLeft;\n out.top -= container.scrollTop;\n }\n }\n return out;\n },\n //\n // return x+y proportion of the given element's size corresponding to the location of the given event.\n //\n getPositionOnElement: function (evt, el, zoom) {\n var box = typeof el.getBoundingClientRect !== \"undefined\" ? el.getBoundingClientRect() : { left: 0, top: 0, width: 0, height: 0 },\n body = document.body,\n docElem = document.documentElement,\n scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop,\n scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft,\n clientTop = docElem.clientTop || body.clientTop || 0,\n clientLeft = docElem.clientLeft || body.clientLeft || 0,\n pst = 0,\n psl = 0,\n top = box.top + scrollTop - clientTop + (pst * zoom),\n left = box.left + scrollLeft - clientLeft + (psl * zoom),\n cl = jsPlumb.pageLocation(evt),\n w = box.width || (el.offsetWidth * zoom),\n h = box.height || (el.offsetHeight * zoom),\n x = (cl[0] - left) / w,\n y = (cl[1] - top) / h;\n\n return [ x, y ];\n },\n\n /**\n * Gets the absolute position of some element as read from the left/top properties in its style.\n * @method getAbsolutePosition\n * @param {Element} el The element to retrieve the absolute coordinates from. **Note** this is a DOM element, not a selector from the underlying library.\n * @return {Number[]} [left, top] pixel values.\n */\n getAbsolutePosition: function (el) {\n var _one = function (s) {\n var ss = el.style[s];\n if (ss) {\n return parseFloat(ss.substring(0, ss.length - 2));\n }\n };\n return [ _one(\"left\"), _one(\"top\") ];\n },\n\n /**\n * Sets the absolute position of some element by setting the left/top properties in its style.\n * @method setAbsolutePosition\n * @param {Element} el The element to set the absolute coordinates on. **Note** this is a DOM element, not a selector from the underlying library.\n * @param {Number[]} xy x and y coordinates\n * @param {Number[]} [animateFrom] Optional previous xy to animate from.\n * @param {Object} [animateOptions] Options for the animation.\n */\n setAbsolutePosition: function (el, xy, animateFrom, animateOptions) {\n if (animateFrom) {\n this.animate(el, {\n left: \"+=\" + (xy[0] - animateFrom[0]),\n top: \"+=\" + (xy[1] - animateFrom[1])\n }, animateOptions);\n }\n else {\n el.style.left = xy[0] + \"px\";\n el.style.top = xy[1] + \"px\";\n }\n },\n /**\n * gets the size for the element, in an array : [ width, height ].\n */\n getSize: function (el) {\n return [ el.offsetWidth, el.offsetHeight ];\n },\n getWidth: function (el) {\n return el.offsetWidth;\n },\n getHeight: function (el) {\n return el.offsetHeight;\n },\n getRenderMode : function() { return \"svg\"; },\n draggable : function (el, options) {\n var info;\n el = _ju.isArray(el) || (el.length != null && !_ju.isString(el)) ? el: [ el ];\n Array.prototype.slice.call(el).forEach(function(_el) {\n info = this.info(_el);\n if (info.el) {\n this._initDraggableIfNecessary(info.el, true, options, info.id, true);\n }\n }.bind(this));\n return this;\n },\n initDraggable: function (el, options, category) {\n _getDragManager(this, category).draggable(el, options);\n el._jsPlumbDragOptions = options;\n },\n destroyDraggable: function (el, category) {\n _getDragManager(this, category).destroyDraggable(el);\n delete el._jsPlumbDragOptions;\n },\n unbindDraggable: function (el, evt, fn, category) {\n _getDragManager(this, category).destroyDraggable(el, evt, fn);\n },\n setDraggable : function (element, draggable) {\n return jsPlumb.each(element, function (el) {\n if (this.isDragSupported(el)) {\n this._draggableStates[this.getAttribute(el, \"id\")] = draggable;\n this.setElementDraggable(el, draggable);\n }\n }.bind(this));\n },\n _draggableStates : {},\n /*\n * toggles the draggable state of the given element(s).\n * el is either an id, or an element object, or a list of ids/element objects.\n */\n toggleDraggable : function (el) {\n var state;\n jsPlumb.each(el, function (el) {\n var elId = this.getAttribute(el, \"id\");\n state = this._draggableStates[elId] == null ? false : this._draggableStates[elId];\n state = !state;\n this._draggableStates[elId] = state;\n this.setDraggable(el, state);\n return state;\n }.bind(this));\n return state;\n },\n _initDraggableIfNecessary : function (element, isDraggable, dragOptions, id, fireEvent) {\n // TODO FIRST: move to DragManager. including as much of the decision to init dragging as possible.\n if (!jsPlumb.headless) {\n var _draggable = isDraggable == null ? false : isDraggable;\n if (_draggable) {\n if (jsPlumb.isDragSupported(element, this)) {\n var options = dragOptions || this.Defaults.DragOptions;\n options = jsPlumb.extend({}, options); // make a copy.\n if (!jsPlumb.isAlreadyDraggable(element, this)) {\n var dragEvent = jsPlumb.dragEvents.drag,\n stopEvent = jsPlumb.dragEvents.stop,\n startEvent = jsPlumb.dragEvents.start;\n\n this.manage(id, element);\n\n options[startEvent] = _ju.wrap(options[startEvent], _dragStart.bind(this));\n\n options[dragEvent] = _ju.wrap(options[dragEvent], _dragMove.bind(this));\n\n options[stopEvent] = _ju.wrap(options[stopEvent], _dragStop.bind(this));\n\n var elId = this.getId(element); // need ID\n\n this._draggableStates[elId] = true;\n var draggable = this._draggableStates[elId];\n\n options.disabled = draggable == null ? false : !draggable;\n this.initDraggable(element, options);\n this.getDragManager().register(element);\n if (fireEvent) {\n this.fire(\"elementDraggable\", {el:element, options:options});\n }\n }\n else {\n // already draggable. attach any start, drag or stop listeners to the current Drag.\n if (dragOptions.force) {\n this.initDraggable(element, options);\n }\n }\n }\n }\n }\n },\n animationSupported:true,\n getElement: function (el) {\n if (el == null) {\n return null;\n }\n // here we pluck the first entry if el was a list of entries.\n // this is not my favourite thing to do, but previous versions of\n // jsplumb supported jquery selectors, and it is possible a selector\n // will be passed in here.\n el = typeof el === \"string\" ? el : el.length != null && el.enctype == null ? el[0] : el;\n return typeof el === \"string\" ? document.getElementById(el) : el;\n },\n removeElement: function (element) {\n _getDragManager(this).elementRemoved(element);\n this.getEventManager().remove(element);\n },\n //\n // this adapter supports a rudimentary animation function. no easing is supported. only\n // left/top properties are supported. property delta args are expected to be in the form\n //\n // +=x.xxxx\n //\n // or\n //\n // -=x.xxxx\n //\n doAnimate: function (el, properties, options) {\n options = options || {};\n var o = this.getOffset(el),\n ap = _animProps(o, properties),\n ldist = ap[0] - o.left,\n tdist = ap[1] - o.top,\n d = options.duration || 250,\n step = 15, steps = d / step,\n linc = (step / d) * ldist,\n tinc = (step / d) * tdist,\n idx = 0,\n _int = setInterval(function () {\n _jp.setPosition(el, {\n left: o.left + (linc * (idx + 1)),\n top: o.top + (tinc * (idx + 1))\n });\n if (options.step != null) {\n options.step(idx, Math.ceil(steps));\n }\n idx++;\n if (idx >= steps) {\n window.clearInterval(_int);\n if (options.complete != null) {\n options.complete();\n }\n }\n }, step);\n },\n // DRAG/DROP\n\n\n destroyDroppable: function (el, category) {\n _getDragManager(this, category).destroyDroppable(el);\n },\n unbindDroppable: function (el, evt, fn, category) {\n _getDragManager(this, category).destroyDroppable(el, evt, fn);\n },\n\n droppable :function(el, options) {\n el = _ju.isArray(el) || (el.length != null && !_ju.isString(el)) ? el: [ el ];\n var info;\n options = options || {};\n options.allowLoopback = false;\n Array.prototype.slice.call(el).forEach(function(_el) {\n info = this.info(_el);\n if (info.el) {\n this.initDroppable(info.el, options);\n }\n }.bind(this));\n return this;\n },\n\n initDroppable: function (el, options, category) {\n _getDragManager(this, category).droppable(el, options);\n },\n isAlreadyDraggable: function (el) {\n return el._katavorioDrag != null;\n },\n isDragSupported: function (el, options) {\n return true;\n },\n isDropSupported: function (el, options) {\n return true;\n },\n isElementDraggable: function (el) {\n el = _jp.getElement(el);\n return el._katavorioDrag && el._katavorioDrag.isEnabled();\n },\n getDragObject: function (eventArgs) {\n return eventArgs[0].drag.getDragElement();\n },\n getDragScope: function (el) {\n return el._katavorioDrag && el._katavorioDrag.scopes.join(\" \") || \"\";\n },\n getDropEvent: function (args) {\n return args[0].e;\n },\n getUIPosition: function (eventArgs, zoom) {\n // here the position reported to us by Katavorio is relative to the element's offsetParent. For top\n // level nodes that is fine, but if we have a nested draggable then its offsetParent is actually\n // not going to be the jsplumb container; it's going to be some child of that element. In that case\n // we want to adjust the UI position to account for the offsetParent's position relative to the Container\n // origin.\n var el = eventArgs[0].el;\n if (el.offsetParent == null) {\n return null;\n }\n var finalPos = eventArgs[0].finalPos || eventArgs[0].pos;\n var p = { left:finalPos[0], top:finalPos[1] };\n if (el._katavorioDrag && el.offsetParent !== this.getContainer()) {\n var oc = this.getOffset(el.offsetParent);\n p.left += oc.left;\n p.top += oc.top;\n }\n return p;\n },\n setDragFilter: function (el, filter, _exclude) {\n if (el._katavorioDrag) {\n el._katavorioDrag.setFilter(filter, _exclude);\n }\n },\n setElementDraggable: function (el, draggable) {\n el = _jp.getElement(el);\n if (el._katavorioDrag) {\n el._katavorioDrag.setEnabled(draggable);\n }\n },\n setDragScope: function (el, scope) {\n if (el._katavorioDrag) {\n el._katavorioDrag.k.setDragScope(el, scope);\n }\n },\n setDropScope:function(el, scope) {\n if (el._katavorioDrop && el._katavorioDrop.length > 0) {\n el._katavorioDrop[0].k.setDropScope(el, scope);\n }\n },\n addToPosse:function(el, spec) {\n var specs = Array.prototype.slice.call(arguments, 1);\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) {\n _el = [ _jp.getElement(_el) ];\n _el.push.apply(_el, specs );\n dm.addToPosse.apply(dm, _el);\n });\n },\n setPosse:function(el, spec) {\n var specs = Array.prototype.slice.call(arguments, 1);\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) {\n _el = [ _jp.getElement(_el) ];\n _el.push.apply(_el, specs );\n dm.setPosse.apply(dm, _el);\n });\n },\n removeFromPosse:function(el, posseId) {\n var specs = Array.prototype.slice.call(arguments, 1);\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) {\n _el = [ _jp.getElement(_el) ];\n _el.push.apply(_el, specs );\n dm.removeFromPosse.apply(dm, _el);\n });\n },\n removeFromAllPosses:function(el) {\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) { dm.removeFromAllPosses(_jp.getElement(_el)); });\n },\n setPosseState:function(el, posseId, state) {\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) { dm.setPosseState(_jp.getElement(_el), posseId, state); });\n },\n dragEvents: {\n 'start': 'start', 'stop': 'stop', 'drag': 'drag', 'step': 'step',\n 'over': 'over', 'out': 'out', 'drop': 'drop', 'complete': 'complete',\n 'beforeStart':'beforeStart'\n },\n animEvents: {\n 'step': \"step\", 'complete': 'complete'\n },\n stopDrag: function (el) {\n if (el._katavorioDrag) {\n el._katavorioDrag.abort();\n }\n },\n addToDragSelection: function (spec) {\n _getDragManager(this).select(spec);\n },\n removeFromDragSelection: function (spec) {\n _getDragManager(this).deselect(spec);\n },\n clearDragSelection: function () {\n _getDragManager(this).deselectAll();\n },\n trigger: function (el, event, originalEvent, payload) {\n this.getEventManager().trigger(el, event, originalEvent, payload);\n },\n doReset:function() {\n // look for katavorio instances and reset each one if found.\n for (var key in this) {\n if (key.indexOf(\"_katavorio_\") === 0) {\n this[key].reset();\n }\n }\n },\n getEventManager:function() {\n return _getEventManager(this);\n },\n on : function(el, event, callback) {\n // TODO: here we would like to map the tap event if we know its\n // an internal bind to a click. we have to know its internal because only\n // then can we be sure that the UP event wont be consumed (tap is a synthesized\n // event from a mousedown followed by a mouseup).\n //event = { \"click\":\"tap\", \"dblclick\":\"dbltap\"}[event] || event;\n this.getEventManager().on.apply(this, arguments);\n return this;\n },\n off : function(el, event, callback) {\n this.getEventManager().off.apply(this, arguments);\n return this;\n }\n\n });\n\n var ready = function (f) {\n var _do = function () {\n if (/complete|loaded|interactive/.test(document.readyState) && typeof(document.body) !== \"undefined\" && document.body != null) {\n f();\n }\n else {\n setTimeout(_do, 9);\n }\n };\n\n _do();\n };\n ready(_jp.init);\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/jsplumb/dist/js/jsplumb.js\n// module id = 721\n// module chunks = 3 4 5","\nimport i18n from '@/module/i18n'\n\n/**\n * cycle\n */\nconst cycleList = [\n {\n value: 'month',\n label: `${i18n.$t('月')}`\n },\n {\n value: 'week',\n label: `${i18n.$t('周')}`\n },\n {\n value: 'day',\n label: `${i18n.$t('日')}`\n },\n {\n value: 'hour',\n label: `${i18n.$t('时')}`\n }\n]\n\n/**\n * cycle value\n */\nconst dateValueList = {\n 'hour': [\n {\n value: 'last1Hour',\n label: `${i18n.$t('前1小时')}`\n },\n {\n value: 'last2Hours',\n label: `${i18n.$t('前2小时')}`\n },\n {\n value: 'last3Hours',\n label: `${i18n.$t('前3小时')}`\n }\n ],\n 'day': [\n {\n value: 'last1Days',\n label: `${i18n.$t('昨天')}`\n },\n {\n value: 'last2Days',\n label: `${i18n.$t('前两天')}`\n },\n {\n value: 'last3Days',\n label: `${i18n.$t('前三天')}`\n },\n {\n value: 'last7Days',\n label: `${i18n.$t('前七天')}`\n }\n ],\n 'week': [\n {\n value: 'lastWeek',\n label: `${i18n.$t('上周')}`\n },\n {\n value: 'lastMonday',\n label: `${i18n.$t('上周一')}`\n },\n {\n value: 'lastTuesday',\n label: `${i18n.$t('上周二')}`\n },\n {\n value: 'lastWednesday',\n label: `${i18n.$t('上周三')}`\n },\n {\n value: 'lastThursday',\n label: `${i18n.$t('上周四')}`\n },\n {\n value: 'lastFriday',\n label: `${i18n.$t('上周五')}`\n },\n {\n value: 'lastSaturday',\n label: `${i18n.$t('上周六')}`\n },\n {\n value: 'lastSunday',\n label: `${i18n.$t('上周日')}`\n }\n ],\n 'month': [\n {\n value: 'lastMonth',\n label: `${i18n.$t('上月')}`\n },\n {\n value: 'lastMonthBegin',\n label: `${i18n.$t('上月初')}`\n },\n {\n value: 'lastMonthEnd',\n label: `${i18n.$t('上月末')}`\n }\n ]\n}\n\n/**\n * direct\n */\nconst directList = [\n {\n id: 1,\n code: 'IN',\n disabled: false\n },\n {\n id: 2,\n code: 'OUT',\n disabled: false\n }\n]\n\n/**\n * type\n */\nconst typeList = [\n {\n id: 1,\n code: 'VARCHAR',\n disabled: false\n },\n {\n id: 2,\n code: 'INTEGER',\n disabled: false\n },\n {\n id: 3,\n code: 'LONG',\n disabled: false\n },\n {\n id: 4,\n code: 'FLOAT',\n disabled: false\n },\n {\n id: 5,\n code: 'DOUBLE',\n disabled: false\n },\n {\n id: 6,\n code: 'DATE',\n disabled: false\n },\n {\n id: 7,\n code: 'TIME',\n disabled: false\n },\n {\n id: 8,\n code: 'TIMESTAMP',\n disabled: false\n },\n {\n id: 9,\n code: 'BOOLEAN',\n disabled: false\n }\n]\n\n/**\n * sqlType\n */\nconst sqlTypeList = [\n {\n id: 0,\n code: `${i18n.$t('查询')}`\n },\n {\n id: 1,\n code: `${i18n.$t('非查询')}`\n }\n]\n\nexport {\n cycleList,\n dateValueList,\n typeList,\n directList,\n sqlTypeList\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/formModel/tasks/_source/commcon.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/log.vue","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var HINT_ELEMENT_CLASS = \"CodeMirror-hint\";\n var ACTIVE_HINT_ELEMENT_CLASS = \"CodeMirror-hint-active\";\n\n // This is the old interface, kept around for now to stay\n // backwards-compatible.\n CodeMirror.showHint = function(cm, getHints, options) {\n if (!getHints) return cm.showHint(options);\n if (options && options.async) getHints.async = true;\n var newOpts = {hint: getHints};\n if (options) for (var prop in options) newOpts[prop] = options[prop];\n return cm.showHint(newOpts);\n };\n\n CodeMirror.defineExtension(\"showHint\", function(options) {\n options = parseOptions(this, this.getCursor(\"start\"), options);\n var selections = this.listSelections()\n if (selections.length > 1) return;\n // By default, don't allow completion when something is selected.\n // A hint function can have a `supportsSelection` property to\n // indicate that it can handle selections.\n if (this.somethingSelected()) {\n if (!options.hint.supportsSelection) return;\n // Don't try with cross-line selections\n for (var i = 0; i < selections.length; i++)\n if (selections[i].head.line != selections[i].anchor.line) return;\n }\n\n if (this.state.completionActive) this.state.completionActive.close();\n var completion = this.state.completionActive = new Completion(this, options);\n if (!completion.options.hint) return;\n\n CodeMirror.signal(this, \"startCompletion\", this);\n completion.update(true);\n });\n\n CodeMirror.defineExtension(\"closeHint\", function() {\n if (this.state.completionActive) this.state.completionActive.close()\n })\n\n function Completion(cm, options) {\n this.cm = cm;\n this.options = options;\n this.widget = null;\n this.debounce = 0;\n this.tick = 0;\n this.startPos = this.cm.getCursor(\"start\");\n this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length;\n\n var self = this;\n cm.on(\"cursorActivity\", this.activityFunc = function() { self.cursorActivity(); });\n }\n\n var requestAnimationFrame = window.requestAnimationFrame || function(fn) {\n return setTimeout(fn, 1000/60);\n };\n var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;\n\n Completion.prototype = {\n close: function() {\n if (!this.active()) return;\n this.cm.state.completionActive = null;\n this.tick = null;\n this.cm.off(\"cursorActivity\", this.activityFunc);\n\n if (this.widget && this.data) CodeMirror.signal(this.data, \"close\");\n if (this.widget) this.widget.close();\n CodeMirror.signal(this.cm, \"endCompletion\", this.cm);\n },\n\n active: function() {\n return this.cm.state.completionActive == this;\n },\n\n pick: function(data, i) {\n var completion = data.list[i];\n if (completion.hint) completion.hint(this.cm, data, completion);\n else this.cm.replaceRange(getText(completion), completion.from || data.from,\n completion.to || data.to, \"complete\");\n CodeMirror.signal(data, \"pick\", completion);\n this.close();\n },\n\n cursorActivity: function() {\n if (this.debounce) {\n cancelAnimationFrame(this.debounce);\n this.debounce = 0;\n }\n\n var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line);\n if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch ||\n pos.ch < this.startPos.ch || this.cm.somethingSelected() ||\n (!pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {\n this.close();\n } else {\n var self = this;\n this.debounce = requestAnimationFrame(function() {self.update();});\n if (this.widget) this.widget.disable();\n }\n },\n\n update: function(first) {\n if (this.tick == null) return\n var self = this, myTick = ++this.tick\n fetchHints(this.options.hint, this.cm, this.options, function(data) {\n if (self.tick == myTick) self.finishUpdate(data, first)\n })\n },\n\n finishUpdate: function(data, first) {\n if (this.data) CodeMirror.signal(this.data, \"update\");\n\n var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);\n if (this.widget) this.widget.close();\n\n this.data = data;\n\n if (data && data.list.length) {\n if (picked && data.list.length == 1) {\n this.pick(data, 0);\n } else {\n this.widget = new Widget(this, data);\n CodeMirror.signal(data, \"shown\");\n }\n }\n }\n };\n\n function parseOptions(cm, pos, options) {\n var editor = cm.options.hintOptions;\n var out = {};\n for (var prop in defaultOptions) out[prop] = defaultOptions[prop];\n if (editor) for (var prop in editor)\n if (editor[prop] !== undefined) out[prop] = editor[prop];\n if (options) for (var prop in options)\n if (options[prop] !== undefined) out[prop] = options[prop];\n if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos)\n return out;\n }\n\n function getText(completion) {\n if (typeof completion == \"string\") return completion;\n else return completion.text;\n }\n\n function buildKeyMap(completion, handle) {\n var baseMap = {\n Up: function() {handle.moveFocus(-1);},\n Down: function() {handle.moveFocus(1);},\n PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);},\n PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);},\n Home: function() {handle.setFocus(0);},\n End: function() {handle.setFocus(handle.length - 1);},\n Enter: handle.pick,\n Tab: handle.pick,\n Esc: handle.close\n };\n\n var mac = /Mac/.test(navigator.platform);\n\n if (mac) {\n baseMap[\"Ctrl-P\"] = function() {handle.moveFocus(-1);};\n baseMap[\"Ctrl-N\"] = function() {handle.moveFocus(1);};\n }\n\n var custom = completion.options.customKeys;\n var ourMap = custom ? {} : baseMap;\n function addBinding(key, val) {\n var bound;\n if (typeof val != \"string\")\n bound = function(cm) { return val(cm, handle); };\n // This mechanism is deprecated\n else if (baseMap.hasOwnProperty(val))\n bound = baseMap[val];\n else\n bound = val;\n ourMap[key] = bound;\n }\n if (custom)\n for (var key in custom) if (custom.hasOwnProperty(key))\n addBinding(key, custom[key]);\n var extra = completion.options.extraKeys;\n if (extra)\n for (var key in extra) if (extra.hasOwnProperty(key))\n addBinding(key, extra[key]);\n return ourMap;\n }\n\n function getHintElement(hintsElement, el) {\n while (el && el != hintsElement) {\n if (el.nodeName.toUpperCase() === \"LI\" && el.parentNode == hintsElement) return el;\n el = el.parentNode;\n }\n }\n\n function Widget(completion, data) {\n this.completion = completion;\n this.data = data;\n this.picked = false;\n var widget = this, cm = completion.cm;\n var ownerDocument = cm.getInputField().ownerDocument;\n var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow;\n\n var hints = this.hints = ownerDocument.createElement(\"ul\");\n var theme = completion.cm.options.theme;\n hints.className = \"CodeMirror-hints \" + theme;\n this.selectedHint = data.selectedHint || 0;\n\n var completions = data.list;\n for (var i = 0; i < completions.length; ++i) {\n var elt = hints.appendChild(ownerDocument.createElement(\"li\")), cur = completions[i];\n var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? \"\" : \" \" + ACTIVE_HINT_ELEMENT_CLASS);\n if (cur.className != null) className = cur.className + \" \" + className;\n elt.className = className;\n if (cur.render) cur.render(elt, data, cur);\n else elt.appendChild(ownerDocument.createTextNode(cur.displayText || getText(cur)));\n elt.hintId = i;\n }\n\n var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);\n var left = pos.left, top = pos.bottom, below = true;\n hints.style.left = left + \"px\";\n hints.style.top = top + \"px\";\n // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.\n var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth);\n var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight);\n (completion.options.container || ownerDocument.body).appendChild(hints);\n var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH;\n var scrolls = hints.scrollHeight > hints.clientHeight + 1\n var startScroll = cm.getScrollInfo();\n\n if (overlapY > 0) {\n var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);\n if (curTop - height > 0) { // Fits above cursor\n hints.style.top = (top = pos.top - height) + \"px\";\n below = false;\n } else if (height > winH) {\n hints.style.height = (winH - 5) + \"px\";\n hints.style.top = (top = pos.bottom - box.top) + \"px\";\n var cursor = cm.getCursor();\n if (data.from.ch != cursor.ch) {\n pos = cm.cursorCoords(cursor);\n hints.style.left = (left = pos.left) + \"px\";\n box = hints.getBoundingClientRect();\n }\n }\n }\n var overlapX = box.right - winW;\n if (overlapX > 0) {\n if (box.right - box.left > winW) {\n hints.style.width = (winW - 5) + \"px\";\n overlapX -= (box.right - box.left) - winW;\n }\n hints.style.left = (left = pos.left - overlapX) + \"px\";\n }\n if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling)\n node.style.paddingRight = cm.display.nativeBarWidth + \"px\"\n\n cm.addKeyMap(this.keyMap = buildKeyMap(completion, {\n moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },\n setFocus: function(n) { widget.changeActive(n); },\n menuSize: function() { return widget.screenAmount(); },\n length: completions.length,\n close: function() { completion.close(); },\n pick: function() { widget.pick(); },\n data: data\n }));\n\n if (completion.options.closeOnUnfocus) {\n var closingOnBlur;\n cm.on(\"blur\", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });\n cm.on(\"focus\", this.onFocus = function() { clearTimeout(closingOnBlur); });\n }\n\n cm.on(\"scroll\", this.onScroll = function() {\n var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();\n var newTop = top + startScroll.top - curScroll.top;\n var point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop);\n if (!below) point += hints.offsetHeight;\n if (point <= editor.top || point >= editor.bottom) return completion.close();\n hints.style.top = newTop + \"px\";\n hints.style.left = (left + startScroll.left - curScroll.left) + \"px\";\n });\n\n CodeMirror.on(hints, \"dblclick\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}\n });\n\n CodeMirror.on(hints, \"click\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {\n widget.changeActive(t.hintId);\n if (completion.options.completeOnSingleClick) widget.pick();\n }\n });\n\n CodeMirror.on(hints, \"mousedown\", function() {\n setTimeout(function(){cm.focus();}, 20);\n });\n\n CodeMirror.signal(data, \"select\", completions[this.selectedHint], hints.childNodes[this.selectedHint]);\n return true;\n }\n\n Widget.prototype = {\n close: function() {\n if (this.completion.widget != this) return;\n this.completion.widget = null;\n this.hints.parentNode.removeChild(this.hints);\n this.completion.cm.removeKeyMap(this.keyMap);\n\n var cm = this.completion.cm;\n if (this.completion.options.closeOnUnfocus) {\n cm.off(\"blur\", this.onBlur);\n cm.off(\"focus\", this.onFocus);\n }\n cm.off(\"scroll\", this.onScroll);\n },\n\n disable: function() {\n this.completion.cm.removeKeyMap(this.keyMap);\n var widget = this;\n this.keyMap = {Enter: function() { widget.picked = true; }};\n this.completion.cm.addKeyMap(this.keyMap);\n },\n\n pick: function() {\n this.completion.pick(this.data, this.selectedHint);\n },\n\n changeActive: function(i, avoidWrap) {\n if (i >= this.data.list.length)\n i = avoidWrap ? this.data.list.length - 1 : 0;\n else if (i < 0)\n i = avoidWrap ? 0 : this.data.list.length - 1;\n if (this.selectedHint == i) return;\n var node = this.hints.childNodes[this.selectedHint];\n if (node) node.className = node.className.replace(\" \" + ACTIVE_HINT_ELEMENT_CLASS, \"\");\n node = this.hints.childNodes[this.selectedHint = i];\n node.className += \" \" + ACTIVE_HINT_ELEMENT_CLASS;\n if (node.offsetTop < this.hints.scrollTop)\n this.hints.scrollTop = node.offsetTop - 3;\n else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)\n this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3;\n CodeMirror.signal(this.data, \"select\", this.data.list[this.selectedHint], node);\n },\n\n screenAmount: function() {\n return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;\n }\n };\n\n function applicableHelpers(cm, helpers) {\n if (!cm.somethingSelected()) return helpers\n var result = []\n for (var i = 0; i < helpers.length; i++)\n if (helpers[i].supportsSelection) result.push(helpers[i])\n return result\n }\n\n function fetchHints(hint, cm, options, callback) {\n if (hint.async) {\n hint(cm, callback, options)\n } else {\n var result = hint(cm, options)\n if (result && result.then) result.then(callback)\n else callback(result)\n }\n }\n\n function resolveAutoHints(cm, pos) {\n var helpers = cm.getHelpers(pos, \"hint\"), words\n if (helpers.length) {\n var resolved = function(cm, callback, options) {\n var app = applicableHelpers(cm, helpers);\n function run(i) {\n if (i == app.length) return callback(null)\n fetchHints(app[i], cm, options, function(result) {\n if (result && result.list.length > 0) callback(result)\n else run(i + 1)\n })\n }\n run(0)\n }\n resolved.async = true\n resolved.supportsSelection = true\n return resolved\n } else if (words = cm.getHelper(cm.getCursor(), \"hintWords\")) {\n return function(cm) { return CodeMirror.hint.fromList(cm, {words: words}) }\n } else if (CodeMirror.hint.anyword) {\n return function(cm, options) { return CodeMirror.hint.anyword(cm, options) }\n } else {\n return function() {}\n }\n }\n\n CodeMirror.registerHelper(\"hint\", \"auto\", {\n resolve: resolveAutoHints\n });\n\n CodeMirror.registerHelper(\"hint\", \"fromList\", function(cm, options) {\n var cur = cm.getCursor(), token = cm.getTokenAt(cur)\n var term, from = CodeMirror.Pos(cur.line, token.start), to = cur\n if (token.start < cur.ch && /\\w/.test(token.string.charAt(cur.ch - token.start - 1))) {\n term = token.string.substr(0, cur.ch - token.start)\n } else {\n term = \"\"\n from = cur\n }\n var found = [];\n for (var i = 0; i < options.words.length; i++) {\n var word = options.words[i];\n if (word.slice(0, term.length) == term)\n found.push(word);\n }\n\n if (found.length) return {list: found, from: from, to: to};\n });\n\n CodeMirror.commands.autocomplete = CodeMirror.showHint;\n\n var defaultOptions = {\n hint: CodeMirror.hint.auto,\n completeSingle: true,\n alignWithWord: true,\n closeCharacters: /[\\s()\\[\\]{};:>,]/,\n closeOnUnfocus: true,\n completeOnSingleClick: true,\n container: null,\n customKeys: null,\n extraKeys: null\n };\n\n CodeMirror.defineOption(\"hintOptions\", null);\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/addon/hint/show-hint.js\n// module id = 725\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"../../mode/sql/sql\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"../../mode/sql/sql\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var tables;\n var defaultTable;\n var keywords;\n var identifierQuote;\n var CONS = {\n QUERY_DIV: \";\",\n ALIAS_KEYWORD: \"AS\"\n };\n var Pos = CodeMirror.Pos, cmpPos = CodeMirror.cmpPos;\n\n function isArray(val) { return Object.prototype.toString.call(val) == \"[object Array]\" }\n\n function getKeywords(editor) {\n var mode = editor.doc.modeOption;\n if (mode === \"sql\") mode = \"text/x-sql\";\n return CodeMirror.resolveMode(mode).keywords;\n }\n\n function getIdentifierQuote(editor) {\n var mode = editor.doc.modeOption;\n if (mode === \"sql\") mode = \"text/x-sql\";\n return CodeMirror.resolveMode(mode).identifierQuote || \"`\";\n }\n\n function getText(item) {\n return typeof item == \"string\" ? item : item.text;\n }\n\n function wrapTable(name, value) {\n if (isArray(value)) value = {columns: value}\n if (!value.text) value.text = name\n return value\n }\n\n function parseTables(input) {\n var result = {}\n if (isArray(input)) {\n for (var i = input.length - 1; i >= 0; i--) {\n var item = input[i]\n result[getText(item).toUpperCase()] = wrapTable(getText(item), item)\n }\n } else if (input) {\n for (var name in input)\n result[name.toUpperCase()] = wrapTable(name, input[name])\n }\n return result\n }\n\n function getTable(name) {\n return tables[name.toUpperCase()]\n }\n\n function shallowClone(object) {\n var result = {};\n for (var key in object) if (object.hasOwnProperty(key))\n result[key] = object[key];\n return result;\n }\n\n function match(string, word) {\n var len = string.length;\n var sub = getText(word).substr(0, len);\n return string.toUpperCase() === sub.toUpperCase();\n }\n\n function addMatches(result, search, wordlist, formatter) {\n if (isArray(wordlist)) {\n for (var i = 0; i < wordlist.length; i++)\n if (match(search, wordlist[i])) result.push(formatter(wordlist[i]))\n } else {\n for (var word in wordlist) if (wordlist.hasOwnProperty(word)) {\n var val = wordlist[word]\n if (!val || val === true)\n val = word\n else\n val = val.displayText ? {text: val.text, displayText: val.displayText} : val.text\n if (match(search, val)) result.push(formatter(val))\n }\n }\n }\n\n function cleanName(name) {\n // Get rid name from identifierQuote and preceding dot(.)\n if (name.charAt(0) == \".\") {\n name = name.substr(1);\n }\n // replace doublicated identifierQuotes with single identifierQuotes\n // and remove single identifierQuotes\n var nameParts = name.split(identifierQuote+identifierQuote);\n for (var i = 0; i < nameParts.length; i++)\n nameParts[i] = nameParts[i].replace(new RegExp(identifierQuote,\"g\"), \"\");\n return nameParts.join(identifierQuote);\n }\n\n function insertIdentifierQuotes(name) {\n var nameParts = getText(name).split(\".\");\n for (var i = 0; i < nameParts.length; i++)\n nameParts[i] = identifierQuote +\n // doublicate identifierQuotes\n nameParts[i].replace(new RegExp(identifierQuote,\"g\"), identifierQuote+identifierQuote) +\n identifierQuote;\n var escaped = nameParts.join(\".\");\n if (typeof name == \"string\") return escaped;\n name = shallowClone(name);\n name.text = escaped;\n return name;\n }\n\n function nameCompletion(cur, token, result, editor) {\n // Try to complete table, column names and return start position of completion\n var useIdentifierQuotes = false;\n var nameParts = [];\n var start = token.start;\n var cont = true;\n while (cont) {\n cont = (token.string.charAt(0) == \".\");\n useIdentifierQuotes = useIdentifierQuotes || (token.string.charAt(0) == identifierQuote);\n\n start = token.start;\n nameParts.unshift(cleanName(token.string));\n\n token = editor.getTokenAt(Pos(cur.line, token.start));\n if (token.string == \".\") {\n cont = true;\n token = editor.getTokenAt(Pos(cur.line, token.start));\n }\n }\n\n // Try to complete table names\n var string = nameParts.join(\".\");\n addMatches(result, string, tables, function(w) {\n return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;\n });\n\n // Try to complete columns from defaultTable\n addMatches(result, string, defaultTable, function(w) {\n return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;\n });\n\n // Try to complete columns\n string = nameParts.pop();\n var table = nameParts.join(\".\");\n\n var alias = false;\n var aliasTable = table;\n // Check if table is available. If not, find table by Alias\n if (!getTable(table)) {\n var oldTable = table;\n table = findTableByAlias(table, editor);\n if (table !== oldTable) alias = true;\n }\n\n var columns = getTable(table);\n if (columns && columns.columns)\n columns = columns.columns;\n\n if (columns) {\n addMatches(result, string, columns, function(w) {\n var tableInsert = table;\n if (alias == true) tableInsert = aliasTable;\n if (typeof w == \"string\") {\n w = tableInsert + \".\" + w;\n } else {\n w = shallowClone(w);\n w.text = tableInsert + \".\" + w.text;\n }\n return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;\n });\n }\n\n return start;\n }\n\n function eachWord(lineText, f) {\n var words = lineText.split(/\\s+/)\n for (var i = 0; i < words.length; i++)\n if (words[i]) f(words[i].replace(/[,;]/g, ''))\n }\n\n function findTableByAlias(alias, editor) {\n var doc = editor.doc;\n var fullQuery = doc.getValue();\n var aliasUpperCase = alias.toUpperCase();\n var previousWord = \"\";\n var table = \"\";\n var separator = [];\n var validRange = {\n start: Pos(0, 0),\n end: Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).length)\n };\n\n //add separator\n var indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV);\n while(indexOfSeparator != -1) {\n separator.push(doc.posFromIndex(indexOfSeparator));\n indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV, indexOfSeparator+1);\n }\n separator.unshift(Pos(0, 0));\n separator.push(Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).text.length));\n\n //find valid range\n var prevItem = null;\n var current = editor.getCursor()\n for (var i = 0; i < separator.length; i++) {\n if ((prevItem == null || cmpPos(current, prevItem) > 0) && cmpPos(current, separator[i]) <= 0) {\n validRange = {start: prevItem, end: separator[i]};\n break;\n }\n prevItem = separator[i];\n }\n\n if (validRange.start) {\n var query = doc.getRange(validRange.start, validRange.end, false);\n\n for (var i = 0; i < query.length; i++) {\n var lineText = query[i];\n eachWord(lineText, function(word) {\n var wordUpperCase = word.toUpperCase();\n if (wordUpperCase === aliasUpperCase && getTable(previousWord))\n table = previousWord;\n if (wordUpperCase !== CONS.ALIAS_KEYWORD)\n previousWord = word;\n });\n if (table) break;\n }\n }\n return table;\n }\n\n CodeMirror.registerHelper(\"hint\", \"sql\", function(editor, options) {\n tables = parseTables(options && options.tables)\n var defaultTableName = options && options.defaultTable;\n var disableKeywords = options && options.disableKeywords;\n defaultTable = defaultTableName && getTable(defaultTableName);\n keywords = getKeywords(editor);\n identifierQuote = getIdentifierQuote(editor);\n\n if (defaultTableName && !defaultTable)\n defaultTable = findTableByAlias(defaultTableName, editor);\n\n defaultTable = defaultTable || [];\n\n if (defaultTable.columns)\n defaultTable = defaultTable.columns;\n\n var cur = editor.getCursor();\n var result = [];\n var token = editor.getTokenAt(cur), start, end, search;\n if (token.end > cur.ch) {\n token.end = cur.ch;\n token.string = token.string.slice(0, cur.ch - token.start);\n }\n\n if (token.string.match(/^[.`\"\\w@]\\w*$/)) {\n search = token.string;\n start = token.start;\n end = token.end;\n } else {\n start = end = cur.ch;\n search = \"\";\n }\n if (search.charAt(0) == \".\" || search.charAt(0) == identifierQuote) {\n start = nameCompletion(cur, token, result, editor);\n } else {\n var objectOrClass = function(w, className) {\n if (typeof w === \"object\") {\n w.className = className;\n } else {\n w = { text: w, className: className };\n }\n return w;\n };\n addMatches(result, search, defaultTable, function(w) {\n return objectOrClass(w, \"CodeMirror-hint-table CodeMirror-hint-default-table\");\n });\n addMatches(\n result,\n search,\n tables, function(w) {\n return objectOrClass(w, \"CodeMirror-hint-table\");\n }\n );\n if (!disableKeywords)\n addMatches(result, search, keywords, function(w) {\n return objectOrClass(w.toUpperCase(), \"CodeMirror-hint-keyword\");\n });\n }\n\n return {list: result, from: Pos(cur.line, start), to: Pos(cur.line, end)};\n });\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/addon/hint/sql-hint.js\n// module id = 726\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var Pos = CodeMirror.Pos;\n\n function matches(hint, typed, matchInMiddle) {\n if (matchInMiddle) return hint.indexOf(typed) >= 0;\n else return hint.lastIndexOf(typed, 0) == 0;\n }\n\n function getHints(cm, options) {\n var tags = options && options.schemaInfo;\n var quote = (options && options.quoteChar) || '\"';\n var matchInMiddle = options && options.matchInMiddle;\n if (!tags) return;\n var cur = cm.getCursor(), token = cm.getTokenAt(cur);\n if (token.end > cur.ch) {\n token.end = cur.ch;\n token.string = token.string.slice(0, cur.ch - token.start);\n }\n var inner = CodeMirror.innerMode(cm.getMode(), token.state);\n if (inner.mode.name != \"xml\") return;\n var result = [], replaceToken = false, prefix;\n var tag = /\\btag\\b/.test(token.type) && !/>$/.test(token.string);\n var tagName = tag && /^\\w/.test(token.string), tagStart;\n\n if (tagName) {\n var before = cm.getLine(cur.line).slice(Math.max(0, token.start - 2), token.start);\n var tagType = /<\\/$/.test(before) ? \"close\" : /<$/.test(before) ? \"open\" : null;\n if (tagType) tagStart = token.start - (tagType == \"close\" ? 2 : 1);\n } else if (tag && token.string == \"<\") {\n tagType = \"open\";\n } else if (tag && token.string == \"\");\n } else {\n // Attribute completion\n var curTag = tags[inner.state.tagName], attrs = curTag && curTag.attrs;\n var globalAttrs = tags[\"!attrs\"];\n if (!attrs && !globalAttrs) return;\n if (!attrs) {\n attrs = globalAttrs;\n } else if (globalAttrs) { // Combine tag-local and global attributes\n var set = {};\n for (var nm in globalAttrs) if (globalAttrs.hasOwnProperty(nm)) set[nm] = globalAttrs[nm];\n for (var nm in attrs) if (attrs.hasOwnProperty(nm)) set[nm] = attrs[nm];\n attrs = set;\n }\n if (token.type == \"string\" || token.string == \"=\") { // A value\n var before = cm.getRange(Pos(cur.line, Math.max(0, cur.ch - 60)),\n Pos(cur.line, token.type == \"string\" ? token.start : token.end));\n var atName = before.match(/([^\\s\\u00a0=<>\\\"\\']+)=$/), atValues;\n if (!atName || !attrs.hasOwnProperty(atName[1]) || !(atValues = attrs[atName[1]])) return;\n if (typeof atValues == 'function') atValues = atValues.call(this, cm); // Functions can be used to supply values for autocomplete widget\n if (token.type == \"string\") {\n prefix = token.string;\n var n = 0;\n if (/['\"]/.test(token.string.charAt(0))) {\n quote = token.string.charAt(0);\n prefix = token.string.slice(1);\n n++;\n }\n var len = token.string.length;\n if (/['\"]/.test(token.string.charAt(len - 1))) {\n quote = token.string.charAt(len - 1);\n prefix = token.string.substr(n, len - 2);\n }\n replaceToken = true;\n }\n for (var i = 0; i < atValues.length; ++i) if (!prefix || matches(atValues[i], prefix, matchInMiddle))\n result.push(quote + atValues[i] + quote);\n } else { // An attribute name\n if (token.type == \"attribute\") {\n prefix = token.string;\n replaceToken = true;\n }\n for (var attr in attrs) if (attrs.hasOwnProperty(attr) && (!prefix || matches(attr, prefix, matchInMiddle)))\n result.push(attr);\n }\n }\n return {\n list: result,\n from: replaceToken ? Pos(cur.line, tagStart == null ? token.start : tagStart) : cur,\n to: replaceToken ? Pos(cur.line, token.end) : cur\n };\n }\n\n CodeMirror.registerHelper(\"hint\", \"xml\", getHints);\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/addon/hint/xml-hint.js\n// module id = 727\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n function wordRegexp(words) {\n return new RegExp(\"^((\" + words.join(\")|(\") + \"))\\\\b\");\n }\n\n var wordOperators = wordRegexp([\"and\", \"or\", \"not\", \"is\"]);\n var commonKeywords = [\"as\", \"assert\", \"break\", \"class\", \"continue\",\n \"def\", \"del\", \"elif\", \"else\", \"except\", \"finally\",\n \"for\", \"from\", \"global\", \"if\", \"import\",\n \"lambda\", \"pass\", \"raise\", \"return\",\n \"try\", \"while\", \"with\", \"yield\", \"in\"];\n var commonBuiltins = [\"abs\", \"all\", \"any\", \"bin\", \"bool\", \"bytearray\", \"callable\", \"chr\",\n \"classmethod\", \"compile\", \"complex\", \"delattr\", \"dict\", \"dir\", \"divmod\",\n \"enumerate\", \"eval\", \"filter\", \"float\", \"format\", \"frozenset\",\n \"getattr\", \"globals\", \"hasattr\", \"hash\", \"help\", \"hex\", \"id\",\n \"input\", \"int\", \"isinstance\", \"issubclass\", \"iter\", \"len\",\n \"list\", \"locals\", \"map\", \"max\", \"memoryview\", \"min\", \"next\",\n \"object\", \"oct\", \"open\", \"ord\", \"pow\", \"property\", \"range\",\n \"repr\", \"reversed\", \"round\", \"set\", \"setattr\", \"slice\",\n \"sorted\", \"staticmethod\", \"str\", \"sum\", \"super\", \"tuple\",\n \"type\", \"vars\", \"zip\", \"__import__\", \"NotImplemented\",\n \"Ellipsis\", \"__debug__\"];\n CodeMirror.registerHelper(\"hintWords\", \"python\", commonKeywords.concat(commonBuiltins));\n\n function top(state) {\n return state.scopes[state.scopes.length - 1];\n }\n\n CodeMirror.defineMode(\"python\", function(conf, parserConf) {\n var ERRORCLASS = \"error\";\n\n var delimiters = parserConf.delimiters || parserConf.singleDelimiters || /^[\\(\\)\\[\\]\\{\\}@,:`=;\\.\\\\]/;\n // (Backwards-compatiblity with old, cumbersome config system)\n var operators = [parserConf.singleOperators, parserConf.doubleOperators, parserConf.doubleDelimiters, parserConf.tripleDelimiters,\n parserConf.operators || /^([-+*/%\\/&|^]=?|[<>=]+|\\/\\/=?|\\*\\*=?|!=|[~!@])/]\n for (var i = 0; i < operators.length; i++) if (!operators[i]) operators.splice(i--, 1)\n\n var hangingIndent = parserConf.hangingIndent || conf.indentUnit;\n\n var myKeywords = commonKeywords, myBuiltins = commonBuiltins;\n if (parserConf.extra_keywords != undefined)\n myKeywords = myKeywords.concat(parserConf.extra_keywords);\n\n if (parserConf.extra_builtins != undefined)\n myBuiltins = myBuiltins.concat(parserConf.extra_builtins);\n\n var py3 = !(parserConf.version && Number(parserConf.version) < 3)\n if (py3) {\n // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator\n var identifiers = parserConf.identifiers|| /^[_A-Za-z\\u00A1-\\uFFFF][_A-Za-z0-9\\u00A1-\\uFFFF]*/;\n myKeywords = myKeywords.concat([\"nonlocal\", \"False\", \"True\", \"None\", \"async\", \"await\"]);\n myBuiltins = myBuiltins.concat([\"ascii\", \"bytes\", \"exec\", \"print\"]);\n var stringPrefixes = new RegExp(\"^(([rbuf]|(br)|(fr))?('{3}|\\\"{3}|['\\\"]))\", \"i\");\n } else {\n var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/;\n myKeywords = myKeywords.concat([\"exec\", \"print\"]);\n myBuiltins = myBuiltins.concat([\"apply\", \"basestring\", \"buffer\", \"cmp\", \"coerce\", \"execfile\",\n \"file\", \"intern\", \"long\", \"raw_input\", \"reduce\", \"reload\",\n \"unichr\", \"unicode\", \"xrange\", \"False\", \"True\", \"None\"]);\n var stringPrefixes = new RegExp(\"^(([rubf]|(ur)|(br))?('{3}|\\\"{3}|['\\\"]))\", \"i\");\n }\n var keywords = wordRegexp(myKeywords);\n var builtins = wordRegexp(myBuiltins);\n\n // tokenizers\n function tokenBase(stream, state) {\n var sol = stream.sol() && state.lastToken != \"\\\\\"\n if (sol) state.indent = stream.indentation()\n // Handle scope changes\n if (sol && top(state).type == \"py\") {\n var scopeOffset = top(state).offset;\n if (stream.eatSpace()) {\n var lineOffset = stream.indentation();\n if (lineOffset > scopeOffset)\n pushPyScope(state);\n else if (lineOffset < scopeOffset && dedent(stream, state) && stream.peek() != \"#\")\n state.errorToken = true;\n return null;\n } else {\n var style = tokenBaseInner(stream, state);\n if (scopeOffset > 0 && dedent(stream, state))\n style += \" \" + ERRORCLASS;\n return style;\n }\n }\n return tokenBaseInner(stream, state);\n }\n\n function tokenBaseInner(stream, state) {\n if (stream.eatSpace()) return null;\n\n // Handle Comments\n if (stream.match(/^#.*/)) return \"comment\";\n\n // Handle Number Literals\n if (stream.match(/^[0-9\\.]/, false)) {\n var floatLiteral = false;\n // Floats\n if (stream.match(/^[\\d_]*\\.\\d+(e[\\+\\-]?\\d+)?/i)) { floatLiteral = true; }\n if (stream.match(/^[\\d_]+\\.\\d*/)) { floatLiteral = true; }\n if (stream.match(/^\\.\\d+/)) { floatLiteral = true; }\n if (floatLiteral) {\n // Float literals may be \"imaginary\"\n stream.eat(/J/i);\n return \"number\";\n }\n // Integers\n var intLiteral = false;\n // Hex\n if (stream.match(/^0x[0-9a-f_]+/i)) intLiteral = true;\n // Binary\n if (stream.match(/^0b[01_]+/i)) intLiteral = true;\n // Octal\n if (stream.match(/^0o[0-7_]+/i)) intLiteral = true;\n // Decimal\n if (stream.match(/^[1-9][\\d_]*(e[\\+\\-]?[\\d_]+)?/)) {\n // Decimal literals may be \"imaginary\"\n stream.eat(/J/i);\n // TODO - Can you have imaginary longs?\n intLiteral = true;\n }\n // Zero by itself with no other piece of number.\n if (stream.match(/^0(?![\\dx])/i)) intLiteral = true;\n if (intLiteral) {\n // Integer literals may be \"long\"\n stream.eat(/L/i);\n return \"number\";\n }\n }\n\n // Handle Strings\n if (stream.match(stringPrefixes)) {\n var isFmtString = stream.current().toLowerCase().indexOf('f') !== -1;\n if (!isFmtString) {\n state.tokenize = tokenStringFactory(stream.current(), state.tokenize);\n return state.tokenize(stream, state);\n } else {\n state.tokenize = formatStringFactory(stream.current(), state.tokenize);\n return state.tokenize(stream, state);\n }\n }\n\n for (var i = 0; i < operators.length; i++)\n if (stream.match(operators[i])) return \"operator\"\n\n if (stream.match(delimiters)) return \"punctuation\";\n\n if (state.lastToken == \".\" && stream.match(identifiers))\n return \"property\";\n\n if (stream.match(keywords) || stream.match(wordOperators))\n return \"keyword\";\n\n if (stream.match(builtins))\n return \"builtin\";\n\n if (stream.match(/^(self|cls)\\b/))\n return \"variable-2\";\n\n if (stream.match(identifiers)) {\n if (state.lastToken == \"def\" || state.lastToken == \"class\")\n return \"def\";\n return \"variable\";\n }\n\n // Handle non-detected items\n stream.next();\n return ERRORCLASS;\n }\n\n function formatStringFactory(delimiter, tokenOuter) {\n while (\"rubf\".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)\n delimiter = delimiter.substr(1);\n\n var singleline = delimiter.length == 1;\n var OUTCLASS = \"string\";\n\n function tokenNestedExpr(depth) {\n return function(stream, state) {\n var inner = tokenBaseInner(stream, state)\n if (inner == \"punctuation\") {\n if (stream.current() == \"{\") {\n state.tokenize = tokenNestedExpr(depth + 1)\n } else if (stream.current() == \"}\") {\n if (depth > 1) state.tokenize = tokenNestedExpr(depth - 1)\n else state.tokenize = tokenString\n }\n }\n return inner\n }\n }\n\n function tokenString(stream, state) {\n while (!stream.eol()) {\n stream.eatWhile(/[^'\"\\{\\}\\\\]/);\n if (stream.eat(\"\\\\\")) {\n stream.next();\n if (singleline && stream.eol())\n return OUTCLASS;\n } else if (stream.match(delimiter)) {\n state.tokenize = tokenOuter;\n return OUTCLASS;\n } else if (stream.match('{{')) {\n // ignore {{ in f-str\n return OUTCLASS;\n } else if (stream.match('{', false)) {\n // switch to nested mode\n state.tokenize = tokenNestedExpr(0)\n if (stream.current()) return OUTCLASS;\n else return state.tokenize(stream, state)\n } else if (stream.match('}}')) {\n return OUTCLASS;\n } else if (stream.match('}')) {\n // single } in f-string is an error\n return ERRORCLASS;\n } else {\n stream.eat(/['\"]/);\n }\n }\n if (singleline) {\n if (parserConf.singleLineStringErrors)\n return ERRORCLASS;\n else\n state.tokenize = tokenOuter;\n }\n return OUTCLASS;\n }\n tokenString.isString = true;\n return tokenString;\n }\n\n function tokenStringFactory(delimiter, tokenOuter) {\n while (\"rubf\".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)\n delimiter = delimiter.substr(1);\n\n var singleline = delimiter.length == 1;\n var OUTCLASS = \"string\";\n\n function tokenString(stream, state) {\n while (!stream.eol()) {\n stream.eatWhile(/[^'\"\\\\]/);\n if (stream.eat(\"\\\\\")) {\n stream.next();\n if (singleline && stream.eol())\n return OUTCLASS;\n } else if (stream.match(delimiter)) {\n state.tokenize = tokenOuter;\n return OUTCLASS;\n } else {\n stream.eat(/['\"]/);\n }\n }\n if (singleline) {\n if (parserConf.singleLineStringErrors)\n return ERRORCLASS;\n else\n state.tokenize = tokenOuter;\n }\n return OUTCLASS;\n }\n tokenString.isString = true;\n return tokenString;\n }\n\n function pushPyScope(state) {\n while (top(state).type != \"py\") state.scopes.pop()\n state.scopes.push({offset: top(state).offset + conf.indentUnit,\n type: \"py\",\n align: null})\n }\n\n function pushBracketScope(stream, state, type) {\n var align = stream.match(/^([\\s\\[\\{\\(]|#.*)*$/, false) ? null : stream.column() + 1\n state.scopes.push({offset: state.indent + hangingIndent,\n type: type,\n align: align})\n }\n\n function dedent(stream, state) {\n var indented = stream.indentation();\n while (state.scopes.length > 1 && top(state).offset > indented) {\n if (top(state).type != \"py\") return true;\n state.scopes.pop();\n }\n return top(state).offset != indented;\n }\n\n function tokenLexer(stream, state) {\n if (stream.sol()) state.beginningOfLine = true;\n\n var style = state.tokenize(stream, state);\n var current = stream.current();\n\n // Handle decorators\n if (state.beginningOfLine && current == \"@\")\n return stream.match(identifiers, false) ? \"meta\" : py3 ? \"operator\" : ERRORCLASS;\n\n if (/\\S/.test(current)) state.beginningOfLine = false;\n\n if ((style == \"variable\" || style == \"builtin\")\n && state.lastToken == \"meta\")\n style = \"meta\";\n\n // Handle scope changes.\n if (current == \"pass\" || current == \"return\")\n state.dedent += 1;\n\n if (current == \"lambda\") state.lambda = true;\n if (current == \":\" && !state.lambda && top(state).type == \"py\")\n pushPyScope(state);\n\n if (current.length == 1 && !/string|comment/.test(style)) {\n var delimiter_index = \"[({\".indexOf(current);\n if (delimiter_index != -1)\n pushBracketScope(stream, state, \"])}\".slice(delimiter_index, delimiter_index+1));\n\n delimiter_index = \"])}\".indexOf(current);\n if (delimiter_index != -1) {\n if (top(state).type == current) state.indent = state.scopes.pop().offset - hangingIndent\n else return ERRORCLASS;\n }\n }\n if (state.dedent > 0 && stream.eol() && top(state).type == \"py\") {\n if (state.scopes.length > 1) state.scopes.pop();\n state.dedent -= 1;\n }\n\n return style;\n }\n\n var external = {\n startState: function(basecolumn) {\n return {\n tokenize: tokenBase,\n scopes: [{offset: basecolumn || 0, type: \"py\", align: null}],\n indent: basecolumn || 0,\n lastToken: null,\n lambda: false,\n dedent: 0\n };\n },\n\n token: function(stream, state) {\n var addErr = state.errorToken;\n if (addErr) state.errorToken = false;\n var style = tokenLexer(stream, state);\n\n if (style && style != \"comment\")\n state.lastToken = (style == \"keyword\" || style == \"punctuation\") ? stream.current() : style;\n if (style == \"punctuation\") style = null;\n\n if (stream.eol() && state.lambda)\n state.lambda = false;\n return addErr ? style + \" \" + ERRORCLASS : style;\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize != tokenBase)\n return state.tokenize.isString ? CodeMirror.Pass : 0;\n\n var scope = top(state), closing = scope.type == textAfter.charAt(0)\n if (scope.align != null)\n return scope.align - (closing ? 1 : 0)\n else\n return scope.offset - (closing ? hangingIndent : 0)\n },\n\n electricInput: /^\\s*[\\}\\]\\)]$/,\n closeBrackets: {triples: \"'\\\"\"},\n lineComment: \"#\",\n fold: \"indent\"\n };\n return external;\n });\n\n CodeMirror.defineMIME(\"text/x-python\", \"python\");\n\n var words = function(str) { return str.split(\" \"); };\n\n CodeMirror.defineMIME(\"text/x-cython\", {\n name: \"python\",\n extra_keywords: words(\"by cdef cimport cpdef ctypedef enum except \"+\n \"extern gil include nogil property public \"+\n \"readonly struct union DEF IF ELIF ELSE\")\n });\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/python/python.js\n// module id = 728\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nvar htmlConfig = {\n autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,\n 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,\n 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,\n 'track': true, 'wbr': true, 'menuitem': true},\n implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,\n 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,\n 'th': true, 'tr': true},\n contextGrabbers: {\n 'dd': {'dd': true, 'dt': true},\n 'dt': {'dd': true, 'dt': true},\n 'li': {'li': true},\n 'option': {'option': true, 'optgroup': true},\n 'optgroup': {'optgroup': true},\n 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,\n 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,\n 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,\n 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,\n 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},\n 'rp': {'rp': true, 'rt': true},\n 'rt': {'rp': true, 'rt': true},\n 'tbody': {'tbody': true, 'tfoot': true},\n 'td': {'td': true, 'th': true},\n 'tfoot': {'tbody': true},\n 'th': {'td': true, 'th': true},\n 'thead': {'tbody': true, 'tfoot': true},\n 'tr': {'tr': true}\n },\n doNotIndent: {\"pre\": true},\n allowUnquoted: true,\n allowMissing: true,\n caseFold: true\n}\n\nvar xmlConfig = {\n autoSelfClosers: {},\n implicitlyClosed: {},\n contextGrabbers: {},\n doNotIndent: {},\n allowUnquoted: false,\n allowMissing: false,\n allowMissingTagName: false,\n caseFold: false\n}\n\nCodeMirror.defineMode(\"xml\", function(editorConf, config_) {\n var indentUnit = editorConf.indentUnit\n var config = {}\n var defaults = config_.htmlMode ? htmlConfig : xmlConfig\n for (var prop in defaults) config[prop] = defaults[prop]\n for (var prop in config_) config[prop] = config_[prop]\n\n // Return variables for tokenizers\n var type, setStyle;\n\n function inText(stream, state) {\n function chain(parser) {\n state.tokenize = parser;\n return parser(stream, state);\n }\n\n var ch = stream.next();\n if (ch == \"<\") {\n if (stream.eat(\"!\")) {\n if (stream.eat(\"[\")) {\n if (stream.match(\"CDATA[\")) return chain(inBlock(\"atom\", \"]]>\"));\n else return null;\n } else if (stream.match(\"--\")) {\n return chain(inBlock(\"comment\", \"-->\"));\n } else if (stream.match(\"DOCTYPE\", true, true)) {\n stream.eatWhile(/[\\w\\._\\-]/);\n return chain(doctype(1));\n } else {\n return null;\n }\n } else if (stream.eat(\"?\")) {\n stream.eatWhile(/[\\w\\._\\-]/);\n state.tokenize = inBlock(\"meta\", \"?>\");\n return \"meta\";\n } else {\n type = stream.eat(\"/\") ? \"closeTag\" : \"openTag\";\n state.tokenize = inTag;\n return \"tag bracket\";\n }\n } else if (ch == \"&\") {\n var ok;\n if (stream.eat(\"#\")) {\n if (stream.eat(\"x\")) {\n ok = stream.eatWhile(/[a-fA-F\\d]/) && stream.eat(\";\");\n } else {\n ok = stream.eatWhile(/[\\d]/) && stream.eat(\";\");\n }\n } else {\n ok = stream.eatWhile(/[\\w\\.\\-:]/) && stream.eat(\";\");\n }\n return ok ? \"atom\" : \"error\";\n } else {\n stream.eatWhile(/[^&<]/);\n return null;\n }\n }\n inText.isInText = true;\n\n function inTag(stream, state) {\n var ch = stream.next();\n if (ch == \">\" || (ch == \"/\" && stream.eat(\">\"))) {\n state.tokenize = inText;\n type = ch == \">\" ? \"endTag\" : \"selfcloseTag\";\n return \"tag bracket\";\n } else if (ch == \"=\") {\n type = \"equals\";\n return null;\n } else if (ch == \"<\") {\n state.tokenize = inText;\n state.state = baseState;\n state.tagName = state.tagStart = null;\n var next = state.tokenize(stream, state);\n return next ? next + \" tag error\" : \"tag error\";\n } else if (/[\\'\\\"]/.test(ch)) {\n state.tokenize = inAttribute(ch);\n state.stringStartCol = stream.column();\n return state.tokenize(stream, state);\n } else {\n stream.match(/^[^\\s\\u00a0=<>\\\"\\']*[^\\s\\u00a0=<>\\\"\\'\\/]/);\n return \"word\";\n }\n }\n\n function inAttribute(quote) {\n var closure = function(stream, state) {\n while (!stream.eol()) {\n if (stream.next() == quote) {\n state.tokenize = inTag;\n break;\n }\n }\n return \"string\";\n };\n closure.isInAttribute = true;\n return closure;\n }\n\n function inBlock(style, terminator) {\n return function(stream, state) {\n while (!stream.eol()) {\n if (stream.match(terminator)) {\n state.tokenize = inText;\n break;\n }\n stream.next();\n }\n return style;\n }\n }\n\n function doctype(depth) {\n return function(stream, state) {\n var ch;\n while ((ch = stream.next()) != null) {\n if (ch == \"<\") {\n state.tokenize = doctype(depth + 1);\n return state.tokenize(stream, state);\n } else if (ch == \">\") {\n if (depth == 1) {\n state.tokenize = inText;\n break;\n } else {\n state.tokenize = doctype(depth - 1);\n return state.tokenize(stream, state);\n }\n }\n }\n return \"meta\";\n };\n }\n\n function Context(state, tagName, startOfLine) {\n this.prev = state.context;\n this.tagName = tagName;\n this.indent = state.indented;\n this.startOfLine = startOfLine;\n if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))\n this.noIndent = true;\n }\n function popContext(state) {\n if (state.context) state.context = state.context.prev;\n }\n function maybePopContext(state, nextTagName) {\n var parentTagName;\n while (true) {\n if (!state.context) {\n return;\n }\n parentTagName = state.context.tagName;\n if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||\n !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {\n return;\n }\n popContext(state);\n }\n }\n\n function baseState(type, stream, state) {\n if (type == \"openTag\") {\n state.tagStart = stream.column();\n return tagNameState;\n } else if (type == \"closeTag\") {\n return closeTagNameState;\n } else {\n return baseState;\n }\n }\n function tagNameState(type, stream, state) {\n if (type == \"word\") {\n state.tagName = stream.current();\n setStyle = \"tag\";\n return attrState;\n } else if (config.allowMissingTagName && type == \"endTag\") {\n setStyle = \"tag bracket\";\n return attrState(type, stream, state);\n } else {\n setStyle = \"error\";\n return tagNameState;\n }\n }\n function closeTagNameState(type, stream, state) {\n if (type == \"word\") {\n var tagName = stream.current();\n if (state.context && state.context.tagName != tagName &&\n config.implicitlyClosed.hasOwnProperty(state.context.tagName))\n popContext(state);\n if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {\n setStyle = \"tag\";\n return closeState;\n } else {\n setStyle = \"tag error\";\n return closeStateErr;\n }\n } else if (config.allowMissingTagName && type == \"endTag\") {\n setStyle = \"tag bracket\";\n return closeState(type, stream, state);\n } else {\n setStyle = \"error\";\n return closeStateErr;\n }\n }\n\n function closeState(type, _stream, state) {\n if (type != \"endTag\") {\n setStyle = \"error\";\n return closeState;\n }\n popContext(state);\n return baseState;\n }\n function closeStateErr(type, stream, state) {\n setStyle = \"error\";\n return closeState(type, stream, state);\n }\n\n function attrState(type, _stream, state) {\n if (type == \"word\") {\n setStyle = \"attribute\";\n return attrEqState;\n } else if (type == \"endTag\" || type == \"selfcloseTag\") {\n var tagName = state.tagName, tagStart = state.tagStart;\n state.tagName = state.tagStart = null;\n if (type == \"selfcloseTag\" ||\n config.autoSelfClosers.hasOwnProperty(tagName)) {\n maybePopContext(state, tagName);\n } else {\n maybePopContext(state, tagName);\n state.context = new Context(state, tagName, tagStart == state.indented);\n }\n return baseState;\n }\n setStyle = \"error\";\n return attrState;\n }\n function attrEqState(type, stream, state) {\n if (type == \"equals\") return attrValueState;\n if (!config.allowMissing) setStyle = \"error\";\n return attrState(type, stream, state);\n }\n function attrValueState(type, stream, state) {\n if (type == \"string\") return attrContinuedState;\n if (type == \"word\" && config.allowUnquoted) {setStyle = \"string\"; return attrState;}\n setStyle = \"error\";\n return attrState(type, stream, state);\n }\n function attrContinuedState(type, stream, state) {\n if (type == \"string\") return attrContinuedState;\n return attrState(type, stream, state);\n }\n\n return {\n startState: function(baseIndent) {\n var state = {tokenize: inText,\n state: baseState,\n indented: baseIndent || 0,\n tagName: null, tagStart: null,\n context: null}\n if (baseIndent != null) state.baseIndent = baseIndent\n return state\n },\n\n token: function(stream, state) {\n if (!state.tagName && stream.sol())\n state.indented = stream.indentation();\n\n if (stream.eatSpace()) return null;\n type = null;\n var style = state.tokenize(stream, state);\n if ((style || type) && style != \"comment\") {\n setStyle = null;\n state.state = state.state(type || style, stream, state);\n if (setStyle)\n style = setStyle == \"error\" ? style + \" error\" : setStyle;\n }\n return style;\n },\n\n indent: function(state, textAfter, fullLine) {\n var context = state.context;\n // Indent multi-line strings (e.g. css).\n if (state.tokenize.isInAttribute) {\n if (state.tagStart == state.indented)\n return state.stringStartCol + 1;\n else\n return state.indented + indentUnit;\n }\n if (context && context.noIndent) return CodeMirror.Pass;\n if (state.tokenize != inTag && state.tokenize != inText)\n return fullLine ? fullLine.match(/^(\\s*)/)[0].length : 0;\n // Indent the starts of attribute names.\n if (state.tagName) {\n if (config.multilineTagIndentPastTag !== false)\n return state.tagStart + state.tagName.length + 2;\n else\n return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);\n }\n if (config.alignCDATA && /$/,\n blockCommentStart: \"\",\n\n configuration: config.htmlMode ? \"html\" : \"xml\",\n helperType: config.htmlMode ? \"html\" : \"xml\",\n\n skipAttribute: function(state) {\n if (state.state == attrValueState)\n state.state = attrState\n }\n };\n});\n\nCodeMirror.defineMIME(\"text/xml\", \"xml\");\nCodeMirror.defineMIME(\"application/xml\", \"xml\");\nif (!CodeMirror.mimeModes.hasOwnProperty(\"text/html\"))\n CodeMirror.defineMIME(\"text/html\", {name: \"xml\", htmlMode: true});\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/xml/xml.js\n// module id = 729\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") { // CommonJS\n mod(require(\"../../lib/codemirror\"));\n } else if (typeof define == \"function\" && define.amd) { // AMD\n define([\"../../lib/codemirror\"], mod);\n } else { // Plain browser env\n mod(CodeMirror);\n }\n})(function(CodeMirror) {\n \"use strict\";\n\n var TOKEN_STYLES = {\n addition: \"positive\",\n attributes: \"attribute\",\n bold: \"strong\",\n cite: \"keyword\",\n code: \"atom\",\n definitionList: \"number\",\n deletion: \"negative\",\n div: \"punctuation\",\n em: \"em\",\n footnote: \"variable\",\n footCite: \"qualifier\",\n header: \"header\",\n html: \"comment\",\n image: \"string\",\n italic: \"em\",\n link: \"link\",\n linkDefinition: \"link\",\n list1: \"variable-2\",\n list2: \"variable-3\",\n list3: \"keyword\",\n notextile: \"string-2\",\n pre: \"operator\",\n p: \"property\",\n quote: \"bracket\",\n span: \"quote\",\n specialChar: \"tag\",\n strong: \"strong\",\n sub: \"builtin\",\n sup: \"builtin\",\n table: \"variable-3\",\n tableHeading: \"operator\"\n };\n\n function startNewLine(stream, state) {\n state.mode = Modes.newLayout;\n state.tableHeading = false;\n\n if (state.layoutType === \"definitionList\" && state.spanningLayout &&\n stream.match(RE(\"definitionListEnd\"), false))\n state.spanningLayout = false;\n }\n\n function handlePhraseModifier(stream, state, ch) {\n if (ch === \"_\") {\n if (stream.eat(\"_\"))\n return togglePhraseModifier(stream, state, \"italic\", /__/, 2);\n else\n return togglePhraseModifier(stream, state, \"em\", /_/, 1);\n }\n\n if (ch === \"*\") {\n if (stream.eat(\"*\")) {\n return togglePhraseModifier(stream, state, \"bold\", /\\*\\*/, 2);\n }\n return togglePhraseModifier(stream, state, \"strong\", /\\*/, 1);\n }\n\n if (ch === \"[\") {\n if (stream.match(/\\d+\\]/)) state.footCite = true;\n return tokenStyles(state);\n }\n\n if (ch === \"(\") {\n var spec = stream.match(/^(r|tm|c)\\)/);\n if (spec)\n return tokenStylesWith(state, TOKEN_STYLES.specialChar);\n }\n\n if (ch === \"<\" && stream.match(/(\\w+)[^>]+>[^<]+<\\/\\1>/))\n return tokenStylesWith(state, TOKEN_STYLES.html);\n\n if (ch === \"?\" && stream.eat(\"?\"))\n return togglePhraseModifier(stream, state, \"cite\", /\\?\\?/, 2);\n\n if (ch === \"=\" && stream.eat(\"=\"))\n return togglePhraseModifier(stream, state, \"notextile\", /==/, 2);\n\n if (ch === \"-\" && !stream.eat(\"-\"))\n return togglePhraseModifier(stream, state, \"deletion\", /-/, 1);\n\n if (ch === \"+\")\n return togglePhraseModifier(stream, state, \"addition\", /\\+/, 1);\n\n if (ch === \"~\")\n return togglePhraseModifier(stream, state, \"sub\", /~/, 1);\n\n if (ch === \"^\")\n return togglePhraseModifier(stream, state, \"sup\", /\\^/, 1);\n\n if (ch === \"%\")\n return togglePhraseModifier(stream, state, \"span\", /%/, 1);\n\n if (ch === \"@\")\n return togglePhraseModifier(stream, state, \"code\", /@/, 1);\n\n if (ch === \"!\") {\n var type = togglePhraseModifier(stream, state, \"image\", /(?:\\([^\\)]+\\))?!/, 1);\n stream.match(/^:\\S+/); // optional Url portion\n return type;\n }\n return tokenStyles(state);\n }\n\n function togglePhraseModifier(stream, state, phraseModifier, closeRE, openSize) {\n var charBefore = stream.pos > openSize ? stream.string.charAt(stream.pos - openSize - 1) : null;\n var charAfter = stream.peek();\n if (state[phraseModifier]) {\n if ((!charAfter || /\\W/.test(charAfter)) && charBefore && /\\S/.test(charBefore)) {\n var type = tokenStyles(state);\n state[phraseModifier] = false;\n return type;\n }\n } else if ((!charBefore || /\\W/.test(charBefore)) && charAfter && /\\S/.test(charAfter) &&\n stream.match(new RegExp(\"^.*\\\\S\" + closeRE.source + \"(?:\\\\W|$)\"), false)) {\n state[phraseModifier] = true;\n state.mode = Modes.attributes;\n }\n return tokenStyles(state);\n };\n\n function tokenStyles(state) {\n var disabled = textileDisabled(state);\n if (disabled) return disabled;\n\n var styles = [];\n if (state.layoutType) styles.push(TOKEN_STYLES[state.layoutType]);\n\n styles = styles.concat(activeStyles(\n state, \"addition\", \"bold\", \"cite\", \"code\", \"deletion\", \"em\", \"footCite\",\n \"image\", \"italic\", \"link\", \"span\", \"strong\", \"sub\", \"sup\", \"table\", \"tableHeading\"));\n\n if (state.layoutType === \"header\")\n styles.push(TOKEN_STYLES.header + \"-\" + state.header);\n\n return styles.length ? styles.join(\" \") : null;\n }\n\n function textileDisabled(state) {\n var type = state.layoutType;\n\n switch(type) {\n case \"notextile\":\n case \"code\":\n case \"pre\":\n return TOKEN_STYLES[type];\n default:\n if (state.notextile)\n return TOKEN_STYLES.notextile + (type ? (\" \" + TOKEN_STYLES[type]) : \"\");\n return null;\n }\n }\n\n function tokenStylesWith(state, extraStyles) {\n var disabled = textileDisabled(state);\n if (disabled) return disabled;\n\n var type = tokenStyles(state);\n if (extraStyles)\n return type ? (type + \" \" + extraStyles) : extraStyles;\n else\n return type;\n }\n\n function activeStyles(state) {\n var styles = [];\n for (var i = 1; i < arguments.length; ++i) {\n if (state[arguments[i]])\n styles.push(TOKEN_STYLES[arguments[i]]);\n }\n return styles;\n }\n\n function blankLine(state) {\n var spanningLayout = state.spanningLayout, type = state.layoutType;\n\n for (var key in state) if (state.hasOwnProperty(key))\n delete state[key];\n\n state.mode = Modes.newLayout;\n if (spanningLayout) {\n state.layoutType = type;\n state.spanningLayout = true;\n }\n }\n\n var REs = {\n cache: {},\n single: {\n bc: \"bc\",\n bq: \"bq\",\n definitionList: /- .*?:=+/,\n definitionListEnd: /.*=:\\s*$/,\n div: \"div\",\n drawTable: /\\|.*\\|/,\n foot: /fn\\d+/,\n header: /h[1-6]/,\n html: /\\s*<(?:\\/)?(\\w+)(?:[^>]+)?>(?:[^<]+<\\/\\1>)?/,\n link: /[^\"]+\":\\S/,\n linkDefinition: /\\[[^\\s\\]]+\\]\\S+/,\n list: /(?:#+|\\*+)/,\n notextile: \"notextile\",\n para: \"p\",\n pre: \"pre\",\n table: \"table\",\n tableCellAttributes: /[\\/\\\\]\\d+/,\n tableHeading: /\\|_\\./,\n tableText: /[^\"_\\*\\[\\(\\?\\+~\\^%@|-]+/,\n text: /[^!\"_=\\*\\[\\(<\\?\\+~\\^%@-]+/\n },\n attributes: {\n align: /(?:<>|<|>|=)/,\n selector: /\\([^\\(][^\\)]+\\)/,\n lang: /\\[[^\\[\\]]+\\]/,\n pad: /(?:\\(+|\\)+){1,2}/,\n css: /\\{[^\\}]+\\}/\n },\n createRe: function(name) {\n switch (name) {\n case \"drawTable\":\n return REs.makeRe(\"^\", REs.single.drawTable, \"$\");\n case \"html\":\n return REs.makeRe(\"^\", REs.single.html, \"(?:\", REs.single.html, \")*\", \"$\");\n case \"linkDefinition\":\n return REs.makeRe(\"^\", REs.single.linkDefinition, \"$\");\n case \"listLayout\":\n return REs.makeRe(\"^\", REs.single.list, RE(\"allAttributes\"), \"*\\\\s+\");\n case \"tableCellAttributes\":\n return REs.makeRe(\"^\", REs.choiceRe(REs.single.tableCellAttributes,\n RE(\"allAttributes\")), \"+\\\\.\");\n case \"type\":\n return REs.makeRe(\"^\", RE(\"allTypes\"));\n case \"typeLayout\":\n return REs.makeRe(\"^\", RE(\"allTypes\"), RE(\"allAttributes\"),\n \"*\\\\.\\\\.?\", \"(\\\\s+|$)\");\n case \"attributes\":\n return REs.makeRe(\"^\", RE(\"allAttributes\"), \"+\");\n\n case \"allTypes\":\n return REs.choiceRe(REs.single.div, REs.single.foot,\n REs.single.header, REs.single.bc, REs.single.bq,\n REs.single.notextile, REs.single.pre, REs.single.table,\n REs.single.para);\n\n case \"allAttributes\":\n return REs.choiceRe(REs.attributes.selector, REs.attributes.css,\n REs.attributes.lang, REs.attributes.align, REs.attributes.pad);\n\n default:\n return REs.makeRe(\"^\", REs.single[name]);\n }\n },\n makeRe: function() {\n var pattern = \"\";\n for (var i = 0; i < arguments.length; ++i) {\n var arg = arguments[i];\n pattern += (typeof arg === \"string\") ? arg : arg.source;\n }\n return new RegExp(pattern);\n },\n choiceRe: function() {\n var parts = [arguments[0]];\n for (var i = 1; i < arguments.length; ++i) {\n parts[i * 2 - 1] = \"|\";\n parts[i * 2] = arguments[i];\n }\n\n parts.unshift(\"(?:\");\n parts.push(\")\");\n return REs.makeRe.apply(null, parts);\n }\n };\n\n function RE(name) {\n return (REs.cache[name] || (REs.cache[name] = REs.createRe(name)));\n }\n\n var Modes = {\n newLayout: function(stream, state) {\n if (stream.match(RE(\"typeLayout\"), false)) {\n state.spanningLayout = false;\n return (state.mode = Modes.blockType)(stream, state);\n }\n var newMode;\n if (!textileDisabled(state)) {\n if (stream.match(RE(\"listLayout\"), false))\n newMode = Modes.list;\n else if (stream.match(RE(\"drawTable\"), false))\n newMode = Modes.table;\n else if (stream.match(RE(\"linkDefinition\"), false))\n newMode = Modes.linkDefinition;\n else if (stream.match(RE(\"definitionList\")))\n newMode = Modes.definitionList;\n else if (stream.match(RE(\"html\"), false))\n newMode = Modes.html;\n }\n return (state.mode = (newMode || Modes.text))(stream, state);\n },\n\n blockType: function(stream, state) {\n var match, type;\n state.layoutType = null;\n\n if (match = stream.match(RE(\"type\")))\n type = match[0];\n else\n return (state.mode = Modes.text)(stream, state);\n\n if (match = type.match(RE(\"header\"))) {\n state.layoutType = \"header\";\n state.header = parseInt(match[0][1]);\n } else if (type.match(RE(\"bq\"))) {\n state.layoutType = \"quote\";\n } else if (type.match(RE(\"bc\"))) {\n state.layoutType = \"code\";\n } else if (type.match(RE(\"foot\"))) {\n state.layoutType = \"footnote\";\n } else if (type.match(RE(\"notextile\"))) {\n state.layoutType = \"notextile\";\n } else if (type.match(RE(\"pre\"))) {\n state.layoutType = \"pre\";\n } else if (type.match(RE(\"div\"))) {\n state.layoutType = \"div\";\n } else if (type.match(RE(\"table\"))) {\n state.layoutType = \"table\";\n }\n\n state.mode = Modes.attributes;\n return tokenStyles(state);\n },\n\n text: function(stream, state) {\n if (stream.match(RE(\"text\"))) return tokenStyles(state);\n\n var ch = stream.next();\n if (ch === '\"')\n return (state.mode = Modes.link)(stream, state);\n return handlePhraseModifier(stream, state, ch);\n },\n\n attributes: function(stream, state) {\n state.mode = Modes.layoutLength;\n\n if (stream.match(RE(\"attributes\")))\n return tokenStylesWith(state, TOKEN_STYLES.attributes);\n else\n return tokenStyles(state);\n },\n\n layoutLength: function(stream, state) {\n if (stream.eat(\".\") && stream.eat(\".\"))\n state.spanningLayout = true;\n\n state.mode = Modes.text;\n return tokenStyles(state);\n },\n\n list: function(stream, state) {\n var match = stream.match(RE(\"list\"));\n state.listDepth = match[0].length;\n var listMod = (state.listDepth - 1) % 3;\n if (!listMod)\n state.layoutType = \"list1\";\n else if (listMod === 1)\n state.layoutType = \"list2\";\n else\n state.layoutType = \"list3\";\n\n state.mode = Modes.attributes;\n return tokenStyles(state);\n },\n\n link: function(stream, state) {\n state.mode = Modes.text;\n if (stream.match(RE(\"link\"))) {\n stream.match(/\\S+/);\n return tokenStylesWith(state, TOKEN_STYLES.link);\n }\n return tokenStyles(state);\n },\n\n linkDefinition: function(stream, state) {\n stream.skipToEnd();\n return tokenStylesWith(state, TOKEN_STYLES.linkDefinition);\n },\n\n definitionList: function(stream, state) {\n stream.match(RE(\"definitionList\"));\n\n state.layoutType = \"definitionList\";\n\n if (stream.match(/\\s*$/))\n state.spanningLayout = true;\n else\n state.mode = Modes.attributes;\n\n return tokenStyles(state);\n },\n\n html: function(stream, state) {\n stream.skipToEnd();\n return tokenStylesWith(state, TOKEN_STYLES.html);\n },\n\n table: function(stream, state) {\n state.layoutType = \"table\";\n return (state.mode = Modes.tableCell)(stream, state);\n },\n\n tableCell: function(stream, state) {\n if (stream.match(RE(\"tableHeading\")))\n state.tableHeading = true;\n else\n stream.eat(\"|\");\n\n state.mode = Modes.tableCellAttributes;\n return tokenStyles(state);\n },\n\n tableCellAttributes: function(stream, state) {\n state.mode = Modes.tableText;\n\n if (stream.match(RE(\"tableCellAttributes\")))\n return tokenStylesWith(state, TOKEN_STYLES.attributes);\n else\n return tokenStyles(state);\n },\n\n tableText: function(stream, state) {\n if (stream.match(RE(\"tableText\")))\n return tokenStyles(state);\n\n if (stream.peek() === \"|\") { // end of cell\n state.mode = Modes.tableCell;\n return tokenStyles(state);\n }\n return handlePhraseModifier(stream, state, stream.next());\n }\n };\n\n CodeMirror.defineMode(\"textile\", function() {\n return {\n startState: function() {\n return { mode: Modes.newLayout };\n },\n token: function(stream, state) {\n if (stream.sol()) startNewLine(stream, state);\n return state.mode(stream, state);\n },\n blankLine: blankLine\n };\n });\n\n CodeMirror.defineMIME(\"text/x-textile\", \"textile\");\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/textile/textile.js\n// module id = 730\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode('shell', function() {\n\n var words = {};\n function define(style, dict) {\n for(var i = 0; i < dict.length; i++) {\n words[dict[i]] = style;\n }\n };\n\n var commonAtoms = [\"true\", \"false\"];\n var commonKeywords = [\"if\", \"then\", \"do\", \"else\", \"elif\", \"while\", \"until\", \"for\", \"in\", \"esac\", \"fi\",\n \"fin\", \"fil\", \"done\", \"exit\", \"set\", \"unset\", \"export\", \"function\"];\n var commonCommands = [\"ab\", \"awk\", \"bash\", \"beep\", \"cat\", \"cc\", \"cd\", \"chown\", \"chmod\", \"chroot\", \"clear\",\n \"cp\", \"curl\", \"cut\", \"diff\", \"echo\", \"find\", \"gawk\", \"gcc\", \"get\", \"git\", \"grep\", \"hg\", \"kill\", \"killall\",\n \"ln\", \"ls\", \"make\", \"mkdir\", \"openssl\", \"mv\", \"nc\", \"nl\", \"node\", \"npm\", \"ping\", \"ps\", \"restart\", \"rm\",\n \"rmdir\", \"sed\", \"service\", \"sh\", \"shopt\", \"shred\", \"source\", \"sort\", \"sleep\", \"ssh\", \"start\", \"stop\",\n \"su\", \"sudo\", \"svn\", \"tee\", \"telnet\", \"top\", \"touch\", \"vi\", \"vim\", \"wall\", \"wc\", \"wget\", \"who\", \"write\",\n \"yes\", \"zsh\"];\n\n CodeMirror.registerHelper(\"hintWords\", \"shell\", commonAtoms.concat(commonKeywords, commonCommands));\n\n define('atom', commonAtoms);\n define('keyword', commonKeywords);\n define('builtin', commonCommands);\n\n function tokenBase(stream, state) {\n if (stream.eatSpace()) return null;\n\n var sol = stream.sol();\n var ch = stream.next();\n\n if (ch === '\\\\') {\n stream.next();\n return null;\n }\n if (ch === '\\'' || ch === '\"' || ch === '`') {\n state.tokens.unshift(tokenString(ch, ch === \"`\" ? \"quote\" : \"string\"));\n return tokenize(stream, state);\n }\n if (ch === '#') {\n if (sol && stream.eat('!')) {\n stream.skipToEnd();\n return 'meta'; // 'comment'?\n }\n stream.skipToEnd();\n return 'comment';\n }\n if (ch === '$') {\n state.tokens.unshift(tokenDollar);\n return tokenize(stream, state);\n }\n if (ch === '+' || ch === '=') {\n return 'operator';\n }\n if (ch === '-') {\n stream.eat('-');\n stream.eatWhile(/\\w/);\n return 'attribute';\n }\n if (/\\d/.test(ch)) {\n stream.eatWhile(/\\d/);\n if(stream.eol() || !/\\w/.test(stream.peek())) {\n return 'number';\n }\n }\n stream.eatWhile(/[\\w-]/);\n var cur = stream.current();\n if (stream.peek() === '=' && /\\w+/.test(cur)) return 'def';\n return words.hasOwnProperty(cur) ? words[cur] : null;\n }\n\n function tokenString(quote, style) {\n var close = quote == \"(\" ? \")\" : quote == \"{\" ? \"}\" : quote\n return function(stream, state) {\n var next, escaped = false;\n while ((next = stream.next()) != null) {\n if (next === close && !escaped) {\n state.tokens.shift();\n break;\n } else if (next === '$' && !escaped && quote !== \"'\" && stream.peek() != close) {\n escaped = true;\n stream.backUp(1);\n state.tokens.unshift(tokenDollar);\n break;\n } else if (!escaped && quote !== close && next === quote) {\n state.tokens.unshift(tokenString(quote, style))\n return tokenize(stream, state)\n } else if (!escaped && /['\"]/.test(next) && !/['\"]/.test(quote)) {\n state.tokens.unshift(tokenStringStart(next, \"string\"));\n stream.backUp(1);\n break;\n }\n escaped = !escaped && next === '\\\\';\n }\n return style;\n };\n };\n\n function tokenStringStart(quote, style) {\n return function(stream, state) {\n state.tokens[0] = tokenString(quote, style)\n stream.next()\n return tokenize(stream, state)\n }\n }\n\n var tokenDollar = function(stream, state) {\n if (state.tokens.length > 1) stream.eat('$');\n var ch = stream.next()\n if (/['\"({]/.test(ch)) {\n state.tokens[0] = tokenString(ch, ch == \"(\" ? \"quote\" : ch == \"{\" ? \"def\" : \"string\");\n return tokenize(stream, state);\n }\n if (!/\\d/.test(ch)) stream.eatWhile(/\\w/);\n state.tokens.shift();\n return 'def';\n };\n\n function tokenize(stream, state) {\n return (state.tokens[0] || tokenBase) (stream, state);\n };\n\n return {\n startState: function() {return {tokens:[]};},\n token: function(stream, state) {\n return tokenize(stream, state);\n },\n closeBrackets: \"()[]{}''\\\"\\\"``\",\n lineComment: '#',\n fold: \"brace\"\n };\n});\n\nCodeMirror.defineMIME('text/x-sh', 'shell');\n// Apache uses a slightly different Media Type for Shell scripts\n// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types\nCodeMirror.defineMIME('application/x-sh', 'shell');\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/shell/shell.js\n// module id = 731\n// module chunks = 3 4 5 7 8 14","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-17a2306c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./email.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./email.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./email.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-17a2306c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./email.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue\n// module id = 734\n// module chunks = 0 3 4 5 6","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/dag.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Vue from 'vue'\nimport $ from 'jquery'\nimport _ from 'lodash'\nimport i18n from '@/module/i18n'\nimport { jsPlumb } from 'jsplumb'\nimport DragZoom from './dragZoom'\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\nimport Permissions from '@/module/permissions'\nimport { uuid, findComponentDownward } from '@/module/util/'\nimport {\n tasksAll,\n rtTasksTpl,\n setSvgColor,\n saveTargetarr,\n rtTargetarrArr } from './util'\nimport mStart from '@/conf/home/pages/projects/pages/definition/pages/list/_source/start'\n\nlet JSP = function () {\n this.dag = {}\n this.selectedElement = {}\n\n this.config = {\n // Whether to drag\n isDrag: true,\n // Whether to allow connection\n isAttachment: false,\n // Whether to drag a new node\n isNewNodes: true,\n // Whether to support double-click node events\n isDblclick: true,\n // Whether to support right-click menu events\n isContextmenu: true,\n // Whether to allow click events\n isClick: false\n }\n}\n\n/**\n * dag init\n */\nJSP.prototype.init = function ({ dag, instance }) {\n // Get the dag component instance\n this.dag = dag\n // Get jsplumb instance\n this.JspInstance = instance\n // Register jsplumb connection type and configuration\n this.JspInstance.registerConnectionType('basic', {\n anchor: 'Continuous',\n connector: 'Straight' // Line type\n })\n\n // Initial configuration\n this.setConfig({\n isDrag: !store.state.dag.isDetails,\n isAttachment: false,\n isNewNodes: Permissions.getAuth() === false ? false : !store.state.dag.isDetails,\n isDblclick: true,\n isContextmenu: true,\n isClick: false\n })\n\n // Monitor line click\n this.JspInstance.bind('click', e => {\n if (this.config.isClick) {\n this.connectClick(e)\n }\n })\n\n // Drag and drop\n if (this.config.isNewNodes) {\n DragZoom.init()\n }\n}\n\n/**\n * set config attribute\n */\nJSP.prototype.setConfig = function (o) {\n this.config = Object.assign(this.config, {}, o)\n}\n\n/**\n * Node binding event\n */\nJSP.prototype.tasksEvent = function (selfId) {\n let tasks = $(`#${selfId}`)\n // Bind right event\n tasks.on('contextmenu', e => {\n this.tasksContextmenu(e)\n return false\n })\n\n // Binding double click event\n tasks.find('.icos').bind('dblclick', e => {\n this.tasksDblclick(e)\n })\n\n // Binding click event\n tasks.on('click', e => {\n this.tasksClick(e)\n })\n}\n\n/**\n * Dag node drag and drop processing\n */\nJSP.prototype.draggable = function () {\n if (this.config.isNewNodes) {\n let selfId\n let self = this\n $('.toolbar-btn .roundedRect').draggable({\n scope: 'plant',\n helper: 'clone',\n containment: $('.dag-model'),\n stop: function (e, ui) {\n self.tasksEvent(selfId)\n\n // Dom structure is not generated without pop-up form form\n if ($(`#${selfId}`).html()) {\n // dag event\n findComponentDownward(self.dag.$root, 'dag-chart')._createNodes({\n id: selfId\n })\n }\n },\n drag: function () {\n $('body').find('.tooltip.fade.top.in').remove()\n }\n })\n\n $('#canvas').droppable({\n scope: 'plant',\n drop: function (ev, ui) {\n let id = 'tasks-' + Math.ceil(Math.random() * 100000) // eslint-disable-line\n // Get mouse coordinates\n let left = parseInt(ui.offset.left - $(this).offset().left)\n let top = parseInt(ui.offset.top - $(this).offset().top) - 10\n if (top < 25) {\n top = 25\n }\n // Generate template node\n $('#canvas').append(rtTasksTpl({\n id: id,\n name: id,\n x: left,\n y: top,\n isAttachment: self.config.isAttachment,\n taskType: findComponentDownward(self.dag.$root, 'dag-chart').dagBarId\n }))\n\n // Get the generated node\n let thisDom = jsPlumb.getSelector('.statemachine-demo .w')\n\n // Generating a connection node\n self.JspInstance.batch(() => {\n self.initNode(thisDom[thisDom.length - 1])\n })\n selfId = id\n }\n })\n }\n}\n\n/**\n * Echo json processing and old data structure processing\n */\nJSP.prototype.jsonHandle = function ({ largeJson, locations }) {\n _.map(largeJson, v => {\n // Generate template\n $('#canvas').append(rtTasksTpl({\n id: v.id,\n name: v.name,\n x: locations[v.id]['x'],\n y: locations[v.id]['y'],\n targetarr: locations[v.id]['targetarr'],\n isAttachment: this.config.isAttachment,\n taskType: v.type,\n runFlag:v.runFlag\n }))\n\n // contextmenu event\n $(`#${v.id}`).on('contextmenu', e => {\n this.tasksContextmenu(e)\n return false\n })\n\n // dblclick event\n $(`#${v.id}`).find('.icos').bind('dblclick', e => {\n this.tasksDblclick(e)\n })\n\n // click event\n $(`#${v.id}`).bind('click', e => {\n this.tasksClick(e)\n })\n })\n}\n\n/**\n * Initialize a single node\n */\nJSP.prototype.initNode = function (el) {\n // Whether to drag\n if (this.config.isDrag) {\n this.JspInstance.draggable(el, {\n containment: 'dag-container'\n })\n }\n\n // Node attribute configuration\n this.JspInstance.makeSource(el, {\n filter: '.ep',\n anchor: 'Continuous',\n connectorStyle: {\n stroke: '#555',\n strokeWidth: 2,\n outlineStroke: 'transparent',\n outlineWidth: 4\n },\n // This place is leaking\n // connectionType: \"basic\",\n extract: {\n action: 'the-action'\n },\n maxConnections: -1\n })\n\n // Node connection property configuration\n this.JspInstance.makeTarget(el, {\n dropOptions: { hoverClass: 'dragHover' },\n anchor: 'Continuous',\n allowLoopback: false // Forbid yourself to connect yourself\n })\n this.JspInstance.fire('jsPlumbDemoNodeAdded', el)\n}\n\n/**\n * Node right click menu\n */\nJSP.prototype.tasksContextmenu = function (event) {\n if (this.config.isContextmenu) {\n let routerName = router.history.current.name\n // state\n let isOne = routerName === 'projects-definition-details' && this.dag.releaseState !== 'NOT_RELEASE'\n // hide\n let isTwo = store.state.dag.isDetails\n\n let html = [\n `${i18n.$t('开始运行')}`,\n `${i18n.$t('编辑节点')}`,\n `${i18n.$t('复制节点')}`,\n `${i18n.$t('删除节点')}`\n ]\n\n let operationHtml = () => {\n return html.splice(',')\n }\n\n let e = event\n let $id = e.currentTarget.id\n let $contextmenu = $('#contextmenu')\n let $name = $(`#${$id}`).find('.name-p').text()\n let $left = e.pageX + document.body.scrollLeft - 5\n let $top = e.pageY + document.body.scrollTop - 5\n $contextmenu.css({\n left: $left,\n top: $top,\n visibility: 'visible'\n })\n // Action bar\n $contextmenu.html('').append(operationHtml)\n\n if (isOne) {\n // start run\n $('#startRunning').on('click', () => {\n let id = router.history.current.params.id\n store.dispatch('dag/getStartCheck', { processDefinitionId: id }).then(res => {\n let modal = Vue.$modal.dialog({\n closable: false,\n showMask: true,\n escClose: true,\n className: 'v-modal-custom',\n transitionName: 'opacityp',\n render (h) {\n return h(mStart, {\n on: {\n onUpdate () {\n modal.remove()\n },\n close () {\n modal.remove()\n }\n },\n props: {\n item: {\n id: id\n },\n startNodeList: $name,\n sourceType: 'contextmenu'\n }\n })\n }\n })\n }).catch(e => {\n Vue.$message.error(e.msg || '')\n })\n })\n }\n if (!isTwo) {\n // edit node\n $(`#editNodes`).click(ev => {\n findComponentDownward(this.dag.$root, 'dag-chart')._createNodes({\n id: $id,\n type: $(`#${$id}`).attr('data-tasks-type')\n })\n })\n // delete node\n $('#removeNodes').click(ev => {\n this.removeNodes($id)\n })\n\n // copy node\n $('#copyNodes').click(res => {\n this.copyNodes($id)\n })\n }\n }\n}\n\n/**\n * Node double click event\n */\nJSP.prototype.tasksDblclick = function (e) {\n // Untie event\n if (this.config.isDblclick) {\n let id = $(e.currentTarget.offsetParent).attr('id')\n\n findComponentDownward(this.dag.$root, 'dag-chart')._createNodes({\n id: id,\n type: $(`#${id}`).attr('data-tasks-type')\n })\n }\n}\n\n/**\n * Node click event\n */\nJSP.prototype.tasksClick = function (e) {\n let $id\n let self = this\n let $body = $(`body`)\n if (this.config.isClick) {\n let $connect = this.selectedElement.connect\n $('.w').removeClass('jtk-tasks-active')\n $(e.currentTarget).addClass('jtk-tasks-active')\n if ($connect) {\n setSvgColor($connect, '#555')\n this.selectedElement.connect = null\n }\n this.selectedElement.id = $(e.currentTarget).attr('id')\n\n // Unbind copy and paste events\n $body.unbind('copy').unbind('paste')\n // Copy binding id\n $id = self.selectedElement.id\n\n $body.bind({\n copy: function () {\n $id = self.selectedElement.id\n },\n paste: function () {\n $id && self.copyNodes($id)\n }\n })\n }\n}\n\n/**\n * Remove binding events\n * paste\n */\nJSP.prototype.removePaste = function () {\n let $body = $(`body`)\n // Unbind copy and paste events\n $body.unbind('copy').unbind('paste')\n // Remove selected node parameters\n this.selectedElement.id = null\n // Remove node selection effect\n $('.w').removeClass('jtk-tasks-active')\n}\n\n/**\n * Line click event\n */\nJSP.prototype.connectClick = function (e) {\n // Set svg color\n setSvgColor(e, '#0097e0')\n let $id = this.selectedElement.id\n if ($id) {\n $(`#${$id}`).removeClass('jtk-tasks-active')\n this.selectedElement.id = null\n }\n this.selectedElement.connect = e\n}\n\n/**\n * toolbarEvent\n * @param {Pointer}\n */\nJSP.prototype.handleEventPointer = function (is) {\n let wDom = $('.w')\n this.setConfig({\n isClick: is,\n isAttachment: false\n })\n wDom.removeClass('jtk-ep')\n if (!is) {\n wDom.removeClass('jtk-tasks-active')\n this.selectedElement = {}\n _.map($('#canvas svg'), v => {\n if ($(v).attr('class')) {\n _.map($(v).find('path'), v1 => {\n $(v1).attr('fill', '#555')\n $(v1).attr('stroke', '#555')\n })\n }\n })\n }\n}\n\n/**\n * toolbarEvent\n * @param {Line}\n */\nJSP.prototype.handleEventLine = function (is) {\n let wDom = $('.w')\n this.setConfig({\n isAttachment: is\n })\n is ? wDom.addClass('jtk-ep') : wDom.removeClass('jtk-ep')\n}\n\n/**\n * toolbarEvent\n * @param {Remove}\n */\nJSP.prototype.handleEventRemove = function () {\n let $id = this.selectedElement.id || null\n let $connect = this.selectedElement.connect || null\n if ($id) {\n this.removeNodes(this.selectedElement.id)\n } else {\n this.removeConnect($connect)\n }\n\n // Monitor whether to edit DAG\n store.commit('dag/setIsEditDag', true)\n}\n\n/**\n * Delete node\n */\nJSP.prototype.removeNodes = function ($id) {\n // Delete node processing(data-targetarr)\n _.map(tasksAll(), v => {\n let targetarr = v.targetarr.split(',')\n if (targetarr.length) {\n let newArr = _.filter(targetarr, v1 => v1 !== $id)\n $(`#${v.id}`).attr('data-targetarr', newArr.toString())\n }\n })\n // delete node\n this.JspInstance.remove($id)\n}\n\n/**\n * Delete connection\n */\nJSP.prototype.removeConnect = function ($connect) {\n if (!$connect) {\n return\n }\n // Remove connections and remove node and node dependencies\n let targetId = $connect.targetId\n let sourceId = $connect.sourceId\n let targetarr = rtTargetarrArr(targetId)\n if (targetarr.length) {\n targetarr = _.filter(targetarr, v => v !== sourceId)\n $(`#${targetId}`).attr('data-targetarr', targetarr.toString())\n }\n this.JspInstance.deleteConnection($connect)\n\n this.selectedElement = {}\n}\n\n/**\n * Copy node\n */\nJSP.prototype.copyNodes = function ($id) {\n let newNodeInfo = _.cloneDeep(_.find(store.state.dag.tasks, v => v.id === $id))\n let newNodePors = store.state.dag.locations[$id]\n // Unstored nodes do not allow replication\n if (!newNodePors) {\n return\n }\n // Generate random id\n let newUuId = `${uuid() + uuid()}`\n let id = newNodeInfo.id.length > 8 ? newNodeInfo.id.substr(0, 7) : newNodeInfo.id\n let name = newNodeInfo.name.length > 8 ? newNodeInfo.name.substr(0, 7) : newNodeInfo.name\n\n // new id\n let newId = `${id || ''}-${newUuId}`\n // new name\n let newName = `${name || ''}-${newUuId}`\n // coordinate x\n let newX = newNodePors.x + 100\n // coordinate y\n let newY = newNodePors.y + 40\n\n // Generate template node\n $('#canvas').append(rtTasksTpl({\n id: newId,\n name: newName,\n x: newX,\n y: newY,\n isAttachment: this.config.isAttachment,\n taskType: newNodeInfo.type\n }))\n\n // Get the generated node\n let thisDom = jsPlumb.getSelector('.statemachine-demo .w')\n\n // Copy node information\n newNodeInfo = Object.assign(newNodeInfo, {\n id: newId,\n name: newName\n })\n\n // Add new node\n store.commit('dag/addTasks', newNodeInfo)\n // Add node location information\n store.commit('dag/setLocations', {\n [newId]: {\n name: newName,\n targetarr: '',\n x: newX,\n y: newY\n }\n })\n\n // Generating a connection node\n this.JspInstance.batch(() => {\n this.initNode(thisDom[thisDom.length - 1])\n // Add events to nodes\n this.tasksEvent(newId)\n })\n}\n/**\n * toolbarEvent\n * @param {Screen}\n */\nJSP.prototype.handleEventScreen = function ({ item, is }) {\n let screenOpen = true\n if (is) {\n item.icon = ''\n screenOpen = true\n } else {\n item.icon = ''\n screenOpen = false\n }\n let $mainLayoutModel = $('.main-layout-model')\n if (screenOpen) {\n $mainLayoutModel.addClass('dag-screen')\n } else {\n $mainLayoutModel.removeClass('dag-screen')\n }\n}\n/**\n * save task\n * @param tasks\n * @param locations\n * @param connects\n */\nJSP.prototype.saveStore = function () {\n return new Promise((resolve, reject) => {\n let connects = []\n let locations = {}\n let tasks = []\n\n let is = (id) => {\n return !!_.filter(tasksAll(), v => v.id === id).length\n }\n\n // task\n _.map(_.cloneDeep(store.state.dag.tasks), v => {\n if (is(v.id)) {\n let preTasks = []\n let id = $(`#${v.id}`)\n let tar = id.attr('data-targetarr')\n let idDep = tar ? id.attr('data-targetarr').split(',') : []\n if (idDep.length) {\n _.map(idDep, v1 => {\n preTasks.push($(`#${v1}`).find('.name-p').text())\n })\n }\n\n let tasksParam = _.assign(v, {\n preTasks: preTasks\n })\n\n // Sub-workflow has no retries and interval\n if (v.type === 'SUB_PROCESS') {\n tasksParam = _.omit(tasksParam, ['maxRetryTimes', 'retryInterval'])\n }\n\n tasks.push(tasksParam)\n }\n })\n\n _.map(this.JspInstance.getConnections(), v => {\n connects.push({\n 'endPointSourceId': v.sourceId,\n 'endPointTargetId': v.targetId\n })\n })\n\n _.map(tasksAll(), v => {\n locations[v.id] = {\n name: v.name,\n targetarr: v.targetarr,\n x: v.x,\n y: v.y\n }\n })\n\n // Storage node\n store.commit('dag/setTasks', tasks)\n // Store coordinate information\n store.commit('dag/setLocations', locations)\n // Storage line dependence\n store.commit('dag/setConnects', connects)\n\n resolve({\n connects: connects,\n tasks: tasks,\n locations: locations\n })\n })\n}\n/**\n * Event processing\n */\nJSP.prototype.handleEvent = function () {\n this.JspInstance.bind('beforeDrop', function (info) {\n let sourceId = info['sourceId']// 出\n let targetId = info['targetId']// 入\n\n /**\n * Recursive search for nodes\n */\n let recursiveVal\n const recursiveTargetarr = (arr, targetId) => {\n for (var i in arr) {\n if (arr[i] === targetId) {\n recursiveVal = targetId\n } else {\n let recTargetarrArr = rtTargetarrArr(arr[i])\n if (recTargetarrArr.length) {\n recursiveTargetarr(recTargetarrArr, targetId)\n } else {\n return recursiveTargetarr(targetId)\n }\n }\n }\n return recursiveVal\n }\n\n // Connection to connected nodes is not allowed\n if (_.findIndex(rtTargetarrArr(targetId), v => v === sourceId) !== -1) {\n return false\n }\n\n // Recursive form to find if the target Targetarr has a sourceId\n if (recursiveTargetarr(rtTargetarrArr(sourceId), targetId)) {\n // setRecursiveVal(null)\n return false\n }\n\n // Storage node dependency information\n saveTargetarr(sourceId, targetId)\n\n // Monitor whether to edit DAG\n store.commit('dag/setIsEditDag', true)\n\n return true\n })\n}\n/**\n * Backfill data processing\n */\nJSP.prototype.jspBackfill = function ({ connects, locations, largeJson }) {\n // Backfill nodes\n this.jsonHandle({\n largeJson: largeJson,\n locations: locations\n })\n\n let wNodes = jsPlumb.getSelector('.statemachine-demo .w')\n\n // Backfill line\n this.JspInstance.batch(() => {\n for (let i = 0; i < wNodes.length; i++) {\n this.initNode(wNodes[i])\n }\n _.map(connects, v => {\n let sourceId = v.endPointSourceId.split('-')\n let targetId = v.endPointTargetId.split('-')\n if (sourceId.length === 4 && targetId.length === 4) {\n sourceId = `${sourceId[0]}-${sourceId[1]}-${sourceId[2]}`\n targetId = `${targetId[0]}-${targetId[1]}-${targetId[2]}`\n } else {\n sourceId = v.endPointSourceId\n targetId = v.endPointTargetId\n }\n\n this.JspInstance.connect({\n source: sourceId,\n target: targetId,\n type: 'basic',\n paintStyle: { strokeWidth: 2, stroke: '#555' }\n })\n })\n })\n\n jsPlumb.fire('jsPlumbDemoLoaded', this.JspInstance)\n\n // Connection monitoring\n this.handleEvent()\n\n // Drag and drop new nodes\n this.draggable()\n}\n\nexport default new JSP()\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/udp/udp.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/localParams.vue","\nimport Vue from 'vue'\nimport mAffirm from './jumpAffirm'\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\nimport { uuid, findComponentDownward } from '@/module/util/'\n\nlet Affirm = {}\nlet $root = {}\nlet $routerType = ''\nlet $isPop = true\n\n/**\n * Listen for route changes\n */\nrouter.beforeEach((to, from, next) => {\n if (from.name === 'projects-definition-details' || from.name === 'projects-instance-details' || from.name === 'definition-create') {\n if (!Affirm.paramVerification(from.name)) {\n Affirm.isPop(() => {\n next()\n })\n } else {\n next()\n }\n } else {\n next()\n }\n})\n\n/**\n * Get judgment initialization data\n */\nAffirm.init = (root) => {\n $isPop = true\n $root = root\n $routerType = router.history.current.name\n}\n\n/**\n * Parameter verification\n */\nAffirm.paramVerification = (name) => {\n if (!$isPop) {\n return true\n }\n let dagStore = store.state.dag\n let flag = false\n if ($routerType === 'definition-create') {\n // No nodes jump out directly\n if (dagStore.tasks.length) {\n if (!dagStore.name) {\n store.commit('dag/setName', `${uuid('dag_')}${uuid() + uuid()}`)\n }\n flag = false\n } else {\n flag = true\n }\n } else {\n // View history direct jump\n flag = name === 'projects-instance-details' ? true : !dagStore.isEditDag\n }\n return flag\n}\n\n/**\n * Pop-up judgment\n */\nAffirm.isPop = (fn) => {\n Vue.$modal.dialog({\n closable: false,\n showMask: true,\n escClose: true,\n className: 'v-modal-custom',\n transitionName: 'opacityp',\n render (h) {\n return h(mAffirm, {\n on: {\n ok () {\n // save\n findComponentDownward($root, 'dag-chart')._save('affirm').then(() => {\n fn()\n Vue.$modal.destroy()\n }).catch(() => {\n fn()\n Vue.$modal.destroy()\n })\n },\n close () {\n fn()\n Vue.$modal.destroy()\n }\n },\n props: {\n }\n })\n }\n })\n}\n\n/**\n * Whether the external setting pops up\n */\nAffirm.setIsPop = (is) => {\n $isPop = is\n}\n\nexport default Affirm\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/jumpAffirm/index.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/jumpAffirm/jumpAffirm.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/formModel.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/listBox.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/resources.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/udfs.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/sqlType.vue","var normalizeComponent = require(\"!../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./datasource.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./datasource.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-62aa87e3\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./datasource.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/dag/_source/formModel/tasks/_source/datasource.vue\n// module id = 786\n// module chunks = 3 4 5","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/datasource.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/procedure.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/dependItemList.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/sub_process.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/_source/selectInput.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/_source/timeoutAlarm.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-2175c153\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./start.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./start.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./start.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-2175c153\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./start.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue\n// module id = 798\n// module chunks = 0 3 4 5","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\n\nexport default {\n data () {\n return {\n router,\n store,\n isDetails: false\n }\n },\n created () {\n this.isDetails = this.store.state.dag.isDetails\n },\n methods: {\n },\n computed: {\n _isDetails () {\n return this.isDetails ? 'icon-disabled' : ''\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/module/mixin/disabledState.js","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n// This is CodeMirror (https://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\//.test(userAgent);\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\\/\\w+/.test(userAgent);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt() {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var activeElement;\n try {\n activeElement = document.activeElement;\n } catch(e) {\n activeElement = document.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {this.id = null;};\n Delayed.prototype.set = function (ms, f) {\n clearTimeout(this.id);\n this.id = setTimeout(f, ms);\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 30;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\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]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n input.init(d);\n }\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n // Add a span to a line.\n function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers || (emitter._handlers = {});\n map$$1[type] = (map$$1[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers, arr = map$$1 && map$$1[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map$$1[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range$$1;\n try {range$$1 = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range$$1 || range$$1.parentElement() != te) { return false }\n return range$$1.compareEndPoints(\"StartToEnd\", range$$1) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var this$1 = this;\n\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n var this$1 = this;\n\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this$1.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\s)\" + lineClass[2] + \"(?:$|\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {\n var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (node.className == \"CodeMirror-linewidget\")\n { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\");\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map$$1, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map$$1.length; i += 3) {\n mStart = map$$1[i];\n mEnd = map$$1[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map$$1.length - 3 || ch == mEnd && map$$1[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map$$1[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map$$1[i - 2] == map$$1[i - 3] && map$$1[i - 1].insertLeft) {\n node = map$$1[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map$$1.length - 3 && map$$1[i + 3] == map$$1[i + 4] && !map$$1[i + 5].insertLeft) {\n node = map$$1[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX() {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }\n return window.pageXOffset || (document.documentElement || document.body).scrollLeft\n }\n function pageScrollY() {\n if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }\n return window.pageYOffset || (document.documentElement || document.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var height = 0;\n if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above)\n { height += widgetHeight(lineObj.widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = true; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo$$1, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight$$1 = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo$$1, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight$$1; box.bottom += widgetHeight$$1;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight$$1 <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo$$1, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top || y >= coords.bottom;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo$$1, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo$$1, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo$$1, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo$$1, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range$$1 = doc.sel.ranges[i];\n if (range$$1.from().line >= cm.display.viewTo || range$$1.to().line < cm.display.viewFrom) { continue }\n var collapsed = range$$1.empty();\n if (collapsed || cm.options.showCursorWhenSelecting)\n { drawSelectionCursor(cm, range$$1.head, curFragment); }\n if (!collapsed)\n { drawSelectionRange(cm, range$$1, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\"; },\n cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n onBlur(cm);\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range$$1) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range$$1;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val);\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.pointerEvents = this.vert.style.pointerEvents = \"none\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.pointerEvents = \"auto\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt$$1 = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt$$1 != bar) { bar.style.pointerEvents = \"none\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt();\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this$1.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt();\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = window.getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }\n snapshot.activeElt.focus();\n if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var sel = window.getSelection(), range$$1 = document.createRange();\n range$$1.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range$$1.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range$$1);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(cm) {\n var width = cm.display.gutters.offsetWidth;\n cm.display.sizer.style.marginLeft = width + \"px\";\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }\n\n // Make sure the gutters options contains the element\n // \"CodeMirror-linenumbers\" when the lineNumbers option is true.\n function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && wheelPixelsPerUnit != null) {\n var pixels = dy * wheelPixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n var this$1 = this;\n\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this$1.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var this$1 = this;\n\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this$1.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n var this$1 = this;\n\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this$1.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(startGen) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = startGen || 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm)\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n var this$1 = this;\n\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this$1;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n var this$1 = this;\n\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this$1.lines[i];\n this$1.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var e = at + n; at < e; ++at)\n { if (op(this$1.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n var this$1 = this;\n\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this$1;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n var this$1 = this;\n\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this$1.height -= oldHeight - child.height;\n if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this$1.children.splice(++i, 0, leaf);\n leaf.parent = this$1;\n }\n child.lines = child.lines.slice(0, remaining);\n this$1.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n var this$1 = this;\n\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this$1[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var this$1 = this;\n\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n var this$1 = this;\n\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null));\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n var this$1 = this;\n\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this$1; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this$1.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range$$1 = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range$$1.head; }\n else if (start == \"anchor\") { pos = range$$1.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range$$1.to(); }\n else { pos = range$$1.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n var this$1 = this;\n\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this$1, ranges[i].anchor),\n clipPos(this$1, ranges[i].head)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var this$1 = this;\n\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var this$1 = this;\n\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var this$1 = this;\n\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range$$1 = sel.ranges[i];\n changes[i] = {from: range$$1.from(), to: range$$1.to(), text: this$1.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this$1, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {this.history = new History(this.history.maxGeneration);},\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history.maxGeneration);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo$$1 = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo$$1 == from.line && from.ch >= span.to ||\n span.from == null && lineNo$$1 != from.line ||\n span.from != null && lineNo$$1 == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo$$1;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo$$1 = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo$$1;\n });\n return clipPos(this, Pos(lineNo$$1, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n var this$1 = this;\n\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this$1.linked[i];\n if (link.doc != other) { continue }\n this$1.linked.splice(i, 1);\n other.unlinkDoc(this$1);\n detachSharedMarkers(findSharedMarkers(this$1));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var loadFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1)\n { return }\n\n var reader = new FileReader;\n reader.onload = operation(cm, function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) { content = \"\"; }\n text[i] = content;\n if (++read == n) {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)));\n }\n });\n reader.readAsText(file);\n };\n for (var i = 0; i < n; ++i) { loadFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 127: \"Delete\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Alt-F\": \"goWordRight\", \"Alt-B\": \"goWordLeft\", \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\",\n \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\", \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\",\n \"Alt-D\": \"delWordAfter\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\", \"Ctrl-T\": \"transposeChars\",\n \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map$$1, handle, context) {\n map$$1 = getKeyMap(map$$1);\n var found = map$$1.call ? map$$1.call(key, context) : map$$1[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map$$1.fallthrough) {\n if (Object.prototype.toString.call(map$$1.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map$$1.fallthrough, handle, context) }\n for (var i = 0; i < map$$1.fallthrough.length; i++) {\n var result = lookupKey(key, map$$1.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Cmd\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"char\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(0, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n cm.curOp.focus = activeElt();\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if (webkit || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n delayBlurEvent(cm);\n setTimeout(function () { return display.input.focus(); }, 20);\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.options.gutters.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.options.gutters[i];\n signal(cm, type, cm, line, gutter, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b-\\u200f\\u2028\\u2029\\ufeff]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n guttersChanged(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"firstLineNumber\", 1, guttersChanged, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, guttersChanged, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function guttersChanged(cm) {\n updateGutters(cm);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n setGuttersForLineNumbers(options);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input);\n display.wrapper.CodeMirror = this;\n updateGutters(this);\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(bind(onFocus, this), 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this$1, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range$$1 = sel.ranges[i$1];\n var from = range$$1.from(), to = range$$1.to();\n if (range$$1.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == inserted)\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput)\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range$$1 = sel.ranges[i];\n if (range$$1.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range$$1.head.line)) { continue }\n var mode = cm.getModeAt(range$$1.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range$$1.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range$$1.head.line).text.slice(0, range$$1.head.ch)))\n { indented = indentLine(cm, range$$1.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range$$1.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", !!autocorrect);\n field.setAttribute(\"autocapitalize\", !!autocapitalize);\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n disableBrowserMagic(te);\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map$$1, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n },\n removeKeyMap: function(map$$1) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this$1.state.modeGen++;\n regChange(this$1);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range$$1 = ranges[i];\n if (!range$$1.empty()) {\n var from = range$$1.from(), to = range$$1.to();\n var start = Math.max(end, from.line);\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how); }\n var newRanges = this$1.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range$$1.head.line > end) {\n indentLine(this$1, range$$1.head.line, how, true);\n end = range$$1.head.line;\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range$$1 = this.doc.sel.primary();\n if (start == null) { pos = range$$1.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range$$1.from() : range$$1.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range$$1) {\n if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range$$1) {\n var other = findPosH(doc, range$$1.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this$1, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range$$1) {\n if (collapse)\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range$$1 == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range$$1, margin) {\n if (range$$1 == null) {\n range$$1 = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range$$1 == \"number\") {\n range$$1 = {from: Pos(range$$1, 0), to: null};\n } else if (range$$1.from == null) {\n range$$1 = {from: range$$1, to: null};\n }\n if (!range$$1.to) { range$$1.to = range$$1.from; }\n range$$1.margin = margin || 0;\n\n if (range$$1.from.line != null) {\n scrollToRange(this, range$$1);\n } else {\n scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo$$1 = this.display.viewFrom;\n this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n ++lineNo$$1;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"char\", \"column\" (like char, but doesn't\n // cross line boundaries), \"word\" (across next word), or \"group\" (to\n // the start of next group of word or non-word-non-whitespace\n // chars). The visually param controls whether, in right-to-left\n // text, direction 1 means to move towards the next index in the\n // string, or towards the character to the right of the current\n // position. The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n function findNextLine() {\n var l = pos.line + dir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n on(div, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = document.activeElement;\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = this.cm.state.focused;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map$$1 = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map$$1[map$$1.length - 1], offset: map$$1[map$$1.length - 2] - map$$1[map$$1.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor())\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var input = this;\n if (this.selectionInEditor())\n { this.pollSelection(); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range$$1;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range$$1 = found[0].find(0)))\n { addText(getBetween(cm.doc, range$$1.from, range$$1.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map$$1 = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map$$1.length; j += 3) {\n var curNode = map$$1[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map$$1[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map$$1[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing) { return }\n var cm = this.cm;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt() != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { window.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt();\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, …*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.45.0\";\n\n return CodeMirror;\n\n})));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/lib/codemirror.js\n// module id = 644\n// module chunks = 3 4 5 7 8 14","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-f72bdd3a\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./secondaryMenu.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./secondaryMenu.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./secondaryMenu.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-f72bdd3a\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./secondaryMenu.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/secondaryMenu/secondaryMenu.vue\n// module id = 654\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 25 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/priority/priority.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport _ from 'lodash'\nimport $ from 'jquery'\nimport i18n from '@/module/i18n'\nimport store from '@/conf/home/store'\n\n/**\n * Node, to array\n */\nconst rtTargetarrArr = (id) => {\n let a = $(`#${id}`).attr('data-targetarr')\n return a ? a.split(',') : []\n}\n\n/**\n * Store node id to targetarr\n */\nconst saveTargetarr = (valId, domId) => {\n let $target = $(`#${domId}`)\n let targetStr = $target.attr('data-targetarr') ? $target.attr('data-targetarr') + `,${valId}` : `${valId}`\n $target.attr('data-targetarr', targetStr)\n}\n\nconst rtBantpl = () => {\n return ``\n}\n\n/**\n * return node html\n */\nconst rtTasksTpl = ({ id, name, x, y, targetarr, isAttachment, taskType,runFlag }) => {\n let tpl = ``\n tpl += `
`\n tpl += `
`\n tpl += `
`\n tpl += `
`\n tpl += `${name}`\n tpl += `
`\n tpl += `
`\n tpl += `
`\n if (runFlag === 'FORBIDDEN') {\n tpl += rtBantpl()\n }\n tpl += `
`\n tpl += `
`\n\n return tpl\n}\n\n/**\n * Get all tasks nodes\n */\nconst tasksAll = () => {\n let a = []\n $('#canvas .w').each(function (idx, elem) {\n let e = $(elem)\n a.push({\n id: e.attr('id'),\n name: e.find('.name-p').text(),\n targetarr: e.attr('data-targetarr') || '',\n x: parseInt(e.css('left'), 10),\n y: parseInt(e.css('top'), 10)\n })\n })\n return a\n}\n\n/**\n * Determine if name is in the current dag map\n * rely dom / backfill\n */\nconst isNameExDag = (name, rely) => {\n if (rely === 'dom') {\n return _.findIndex(tasksAll(), v => v.name === name) !== -1\n } else {\n return _.findIndex(store.state.dag.tasks, v => v.name === name) !== -1\n }\n}\n\n/**\n * Change svg line color\n */\nconst setSvgColor = (e, color) => {\n // Traverse clear all colors\n $('.jtk-connector').each((i, o) => {\n _.map($(o)[0].childNodes, v => {\n $(v).attr('fill', '#555').attr('stroke', '#555').attr('stroke-width', 2)\n })\n })\n\n // Add color to the selection\n _.map($(e.canvas)[0].childNodes, (v, i) => {\n $(v).attr('fill', color).attr('stroke', color)\n if ($(v).attr('class')) {\n $(v).attr('stroke-width', 2)\n }\n })\n}\n\n/**\n * Get all node ids\n */\nconst allNodesId = () => {\n let idArr = []\n $('.w').each((i, o) => {\n let $obj = $(o)\n let $span = $obj.find('.name-p').text()\n if ($span) {\n idArr.push({\n id: $obj.attr('id'),\n name: $span\n })\n }\n })\n return idArr\n}\n\nexport {\n rtTargetarrArr,\n saveTargetarr,\n rtTasksTpl,\n tasksAll,\n isNameExDag,\n setSvgColor,\n allNodesId,\n rtBantpl\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/plugIn/util.js","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-5b25ea8f\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./resources.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./resources.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./resources.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-5b25ea8f\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./resources.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/dag/_source/formModel/tasks/_source/resources.vue\n// module id = 699\n// module chunks = 3 4 5","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-6a4fc01c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./priority.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./priority.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./priority.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-6a4fc01c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./priority.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/priority/priority.vue\n// module id = 700\n// module chunks = 0 3 4 5 6","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport i18n from '@/module/i18n'\n/**\n * download file\n */\nlet downloadFile = ($url, $obj) => {\n let param = {\n url: $url,\n obj: $obj\n }\n\n if (!param.url) {\n this.$message.warning(`${i18n.$t('无下载url无法下载')}`)\n return\n }\n\n let generatorInput = function (obj) {\n let result = ''\n let keyArr = Object.keys(obj)\n keyArr.forEach(function (key) {\n result += \"\"\n })\n return result\n }\n $(`
${generatorInput(param.obj)}
`).appendTo('body').submit().remove()\n}\n\nexport { downloadFile }\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/module/download/index.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue","/**\n * jsBezier\n *\n * Copyright (c) 2010 - 2017 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * licensed under the MIT license.\n *\n * a set of Bezier curve functions that deal with Beziers, used by jsPlumb, and perhaps useful for other people. These functions work with Bezier\n * curves of arbitrary degree.\n *\n * - functions are all in the 'jsBezier' namespace.\n *\n * - all input points should be in the format {x:.., y:..}. all output points are in this format too.\n *\n * - all input curves should be in the format [ {x:.., y:..}, {x:.., y:..}, {x:.., y:..}, {x:.., y:..} ]\n *\n * - 'location' as used as an input here refers to a decimal in the range 0-1 inclusive, which indicates a point some proportion along the length\n * of the curve. location as output has the same format and meaning.\n *\n *\n * Function List:\n * --------------\n *\n * distanceFromCurve(point, curve)\n *\n * \tCalculates the distance that the given point lies from the given Bezier. Note that it is computed relative to the center of the Bezier,\n * so if you have stroked the curve with a wide pen you may wish to take that into account! The distance returned is relative to the values\n * of the curve and the point - it will most likely be pixels.\n *\n * gradientAtPoint(curve, location)\n *\n * \tCalculates the gradient to the curve at the given location, as a decimal between 0 and 1 inclusive.\n *\n * gradientAtPointAlongCurveFrom (curve, location)\n *\n *\tCalculates the gradient at the point on the given curve that is 'distance' units from location.\n *\n * nearestPointOnCurve(point, curve)\n *\n *\tCalculates the nearest point to the given point on the given curve. The return value of this is a JS object literal, containing both the\n *point's coordinates and also the 'location' of the point (see above), for example: { point:{x:551,y:150}, location:0.263365 }.\n *\n * pointOnCurve(curve, location)\n *\n * \tCalculates the coordinates of the point on the given Bezier curve at the given location.\n *\n * pointAlongCurveFrom(curve, location, distance)\n *\n * \tCalculates the coordinates of the point on the given curve that is 'distance' units from location. 'distance' should be in the same coordinate\n * space as that used to construct the Bezier curve. For an HTML Canvas usage, for example, distance would be a measure of pixels.\n *\n * locationAlongCurveFrom(curve, location, distance)\n *\n * \tCalculates the location on the given curve that is 'distance' units from location. 'distance' should be in the same coordinate\n * space as that used to construct the Bezier curve. For an HTML Canvas usage, for example, distance would be a measure of pixels.\n *\n * perpendicularToCurveAt(curve, location, length, distance)\n *\n * \tCalculates the perpendicular to the given curve at the given location. length is the length of the line you wish for (it will be centered\n * on the point at 'location'). distance is optional, and allows you to specify a point along the path from the given location as the center of\n * the perpendicular returned. The return value of this is an array of two points: [ {x:...,y:...}, {x:...,y:...} ].\n *\n *\n */\n\n(function() {\n\n var root = this;\n\n if(typeof Math.sgn == \"undefined\") {\n Math.sgn = function(x) { return x == 0 ? 0 : x > 0 ? 1 :-1; };\n }\n\n var Vectors = {\n subtract \t: \tfunction(v1, v2) { return {x:v1.x - v2.x, y:v1.y - v2.y }; },\n dotProduct\t: \tfunction(v1, v2) { return (v1.x * v2.x) + (v1.y * v2.y); },\n square\t\t:\tfunction(v) { return Math.sqrt((v.x * v.x) + (v.y * v.y)); },\n scale\t\t:\tfunction(v, s) { return {x:v.x * s, y:v.y * s }; }\n },\n\n maxRecursion = 64,\n flatnessTolerance = Math.pow(2.0,-maxRecursion-1);\n\n /**\n * Calculates the distance that the point lies from the curve.\n *\n * @param point a point in the form {x:567, y:3342}\n * @param curve a Bezier curve in the form [{x:..., y:...}, {x:..., y:...}, {x:..., y:...}, {x:..., y:...}]. note that this is currently\n * hardcoded to assume cubiz beziers, but would be better off supporting any degree.\n * @return a JS object literal containing location and distance, for example: {location:0.35, distance:10}. Location is analogous to the location\n * argument you pass to the pointOnPath function: it is a ratio of distance travelled along the curve. Distance is the distance in pixels from\n * the point to the curve.\n */\n var _distanceFromCurve = function(point, curve) {\n var candidates = [],\n w = _convertToBezier(point, curve),\n degree = curve.length - 1, higherDegree = (2 * degree) - 1,\n numSolutions = _findRoots(w, higherDegree, candidates, 0),\n v = Vectors.subtract(point, curve[0]), dist = Vectors.square(v), t = 0.0;\n\n for (var i = 0; i < numSolutions; i++) {\n v = Vectors.subtract(point, _bezier(curve, degree, candidates[i], null, null));\n var newDist = Vectors.square(v);\n if (newDist < dist) {\n dist = newDist;\n t = candidates[i];\n }\n }\n v = Vectors.subtract(point, curve[degree]);\n newDist = Vectors.square(v);\n if (newDist < dist) {\n dist = newDist;\n t = 1.0;\n }\n return {location:t, distance:dist};\n };\n /**\n * finds the nearest point on the curve to the given point.\n */\n var _nearestPointOnCurve = function(point, curve) {\n var td = _distanceFromCurve(point, curve);\n return {point:_bezier(curve, curve.length - 1, td.location, null, null), location:td.location};\n };\n var _convertToBezier = function(point, curve) {\n var degree = curve.length - 1, higherDegree = (2 * degree) - 1,\n c = [], d = [], cdTable = [], w = [],\n z = [ [1.0, 0.6, 0.3, 0.1], [0.4, 0.6, 0.6, 0.4], [0.1, 0.3, 0.6, 1.0] ];\n\n for (var i = 0; i <= degree; i++) c[i] = Vectors.subtract(curve[i], point);\n for (var i = 0; i <= degree - 1; i++) {\n d[i] = Vectors.subtract(curve[i+1], curve[i]);\n d[i] = Vectors.scale(d[i], 3.0);\n }\n for (var row = 0; row <= degree - 1; row++) {\n for (var column = 0; column <= degree; column++) {\n if (!cdTable[row]) cdTable[row] = [];\n cdTable[row][column] = Vectors.dotProduct(d[row], c[column]);\n }\n }\n for (i = 0; i <= higherDegree; i++) {\n if (!w[i]) w[i] = [];\n w[i].y = 0.0;\n w[i].x = parseFloat(i) / higherDegree;\n }\n var n = degree, m = degree-1;\n for (var k = 0; k <= n + m; k++) {\n var lb = Math.max(0, k - m),\n ub = Math.min(k, n);\n for (i = lb; i <= ub; i++) {\n var j = k - i;\n w[i+j].y += cdTable[j][i] * z[j][i];\n }\n }\n return w;\n };\n /**\n * counts how many roots there are.\n */\n var _findRoots = function(w, degree, t, depth) {\n var left = [], right = [],\n left_count, right_count,\n left_t = [], right_t = [];\n\n switch (_getCrossingCount(w, degree)) {\n case 0 : {\n return 0;\n }\n case 1 : {\n if (depth >= maxRecursion) {\n t[0] = (w[0].x + w[degree].x) / 2.0;\n return 1;\n }\n if (_isFlatEnough(w, degree)) {\n t[0] = _computeXIntercept(w, degree);\n return 1;\n }\n break;\n }\n }\n _bezier(w, degree, 0.5, left, right);\n left_count = _findRoots(left, degree, left_t, depth+1);\n right_count = _findRoots(right, degree, right_t, depth+1);\n for (var i = 0; i < left_count; i++) t[i] = left_t[i];\n for (var i = 0; i < right_count; i++) t[i+left_count] = right_t[i];\n return (left_count+right_count);\n };\n var _getCrossingCount = function(curve, degree) {\n var n_crossings = 0, sign, old_sign;\n sign = old_sign = Math.sgn(curve[0].y);\n for (var i = 1; i <= degree; i++) {\n sign = Math.sgn(curve[i].y);\n if (sign != old_sign) n_crossings++;\n old_sign = sign;\n }\n return n_crossings;\n };\n var _isFlatEnough = function(curve, degree) {\n var error,\n intercept_1, intercept_2, left_intercept, right_intercept,\n a, b, c, det, dInv, a1, b1, c1, a2, b2, c2;\n a = curve[0].y - curve[degree].y;\n b = curve[degree].x - curve[0].x;\n c = curve[0].x * curve[degree].y - curve[degree].x * curve[0].y;\n\n var max_distance_above, max_distance_below;\n max_distance_above = max_distance_below = 0.0;\n\n for (var i = 1; i < degree; i++) {\n var value = a * curve[i].x + b * curve[i].y + c;\n if (value > max_distance_above)\n max_distance_above = value;\n else if (value < max_distance_below)\n max_distance_below = value;\n }\n\n a1 = 0.0; b1 = 1.0; c1 = 0.0; a2 = a; b2 = b;\n c2 = c - max_distance_above;\n det = a1 * b2 - a2 * b1;\n dInv = 1.0/det;\n intercept_1 = (b1 * c2 - b2 * c1) * dInv;\n a2 = a; b2 = b; c2 = c - max_distance_below;\n det = a1 * b2 - a2 * b1;\n dInv = 1.0/det;\n intercept_2 = (b1 * c2 - b2 * c1) * dInv;\n left_intercept = Math.min(intercept_1, intercept_2);\n right_intercept = Math.max(intercept_1, intercept_2);\n error = right_intercept - left_intercept;\n return (error < flatnessTolerance)? 1 : 0;\n };\n var _computeXIntercept = function(curve, degree) {\n var XLK = 1.0, YLK = 0.0,\n XNM = curve[degree].x - curve[0].x, YNM = curve[degree].y - curve[0].y,\n XMK = curve[0].x - 0.0, YMK = curve[0].y - 0.0,\n det = XNM*YLK - YNM*XLK, detInv = 1.0/det,\n S = (XNM*YMK - YNM*XMK) * detInv;\n return 0.0 + XLK * S;\n };\n var _bezier = function(curve, degree, t, left, right) {\n var temp = [[]];\n for (var j =0; j <= degree; j++) temp[0][j] = curve[j];\n for (var i = 1; i <= degree; i++) {\n for (var j =0 ; j <= degree - i; j++) {\n if (!temp[i]) temp[i] = [];\n if (!temp[i][j]) temp[i][j] = {};\n temp[i][j].x = (1.0 - t) * temp[i-1][j].x + t * temp[i-1][j+1].x;\n temp[i][j].y = (1.0 - t) * temp[i-1][j].y + t * temp[i-1][j+1].y;\n }\n }\n if (left != null)\n for (j = 0; j <= degree; j++) left[j] = temp[j][0];\n if (right != null)\n for (j = 0; j <= degree; j++) right[j] = temp[degree-j][j];\n\n return (temp[degree][0]);\n };\n\n var _curveFunctionCache = {};\n var _getCurveFunctions = function(order) {\n var fns = _curveFunctionCache[order];\n if (!fns) {\n fns = [];\n var f_term = function() { return function(t) { return Math.pow(t, order); }; },\n l_term = function() { return function(t) { return Math.pow((1-t), order); }; },\n c_term = function(c) { return function(t) { return c; }; },\n t_term = function() { return function(t) { return t; }; },\n one_minus_t_term = function() { return function(t) { return 1-t; }; },\n _termFunc = function(terms) {\n return function(t) {\n var p = 1;\n for (var i = 0; i < terms.length; i++) p = p * terms[i](t);\n return p;\n };\n };\n\n fns.push(new f_term()); // first is t to the power of the curve order\n for (var i = 1; i < order; i++) {\n var terms = [new c_term(order)];\n for (var j = 0 ; j < (order - i); j++) terms.push(new t_term());\n for (var j = 0 ; j < i; j++) terms.push(new one_minus_t_term());\n fns.push(new _termFunc(terms));\n }\n fns.push(new l_term()); // last is (1-t) to the power of the curve order\n\n _curveFunctionCache[order] = fns;\n }\n\n return fns;\n };\n\n\n /**\n * calculates a point on the curve, for a Bezier of arbitrary order.\n * @param curve an array of control points, eg [{x:10,y:20}, {x:50,y:50}, {x:100,y:100}, {x:120,y:100}]. For a cubic bezier this should have four points.\n * @param location a decimal indicating the distance along the curve the point should be located at. this is the distance along the curve as it travels, taking the way it bends into account. should be a number from 0 to 1, inclusive.\n */\n var _pointOnPath = function(curve, location) {\n var cc = _getCurveFunctions(curve.length - 1),\n _x = 0, _y = 0;\n for (var i = 0; i < curve.length ; i++) {\n _x = _x + (curve[i].x * cc[i](location));\n _y = _y + (curve[i].y * cc[i](location));\n }\n\n return {x:_x, y:_y};\n };\n\n var _dist = function(p1,p2) {\n return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));\n };\n\n var _isPoint = function(curve) {\n return curve[0].x === curve[1].x && curve[0].y === curve[1].y;\n };\n\n /**\n * finds the point that is 'distance' along the path from 'location'. this method returns both the x,y location of the point and also\n * its 'location' (proportion of travel along the path); the method below - _pointAlongPathFrom - calls this method and just returns the\n * point.\n */\n var _pointAlongPath = function(curve, location, distance) {\n\n if (_isPoint(curve)) {\n return {\n point:curve[0],\n location:location\n };\n }\n\n var prev = _pointOnPath(curve, location),\n tally = 0,\n curLoc = location,\n direction = distance > 0 ? 1 : -1,\n cur = null;\n\n while (tally < Math.abs(distance)) {\n curLoc += (0.005 * direction);\n cur = _pointOnPath(curve, curLoc);\n tally += _dist(cur, prev);\n prev = cur;\n }\n return {point:cur, location:curLoc};\n };\n\n var _length = function(curve) {\n if (_isPoint(curve)) return 0;\n\n var prev = _pointOnPath(curve, 0),\n tally = 0,\n curLoc = 0,\n direction = 1,\n cur = null;\n\n while (curLoc < 1) {\n curLoc += (0.005 * direction);\n cur = _pointOnPath(curve, curLoc);\n tally += _dist(cur, prev);\n prev = cur;\n }\n return tally;\n };\n\n /**\n * finds the point that is 'distance' along the path from 'location'.\n */\n var _pointAlongPathFrom = function(curve, location, distance) {\n return _pointAlongPath(curve, location, distance).point;\n };\n\n /**\n * finds the location that is 'distance' along the path from 'location'.\n */\n var _locationAlongPathFrom = function(curve, location, distance) {\n return _pointAlongPath(curve, location, distance).location;\n };\n\n /**\n * returns the gradient of the curve at the given location, which is a decimal between 0 and 1 inclusive.\n *\n * thanks // http://bimixual.org/AnimationLibrary/beziertangents.html\n */\n var _gradientAtPoint = function(curve, location) {\n var p1 = _pointOnPath(curve, location),\n p2 = _pointOnPath(curve.slice(0, curve.length - 1), location),\n dy = p2.y - p1.y, dx = p2.x - p1.x;\n return dy === 0 ? Infinity : Math.atan(dy / dx);\n };\n\n /**\n returns the gradient of the curve at the point which is 'distance' from the given location.\n if this point is greater than location 1, the gradient at location 1 is returned.\n if this point is less than location 0, the gradient at location 0 is returned.\n */\n var _gradientAtPointAlongPathFrom = function(curve, location, distance) {\n var p = _pointAlongPath(curve, location, distance);\n if (p.location > 1) p.location = 1;\n if (p.location < 0) p.location = 0;\n return _gradientAtPoint(curve, p.location);\n };\n\n /**\n * calculates a line that is 'length' pixels long, perpendicular to, and centered on, the path at 'distance' pixels from the given location.\n * if distance is not supplied, the perpendicular for the given location is computed (ie. we set distance to zero).\n */\n var _perpendicularToPathAt = function(curve, location, length, distance) {\n distance = distance == null ? 0 : distance;\n var p = _pointAlongPath(curve, location, distance),\n m = _gradientAtPoint(curve, p.location),\n _theta2 = Math.atan(-1 / m),\n y = length / 2 * Math.sin(_theta2),\n x = length / 2 * Math.cos(_theta2);\n return [{x:p.point.x + x, y:p.point.y + y}, {x:p.point.x - x, y:p.point.y - y}];\n };\n\n /**\n * Calculates all intersections of the given line with the given curve.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param curve\n * @returns {Array}\n */\n var _lineIntersection = function(x1, y1, x2, y2, curve) {\n var a = y2 - y1,\n b = x1 - x2,\n c = (x1 * (y1 - y2)) + (y1 * (x2-x1)),\n coeffs = _computeCoefficients(curve),\n p = [\n (a*coeffs[0][0]) + (b * coeffs[1][0]),\n (a*coeffs[0][1])+(b*coeffs[1][1]),\n (a*coeffs[0][2])+(b*coeffs[1][2]),\n (a*coeffs[0][3])+(b*coeffs[1][3]) + c\n ],\n r = _cubicRoots.apply(null, p),\n intersections = [];\n\n if (r != null) {\n\n for (var i = 0; i < 3; i++) {\n var t = r[i],\n t2 = Math.pow(t, 2),\n t3 = Math.pow(t, 3),\n x = [\n (coeffs[0][0] * t3) + (coeffs[0][1] * t2) + (coeffs[0][2] * t) + coeffs[0][3],\n (coeffs[1][0] * t3) + (coeffs[1][1] * t2) + (coeffs[1][2] * t) + coeffs[1][3]\n ];\n\n // check bounds of the line\n var s;\n if ((x2 - x1) !== 0) {\n s = (x[0] - x1) / (x2 - x1);\n }\n else {\n s = (x[1] - y1) / (y2 - y1);\n }\n\n if (t >= 0 && t <= 1.0 && s >= 0 && s <= 1.0) {\n intersections.push(x);\n }\n }\n }\n\n return intersections;\n };\n\n /**\n * Calculates all intersections of the given box with the given curve.\n * @param x X position of top left corner of box\n * @param y Y position of top left corner of box\n * @param w width of box\n * @param h height of box\n * @param curve\n * @returns {Array}\n */\n var _boxIntersection = function(x, y, w, h, curve) {\n var i = [];\n i.push.apply(i, _lineIntersection(x, y, x + w, y, curve));\n i.push.apply(i, _lineIntersection(x + w, y, x + w, y + h, curve));\n i.push.apply(i, _lineIntersection(x + w, y + h, x, y + h, curve));\n i.push.apply(i, _lineIntersection(x, y + h, x, y, curve));\n return i;\n };\n\n /**\n * Calculates all intersections of the given bounding box with the given curve.\n * @param boundingBox Bounding box, in { x:.., y:..., w:..., h:... } format.\n * @param curve\n * @returns {Array}\n */\n var _boundingBoxIntersection = function(boundingBox, curve) {\n var i = [];\n i.push.apply(i, _lineIntersection(boundingBox.x, boundingBox.y, boundingBox.x + boundingBox.w, boundingBox.y, curve));\n i.push.apply(i, _lineIntersection(boundingBox.x + boundingBox.w, boundingBox.y, boundingBox.x + boundingBox.w, boundingBox.y + boundingBox.h, curve));\n i.push.apply(i, _lineIntersection(boundingBox.x + boundingBox.w, boundingBox.y + boundingBox.h, boundingBox.x, boundingBox.y + boundingBox.h, curve));\n i.push.apply(i, _lineIntersection(boundingBox.x, boundingBox.y + boundingBox.h, boundingBox.x, boundingBox.y, curve));\n return i;\n };\n\n\n function _computeCoefficientsForAxis(curve, axis) {\n return [\n -(curve[0][axis]) + (3*curve[1][axis]) + (-3 * curve[2][axis]) + curve[3][axis],\n (3*(curve[0][axis])) - (6*(curve[1][axis])) + (3*(curve[2][axis])),\n -3*curve[0][axis] + 3*curve[1][axis],\n curve[0][axis]\n ];\n }\n\n function _computeCoefficients(curve)\n {\n return [\n _computeCoefficientsForAxis(curve, \"x\"),\n _computeCoefficientsForAxis(curve, \"y\")\n ];\n }\n\n function sgn(x) {\n return x < 0 ? -1 : x > 0 ? 1 : 0;\n }\n\n function _cubicRoots(a, b, c, d) {\n var A = b / a,\n B = c / a,\n C = d / a,\n Q = (3*B - Math.pow(A, 2))/9,\n R = (9*A*B - 27*C - 2*Math.pow(A, 3))/54,\n D = Math.pow(Q, 3) + Math.pow(R, 2),\n S,\n T,\n t = [];\n\n if (D >= 0) // complex or duplicate roots\n {\n S = sgn(R + Math.sqrt(D))*Math.pow(Math.abs(R + Math.sqrt(D)),(1/3));\n T = sgn(R - Math.sqrt(D))*Math.pow(Math.abs(R - Math.sqrt(D)),(1/3));\n\n t[0] = -A/3 + (S + T);\n t[1] = -A/3 - (S + T)/2;\n t[2] = -A/3 - (S + T)/2;\n\n /*discard complex roots*/\n if (Math.abs(Math.sqrt(3)*(S - T)/2) !== 0) {\n t[1] = -1;\n t[2] = -1;\n }\n }\n else // distinct real roots\n {\n var th = Math.acos(R/Math.sqrt(-Math.pow(Q, 3)));\n t[0] = 2*Math.sqrt(-Q)*Math.cos(th/3) - A/3;\n t[1] = 2*Math.sqrt(-Q)*Math.cos((th + 2*Math.PI)/3) - A/3;\n t[2] = 2*Math.sqrt(-Q)*Math.cos((th + 4*Math.PI)/3) - A/3;\n }\n\n // discard out of spec roots\n for (var i = 0; i < 3; i++) {\n if (t[i] < 0 || t[i] > 1.0) {\n t[i] = -1;\n }\n }\n\n return t;\n }\n\n var jsBezier = this.jsBezier = {\n distanceFromCurve : _distanceFromCurve,\n gradientAtPoint : _gradientAtPoint,\n gradientAtPointAlongCurveFrom : _gradientAtPointAlongPathFrom,\n nearestPointOnCurve : _nearestPointOnCurve,\n pointOnCurve : _pointOnPath,\n pointAlongCurveFrom : _pointAlongPathFrom,\n perpendicularToCurveAt : _perpendicularToPathAt,\n locationAlongCurveFrom:_locationAlongPathFrom,\n getLength:_length,\n lineIntersection:_lineIntersection,\n boxIntersection:_boxIntersection,\n boundingBoxIntersection:_boundingBoxIntersection,\n version:\"0.9.0\"\n };\n\n if (typeof exports !== \"undefined\") {\n exports.jsBezier = jsBezier;\n }\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/**\n * Biltong v0.4.0\n *\n * Various geometry functions written as part of jsPlumb and perhaps useful for others.\n *\n * Copyright (c) 2017 jsPlumb\n * https://jsplumbtoolkit.com\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n;(function() {\n\n \"use strict\";\n var root = this;\n\n var Biltong = root.Biltong = {\n version:\"0.4.0\"\n };\n\n if (typeof exports !== \"undefined\") {\n exports.Biltong = Biltong;\n }\n\n var _isa = function(a) { return Object.prototype.toString.call(a) === \"[object Array]\"; },\n _pointHelper = function(p1, p2, fn) {\n p1 = _isa(p1) ? p1 : [p1.x, p1.y];\n p2 = _isa(p2) ? p2 : [p2.x, p2.y];\n return fn(p1, p2);\n },\n /**\n * @name Biltong.gradient\n * @function\n * @desc Calculates the gradient of a line between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The gradient of a line between the two points.\n */\n _gradient = Biltong.gradient = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n if (_p2[0] == _p1[0])\n return _p2[1] > _p1[1] ? Infinity : -Infinity;\n else if (_p2[1] == _p1[1])\n return _p2[0] > _p1[0] ? 0 : -0;\n else\n return (_p2[1] - _p1[1]) / (_p2[0] - _p1[0]);\n });\n },\n /**\n * @name Biltong.normal\n * @function\n * @desc Calculates the gradient of a normal to a line between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The gradient of a normal to a line between the two points.\n */\n _normal = Biltong.normal = function(p1, p2) {\n return -1 / _gradient(p1, p2);\n },\n /**\n * @name Biltong.lineLength\n * @function\n * @desc Calculates the length of a line between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The length of a line between the two points.\n */\n _lineLength = Biltong.lineLength = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n return Math.sqrt(Math.pow(_p2[1] - _p1[1], 2) + Math.pow(_p2[0] - _p1[0], 2));\n });\n },\n /**\n * @name Biltong.quadrant\n * @function\n * @desc Calculates the quadrant in which the angle between the two points lies.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Integer} The quadrant - 1 for upper right, 2 for lower right, 3 for lower left, 4 for upper left.\n */\n _quadrant = Biltong.quadrant = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n if (_p2[0] > _p1[0]) {\n return (_p2[1] > _p1[1]) ? 2 : 1;\n }\n else if (_p2[0] == _p1[0]) {\n return _p2[1] > _p1[1] ? 2 : 1;\n }\n else {\n return (_p2[1] > _p1[1]) ? 3 : 4;\n }\n });\n },\n /**\n * @name Biltong.theta\n * @function\n * @desc Calculates the angle between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The angle between the two points.\n */\n _theta = Biltong.theta = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n var m = _gradient(_p1, _p2),\n t = Math.atan(m),\n s = _quadrant(_p1, _p2);\n if ((s == 4 || s== 3)) t += Math.PI;\n if (t < 0) t += (2 * Math.PI);\n\n return t;\n });\n },\n /**\n * @name Biltong.intersects\n * @function\n * @desc Calculates whether or not the two rectangles intersect.\n * @param {Rectangle} r1 First rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @param {Rectangle} r2 Second rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @return {Boolean} True if the rectangles intersect, false otherwise.\n */\n _intersects = Biltong.intersects = function(r1, r2) {\n var x1 = r1.x, x2 = r1.x + r1.w, y1 = r1.y, y2 = r1.y + r1.h,\n a1 = r2.x, a2 = r2.x + r2.w, b1 = r2.y, b2 = r2.y + r2.h;\n\n return ( (x1 <= a1 && a1 <= x2) && (y1 <= b1 && b1 <= y2) ) ||\n ( (x1 <= a2 && a2 <= x2) && (y1 <= b1 && b1 <= y2) ) ||\n ( (x1 <= a1 && a1 <= x2) && (y1 <= b2 && b2 <= y2) ) ||\n ( (x1 <= a2 && a1 <= x2) && (y1 <= b2 && b2 <= y2) ) ||\n ( (a1 <= x1 && x1 <= a2) && (b1 <= y1 && y1 <= b2) ) ||\n ( (a1 <= x2 && x2 <= a2) && (b1 <= y1 && y1 <= b2) ) ||\n ( (a1 <= x1 && x1 <= a2) && (b1 <= y2 && y2 <= b2) ) ||\n ( (a1 <= x2 && x1 <= a2) && (b1 <= y2 && y2 <= b2) );\n },\n /**\n * @name Biltong.encloses\n * @function\n * @desc Calculates whether or not r2 is completely enclosed by r1.\n * @param {Rectangle} r1 First rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @param {Rectangle} r2 Second rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @param {Boolean} [allowSharedEdges=false] If true, the concept of enclosure allows for one or more edges to be shared by the two rectangles.\n * @return {Boolean} True if r1 encloses r2, false otherwise.\n */\n _encloses = Biltong.encloses = function(r1, r2, allowSharedEdges) {\n var x1 = r1.x, x2 = r1.x + r1.w, y1 = r1.y, y2 = r1.y + r1.h,\n a1 = r2.x, a2 = r2.x + r2.w, b1 = r2.y, b2 = r2.y + r2.h,\n c = function(v1, v2, v3, v4) { return allowSharedEdges ? v1 <= v2 && v3>= v4 : v1 < v2 && v3 > v4; };\n\n return c(x1,a1,x2,a2) && c(y1,b1,y2,b2);\n },\n _segmentMultipliers = [null, [1, -1], [1, 1], [-1, 1], [-1, -1] ],\n _inverseSegmentMultipliers = [null, [-1, -1], [-1, 1], [1, 1], [1, -1] ],\n /**\n * @name Biltong.pointOnLine\n * @function\n * @desc Calculates a point on the line from `fromPoint` to `toPoint` that is `distance` units along the length of the line.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Point} Point on the line, in the form `{ x:..., y:... }`.\n */\n _pointOnLine = Biltong.pointOnLine = function(fromPoint, toPoint, distance) {\n var m = _gradient(fromPoint, toPoint),\n s = _quadrant(fromPoint, toPoint),\n segmentMultiplier = distance > 0 ? _segmentMultipliers[s] : _inverseSegmentMultipliers[s],\n theta = Math.atan(m),\n y = Math.abs(distance * Math.sin(theta)) * segmentMultiplier[1],\n x = Math.abs(distance * Math.cos(theta)) * segmentMultiplier[0];\n return { x:fromPoint.x + x, y:fromPoint.y + y };\n },\n /**\n * @name Biltong.perpendicularLineTo\n * @function\n * @desc Calculates a line of length `length` that is perpendicular to the line from `fromPoint` to `toPoint` and passes through `toPoint`.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Line} Perpendicular line, in the form `[ { x:..., y:... }, { x:..., y:... } ]`.\n */\n _perpendicularLineTo = Biltong.perpendicularLineTo = function(fromPoint, toPoint, length) {\n var m = _gradient(fromPoint, toPoint),\n theta2 = Math.atan(-1 / m),\n y = length / 2 * Math.sin(theta2),\n x = length / 2 * Math.cos(theta2);\n return [{x:toPoint.x + x, y:toPoint.y + y}, {x:toPoint.x - x, y:toPoint.y - y}];\n };\n}).call(typeof window !== 'undefined' ? window : this);\n;\n(function () {\n\n \"use strict\";\n\n /**\n * Creates a Touch object.\n * @param view\n * @param target\n * @param pageX\n * @param pageY\n * @param screenX\n * @param screenY\n * @param clientX\n * @param clientY\n * @returns {Touch}\n * @private\n */\n function _touch(view, target, pageX, pageY, screenX, screenY, clientX, clientY) {\n\n return new Touch({\n target:target,\n identifier:_uuid(),\n pageX: pageX,\n pageY: pageY,\n screenX: screenX,\n screenY: screenY,\n clientX: clientX || screenX,\n clientY: clientY || screenY\n });\n }\n\n /**\n * Create a synthetic touch list from the given list of Touch objects.\n * @returns {Array}\n * @private\n */\n function _touchList() {\n var list = [];\n Array.prototype.push.apply(list, arguments);\n list.item = function(index) { return this[index]; };\n return list;\n }\n\n /**\n * Create a Touch object and then insert it into a synthetic touch list, returning the list.s\n * @param view\n * @param target\n * @param pageX\n * @param pageY\n * @param screenX\n * @param screenY\n * @param clientX\n * @param clientY\n * @returns {Array}\n * @private\n */\n function _touchAndList(view, target, pageX, pageY, screenX, screenY, clientX, clientY) {\n return _touchList(_touch.apply(null, arguments));\n }\n\n var root = this,\n matchesSelector = function (el, selector, ctx) {\n ctx = ctx || el.parentNode;\n var possibles = ctx.querySelectorAll(selector);\n for (var i = 0; i < possibles.length; i++) {\n if (possibles[i] === el) {\n return true;\n }\n }\n return false;\n },\n _gel = function (el) {\n return (typeof el == \"string\" || el.constructor === String) ? document.getElementById(el) : el;\n },\n _t = function (e) {\n return e.srcElement || e.target;\n },\n //\n // gets path info for the given event - the path from target to obj, in the event's bubble chain. if doCompute\n // is false we just return target for the path.\n //\n _pi = function(e, target, obj, doCompute) {\n if (!doCompute) return { path:[target], end:1 };\n else if (typeof e.path !== \"undefined\" && e.path.indexOf) {\n return { path: e.path, end: e.path.indexOf(obj) };\n } else {\n var out = { path:[], end:-1 }, _one = function(el) {\n out.path.push(el);\n if (el === obj) {\n out.end = out.path.length - 1;\n }\n else if (el.parentNode != null) {\n _one(el.parentNode)\n }\n };\n _one(target);\n return out;\n }\n },\n _d = function (l, fn) {\n for (var i = 0, j = l.length; i < j; i++) {\n if (l[i] == fn) break;\n }\n if (i < l.length) l.splice(i, 1);\n },\n guid = 1,\n //\n // this function generates a guid for every handler, sets it on the handler, then adds\n // it to the associated object's map of handlers for the given event. this is what enables us\n // to unbind all events of some type, or all events (the second of which can be requested by the user,\n // but it also used by Mottle when an element is removed.)\n _store = function (obj, event, fn) {\n var g = guid++;\n obj.__ta = obj.__ta || {};\n obj.__ta[event] = obj.__ta[event] || {};\n // store each handler with a unique guid.\n obj.__ta[event][g] = fn;\n // set the guid on the handler.\n fn.__tauid = g;\n return g;\n },\n _unstore = function (obj, event, fn) {\n obj.__ta && obj.__ta[event] && delete obj.__ta[event][fn.__tauid];\n // a handler might have attached extra functions, so we unbind those too.\n if (fn.__taExtra) {\n for (var i = 0; i < fn.__taExtra.length; i++) {\n _unbind(obj, fn.__taExtra[i][0], fn.__taExtra[i][1]);\n }\n fn.__taExtra.length = 0;\n }\n // a handler might have attached an unstore callback\n fn.__taUnstore && fn.__taUnstore();\n },\n _curryChildFilter = function (children, obj, fn, evt) {\n if (children == null) return fn;\n else {\n var c = children.split(\",\"),\n _fn = function (e) {\n _fn.__tauid = fn.__tauid;\n var t = _t(e), target = t; // t is the target element on which the event occurred. it is the\n // element we will wish to pass to any callbacks.\n var pathInfo = _pi(e, t, obj, children != null)\n if (pathInfo.end != -1) {\n for (var p = 0; p < pathInfo.end; p++) {\n target = pathInfo.path[p];\n for (var i = 0; i < c.length; i++) {\n if (matchesSelector(target, c[i], obj)) {\n fn.apply(target, arguments);\n }\n }\n }\n }\n };\n registerExtraFunction(fn, evt, _fn);\n return _fn;\n }\n },\n //\n // registers an 'extra' function on some event listener function we were given - a function that we\n // created and bound to the element as part of our housekeeping, and which we want to unbind and remove\n // whenever the given function is unbound.\n registerExtraFunction = function (fn, evt, newFn) {\n fn.__taExtra = fn.__taExtra || [];\n fn.__taExtra.push([evt, newFn]);\n },\n DefaultHandler = function (obj, evt, fn, children) {\n if (isTouchDevice && touchMap[evt]) {\n var tfn = _curryChildFilter(children, obj, fn, touchMap[evt]);\n _bind(obj, touchMap[evt], tfn , fn);\n }\n if (evt === \"focus\" && obj.getAttribute(\"tabindex\") == null) {\n obj.setAttribute(\"tabindex\", \"1\");\n }\n _bind(obj, evt, _curryChildFilter(children, obj, fn, evt), fn);\n },\n SmartClickHandler = function (obj, evt, fn, children) {\n if (obj.__taSmartClicks == null) {\n var down = function (e) {\n obj.__tad = _pageLocation(e);\n },\n up = function (e) {\n obj.__tau = _pageLocation(e);\n },\n click = function (e) {\n if (obj.__tad && obj.__tau && obj.__tad[0] === obj.__tau[0] && obj.__tad[1] === obj.__tau[1]) {\n for (var i = 0; i < obj.__taSmartClicks.length; i++)\n obj.__taSmartClicks[i].apply(_t(e), [ e ]);\n }\n };\n DefaultHandler(obj, \"mousedown\", down, children);\n DefaultHandler(obj, \"mouseup\", up, children);\n DefaultHandler(obj, \"click\", click, children);\n obj.__taSmartClicks = [];\n }\n\n // store in the list of callbacks\n obj.__taSmartClicks.push(fn);\n // the unstore function removes this function from the object's listener list for this type.\n fn.__taUnstore = function () {\n _d(obj.__taSmartClicks, fn);\n };\n },\n _tapProfiles = {\n \"tap\": {touches: 1, taps: 1},\n \"dbltap\": {touches: 1, taps: 2},\n \"contextmenu\": {touches: 2, taps: 1}\n },\n TapHandler = function (clickThreshold, dblClickThreshold) {\n return function (obj, evt, fn, children) {\n // if event is contextmenu, for devices which are mouse only, we want to\n // use the default bind.\n if (evt == \"contextmenu\" && isMouseDevice)\n DefaultHandler(obj, evt, fn, children);\n else {\n // the issue here is that this down handler gets registered only for the\n // child nodes in the first registration. in fact it should be registered with\n // no child selector and then on down we should cycle through the registered\n // functions to see if one of them matches. on mouseup we should execute ALL of\n // the functions whose children are either null or match the element.\n if (obj.__taTapHandler == null) {\n var tt = obj.__taTapHandler = {\n tap: [],\n dbltap: [],\n contextmenu: [],\n down: false,\n taps: 0,\n downSelectors: []\n };\n var down = function (e) {\n var target = _t(e), pathInfo = _pi(e, target, obj, children != null), finished = false;\n for (var p = 0; p < pathInfo.end; p++) {\n if (finished) return;\n target = pathInfo.path[p];\n for (var i = 0; i < tt.downSelectors.length; i++) {\n if (tt.downSelectors[i] == null || matchesSelector(target, tt.downSelectors[i], obj)) {\n tt.down = true;\n setTimeout(clearSingle, clickThreshold);\n setTimeout(clearDouble, dblClickThreshold);\n finished = true;\n break; // we only need one match on mousedown\n }\n }\n }\n },\n up = function (e) {\n if (tt.down) {\n var target = _t(e), currentTarget, pathInfo;\n tt.taps++;\n var tc = _touchCount(e);\n for (var eventId in _tapProfiles) {\n if (_tapProfiles.hasOwnProperty(eventId)) {\n var p = _tapProfiles[eventId];\n if (p.touches === tc && (p.taps === 1 || p.taps === tt.taps)) {\n for (var i = 0; i < tt[eventId].length; i++) {\n pathInfo = _pi(e, target, obj, tt[eventId][i][1] != null);\n for (var pLoop = 0; pLoop < pathInfo.end; pLoop++) {\n currentTarget = pathInfo.path[pLoop];\n // this is a single event registration handler.\n if (tt[eventId][i][1] == null || matchesSelector(currentTarget, tt[eventId][i][1], obj)) {\n tt[eventId][i][0].apply(currentTarget, [ e ]);\n break;\n }\n }\n }\n }\n }\n }\n }\n },\n clearSingle = function () {\n tt.down = false;\n },\n clearDouble = function () {\n tt.taps = 0;\n };\n\n DefaultHandler(obj, \"mousedown\", down);\n DefaultHandler(obj, \"mouseup\", up);\n }\n // add this child selector (it can be null, that's fine).\n obj.__taTapHandler.downSelectors.push(children);\n\n obj.__taTapHandler[evt].push([fn, children]);\n // the unstore function removes this function from the object's listener list for this type.\n fn.__taUnstore = function () {\n _d(obj.__taTapHandler[evt], fn);\n };\n }\n };\n },\n meeHelper = function (type, evt, obj, target) {\n for (var i in obj.__tamee[type]) {\n if (obj.__tamee[type].hasOwnProperty(i)) {\n obj.__tamee[type][i].apply(target, [ evt ]);\n }\n }\n },\n MouseEnterExitHandler = function () {\n var activeElements = [];\n return function (obj, evt, fn, children) {\n if (!obj.__tamee) {\n // __tamee holds a flag saying whether the mouse is currently \"in\" the element, and a list of\n // both mouseenter and mouseexit functions.\n obj.__tamee = { over: false, mouseenter: [], mouseexit: [] };\n // register over and out functions\n var over = function (e) {\n var t = _t(e);\n if ((children == null && (t == obj && !obj.__tamee.over)) || (matchesSelector(t, children, obj) && (t.__tamee == null || !t.__tamee.over))) {\n meeHelper(\"mouseenter\", e, obj, t);\n t.__tamee = t.__tamee || {};\n t.__tamee.over = true;\n activeElements.push(t);\n }\n },\n out = function (e) {\n var t = _t(e);\n // is the current target one of the activeElements? and is the\n // related target NOT a descendant of it?\n for (var i = 0; i < activeElements.length; i++) {\n if (t == activeElements[i] && !matchesSelector((e.relatedTarget || e.toElement), \"*\", t)) {\n t.__tamee.over = false;\n activeElements.splice(i, 1);\n meeHelper(\"mouseexit\", e, obj, t);\n }\n }\n };\n\n _bind(obj, \"mouseover\", _curryChildFilter(children, obj, over, \"mouseover\"), over);\n _bind(obj, \"mouseout\", _curryChildFilter(children, obj, out, \"mouseout\"), out);\n }\n\n fn.__taUnstore = function () {\n delete obj.__tamee[evt][fn.__tauid];\n };\n\n _store(obj, evt, fn);\n obj.__tamee[evt][fn.__tauid] = fn;\n };\n },\n isTouchDevice = \"ontouchstart\" in document.documentElement,\n isMouseDevice = \"onmousedown\" in document.documentElement,\n touchMap = { \"mousedown\": \"touchstart\", \"mouseup\": \"touchend\", \"mousemove\": \"touchmove\" },\n touchstart = \"touchstart\", touchend = \"touchend\", touchmove = \"touchmove\",\n iev = (function () {\n var rv = -1;\n if (navigator.appName == 'Microsoft Internet Explorer') {\n var ua = navigator.userAgent,\n re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n return rv;\n })(),\n isIELT9 = iev > -1 && iev < 9,\n _genLoc = function (e, prefix) {\n if (e == null) return [ 0, 0 ];\n var ts = _touches(e), t = _getTouch(ts, 0);\n return [t[prefix + \"X\"], t[prefix + \"Y\"]];\n },\n _pageLocation = function (e) {\n if (e == null) return [ 0, 0 ];\n if (isIELT9) {\n return [ e.clientX + document.documentElement.scrollLeft, e.clientY + document.documentElement.scrollTop ];\n }\n else {\n return _genLoc(e, \"page\");\n }\n },\n _screenLocation = function (e) {\n return _genLoc(e, \"screen\");\n },\n _clientLocation = function (e) {\n return _genLoc(e, \"client\");\n },\n _getTouch = function (touches, idx) {\n return touches.item ? touches.item(idx) : touches[idx];\n },\n _touches = function (e) {\n return e.touches && e.touches.length > 0 ? e.touches :\n e.changedTouches && e.changedTouches.length > 0 ? e.changedTouches :\n e.targetTouches && e.targetTouches.length > 0 ? e.targetTouches :\n [ e ];\n },\n _touchCount = function (e) {\n return _touches(e).length;\n },\n //http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html\n _bind = function (obj, type, fn, originalFn) {\n _store(obj, type, fn);\n originalFn.__tauid = fn.__tauid;\n if (obj.addEventListener)\n obj.addEventListener(type, fn, false);\n else if (obj.attachEvent) {\n var key = type + fn.__tauid;\n obj[\"e\" + key] = fn;\n // TODO look at replacing with .call(..)\n obj[key] = function () {\n obj[\"e\" + key] && obj[\"e\" + key](window.event);\n };\n obj.attachEvent(\"on\" + type, obj[key]);\n }\n },\n _unbind = function (obj, type, fn) {\n if (fn == null) return;\n _each(obj, function () {\n var _el = _gel(this);\n _unstore(_el, type, fn);\n // it has been bound if there is a tauid. otherwise it was not bound and we can ignore it.\n if (fn.__tauid != null) {\n if (_el.removeEventListener) {\n _el.removeEventListener(type, fn, false);\n if (isTouchDevice && touchMap[type]) _el.removeEventListener(touchMap[type], fn, false);\n }\n else if (this.detachEvent) {\n var key = type + fn.__tauid;\n _el[key] && _el.detachEvent(\"on\" + type, _el[key]);\n _el[key] = null;\n _el[\"e\" + key] = null;\n }\n }\n\n // if a touch event was also registered, deregister now.\n if (fn.__taTouchProxy) {\n _unbind(obj, fn.__taTouchProxy[1], fn.__taTouchProxy[0]);\n }\n });\n },\n _each = function (obj, fn) {\n if (obj == null) return;\n // if a list (or list-like), use it. if a string, get a list\n // by running the string through querySelectorAll. else, assume\n // it's an Element.\n // obj.top is \"unknown\" in IE8.\n obj = (typeof Window !== \"undefined\" && (typeof obj.top !== \"unknown\" && obj == obj.top)) ? [ obj ] :\n (typeof obj !== \"string\") && (obj.tagName == null && obj.length != null) ? obj :\n typeof obj === \"string\" ? document.querySelectorAll(obj)\n : [ obj ];\n\n for (var i = 0; i < obj.length; i++)\n fn.apply(obj[i]);\n },\n _uuid = function () {\n return ('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n }));\n };\n\n /**\n * Mottle offers support for abstracting out the differences\n * between touch and mouse devices, plus \"smart click\" functionality\n * (don't fire click if the mouse has moved between mousedown and mouseup),\n * and synthesized click/tap events.\n * @class Mottle\n * @constructor\n * @param {Object} params Constructor params\n * @param {Number} [params.clickThreshold=250] Threshold, in milliseconds beyond which a touchstart followed by a touchend is not considered to be a click.\n * @param {Number} [params.dblClickThreshold=450] Threshold, in milliseconds beyond which two successive tap events are not considered to be a click.\n * @param {Boolean} [params.smartClicks=false] If true, won't fire click events if the mouse has moved between mousedown and mouseup. Note that this functionality\n * requires that Mottle consume the mousedown event, and so may not be viable in all use cases.\n */\n root.Mottle = function (params) {\n params = params || {};\n var clickThreshold = params.clickThreshold || 250,\n dblClickThreshold = params.dblClickThreshold || 450,\n mouseEnterExitHandler = new MouseEnterExitHandler(),\n tapHandler = new TapHandler(clickThreshold, dblClickThreshold),\n _smartClicks = params.smartClicks,\n _doBind = function (obj, evt, fn, children) {\n if (fn == null) return;\n _each(obj, function () {\n var _el = _gel(this);\n if (_smartClicks && evt === \"click\")\n SmartClickHandler(_el, evt, fn, children);\n else if (evt === \"tap\" || evt === \"dbltap\" || evt === \"contextmenu\") {\n tapHandler(_el, evt, fn, children);\n }\n else if (evt === \"mouseenter\" || evt == \"mouseexit\")\n mouseEnterExitHandler(_el, evt, fn, children);\n else\n DefaultHandler(_el, evt, fn, children);\n });\n };\n\n /**\n * Removes an element from the DOM, and deregisters all event handlers for it. You should use this\n * to ensure you don't leak memory.\n * @method remove\n * @param {String|Element} el Element, or id of the element, to remove.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.remove = function (el) {\n _each(el, function () {\n var _el = _gel(this);\n if (_el.__ta) {\n for (var evt in _el.__ta) {\n if (_el.__ta.hasOwnProperty(evt)) {\n for (var h in _el.__ta[evt]) {\n if (_el.__ta[evt].hasOwnProperty(h))\n _unbind(_el, evt, _el.__ta[evt][h]);\n }\n }\n }\n }\n _el.parentNode && _el.parentNode.removeChild(_el);\n });\n return this;\n };\n\n /**\n * Register an event handler, optionally as a delegate for some set of descendant elements. Note\n * that this method takes either 3 or 4 arguments - if you supply 3 arguments it is assumed you have\n * omitted the `children` parameter, and that the event handler should be bound directly to the given element.\n * @method on\n * @param {Element[]|Element|String} el Either an Element, or a CSS spec for a list of elements, or an array of Elements.\n * @param {String} [children] Comma-delimited list of selectors identifying allowed children.\n * @param {String} event Event ID.\n * @param {Function} fn Event handler function.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.on = function (el, event, children, fn) {\n var _el = arguments[0],\n _c = arguments.length == 4 ? arguments[2] : null,\n _e = arguments[1],\n _f = arguments[arguments.length - 1];\n\n _doBind(_el, _e, _f, _c);\n return this;\n };\n\n /**\n * Cancel delegate event handling for the given function. Note that unlike with 'on' you do not supply\n * a list of child selectors here: it removes event delegation from all of the child selectors for which the\n * given function was registered (if any).\n * @method off\n * @param {Element[]|Element|String} el Element - or ID of element - from which to remove event listener.\n * @param {String} event Event ID.\n * @param {Function} fn Event handler function.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.off = function (el, event, fn) {\n _unbind(el, event, fn);\n return this;\n };\n\n /**\n * Triggers some event for a given element.\n * @method trigger\n * @param {Element} el Element for which to trigger the event.\n * @param {String} event Event ID.\n * @param {Event} originalEvent The original event. Should be optional of course, but currently is not, due\n * to the jsPlumb use case that caused this method to be added.\n * @param {Object} [payload] Optional object to set as `payload` on the generated event; useful for message passing.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.trigger = function (el, event, originalEvent, payload) {\n // MouseEvent undefined in old IE; that's how we know it's a mouse event. A fine Microsoft paradox.\n var originalIsMouse = isMouseDevice && (typeof MouseEvent === \"undefined\" || originalEvent == null || originalEvent.constructor === MouseEvent);\n\n var eventToBind = (isTouchDevice && !isMouseDevice && touchMap[event]) ? touchMap[event] : event,\n bindingAMouseEvent = !(isTouchDevice && !isMouseDevice && touchMap[event]);\n\n var pl = _pageLocation(originalEvent), sl = _screenLocation(originalEvent), cl = _clientLocation(originalEvent);\n _each(el, function () {\n var _el = _gel(this), evt;\n originalEvent = originalEvent || {\n screenX: sl[0],\n screenY: sl[1],\n clientX: cl[0],\n clientY: cl[1]\n };\n\n var _decorate = function (_evt) {\n if (payload) _evt.payload = payload;\n };\n\n var eventGenerators = {\n \"TouchEvent\": function (evt) {\n\n var touchList = _touchAndList(window, _el, 0, pl[0], pl[1], sl[0], sl[1], cl[0], cl[1]),\n init = evt.initTouchEvent || evt.initEvent;\n\n init(eventToBind, true, true, window, null, sl[0], sl[1],\n cl[0], cl[1], false, false, false, false,\n touchList, touchList, touchList, 1, 0);\n },\n \"MouseEvents\": function (evt) {\n evt.initMouseEvent(eventToBind, true, true, window, 0,\n sl[0], sl[1],\n cl[0], cl[1],\n false, false, false, false, 1, _el);\n }\n };\n\n if (document.createEvent) {\n\n var ite = !bindingAMouseEvent && !originalIsMouse && (isTouchDevice && touchMap[event]),\n evtName = ite ? \"TouchEvent\" : \"MouseEvents\";\n\n evt = document.createEvent(evtName);\n eventGenerators[evtName](evt);\n _decorate(evt);\n _el.dispatchEvent(evt);\n }\n else if (document.createEventObject) {\n evt = document.createEventObject();\n evt.eventType = evt.eventName = eventToBind;\n evt.screenX = sl[0];\n evt.screenY = sl[1];\n evt.clientX = cl[0];\n evt.clientY = cl[1];\n _decorate(evt);\n _el.fireEvent('on' + eventToBind, evt);\n }\n });\n return this;\n }\n };\n\n /**\n * Static method to assist in 'consuming' an element: uses `stopPropagation` where available, or sets\n * `e.returnValue=false` where it is not.\n * @method Mottle.consume\n * @param {Event} e Event to consume\n * @param {Boolean} [doNotPreventDefault=false] If true, does not call `preventDefault()` on the event.\n */\n root.Mottle.consume = function (e, doNotPreventDefault) {\n if (e.stopPropagation)\n e.stopPropagation();\n else\n e.returnValue = false;\n\n if (!doNotPreventDefault && e.preventDefault)\n e.preventDefault();\n };\n\n /**\n * Gets the page location corresponding to the given event. For touch events this means get the page location of the first touch.\n * @method Mottle.pageLocation\n * @param {Event} e Event to get page location for.\n * @return {Number[]} [left, top] for the given event.\n */\n root.Mottle.pageLocation = _pageLocation;\n\n /**\n * Forces touch events to be turned \"on\". Useful for testing: even if you don't have a touch device, you can still\n * trigger a touch event when this is switched on and it will be captured and acted on.\n * @method setForceTouchEvents\n * @param {Boolean} value If true, force touch events to be on.\n */\n root.Mottle.setForceTouchEvents = function (value) {\n isTouchDevice = value;\n };\n\n /**\n * Forces mouse events to be turned \"on\". Useful for testing: even if you don't have a mouse, you can still\n * trigger a mouse event when this is switched on and it will be captured and acted on.\n * @method setForceMouseEvents\n * @param {Boolean} value If true, force mouse events to be on.\n */\n root.Mottle.setForceMouseEvents = function (value) {\n isMouseDevice = value;\n };\n\n root.Mottle.version = \"0.8.0\";\n\n if (typeof exports !== \"undefined\") {\n exports.Mottle = root.Mottle;\n }\n\n}).call(typeof window === \"undefined\" ? this : window);\n\n/**\n drag/drop functionality for use with jsPlumb but with\n no knowledge of jsPlumb. supports multiple scopes (separated by whitespace), dragging\n multiple elements, constrain to parent, drop filters, drag start filters, custom\n css classes.\n\n a lot of the functionality of this script is expected to be plugged in:\n\n addClass\n removeClass\n\n addEvent\n removeEvent\n\n getPosition\n setPosition\n getSize\n\n indexOf\n intersects\n\n the name came from here:\n\n http://mrsharpoblunto.github.io/foswig.js/\n\n copyright 2016 jsPlumb\n */\n\n;(function() {\n\n \"use strict\";\n var root = this;\n\n var _suggest = function(list, item, head) {\n if (list.indexOf(item) === -1) {\n head ? list.unshift(item) : list.push(item);\n return true;\n }\n return false;\n };\n\n var _vanquish = function(list, item) {\n var idx = list.indexOf(item);\n if (idx !== -1) list.splice(idx, 1);\n };\n\n var _difference = function(l1, l2) {\n var d = [];\n for (var i = 0; i < l1.length; i++) {\n if (l2.indexOf(l1[i]) === -1)\n d.push(l1[i]);\n }\n return d;\n };\n\n var _isString = function(f) {\n return f == null ? false : (typeof f === \"string\" || f.constructor === String);\n };\n\n var getOffsetRect = function (elem) {\n // (1)\n var box = elem.getBoundingClientRect(),\n body = document.body,\n docElem = document.documentElement,\n // (2)\n scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop,\n scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft,\n // (3)\n clientTop = docElem.clientTop || body.clientTop || 0,\n clientLeft = docElem.clientLeft || body.clientLeft || 0,\n // (4)\n top = box.top + scrollTop - clientTop,\n left = box.left + scrollLeft - clientLeft;\n\n return { top: Math.round(top), left: Math.round(left) };\n };\n\n var matchesSelector = function(el, selector, ctx) {\n ctx = ctx || el.parentNode;\n var possibles = ctx.querySelectorAll(selector);\n for (var i = 0; i < possibles.length; i++) {\n if (possibles[i] === el)\n return true;\n }\n return false;\n };\n\n var findDelegateElement = function(parentElement, childElement, selector) {\n if (matchesSelector(childElement, selector, parentElement)) {\n return childElement;\n } else {\n var currentParent = childElement.parentNode;\n while (currentParent != null && currentParent !== parentElement) {\n if (matchesSelector(currentParent, selector, parentElement)) {\n return currentParent;\n } else {\n currentParent = currentParent.parentNode;\n }\n }\n }\n };\n\n var iev = (function() {\n var rv = -1;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var ua = navigator.userAgent,\n re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n return rv;\n })(),\n DEFAULT_GRID_X = 10,\n DEFAULT_GRID_Y = 10,\n isIELT9 = iev > -1 && iev < 9,\n isIE9 = iev === 9,\n _pl = function(e) {\n if (isIELT9) {\n return [ e.clientX + document.documentElement.scrollLeft, e.clientY + document.documentElement.scrollTop ];\n }\n else {\n var ts = _touches(e), t = _getTouch(ts, 0);\n // for IE9 pageX might be null if the event was synthesized. We try for pageX/pageY first,\n // falling back to clientX/clientY if necessary. In every other browser we want to use pageX/pageY.\n return isIE9 ? [t.pageX || t.clientX, t.pageY || t.clientY] : [t.pageX, t.pageY];\n }\n },\n _getTouch = function(touches, idx) { return touches.item ? touches.item(idx) : touches[idx]; },\n _touches = function(e) {\n return e.touches && e.touches.length > 0 ? e.touches :\n e.changedTouches && e.changedTouches.length > 0 ? e.changedTouches :\n e.targetTouches && e.targetTouches.length > 0 ? e.targetTouches :\n [ e ];\n },\n _classes = {\n draggable:\"katavorio-draggable\", // draggable elements\n droppable:\"katavorio-droppable\", // droppable elements\n drag : \"katavorio-drag\", // elements currently being dragged\n selected:\"katavorio-drag-selected\", // elements in current drag selection\n active : \"katavorio-drag-active\", // droppables that are targets of a currently dragged element\n hover : \"katavorio-drag-hover\", // droppables over which a matching drag element is hovering\n noSelect : \"katavorio-drag-no-select\", // added to the body to provide a hook to suppress text selection\n ghostProxy:\"katavorio-ghost-proxy\", // added to a ghost proxy element in use when a drag has exited the bounds of its parent.\n clonedDrag:\"katavorio-clone-drag\" // added to a node that is a clone of an element created at the start of a drag\n },\n _defaultScope = \"katavorio-drag-scope\",\n _events = [ \"stop\", \"start\", \"drag\", \"drop\", \"over\", \"out\", \"beforeStart\" ],\n _devNull = function() {},\n _true = function() { return true; },\n _foreach = function(l, fn, from) {\n for (var i = 0; i < l.length; i++) {\n if (l[i] != from)\n fn(l[i]);\n }\n },\n _setDroppablesActive = function(dd, val, andHover, drag) {\n _foreach(dd, function(e) {\n e.setActive(val);\n if (val) e.updatePosition();\n if (andHover) e.setHover(drag, val);\n });\n },\n _each = function(obj, fn) {\n if (obj == null) return;\n obj = !_isString(obj) && (obj.tagName == null && obj.length != null) ? obj : [ obj ];\n for (var i = 0; i < obj.length; i++)\n fn.apply(obj[i], [ obj[i] ]);\n },\n _consume = function(e) {\n if (e.stopPropagation) {\n e.stopPropagation();\n e.preventDefault();\n }\n else {\n e.returnValue = false;\n }\n },\n _defaultInputFilterSelector = \"input,textarea,select,button,option\",\n //\n // filters out events on all input elements, like textarea, checkbox, input, select.\n _inputFilter = function(e, el, _katavorio) {\n var t = e.srcElement || e.target;\n return !matchesSelector(t, _katavorio.getInputFilterSelector(), el);\n };\n\n var Super = function(el, params, css, scope) {\n this.params = params || {};\n this.el = el;\n this.params.addClass(this.el, this._class);\n this.uuid = _uuid();\n var enabled = true;\n this.setEnabled = function(e) { enabled = e; };\n this.isEnabled = function() { return enabled; };\n this.toggleEnabled = function() { enabled = !enabled; };\n this.setScope = function(scopes) {\n this.scopes = scopes ? scopes.split(/\\s+/) : [ scope ];\n };\n this.addScope = function(scopes) {\n var m = {};\n _each(this.scopes, function(s) { m[s] = true;});\n _each(scopes ? scopes.split(/\\s+/) : [], function(s) { m[s] = true;});\n this.scopes = [];\n for (var i in m) this.scopes.push(i);\n };\n this.removeScope = function(scopes) {\n var m = {};\n _each(this.scopes, function(s) { m[s] = true;});\n _each(scopes ? scopes.split(/\\s+/) : [], function(s) { delete m[s];});\n this.scopes = [];\n for (var i in m) this.scopes.push(i);\n };\n this.toggleScope = function(scopes) {\n var m = {};\n _each(this.scopes, function(s) { m[s] = true;});\n _each(scopes ? scopes.split(/\\s+/) : [], function(s) {\n if (m[s]) delete m[s];\n else m[s] = true;\n });\n this.scopes = [];\n for (var i in m) this.scopes.push(i);\n };\n this.setScope(params.scope);\n this.k = params.katavorio;\n return params.katavorio;\n };\n\n var TRUE = function() { return true; };\n var FALSE = function() { return false; };\n\n var Drag = function(el, params, css, scope) {\n this._class = css.draggable;\n var k = Super.apply(this, arguments);\n this.rightButtonCanDrag = this.params.rightButtonCanDrag;\n var downAt = [0,0], posAtDown = null, pagePosAtDown = null, pageDelta = [0,0], moving = false, initialScroll = [0,0],\n consumeStartEvent = this.params.consumeStartEvent !== false,\n dragEl = this.el,\n clone = this.params.clone,\n scroll = this.params.scroll,\n _multipleDrop = params.multipleDrop !== false,\n isConstrained = false,\n useGhostProxy = params.ghostProxy === true ? TRUE : params.ghostProxy && typeof params.ghostProxy === \"function\" ? params.ghostProxy : FALSE,\n ghostProxy = function(el) { return el.cloneNode(true); },\n selector = params.selector,\n elementToDrag = null;\n\n var snapThreshold = params.snapThreshold,\n _snap = function(pos, gridX, gridY, thresholdX, thresholdY) {\n var _dx = Math.floor(pos[0] / gridX),\n _dxl = gridX * _dx,\n _dxt = _dxl + gridX,\n _x = Math.abs(pos[0] - _dxl) <= thresholdX ? _dxl : Math.abs(_dxt - pos[0]) <= thresholdX ? _dxt : pos[0];\n\n var _dy = Math.floor(pos[1] / gridY),\n _dyl = gridY * _dy,\n _dyt = _dyl + gridY,\n _y = Math.abs(pos[1] - _dyl) <= thresholdY ? _dyl : Math.abs(_dyt - pos[1]) <= thresholdY ? _dyt : pos[1];\n\n return [ _x, _y];\n };\n\n this.posses = [];\n this.posseRoles = {};\n\n this.toGrid = function(pos) {\n if (this.params.grid == null) {\n return pos;\n }\n else {\n var tx = this.params.grid ? this.params.grid[0] / 2 : snapThreshold ? snapThreshold : DEFAULT_GRID_X / 2,\n ty = this.params.grid ? this.params.grid[1] / 2 : snapThreshold ? snapThreshold : DEFAULT_GRID_Y / 2;\n\n return _snap(pos, this.params.grid[0], this.params.grid[1], tx, ty);\n }\n };\n\n this.snap = function(x, y) {\n if (dragEl == null) return;\n x = x || (this.params.grid ? this.params.grid[0] : DEFAULT_GRID_X);\n y = y || (this.params.grid ? this.params.grid[1] : DEFAULT_GRID_Y);\n var p = this.params.getPosition(dragEl),\n tx = this.params.grid ? this.params.grid[0] / 2 : snapThreshold,\n ty = this.params.grid ? this.params.grid[1] / 2 : snapThreshold;\n\n this.params.setPosition(dragEl, _snap(p, x, y, tx, ty));\n };\n\n this.setUseGhostProxy = function(val) {\n useGhostProxy = val ? TRUE : FALSE;\n };\n\n var constrain;\n var negativeFilter = function(pos) {\n return (params.allowNegative === false) ? [ Math.max (0, pos[0]), Math.max(0, pos[1]) ] : pos;\n };\n\n var _setConstrain = function(value) {\n constrain = typeof value === \"function\" ? value : value ? function(pos, dragEl, _constrainRect, _size) {\n return negativeFilter([\n Math.max(0, Math.min(_constrainRect.w - _size[0], pos[0])),\n Math.max(0, Math.min(_constrainRect.h - _size[1], pos[1]))\n ]);\n }.bind(this) : function(pos) { return negativeFilter(pos); };\n }.bind(this);\n\n _setConstrain(typeof this.params.constrain === \"function\" ? this.params.constrain : (this.params.constrain || this.params.containment));\n\n\n /**\n * Sets whether or not the Drag is constrained. A value of 'true' means constrain to parent bounds; a function\n * will be executed and returns true if the position is allowed.\n * @param value\n */\n this.setConstrain = function(value) {\n _setConstrain(value);\n };\n\n var revertFunction;\n /**\n * Sets a function to call on drag stop, which, if it returns true, indicates that the given element should\n * revert to its position before the previous drag.\n * @param fn\n */\n this.setRevert = function(fn) {\n revertFunction = fn;\n };\n\n var _assignId = function(obj) {\n if (typeof obj === \"function\") {\n obj._katavorioId = _uuid();\n return obj._katavorioId;\n } else {\n return obj;\n }\n },\n // a map of { spec -> [ fn, exclusion ] } entries.\n _filters = {},\n _testFilter = function(e) {\n for (var key in _filters) {\n var f = _filters[key];\n var rv = f[0](e);\n if (f[1]) rv = !rv;\n if (!rv) return false;\n }\n return true;\n },\n _setFilter = this.setFilter = function(f, _exclude) {\n if (f) {\n var key = _assignId(f);\n _filters[key] = [\n function(e) {\n var t = e.srcElement || e.target, m;\n if (_isString(f)) {\n m = matchesSelector(t, f, el);\n }\n else if (typeof f === \"function\") {\n m = f(e, el);\n }\n return m;\n },\n _exclude !== false\n ];\n\n }\n },\n _addFilter = this.addFilter = _setFilter,\n _removeFilter = this.removeFilter = function(f) {\n var key = typeof f === \"function\" ? f._katavorioId : f;\n delete _filters[key];\n };\n\n this.clearAllFilters = function() {\n _filters = {};\n };\n\n this.canDrag = this.params.canDrag || _true;\n\n var constrainRect,\n matchingDroppables = [],\n intersectingDroppables = [];\n\n this.downListener = function(e) {\n var isNotRightClick = this.rightButtonCanDrag || (e.which !== 3 && e.button !== 2);\n if (isNotRightClick && this.isEnabled() && this.canDrag()) {\n\n var _f = _testFilter(e) && _inputFilter(e, this.el, this.k);\n if (_f) {\n\n if (selector) {\n elementToDrag = findDelegateElement(this.el, e.target || e.srcElement, selector);\n if(elementToDrag == null) {\n return;\n }\n }\n else {\n elementToDrag = this.el;\n }\n\n if (clone) {\n dragEl = elementToDrag.cloneNode(true);\n this.params.addClass(dragEl, _classes.clonedDrag);\n\n dragEl.setAttribute(\"id\", null);\n dragEl.style.position = \"absolute\";\n\n if (this.params.parent != null) {\n var p = this.params.getPosition(this.el);\n dragEl.style.left = p[0] + \"px\";\n dragEl.style.top = p[1] + \"px\";\n this.params.parent.appendChild(dragEl);\n } else {\n // the clone node is added to the body; getOffsetRect gives us a value\n // relative to the body.\n var b = getOffsetRect(elementToDrag);\n dragEl.style.left = b.left + \"px\";\n dragEl.style.top = b.top + \"px\";\n\n document.body.appendChild(dragEl);\n }\n\n } else {\n dragEl = elementToDrag;\n }\n\n consumeStartEvent && _consume(e);\n downAt = _pl(e);\n if (dragEl && dragEl.parentNode)\n {\n initialScroll = [dragEl.parentNode.scrollLeft, dragEl.parentNode.scrollTop];\n }\n //\n this.params.bind(document, \"mousemove\", this.moveListener);\n this.params.bind(document, \"mouseup\", this.upListener);\n k.markSelection(this);\n k.markPosses(this);\n this.params.addClass(document.body, css.noSelect);\n _dispatch(\"beforeStart\", {el:this.el, pos:posAtDown, e:e, drag:this});\n }\n else if (this.params.consumeFilteredEvents) {\n _consume(e);\n }\n }\n }.bind(this);\n\n this.moveListener = function(e) {\n if (downAt) {\n if (!moving) {\n var _continue = _dispatch(\"start\", {el:this.el, pos:posAtDown, e:e, drag:this});\n if (_continue !== false) {\n if (!downAt) {\n return;\n }\n this.mark(true);\n moving = true;\n } else {\n this.abort();\n }\n }\n\n // it is possible that the start event caused the drag to be aborted. So we check\n // again that we are currently dragging.\n if (downAt) {\n intersectingDroppables.length = 0;\n var pos = _pl(e), dx = pos[0] - downAt[0], dy = pos[1] - downAt[1],\n z = this.params.ignoreZoom ? 1 : k.getZoom();\n if (dragEl && dragEl.parentNode)\n {\n dx += dragEl.parentNode.scrollLeft - initialScroll[0];\n dy += dragEl.parentNode.scrollTop - initialScroll[1];\n }\n dx /= z;\n dy /= z;\n this.moveBy(dx, dy, e);\n k.updateSelection(dx, dy, this);\n k.updatePosses(dx, dy, this);\n }\n }\n }.bind(this);\n\n this.upListener = function(e) {\n if (downAt) {\n downAt = null;\n this.params.unbind(document, \"mousemove\", this.moveListener);\n this.params.unbind(document, \"mouseup\", this.upListener);\n this.params.removeClass(document.body, css.noSelect);\n this.unmark(e);\n k.unmarkSelection(this, e);\n k.unmarkPosses(this, e);\n this.stop(e);\n\n //k.notifySelectionDragStop(this, e); removed in 1.1.0 under the \"leave it for one release in case it breaks\" rule.\n // it isnt necessary to fire this as the normal stop event now includes a `selection` member that has every dragged element.\n // firing this event causes consumers who use the `selection` array to process a lot more drag stop events than is necessary\n\n k.notifyPosseDragStop(this, e);\n moving = false;\n if (clone) {\n dragEl && dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n dragEl = null;\n }\n\n intersectingDroppables.length = 0;\n\n if (revertFunction && revertFunction(this.el, this.params.getPosition(this.el)) === true) {\n this.params.setPosition(this.el, posAtDown);\n _dispatch(\"revert\", this.el);\n }\n }\n }.bind(this);\n\n this.getFilters = function() { return _filters; };\n\n this.abort = function() {\n if (downAt != null) {\n this.upListener();\n }\n };\n\n /**\n * Returns the element that was last dragged. This may be some original element from the DOM, or if `clone` is\n * set, then its actually a copy of some original DOM element. In some client calls to this method, it is the\n * actual element that was dragged that is desired. In others, it is the original DOM element that the user\n * wishes to get - in which case, pass true for `retrieveOriginalElement`.\n *\n * @returns {*}\n */\n this.getDragElement = function(retrieveOriginalElement) {\n return retrieveOriginalElement ? elementToDrag || this.el : dragEl || this.el;\n };\n\n var listeners = {\"start\":[], \"drag\":[], \"stop\":[], \"over\":[], \"out\":[], \"beforeStart\":[], \"revert\":[] };\n if (params.events.start) listeners.start.push(params.events.start);\n if (params.events.beforeStart) listeners.beforeStart.push(params.events.beforeStart);\n if (params.events.stop) listeners.stop.push(params.events.stop);\n if (params.events.drag) listeners.drag.push(params.events.drag);\n if (params.events.revert) listeners.revert.push(params.events.revert);\n\n this.on = function(evt, fn) {\n if (listeners[evt]) listeners[evt].push(fn);\n };\n\n this.off = function(evt, fn) {\n if (listeners[evt]) {\n var l = [];\n for (var i = 0; i < listeners[evt].length; i++) {\n if (listeners[evt][i] !== fn) l.push(listeners[evt][i]);\n }\n listeners[evt] = l;\n }\n };\n\n var _dispatch = function(evt, value) {\n var result = null;\n if (listeners[evt]) {\n for (var i = 0; i < listeners[evt].length; i++) {\n try {\n var v = listeners[evt][i](value);\n if (v != null) {\n result = v;\n }\n }\n catch (e) { }\n }\n }\n return result;\n };\n\n this.notifyStart = function(e) {\n _dispatch(\"start\", {el:this.el, pos:this.params.getPosition(dragEl), e:e, drag:this});\n };\n\n this.stop = function(e, force) {\n if (force || moving) {\n var positions = [],\n sel = k.getSelection(),\n dPos = this.params.getPosition(dragEl);\n\n if (sel.length > 1) {\n for (var i = 0; i < sel.length; i++) {\n var p = this.params.getPosition(sel[i].el);\n positions.push([ sel[i].el, { left: p[0], top: p[1] }, sel[i] ]);\n }\n }\n else {\n positions.push([ dragEl, {left:dPos[0], top:dPos[1]}, this ]);\n }\n\n _dispatch(\"stop\", {\n el: dragEl,\n pos: ghostProxyOffsets || dPos,\n finalPos:dPos,\n e: e,\n drag: this,\n selection:positions\n });\n }\n };\n\n this.mark = function(andNotify) {\n posAtDown = this.params.getPosition(dragEl);\n pagePosAtDown = this.params.getPosition(dragEl, true);\n pageDelta = [pagePosAtDown[0] - posAtDown[0], pagePosAtDown[1] - posAtDown[1]];\n this.size = this.params.getSize(dragEl);\n matchingDroppables = k.getMatchingDroppables(this);\n _setDroppablesActive(matchingDroppables, true, false, this);\n this.params.addClass(dragEl, this.params.dragClass || css.drag);\n\n var cs;\n if (this.params.getConstrainingRectangle) {\n cs = this.params.getConstrainingRectangle(dragEl)\n } else {\n cs = this.params.getSize(dragEl.parentNode);\n }\n constrainRect = {w: cs[0], h: cs[1]};\n\n if (andNotify) {\n k.notifySelectionDragStart(this);\n }\n };\n var ghostProxyOffsets;\n this.unmark = function(e, doNotCheckDroppables) {\n _setDroppablesActive(matchingDroppables, false, true, this);\n\n if (isConstrained && useGhostProxy(elementToDrag)) {\n ghostProxyOffsets = [dragEl.offsetLeft, dragEl.offsetTop];\n elementToDrag.parentNode.removeChild(dragEl);\n dragEl = elementToDrag;\n }\n else {\n ghostProxyOffsets = null;\n }\n\n this.params.removeClass(dragEl, this.params.dragClass || css.drag);\n matchingDroppables.length = 0;\n isConstrained = false;\n if (!doNotCheckDroppables) {\n if (intersectingDroppables.length > 0 && ghostProxyOffsets) {\n params.setPosition(elementToDrag, ghostProxyOffsets);\n }\n intersectingDroppables.sort(_rankSort);\n for (var i = 0; i < intersectingDroppables.length; i++) {\n var retVal = intersectingDroppables[i].drop(this, e);\n if (retVal === true) break;\n }\n }\n };\n this.moveBy = function(dx, dy, e) {\n intersectingDroppables.length = 0;\n var desiredLoc = this.toGrid([posAtDown[0] + dx, posAtDown[1] + dy]),\n cPos = constrain(desiredLoc, dragEl, constrainRect, this.size);\n\n if (useGhostProxy(this.el)) {\n if (desiredLoc[0] !== cPos[0] || desiredLoc[1] !== cPos[1]) {\n if (!isConstrained) {\n var gp = ghostProxy(elementToDrag);\n params.addClass(gp, _classes.ghostProxy);\n elementToDrag.parentNode.appendChild(gp);\n dragEl = gp;\n isConstrained = true;\n }\n cPos = desiredLoc;\n }\n else {\n if (isConstrained) {\n elementToDrag.parentNode.removeChild(dragEl);\n dragEl = elementToDrag;\n isConstrained = false;\n }\n }\n }\n\n var rect = { x:cPos[0], y:cPos[1], w:this.size[0], h:this.size[1]},\n pageRect = { x:rect.x + pageDelta[0], y:rect.y + pageDelta[1], w:rect.w, h:rect.h},\n focusDropElement = null;\n\n this.params.setPosition(dragEl, cPos);\n for (var i = 0; i < matchingDroppables.length; i++) {\n var r2 = { x:matchingDroppables[i].pagePosition[0], y:matchingDroppables[i].pagePosition[1], w:matchingDroppables[i].size[0], h:matchingDroppables[i].size[1]};\n if (this.params.intersects(pageRect, r2) && (_multipleDrop || focusDropElement == null || focusDropElement === matchingDroppables[i].el) && matchingDroppables[i].canDrop(this)) {\n if (!focusDropElement) focusDropElement = matchingDroppables[i].el;\n intersectingDroppables.push(matchingDroppables[i]);\n matchingDroppables[i].setHover(this, true, e);\n }\n else if (matchingDroppables[i].isHover()) {\n matchingDroppables[i].setHover(this, false, e);\n }\n }\n\n _dispatch(\"drag\", {el:this.el, pos:cPos, e:e, drag:this});\n\n /* test to see if the parent needs to be scrolled (future)\n if (scroll) {\n var pnsl = dragEl.parentNode.scrollLeft, pnst = dragEl.parentNode.scrollTop;\n console.log(\"scroll!\", pnsl, pnst);\n }*/\n };\n this.destroy = function() {\n this.params.unbind(this.el, \"mousedown\", this.downListener);\n this.params.unbind(document, \"mousemove\", this.moveListener);\n this.params.unbind(document, \"mouseup\", this.upListener);\n this.downListener = null;\n this.upListener = null;\n this.moveListener = null;\n };\n\n // init:register mousedown, and perhaps set a filter\n this.params.bind(this.el, \"mousedown\", this.downListener);\n\n // if handle provded, use that. otherwise, try to set a filter.\n // note that a `handle` selector always results in filterExclude being set to false, ie.\n // the selector defines the handle element(s).\n if (this.params.handle)\n _setFilter(this.params.handle, false);\n else\n _setFilter(this.params.filter, this.params.filterExclude);\n };\n\n var Drop = function(el, params, css, scope) {\n this._class = css.droppable;\n this.params = params || {};\n this.rank = params.rank || 0;\n this._activeClass = this.params.activeClass || css.active;\n this._hoverClass = this.params.hoverClass || css.hover;\n Super.apply(this, arguments);\n var hover = false;\n this.allowLoopback = this.params.allowLoopback !== false;\n\n this.setActive = function(val) {\n this.params[val ? \"addClass\" : \"removeClass\"](this.el, this._activeClass);\n };\n\n this.updatePosition = function() {\n this.position = this.params.getPosition(this.el);\n this.pagePosition = this.params.getPosition(this.el, true);\n this.size = this.params.getSize(this.el);\n };\n\n this.canDrop = this.params.canDrop || function(drag) {\n return true;\n };\n\n this.isHover = function() { return hover; };\n\n this.setHover = function(drag, val, e) {\n // if turning off hover but this was not the drag that caused the hover, ignore.\n if (val || this.el._katavorioDragHover == null || this.el._katavorioDragHover === drag.el._katavorio) {\n this.params[val ? \"addClass\" : \"removeClass\"](this.el, this._hoverClass);\n this.el._katavorioDragHover = val ? drag.el._katavorio : null;\n if (hover !== val) {\n this.params.events[val ? \"over\" : \"out\"]({el: this.el, e: e, drag: drag, drop: this});\n }\n hover = val;\n }\n };\n\n /**\n * A drop event. `drag` is the corresponding Drag object, which may be a Drag for some specific element, or it\n * may be a Drag on some element acting as a delegate for elements contained within it.\n * @param drag\n * @param event\n * @returns {*}\n */\n this.drop = function(drag, event) {\n return this.params.events[\"drop\"]({ drag:drag, e:event, drop:this });\n };\n\n this.destroy = function() {\n this._class = null;\n this._activeClass = null;\n this._hoverClass = null;\n hover = null;\n };\n };\n\n var _uuid = function() {\n return ('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random()*16|0, v = c === 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n }));\n };\n\n var _rankSort = function(a,b) {\n return a.rank < b.rank ? 1 : a.rank > b.rank ? -1 : 0;\n };\n\n var _gel = function(el) {\n if (el == null) return null;\n el = (typeof el === \"string\" || el.constructor === String) ? document.getElementById(el) : el;\n if (el == null) return null;\n el._katavorio = el._katavorio || _uuid();\n return el;\n };\n\n root.Katavorio = function(katavorioParams) {\n\n var _selection = [],\n _selectionMap = {};\n\n this._dragsByScope = {};\n this._dropsByScope = {};\n var _zoom = 1,\n _reg = function(obj, map) {\n _each(obj, function(_obj) {\n for(var i = 0; i < _obj.scopes.length; i++) {\n map[_obj.scopes[i]] = map[_obj.scopes[i]] || [];\n map[_obj.scopes[i]].push(_obj);\n }\n });\n },\n _unreg = function(obj, map) {\n var c = 0;\n _each(obj, function(_obj) {\n for(var i = 0; i < _obj.scopes.length; i++) {\n if (map[_obj.scopes[i]]) {\n var idx = katavorioParams.indexOf(map[_obj.scopes[i]], _obj);\n if (idx !== -1) {\n map[_obj.scopes[i]].splice(idx, 1);\n c++;\n }\n }\n }\n });\n\n return c > 0 ;\n },\n _getMatchingDroppables = this.getMatchingDroppables = function(drag) {\n var dd = [], _m = {};\n for (var i = 0; i < drag.scopes.length; i++) {\n var _dd = this._dropsByScope[drag.scopes[i]];\n if (_dd) {\n for (var j = 0; j < _dd.length; j++) {\n if (_dd[j].canDrop(drag) && !_m[_dd[j].uuid] && (_dd[j].allowLoopback || _dd[j].el !== drag.el)) {\n _m[_dd[j].uuid] = true;\n dd.push(_dd[j]);\n }\n }\n }\n }\n dd.sort(_rankSort);\n return dd;\n },\n _prepareParams = function(p) {\n p = p || {};\n var _p = {\n events:{}\n }, i;\n for (i in katavorioParams) _p[i] = katavorioParams[i];\n for (i in p) _p[i] = p[i];\n // events\n\n for (i = 0; i < _events.length; i++) {\n _p.events[_events[i]] = p[_events[i]] || _devNull;\n }\n _p.katavorio = this;\n return _p;\n }.bind(this),\n _mistletoe = function(existingDrag, params) {\n for (var i = 0; i < _events.length; i++) {\n if (params[_events[i]]) {\n existingDrag.on(_events[i], params[_events[i]]);\n }\n }\n }.bind(this),\n _css = {},\n overrideCss = katavorioParams.css || {},\n _scope = katavorioParams.scope || _defaultScope;\n\n // prepare map of css classes based on defaults frst, then optional overrides\n for (var i in _classes) _css[i] = _classes[i];\n for (var i in overrideCss) _css[i] = overrideCss[i];\n\n var inputFilterSelector = katavorioParams.inputFilterSelector || _defaultInputFilterSelector;\n /**\n * Gets the selector identifying which input elements to filter from drag events.\n * @method getInputFilterSelector\n * @return {String} Current input filter selector.\n */\n this.getInputFilterSelector = function() { return inputFilterSelector; };\n\n /**\n * Sets the selector identifying which input elements to filter from drag events.\n * @method setInputFilterSelector\n * @param {String} selector Input filter selector to set.\n * @return {Katavorio} Current instance; method may be chained.\n */\n this.setInputFilterSelector = function(selector) {\n inputFilterSelector = selector;\n return this;\n };\n\n /**\n * Either makes the given element draggable, or identifies it as an element inside which some identified list\n * of elements may be draggable.\n * @param el\n * @param params\n * @returns {Array}\n */\n this.draggable = function(el, params) {\n var o = [];\n _each(el, function (_el) {\n _el = _gel(_el);\n if (_el != null) {\n if (_el._katavorioDrag == null) {\n var p = _prepareParams(params);\n _el._katavorioDrag = new Drag(_el, p, _css, _scope);\n _reg(_el._katavorioDrag, this._dragsByScope);\n o.push(_el._katavorioDrag);\n katavorioParams.addClass(_el, _css.draggable);\n }\n else {\n _mistletoe(_el._katavorioDrag, params);\n }\n }\n }.bind(this));\n return o;\n };\n\n this.droppable = function(el, params) {\n var o = [];\n _each(el, function(_el) {\n _el = _gel(_el);\n if (_el != null) {\n var drop = new Drop(_el, _prepareParams(params), _css, _scope);\n _el._katavorioDrop = _el._katavorioDrop || [];\n _el._katavorioDrop.push(drop);\n _reg(drop, this._dropsByScope);\n o.push(drop);\n katavorioParams.addClass(_el, _css.droppable);\n }\n }.bind(this));\n return o;\n };\n\n /**\n * @name Katavorio#select\n * @function\n * @desc Adds an element to the current selection (for multiple node drag)\n * @param {Element|String} DOM element - or id of the element - to add.\n */\n this.select = function(el) {\n _each(el, function() {\n var _el = _gel(this);\n if (_el && _el._katavorioDrag) {\n if (!_selectionMap[_el._katavorio]) {\n _selection.push(_el._katavorioDrag);\n _selectionMap[_el._katavorio] = [ _el, _selection.length - 1 ];\n katavorioParams.addClass(_el, _css.selected);\n }\n }\n });\n return this;\n };\n\n /**\n * @name Katavorio#deselect\n * @function\n * @desc Removes an element from the current selection (for multiple node drag)\n * @param {Element|String} DOM element - or id of the element - to remove.\n */\n this.deselect = function(el) {\n _each(el, function() {\n var _el = _gel(this);\n if (_el && _el._katavorio) {\n var e = _selectionMap[_el._katavorio];\n if (e) {\n var _s = [];\n for (var i = 0; i < _selection.length; i++)\n if (_selection[i].el !== _el) _s.push(_selection[i]);\n _selection = _s;\n delete _selectionMap[_el._katavorio];\n katavorioParams.removeClass(_el, _css.selected);\n }\n }\n });\n return this;\n };\n\n this.deselectAll = function() {\n for (var i in _selectionMap) {\n var d = _selectionMap[i];\n katavorioParams.removeClass(d[0], _css.selected);\n }\n\n _selection.length = 0;\n _selectionMap = {};\n };\n\n this.markSelection = function(drag) {\n _foreach(_selection, function(e) { e.mark(); }, drag);\n };\n\n this.markPosses = function(drag) {\n if (drag.posses) {\n _each(drag.posses, function(p) {\n if (drag.posseRoles[p] && _posses[p]) {\n _foreach(_posses[p].members, function (d) {\n d.mark();\n }, drag);\n }\n })\n }\n };\n\n this.unmarkSelection = function(drag, event) {\n _foreach(_selection, function(e) { e.unmark(event); }, drag);\n };\n\n this.unmarkPosses = function(drag, event) {\n if (drag.posses) {\n _each(drag.posses, function(p) {\n if (drag.posseRoles[p] && _posses[p]) {\n _foreach(_posses[p].members, function (d) {\n d.unmark(event, true);\n }, drag);\n }\n });\n }\n };\n\n this.getSelection = function() { return _selection.slice(0); };\n\n this.updateSelection = function(dx, dy, drag) {\n _foreach(_selection, function(e) { e.moveBy(dx, dy); }, drag);\n };\n\n var _posseAction = function(fn, drag) {\n if (drag.posses) {\n _each(drag.posses, function(p) {\n if (drag.posseRoles[p] && _posses[p]) {\n _foreach(_posses[p].members, function (e) {\n fn(e);\n }, drag);\n }\n });\n }\n };\n\n this.updatePosses = function(dx, dy, drag) {\n _posseAction(function(e) { e.moveBy(dx, dy); }, drag);\n };\n\n this.notifyPosseDragStop = function(drag, evt) {\n _posseAction(function(e) { e.stop(evt, true); }, drag);\n };\n\n this.notifySelectionDragStop = function(drag, evt) {\n _foreach(_selection, function(e) { e.stop(evt, true); }, drag);\n };\n\n this.notifySelectionDragStart = function(drag, evt) {\n _foreach(_selection, function(e) { e.notifyStart(evt);}, drag);\n };\n\n this.setZoom = function(z) { _zoom = z; };\n this.getZoom = function() { return _zoom; };\n\n // does the work of changing scopes\n var _scopeManip = function(kObj, scopes, map, fn) {\n _each(kObj, function(_kObj) {\n _unreg(_kObj, map); // deregister existing scopes\n _kObj[fn](scopes); // set scopes\n _reg(_kObj, map); // register new ones\n });\n };\n\n _each([ \"set\", \"add\", \"remove\", \"toggle\"], function(v) {\n this[v + \"Scope\"] = function(el, scopes) {\n _scopeManip(el._katavorioDrag, scopes, this._dragsByScope, v + \"Scope\");\n _scopeManip(el._katavorioDrop, scopes, this._dropsByScope, v + \"Scope\");\n }.bind(this);\n this[v + \"DragScope\"] = function(el, scopes) {\n _scopeManip(el.constructor === Drag ? el : el._katavorioDrag, scopes, this._dragsByScope, v + \"Scope\");\n }.bind(this);\n this[v + \"DropScope\"] = function(el, scopes) {\n _scopeManip(el.constructor === Drop ? el : el._katavorioDrop, scopes, this._dropsByScope, v + \"Scope\");\n }.bind(this);\n }.bind(this));\n\n this.snapToGrid = function(x, y) {\n for (var s in this._dragsByScope) {\n _foreach(this._dragsByScope[s], function(d) { d.snap(x, y); });\n }\n };\n\n this.getDragsForScope = function(s) { return this._dragsByScope[s]; };\n this.getDropsForScope = function(s) { return this._dropsByScope[s]; };\n\n var _destroy = function(el, type, map) {\n el = _gel(el);\n if (el[type]) {\n\n // remove from selection, if present.\n var selIdx = _selection.indexOf(el[type]);\n if (selIdx >= 0) {\n _selection.splice(selIdx, 1);\n }\n\n if (_unreg(el[type], map)) {\n _each(el[type], function(kObj) { kObj.destroy() });\n }\n\n delete el[type];\n }\n };\n\n var _removeListener = function(el, type, evt, fn) {\n el = _gel(el);\n if (el[type]) {\n el[type].off(evt, fn);\n }\n };\n\n this.elementRemoved = function(el) {\n this.destroyDraggable(el);\n this.destroyDroppable(el);\n };\n\n /**\n * Either completely remove drag functionality from the given element, or remove a specific event handler. If you\n * call this method with a single argument - the element - all drag functionality is removed from it. Otherwise, if\n * you provide an event name and listener function, this function is de-registered (if found).\n * @param el Element to update\n * @param {string} [evt] Optional event name to unsubscribe\n * @param {Function} [fn] Optional function to unsubscribe\n */\n this.destroyDraggable = function(el, evt, fn) {\n if (arguments.length === 1) {\n _destroy(el, \"_katavorioDrag\", this._dragsByScope);\n } else {\n _removeListener(el, \"_katavorioDrag\", evt, fn);\n }\n };\n\n /**\n * Either completely remove drop functionality from the given element, or remove a specific event handler. If you\n * call this method with a single argument - the element - all drop functionality is removed from it. Otherwise, if\n * you provide an event name and listener function, this function is de-registered (if found).\n * @param el Element to update\n * @param {string} [evt] Optional event name to unsubscribe\n * @param {Function} [fn] Optional function to unsubscribe\n */\n this.destroyDroppable = function(el, evt, fn) {\n if (arguments.length === 1) {\n _destroy(el, \"_katavorioDrop\", this._dropsByScope);\n } else {\n _removeListener(el, \"_katavorioDrop\", evt, fn);\n }\n };\n\n this.reset = function() {\n this._dragsByScope = {};\n this._dropsByScope = {};\n _selection = [];\n _selectionMap = {};\n _posses = {};\n };\n\n // ----- groups\n var _posses = {};\n\n var _processOneSpec = function(el, _spec, dontAddExisting) {\n var posseId = _isString(_spec) ? _spec : _spec.id;\n var active = _isString(_spec) ? true : _spec.active !== false;\n var posse = _posses[posseId] || (function() {\n var g = {name:posseId, members:[]};\n _posses[posseId] = g;\n return g;\n })();\n _each(el, function(_el) {\n if (_el._katavorioDrag) {\n\n if (dontAddExisting && _el._katavorioDrag.posseRoles[posse.name] != null) return;\n\n _suggest(posse.members, _el._katavorioDrag);\n _suggest(_el._katavorioDrag.posses, posse.name);\n _el._katavorioDrag.posseRoles[posse.name] = active;\n }\n });\n return posse;\n };\n\n /**\n * Add the given element to the posse with the given id, creating the group if it at first does not exist.\n * @method addToPosse\n * @param {Element} el Element to add.\n * @param {String...|Object...} spec Variable args parameters. Each argument can be a either a String, indicating\n * the ID of a Posse to which the element should be added as an active participant, or an Object containing\n * `{ id:\"posseId\", active:false/true}`. In the latter case, if `active` is not provided it is assumed to be\n * true.\n * @returns {Posse|Posse[]} The Posse(s) to which the element(s) was/were added.\n */\n this.addToPosse = function(el, spec) {\n\n var posses = [];\n\n for (var i = 1; i < arguments.length; i++) {\n posses.push(_processOneSpec(el, arguments[i]));\n }\n\n return posses.length === 1 ? posses[0] : posses;\n };\n\n /**\n * Sets the posse(s) for the element with the given id, creating those that do not yet exist, and removing from\n * the element any current Posses that are not specified by this method call. This method will not change the\n * active/passive state if it is given a posse in which the element is already a member.\n * @method setPosse\n * @param {Element} el Element to set posse(s) on.\n * @param {String...|Object...} spec Variable args parameters. Each argument can be a either a String, indicating\n * the ID of a Posse to which the element should be added as an active participant, or an Object containing\n * `{ id:\"posseId\", active:false/true}`. In the latter case, if `active` is not provided it is assumed to be\n * true.\n * @returns {Posse|Posse[]} The Posse(s) to which the element(s) now belongs.\n */\n this.setPosse = function(el, spec) {\n\n var posses = [];\n\n for (var i = 1; i < arguments.length; i++) {\n posses.push(_processOneSpec(el, arguments[i], true).name);\n }\n\n _each(el, function(_el) {\n if (_el._katavorioDrag) {\n var diff = _difference(_el._katavorioDrag.posses, posses);\n var p = [];\n Array.prototype.push.apply(p, _el._katavorioDrag.posses);\n for (var i = 0; i < diff.length; i++) {\n this.removeFromPosse(_el, diff[i]);\n }\n }\n }.bind(this));\n\n return posses.length === 1 ? posses[0] : posses;\n };\n\n /**\n * Remove the given element from the given posse(s).\n * @method removeFromPosse\n * @param {Element} el Element to remove.\n * @param {String...} posseId Varargs parameter: one value for each posse to remove the element from.\n */\n this.removeFromPosse = function(el, posseId) {\n if (arguments.length < 2) throw new TypeError(\"No posse id provided for remove operation\");\n for(var i = 1; i < arguments.length; i++) {\n posseId = arguments[i];\n _each(el, function (_el) {\n if (_el._katavorioDrag && _el._katavorioDrag.posses) {\n var d = _el._katavorioDrag;\n _each(posseId, function (p) {\n _vanquish(_posses[p].members, d);\n _vanquish(d.posses, p);\n delete d.posseRoles[p];\n });\n }\n });\n }\n };\n\n /**\n * Remove the given element from all Posses to which it belongs.\n * @method removeFromAllPosses\n * @param {Element|Element[]} el Element to remove from Posses.\n */\n this.removeFromAllPosses = function(el) {\n _each(el, function(_el) {\n if (_el._katavorioDrag && _el._katavorioDrag.posses) {\n var d = _el._katavorioDrag;\n _each(d.posses, function(p) {\n _vanquish(_posses[p].members, d);\n });\n d.posses.length = 0;\n d.posseRoles = {};\n }\n });\n };\n\n /**\n * Changes the participation state for the element in the Posse with the given ID.\n * @param {Element|Element[]} el Element(s) to change state for.\n * @param {String} posseId ID of the Posse to change element state for.\n * @param {Boolean} state True to make active, false to make passive.\n */\n this.setPosseState = function(el, posseId, state) {\n var posse = _posses[posseId];\n if (posse) {\n _each(el, function(_el) {\n if (_el._katavorioDrag && _el._katavorioDrag.posses) {\n _el._katavorioDrag.posseRoles[posse.name] = state;\n }\n });\n }\n };\n\n };\n\n root.Katavorio.version = \"1.0.0\";\n\n if (typeof exports !== \"undefined\") {\n exports.Katavorio = root.Katavorio;\n }\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n\n(function() {\n\n var root = this;\n root.jsPlumbUtil = root.jsPlumbUtil || {};\n var jsPlumbUtil = root.jsPlumbUtil;\n\n if (typeof exports !=='undefined') { exports.jsPlumbUtil = jsPlumbUtil;}\n\n\n function isArray(a) {\n return Object.prototype.toString.call(a) === \"[object Array]\";\n }\n jsPlumbUtil.isArray = isArray;\n function isNumber(n) {\n return Object.prototype.toString.call(n) === \"[object Number]\";\n }\n jsPlumbUtil.isNumber = isNumber;\n function isString(s) {\n return typeof s === \"string\";\n }\n jsPlumbUtil.isString = isString;\n function isBoolean(s) {\n return typeof s === \"boolean\";\n }\n jsPlumbUtil.isBoolean = isBoolean;\n function isNull(s) {\n return s == null;\n }\n jsPlumbUtil.isNull = isNull;\n function isObject(o) {\n return o == null ? false : Object.prototype.toString.call(o) === \"[object Object]\";\n }\n jsPlumbUtil.isObject = isObject;\n function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n }\n jsPlumbUtil.isDate = isDate;\n function isFunction(o) {\n return Object.prototype.toString.call(o) === \"[object Function]\";\n }\n jsPlumbUtil.isFunction = isFunction;\n function isNamedFunction(o) {\n return isFunction(o) && o.name != null && o.name.length > 0;\n }\n jsPlumbUtil.isNamedFunction = isNamedFunction;\n function isEmpty(o) {\n for (var i in o) {\n if (o.hasOwnProperty(i)) {\n return false;\n }\n }\n return true;\n }\n jsPlumbUtil.isEmpty = isEmpty;\n function clone(a) {\n if (isString(a)) {\n return \"\" + a;\n }\n else if (isBoolean(a)) {\n return !!a;\n }\n else if (isDate(a)) {\n return new Date(a.getTime());\n }\n else if (isFunction(a)) {\n return a;\n }\n else if (isArray(a)) {\n var b = [];\n for (var i = 0; i < a.length; i++) {\n b.push(clone(a[i]));\n }\n return b;\n }\n else if (isObject(a)) {\n var c = {};\n for (var j in a) {\n c[j] = clone(a[j]);\n }\n return c;\n }\n else {\n return a;\n }\n }\n jsPlumbUtil.clone = clone;\n function merge(a, b, collations, overwrites) {\n // first change the collations array - if present - into a lookup table, because its faster.\n var cMap = {}, ar, i, oMap = {};\n collations = collations || [];\n overwrites = overwrites || [];\n for (i = 0; i < collations.length; i++) {\n cMap[collations[i]] = true;\n }\n for (i = 0; i < overwrites.length; i++) {\n oMap[overwrites[i]] = true;\n }\n var c = clone(a);\n for (i in b) {\n if (c[i] == null || oMap[i]) {\n c[i] = b[i];\n }\n else if (isString(b[i]) || isBoolean(b[i])) {\n if (!cMap[i]) {\n c[i] = b[i]; // if we dont want to collate, just copy it in.\n }\n else {\n ar = [];\n // if c's object is also an array we can keep its values.\n ar.push.apply(ar, isArray(c[i]) ? c[i] : [c[i]]);\n ar.push.apply(ar, isBoolean(b[i]) ? b[i] : [b[i]]);\n c[i] = ar;\n }\n }\n else {\n if (isArray(b[i])) {\n ar = [];\n // if c's object is also an array we can keep its values.\n if (isArray(c[i])) {\n ar.push.apply(ar, c[i]);\n }\n ar.push.apply(ar, b[i]);\n c[i] = ar;\n }\n else if (isObject(b[i])) {\n // overwrite c's value with an object if it is not already one.\n if (!isObject(c[i])) {\n c[i] = {};\n }\n for (var j in b[i]) {\n c[i][j] = b[i][j];\n }\n }\n }\n }\n return c;\n }\n jsPlumbUtil.merge = merge;\n function replace(inObj, path, value) {\n if (inObj == null) {\n return;\n }\n var q = inObj, t = q;\n path.replace(/([^\\.])+/g, function (term, lc, pos, str) {\n var array = term.match(/([^\\[0-9]+){1}(\\[)([0-9+])/), last = pos + term.length >= str.length, _getArray = function () {\n return t[array[1]] || (function () {\n t[array[1]] = [];\n return t[array[1]];\n })();\n };\n if (last) {\n // set term = value on current t, creating term as array if necessary.\n if (array) {\n _getArray()[array[3]] = value;\n }\n else {\n t[term] = value;\n }\n }\n else {\n // set to current t[term], creating t[term] if necessary.\n if (array) {\n var a_1 = _getArray();\n t = a_1[array[3]] || (function () {\n a_1[array[3]] = {};\n return a_1[array[3]];\n })();\n }\n else {\n t = t[term] || (function () {\n t[term] = {};\n return t[term];\n })();\n }\n }\n return \"\";\n });\n return inObj;\n }\n jsPlumbUtil.replace = replace;\n //\n // chain a list of functions, supplied by [ object, method name, args ], and return on the first\n // one that returns the failValue. if none return the failValue, return the successValue.\n //\n function functionChain(successValue, failValue, fns) {\n for (var i = 0; i < fns.length; i++) {\n var o = fns[i][0][fns[i][1]].apply(fns[i][0], fns[i][2]);\n if (o === failValue) {\n return o;\n }\n }\n return successValue;\n }\n jsPlumbUtil.functionChain = functionChain;\n /**\n *\n * Take the given model and expand out any parameters. 'functionPrefix' is optional, and if present, helps jsplumb figure out what to do if a value is a Function.\n * if you do not provide it (and doNotExpandFunctions is null, or false), jsplumb will run the given values through any functions it finds, and use the function's\n * output as the value in the result. if you do provide the prefix, only functions that are named and have this prefix\n * will be executed; other functions will be passed as values to the output.\n *\n * @param model\n * @param values\n * @param functionPrefix\n * @param doNotExpandFunctions\n * @returns {any}\n */\n function populate(model, values, functionPrefix, doNotExpandFunctions) {\n // for a string, see if it has parameter matches, and if so, try to make the substitutions.\n var getValue = function (fromString) {\n var matches = fromString.match(/(\\${.*?})/g);\n if (matches != null) {\n for (var i = 0; i < matches.length; i++) {\n var val = values[matches[i].substring(2, matches[i].length - 1)] || \"\";\n if (val != null) {\n fromString = fromString.replace(matches[i], val);\n }\n }\n }\n return fromString;\n };\n // process one entry.\n var _one = function (d) {\n if (d != null) {\n if (isString(d)) {\n return getValue(d);\n }\n else if (isFunction(d) && !doNotExpandFunctions && (functionPrefix == null || (d.name || \"\").indexOf(functionPrefix) === 0)) {\n return d(values);\n }\n else if (isArray(d)) {\n var r = [];\n for (var i = 0; i < d.length; i++) {\n r.push(_one(d[i]));\n }\n return r;\n }\n else if (isObject(d)) {\n var s = {};\n for (var j in d) {\n s[j] = _one(d[j]);\n }\n return s;\n }\n else {\n return d;\n }\n }\n };\n return _one(model);\n }\n jsPlumbUtil.populate = populate;\n function findWithFunction(a, f) {\n if (a) {\n for (var i = 0; i < a.length; i++) {\n if (f(a[i])) {\n return i;\n }\n }\n }\n return -1;\n }\n jsPlumbUtil.findWithFunction = findWithFunction;\n function removeWithFunction(a, f) {\n var idx = findWithFunction(a, f);\n if (idx > -1) {\n a.splice(idx, 1);\n }\n return idx !== -1;\n }\n jsPlumbUtil.removeWithFunction = removeWithFunction;\n function remove(l, v) {\n var idx = l.indexOf(v);\n if (idx > -1) {\n l.splice(idx, 1);\n }\n return idx !== -1;\n }\n jsPlumbUtil.remove = remove;\n function addWithFunction(list, item, hashFunction) {\n if (findWithFunction(list, hashFunction) === -1) {\n list.push(item);\n }\n }\n jsPlumbUtil.addWithFunction = addWithFunction;\n function addToList(map, key, value, insertAtStart) {\n var l = map[key];\n if (l == null) {\n l = [];\n map[key] = l;\n }\n l[insertAtStart ? \"unshift\" : \"push\"](value);\n return l;\n }\n jsPlumbUtil.addToList = addToList;\n function suggest(list, item, insertAtHead) {\n if (list.indexOf(item) === -1) {\n if (insertAtHead) {\n list.unshift(item);\n }\n else {\n list.push(item);\n }\n return true;\n }\n return false;\n }\n jsPlumbUtil.suggest = suggest;\n //\n // extends the given obj (which can be an array) with the given constructor function, prototype functions, and\n // class members, any of which may be null.\n //\n function extend(child, parent, _protoFn) {\n var i;\n parent = isArray(parent) ? parent : [parent];\n var _copyProtoChain = function (focus) {\n var proto = focus.__proto__;\n while (proto != null) {\n if (proto.prototype != null) {\n for (var j in proto.prototype) {\n if (proto.prototype.hasOwnProperty(j) && !child.prototype.hasOwnProperty(j)) {\n child.prototype[j] = proto.prototype[j];\n }\n }\n proto = proto.prototype.__proto__;\n }\n else {\n proto = null;\n }\n }\n };\n for (i = 0; i < parent.length; i++) {\n for (var j in parent[i].prototype) {\n if (parent[i].prototype.hasOwnProperty(j) && !child.prototype.hasOwnProperty(j)) {\n child.prototype[j] = parent[i].prototype[j];\n }\n }\n _copyProtoChain(parent[i]);\n }\n var _makeFn = function (name, protoFn) {\n return function () {\n for (i = 0; i < parent.length; i++) {\n if (parent[i].prototype[name]) {\n parent[i].prototype[name].apply(this, arguments);\n }\n }\n return protoFn.apply(this, arguments);\n };\n };\n var _oneSet = function (fns) {\n for (var k in fns) {\n child.prototype[k] = _makeFn(k, fns[k]);\n }\n };\n if (arguments.length > 2) {\n for (i = 2; i < arguments.length; i++) {\n _oneSet(arguments[i]);\n }\n }\n return child;\n }\n jsPlumbUtil.extend = extend;\n function uuid() {\n return ('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n }));\n }\n jsPlumbUtil.uuid = uuid;\n function fastTrim(s) {\n if (s == null) {\n return null;\n }\n var str = s.replace(/^\\s\\s*/, ''), ws = /\\s/, i = str.length;\n while (ws.test(str.charAt(--i))) {\n }\n return str.slice(0, i + 1);\n }\n jsPlumbUtil.fastTrim = fastTrim;\n function each(obj, fn) {\n obj = obj.length == null || typeof obj === \"string\" ? [obj] : obj;\n for (var i = 0; i < obj.length; i++) {\n fn(obj[i]);\n }\n }\n jsPlumbUtil.each = each;\n function map(obj, fn) {\n var o = [];\n for (var i = 0; i < obj.length; i++) {\n o.push(fn(obj[i]));\n }\n return o;\n }\n jsPlumbUtil.map = map;\n function mergeWithParents(type, map, parentAttribute) {\n parentAttribute = parentAttribute || \"parent\";\n var _def = function (id) {\n return id ? map[id] : null;\n };\n var _parent = function (def) {\n return def ? _def(def[parentAttribute]) : null;\n };\n var _one = function (parent, def) {\n if (parent == null) {\n return def;\n }\n else {\n var d_1 = merge(parent, def);\n return _one(_parent(parent), d_1);\n }\n };\n var _getDef = function (t) {\n if (t == null) {\n return {};\n }\n if (typeof t === \"string\") {\n return _def(t);\n }\n else if (t.length) {\n var done = false, i = 0, _dd = void 0;\n while (!done && i < t.length) {\n _dd = _getDef(t[i]);\n if (_dd) {\n done = true;\n }\n else {\n i++;\n }\n }\n return _dd;\n }\n };\n var d = _getDef(type);\n if (d) {\n return _one(_parent(d), d);\n }\n else {\n return {};\n }\n }\n jsPlumbUtil.mergeWithParents = mergeWithParents;\n jsPlumbUtil.logEnabled = true;\n function log() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (jsPlumbUtil.logEnabled && typeof console !== \"undefined\") {\n try {\n var msg = arguments[arguments.length - 1];\n console.log(msg);\n }\n catch (e) {\n }\n }\n }\n jsPlumbUtil.log = log;\n /**\n * Wraps one function with another, creating a placeholder for the\n * wrapped function if it was null. this is used to wrap the various\n * drag/drop event functions - to allow jsPlumb to be notified of\n * important lifecycle events without imposing itself on the user's\n * drag/drop functionality.\n * @method jsPlumbUtil.wrap\n * @param {Function} wrappedFunction original function to wrap; may be null.\n * @param {Function} newFunction function to wrap the original with.\n * @param {Object} [returnOnThisValue] Optional. Indicates that the wrappedFunction should\n * not be executed if the newFunction returns a value matching 'returnOnThisValue'.\n * note that this is a simple comparison and only works for primitives right now.\n */\n function wrap(wrappedFunction, newFunction, returnOnThisValue) {\n return function () {\n var r = null;\n try {\n if (newFunction != null) {\n r = newFunction.apply(this, arguments);\n }\n }\n catch (e) {\n log(\"jsPlumb function failed : \" + e);\n }\n if ((wrappedFunction != null) && (returnOnThisValue == null || (r !== returnOnThisValue))) {\n try {\n r = wrappedFunction.apply(this, arguments);\n }\n catch (e) {\n log(\"wrapped function failed : \" + e);\n }\n }\n return r;\n };\n }\n jsPlumbUtil.wrap = wrap;\n var EventGenerator = /** @class */ (function () {\n function EventGenerator() {\n var _this = this;\n this._listeners = {};\n this.eventsSuspended = false;\n this.tick = false;\n // this is a list of events that should re-throw any errors that occur during their dispatch.\n this.eventsToDieOn = { \"ready\": true };\n this.queue = [];\n this.bind = function (event, listener, insertAtStart) {\n var _one = function (evt) {\n addToList(_this._listeners, evt, listener, insertAtStart);\n listener.__jsPlumb = listener.__jsPlumb || {};\n listener.__jsPlumb[uuid()] = evt;\n };\n if (typeof event === \"string\") {\n _one(event);\n }\n else if (event.length != null) {\n for (var i = 0; i < event.length; i++) {\n _one(event[i]);\n }\n }\n return _this;\n };\n this.fire = function (event, value, originalEvent) {\n if (!this.tick) {\n this.tick = true;\n if (!this.eventsSuspended && this._listeners[event]) {\n var l = this._listeners[event].length, i = 0, _gone = false, ret = null;\n if (!this.shouldFireEvent || this.shouldFireEvent(event, value, originalEvent)) {\n while (!_gone && i < l && ret !== false) {\n // doing it this way rather than catching and then possibly re-throwing means that an error propagated by this\n // method will have the whole call stack available in the debugger.\n if (this.eventsToDieOn[event]) {\n this._listeners[event][i].apply(this, [value, originalEvent]);\n }\n else {\n try {\n ret = this._listeners[event][i].apply(this, [value, originalEvent]);\n }\n catch (e) {\n log(\"jsPlumb: fire failed for event \" + event + \" : \" + e);\n }\n }\n i++;\n if (this._listeners == null || this._listeners[event] == null) {\n _gone = true;\n }\n }\n }\n }\n this.tick = false;\n this._drain();\n }\n else {\n this.queue.unshift(arguments);\n }\n return this;\n };\n this._drain = function () {\n var n = _this.queue.pop();\n if (n) {\n _this.fire.apply(_this, n);\n }\n };\n this.unbind = function (eventOrListener, listener) {\n if (arguments.length === 0) {\n this._listeners = {};\n }\n else if (arguments.length === 1) {\n if (typeof eventOrListener === \"string\") {\n delete this._listeners[eventOrListener];\n }\n else if (eventOrListener.__jsPlumb) {\n var evt = void 0;\n for (var i in eventOrListener.__jsPlumb) {\n evt = eventOrListener.__jsPlumb[i];\n remove(this._listeners[evt] || [], eventOrListener);\n }\n }\n }\n else if (arguments.length === 2) {\n remove(this._listeners[eventOrListener] || [], listener);\n }\n return this;\n };\n this.getListener = function (forEvent) {\n return _this._listeners[forEvent];\n };\n this.setSuspendEvents = function (val) {\n _this.eventsSuspended = val;\n };\n this.isSuspendEvents = function () {\n return _this.eventsSuspended;\n };\n this.silently = function (fn) {\n _this.setSuspendEvents(true);\n try {\n fn();\n }\n catch (e) {\n log(\"Cannot execute silent function \" + e);\n }\n _this.setSuspendEvents(false);\n };\n this.cleanupListeners = function () {\n for (var i in _this._listeners) {\n _this._listeners[i] = null;\n }\n };\n }\n return EventGenerator;\n }());\n jsPlumbUtil.EventGenerator = EventGenerator;\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains utility functions that run in browsers only.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n ;(function() {\n\n \"use strict\";\n\n var root = this;\n\n root.jsPlumbUtil.matchesSelector = function(el, selector, ctx) {\n ctx = ctx || el.parentNode;\n var possibles = ctx.querySelectorAll(selector);\n for (var i = 0; i < possibles.length; i++) {\n if (possibles[i] === el) {\n return true;\n }\n }\n return false;\n };\n\n root.jsPlumbUtil.consume = function(e, doNotPreventDefault) {\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n else {\n e.returnValue = false;\n }\n\n if (!doNotPreventDefault && e.preventDefault){\n e.preventDefault();\n }\n };\n\n /*\n * Function: sizeElement\n * Helper to size and position an element. You would typically use\n * this when writing your own Connector or Endpoint implementation.\n *\n * Parameters:\n * x - [int] x position for the element origin\n * y - [int] y position for the element origin\n * w - [int] width of the element\n * h - [int] height of the element\n *\n */\n root.jsPlumbUtil.sizeElement = function(el, x, y, w, h) {\n if (el) {\n el.style.height = h + \"px\";\n el.height = h;\n el.style.width = w + \"px\";\n el.width = w;\n el.style.left = x + \"px\";\n el.style.top = y + \"px\";\n }\n };\n\n }).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the core code.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function () {\n\n \"use strict\";\n\n var root = this;\n\n var _ju = root.jsPlumbUtil,\n\n /**\n * creates a timestamp, using milliseconds since 1970, but as a string.\n */\n _timestamp = function () {\n return \"\" + (new Date()).getTime();\n },\n\n // helper method to update the hover style whenever it, or paintStyle, changes.\n // we use paintStyle as the foundation and merge hoverPaintStyle over the\n // top.\n _updateHoverStyle = function (component) {\n if (component._jsPlumb.paintStyle && component._jsPlumb.hoverPaintStyle) {\n var mergedHoverStyle = {};\n jsPlumb.extend(mergedHoverStyle, component._jsPlumb.paintStyle);\n jsPlumb.extend(mergedHoverStyle, component._jsPlumb.hoverPaintStyle);\n delete component._jsPlumb.hoverPaintStyle;\n // we want the fill of paintStyle to override a gradient, if possible.\n if (mergedHoverStyle.gradient && component._jsPlumb.paintStyle.fill) {\n delete mergedHoverStyle.gradient;\n }\n component._jsPlumb.hoverPaintStyle = mergedHoverStyle;\n }\n },\n events = [\"tap\", \"dbltap\", \"click\", \"dblclick\", \"mouseover\", \"mouseout\", \"mousemove\", \"mousedown\", \"mouseup\", \"contextmenu\" ],\n eventFilters = { \"mouseout\": \"mouseleave\", \"mouseexit\": \"mouseleave\" },\n _updateAttachedElements = function (component, state, timestamp, sourceElement) {\n var affectedElements = component.getAttachedElements();\n if (affectedElements) {\n for (var i = 0, j = affectedElements.length; i < j; i++) {\n if (!sourceElement || sourceElement !== affectedElements[i]) {\n affectedElements[i].setHover(state, true, timestamp);\t\t\t// tell the attached elements not to inform their own attached elements.\n }\n }\n }\n },\n _splitType = function (t) {\n return t == null ? null : t.split(\" \");\n },\n _mapType = function(map, obj, typeId) {\n for (var i in obj) {\n map[i] = typeId;\n }\n },\n _each = function(fn, obj) {\n obj = _ju.isArray(obj) || (obj.length != null && !_ju.isString(obj)) ? obj : [ obj ];\n for (var i = 0; i < obj.length; i++) {\n try {\n fn.apply(obj[i], [ obj[i] ]);\n }\n catch (e) {\n _ju.log(\".each iteration failed : \" + e);\n }\n }\n },\n _applyTypes = function (component, params, doNotRepaint) {\n if (component.getDefaultType) {\n var td = component.getTypeDescriptor(), map = {};\n var defType = component.getDefaultType();\n var o = _ju.merge({}, defType);\n _mapType(map, defType, \"__default\");\n for (var i = 0, j = component._jsPlumb.types.length; i < j; i++) {\n var tid = component._jsPlumb.types[i];\n if (tid !== \"__default\") {\n var _t = component._jsPlumb.instance.getType(tid, td);\n if (_t != null) {\n o = _ju.merge(o, _t, [ \"cssClass\" ], [ \"connector\" ]);\n _mapType(map, _t, tid);\n }\n }\n }\n\n if (params) {\n o = _ju.populate(o, params, \"_\");\n }\n\n component.applyType(o, doNotRepaint, map);\n if (!doNotRepaint) {\n component.repaint();\n }\n }\n },\n\n// ------------------------------ BEGIN jsPlumbUIComponent --------------------------------------------\n\n jsPlumbUIComponent = root.jsPlumbUIComponent = function (params) {\n\n _ju.EventGenerator.apply(this, arguments);\n\n var self = this,\n a = arguments,\n idPrefix = self.idPrefix,\n id = idPrefix + (new Date()).getTime();\n\n this._jsPlumb = {\n instance: params._jsPlumb,\n parameters: params.parameters || {},\n paintStyle: null,\n hoverPaintStyle: null,\n paintStyleInUse: null,\n hover: false,\n beforeDetach: params.beforeDetach,\n beforeDrop: params.beforeDrop,\n overlayPlacements: [],\n hoverClass: params.hoverClass || params._jsPlumb.Defaults.HoverClass,\n types: [],\n typeCache:{}\n };\n\n this.cacheTypeItem = function(key, item, typeId) {\n this._jsPlumb.typeCache[typeId] = this._jsPlumb.typeCache[typeId] || {};\n this._jsPlumb.typeCache[typeId][key] = item;\n };\n this.getCachedTypeItem = function(key, typeId) {\n return this._jsPlumb.typeCache[typeId] ? this._jsPlumb.typeCache[typeId][key] : null;\n };\n\n this.getId = function () {\n return id;\n };\n\n// ----------------------------- default type --------------------------------------------\n\n\n var o = params.overlays || [], oo = {};\n if (this.defaultOverlayKeys) {\n for (var i = 0; i < this.defaultOverlayKeys.length; i++) {\n Array.prototype.push.apply(o, this._jsPlumb.instance.Defaults[this.defaultOverlayKeys[i]] || []);\n }\n\n for (i = 0; i < o.length; i++) {\n // if a string, convert to object representation so that we can store the typeid on it.\n // also assign an id.\n var fo = jsPlumb.convertToFullOverlaySpec(o[i]);\n oo[fo[1].id] = fo;\n }\n }\n\n var _defaultType = {\n overlays:oo,\n parameters: params.parameters || {},\n scope: params.scope || this._jsPlumb.instance.getDefaultScope()\n };\n this.getDefaultType = function() {\n return _defaultType;\n };\n this.appendToDefaultType = function(obj) {\n for (var i in obj) {\n _defaultType[i] = obj[i];\n }\n };\n\n// ----------------------------- end default type --------------------------------------------\n\n // all components can generate events\n\n if (params.events) {\n for (var evtName in params.events) {\n self.bind(evtName, params.events[evtName]);\n }\n }\n\n // all components get this clone function.\n // TODO issue 116 showed a problem with this - it seems 'a' that is in\n // the clone function's scope is shared by all invocations of it, the classic\n // JS closure problem. for now, jsPlumb does a version of this inline where\n // it used to call clone. but it would be nice to find some time to look\n // further at this.\n this.clone = function () {\n var o = Object.create(this.constructor.prototype);\n this.constructor.apply(o, a);\n return o;\n }.bind(this);\n\n // user can supply a beforeDetach callback, which will be executed before a detach\n // is performed; returning false prevents the detach.\n this.isDetachAllowed = function (connection) {\n var r = true;\n if (this._jsPlumb.beforeDetach) {\n try {\n r = this._jsPlumb.beforeDetach(connection);\n }\n catch (e) {\n _ju.log(\"jsPlumb: beforeDetach callback failed\", e);\n }\n }\n return r;\n };\n\n // user can supply a beforeDrop callback, which will be executed before a dropped\n // connection is confirmed. user can return false to reject connection.\n this.isDropAllowed = function (sourceId, targetId, scope, connection, dropEndpoint, source, target) {\n var r = this._jsPlumb.instance.checkCondition(\"beforeDrop\", {\n sourceId: sourceId,\n targetId: targetId,\n scope: scope,\n connection: connection,\n dropEndpoint: dropEndpoint,\n source: source, target: target\n });\n if (this._jsPlumb.beforeDrop) {\n try {\n r = this._jsPlumb.beforeDrop({\n sourceId: sourceId,\n targetId: targetId,\n scope: scope,\n connection: connection,\n dropEndpoint: dropEndpoint,\n source: source, target: target\n });\n }\n catch (e) {\n _ju.log(\"jsPlumb: beforeDrop callback failed\", e);\n }\n }\n return r;\n };\n\n var domListeners = [];\n\n // sets the component associated with listener events. for instance, an overlay delegates\n // its events back to a connector. but if the connector is swapped on the underlying connection,\n // then this component must be changed. This is called by setConnector in the Connection class.\n this.setListenerComponent = function (c) {\n for (var i = 0; i < domListeners.length; i++) {\n domListeners[i][3] = c;\n }\n };\n\n\n };\n\n var _removeTypeCssHelper = function (component, typeIndex) {\n var typeId = component._jsPlumb.types[typeIndex],\n type = component._jsPlumb.instance.getType(typeId, component.getTypeDescriptor());\n\n if (type != null && type.cssClass && component.canvas) {\n component._jsPlumb.instance.removeClass(component.canvas, type.cssClass);\n }\n };\n\n _ju.extend(root.jsPlumbUIComponent, _ju.EventGenerator, {\n\n getParameter: function (name) {\n return this._jsPlumb.parameters[name];\n },\n\n setParameter: function (name, value) {\n this._jsPlumb.parameters[name] = value;\n },\n\n getParameters: function () {\n return this._jsPlumb.parameters;\n },\n\n setParameters: function (p) {\n this._jsPlumb.parameters = p;\n },\n\n getClass:function() {\n return jsPlumb.getClass(this.canvas);\n },\n\n hasClass:function(clazz) {\n return jsPlumb.hasClass(this.canvas, clazz);\n },\n\n addClass: function (clazz) {\n jsPlumb.addClass(this.canvas, clazz);\n },\n\n removeClass: function (clazz) {\n jsPlumb.removeClass(this.canvas, clazz);\n },\n\n updateClasses: function (classesToAdd, classesToRemove) {\n jsPlumb.updateClasses(this.canvas, classesToAdd, classesToRemove);\n },\n\n setType: function (typeId, params, doNotRepaint) {\n this.clearTypes();\n this._jsPlumb.types = _splitType(typeId) || [];\n _applyTypes(this, params, doNotRepaint);\n },\n\n getType: function () {\n return this._jsPlumb.types;\n },\n\n reapplyTypes: function (params, doNotRepaint) {\n _applyTypes(this, params, doNotRepaint);\n },\n\n hasType: function (typeId) {\n return this._jsPlumb.types.indexOf(typeId) !== -1;\n },\n\n addType: function (typeId, params, doNotRepaint) {\n var t = _splitType(typeId), _cont = false;\n if (t != null) {\n for (var i = 0, j = t.length; i < j; i++) {\n if (!this.hasType(t[i])) {\n this._jsPlumb.types.push(t[i]);\n _cont = true;\n }\n }\n if (_cont) {\n _applyTypes(this, params, doNotRepaint);\n }\n }\n },\n\n removeType: function (typeId, params, doNotRepaint) {\n var t = _splitType(typeId), _cont = false, _one = function (tt) {\n var idx = this._jsPlumb.types.indexOf(tt);\n if (idx !== -1) {\n // remove css class if necessary\n _removeTypeCssHelper(this, idx);\n this._jsPlumb.types.splice(idx, 1);\n return true;\n }\n return false;\n }.bind(this);\n\n if (t != null) {\n for (var i = 0, j = t.length; i < j; i++) {\n _cont = _one(t[i]) || _cont;\n }\n if (_cont) {\n _applyTypes(this, params, doNotRepaint);\n }\n }\n },\n clearTypes: function (params, doNotRepaint) {\n var i = this._jsPlumb.types.length;\n for (var j = 0; j < i; j++) {\n _removeTypeCssHelper(this, 0);\n this._jsPlumb.types.splice(0, 1);\n }\n _applyTypes(this, params, doNotRepaint);\n },\n\n toggleType: function (typeId, params, doNotRepaint) {\n var t = _splitType(typeId);\n if (t != null) {\n for (var i = 0, j = t.length; i < j; i++) {\n var idx = this._jsPlumb.types.indexOf(t[i]);\n if (idx !== -1) {\n _removeTypeCssHelper(this, idx);\n this._jsPlumb.types.splice(idx, 1);\n }\n else {\n this._jsPlumb.types.push(t[i]);\n }\n }\n\n _applyTypes(this, params, doNotRepaint);\n }\n },\n applyType: function (t, doNotRepaint) {\n this.setPaintStyle(t.paintStyle, doNotRepaint);\n this.setHoverPaintStyle(t.hoverPaintStyle, doNotRepaint);\n if (t.parameters) {\n for (var i in t.parameters) {\n this.setParameter(i, t.parameters[i]);\n }\n }\n this._jsPlumb.paintStyleInUse = this.getPaintStyle();\n },\n setPaintStyle: function (style, doNotRepaint) {\n // this._jsPlumb.paintStyle = jsPlumb.extend({}, style);\n // TODO figure out if we want components to clone paintStyle so as not to share it.\n this._jsPlumb.paintStyle = style;\n this._jsPlumb.paintStyleInUse = this._jsPlumb.paintStyle;\n _updateHoverStyle(this);\n if (!doNotRepaint) {\n this.repaint();\n }\n },\n getPaintStyle: function () {\n return this._jsPlumb.paintStyle;\n },\n setHoverPaintStyle: function (style, doNotRepaint) {\n //this._jsPlumb.hoverPaintStyle = jsPlumb.extend({}, style);\n // TODO figure out if we want components to clone paintStyle so as not to share it.\n this._jsPlumb.hoverPaintStyle = style;\n _updateHoverStyle(this);\n if (!doNotRepaint) {\n this.repaint();\n }\n },\n getHoverPaintStyle: function () {\n return this._jsPlumb.hoverPaintStyle;\n },\n destroy: function (force) {\n if (force || this.typeId == null) {\n this.cleanupListeners(); // this is on EventGenerator\n this.clone = null;\n this._jsPlumb = null;\n }\n },\n\n isHover: function () {\n return this._jsPlumb.hover;\n },\n\n setHover: function (hover, ignoreAttachedElements, timestamp) {\n // while dragging, we ignore these events. this keeps the UI from flashing and\n // swishing and whatevering.\n if (this._jsPlumb && !this._jsPlumb.instance.currentlyDragging && !this._jsPlumb.instance.isHoverSuspended()) {\n\n this._jsPlumb.hover = hover;\n var method = hover ? \"addClass\" : \"removeClass\";\n\n if (this.canvas != null) {\n if (this._jsPlumb.instance.hoverClass != null) {\n this._jsPlumb.instance[method](this.canvas, this._jsPlumb.instance.hoverClass);\n }\n if (this._jsPlumb.hoverClass != null) {\n this._jsPlumb.instance[method](this.canvas, this._jsPlumb.hoverClass);\n }\n }\n if (this._jsPlumb.hoverPaintStyle != null) {\n this._jsPlumb.paintStyleInUse = hover ? this._jsPlumb.hoverPaintStyle : this._jsPlumb.paintStyle;\n if (!this._jsPlumb.instance.isSuspendDrawing()) {\n timestamp = timestamp || _timestamp();\n this.repaint({timestamp: timestamp, recalc: false});\n }\n }\n // get the list of other affected elements, if supported by this component.\n // for a connection, its the endpoints. for an endpoint, its the connections! surprise.\n if (this.getAttachedElements && !ignoreAttachedElements) {\n _updateAttachedElements(this, hover, _timestamp(), this);\n }\n }\n }\n });\n\n// ------------------------------ END jsPlumbUIComponent --------------------------------------------\n\n var _jsPlumbInstanceIndex = 0,\n getInstanceIndex = function () {\n var i = _jsPlumbInstanceIndex + 1;\n _jsPlumbInstanceIndex++;\n return i;\n };\n\n var jsPlumbInstance = root.jsPlumbInstance = function (_defaults) {\n\n this.version = \"2.9.0\";\n\n this.Defaults = {\n Anchor: \"Bottom\",\n Anchors: [ null, null ],\n ConnectionsDetachable: true,\n ConnectionOverlays: [ ],\n Connector: \"Bezier\",\n Container: null,\n DoNotThrowErrors: false,\n DragOptions: { },\n DropOptions: { },\n Endpoint: \"Dot\",\n EndpointOverlays: [ ],\n Endpoints: [ null, null ],\n EndpointStyle: { fill: \"#456\" },\n EndpointStyles: [ null, null ],\n EndpointHoverStyle: null,\n EndpointHoverStyles: [ null, null ],\n HoverPaintStyle: null,\n LabelStyle: { color: \"black\" },\n LogEnabled: false,\n Overlays: [ ],\n MaxConnections: 1,\n PaintStyle: { \"stroke-width\": 4, stroke: \"#456\" },\n ReattachConnections: false,\n RenderMode: \"svg\",\n Scope: \"jsPlumb_DefaultScope\"\n };\n\n if (_defaults) {\n jsPlumb.extend(this.Defaults, _defaults);\n }\n\n this.logEnabled = this.Defaults.LogEnabled;\n this._connectionTypes = {};\n this._endpointTypes = {};\n\n _ju.EventGenerator.apply(this);\n\n var _currentInstance = this,\n _instanceIndex = getInstanceIndex(),\n _bb = _currentInstance.bind,\n _initialDefaults = {},\n _zoom = 1,\n _info = function (el) {\n if (el == null) {\n return null;\n }\n else if (el.nodeType === 3 || el.nodeType === 8) {\n return { el:el, text:true };\n }\n else {\n var _el = _currentInstance.getElement(el);\n return { el: _el, id: (_ju.isString(el) && _el == null) ? el : _getId(_el) };\n }\n };\n\n this.getInstanceIndex = function () {\n return _instanceIndex;\n };\n\n // CONVERTED\n this.setZoom = function (z, repaintEverything) {\n _zoom = z;\n _currentInstance.fire(\"zoom\", _zoom);\n if (repaintEverything) {\n _currentInstance.repaintEverything();\n }\n return true;\n };\n // CONVERTED\n this.getZoom = function () {\n return _zoom;\n };\n\n for (var i in this.Defaults) {\n _initialDefaults[i] = this.Defaults[i];\n }\n\n var _container, _containerDelegations = [];\n this.unbindContainer = function() {\n if (_container != null && _containerDelegations.length > 0) {\n for (var i = 0; i < _containerDelegations.length; i++) {\n _currentInstance.off(_container, _containerDelegations[i][0], _containerDelegations[i][1]);\n }\n }\n };\n this.setContainer = function (c) {\n\n this.unbindContainer();\n\n // get container as dom element.\n c = this.getElement(c);\n // move existing connections and endpoints, if any.\n this.select().each(function (conn) {\n conn.moveParent(c);\n });\n this.selectEndpoints().each(function (ep) {\n ep.moveParent(c);\n });\n\n // set container.\n var previousContainer = _container;\n _container = c;\n _containerDelegations.length = 0;\n var eventAliases = {\n \"endpointclick\":\"endpointClick\",\n \"endpointdblclick\":\"endpointDblClick\"\n };\n\n var _oneDelegateHandler = function (id, e, componentType) {\n var t = e.srcElement || e.target,\n jp = (t && t.parentNode ? t.parentNode._jsPlumb : null) || (t ? t._jsPlumb : null) || (t && t.parentNode && t.parentNode.parentNode ? t.parentNode.parentNode._jsPlumb : null);\n if (jp) {\n jp.fire(id, jp, e);\n var alias = componentType ? eventAliases[componentType + id] || id : id;\n // jsplumb also fires every event coming from components/overlays. That's what the test for `jp.component` is for.\n _currentInstance.fire(alias, jp.component || jp, e);\n }\n };\n\n var _addOneDelegate = function(eventId, selector, fn) {\n _containerDelegations.push([eventId, fn]);\n _currentInstance.on(_container, eventId, selector, fn);\n };\n\n // delegate one event on the container to jsplumb elements. it might be possible to\n // abstract this out: each of endpoint, connection and overlay could register themselves with\n // jsplumb as \"component types\" or whatever, and provide a suitable selector. this would be\n // done by the renderer (although admittedly from 2.0 onwards we're not supporting vml anymore)\n var _oneDelegate = function (id) {\n // connections.\n _addOneDelegate(id, \".jtk-connector\", function (e) {\n _oneDelegateHandler(id, e);\n });\n // endpoints. note they can have an enclosing div, or not.\n _addOneDelegate(id, \".jtk-endpoint\", function (e) {\n _oneDelegateHandler(id, e, \"endpoint\");\n });\n // overlays\n _addOneDelegate(id, \".jtk-overlay\", function (e) {\n _oneDelegateHandler(id, e);\n });\n };\n\n for (var i = 0; i < events.length; i++) {\n _oneDelegate(events[i]);\n }\n\n // managed elements\n for (var elId in managedElements) {\n var el = managedElements[elId].el;\n if (el.parentNode === previousContainer) {\n previousContainer.removeChild(el);\n _container.appendChild(el);\n }\n }\n\n };\n this.getContainer = function () {\n return _container;\n };\n\n this.bind = function (event, fn) {\n if (\"ready\" === event && initialized) {\n fn();\n }\n else {\n _bb.apply(_currentInstance, [event, fn]);\n }\n };\n\n _currentInstance.importDefaults = function (d) {\n for (var i in d) {\n _currentInstance.Defaults[i] = d[i];\n }\n if (d.Container) {\n _currentInstance.setContainer(d.Container);\n }\n\n return _currentInstance;\n };\n\n _currentInstance.restoreDefaults = function () {\n _currentInstance.Defaults = jsPlumb.extend({}, _initialDefaults);\n return _currentInstance;\n };\n\n var log = null,\n initialized = false,\n // TODO remove from window scope\n connections = [],\n // map of element id -> endpoint lists. an element can have an arbitrary\n // number of endpoints on it, and not all of them have to be connected\n // to anything.\n endpointsByElement = {},\n endpointsByUUID = {},\n managedElements = {},\n offsets = {},\n offsetTimestamps = {},\n draggableStates = {},\n connectionBeingDragged = false,\n sizes = [],\n _suspendDrawing = false,\n _suspendedAt = null,\n DEFAULT_SCOPE = this.Defaults.Scope,\n _curIdStamp = 1,\n _idstamp = function () {\n return \"\" + _curIdStamp++;\n },\n\n //\n // appends an element to some other element, which is calculated as follows:\n //\n // 1. if Container exists, use that element.\n // 2. if the 'parent' parameter exists, use that.\n // 3. otherwise just use the root element.\n //\n //\n _appendElement = function (el, parent) {\n if (_container) {\n _container.appendChild(el);\n }\n else if (!parent) {\n this.appendToRoot(el);\n }\n else {\n this.getElement(parent).appendChild(el);\n }\n }.bind(this),\n\n //\n // Draws an endpoint and its connections. this is the main entry point into drawing connections as well\n // as endpoints, since jsPlumb is endpoint-centric under the hood.\n //\n // @param element element to draw (of type library specific element object)\n // @param ui UI object from current library's event system. optional.\n // @param timestamp timestamp for this paint cycle. used to speed things up a little by cutting down the amount of offset calculations we do.\n // @param clearEdits defaults to false; indicates that mouse edits for connectors should be cleared\n ///\n _draw = function (element, ui, timestamp, clearEdits) {\n\n if (!_suspendDrawing) {\n var id = _getId(element),\n repaintEls,\n dm = _currentInstance.getDragManager();\n\n if (dm) {\n repaintEls = dm.getElementsForDraggable(id);\n }\n\n if (timestamp == null) {\n timestamp = _timestamp();\n }\n\n // update the offset of everything _before_ we try to draw anything.\n var o = _updateOffset({ elId: id, offset: ui, recalc: false, timestamp: timestamp });\n\n if (repaintEls && o && o.o) {\n for (var i in repaintEls) {\n _updateOffset({\n elId: repaintEls[i].id,\n offset: {\n left: o.o.left + repaintEls[i].offset.left,\n top: o.o.top + repaintEls[i].offset.top\n },\n recalc: false,\n timestamp: timestamp\n });\n }\n }\n\n _currentInstance.anchorManager.redraw(id, ui, timestamp, null, clearEdits);\n\n if (repaintEls) {\n for (var j in repaintEls) {\n _currentInstance.anchorManager.redraw(repaintEls[j].id, ui, timestamp, repaintEls[j].offset, clearEdits, true);\n }\n }\n }\n },\n\n //\n // gets an Endpoint by uuid.\n //\n _getEndpoint = function (uuid) {\n return endpointsByUUID[uuid];\n },\n\n /**\n * inits a draggable if it's not already initialised.\n * TODO: somehow abstract this to the adapter, because the concept of \"draggable\" has no\n * place on the server.\n */\n\n\n _scopeMatch = function (e1, e2) {\n var s1 = e1.scope.split(/\\s/), s2 = e2.scope.split(/\\s/);\n for (var i = 0; i < s1.length; i++) {\n for (var j = 0; j < s2.length; j++) {\n if (s2[j] === s1[i]) {\n return true;\n }\n }\n }\n\n return false;\n },\n\n _mergeOverrides = function (def, values) {\n var m = jsPlumb.extend({}, def);\n for (var i in values) {\n if (values[i]) {\n m[i] = values[i];\n }\n }\n return m;\n },\n\n /*\n * prepares a final params object that can be passed to _newConnection, taking into account defaults, events, etc.\n */\n _prepareConnectionParams = function (params, referenceParams) {\n var _p = jsPlumb.extend({ }, params);\n if (referenceParams) {\n jsPlumb.extend(_p, referenceParams);\n }\n\n // hotwire endpoints passed as source or target to sourceEndpoint/targetEndpoint, respectively.\n if (_p.source) {\n if (_p.source.endpoint) {\n _p.sourceEndpoint = _p.source;\n }\n else {\n _p.source = _currentInstance.getElement(_p.source);\n }\n }\n if (_p.target) {\n if (_p.target.endpoint) {\n _p.targetEndpoint = _p.target;\n }\n else {\n _p.target = _currentInstance.getElement(_p.target);\n }\n }\n\n // test for endpoint uuids to connect\n if (params.uuids) {\n _p.sourceEndpoint = _getEndpoint(params.uuids[0]);\n _p.targetEndpoint = _getEndpoint(params.uuids[1]);\n }\n\n // now ensure that if we do have Endpoints already, they're not full.\n // source:\n if (_p.sourceEndpoint && _p.sourceEndpoint.isFull()) {\n _ju.log(_currentInstance, \"could not add connection; source endpoint is full\");\n return;\n }\n\n // target:\n if (_p.targetEndpoint && _p.targetEndpoint.isFull()) {\n _ju.log(_currentInstance, \"could not add connection; target endpoint is full\");\n return;\n }\n\n // if source endpoint mandates connection type and nothing specified in our params, use it.\n if (!_p.type && _p.sourceEndpoint) {\n _p.type = _p.sourceEndpoint.connectionType;\n }\n\n // copy in any connectorOverlays that were specified on the source endpoint.\n // it doesnt copy target endpoint overlays. i'm not sure if we want it to or not.\n if (_p.sourceEndpoint && _p.sourceEndpoint.connectorOverlays) {\n _p.overlays = _p.overlays || [];\n for (var i = 0, j = _p.sourceEndpoint.connectorOverlays.length; i < j; i++) {\n _p.overlays.push(_p.sourceEndpoint.connectorOverlays[i]);\n }\n }\n\n // scope\n if (_p.sourceEndpoint && _p.sourceEndpoint.scope) {\n _p.scope = _p.sourceEndpoint.scope;\n }\n\n // pointer events\n if (!_p[\"pointer-events\"] && _p.sourceEndpoint && _p.sourceEndpoint.connectorPointerEvents) {\n _p[\"pointer-events\"] = _p.sourceEndpoint.connectorPointerEvents;\n }\n\n\n var _addEndpoint = function (el, def, idx) {\n return _currentInstance.addEndpoint(el, _mergeOverrides(def, {\n anchor: _p.anchors ? _p.anchors[idx] : _p.anchor,\n endpoint: _p.endpoints ? _p.endpoints[idx] : _p.endpoint,\n paintStyle: _p.endpointStyles ? _p.endpointStyles[idx] : _p.endpointStyle,\n hoverPaintStyle: _p.endpointHoverStyles ? _p.endpointHoverStyles[idx] : _p.endpointHoverStyle\n }));\n };\n\n // check for makeSource/makeTarget specs.\n\n var _oneElementDef = function (type, idx, defs, matchType) {\n if (_p[type] && !_p[type].endpoint && !_p[type + \"Endpoint\"] && !_p.newConnection) {\n var tid = _getId(_p[type]), tep = defs[tid];\n\n tep = tep ? tep[matchType] : null;\n\n if (tep) {\n // if not enabled, return.\n if (!tep.enabled) {\n return false;\n }\n var newEndpoint = tep.endpoint != null && tep.endpoint._jsPlumb ? tep.endpoint : _addEndpoint(_p[type], tep.def, idx);\n if (newEndpoint.isFull()) {\n return false;\n }\n _p[type + \"Endpoint\"] = newEndpoint;\n if (!_p.scope && tep.def.scope) {\n _p.scope = tep.def.scope;\n } // provide scope if not already provided and endpoint def has one.\n if (tep.uniqueEndpoint) {\n if (!tep.endpoint) {\n tep.endpoint = newEndpoint;\n newEndpoint.setDeleteOnEmpty(false);\n }\n else {\n newEndpoint.finalEndpoint = tep.endpoint;\n }\n } else {\n newEndpoint.setDeleteOnEmpty(true);\n }\n\n //\n // copy in connector overlays if present on the source definition.\n //\n if (idx === 0 && tep.def.connectorOverlays) {\n _p.overlays = _p.overlays || [];\n Array.prototype.push.apply(_p.overlays, tep.def.connectorOverlays);\n }\n }\n }\n };\n\n if (_oneElementDef(\"source\", 0, this.sourceEndpointDefinitions, _p.type || \"default\") === false) {\n return;\n }\n if (_oneElementDef(\"target\", 1, this.targetEndpointDefinitions, _p.type || \"default\") === false) {\n return;\n }\n\n // last, ensure scopes match\n if (_p.sourceEndpoint && _p.targetEndpoint) {\n if (!_scopeMatch(_p.sourceEndpoint, _p.targetEndpoint)) {\n _p = null;\n }\n }\n\n return _p;\n }.bind(_currentInstance),\n\n _newConnection = function (params) {\n var connectionFunc = _currentInstance.Defaults.ConnectionType || _currentInstance.getDefaultConnectionType();\n\n params._jsPlumb = _currentInstance;\n params.newConnection = _newConnection;\n params.newEndpoint = _newEndpoint;\n params.endpointsByUUID = endpointsByUUID;\n params.endpointsByElement = endpointsByElement;\n params.finaliseConnection = _finaliseConnection;\n params.id = \"con_\" + _idstamp();\n var con = new connectionFunc(params);\n\n // if the connection is draggable, then maybe we need to tell the target endpoint to init the\n // dragging code. it won't run again if it already configured to be draggable.\n if (con.isDetachable()) {\n con.endpoints[0].initDraggable(\"_jsPlumbSource\");\n con.endpoints[1].initDraggable(\"_jsPlumbTarget\");\n }\n\n return con;\n },\n\n //\n // adds the connection to the backing model, fires an event if necessary and then redraws\n //\n _finaliseConnection = _currentInstance.finaliseConnection = function (jpc, params, originalEvent, doInformAnchorManager) {\n params = params || {};\n // add to list of connections (by scope).\n if (!jpc.suspendedEndpoint) {\n connections.push(jpc);\n }\n\n jpc.pending = null;\n\n // turn off isTemporarySource on the source endpoint (only viable on first draw)\n jpc.endpoints[0].isTemporarySource = false;\n\n // always inform the anchor manager\n // except that if jpc has a suspended endpoint it's not true to say the\n // connection is new; it has just (possibly) moved. the question is whether\n // to make that call here or in the anchor manager. i think perhaps here.\n if (doInformAnchorManager !== false) {\n _currentInstance.anchorManager.newConnection(jpc);\n }\n\n // force a paint\n _draw(jpc.source);\n\n // fire an event\n if (!params.doNotFireConnectionEvent && params.fireEvent !== false) {\n\n var eventArgs = {\n connection: jpc,\n source: jpc.source, target: jpc.target,\n sourceId: jpc.sourceId, targetId: jpc.targetId,\n sourceEndpoint: jpc.endpoints[0], targetEndpoint: jpc.endpoints[1]\n };\n\n _currentInstance.fire(\"connection\", eventArgs, originalEvent);\n }\n },\n\n /*\n factory method to prepare a new endpoint. this should always be used instead of creating Endpoints\n manually, since this method attaches event listeners and an id.\n */\n _newEndpoint = function (params, id) {\n var endpointFunc = _currentInstance.Defaults.EndpointType || jsPlumb.Endpoint;\n var _p = jsPlumb.extend({}, params);\n _p._jsPlumb = _currentInstance;\n _p.newConnection = _newConnection;\n _p.newEndpoint = _newEndpoint;\n _p.endpointsByUUID = endpointsByUUID;\n _p.endpointsByElement = endpointsByElement;\n _p.fireDetachEvent = fireDetachEvent;\n _p.elementId = id || _getId(_p.source);\n var ep = new endpointFunc(_p);\n ep.id = \"ep_\" + _idstamp();\n _manage(_p.elementId, _p.source);\n\n if (!jsPlumb.headless) {\n _currentInstance.getDragManager().endpointAdded(_p.source, id);\n }\n\n return ep;\n },\n\n /*\n * performs the given function operation on all the connections found\n * for the given element id; this means we find all the endpoints for\n * the given element, and then for each endpoint find the connectors\n * connected to it. then we pass each connection in to the given\n * function.\n */\n _operation = function (elId, func, endpointFunc) {\n var endpoints = endpointsByElement[elId];\n if (endpoints && endpoints.length) {\n for (var i = 0, ii = endpoints.length; i < ii; i++) {\n for (var j = 0, jj = endpoints[i].connections.length; j < jj; j++) {\n var retVal = func(endpoints[i].connections[j]);\n // if the function passed in returns true, we exit.\n // most functions return false.\n if (retVal) {\n return;\n }\n }\n if (endpointFunc) {\n endpointFunc(endpoints[i]);\n }\n }\n }\n },\n\n _setDraggable = function (element, draggable) {\n return jsPlumb.each(element, function (el) {\n if (_currentInstance.isDragSupported(el)) {\n draggableStates[_currentInstance.getAttribute(el, \"id\")] = draggable;\n _currentInstance.setElementDraggable(el, draggable);\n }\n });\n },\n /*\n * private method to do the business of hiding/showing.\n *\n * @param el\n * either Id of the element in question or a library specific\n * object for the element.\n * @param state\n * String specifying a value for the css 'display' property\n * ('block' or 'none').\n */\n _setVisible = function (el, state, alsoChangeEndpoints) {\n state = state === \"block\";\n var endpointFunc = null;\n if (alsoChangeEndpoints) {\n endpointFunc = function (ep) {\n ep.setVisible(state, true, true);\n };\n }\n var info = _info(el);\n _operation(info.id, function (jpc) {\n if (state && alsoChangeEndpoints) {\n // this test is necessary because this functionality is new, and i wanted to maintain backwards compatibility.\n // this block will only set a connection to be visible if the other endpoint in the connection is also visible.\n var oidx = jpc.sourceId === info.id ? 1 : 0;\n if (jpc.endpoints[oidx].isVisible()) {\n jpc.setVisible(true);\n }\n }\n else { // the default behaviour for show, and what always happens for hide, is to just set the visibility without getting clever.\n jpc.setVisible(state);\n }\n }, endpointFunc);\n },\n /**\n * private method to do the business of toggling hiding/showing.\n */\n _toggleVisible = function (elId, changeEndpoints) {\n var endpointFunc = null;\n if (changeEndpoints) {\n endpointFunc = function (ep) {\n var state = ep.isVisible();\n ep.setVisible(!state);\n };\n }\n _operation(elId, function (jpc) {\n var state = jpc.isVisible();\n jpc.setVisible(!state);\n }, endpointFunc);\n },\n\n // TODO comparison performance\n _getCachedData = function (elId) {\n var o = offsets[elId];\n if (!o) {\n return _updateOffset({elId: elId});\n }\n else {\n return {o: o, s: sizes[elId]};\n }\n },\n\n /**\n * gets an id for the given element, creating and setting one if\n * necessary. the id is of the form\n *\n * jsPlumb__\n *\n * where \"index in instance\" is a monotonically increasing integer that starts at 0,\n * for each instance. this method is used not only to assign ids to elements that do not\n * have them but also to connections and endpoints.\n */\n _getId = function (element, uuid, doNotCreateIfNotFound) {\n if (_ju.isString(element)) {\n return element;\n }\n if (element == null) {\n return null;\n }\n var id = _currentInstance.getAttribute(element, \"id\");\n if (!id || id === \"undefined\") {\n // check if fixed uuid parameter is given\n if (arguments.length === 2 && arguments[1] !== undefined) {\n id = uuid;\n }\n else if (arguments.length === 1 || (arguments.length === 3 && !arguments[2])) {\n id = \"jsPlumb_\" + _instanceIndex + \"_\" + _idstamp();\n }\n\n if (!doNotCreateIfNotFound) {\n _currentInstance.setAttribute(element, \"id\", id);\n }\n }\n return id;\n };\n\n this.setConnectionBeingDragged = function (v) {\n connectionBeingDragged = v;\n };\n this.isConnectionBeingDragged = function () {\n return connectionBeingDragged;\n };\n\n /**\n * Returns a map of all the elements this jsPlumbInstance is currently managing.\n * @returns {Object} Map of [id-> {el, endpoint[], connection, position}] information.\n */\n this.getManagedElements = function() {\n return managedElements;\n };\n\n this.connectorClass = \"jtk-connector\";\n this.connectorOutlineClass = \"jtk-connector-outline\";\n this.connectedClass = \"jtk-connected\";\n this.hoverClass = \"jtk-hover\";\n this.endpointClass = \"jtk-endpoint\";\n this.endpointConnectedClass = \"jtk-endpoint-connected\";\n this.endpointFullClass = \"jtk-endpoint-full\";\n this.endpointDropAllowedClass = \"jtk-endpoint-drop-allowed\";\n this.endpointDropForbiddenClass = \"jtk-endpoint-drop-forbidden\";\n this.overlayClass = \"jtk-overlay\";\n this.draggingClass = \"jtk-dragging\";// CONVERTED\n this.elementDraggingClass = \"jtk-element-dragging\";// CONVERTED\n this.sourceElementDraggingClass = \"jtk-source-element-dragging\"; // CONVERTED\n this.targetElementDraggingClass = \"jtk-target-element-dragging\";// CONVERTED\n this.endpointAnchorClassPrefix = \"jtk-endpoint-anchor\";\n this.hoverSourceClass = \"jtk-source-hover\";\n this.hoverTargetClass = \"jtk-target-hover\";\n this.dragSelectClass = \"jtk-drag-select\";\n\n this.Anchors = {};\n this.Connectors = { \"svg\": {} };\n this.Endpoints = { \"svg\": {} };\n this.Overlays = { \"svg\": {} } ;\n this.ConnectorRenderers = {};\n this.SVG = \"svg\";\n\n// --------------------------- jsPlumbInstance public API ---------------------------------------------------------\n\n\n this.addEndpoint = function (el, params, referenceParams) {\n referenceParams = referenceParams || {};\n var p = jsPlumb.extend({}, referenceParams);\n jsPlumb.extend(p, params);\n p.endpoint = p.endpoint || _currentInstance.Defaults.Endpoint;\n p.paintStyle = p.paintStyle || _currentInstance.Defaults.EndpointStyle;\n\n var results = [],\n inputs = (_ju.isArray(el) || (el.length != null && !_ju.isString(el))) ? el : [ el ];\n\n for (var i = 0, j = inputs.length; i < j; i++) {\n p.source = _currentInstance.getElement(inputs[i]);\n _ensureContainer(p.source);\n\n var id = _getId(p.source), e = _newEndpoint(p, id);\n\n // ensure element is managed.\n var myOffset = _manage(id, p.source).info.o;\n _ju.addToList(endpointsByElement, id, e);\n\n if (!_suspendDrawing) {\n e.paint({\n anchorLoc: e.anchor.compute({ xy: [ myOffset.left, myOffset.top ], wh: sizes[id], element: e, timestamp: _suspendedAt }),\n timestamp: _suspendedAt\n });\n }\n\n results.push(e);\n }\n\n return results.length === 1 ? results[0] : results;\n };\n\n this.addEndpoints = function (el, endpoints, referenceParams) {\n var results = [];\n for (var i = 0, j = endpoints.length; i < j; i++) {\n var e = _currentInstance.addEndpoint(el, endpoints[i], referenceParams);\n if (_ju.isArray(e)) {\n Array.prototype.push.apply(results, e);\n }\n else {\n results.push(e);\n }\n }\n return results;\n };\n\n this.animate = function (el, properties, options) {\n if (!this.animationSupported) {\n return false;\n }\n\n options = options || {};\n var del = _currentInstance.getElement(el),\n id = _getId(del),\n stepFunction = jsPlumb.animEvents.step,\n completeFunction = jsPlumb.animEvents.complete;\n\n options[stepFunction] = _ju.wrap(options[stepFunction], function () {\n _currentInstance.revalidate(id);\n });\n\n // onComplete repaints, just to make sure everything looks good at the end of the animation.\n options[completeFunction] = _ju.wrap(options[completeFunction], function () {\n _currentInstance.revalidate(id);\n });\n\n _currentInstance.doAnimate(del, properties, options);\n };\n\n /**\n * checks for a listener for the given condition, executing it if found, passing in the given value.\n * condition listeners would have been attached using \"bind\" (which is, you could argue, now overloaded, since\n * firing click events etc is a bit different to what this does). i thought about adding a \"bindCondition\"\n * or something, but decided against it, for the sake of simplicity. jsPlumb will never fire one of these\n * condition events anyway.\n */\n this.checkCondition = function (conditionName, args) {\n var l = _currentInstance.getListener(conditionName),\n r = true;\n\n if (l && l.length > 0) {\n var values = Array.prototype.slice.call(arguments, 1);\n try {\n for (var i = 0, j = l.length; i < j; i++) {\n r = r && l[i].apply(l[i], values);\n }\n }\n catch (e) {\n _ju.log(_currentInstance, \"cannot check condition [\" + conditionName + \"]\" + e);\n }\n }\n return r;\n };\n\n this.connect = function (params, referenceParams) {\n // prepare a final set of parameters to create connection with\n var _p = _prepareConnectionParams(params, referenceParams), jpc;\n // TODO probably a nicer return value if the connection was not made. _prepareConnectionParams\n // will return null (and log something) if either endpoint was full. what would be nicer is to\n // create a dedicated 'error' object.\n if (_p) {\n if (_p.source == null && _p.sourceEndpoint == null) {\n _ju.log(\"Cannot establish connection - source does not exist\");\n return;\n }\n if (_p.target == null && _p.targetEndpoint == null) {\n _ju.log(\"Cannot establish connection - target does not exist\");\n return;\n }\n _ensureContainer(_p.source);\n // create the connection. it is not yet registered\n jpc = _newConnection(_p);\n // now add it the model, fire an event, and redraw\n _finaliseConnection(jpc, _p);\n }\n return jpc;\n };\n\n var stTypes = [\n { el: \"source\", elId: \"sourceId\", epDefs: \"sourceEndpointDefinitions\" },\n { el: \"target\", elId: \"targetId\", epDefs: \"targetEndpointDefinitions\" }\n ];\n\n var _set = function (c, el, idx, doNotRepaint) {\n var ep, _st = stTypes[idx], cId = c[_st.elId], cEl = c[_st.el], sid, sep,\n oldEndpoint = c.endpoints[idx];\n\n var evtParams = {\n index: idx,\n originalSourceId: idx === 0 ? cId : c.sourceId,\n newSourceId: c.sourceId,\n originalTargetId: idx === 1 ? cId : c.targetId,\n newTargetId: c.targetId,\n connection: c\n };\n\n if (el.constructor === jsPlumb.Endpoint) {\n ep = el;\n ep.addConnection(c);\n el = ep.element;\n }\n else {\n sid = _getId(el);\n sep = this[_st.epDefs][sid];\n\n if (sid === c[_st.elId]) {\n ep = null; // dont change source/target if the element is already the one given.\n }\n else if (sep) {\n for (var t in sep) {\n if (!sep[t].enabled) {\n return;\n }\n ep = sep[t].endpoint != null && sep[t].endpoint._jsPlumb ? sep[t].endpoint : this.addEndpoint(el, sep[t].def);\n if (sep[t].uniqueEndpoint) {\n sep[t].endpoint = ep;\n }\n ep.addConnection(c);\n }\n }\n else {\n ep = c.makeEndpoint(idx === 0, el, sid);\n }\n }\n\n if (ep != null) {\n oldEndpoint.detachFromConnection(c);\n c.endpoints[idx] = ep;\n c[_st.el] = ep.element;\n c[_st.elId] = ep.elementId;\n evtParams[idx === 0 ? \"newSourceId\" : \"newTargetId\"] = ep.elementId;\n\n fireMoveEvent(evtParams);\n\n if (!doNotRepaint) {\n c.repaint();\n }\n }\n\n evtParams.element = el;\n return evtParams;\n\n }.bind(this);\n\n this.setSource = function (connection, el, doNotRepaint) {\n var p = _set(connection, el, 0, doNotRepaint);\n this.anchorManager.sourceChanged(p.originalSourceId, p.newSourceId, connection, p.el);\n };\n this.setTarget = function (connection, el, doNotRepaint) {\n var p = _set(connection, el, 1, doNotRepaint);\n this.anchorManager.updateOtherEndpoint(p.originalSourceId, p.originalTargetId, p.newTargetId, connection);\n };\n\n this.deleteEndpoint = function (object, dontUpdateHover, deleteAttachedObjects) {\n var endpoint = (typeof object === \"string\") ? endpointsByUUID[object] : object;\n if (endpoint) {\n _currentInstance.deleteObject({ endpoint: endpoint, dontUpdateHover: dontUpdateHover, deleteAttachedObjects:deleteAttachedObjects });\n }\n return _currentInstance;\n };\n\n this.deleteEveryEndpoint = function () {\n var _is = _currentInstance.setSuspendDrawing(true);\n for (var id in endpointsByElement) {\n var endpoints = endpointsByElement[id];\n if (endpoints && endpoints.length) {\n for (var i = 0, j = endpoints.length; i < j; i++) {\n _currentInstance.deleteEndpoint(endpoints[i], true);\n }\n }\n }\n endpointsByElement = {};\n managedElements = {};\n endpointsByUUID = {};\n offsets = {};\n offsetTimestamps = {};\n _currentInstance.anchorManager.reset();\n var dm = _currentInstance.getDragManager();\n if (dm) {\n dm.reset();\n }\n if (!_is) {\n _currentInstance.setSuspendDrawing(false);\n }\n return _currentInstance;\n };\n\n var fireDetachEvent = function (jpc, doFireEvent, originalEvent) {\n // may have been given a connection, or in special cases, an object\n var connType = _currentInstance.Defaults.ConnectionType || _currentInstance.getDefaultConnectionType(),\n argIsConnection = jpc.constructor === connType,\n params = argIsConnection ? {\n connection: jpc,\n source: jpc.source, target: jpc.target,\n sourceId: jpc.sourceId, targetId: jpc.targetId,\n sourceEndpoint: jpc.endpoints[0], targetEndpoint: jpc.endpoints[1]\n } : jpc;\n\n if (doFireEvent) {\n _currentInstance.fire(\"connectionDetached\", params, originalEvent);\n }\n\n // always fire this. used by internal jsplumb stuff.\n _currentInstance.fire(\"internal.connectionDetached\", params, originalEvent);\n\n _currentInstance.anchorManager.connectionDetached(params);\n };\n\n var fireMoveEvent = _currentInstance.fireMoveEvent = function (params, evt) {\n _currentInstance.fire(\"connectionMoved\", params, evt);\n };\n\n this.unregisterEndpoint = function (endpoint) {\n if (endpoint._jsPlumb.uuid) {\n endpointsByUUID[endpoint._jsPlumb.uuid] = null;\n }\n _currentInstance.anchorManager.deleteEndpoint(endpoint);\n // TODO at least replace this with a removeWithFunction call.\n for (var e in endpointsByElement) {\n var endpoints = endpointsByElement[e];\n if (endpoints) {\n var newEndpoints = [];\n for (var i = 0, j = endpoints.length; i < j; i++) {\n if (endpoints[i] !== endpoint) {\n newEndpoints.push(endpoints[i]);\n }\n }\n\n endpointsByElement[e] = newEndpoints;\n }\n if (endpointsByElement[e].length < 1) {\n delete endpointsByElement[e];\n }\n }\n };\n\n var IS_DETACH_ALLOWED = \"isDetachAllowed\";\n var BEFORE_DETACH = \"beforeDetach\";\n var CHECK_CONDITION = \"checkCondition\";\n\n /**\n * Deletes a Connection.\n * @method deleteConnection\n * @param connection Connection to delete\n * @param {Object} [params] Optional delete parameters\n * @param {Boolean} [params.doNotFireEvent=false] If true, a connection detached event will not be fired. Otherwise one will.\n * @param {Boolean} [params.force=false] If true, the connection will be deleted even if a beforeDetach interceptor tries to stop the deletion.\n * @returns {Boolean} True if the connection was deleted, false otherwise.\n */\n this.deleteConnection = function(connection, params) {\n\n if (connection != null) {\n params = params || {};\n\n if (params.force || _ju.functionChain(true, false, [\n [ connection.endpoints[0], IS_DETACH_ALLOWED, [ connection ] ],\n [ connection.endpoints[1], IS_DETACH_ALLOWED, [ connection ] ],\n [ connection, IS_DETACH_ALLOWED, [ connection ] ],\n [ _currentInstance, CHECK_CONDITION, [ BEFORE_DETACH, connection ] ]\n ])) {\n\n connection.setHover(false);\n fireDetachEvent(connection, !connection.pending && params.fireEvent !== false, params.originalEvent);\n\n connection.endpoints[0].detachFromConnection(connection);\n connection.endpoints[1].detachFromConnection(connection);\n _ju.removeWithFunction(connections, function (_c) {\n return connection.id === _c.id;\n });\n\n connection.cleanup();\n connection.destroy();\n return true;\n }\n }\n return false;\n };\n\n /**\n * Remove all Connections from all elements, but leaves Endpoints in place ((unless a connection is set to auto delete its Endpoints).\n * @method deleteEveryConnection\n * @param {Object} [params] optional params object for the call\n * @param {Boolean} [params.fireEvent=true] Whether or not to fire detach events\n * @param {Boolean} [params.forceDetach=false] If true, this call will ignore any `beforeDetach` interceptors.\n * @returns {Number} The number of connections that were deleted.\n */\n this.deleteEveryConnection = function (params) {\n params = params || {};\n var count = connections.length, deletedCount = 0;\n _currentInstance.batch(function () {\n for (var i = 0; i < count; i++) {\n deletedCount += _currentInstance.deleteConnection(connections[0], params) ? 1 : 0;\n }\n });\n return deletedCount;\n };\n\n /**\n * Removes all an element's Connections.\n * @method deleteConnectionsForElement\n * @param {Object} el Either the id of the element, or a selector for the element.\n * @param {Object} [params] Optional parameters.\n * @param {Boolean} [params.fireEvent=true] Whether or not to fire the detach event.\n * @param {Boolean} [params.forceDetach=false] If true, this call will ignore any `beforeDetach` interceptors.\n * @return {jsPlumbInstance} The current jsPlumb instance.\n */\n this.deleteConnectionsForElement = function (el, params) {\n params = params || {};\n el = _currentInstance.getElement(el);\n var id = _getId(el), endpoints = endpointsByElement[id];\n if (endpoints && endpoints.length) {\n for (var i = 0, j = endpoints.length; i < j; i++) {\n endpoints[i].deleteEveryConnection(params);\n }\n }\n return _currentInstance;\n };\n\n /// not public. but of course its exposed. how to change this.\n this.deleteObject = function (params) {\n var result = {\n endpoints: {},\n connections: {},\n endpointCount: 0,\n connectionCount: 0\n },\n deleteAttachedObjects = params.deleteAttachedObjects !== false;\n\n var unravelConnection = function (connection) {\n if (connection != null && result.connections[connection.id] == null) {\n if (!params.dontUpdateHover && connection._jsPlumb != null) {\n connection.setHover(false);\n }\n result.connections[connection.id] = connection;\n result.connectionCount++;\n }\n };\n var unravelEndpoint = function (endpoint) {\n if (endpoint != null && result.endpoints[endpoint.id] == null) {\n if (!params.dontUpdateHover && endpoint._jsPlumb != null) {\n endpoint.setHover(false);\n }\n result.endpoints[endpoint.id] = endpoint;\n result.endpointCount++;\n\n if (deleteAttachedObjects) {\n for (var i = 0; i < endpoint.connections.length; i++) {\n var c = endpoint.connections[i];\n unravelConnection(c);\n }\n }\n }\n };\n\n if (params.connection) {\n unravelConnection(params.connection);\n }\n else {\n unravelEndpoint(params.endpoint);\n }\n\n // loop through connections\n for (var i in result.connections) {\n var c = result.connections[i];\n if (c._jsPlumb) {\n _ju.removeWithFunction(connections, function (_c) {\n return c.id === _c.id;\n });\n\n fireDetachEvent(c, params.fireEvent === false ? false : !c.pending, params.originalEvent);\n var doNotCleanup = params.deleteAttachedObjects == null ? null : !params.deleteAttachedObjects;\n\n c.endpoints[0].detachFromConnection(c, null, doNotCleanup);\n c.endpoints[1].detachFromConnection(c, null, doNotCleanup);\n\n c.cleanup(true);\n c.destroy(true);\n }\n }\n\n // loop through endpoints\n for (var j in result.endpoints) {\n var e = result.endpoints[j];\n if (e._jsPlumb) {\n _currentInstance.unregisterEndpoint(e);\n // FIRE some endpoint deleted event?\n e.cleanup(true);\n e.destroy(true);\n }\n }\n\n return result;\n };\n\n\n // helpers for select/selectEndpoints\n var _setOperation = function (list, func, args, selector) {\n for (var i = 0, j = list.length; i < j; i++) {\n list[i][func].apply(list[i], args);\n }\n return selector(list);\n },\n _getOperation = function (list, func, args) {\n var out = [];\n for (var i = 0, j = list.length; i < j; i++) {\n out.push([ list[i][func].apply(list[i], args), list[i] ]);\n }\n return out;\n },\n setter = function (list, func, selector) {\n return function () {\n return _setOperation(list, func, arguments, selector);\n };\n },\n getter = function (list, func) {\n return function () {\n return _getOperation(list, func, arguments);\n };\n },\n prepareList = function (input, doNotGetIds) {\n var r = [];\n if (input) {\n if (typeof input === 'string') {\n if (input === \"*\") {\n return input;\n }\n r.push(input);\n }\n else {\n if (doNotGetIds) {\n r = input;\n }\n else {\n if (input.length) {\n for (var i = 0, j = input.length; i < j; i++) {\n r.push(_info(input[i]).id);\n }\n }\n else {\n r.push(_info(input).id);\n }\n }\n }\n }\n return r;\n },\n filterList = function (list, value, missingIsFalse) {\n if (list === \"*\") {\n return true;\n }\n return list.length > 0 ? list.indexOf(value) !== -1 : !missingIsFalse;\n };\n\n // get some connections, specifying source/target/scope\n this.getConnections = function (options, flat) {\n if (!options) {\n options = {};\n } else if (options.constructor === String) {\n options = { \"scope\": options };\n }\n var scope = options.scope || _currentInstance.getDefaultScope(),\n scopes = prepareList(scope, true),\n sources = prepareList(options.source),\n targets = prepareList(options.target),\n results = (!flat && scopes.length > 1) ? {} : [],\n _addOne = function (scope, obj) {\n if (!flat && scopes.length > 1) {\n var ss = results[scope];\n if (ss == null) {\n ss = results[scope] = [];\n }\n ss.push(obj);\n } else {\n results.push(obj);\n }\n };\n\n for (var j = 0, jj = connections.length; j < jj; j++) {\n var c = connections[j],\n sourceId = c.proxies && c.proxies[0] ? c.proxies[0].originalEp.elementId : c.sourceId,\n targetId = c.proxies && c.proxies[1] ? c.proxies[1].originalEp.elementId : c.targetId;\n\n if (filterList(scopes, c.scope) && filterList(sources, sourceId) && filterList(targets, targetId)) {\n _addOne(c.scope, c);\n }\n }\n\n return results;\n };\n\n var _curryEach = function (list, executor) {\n return function (f) {\n for (var i = 0, ii = list.length; i < ii; i++) {\n f(list[i]);\n }\n return executor(list);\n };\n },\n _curryGet = function (list) {\n return function (idx) {\n return list[idx];\n };\n };\n\n var _makeCommonSelectHandler = function (list, executor) {\n var out = {\n length: list.length,\n each: _curryEach(list, executor),\n get: _curryGet(list)\n },\n setters = [\"setHover\", \"removeAllOverlays\", \"setLabel\", \"addClass\", \"addOverlay\", \"removeOverlay\",\n \"removeOverlays\", \"showOverlay\", \"hideOverlay\", \"showOverlays\", \"hideOverlays\", \"setPaintStyle\",\n \"setHoverPaintStyle\", \"setSuspendEvents\", \"setParameter\", \"setParameters\", \"setVisible\",\n \"repaint\", \"addType\", \"toggleType\", \"removeType\", \"removeClass\", \"setType\", \"bind\", \"unbind\" ],\n\n getters = [\"getLabel\", \"getOverlay\", \"isHover\", \"getParameter\", \"getParameters\", \"getPaintStyle\",\n \"getHoverPaintStyle\", \"isVisible\", \"hasType\", \"getType\", \"isSuspendEvents\" ],\n i, ii;\n\n for (i = 0, ii = setters.length; i < ii; i++) {\n out[setters[i]] = setter(list, setters[i], executor);\n }\n\n for (i = 0, ii = getters.length; i < ii; i++) {\n out[getters[i]] = getter(list, getters[i]);\n }\n\n return out;\n };\n\n var _makeConnectionSelectHandler = function (list) {\n var common = _makeCommonSelectHandler(list, _makeConnectionSelectHandler);\n return jsPlumb.extend(common, {\n // setters\n setDetachable: setter(list, \"setDetachable\", _makeConnectionSelectHandler),\n setReattach: setter(list, \"setReattach\", _makeConnectionSelectHandler),\n setConnector: setter(list, \"setConnector\", _makeConnectionSelectHandler),\n delete: function () {\n for (var i = 0, ii = list.length; i < ii; i++) {\n _currentInstance.deleteConnection(list[i]);\n }\n },\n // getters\n isDetachable: getter(list, \"isDetachable\"),\n isReattach: getter(list, \"isReattach\")\n });\n };\n\n var _makeEndpointSelectHandler = function (list) {\n var common = _makeCommonSelectHandler(list, _makeEndpointSelectHandler);\n return jsPlumb.extend(common, {\n setEnabled: setter(list, \"setEnabled\", _makeEndpointSelectHandler),\n setAnchor: setter(list, \"setAnchor\", _makeEndpointSelectHandler),\n isEnabled: getter(list, \"isEnabled\"),\n deleteEveryConnection: function () {\n for (var i = 0, ii = list.length; i < ii; i++) {\n list[i].deleteEveryConnection();\n }\n },\n \"delete\": function () {\n for (var i = 0, ii = list.length; i < ii; i++) {\n _currentInstance.deleteEndpoint(list[i]);\n }\n }\n });\n };\n\n this.select = function (params) {\n params = params || {};\n params.scope = params.scope || \"*\";\n return _makeConnectionSelectHandler(params.connections || _currentInstance.getConnections(params, true));\n };\n\n this.selectEndpoints = function (params) {\n params = params || {};\n params.scope = params.scope || \"*\";\n var noElementFilters = !params.element && !params.source && !params.target,\n elements = noElementFilters ? \"*\" : prepareList(params.element),\n sources = noElementFilters ? \"*\" : prepareList(params.source),\n targets = noElementFilters ? \"*\" : prepareList(params.target),\n scopes = prepareList(params.scope, true);\n\n var ep = [];\n\n for (var el in endpointsByElement) {\n var either = filterList(elements, el, true),\n source = filterList(sources, el, true),\n sourceMatchExact = sources !== \"*\",\n target = filterList(targets, el, true),\n targetMatchExact = targets !== \"*\";\n\n // if they requested 'either' then just match scope. otherwise if they requested 'source' (not as a wildcard) then we have to match only endpoints that have isSource set to to true, and the same thing with isTarget.\n if (either || source || target) {\n inner:\n for (var i = 0, ii = endpointsByElement[el].length; i < ii; i++) {\n var _ep = endpointsByElement[el][i];\n if (filterList(scopes, _ep.scope, true)) {\n\n var noMatchSource = (sourceMatchExact && sources.length > 0 && !_ep.isSource),\n noMatchTarget = (targetMatchExact && targets.length > 0 && !_ep.isTarget);\n\n if (noMatchSource || noMatchTarget) {\n continue inner;\n }\n\n ep.push(_ep);\n }\n }\n }\n }\n\n return _makeEndpointSelectHandler(ep);\n };\n\n // get all connections managed by the instance of jsplumb.\n this.getAllConnections = function () {\n return connections;\n };\n this.getDefaultScope = function () {\n return DEFAULT_SCOPE;\n };\n // get an endpoint by uuid.\n this.getEndpoint = _getEndpoint;\n /**\n * Gets the list of Endpoints for a given element.\n * @method getEndpoints\n * @param {String|Element|Selector} el The element to get endpoints for.\n * @return {Endpoint[]} An array of Endpoints for the specified element.\n */\n this.getEndpoints = function (el) {\n return endpointsByElement[_info(el).id] || [];\n };\n // gets the default endpoint type. used when subclassing. see wiki.\n this.getDefaultEndpointType = function () {\n return jsPlumb.Endpoint;\n };\n // gets the default connection type. used when subclassing. see wiki.\n this.getDefaultConnectionType = function () {\n return jsPlumb.Connection;\n };\n /*\n * Gets an element's id, creating one if necessary. really only exposed\n * for the lib-specific functionality to access; would be better to pass\n * the current instance into the lib-specific code (even though this is\n * a static call. i just don't want to expose it to the public API).\n */\n this.getId = _getId;\n this.draw = _draw;\n this.info = _info;\n\n this.appendElement = _appendElement;\n\n var _hoverSuspended = false;\n this.isHoverSuspended = function () {\n return _hoverSuspended;\n };\n this.setHoverSuspended = function (s) {\n _hoverSuspended = s;\n };\n\n // set an element's connections to be hidden\n this.hide = function (el, changeEndpoints) {\n _setVisible(el, \"none\", changeEndpoints);\n return _currentInstance;\n };\n\n // exposed for other objects to use to get a unique id.\n this.idstamp = _idstamp;\n\n // ensure that, if the current container exists, it is a DOM element and not a selector.\n // if it does not exist and `candidate` is supplied, the offset parent of that element will be set as the Container.\n // this is used to do a better default behaviour for the case that the user has not set a container:\n // addEndpoint, makeSource, makeTarget and connect all call this method with the offsetParent of the\n // element in question (for connect it is the source element). So if no container is set, it is inferred\n // to be the offsetParent of the first element the user tries to connect.\n var _ensureContainer = function (candidate) {\n if (!_container && candidate) {\n var can = _currentInstance.getElement(candidate);\n if (can.offsetParent) {\n _currentInstance.setContainer(can.offsetParent);\n }\n }\n };\n\n var _getContainerFromDefaults = function () {\n if (_currentInstance.Defaults.Container) {\n _currentInstance.setContainer(_currentInstance.Defaults.Container);\n }\n };\n\n // check if a given element is managed or not. if not, add to our map. if drawing is not suspended then\n // we'll also stash its dimensions; otherwise we'll do this in a lazy way through updateOffset.\n var _manage = _currentInstance.manage = function (id, element, _transient) {\n if (!managedElements[id]) {\n managedElements[id] = {\n el: element,\n endpoints: [],\n connections: []\n };\n\n managedElements[id].info = _updateOffset({ elId: id, timestamp: _suspendedAt });\n _currentInstance.addClass(element, \"jtk-managed\");\n if (!_transient) {\n _currentInstance.fire(\"manageElement\", { id:id, info:managedElements[id].info, el:element });\n }\n }\n\n return managedElements[id];\n };\n\n var _unmanage = _currentInstance.unmanage = function(id) {\n if (managedElements[id]) {\n _currentInstance.removeClass(managedElements[id].el, \"jtk-managed\");\n delete managedElements[id];\n _currentInstance.fire(\"unmanageElement\", id);\n }\n };\n\n /**\n * updates the offset and size for a given element, and stores the\n * values. if 'offset' is not null we use that (it would have been\n * passed in from a drag call) because it's faster; but if it is null,\n * or if 'recalc' is true in order to force a recalculation, we get the current values.\n * @method updateOffset\n */\n var _updateOffset = function (params) {\n\n var timestamp = params.timestamp, recalc = params.recalc, offset = params.offset, elId = params.elId, s;\n if (_suspendDrawing && !timestamp) {\n timestamp = _suspendedAt;\n }\n if (!recalc) {\n if (timestamp && timestamp === offsetTimestamps[elId]) {\n return {o: params.offset || offsets[elId], s: sizes[elId]};\n }\n }\n if (recalc || (!offset && offsets[elId] == null)) { // if forced repaint or no offset available, we recalculate.\n\n // get the current size and offset, and store them\n s = managedElements[elId] ? managedElements[elId].el : null;\n if (s != null) {\n sizes[elId] = _currentInstance.getSize(s);\n offsets[elId] = _currentInstance.getOffset(s);\n offsetTimestamps[elId] = timestamp;\n }\n } else {\n offsets[elId] = offset || offsets[elId];\n if (sizes[elId] == null) {\n s = managedElements[elId].el;\n if (s != null) {\n sizes[elId] = _currentInstance.getSize(s);\n }\n }\n offsetTimestamps[elId] = timestamp;\n }\n\n if (offsets[elId] && !offsets[elId].right) {\n offsets[elId].right = offsets[elId].left + sizes[elId][0];\n offsets[elId].bottom = offsets[elId].top + sizes[elId][1];\n offsets[elId].width = sizes[elId][0];\n offsets[elId].height = sizes[elId][1];\n offsets[elId].centerx = offsets[elId].left + (offsets[elId].width / 2);\n offsets[elId].centery = offsets[elId].top + (offsets[elId].height / 2);\n }\n\n return {o: offsets[elId], s: sizes[elId]};\n };\n\n this.updateOffset = _updateOffset;\n\n /**\n * callback from the current library to tell us to prepare ourselves (attach\n * mouse listeners etc; can't do that until the library has provided a bind method)\n */\n this.init = function () {\n if (!initialized) {\n _getContainerFromDefaults();\n _currentInstance.anchorManager = new root.jsPlumb.AnchorManager({jsPlumbInstance: _currentInstance});\n initialized = true;\n _currentInstance.fire(\"ready\", _currentInstance);\n }\n }.bind(this);\n\n this.log = log;\n this.jsPlumbUIComponent = jsPlumbUIComponent;\n\n /*\n * Creates an anchor with the given params.\n *\n *\n * Returns: The newly created Anchor.\n * Throws: an error if a named anchor was not found.\n */\n this.makeAnchor = function () {\n var pp, _a = function (t, p) {\n if (root.jsPlumb.Anchors[t]) {\n return new root.jsPlumb.Anchors[t](p);\n }\n if (!_currentInstance.Defaults.DoNotThrowErrors) {\n throw { msg: \"jsPlumb: unknown anchor type '\" + t + \"'\" };\n }\n };\n if (arguments.length === 0) {\n return null;\n }\n var specimen = arguments[0], elementId = arguments[1], jsPlumbInstance = arguments[2], newAnchor = null;\n // if it appears to be an anchor already...\n if (specimen.compute && specimen.getOrientation) {\n return specimen;\n } //TODO hazy here about whether it should be added or is already added somehow.\n // is it the name of an anchor type?\n else if (typeof specimen === \"string\") {\n newAnchor = _a(arguments[0], {elementId: elementId, jsPlumbInstance: _currentInstance});\n }\n // is it an array? it will be one of:\n // an array of [spec, params] - this defines a single anchor, which may be dynamic, but has parameters.\n // an array of arrays - this defines some dynamic anchors\n // an array of numbers - this defines a single anchor.\n else if (_ju.isArray(specimen)) {\n if (_ju.isArray(specimen[0]) || _ju.isString(specimen[0])) {\n // if [spec, params] format\n if (specimen.length === 2 && _ju.isObject(specimen[1])) {\n // if first arg is a string, its a named anchor with params\n if (_ju.isString(specimen[0])) {\n pp = root.jsPlumb.extend({elementId: elementId, jsPlumbInstance: _currentInstance}, specimen[1]);\n newAnchor = _a(specimen[0], pp);\n }\n // otherwise first arg is array, second is params. we treat as a dynamic anchor, which is fine\n // even if the first arg has only one entry. you could argue all anchors should be implicitly dynamic in fact.\n else {\n pp = root.jsPlumb.extend({elementId: elementId, jsPlumbInstance: _currentInstance, anchors: specimen[0]}, specimen[1]);\n newAnchor = new root.jsPlumb.DynamicAnchor(pp);\n }\n }\n else {\n newAnchor = new jsPlumb.DynamicAnchor({anchors: specimen, selector: null, elementId: elementId, jsPlumbInstance: _currentInstance});\n }\n\n }\n else {\n var anchorParams = {\n x: specimen[0], y: specimen[1],\n orientation: (specimen.length >= 4) ? [ specimen[2], specimen[3] ] : [0, 0],\n offsets: (specimen.length >= 6) ? [ specimen[4], specimen[5] ] : [ 0, 0 ],\n elementId: elementId,\n jsPlumbInstance: _currentInstance,\n cssClass: specimen.length === 7 ? specimen[6] : null\n };\n newAnchor = new root.jsPlumb.Anchor(anchorParams);\n newAnchor.clone = function () {\n return new root.jsPlumb.Anchor(anchorParams);\n };\n }\n }\n\n if (!newAnchor.id) {\n newAnchor.id = \"anchor_\" + _idstamp();\n }\n return newAnchor;\n };\n\n /**\n * makes a list of anchors from the given list of types or coords, eg\n * [\"TopCenter\", \"RightMiddle\", \"BottomCenter\", [0, 1, -1, -1] ]\n */\n this.makeAnchors = function (types, elementId, jsPlumbInstance) {\n var r = [];\n for (var i = 0, ii = types.length; i < ii; i++) {\n if (typeof types[i] === \"string\") {\n r.push(root.jsPlumb.Anchors[types[i]]({elementId: elementId, jsPlumbInstance: jsPlumbInstance}));\n }\n else if (_ju.isArray(types[i])) {\n r.push(_currentInstance.makeAnchor(types[i], elementId, jsPlumbInstance));\n }\n }\n return r;\n };\n\n /**\n * Makes a dynamic anchor from the given list of anchors (which may be in shorthand notation as strings or dimension arrays, or Anchor\n * objects themselves) and the given, optional, anchorSelector function (jsPlumb uses a default if this is not provided; most people will\n * not need to provide this - i think).\n */\n this.makeDynamicAnchor = function (anchors, anchorSelector) {\n return new root.jsPlumb.DynamicAnchor({anchors: anchors, selector: anchorSelector, elementId: null, jsPlumbInstance: _currentInstance});\n };\n\n// --------------------- makeSource/makeTarget ----------------------------------------------\n\n this.targetEndpointDefinitions = {};\n this.sourceEndpointDefinitions = {};\n\n var selectorFilter = function (evt, _el, selector, _instance, negate) {\n var t = evt.target || evt.srcElement, ok = false,\n sel = _instance.getSelector(_el, selector);\n for (var j = 0; j < sel.length; j++) {\n if (sel[j] === t) {\n ok = true;\n break;\n }\n }\n return negate ? !ok : ok;\n };\n\n var _makeElementDropHandler = function (elInfo, p, dropOptions, isSource, isTarget) {\n var proxyComponent = new jsPlumbUIComponent(p);\n var _drop = p._jsPlumb.EndpointDropHandler({\n jsPlumb: _currentInstance,\n enabled: function () {\n return elInfo.def.enabled;\n },\n isFull: function () {\n var targetCount = _currentInstance.select({target: elInfo.id}).length;\n return elInfo.def.maxConnections > 0 && targetCount >= elInfo.def.maxConnections;\n },\n element: elInfo.el,\n elementId: elInfo.id,\n isSource: isSource,\n isTarget: isTarget,\n addClass: function (clazz) {\n _currentInstance.addClass(elInfo.el, clazz);\n },\n removeClass: function (clazz) {\n _currentInstance.removeClass(elInfo.el, clazz);\n },\n onDrop: function (jpc) {\n var source = jpc.endpoints[0];\n source.anchor.unlock();\n },\n isDropAllowed: function () {\n return proxyComponent.isDropAllowed.apply(proxyComponent, arguments);\n },\n isRedrop:function(jpc) {\n return (jpc.suspendedElement != null && jpc.suspendedEndpoint != null && jpc.suspendedEndpoint.element === elInfo.el);\n },\n getEndpoint: function (jpc) {\n\n // make a new Endpoint for the target, or get it from the cache if uniqueEndpoint\n // is set. if its a redrop the new endpoint will be immediately cleaned up.\n\n var newEndpoint = elInfo.def.endpoint;\n\n // if no cached endpoint, or there was one but it has been cleaned up\n // (ie. detached), create a new one\n if (newEndpoint == null || newEndpoint._jsPlumb == null) {\n var eps = _currentInstance.deriveEndpointAndAnchorSpec(jpc.getType().join(\" \"), true);\n var pp = eps.endpoints ? root.jsPlumb.extend(p, {\n endpoint:elInfo.def.def.endpoint || eps.endpoints[1]\n }) :p;\n if (eps.anchors) {\n pp = root.jsPlumb.extend(pp, {\n anchor:elInfo.def.def.anchor || eps.anchors[1]\n });\n }\n newEndpoint = _currentInstance.addEndpoint(elInfo.el, pp);\n newEndpoint._mtNew = true;\n }\n\n if (p.uniqueEndpoint) {\n elInfo.def.endpoint = newEndpoint;\n }\n\n newEndpoint.setDeleteOnEmpty(true);\n\n // if connection is detachable, init the new endpoint to be draggable, to support that happening.\n if (jpc.isDetachable()) {\n newEndpoint.initDraggable();\n }\n\n // if the anchor has a 'positionFinder' set, then delegate to that function to find\n // out where to locate the anchor.\n if (newEndpoint.anchor.positionFinder != null) {\n var dropPosition = _currentInstance.getUIPosition(arguments, _currentInstance.getZoom()),\n elPosition = _currentInstance.getOffset(elInfo.el),\n elSize = _currentInstance.getSize(elInfo.el),\n ap = dropPosition == null ? [0,0] : newEndpoint.anchor.positionFinder(dropPosition, elPosition, elSize, newEndpoint.anchor.constructorParams);\n\n newEndpoint.anchor.x = ap[0];\n newEndpoint.anchor.y = ap[1];\n // now figure an orientation for it..kind of hard to know what to do actually. probably the best thing i can do is to\n // support specifying an orientation in the anchor's spec. if one is not supplied then i will make the orientation\n // be what will cause the most natural link to the source: it will be pointing at the source, but it needs to be\n // specified in one axis only, and so how to make that choice? i think i will use whichever axis is the one in which\n // the target is furthest away from the source.\n }\n\n return newEndpoint;\n },\n maybeCleanup: function (ep) {\n if (ep._mtNew && ep.connections.length === 0) {\n _currentInstance.deleteObject({endpoint: ep});\n }\n else {\n delete ep._mtNew;\n }\n }\n });\n\n // wrap drop events as needed and initialise droppable\n var dropEvent = root.jsPlumb.dragEvents.drop;\n dropOptions.scope = dropOptions.scope || (p.scope || _currentInstance.Defaults.Scope);\n dropOptions[dropEvent] = _ju.wrap(dropOptions[dropEvent], _drop, true);\n dropOptions.rank = p.rank || 0;\n\n // if target, return true from the over event. this will cause katavorio to stop setting drops to hover\n // if multipleDrop is set to false.\n if (isTarget) {\n dropOptions[root.jsPlumb.dragEvents.over] = function () { return true; };\n }\n\n // vanilla jsplumb only\n if (p.allowLoopback === false) {\n dropOptions.canDrop = function (_drag) {\n var de = _drag.getDragElement()._jsPlumbRelatedElement;\n return de !== elInfo.el;\n };\n }\n _currentInstance.initDroppable(elInfo.el, dropOptions, \"internal\");\n\n return _drop;\n\n };\n\n // see API docs\n this.makeTarget = function (el, params, referenceParams) {\n\n // put jsplumb ref into params without altering the params passed in\n var p = root.jsPlumb.extend({_jsPlumb: this}, referenceParams);\n root.jsPlumb.extend(p, params);\n\n var maxConnections = p.maxConnections || -1,\n\n _doOne = function (el) {\n\n // get the element's id and store the endpoint definition for it. jsPlumb.connect calls will look for one of these,\n // and use the endpoint definition if found.\n // decode the info for this element (id and element)\n var elInfo = _info(el),\n elid = elInfo.id,\n dropOptions = root.jsPlumb.extend({}, p.dropOptions || {}),\n type = p.connectionType || \"default\";\n\n this.targetEndpointDefinitions[elid] = this.targetEndpointDefinitions[elid] || {};\n\n _ensureContainer(elid);\n\n // if this is a group and the user has not mandated a rank, set to -1 so that Nodes takes\n // precedence.\n if (elInfo.el._isJsPlumbGroup && dropOptions.rank == null) {\n dropOptions.rank = -1;\n }\n\n // store the definition\n var _def = {\n def: root.jsPlumb.extend({}, p),\n uniqueEndpoint: p.uniqueEndpoint,\n maxConnections: maxConnections,\n enabled: true\n };\n\n if (p.createEndpoint) {\n _def.uniqueEndpoint = true;\n _def.endpoint = _currentInstance.addEndpoint(el, _def.def);\n _def.endpoint.setDeleteOnEmpty(false);\n }\n\n elInfo.def = _def;\n this.targetEndpointDefinitions[elid][type] = _def;\n _makeElementDropHandler(elInfo, p, dropOptions, p.isSource === true, true);\n // stash the definition on the drop\n elInfo.el._katavorioDrop[elInfo.el._katavorioDrop.length - 1].targetDef = _def;\n\n }.bind(this);\n\n // make an array if only given one element\n var inputs = el.length && el.constructor !== String ? el : [ el ];\n\n // register each one in the list.\n for (var i = 0, ii = inputs.length; i < ii; i++) {\n _doOne(inputs[i]);\n }\n\n return this;\n };\n\n // see api docs\n this.unmakeTarget = function (el, doNotClearArrays) {\n var info = _info(el);\n _currentInstance.destroyDroppable(info.el, \"internal\");\n if (!doNotClearArrays) {\n delete this.targetEndpointDefinitions[info.id];\n }\n\n return this;\n };\n\n // see api docs\n this.makeSource = function (el, params, referenceParams) {\n var p = root.jsPlumb.extend({_jsPlumb: this}, referenceParams);\n root.jsPlumb.extend(p, params);\n var type = p.connectionType || \"default\";\n var aae = _currentInstance.deriveEndpointAndAnchorSpec(type);\n p.endpoint = p.endpoint || aae.endpoints[0];\n p.anchor = p.anchor || aae.anchors[0];\n var maxConnections = p.maxConnections || -1,\n onMaxConnections = p.onMaxConnections,\n _doOne = function (elInfo) {\n // get the element's id and store the endpoint definition for it. jsPlumb.connect calls will look for one of these,\n // and use the endpoint definition if found.\n var elid = elInfo.id,\n _del = this.getElement(elInfo.el);\n\n this.sourceEndpointDefinitions[elid] = this.sourceEndpointDefinitions[elid] || {};\n _ensureContainer(elid);\n\n var _def = {\n def:root.jsPlumb.extend({}, p),\n uniqueEndpoint: p.uniqueEndpoint,\n maxConnections: maxConnections,\n enabled: true\n };\n\n if (p.createEndpoint) {\n _def.uniqueEndpoint = true;\n _def.endpoint = _currentInstance.addEndpoint(el, _def.def);\n _def.endpoint.setDeleteOnEmpty(false);\n }\n\n this.sourceEndpointDefinitions[elid][type] = _def;\n elInfo.def = _def;\n\n var stopEvent = root.jsPlumb.dragEvents.stop,\n dragEvent = root.jsPlumb.dragEvents.drag,\n dragOptions = root.jsPlumb.extend({ }, p.dragOptions || {}),\n existingDrag = dragOptions.drag,\n existingStop = dragOptions.stop,\n ep = null,\n endpointAddedButNoDragYet = false;\n\n // set scope if its not set in dragOptions but was passed in in params\n dragOptions.scope = dragOptions.scope || p.scope;\n\n dragOptions[dragEvent] = _ju.wrap(dragOptions[dragEvent], function () {\n if (existingDrag) {\n existingDrag.apply(this, arguments);\n }\n endpointAddedButNoDragYet = false;\n });\n\n dragOptions[stopEvent] = _ju.wrap(dragOptions[stopEvent], function () {\n\n if (existingStop) {\n existingStop.apply(this, arguments);\n }\n this.currentlyDragging = false;\n if (ep._jsPlumb != null) { // if not cleaned up...\n\n // reset the anchor to the anchor that was initially provided. the one we were using to drag\n // the connection was just a placeholder that was located at the place the user pressed the\n // mouse button to initiate the drag.\n var anchorDef = p.anchor || this.Defaults.Anchor,\n oldAnchor = ep.anchor,\n oldConnection = ep.connections[0];\n\n var newAnchor = this.makeAnchor(anchorDef, elid, this),\n _el = ep.element;\n\n // if the anchor has a 'positionFinder' set, then delegate to that function to find\n // out where to locate the anchor. issue 117.\n if (newAnchor.positionFinder != null) {\n var elPosition = _currentInstance.getOffset(_el),\n elSize = this.getSize(_el),\n dropPosition = { left: elPosition.left + (oldAnchor.x * elSize[0]), top: elPosition.top + (oldAnchor.y * elSize[1]) },\n ap = newAnchor.positionFinder(dropPosition, elPosition, elSize, newAnchor.constructorParams);\n\n newAnchor.x = ap[0];\n newAnchor.y = ap[1];\n }\n\n ep.setAnchor(newAnchor, true);\n ep.repaint();\n this.repaint(ep.elementId);\n if (oldConnection != null) {\n this.repaint(oldConnection.targetId);\n }\n }\n }.bind(this));\n\n // when the user presses the mouse, add an Endpoint, if we are enabled.\n var mouseDownListener = function (e) {\n // on right mouse button, abort.\n if (e.which === 3 || e.button === 2) {\n return;\n }\n\n // TODO store def on element.\n var def = this.sourceEndpointDefinitions[elid][type];\n\n // if disabled, return.\n if (!def.enabled) {\n return;\n }\n\n elid = this.getId(this.getElement(elInfo.el)); // elid might have changed since this method was called to configure the element.\n\n // if a filter was given, run it, and return if it says no.\n if (p.filter) {\n var r = _ju.isString(p.filter) ? selectorFilter(e, elInfo.el, p.filter, this, p.filterExclude) : p.filter(e, elInfo.el);\n if (r === false) {\n return;\n }\n }\n\n // if maxConnections reached\n var sourceCount = this.select({source: elid}).length;\n if (def.maxConnections >= 0 && (sourceCount >= def.maxConnections)) {\n if (onMaxConnections) {\n onMaxConnections({\n element: elInfo.el,\n maxConnections: maxConnections\n }, e);\n }\n return false;\n }\n\n // find the position on the element at which the mouse was pressed; this is where the endpoint\n // will be located.\n var elxy = root.jsPlumb.getPositionOnElement(e, _del, _zoom);\n\n // we need to override the anchor in here, and force 'isSource', but we don't want to mess with\n // the params passed in, because after a connection is established we're going to reset the endpoint\n // to have the anchor we were given.\n var tempEndpointParams = {};\n root.jsPlumb.extend(tempEndpointParams, p);\n tempEndpointParams.isTemporarySource = true;\n tempEndpointParams.anchor = [ elxy[0], elxy[1] , 0, 0];\n tempEndpointParams.dragOptions = dragOptions;\n\n if (def.def.scope) {\n tempEndpointParams.scope = def.def.scope;\n }\n\n ep = this.addEndpoint(elid, tempEndpointParams);\n endpointAddedButNoDragYet = true;\n ep.setDeleteOnEmpty(true);\n\n // if unique endpoint and it's already been created, push it onto the endpoint we create. at the end\n // of a successful connection we'll switch to that endpoint.\n // TODO this is the same code as the programmatic endpoints create on line 1050 ish\n if (def.uniqueEndpoint) {\n if (!def.endpoint) {\n def.endpoint = ep;\n ep.setDeleteOnEmpty(false);\n }\n else {\n ep.finalEndpoint = def.endpoint;\n }\n }\n\n var _delTempEndpoint = function () {\n // this mouseup event is fired only if no dragging occurred, by jquery and yui, but for mootools\n // it is fired even if dragging has occurred, in which case we would blow away a perfectly\n // legitimate endpoint, were it not for this check. the flag is set after adding an\n // endpoint and cleared in a drag listener we set in the dragOptions above.\n _currentInstance.off(ep.canvas, \"mouseup\", _delTempEndpoint);\n _currentInstance.off(elInfo.el, \"mouseup\", _delTempEndpoint);\n if (endpointAddedButNoDragYet) {\n endpointAddedButNoDragYet = false;\n _currentInstance.deleteEndpoint(ep);\n }\n };\n\n _currentInstance.on(ep.canvas, \"mouseup\", _delTempEndpoint);\n _currentInstance.on(elInfo.el, \"mouseup\", _delTempEndpoint);\n\n // optionally check for attributes to extract from the source element\n var payload = {};\n if (def.def.extract) {\n for (var att in def.def.extract) {\n var v = (e.srcElement || e.target).getAttribute(att);\n if (v) {\n payload[def.def.extract[att]] = v;\n }\n }\n }\n\n // and then trigger its mousedown event, which will kick off a drag, which will start dragging\n // a new connection from this endpoint.\n _currentInstance.trigger(ep.canvas, \"mousedown\", e, payload);\n\n _ju.consume(e);\n\n }.bind(this);\n\n this.on(elInfo.el, \"mousedown\", mouseDownListener);\n _def.trigger = mouseDownListener;\n\n // if a filter was provided, set it as a dragFilter on the element,\n // to prevent the element drag function from kicking in when we want to\n // drag a new connection\n if (p.filter && (_ju.isString(p.filter) || _ju.isFunction(p.filter))) {\n _currentInstance.setDragFilter(elInfo.el, p.filter);\n }\n\n var dropOptions = root.jsPlumb.extend({}, p.dropOptions || {});\n\n _makeElementDropHandler(elInfo, p, dropOptions, true, p.isTarget === true);\n\n }.bind(this);\n\n var inputs = el.length && el.constructor !== String ? el : [ el ];\n for (var i = 0, ii = inputs.length; i < ii; i++) {\n _doOne(_info(inputs[i]));\n }\n\n return this;\n };\n\n // see api docs\n this.unmakeSource = function (el, connectionType, doNotClearArrays) {\n var info = _info(el);\n _currentInstance.destroyDroppable(info.el, \"internal\");\n var eldefs = this.sourceEndpointDefinitions[info.id];\n if (eldefs) {\n for (var def in eldefs) {\n if (connectionType == null || connectionType === def) {\n var mouseDownListener = eldefs[def].trigger;\n if (mouseDownListener) {\n _currentInstance.off(info.el, \"mousedown\", mouseDownListener);\n }\n if (!doNotClearArrays) {\n delete this.sourceEndpointDefinitions[info.id][def];\n }\n }\n }\n }\n\n return this;\n };\n\n // see api docs\n this.unmakeEverySource = function () {\n for (var i in this.sourceEndpointDefinitions) {\n _currentInstance.unmakeSource(i, null, true);\n }\n\n this.sourceEndpointDefinitions = {};\n return this;\n };\n\n var _getScope = function (el, types, connectionType) {\n types = _ju.isArray(types) ? types : [ types ];\n var id = _getId(el);\n connectionType = connectionType || \"default\";\n for (var i = 0; i < types.length; i++) {\n var eldefs = this[types[i]][id];\n if (eldefs && eldefs[connectionType]) {\n return eldefs[connectionType].def.scope || this.Defaults.Scope;\n }\n }\n }.bind(this);\n\n var _setScope = function (el, scope, types, connectionType) {\n types = _ju.isArray(types) ? types : [ types ];\n var id = _getId(el);\n connectionType = connectionType || \"default\";\n for (var i = 0; i < types.length; i++) {\n var eldefs = this[types[i]][id];\n if (eldefs && eldefs[connectionType]) {\n eldefs[connectionType].def.scope = scope;\n }\n }\n\n }.bind(this);\n\n this.getScope = function (el, scope) {\n return _getScope(el, [ \"sourceEndpointDefinitions\", \"targetEndpointDefinitions\" ]);\n };\n this.getSourceScope = function (el) {\n return _getScope(el, \"sourceEndpointDefinitions\");\n };\n this.getTargetScope = function (el) {\n return _getScope(el, \"targetEndpointDefinitions\");\n };\n this.setScope = function (el, scope, connectionType) {\n this.setSourceScope(el, scope, connectionType);\n this.setTargetScope(el, scope, connectionType);\n };\n this.setSourceScope = function (el, scope, connectionType) {\n _setScope(el, scope, \"sourceEndpointDefinitions\", connectionType);\n // we get the source scope during the mousedown event, but we also want to set this.\n this.setDragScope(el, scope);\n };\n this.setTargetScope = function (el, scope, connectionType) {\n _setScope(el, scope, \"targetEndpointDefinitions\", connectionType);\n this.setDropScope(el, scope);\n };\n\n // see api docs\n this.unmakeEveryTarget = function () {\n for (var i in this.targetEndpointDefinitions) {\n _currentInstance.unmakeTarget(i, true);\n }\n\n this.targetEndpointDefinitions = {};\n return this;\n };\n\n // does the work of setting a source enabled or disabled.\n var _setEnabled = function (type, el, state, toggle, connectionType) {\n var a = type === \"source\" ? this.sourceEndpointDefinitions : this.targetEndpointDefinitions,\n originalState, info, newState;\n\n connectionType = connectionType || \"default\";\n\n // a selector or an array\n if (el.length && !_ju.isString(el)) {\n originalState = [];\n for (var i = 0, ii = el.length; i < ii; i++) {\n info = _info(el[i]);\n if (a[info.id] && a[info.id][connectionType]) {\n originalState[i] = a[info.id][connectionType].enabled;\n newState = toggle ? !originalState[i] : state;\n a[info.id][connectionType].enabled = newState;\n _currentInstance[newState ? \"removeClass\" : \"addClass\"](info.el, \"jtk-\" + type + \"-disabled\");\n }\n }\n }\n // otherwise a DOM element or a String ID.\n else {\n info = _info(el);\n var id = info.id;\n if (a[id] && a[id][connectionType]) {\n originalState = a[id][connectionType].enabled;\n newState = toggle ? !originalState : state;\n a[id][connectionType].enabled = newState;\n _currentInstance[newState ? \"removeClass\" : \"addClass\"](info.el, \"jtk-\" + type + \"-disabled\");\n }\n }\n return originalState;\n }.bind(this);\n\n var _first = function (el, fn) {\n if (_ju.isString(el) || !el.length) {\n return fn.apply(this, [ el ]);\n }\n else if (el.length) {\n return fn.apply(this, [ el[0] ]);\n }\n\n }.bind(this);\n\n this.toggleSourceEnabled = function (el, connectionType) {\n _setEnabled(\"source\", el, null, true, connectionType);\n return this.isSourceEnabled(el, connectionType);\n };\n\n this.setSourceEnabled = function (el, state, connectionType) {\n return _setEnabled(\"source\", el, state, null, connectionType);\n };\n this.isSource = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var eldefs = this.sourceEndpointDefinitions[_info(_el).id];\n return eldefs != null && eldefs[connectionType] != null;\n }.bind(this));\n };\n this.isSourceEnabled = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var sep = this.sourceEndpointDefinitions[_info(_el).id];\n return sep && sep[connectionType] && sep[connectionType].enabled === true;\n }.bind(this));\n };\n\n this.toggleTargetEnabled = function (el, connectionType) {\n _setEnabled(\"target\", el, null, true, connectionType);\n return this.isTargetEnabled(el, connectionType);\n };\n\n this.isTarget = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var eldefs = this.targetEndpointDefinitions[_info(_el).id];\n return eldefs != null && eldefs[connectionType] != null;\n }.bind(this));\n };\n this.isTargetEnabled = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var tep = this.targetEndpointDefinitions[_info(_el).id];\n return tep && tep[connectionType] && tep[connectionType].enabled === true;\n }.bind(this));\n };\n this.setTargetEnabled = function (el, state, connectionType) {\n return _setEnabled(\"target\", el, state, null, connectionType);\n };\n\n// --------------------- end makeSource/makeTarget ----------------------------------------------\n\n this.ready = function (fn) {\n _currentInstance.bind(\"ready\", fn);\n };\n\n var _elEach = function(el, fn) {\n // support both lists...\n if (typeof el === 'object' && el.length) {\n for (var i = 0, ii = el.length; i < ii; i++) {\n fn(el[i]);\n }\n }\n else {// ...and single strings or elements.\n fn(el);\n }\n\n return _currentInstance;\n };\n\n // repaint some element's endpoints and connections\n this.repaint = function (el, ui, timestamp) {\n return _elEach(el, function(_el) {\n _draw(_el, ui, timestamp);\n });\n };\n\n this.revalidate = function (el, timestamp, isIdAlready) {\n return _elEach(el, function(_el) {\n var elId = isIdAlready ? _el : _currentInstance.getId(_el);\n _currentInstance.updateOffset({ elId: elId, recalc: true, timestamp:timestamp });\n var dm = _currentInstance.getDragManager();\n if (dm) {\n dm.updateOffsets(elId);\n }\n _currentInstance.repaint(_el);\n });\n };\n\n // repaint every endpoint and connection.\n this.repaintEverything = function () {\n // TODO this timestamp causes continuous anchors to not repaint properly.\n // fix this. do not just take out the timestamp. it runs a lot faster with\n // the timestamp included.\n var timestamp = _timestamp(), elId;\n\n for (elId in endpointsByElement) {\n _currentInstance.updateOffset({ elId: elId, recalc: true, timestamp: timestamp });\n }\n\n for (elId in endpointsByElement) {\n _draw(elId, null, timestamp);\n }\n\n return this;\n };\n\n this.removeAllEndpoints = function (el, recurse, affectedElements) {\n affectedElements = affectedElements || [];\n var _one = function (_el) {\n var info = _info(_el),\n ebe = endpointsByElement[info.id],\n i, ii;\n\n if (ebe) {\n affectedElements.push(info);\n for (i = 0, ii = ebe.length; i < ii; i++) {\n _currentInstance.deleteEndpoint(ebe[i], false);\n }\n }\n delete endpointsByElement[info.id];\n\n if (recurse) {\n if (info.el && info.el.nodeType !== 3 && info.el.nodeType !== 8) {\n for (i = 0, ii = info.el.childNodes.length; i < ii; i++) {\n _one(info.el.childNodes[i]);\n }\n }\n }\n\n };\n _one(el);\n return this;\n };\n\n var _doRemove = function(info, affectedElements) {\n _currentInstance.removeAllEndpoints(info.id, true, affectedElements);\n var dm = _currentInstance.getDragManager();\n var _one = function(_info) {\n\n if (dm) {\n dm.elementRemoved(_info.id);\n }\n _currentInstance.anchorManager.clearFor(_info.id);\n _currentInstance.anchorManager.removeFloatingConnection(_info.id);\n\n if (_currentInstance.isSource(_info.el)) {\n _currentInstance.unmakeSource(_info.el);\n }\n if (_currentInstance.isTarget(_info.el)) {\n _currentInstance.unmakeTarget(_info.el);\n }\n _currentInstance.destroyDraggable(_info.el);\n _currentInstance.destroyDroppable(_info.el);\n\n\n delete _currentInstance.floatingConnections[_info.id];\n delete managedElements[_info.id];\n delete offsets[_info.id];\n if (_info.el) {\n _currentInstance.removeElement(_info.el);\n _info.el._jsPlumb = null;\n }\n };\n\n // remove all affected child elements\n for (var ae = 1; ae < affectedElements.length; ae++) {\n _one(affectedElements[ae]);\n }\n // and always remove the requested one from the dom.\n _one(info);\n };\n\n /**\n * Remove the given element, including cleaning up all endpoints registered for it.\n * This is exposed in the public API but also used internally by jsPlumb when removing the\n * element associated with a connection drag.\n */\n this.remove = function (el, doNotRepaint) {\n var info = _info(el), affectedElements = [];\n if (info.text) {\n info.el.parentNode.removeChild(info.el);\n }\n else if (info.id) {\n _currentInstance.batch(function () {\n _doRemove(info, affectedElements);\n }, doNotRepaint === true);\n }\n return _currentInstance;\n };\n\n this.empty = function (el, doNotRepaint) {\n var affectedElements = [];\n var _one = function(el, dontRemoveFocus) {\n var info = _info(el);\n if (info.text) {\n info.el.parentNode.removeChild(info.el);\n }\n else if (info.el) {\n while(info.el.childNodes.length > 0) {\n _one(info.el.childNodes[0]);\n }\n if (!dontRemoveFocus) {\n _doRemove(info, affectedElements);\n }\n }\n };\n\n _currentInstance.batch(function() {\n _one(el, true);\n }, doNotRepaint === false);\n\n return _currentInstance;\n };\n\n this.reset = function (doNotUnbindInstanceEventListeners) {\n _currentInstance.silently(function() {\n _hoverSuspended = false;\n _currentInstance.removeAllGroups();\n _currentInstance.removeGroupManager();\n _currentInstance.deleteEveryEndpoint();\n if (!doNotUnbindInstanceEventListeners) {\n _currentInstance.unbind();\n }\n this.targetEndpointDefinitions = {};\n this.sourceEndpointDefinitions = {};\n connections.length = 0;\n if (this.doReset) {\n this.doReset();\n }\n }.bind(this));\n };\n\n var _clearObject = function (obj) {\n if (obj.canvas && obj.canvas.parentNode) {\n obj.canvas.parentNode.removeChild(obj.canvas);\n }\n obj.cleanup();\n obj.destroy();\n };\n\n this.clear = function () {\n _currentInstance.select().each(_clearObject);\n _currentInstance.selectEndpoints().each(_clearObject);\n\n endpointsByElement = {};\n endpointsByUUID = {};\n };\n\n this.setDefaultScope = function (scope) {\n DEFAULT_SCOPE = scope;\n return _currentInstance;\n };\n\n this.deriveEndpointAndAnchorSpec = function(type, dontPrependDefault) {\n var bits = ((dontPrependDefault ? \"\" : \"default \") + type).split(/[\\s]/), eps = null, ep = null, a = null, as = null;\n for (var i = 0; i < bits.length; i++) {\n var _t = _currentInstance.getType(bits[i], \"connection\");\n if (_t) {\n if (_t.endpoints) {\n eps = _t.endpoints;\n }\n if (_t.endpoint) {\n ep = _t.endpoint;\n }\n if (_t.anchors) {\n as = _t.anchors;\n }\n if (_t.anchor) {\n a = _t.anchor;\n }\n }\n }\n return { endpoints: eps ? eps : [ ep, ep ], anchors: as ? as : [a, a ]};\n };\n\n // sets the id of some element, changing whatever we need to to keep track.\n this.setId = function (el, newId, doNotSetAttribute) {\n //\n var id;\n\n if (_ju.isString(el)) {\n id = el;\n }\n else {\n el = this.getElement(el);\n id = this.getId(el);\n }\n\n var sConns = this.getConnections({source: id, scope: '*'}, true),\n tConns = this.getConnections({target: id, scope: '*'}, true);\n\n newId = \"\" + newId;\n\n if (!doNotSetAttribute) {\n el = this.getElement(id);\n this.setAttribute(el, \"id\", newId);\n }\n else {\n el = this.getElement(newId);\n }\n\n endpointsByElement[newId] = endpointsByElement[id] || [];\n for (var i = 0, ii = endpointsByElement[newId].length; i < ii; i++) {\n endpointsByElement[newId][i].setElementId(newId);\n endpointsByElement[newId][i].setReferenceElement(el);\n }\n delete endpointsByElement[id];\n\n this.sourceEndpointDefinitions[newId] = this.sourceEndpointDefinitions[id];\n delete this.sourceEndpointDefinitions[id];\n this.targetEndpointDefinitions[newId] = this.targetEndpointDefinitions[id];\n delete this.targetEndpointDefinitions[id];\n\n this.anchorManager.changeId(id, newId);\n var dm = this.getDragManager();\n if (dm) {\n dm.changeId(id, newId);\n }\n managedElements[newId] = managedElements[id];\n delete managedElements[id];\n\n var _conns = function (list, epIdx, type) {\n for (var i = 0, ii = list.length; i < ii; i++) {\n list[i].endpoints[epIdx].setElementId(newId);\n list[i].endpoints[epIdx].setReferenceElement(el);\n list[i][type + \"Id\"] = newId;\n list[i][type] = el;\n }\n };\n _conns(sConns, 0, \"source\");\n _conns(tConns, 1, \"target\");\n\n this.repaint(newId);\n };\n\n this.setDebugLog = function (debugLog) {\n log = debugLog;\n };\n\n this.setSuspendDrawing = function (val, repaintAfterwards) {\n var curVal = _suspendDrawing;\n _suspendDrawing = val;\n if (val) {\n _suspendedAt = new Date().getTime();\n } else {\n _suspendedAt = null;\n }\n if (repaintAfterwards) {\n this.repaintEverything();\n }\n return curVal;\n };\n\n // returns whether or not drawing is currently suspended.\n this.isSuspendDrawing = function () {\n return _suspendDrawing;\n };\n\n // return timestamp for when drawing was suspended.\n this.getSuspendedAt = function () {\n return _suspendedAt;\n };\n\n this.batch = function (fn, doNotRepaintAfterwards) {\n var _wasSuspended = this.isSuspendDrawing();\n if (!_wasSuspended) {\n this.setSuspendDrawing(true);\n }\n try {\n fn();\n }\n catch (e) {\n _ju.log(\"Function run while suspended failed\", e);\n }\n if (!_wasSuspended) {\n this.setSuspendDrawing(false, !doNotRepaintAfterwards);\n }\n };\n\n this.doWhileSuspended = this.batch;\n\n this.getCachedData = _getCachedData;\n this.timestamp = _timestamp;\n this.show = function (el, changeEndpoints) {\n _setVisible(el, \"block\", changeEndpoints);\n return _currentInstance;\n };\n\n // TODO: update this method to return the current state.\n this.toggleVisible = _toggleVisible;\n this.addListener = this.bind;\n\n var floatingConnections = [];\n this.registerFloatingConnection = function(info, conn, ep) {\n floatingConnections[info.id] = conn;\n // only register for the target endpoint; we will not be dragging the source at any time\n // before this connection is either discarded or made into a permanent connection.\n _ju.addToList(endpointsByElement, info.id, ep);\n };\n this.getFloatingConnectionFor = function(id) {\n return floatingConnections[id];\n };\n };\n\n _ju.extend(root.jsPlumbInstance, _ju.EventGenerator, {\n setAttribute: function (el, a, v) {\n this.setAttribute(el, a, v);\n },\n getAttribute: function (el, a) {\n return this.getAttribute(root.jsPlumb.getElement(el), a);\n },\n convertToFullOverlaySpec: function(spec) {\n if (_ju.isString(spec)) {\n spec = [ spec, { } ];\n }\n spec[1].id = spec[1].id || _ju.uuid();\n return spec;\n },\n registerConnectionType: function (id, type) {\n this._connectionTypes[id] = root.jsPlumb.extend({}, type);\n if (type.overlays) {\n var to = {};\n for (var i = 0; i < type.overlays.length; i++) {\n // if a string, convert to object representation so that we can store the typeid on it.\n // also assign an id.\n var fo = this.convertToFullOverlaySpec(type.overlays[i]);\n to[fo[1].id] = fo;\n }\n this._connectionTypes[id].overlays = to;\n }\n },\n registerConnectionTypes: function (types) {\n for (var i in types) {\n this.registerConnectionType(i, types[i]);\n }\n },\n registerEndpointType: function (id, type) {\n this._endpointTypes[id] = root.jsPlumb.extend({}, type);\n if (type.overlays) {\n var to = {};\n for (var i = 0; i < type.overlays.length; i++) {\n // if a string, convert to object representation so that we can store the typeid on it.\n // also assign an id.\n var fo = this.convertToFullOverlaySpec(type.overlays[i]);\n to[fo[1].id] = fo;\n }\n this._endpointTypes[id].overlays = to;\n }\n },\n registerEndpointTypes: function (types) {\n for (var i in types) {\n this.registerEndpointType(i, types[i]);\n }\n },\n getType: function (id, typeDescriptor) {\n return typeDescriptor === \"connection\" ? this._connectionTypes[id] : this._endpointTypes[id];\n },\n setIdChanged: function (oldId, newId) {\n this.setId(oldId, newId, true);\n },\n // set parent: change the parent for some node and update all the registrations we need to.\n setParent: function (el, newParent) {\n var _dom = this.getElement(el),\n _id = this.getId(_dom),\n _pdom = this.getElement(newParent),\n _pid = this.getId(_pdom),\n dm = this.getDragManager();\n\n _dom.parentNode.removeChild(_dom);\n _pdom.appendChild(_dom);\n if (dm) {\n dm.setParent(_dom, _id, _pdom, _pid);\n }\n },\n extend: function (o1, o2, names) {\n var i;\n if (names) {\n for (i = 0; i < names.length; i++) {\n o1[names[i]] = o2[names[i]];\n }\n }\n else {\n for (i in o2) {\n o1[i] = o2[i];\n }\n }\n\n return o1;\n },\n floatingConnections: {},\n getFloatingAnchorIndex: function (jpc) {\n return jpc.endpoints[0].isFloating() ? 0 : jpc.endpoints[1].isFloating() ? 1 : -1;\n }\n });\n\n// --------------------- static instance + module registration -------------------------------------------\n\n// create static instance and assign to window if window exists.\n var jsPlumb = new jsPlumbInstance();\n // register on 'root' (lets us run on server or browser)\n root.jsPlumb = jsPlumb;\n // add 'getInstance' method to static instance\n jsPlumb.getInstance = function (_defaults, overrideFns) {\n var j = new jsPlumbInstance(_defaults);\n if (overrideFns) {\n for (var ovf in overrideFns) {\n j[ovf] = overrideFns[ovf];\n }\n }\n j.init();\n return j;\n };\n jsPlumb.each = function (spec, fn) {\n if (spec == null) {\n return;\n }\n if (typeof spec === \"string\") {\n fn(jsPlumb.getElement(spec));\n }\n else if (spec.length != null) {\n for (var i = 0; i < spec.length; i++) {\n fn(jsPlumb.getElement(spec[i]));\n }\n }\n else {\n fn(spec);\n } // assume it's an element.\n };\n\n // CommonJS\n if (typeof exports !== 'undefined') {\n exports.jsPlumb = jsPlumb;\n }\n\n// --------------------- end static instance + AMD registration -------------------------------------------\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function() {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n // ------------------------------ BEGIN OverlayCapablejsPlumbUIComponent --------------------------------------------\n\n var _internalLabelOverlayId = \"__label\",\n // this is a shortcut helper method to let people add a label as\n // overlay.\n _makeLabelOverlay = function (component, params) {\n\n var _params = {\n cssClass: params.cssClass,\n labelStyle: component.labelStyle,\n id: _internalLabelOverlayId,\n component: component,\n _jsPlumb: component._jsPlumb.instance // TODO not necessary, since the instance can be accessed through the component.\n },\n mergedParams = _jp.extend(_params, params);\n\n return new _jp.Overlays[component._jsPlumb.instance.getRenderMode()].Label(mergedParams);\n },\n _processOverlay = function (component, o) {\n var _newOverlay = null;\n if (_ju.isArray(o)) {\t// this is for the shorthand [\"Arrow\", { width:50 }] syntax\n // there's also a three arg version:\n // [\"Arrow\", { width:50 }, {location:0.7}]\n // which merges the 3rd arg into the 2nd.\n var type = o[0],\n // make a copy of the object so as not to mess up anyone else's reference...\n p = _jp.extend({component: component, _jsPlumb: component._jsPlumb.instance}, o[1]);\n if (o.length === 3) {\n _jp.extend(p, o[2]);\n }\n _newOverlay = new _jp.Overlays[component._jsPlumb.instance.getRenderMode()][type](p);\n } else if (o.constructor === String) {\n _newOverlay = new _jp.Overlays[component._jsPlumb.instance.getRenderMode()][o]({component: component, _jsPlumb: component._jsPlumb.instance});\n } else {\n _newOverlay = o;\n }\n\n _newOverlay.id = _newOverlay.id || _ju.uuid();\n component.cacheTypeItem(\"overlay\", _newOverlay, _newOverlay.id);\n component._jsPlumb.overlays[_newOverlay.id] = _newOverlay;\n\n return _newOverlay;\n };\n\n _jp.OverlayCapableJsPlumbUIComponent = function (params) {\n\n root.jsPlumbUIComponent.apply(this, arguments);\n this._jsPlumb.overlays = {};\n this._jsPlumb.overlayPositions = {};\n\n if (params.label) {\n this.getDefaultType().overlays[_internalLabelOverlayId] = [\"Label\", {\n label: params.label,\n location: params.labelLocation || this.defaultLabelLocation || 0.5,\n labelStyle: params.labelStyle || this._jsPlumb.instance.Defaults.LabelStyle,\n id:_internalLabelOverlayId\n }];\n }\n\n this.setListenerComponent = function (c) {\n if (this._jsPlumb) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].setListenerComponent(c);\n }\n }\n };\n };\n\n _jp.OverlayCapableJsPlumbUIComponent.applyType = function (component, t) {\n if (t.overlays) {\n // loop through the ones in the type. if already present on the component,\n // dont remove or re-add.\n var keep = {}, i;\n\n for (i in t.overlays) {\n\n var existing = component._jsPlumb.overlays[t.overlays[i][1].id];\n if (existing) {\n // maybe update from data, if there were parameterised values for instance.\n existing.updateFrom(t.overlays[i][1]);\n keep[t.overlays[i][1].id] = true;\n }\n else {\n var c = component.getCachedTypeItem(\"overlay\", t.overlays[i][1].id);\n if (c != null) {\n c.reattach(component._jsPlumb.instance, component);\n c.setVisible(true);\n // maybe update from data, if there were parameterised values for instance.\n c.updateFrom(t.overlays[i][1]);\n component._jsPlumb.overlays[c.id] = c;\n }\n else {\n c = component.addOverlay(t.overlays[i], true);\n }\n keep[c.id] = true;\n }\n }\n\n // now loop through the full overlays and remove those that we dont want to keep\n for (i in component._jsPlumb.overlays) {\n if (keep[component._jsPlumb.overlays[i].id] == null) {\n component.removeOverlay(component._jsPlumb.overlays[i].id, true); // remove overlay but dont clean it up.\n // that would remove event listeners etc; overlays are never discarded by the types stuff, they are\n // just detached/reattached.\n }\n }\n }\n };\n\n _ju.extend(_jp.OverlayCapableJsPlumbUIComponent, root.jsPlumbUIComponent, {\n\n setHover: function (hover, ignoreAttachedElements) {\n if (this._jsPlumb && !this._jsPlumb.instance.isConnectionBeingDragged()) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i][hover ? \"addClass\" : \"removeClass\"](this._jsPlumb.instance.hoverClass);\n }\n }\n },\n addOverlay: function (overlay, doNotRepaint) {\n var o = _processOverlay(this, overlay);\n if (!doNotRepaint) {\n this.repaint();\n }\n return o;\n },\n getOverlay: function (id) {\n return this._jsPlumb.overlays[id];\n },\n getOverlays: function () {\n return this._jsPlumb.overlays;\n },\n hideOverlay: function (id) {\n var o = this.getOverlay(id);\n if (o) {\n o.hide();\n }\n },\n hideOverlays: function () {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].hide();\n }\n },\n showOverlay: function (id) {\n var o = this.getOverlay(id);\n if (o) {\n o.show();\n }\n },\n showOverlays: function () {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].show();\n }\n },\n removeAllOverlays: function (doNotRepaint) {\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays[i].cleanup) {\n this._jsPlumb.overlays[i].cleanup();\n }\n }\n\n this._jsPlumb.overlays = {};\n this._jsPlumb.overlayPositions = null;\n this._jsPlumb.overlayPlacements= {};\n if (!doNotRepaint) {\n this.repaint();\n }\n },\n removeOverlay: function (overlayId, dontCleanup) {\n var o = this._jsPlumb.overlays[overlayId];\n if (o) {\n o.setVisible(false);\n if (!dontCleanup && o.cleanup) {\n o.cleanup();\n }\n delete this._jsPlumb.overlays[overlayId];\n if (this._jsPlumb.overlayPositions) {\n delete this._jsPlumb.overlayPositions[overlayId];\n }\n\n if (this._jsPlumb.overlayPlacements) {\n delete this._jsPlumb.overlayPlacements[overlayId];\n }\n }\n },\n removeOverlays: function () {\n for (var i = 0, j = arguments.length; i < j; i++) {\n this.removeOverlay(arguments[i]);\n }\n },\n moveParent: function (newParent) {\n if (this.bgCanvas) {\n this.bgCanvas.parentNode.removeChild(this.bgCanvas);\n newParent.appendChild(this.bgCanvas);\n }\n\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n newParent.appendChild(this.canvas);\n\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays[i].isAppendedAtTopLevel) {\n var el = this._jsPlumb.overlays[i].getElement();\n el.parentNode.removeChild(el);\n newParent.appendChild(el);\n }\n }\n }\n },\n getLabel: function () {\n var lo = this.getOverlay(_internalLabelOverlayId);\n return lo != null ? lo.getLabel() : null;\n },\n getLabelOverlay: function () {\n return this.getOverlay(_internalLabelOverlayId);\n },\n setLabel: function (l) {\n var lo = this.getOverlay(_internalLabelOverlayId);\n if (!lo) {\n var params = l.constructor === String || l.constructor === Function ? { label: l } : l;\n lo = _makeLabelOverlay(this, params);\n this._jsPlumb.overlays[_internalLabelOverlayId] = lo;\n }\n else {\n if (l.constructor === String || l.constructor === Function) {\n lo.setLabel(l);\n }\n else {\n if (l.label) {\n lo.setLabel(l.label);\n }\n if (l.location) {\n lo.setLocation(l.location);\n }\n }\n }\n\n if (!this._jsPlumb.instance.isSuspendDrawing()) {\n this.repaint();\n }\n },\n cleanup: function (force) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].cleanup(force);\n this._jsPlumb.overlays[i].destroy(force);\n }\n if (force) {\n this._jsPlumb.overlays = {};\n this._jsPlumb.overlayPositions = null;\n }\n },\n setVisible: function (v) {\n this[v ? \"showOverlays\" : \"hideOverlays\"]();\n },\n setAbsoluteOverlayPosition: function (overlay, xy) {\n this._jsPlumb.overlayPositions[overlay.id] = xy;\n },\n getAbsoluteOverlayPosition: function (overlay) {\n return this._jsPlumb.overlayPositions ? this._jsPlumb.overlayPositions[overlay.id] : null;\n },\n _clazzManip:function(action, clazz, dontUpdateOverlays) {\n if (!dontUpdateOverlays) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i][action + \"Class\"](clazz);\n }\n }\n },\n addClass:function(clazz, dontUpdateOverlays) {\n this._clazzManip(\"add\", clazz, dontUpdateOverlays);\n },\n removeClass:function(clazz, dontUpdateOverlays) {\n this._clazzManip(\"remove\", clazz, dontUpdateOverlays);\n }\n });\n\n// ------------------------------ END OverlayCapablejsPlumbUIComponent --------------------------------------------\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the code for Endpoints.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n * \n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n // create the drag handler for a connection\n var _makeConnectionDragHandler = function (endpoint, placeholder, _jsPlumb) {\n var stopped = false;\n return {\n drag: function () {\n if (stopped) {\n stopped = false;\n return true;\n }\n\n if (placeholder.element) {\n var _ui = _jsPlumb.getUIPosition(arguments, _jsPlumb.getZoom());\n if (_ui != null) {\n _jsPlumb.setPosition(placeholder.element, _ui);\n }\n _jsPlumb.repaint(placeholder.element, _ui);\n // always repaint the source endpoint, because only continuous/dynamic anchors cause the endpoint\n // to be repainted, so static anchors need to be told (or the endpoint gets dragged around)\n endpoint.paint({anchorPoint:endpoint.anchor.getCurrentLocation({element:endpoint})});\n }\n },\n stopDrag: function () {\n stopped = true;\n }\n };\n };\n\n // creates a placeholder div for dragging purposes, adds it, and pre-computes its offset.\n var _makeDraggablePlaceholder = function (placeholder, _jsPlumb, ipco, ips) {\n var n = _jsPlumb.createElement(\"div\", { position : \"absolute\" });\n _jsPlumb.appendElement(n);\n var id = _jsPlumb.getId(n);\n _jsPlumb.setPosition(n, ipco);\n n.style.width = ips[0] + \"px\";\n n.style.height = ips[1] + \"px\";\n _jsPlumb.manage(id, n, true); // TRANSIENT MANAGE\n // create and assign an id, and initialize the offset.\n placeholder.id = id;\n placeholder.element = n;\n };\n\n // create a floating endpoint (for drag connections)\n var _makeFloatingEndpoint = function (paintStyle, referenceAnchor, endpoint, referenceCanvas, sourceElement, _jsPlumb, _newEndpoint, scope) {\n var floatingAnchor = new _jp.FloatingAnchor({ reference: referenceAnchor, referenceCanvas: referenceCanvas, jsPlumbInstance: _jsPlumb });\n //setting the scope here should not be the way to fix that mootools issue. it should be fixed by not\n // adding the floating endpoint as a droppable. that makes more sense anyway!\n // TRANSIENT MANAGE\n return _newEndpoint({\n paintStyle: paintStyle,\n endpoint: endpoint,\n anchor: floatingAnchor,\n source: sourceElement,\n scope: scope\n });\n };\n\n var typeParameters = [ \"connectorStyle\", \"connectorHoverStyle\", \"connectorOverlays\",\n \"connector\", \"connectionType\", \"connectorClass\", \"connectorHoverClass\" ];\n\n // a helper function that tries to find a connection to the given element, and returns it if so. if elementWithPrecedence is null,\n // or no connection to it is found, we return the first connection in our list.\n var findConnectionToUseForDynamicAnchor = function (ep, elementWithPrecedence) {\n var idx = 0;\n if (elementWithPrecedence != null) {\n for (var i = 0; i < ep.connections.length; i++) {\n if (ep.connections[i].sourceId === elementWithPrecedence || ep.connections[i].targetId === elementWithPrecedence) {\n idx = i;\n break;\n }\n }\n }\n\n return ep.connections[idx];\n };\n\n _jp.Endpoint = function (params) {\n var _jsPlumb = params._jsPlumb,\n _newConnection = params.newConnection,\n _newEndpoint = params.newEndpoint;\n\n this.idPrefix = \"_jsplumb_e_\";\n this.defaultLabelLocation = [ 0.5, 0.5 ];\n this.defaultOverlayKeys = [\"Overlays\", \"EndpointOverlays\"];\n _jp.OverlayCapableJsPlumbUIComponent.apply(this, arguments);\n\n// TYPE\n\n this.appendToDefaultType({\n connectionType:params.connectionType,\n maxConnections: params.maxConnections == null ? this._jsPlumb.instance.Defaults.MaxConnections : params.maxConnections, // maximum number of connections this endpoint can be the source of.,\n paintStyle: params.endpointStyle || params.paintStyle || params.style || this._jsPlumb.instance.Defaults.EndpointStyle || _jp.Defaults.EndpointStyle,\n hoverPaintStyle: params.endpointHoverStyle || params.hoverPaintStyle || this._jsPlumb.instance.Defaults.EndpointHoverStyle || _jp.Defaults.EndpointHoverStyle,\n connectorStyle: params.connectorStyle,\n connectorHoverStyle: params.connectorHoverStyle,\n connectorClass: params.connectorClass,\n connectorHoverClass: params.connectorHoverClass,\n connectorOverlays: params.connectorOverlays,\n connector: params.connector,\n connectorTooltip: params.connectorTooltip\n });\n\n// END TYPE\n\n this._jsPlumb.enabled = !(params.enabled === false);\n this._jsPlumb.visible = true;\n this.element = _jp.getElement(params.source);\n this._jsPlumb.uuid = params.uuid;\n this._jsPlumb.floatingEndpoint = null;\n var inPlaceCopy = null;\n if (this._jsPlumb.uuid) {\n params.endpointsByUUID[this._jsPlumb.uuid] = this;\n }\n this.elementId = params.elementId;\n this.dragProxy = params.dragProxy;\n\n this._jsPlumb.connectionCost = params.connectionCost;\n this._jsPlumb.connectionsDirected = params.connectionsDirected;\n this._jsPlumb.currentAnchorClass = \"\";\n this._jsPlumb.events = {};\n\n var deleteOnEmpty = params.deleteOnEmpty === true;\n this.setDeleteOnEmpty = function(d) {\n deleteOnEmpty = d;\n };\n\n var _updateAnchorClass = function () {\n // stash old, get new\n var oldAnchorClass = _jsPlumb.endpointAnchorClassPrefix + \"-\" + this._jsPlumb.currentAnchorClass;\n this._jsPlumb.currentAnchorClass = this.anchor.getCssClass();\n var anchorClass = _jsPlumb.endpointAnchorClassPrefix + (this._jsPlumb.currentAnchorClass ? \"-\" + this._jsPlumb.currentAnchorClass : \"\");\n\n this.removeClass(oldAnchorClass);\n this.addClass(anchorClass);\n // add and remove at the same time to reduce the number of reflows.\n _jp.updateClasses(this.element, anchorClass, oldAnchorClass);\n }.bind(this);\n\n this.prepareAnchor = function(anchorParams) {\n var a = this._jsPlumb.instance.makeAnchor(anchorParams, this.elementId, _jsPlumb);\n a.bind(\"anchorChanged\", function (currentAnchor) {\n this.fire(\"anchorChanged\", {endpoint: this, anchor: currentAnchor});\n _updateAnchorClass();\n }.bind(this));\n return a;\n };\n\n this.setPreparedAnchor = function(anchor, doNotRepaint) {\n this._jsPlumb.instance.continuousAnchorFactory.clear(this.elementId);\n this.anchor = anchor;\n _updateAnchorClass();\n\n if (!doNotRepaint) {\n this._jsPlumb.instance.repaint(this.elementId);\n }\n\n return this;\n };\n\n this.setAnchor = function (anchorParams, doNotRepaint) {\n var a = this.prepareAnchor(anchorParams);\n this.setPreparedAnchor(a, doNotRepaint);\n return this;\n };\n\n var internalHover = function (state) {\n if (this.connections.length > 0) {\n for (var i = 0; i < this.connections.length; i++) {\n this.connections[i].setHover(state, false);\n }\n }\n else {\n this.setHover(state);\n }\n }.bind(this);\n\n this.bind(\"mouseover\", function () {\n internalHover(true);\n });\n this.bind(\"mouseout\", function () {\n internalHover(false);\n });\n\n // ANCHOR MANAGER\n if (!params._transient) { // in place copies, for example, are transient. they will never need to be retrieved during a paint cycle, because they dont move, and then they are deleted.\n this._jsPlumb.instance.anchorManager.add(this, this.elementId);\n }\n\n this.prepareEndpoint = function(ep, typeId) {\n var _e = function (t, p) {\n var rm = _jsPlumb.getRenderMode();\n if (_jp.Endpoints[rm][t]) {\n return new _jp.Endpoints[rm][t](p);\n }\n if (!_jsPlumb.Defaults.DoNotThrowErrors) {\n throw { msg: \"jsPlumb: unknown endpoint type '\" + t + \"'\" };\n }\n };\n\n var endpointArgs = {\n _jsPlumb: this._jsPlumb.instance,\n cssClass: params.cssClass,\n container: params.container,\n tooltip: params.tooltip,\n connectorTooltip: params.connectorTooltip,\n endpoint: this\n };\n\n var endpoint;\n\n if (_ju.isString(ep)) {\n endpoint = _e(ep, endpointArgs);\n }\n else if (_ju.isArray(ep)) {\n endpointArgs = _ju.merge(ep[1], endpointArgs);\n endpoint = _e(ep[0], endpointArgs);\n }\n else {\n endpoint = ep.clone();\n }\n\n // assign a clone function using a copy of endpointArgs. this is used when a drag starts: the endpoint that was dragged is cloned,\n // and the clone is left in its place while the original one goes off on a magical journey.\n // the copy is to get around a closure problem, in which endpointArgs ends up getting shared by\n // the whole world.\n //var argsForClone = jsPlumb.extend({}, endpointArgs);\n endpoint.clone = function () {\n // TODO this, and the code above, can be refactored to be more dry.\n if (_ju.isString(ep)) {\n return _e(ep, endpointArgs);\n }\n else if (_ju.isArray(ep)) {\n endpointArgs = _ju.merge(ep[1], endpointArgs);\n return _e(ep[0], endpointArgs);\n }\n }.bind(this);\n\n endpoint.typeId = typeId;\n return endpoint;\n };\n\n this.setEndpoint = function(ep, doNotRepaint) {\n var _ep = this.prepareEndpoint(ep);\n this.setPreparedEndpoint(_ep, true);\n };\n\n this.setPreparedEndpoint = function (ep, doNotRepaint) {\n if (this.endpoint != null) {\n this.endpoint.cleanup();\n this.endpoint.destroy();\n }\n this.endpoint = ep;\n this.type = this.endpoint.type;\n this.canvas = this.endpoint.canvas;\n };\n\n _jp.extend(this, params, typeParameters);\n\n this.isSource = params.isSource || false;\n this.isTemporarySource = params.isTemporarySource || false;\n this.isTarget = params.isTarget || false;\n\n this.connections = params.connections || [];\n this.connectorPointerEvents = params[\"connector-pointer-events\"];\n\n this.scope = params.scope || _jsPlumb.getDefaultScope();\n this.timestamp = null;\n this.reattachConnections = params.reattach || _jsPlumb.Defaults.ReattachConnections;\n this.connectionsDetachable = _jsPlumb.Defaults.ConnectionsDetachable;\n if (params.connectionsDetachable === false || params.detachable === false) {\n this.connectionsDetachable = false;\n }\n this.dragAllowedWhenFull = params.dragAllowedWhenFull !== false;\n\n if (params.onMaxConnections) {\n this.bind(\"maxConnections\", params.onMaxConnections);\n }\n\n //\n // add a connection. not part of public API.\n //\n this.addConnection = function (connection) {\n this.connections.push(connection);\n this[(this.connections.length > 0 ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointConnectedClass);\n this[(this.isFull() ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointFullClass);\n };\n\n this.detachFromConnection = function (connection, idx, doNotCleanup) {\n idx = idx == null ? this.connections.indexOf(connection) : idx;\n if (idx >= 0) {\n this.connections.splice(idx, 1);\n this[(this.connections.length > 0 ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointConnectedClass);\n this[(this.isFull() ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointFullClass);\n }\n\n if (!doNotCleanup && deleteOnEmpty && this.connections.length === 0) {\n _jsPlumb.deleteObject({\n endpoint: this,\n fireEvent: false,\n deleteAttachedObjects: doNotCleanup !== true\n });\n }\n };\n\n this.deleteEveryConnection = function(params) {\n var c = this.connections.length;\n for (var i = 0; i < c; i++) {\n _jsPlumb.deleteConnection(this.connections[0], params);\n }\n };\n\n this.detachFrom = function (targetEndpoint, fireEvent, originalEvent) {\n var c = [];\n for (var i = 0; i < this.connections.length; i++) {\n if (this.connections[i].endpoints[1] === targetEndpoint || this.connections[i].endpoints[0] === targetEndpoint) {\n c.push(this.connections[i]);\n }\n }\n for (var j = 0, count = c.length; j < count; j++) {\n _jsPlumb.deleteConnection(c[0]);\n }\n return this;\n };\n\n this.getElement = function () {\n return this.element;\n };\n\n this.setElement = function (el) {\n var parentId = this._jsPlumb.instance.getId(el),\n curId = this.elementId;\n // remove the endpoint from the list for the current endpoint's element\n _ju.removeWithFunction(params.endpointsByElement[this.elementId], function (e) {\n return e.id === this.id;\n }.bind(this));\n this.element = _jp.getElement(el);\n this.elementId = _jsPlumb.getId(this.element);\n _jsPlumb.anchorManager.rehomeEndpoint(this, curId, this.element);\n _jsPlumb.dragManager.endpointAdded(this.element);\n _ju.addToList(params.endpointsByElement, parentId, this);\n return this;\n };\n\n /**\n * private but must be exposed.\n */\n this.makeInPlaceCopy = function () {\n var loc = this.anchor.getCurrentLocation({element: this}),\n o = this.anchor.getOrientation(this),\n acc = this.anchor.getCssClass(),\n inPlaceAnchor = {\n bind: function () {\n },\n compute: function () {\n return [ loc[0], loc[1] ];\n },\n getCurrentLocation: function () {\n return [ loc[0], loc[1] ];\n },\n getOrientation: function () {\n return o;\n },\n getCssClass: function () {\n return acc;\n }\n };\n\n return _newEndpoint({\n dropOptions: params.dropOptions,\n anchor: inPlaceAnchor,\n source: this.element,\n paintStyle: this.getPaintStyle(),\n endpoint: params.hideOnDrag ? \"Blank\" : this.endpoint,\n _transient: true,\n scope: this.scope,\n reference:this\n });\n };\n\n /**\n * returns a connection from the pool; used when dragging starts. just gets the head of the array if it can.\n */\n this.connectorSelector = function () {\n return this.connections[0];\n };\n\n this.setStyle = this.setPaintStyle;\n\n this.paint = function (params) {\n params = params || {};\n var timestamp = params.timestamp, recalc = !(params.recalc === false);\n if (!timestamp || this.timestamp !== timestamp) {\n\n var info = _jsPlumb.updateOffset({ elId: this.elementId, timestamp: timestamp });\n\n var xy = params.offset ? params.offset.o : info.o;\n if (xy != null) {\n var ap = params.anchorPoint, connectorPaintStyle = params.connectorPaintStyle;\n if (ap == null) {\n var wh = params.dimensions || info.s,\n anchorParams = { xy: [ xy.left, xy.top ], wh: wh, element: this, timestamp: timestamp };\n if (recalc && this.anchor.isDynamic && this.connections.length > 0) {\n var c = findConnectionToUseForDynamicAnchor(this, params.elementWithPrecedence),\n oIdx = c.endpoints[0] === this ? 1 : 0,\n oId = oIdx === 0 ? c.sourceId : c.targetId,\n oInfo = _jsPlumb.getCachedData(oId),\n oOffset = oInfo.o, oWH = oInfo.s;\n\n anchorParams.index = oIdx === 0 ? 1 : 0;\n anchorParams.connection = c;\n anchorParams.txy = [ oOffset.left, oOffset.top ];\n anchorParams.twh = oWH;\n anchorParams.tElement = c.endpoints[oIdx];\n } else if (this.connections.length > 0) {\n anchorParams.connection = this.connections[0];\n }\n ap = this.anchor.compute(anchorParams);\n }\n\n this.endpoint.compute(ap, this.anchor.getOrientation(this), this._jsPlumb.paintStyleInUse, connectorPaintStyle || this.paintStyleInUse);\n this.endpoint.paint(this._jsPlumb.paintStyleInUse, this.anchor);\n this.timestamp = timestamp;\n\n // paint overlays\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays.hasOwnProperty(i)) {\n var o = this._jsPlumb.overlays[i];\n if (o.isVisible()) {\n this._jsPlumb.overlayPlacements[i] = o.draw(this.endpoint, this._jsPlumb.paintStyleInUse);\n o.paint(this._jsPlumb.overlayPlacements[i]);\n }\n }\n }\n }\n }\n };\n\n this.getTypeDescriptor = function () {\n return \"endpoint\";\n };\n this.isVisible = function () {\n return this._jsPlumb.visible;\n };\n\n this.repaint = this.paint;\n\n var draggingInitialised = false;\n this.initDraggable = function () {\n\n // is this a connection source? we make it draggable and have the\n // drag listener maintain a connection with a floating endpoint.\n if (!draggingInitialised && _jp.isDragSupported(this.element)) {\n var placeholderInfo = { id: null, element: null },\n jpc = null,\n existingJpc = false,\n existingJpcParams = null,\n _dragHandler = _makeConnectionDragHandler(this, placeholderInfo, _jsPlumb),\n dragOptions = params.dragOptions || {},\n defaultOpts = {},\n startEvent = _jp.dragEvents.start,\n stopEvent = _jp.dragEvents.stop,\n dragEvent = _jp.dragEvents.drag,\n beforeStartEvent = _jp.dragEvents.beforeStart,\n payload;\n\n // respond to beforeStart from katavorio; this will have, optionally, a payload of attribute values\n // that were placed there by the makeSource mousedown listener.\n var beforeStart = function(beforeStartParams) {\n payload = beforeStartParams.e.payload || {};\n };\n\n var start = function (startParams) {\n\n// ------------- first, get a connection to drag. this may be null, in which case we are dragging a new one.\n\n jpc = this.connectorSelector();\n\n// -------------------------------- now a bunch of tests about whether or not to proceed -------------------------\n\n var _continue = true;\n // if not enabled, return\n if (!this.isEnabled()) {\n _continue = false;\n }\n // if no connection and we're not a source - or temporarily a source, as is the case with makeSource - return.\n if (jpc == null && !this.isSource && !this.isTemporarySource) {\n _continue = false;\n }\n // otherwise if we're full and not allowed to drag, also return false.\n if (this.isSource && this.isFull() && !(jpc != null && this.dragAllowedWhenFull)) {\n _continue = false;\n }\n // if the connection was setup as not detachable or one of its endpoints\n // was setup as connectionsDetachable = false, or Defaults.ConnectionsDetachable\n // is set to false...\n if (jpc != null && !jpc.isDetachable(this)) {\n // .. and the endpoint is full\n if (this.isFull()) {\n _continue = false;\n } else {\n // otherwise, if not full, set the connection to null, and we will now proceed\n // to drag a new connection.\n jpc = null;\n }\n }\n\n var beforeDrag = _jsPlumb.checkCondition(jpc == null ? \"beforeDrag\" : \"beforeStartDetach\", {\n endpoint:this,\n source:this.element,\n sourceId:this.elementId,\n connection:jpc\n });\n if (beforeDrag === false) {\n _continue = false;\n }\n // else we might have been given some data. we'll pass it in to a new connection as 'data'.\n // here we also merge in the optional payload we were given on mousedown.\n else if (typeof beforeDrag === \"object\") {\n _jp.extend(beforeDrag, payload || {});\n }\n else {\n // or if no beforeDrag data, maybe use the payload on its own.\n beforeDrag = payload || {};\n }\n\n if (_continue === false) {\n // this is for mootools and yui. returning false from this causes jquery to stop drag.\n // the events are wrapped in both mootools and yui anyway, but i don't think returning\n // false from the start callback would stop a drag.\n if (_jsPlumb.stopDrag) {\n _jsPlumb.stopDrag(this.canvas);\n }\n _dragHandler.stopDrag();\n return false;\n }\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n // ok to proceed.\n\n // clear hover for all connections for this endpoint before continuing.\n for (var i = 0; i < this.connections.length; i++) {\n this.connections[i].setHover(false);\n }\n\n this.addClass(\"endpointDrag\");\n _jsPlumb.setConnectionBeingDragged(true);\n\n // if we're not full but there was a connection, make it null. we'll create a new one.\n if (jpc && !this.isFull() && this.isSource) {\n jpc = null;\n }\n\n _jsPlumb.updateOffset({ elId: this.elementId });\n\n// ---------------- make the element we will drag around, and position it -----------------------------\n\n var ipco = this._jsPlumb.instance.getOffset(this.canvas),\n canvasElement = this.canvas,\n ips = this._jsPlumb.instance.getSize(this.canvas);\n\n _makeDraggablePlaceholder(placeholderInfo, _jsPlumb, ipco, ips);\n\n // store the id of the dragging div and the source element. the drop function will pick these up. \n _jsPlumb.setAttributes(this.canvas, {\n \"dragId\": placeholderInfo.id,\n \"elId\": this.elementId\n });\n\n// ------------------- create an endpoint that will be our floating endpoint ------------------------------------\n\n var endpointToFloat = this.dragProxy || this.endpoint;\n if (this.dragProxy == null && this.connectionType != null) {\n var aae = this._jsPlumb.instance.deriveEndpointAndAnchorSpec(this.connectionType);\n if (aae.endpoints[1]) {\n endpointToFloat = aae.endpoints[1];\n }\n }\n var centerAnchor = this._jsPlumb.instance.makeAnchor(\"Center\");\n centerAnchor.isFloating = true;\n this._jsPlumb.floatingEndpoint = _makeFloatingEndpoint(this.getPaintStyle(), centerAnchor, endpointToFloat, this.canvas, placeholderInfo.element, _jsPlumb, _newEndpoint, this.scope);\n var _savedAnchor = this._jsPlumb.floatingEndpoint.anchor;\n\n\n if (jpc == null) {\n\n this.setHover(false, false);\n // create a connection. one end is this endpoint, the other is a floating endpoint. \n jpc = _newConnection({\n sourceEndpoint: this,\n targetEndpoint: this._jsPlumb.floatingEndpoint,\n source: this.element, // for makeSource with parent option. ensure source element is represented correctly.\n target: placeholderInfo.element,\n anchors: [ this.anchor, this._jsPlumb.floatingEndpoint.anchor ],\n paintStyle: params.connectorStyle, // this can be null. Connection will use the default.\n hoverPaintStyle: params.connectorHoverStyle,\n connector: params.connector, // this can also be null. Connection will use the default.\n overlays: params.connectorOverlays,\n type: this.connectionType,\n cssClass: this.connectorClass,\n hoverClass: this.connectorHoverClass,\n scope:params.scope,\n data:beforeDrag\n });\n jpc.pending = true;\n jpc.addClass(_jsPlumb.draggingClass);\n this._jsPlumb.floatingEndpoint.addClass(_jsPlumb.draggingClass);\n this._jsPlumb.floatingEndpoint.anchor = _savedAnchor;\n // fire an event that informs that a connection is being dragged\n _jsPlumb.fire(\"connectionDrag\", jpc);\n\n // register the new connection on the drag manager. This connection, at this point, is 'pending',\n // and has as its target a temporary element (the 'placeholder'). If the connection subsequently\n // becomes established, the anchor manager is informed that the target of the connection has\n // changed.\n\n _jsPlumb.anchorManager.newConnection(jpc);\n\n } else {\n existingJpc = true;\n jpc.setHover(false);\n // new anchor idx\n var anchorIdx = jpc.endpoints[0].id === this.id ? 0 : 1;\n this.detachFromConnection(jpc, null, true); // detach from the connection while dragging is occurring. but dont cleanup automatically.\n\n // store the original scope (issue 57)\n var dragScope = _jsPlumb.getDragScope(canvasElement);\n _jsPlumb.setAttribute(this.canvas, \"originalScope\", dragScope);\n\n // fire an event that informs that a connection is being dragged. we do this before\n // replacing the original target with the floating element info.\n _jsPlumb.fire(\"connectionDrag\", jpc);\n\n // now we replace ourselves with the temporary div we created above:\n if (anchorIdx === 0) {\n existingJpcParams = [ jpc.source, jpc.sourceId, canvasElement, dragScope ];\n _jsPlumb.anchorManager.sourceChanged(jpc.endpoints[anchorIdx].elementId, placeholderInfo.id, jpc, placeholderInfo.element);\n\n } else {\n existingJpcParams = [ jpc.target, jpc.targetId, canvasElement, dragScope ];\n jpc.target = placeholderInfo.element;\n jpc.targetId = placeholderInfo.id;\n\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.endpoints[anchorIdx].elementId, jpc.targetId, jpc);\n }\n\n // store the original endpoint and assign the new floating endpoint for the drag.\n jpc.suspendedEndpoint = jpc.endpoints[anchorIdx];\n\n // PROVIDE THE SUSPENDED ELEMENT, BE IT A SOURCE OR TARGET (ISSUE 39)\n jpc.suspendedElement = jpc.endpoints[anchorIdx].getElement();\n jpc.suspendedElementId = jpc.endpoints[anchorIdx].elementId;\n jpc.suspendedElementType = anchorIdx === 0 ? \"source\" : \"target\";\n\n jpc.suspendedEndpoint.setHover(false);\n this._jsPlumb.floatingEndpoint.referenceEndpoint = jpc.suspendedEndpoint;\n jpc.endpoints[anchorIdx] = this._jsPlumb.floatingEndpoint;\n\n jpc.addClass(_jsPlumb.draggingClass);\n this._jsPlumb.floatingEndpoint.addClass(_jsPlumb.draggingClass);\n }\n\n _jsPlumb.registerFloatingConnection(placeholderInfo, jpc, this._jsPlumb.floatingEndpoint);\n\n // // register it and register connection on it.\n // _jsPlumb.floatingConnections[placeholderInfo.id] = jpc;\n //\n // // only register for the target endpoint; we will not be dragging the source at any time\n // // before this connection is either discarded or made into a permanent connection.\n // _ju.addToList(params.endpointsByElement, placeholderInfo.id, this._jsPlumb.floatingEndpoint);\n\n\n // tell jsplumb about it\n _jsPlumb.currentlyDragging = true;\n }.bind(this);\n\n var stop = function () {\n _jsPlumb.setConnectionBeingDragged(false);\n\n if (jpc && jpc.endpoints != null) {\n // get the actual drop event (decode from library args to stop function)\n var originalEvent = _jsPlumb.getDropEvent(arguments);\n // unlock the other endpoint (if it is dynamic, it would have been locked at drag start)\n var idx = _jsPlumb.getFloatingAnchorIndex(jpc);\n jpc.endpoints[idx === 0 ? 1 : 0].anchor.unlock();\n // TODO: Dont want to know about css classes inside jsplumb, ideally.\n jpc.removeClass(_jsPlumb.draggingClass);\n\n // if we have the floating endpoint then the connection has not been dropped\n // on another endpoint. If it is a new connection we throw it away. If it is an\n // existing connection we check to see if we should reattach it, throwing it away\n // if not.\n if (this._jsPlumb && (jpc.deleteConnectionNow || jpc.endpoints[idx] === this._jsPlumb.floatingEndpoint)) {\n // 6a. if the connection was an existing one...\n if (existingJpc && jpc.suspendedEndpoint) {\n // fix for issue35, thanks Sylvain Gizard: when firing the detach event make sure the\n // floating endpoint has been replaced.\n if (idx === 0) {\n jpc.floatingElement = jpc.source;\n jpc.floatingId = jpc.sourceId;\n jpc.floatingEndpoint = jpc.endpoints[0];\n jpc.floatingIndex = 0;\n jpc.source = existingJpcParams[0];\n jpc.sourceId = existingJpcParams[1];\n } else {\n // keep a copy of the floating element; the anchor manager will want to clean up.\n jpc.floatingElement = jpc.target;\n jpc.floatingId = jpc.targetId;\n jpc.floatingEndpoint = jpc.endpoints[1];\n jpc.floatingIndex = 1;\n jpc.target = existingJpcParams[0];\n jpc.targetId = existingJpcParams[1];\n }\n\n var fe = this._jsPlumb.floatingEndpoint; // store for later removal.\n // restore the original scope (issue 57)\n _jsPlumb.setDragScope(existingJpcParams[2], existingJpcParams[3]);\n jpc.endpoints[idx] = jpc.suspendedEndpoint;\n // if the connection should be reattached, or the other endpoint refuses detach, then\n // reset the connection to its original state\n if (jpc.isReattach() || jpc._forceReattach || jpc._forceDetach || !_jsPlumb.deleteConnection(jpc, {originalEvent: originalEvent})) {\n\n jpc.setHover(false);\n jpc._forceDetach = null;\n jpc._forceReattach = null;\n this._jsPlumb.floatingEndpoint.detachFromConnection(jpc);\n jpc.suspendedEndpoint.addConnection(jpc);\n\n // TODO this code is duplicated in lots of places...and there is nothing external\n // in the code; it all refers to the connection itself. we could add a\n // `checkSanity(connection)` method to anchorManager that did this.\n if (idx === 1) {\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.floatingId, jpc.targetId, jpc);\n }\n else {\n _jsPlumb.anchorManager.sourceChanged(jpc.floatingId, jpc.sourceId, jpc, jpc.source);\n }\n\n _jsPlumb.repaint(existingJpcParams[1]);\n }\n else {\n _jsPlumb.deleteObject({endpoint: fe});\n }\n }\n }\n\n // makeTargets sets this flag, to tell us we have been replaced and should delete this object.\n if (this.deleteAfterDragStop) {\n _jsPlumb.deleteObject({endpoint: this});\n }\n else {\n if (this._jsPlumb) {\n this.paint({recalc: false});\n }\n }\n\n // although the connection is no longer valid, there are use cases where this is useful.\n _jsPlumb.fire(\"connectionDragStop\", jpc, originalEvent);\n // fire this event to give people more fine-grained control (connectionDragStop fires a lot)\n if (jpc.pending) {\n _jsPlumb.fire(\"connectionAborted\", jpc, originalEvent);\n }\n // tell jsplumb that dragging is finished.\n _jsPlumb.currentlyDragging = false;\n jpc.suspendedElement = null;\n jpc.suspendedEndpoint = null;\n jpc = null;\n }\n\n // if no endpoints, jpc already cleaned up. but still we want to ensure we're reset properly.\n // remove the element associated with the floating endpoint\n // (and its associated floating endpoint and visual artefacts)\n if (placeholderInfo && placeholderInfo.element) {\n _jsPlumb.remove(placeholderInfo.element, false, false);\n }\n // remove the inplace copy\n if (inPlaceCopy) {\n _jsPlumb.deleteObject({endpoint: inPlaceCopy});\n }\n\n if (this._jsPlumb) {\n // make our canvas visible (TODO: hand off to library; we should not know about DOM)\n this.canvas.style.visibility = \"visible\";\n // unlock our anchor\n this.anchor.unlock();\n // clear floating anchor.\n this._jsPlumb.floatingEndpoint = null;\n }\n\n }.bind(this);\n\n dragOptions = _jp.extend(defaultOpts, dragOptions);\n dragOptions.scope = this.scope || dragOptions.scope;\n dragOptions[beforeStartEvent] = _ju.wrap(dragOptions[beforeStartEvent], beforeStart, false);\n dragOptions[startEvent] = _ju.wrap(dragOptions[startEvent], start, false);\n // extracted drag handler function so can be used by makeSource\n dragOptions[dragEvent] = _ju.wrap(dragOptions[dragEvent], _dragHandler.drag);\n dragOptions[stopEvent] = _ju.wrap(dragOptions[stopEvent], stop);\n dragOptions.multipleDrop = false;\n\n dragOptions.canDrag = function () {\n return this.isSource || this.isTemporarySource || (this.connections.length > 0 && this.connectionsDetachable !== false);\n }.bind(this);\n\n _jsPlumb.initDraggable(this.canvas, dragOptions, \"internal\");\n\n this.canvas._jsPlumbRelatedElement = this.element;\n\n draggingInitialised = true;\n }\n };\n\n var ep = params.endpoint || this._jsPlumb.instance.Defaults.Endpoint || _jp.Defaults.Endpoint;\n this.setEndpoint(ep, true);\n var anchorParamsToUse = params.anchor ? params.anchor : params.anchors ? params.anchors : (_jsPlumb.Defaults.Anchor || \"Top\");\n this.setAnchor(anchorParamsToUse, true);\n\n // finally, set type if it was provided\n var type = [ \"default\", (params.type || \"\")].join(\" \");\n this.addType(type, params.data, true);\n this.canvas = this.endpoint.canvas;\n this.canvas._jsPlumb = this;\n\n this.initDraggable();\n\n // pulled this out into a function so we can reuse it for the inPlaceCopy canvas; you can now drop detached connections\n // back onto the endpoint you detached it from.\n var _initDropTarget = function (canvas, isTransient, endpoint, referenceEndpoint) {\n\n if (_jp.isDropSupported(this.element)) {\n var dropOptions = params.dropOptions || _jsPlumb.Defaults.DropOptions || _jp.Defaults.DropOptions;\n dropOptions = _jp.extend({}, dropOptions);\n dropOptions.scope = dropOptions.scope || this.scope;\n var dropEvent = _jp.dragEvents.drop,\n overEvent = _jp.dragEvents.over,\n outEvent = _jp.dragEvents.out,\n _ep = this,\n drop = _jsPlumb.EndpointDropHandler({\n getEndpoint: function () {\n return _ep;\n },\n jsPlumb: _jsPlumb,\n enabled: function () {\n return endpoint != null ? endpoint.isEnabled() : true;\n },\n isFull: function () {\n return endpoint.isFull();\n },\n element: this.element,\n elementId: this.elementId,\n isSource: this.isSource,\n isTarget: this.isTarget,\n addClass: function (clazz) {\n _ep.addClass(clazz);\n },\n removeClass: function (clazz) {\n _ep.removeClass(clazz);\n },\n isDropAllowed: function () {\n return _ep.isDropAllowed.apply(_ep, arguments);\n },\n reference:referenceEndpoint,\n isRedrop:function(jpc, dhParams) {\n return jpc.suspendedEndpoint && dhParams.reference && (jpc.suspendedEndpoint.id === dhParams.reference.id);\n }\n });\n\n dropOptions[dropEvent] = _ju.wrap(dropOptions[dropEvent], drop, true);\n dropOptions[overEvent] = _ju.wrap(dropOptions[overEvent], function () {\n var draggable = _jp.getDragObject(arguments),\n id = _jsPlumb.getAttribute(_jp.getElement(draggable), \"dragId\"),\n _jpc = _jsPlumb.getFloatingConnectionFor(id);//_jsPlumb.floatingConnections[id];\n\n if (_jpc != null) {\n var idx = _jsPlumb.getFloatingAnchorIndex(_jpc);\n // here we should fire the 'over' event if we are a target and this is a new connection,\n // or we are the same as the floating endpoint.\n var _cont = (this.isTarget && idx !== 0) || (_jpc.suspendedEndpoint && this.referenceEndpoint && this.referenceEndpoint.id === _jpc.suspendedEndpoint.id);\n if (_cont) {\n var bb = _jsPlumb.checkCondition(\"checkDropAllowed\", {\n sourceEndpoint: _jpc.endpoints[idx],\n targetEndpoint: this,\n connection: _jpc\n });\n this[(bb ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointDropAllowedClass);\n this[(bb ? \"remove\" : \"add\") + \"Class\"](_jsPlumb.endpointDropForbiddenClass);\n _jpc.endpoints[idx].anchor.over(this.anchor, this);\n }\n }\n }.bind(this));\n\n dropOptions[outEvent] = _ju.wrap(dropOptions[outEvent], function () {\n var draggable = _jp.getDragObject(arguments),\n id = draggable == null ? null : _jsPlumb.getAttribute(_jp.getElement(draggable), \"dragId\"),\n _jpc = id ? _jsPlumb.getFloatingConnectionFor(id) : null;\n\n if (_jpc != null) {\n var idx = _jsPlumb.getFloatingAnchorIndex(_jpc);\n var _cont = (this.isTarget && idx !== 0) || (_jpc.suspendedEndpoint && this.referenceEndpoint && this.referenceEndpoint.id === _jpc.suspendedEndpoint.id);\n if (_cont) {\n this.removeClass(_jsPlumb.endpointDropAllowedClass);\n this.removeClass(_jsPlumb.endpointDropForbiddenClass);\n _jpc.endpoints[idx].anchor.out();\n }\n }\n }.bind(this));\n\n _jsPlumb.initDroppable(canvas, dropOptions, \"internal\", isTransient);\n }\n }.bind(this);\n\n // Initialise the endpoint's canvas as a drop target. The drop handler will take care of the logic of whether\n // something can actually be dropped.\n if (!this.anchor.isFloating) {\n _initDropTarget(this.canvas, !(params._transient || this.anchor.isFloating), this, params.reference);\n }\n\n return this;\n };\n\n _ju.extend(_jp.Endpoint, _jp.OverlayCapableJsPlumbUIComponent, {\n\n setVisible: function (v, doNotChangeConnections, doNotNotifyOtherEndpoint) {\n this._jsPlumb.visible = v;\n if (this.canvas) {\n this.canvas.style.display = v ? \"block\" : \"none\";\n }\n this[v ? \"showOverlays\" : \"hideOverlays\"]();\n if (!doNotChangeConnections) {\n for (var i = 0; i < this.connections.length; i++) {\n this.connections[i].setVisible(v);\n if (!doNotNotifyOtherEndpoint) {\n var oIdx = this === this.connections[i].endpoints[0] ? 1 : 0;\n // only change the other endpoint if this is its only connection.\n if (this.connections[i].endpoints[oIdx].connections.length === 1) {\n this.connections[i].endpoints[oIdx].setVisible(v, true, true);\n }\n }\n }\n }\n },\n getAttachedElements: function () {\n return this.connections;\n },\n applyType: function (t, doNotRepaint) {\n this.setPaintStyle(t.endpointStyle || t.paintStyle, doNotRepaint);\n this.setHoverPaintStyle(t.endpointHoverStyle || t.hoverPaintStyle, doNotRepaint);\n if (t.maxConnections != null) {\n this._jsPlumb.maxConnections = t.maxConnections;\n }\n if (t.scope) {\n this.scope = t.scope;\n }\n _jp.extend(this, t, typeParameters);\n if (t.cssClass != null && this.canvas) {\n this._jsPlumb.instance.addClass(this.canvas, t.cssClass);\n }\n _jp.OverlayCapableJsPlumbUIComponent.applyType(this, t);\n },\n isEnabled: function () {\n return this._jsPlumb.enabled;\n },\n setEnabled: function (e) {\n this._jsPlumb.enabled = e;\n },\n cleanup: function () {\n var anchorClass = this._jsPlumb.instance.endpointAnchorClassPrefix + (this._jsPlumb.currentAnchorClass ? \"-\" + this._jsPlumb.currentAnchorClass : \"\");\n _jp.removeClass(this.element, anchorClass);\n this.anchor = null;\n this.endpoint.cleanup(true);\n this.endpoint.destroy();\n this.endpoint = null;\n // drag/drop\n this._jsPlumb.instance.destroyDraggable(this.canvas, \"internal\");\n this._jsPlumb.instance.destroyDroppable(this.canvas, \"internal\");\n },\n setHover: function (h) {\n if (this.endpoint && this._jsPlumb && !this._jsPlumb.instance.isConnectionBeingDragged()) {\n this.endpoint.setHover(h);\n }\n },\n isFull: function () {\n return this._jsPlumb.maxConnections === 0 ? true : !(this.isFloating() || this._jsPlumb.maxConnections < 0 || this.connections.length < this._jsPlumb.maxConnections);\n },\n /**\n * private but needs to be exposed.\n */\n isFloating: function () {\n return this.anchor != null && this.anchor.isFloating;\n },\n isConnectedTo: function (endpoint) {\n var found = false;\n if (endpoint) {\n for (var i = 0; i < this.connections.length; i++) {\n if (this.connections[i].endpoints[1] === endpoint || this.connections[i].endpoints[0] === endpoint) {\n found = true;\n break;\n }\n }\n }\n return found;\n },\n getConnectionCost: function () {\n return this._jsPlumb.connectionCost;\n },\n setConnectionCost: function (c) {\n this._jsPlumb.connectionCost = c;\n },\n areConnectionsDirected: function () {\n return this._jsPlumb.connectionsDirected;\n },\n setConnectionsDirected: function (b) {\n this._jsPlumb.connectionsDirected = b;\n },\n setElementId: function (_elId) {\n this.elementId = _elId;\n this.anchor.elementId = _elId;\n },\n setReferenceElement: function (_el) {\n this.element = _jp.getElement(_el);\n },\n setDragAllowedWhenFull: function (allowed) {\n this.dragAllowedWhenFull = allowed;\n },\n equals: function (endpoint) {\n return this.anchor.equals(endpoint.anchor);\n },\n getUuid: function () {\n return this._jsPlumb.uuid;\n },\n computeAnchor: function (params) {\n return this.anchor.compute(params);\n }\n });\n\n root.jsPlumbInstance.prototype.EndpointDropHandler = function (dhParams) {\n return function (e) {\n\n var _jsPlumb = dhParams.jsPlumb;\n\n // remove the classes that are added dynamically. drop is neither forbidden nor allowed now that\n // the drop is finishing.\n dhParams.removeClass(_jsPlumb.endpointDropAllowedClass);\n dhParams.removeClass(_jsPlumb.endpointDropForbiddenClass);\n\n var originalEvent = _jsPlumb.getDropEvent(arguments),\n draggable = _jsPlumb.getDragObject(arguments),\n id = _jsPlumb.getAttribute(draggable, \"dragId\"),\n elId = _jsPlumb.getAttribute(draggable, \"elId\"),\n scope = _jsPlumb.getAttribute(draggable, \"originalScope\"),\n jpc = _jsPlumb.getFloatingConnectionFor(id);\n\n // if no active connection, bail.\n if (jpc == null) {\n return;\n }\n\n // calculate if this is an existing connection.\n var existingConnection = jpc.suspendedEndpoint != null;\n\n // if suspended endpoint exists but has been cleaned up, bail. This means it's an existing connection\n // that has been detached and will shortly be discarded.\n if (existingConnection && jpc.suspendedEndpoint._jsPlumb == null) {\n return;\n }\n\n // get the drop endpoint. for a normal connection this is just the one that would replace the currently\n // floating endpoint. for a makeTarget this is a new endpoint that is created on drop. But we leave that to\n // the handler to figure out.\n var _ep = dhParams.getEndpoint(jpc);\n\n // If we're not given an endpoint to use, bail.\n if (_ep == null) {\n return;\n }\n\n // if this is a drop back where the connection came from, mark it force reattach and\n // return; the stop handler will reattach. without firing an event.\n if (dhParams.isRedrop(jpc, dhParams)) {\n jpc._forceReattach = true;\n jpc.setHover(false);\n if (dhParams.maybeCleanup) {\n dhParams.maybeCleanup(_ep);\n }\n return;\n }\n\n // ensure we dont bother trying to drop sources on non-source eps, and same for target.\n var idx = _jsPlumb.getFloatingAnchorIndex(jpc);\n if ((idx === 0 && !dhParams.isSource)|| (idx === 1 && !dhParams.isTarget)){\n if (dhParams.maybeCleanup) {\n dhParams.maybeCleanup(_ep);\n }\n return;\n }\n\n if (dhParams.onDrop) {\n dhParams.onDrop(jpc);\n }\n\n // restore the original scope if necessary (issue 57)\n if (scope) {\n _jsPlumb.setDragScope(draggable, scope);\n }\n\n // if the target of the drop is full, fire an event (we abort below)\n // makeTarget: keep.\n var isFull = dhParams.isFull(e);\n if (isFull) {\n _ep.fire(\"maxConnections\", {\n endpoint: this,\n connection: jpc,\n maxConnections: _ep._jsPlumb.maxConnections\n }, originalEvent);\n }\n //\n // if endpoint enabled, not full, and matches the index of the floating endpoint...\n if (!isFull && dhParams.enabled()) {\n var _doContinue = true;\n\n // before testing for beforeDrop, reset the connection's source/target to be the actual DOM elements\n // involved (that is, stash any temporary stuff used for dragging. but we need to keep it around in\n // order that the anchor manager can clean things up properly).\n if (idx === 0) {\n jpc.floatingElement = jpc.source;\n jpc.floatingId = jpc.sourceId;\n jpc.floatingEndpoint = jpc.endpoints[0];\n jpc.floatingIndex = 0;\n jpc.source = dhParams.element;\n jpc.sourceId = dhParams.elementId;\n } else {\n jpc.floatingElement = jpc.target;\n jpc.floatingId = jpc.targetId;\n jpc.floatingEndpoint = jpc.endpoints[1];\n jpc.floatingIndex = 1;\n jpc.target = dhParams.element;\n jpc.targetId = dhParams.elementId;\n }\n\n // if this is an existing connection and detach is not allowed we won't continue. The connection's\n // endpoints have been reinstated; everything is back to how it was.\n if (existingConnection && jpc.suspendedEndpoint.id !== _ep.id) {\n if (!jpc.isDetachAllowed(jpc) || !jpc.endpoints[idx].isDetachAllowed(jpc) || !jpc.suspendedEndpoint.isDetachAllowed(jpc) || !_jsPlumb.checkCondition(\"beforeDetach\", jpc)) {\n _doContinue = false;\n }\n }\n\n// ------------ wrap the execution path in a function so we can support asynchronous beforeDrop\n\n var continueFunction = function (optionalData) {\n // remove this jpc from the current endpoint, which is a floating endpoint that we will\n // subsequently discard.\n jpc.endpoints[idx].detachFromConnection(jpc);\n\n // if there's a suspended endpoint, detach it from the connection.\n if (jpc.suspendedEndpoint) {\n jpc.suspendedEndpoint.detachFromConnection(jpc);\n }\n\n jpc.endpoints[idx] = _ep;\n _ep.addConnection(jpc);\n\n // copy our parameters in to the connection:\n var params = _ep.getParameters();\n for (var aParam in params) {\n jpc.setParameter(aParam, params[aParam]);\n }\n\n if (!existingConnection) {\n // if not an existing connection and\n if (params.draggable) {\n _jsPlumb.initDraggable(this.element, dhParams.dragOptions, \"internal\", _jsPlumb);\n }\n }\n else {\n var suspendedElementId = jpc.suspendedEndpoint.elementId;\n _jsPlumb.fireMoveEvent({\n index: idx,\n originalSourceId: idx === 0 ? suspendedElementId : jpc.sourceId,\n newSourceId: idx === 0 ? _ep.elementId : jpc.sourceId,\n originalTargetId: idx === 1 ? suspendedElementId : jpc.targetId,\n newTargetId: idx === 1 ? _ep.elementId : jpc.targetId,\n originalSourceEndpoint: idx === 0 ? jpc.suspendedEndpoint : jpc.endpoints[0],\n newSourceEndpoint: idx === 0 ? _ep : jpc.endpoints[0],\n originalTargetEndpoint: idx === 1 ? jpc.suspendedEndpoint : jpc.endpoints[1],\n newTargetEndpoint: idx === 1 ? _ep : jpc.endpoints[1],\n connection: jpc\n }, originalEvent);\n }\n\n if (idx === 1) {\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.floatingId, jpc.targetId, jpc);\n }\n else {\n _jsPlumb.anchorManager.sourceChanged(jpc.floatingId, jpc.sourceId, jpc, jpc.source);\n }\n\n // when makeSource has uniqueEndpoint:true, we want to create connections with new endpoints\n // that are subsequently deleted. So makeSource sets `finalEndpoint`, which is the Endpoint to\n // which the connection should be attached. The `detachFromConnection` call below results in the\n // temporary endpoint being cleaned up.\n if (jpc.endpoints[0].finalEndpoint) {\n var _toDelete = jpc.endpoints[0];\n _toDelete.detachFromConnection(jpc);\n jpc.endpoints[0] = jpc.endpoints[0].finalEndpoint;\n jpc.endpoints[0].addConnection(jpc);\n }\n\n // if optionalData was given, merge it onto the connection's data.\n if (_ju.isObject(optionalData)) {\n jpc.mergeData(optionalData);\n }\n // finalise will inform the anchor manager and also add to\n // connectionsByScope if necessary.\n _jsPlumb.finaliseConnection(jpc, null, originalEvent, false);\n jpc.setHover(false);\n\n // SP continuous anchor flush\n _jsPlumb.revalidate(jpc.endpoints[0].element);\n\n }.bind(this);\n\n var dontContinueFunction = function () {\n // otherwise just put it back on the endpoint it was on before the drag.\n if (jpc.suspendedEndpoint) {\n jpc.endpoints[idx] = jpc.suspendedEndpoint;\n jpc.setHover(false);\n jpc._forceDetach = true;\n if (idx === 0) {\n jpc.source = jpc.suspendedEndpoint.element;\n jpc.sourceId = jpc.suspendedEndpoint.elementId;\n } else {\n jpc.target = jpc.suspendedEndpoint.element;\n jpc.targetId = jpc.suspendedEndpoint.elementId;\n }\n jpc.suspendedEndpoint.addConnection(jpc);\n\n // TODO checkSanity\n if (idx === 1) {\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.floatingId, jpc.targetId, jpc);\n }\n else {\n _jsPlumb.anchorManager.sourceChanged(jpc.floatingId, jpc.sourceId, jpc, jpc.source);\n }\n\n _jsPlumb.repaint(jpc.sourceId);\n jpc._forceDetach = false;\n }\n };\n\n// --------------------------------------\n // now check beforeDrop. this will be available only on Endpoints that are setup to\n // have a beforeDrop condition (although, secretly, under the hood all Endpoints and\n // the Connection have them, because they are on jsPlumbUIComponent. shhh!), because\n // it only makes sense to have it on a target endpoint.\n _doContinue = _doContinue && dhParams.isDropAllowed(jpc.sourceId, jpc.targetId, jpc.scope, jpc, _ep);// && jpc.pending;\n\n if (_doContinue) {\n continueFunction(_doContinue);\n return true;\n }\n else {\n dontContinueFunction();\n }\n }\n\n if (dhParams.maybeCleanup) {\n dhParams.maybeCleanup(_ep);\n }\n\n _jsPlumb.currentlyDragging = false;\n };\n };\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the code for Connections.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this,\n _jp = root.jsPlumb,\n _ju = root.jsPlumbUtil;\n\n var makeConnector = function (_jsPlumb, renderMode, connectorName, connectorArgs, forComponent) {\n // first make sure we have a cache for the specified renderer\n _jp.Connectors[renderMode] = _jp.Connectors[renderMode] || {};\n\n // now see if the one we want exists; if not we will try to make it\n if (_jp.Connectors[renderMode][connectorName] == null) {\n\n if (_jp.Connectors[connectorName] == null) {\n if (!_jsPlumb.Defaults.DoNotThrowErrors) {\n throw new TypeError(\"jsPlumb: unknown connector type '\" + connectorName + \"'\");\n } else {\n return null;\n }\n }\n\n _jp.Connectors[renderMode][connectorName] = function() {\n _jp.Connectors[connectorName].apply(this, arguments);\n _jp.ConnectorRenderers[renderMode].apply(this, arguments);\n };\n\n _ju.extend(_jp.Connectors[renderMode][connectorName], [ _jp.Connectors[connectorName], _jp.ConnectorRenderers[renderMode]]);\n\n }\n\n return new _jp.Connectors[renderMode][connectorName](connectorArgs, forComponent);\n },\n _makeAnchor = function (anchorParams, elementId, _jsPlumb) {\n return (anchorParams) ? _jsPlumb.makeAnchor(anchorParams, elementId, _jsPlumb) : null;\n },\n _updateConnectedClass = function (conn, element, _jsPlumb, remove) {\n if (element != null) {\n element._jsPlumbConnections = element._jsPlumbConnections || {};\n if (remove) {\n delete element._jsPlumbConnections[conn.id];\n }\n else {\n element._jsPlumbConnections[conn.id] = true;\n }\n\n if (_ju.isEmpty(element._jsPlumbConnections)) {\n _jsPlumb.removeClass(element, _jsPlumb.connectedClass);\n }\n else {\n _jsPlumb.addClass(element, _jsPlumb.connectedClass);\n }\n }\n };\n\n _jp.Connection = function (params) {\n var _newEndpoint = params.newEndpoint;\n\n this.id = params.id;\n this.connector = null;\n this.idPrefix = \"_jsplumb_c_\";\n this.defaultLabelLocation = 0.5;\n this.defaultOverlayKeys = [\"Overlays\", \"ConnectionOverlays\"];\n // if a new connection is the result of moving some existing connection, params.previousConnection\n // will have that Connection in it. listeners for the jsPlumbConnection event can look for that\n // member and take action if they need to.\n this.previousConnection = params.previousConnection;\n this.source = _jp.getElement(params.source);\n this.target = _jp.getElement(params.target);\n\n\n _jp.OverlayCapableJsPlumbUIComponent.apply(this, arguments);\n\n // sourceEndpoint and targetEndpoint override source/target, if they are present. but \n // source is not overridden if the Endpoint has declared it is not the final target of a connection;\n // instead we use the source that the Endpoint declares will be the final source element.\n if (params.sourceEndpoint) {\n this.source = params.sourceEndpoint.getElement();\n this.sourceId = params.sourceEndpoint.elementId;\n } else {\n this.sourceId = this._jsPlumb.instance.getId(this.source);\n }\n\n if (params.targetEndpoint) {\n this.target = params.targetEndpoint.getElement();\n this.targetId = params.targetEndpoint.elementId;\n } else {\n this.targetId = this._jsPlumb.instance.getId(this.target);\n }\n\n\n this.scope = params.scope; // scope may have been passed in to the connect call. if it wasn't, we will pull it from the source endpoint, after having initialised the endpoints. \n this.endpoints = [];\n this.endpointStyles = [];\n\n var _jsPlumb = this._jsPlumb.instance;\n\n _jsPlumb.manage(this.sourceId, this.source);\n _jsPlumb.manage(this.targetId, this.target);\n\n this._jsPlumb.visible = true;\n\n this._jsPlumb.params = {\n cssClass: params.cssClass,\n container: params.container,\n \"pointer-events\": params[\"pointer-events\"],\n editorParams: params.editorParams,\n overlays: params.overlays\n };\n this._jsPlumb.lastPaintedAt = null;\n\n // listen to mouseover and mouseout events passed from the container delegate.\n this.bind(\"mouseover\", function () {\n this.setHover(true);\n }.bind(this));\n this.bind(\"mouseout\", function () {\n this.setHover(false);\n }.bind(this));\n\n\n// INITIALISATION CODE\n\n this.makeEndpoint = function (isSource, el, elId, ep) {\n elId = elId || this._jsPlumb.instance.getId(el);\n return this.prepareEndpoint(_jsPlumb, _newEndpoint, this, ep, isSource ? 0 : 1, params, el, elId);\n };\n\n // if type given, get the endpoint definitions mapping to that type from the jsplumb instance, and use those.\n // we apply types at the end of this constructor but endpoints are only honoured in a type definition at\n // create time.\n if (params.type) {\n params.endpoints = params.endpoints || this._jsPlumb.instance.deriveEndpointAndAnchorSpec(params.type).endpoints;\n }\n\n var eS = this.makeEndpoint(true, this.source, this.sourceId, params.sourceEndpoint),\n eT = this.makeEndpoint(false, this.target, this.targetId, params.targetEndpoint);\n\n if (eS) {\n _ju.addToList(params.endpointsByElement, this.sourceId, eS);\n }\n if (eT) {\n _ju.addToList(params.endpointsByElement, this.targetId, eT);\n }\n // if scope not set, set it to be the scope for the source endpoint.\n if (!this.scope) {\n this.scope = this.endpoints[0].scope;\n }\n\n // if explicitly told to (or not to) delete endpoints when empty, override endpoint's preferences\n if (params.deleteEndpointsOnEmpty != null) {\n this.endpoints[0].setDeleteOnEmpty(params.deleteEndpointsOnEmpty);\n this.endpoints[1].setDeleteOnEmpty(params.deleteEndpointsOnEmpty);\n }\n\n// -------------------------- DEFAULT TYPE ---------------------------------------------\n\n // DETACHABLE\n var _detachable = _jsPlumb.Defaults.ConnectionsDetachable;\n if (params.detachable === false) {\n _detachable = false;\n }\n if (this.endpoints[0].connectionsDetachable === false) {\n _detachable = false;\n }\n if (this.endpoints[1].connectionsDetachable === false) {\n _detachable = false;\n }\n // REATTACH\n var _reattach = params.reattach || this.endpoints[0].reattachConnections || this.endpoints[1].reattachConnections || _jsPlumb.Defaults.ReattachConnections;\n\n this.appendToDefaultType({\n detachable: _detachable,\n reattach: _reattach,\n paintStyle:this.endpoints[0].connectorStyle || this.endpoints[1].connectorStyle || params.paintStyle || _jsPlumb.Defaults.PaintStyle || _jp.Defaults.PaintStyle,\n hoverPaintStyle:this.endpoints[0].connectorHoverStyle || this.endpoints[1].connectorHoverStyle || params.hoverPaintStyle || _jsPlumb.Defaults.HoverPaintStyle || _jp.Defaults.HoverPaintStyle\n });\n\n var _suspendedAt = _jsPlumb.getSuspendedAt();\n if (!_jsPlumb.isSuspendDrawing()) {\n // paint the endpoints\n var myInfo = _jsPlumb.getCachedData(this.sourceId),\n myOffset = myInfo.o, myWH = myInfo.s,\n otherInfo = _jsPlumb.getCachedData(this.targetId),\n otherOffset = otherInfo.o,\n otherWH = otherInfo.s,\n initialTimestamp = _suspendedAt || _jsPlumb.timestamp(),\n anchorLoc = this.endpoints[0].anchor.compute({\n xy: [ myOffset.left, myOffset.top ], wh: myWH, element: this.endpoints[0],\n elementId: this.endpoints[0].elementId,\n txy: [ otherOffset.left, otherOffset.top ], twh: otherWH, tElement: this.endpoints[1],\n timestamp: initialTimestamp\n });\n\n this.endpoints[0].paint({ anchorLoc: anchorLoc, timestamp: initialTimestamp });\n\n anchorLoc = this.endpoints[1].anchor.compute({\n xy: [ otherOffset.left, otherOffset.top ], wh: otherWH, element: this.endpoints[1],\n elementId: this.endpoints[1].elementId,\n txy: [ myOffset.left, myOffset.top ], twh: myWH, tElement: this.endpoints[0],\n timestamp: initialTimestamp\n });\n this.endpoints[1].paint({ anchorLoc: anchorLoc, timestamp: initialTimestamp });\n }\n\n this.getTypeDescriptor = function () {\n return \"connection\";\n };\n this.getAttachedElements = function () {\n return this.endpoints;\n };\n\n this.isDetachable = function (ep) {\n return this._jsPlumb.detachable === false ? false : ep != null ? ep.connectionsDetachable === true : this._jsPlumb.detachable === true;\n };\n this.setDetachable = function (detachable) {\n this._jsPlumb.detachable = detachable === true;\n };\n this.isReattach = function () {\n return this._jsPlumb.reattach === true || this.endpoints[0].reattachConnections === true || this.endpoints[1].reattachConnections === true;\n };\n this.setReattach = function (reattach) {\n this._jsPlumb.reattach = reattach === true;\n };\n\n// END INITIALISATION CODE\n\n\n// COST + DIRECTIONALITY\n // if cost not supplied, try to inherit from source endpoint\n this._jsPlumb.cost = params.cost || this.endpoints[0].getConnectionCost();\n this._jsPlumb.directed = params.directed;\n // inherit directed flag if set no source endpoint\n if (params.directed == null) {\n this._jsPlumb.directed = this.endpoints[0].areConnectionsDirected();\n }\n// END COST + DIRECTIONALITY\n\n// PARAMETERS\n // merge all the parameters objects into the connection. parameters set\n // on the connection take precedence; then source endpoint params, then\n // finally target endpoint params.\n var _p = _jp.extend({}, this.endpoints[1].getParameters());\n _jp.extend(_p, this.endpoints[0].getParameters());\n _jp.extend(_p, this.getParameters());\n this.setParameters(_p);\n// END PARAMETERS\n\n// PAINTING\n\n this.setConnector(this.endpoints[0].connector || this.endpoints[1].connector || params.connector || _jsPlumb.Defaults.Connector || _jp.Defaults.Connector, true);\n var data = params.data == null || !_ju.isObject(params.data) ? {} : params.data;\n this.getData = function() { return data; };\n this.setData = function(d) { data = d || {}; };\n this.mergeData = function(d) { data = _jp.extend(data, d); };\n\n // the very last thing we do is apply types, if there are any.\n var _types = [ \"default\", this.endpoints[0].connectionType, this.endpoints[1].connectionType, params.type ].join(\" \");\n if (/[^\\s]/.test(_types)) {\n this.addType(_types, params.data, true);\n }\n\n this.updateConnectedClass();\n\n// END PAINTING \n };\n\n _ju.extend(_jp.Connection, _jp.OverlayCapableJsPlumbUIComponent, {\n applyType: function (t, doNotRepaint, typeMap) {\n\n var _connector = null;\n if (t.connector != null) {\n _connector = this.getCachedTypeItem(\"connector\", typeMap.connector);\n if (_connector == null) {\n _connector = this.prepareConnector(t.connector, typeMap.connector);\n this.cacheTypeItem(\"connector\", _connector, typeMap.connector);\n }\n this.setPreparedConnector(_connector);\n }\n\n // none of these things result in the creation of objects so can be ignored.\n if (t.detachable != null) {\n this.setDetachable(t.detachable);\n }\n if (t.reattach != null) {\n this.setReattach(t.reattach);\n }\n if (t.scope) {\n this.scope = t.scope;\n }\n\n if (t.cssClass != null && this.canvas) {\n this._jsPlumb.instance.addClass(this.canvas, t.cssClass);\n }\n\n var _anchors = null;\n // this also results in the creation of objects.\n if (t.anchor) {\n // note that even if the param was anchor, we store `anchors`.\n _anchors = this.getCachedTypeItem(\"anchors\", typeMap.anchor);\n if (_anchors == null) {\n _anchors = [ this._jsPlumb.instance.makeAnchor(t.anchor), this._jsPlumb.instance.makeAnchor(t.anchor) ];\n this.cacheTypeItem(\"anchors\", _anchors, typeMap.anchor);\n }\n }\n else if (t.anchors) {\n _anchors = this.getCachedTypeItem(\"anchors\", typeMap.anchors);\n if (_anchors == null) {\n _anchors = [\n this._jsPlumb.instance.makeAnchor(t.anchors[0]),\n this._jsPlumb.instance.makeAnchor(t.anchors[1])\n ];\n this.cacheTypeItem(\"anchors\", _anchors, typeMap.anchors);\n }\n }\n if (_anchors != null) {\n this.endpoints[0].anchor = _anchors[0];\n this.endpoints[1].anchor = _anchors[1];\n if (this.endpoints[1].anchor.isDynamic) {\n this._jsPlumb.instance.repaint(this.endpoints[1].elementId);\n }\n }\n\n _jp.OverlayCapableJsPlumbUIComponent.applyType(this, t);\n },\n addClass: function (c, informEndpoints) {\n if (informEndpoints) {\n this.endpoints[0].addClass(c);\n this.endpoints[1].addClass(c);\n if (this.suspendedEndpoint) {\n this.suspendedEndpoint.addClass(c);\n }\n }\n if (this.connector) {\n this.connector.addClass(c);\n }\n },\n removeClass: function (c, informEndpoints) {\n if (informEndpoints) {\n this.endpoints[0].removeClass(c);\n this.endpoints[1].removeClass(c);\n if (this.suspendedEndpoint) {\n this.suspendedEndpoint.removeClass(c);\n }\n }\n if (this.connector) {\n this.connector.removeClass(c);\n }\n },\n isVisible: function () {\n return this._jsPlumb.visible;\n },\n setVisible: function (v) {\n this._jsPlumb.visible = v;\n if (this.connector) {\n this.connector.setVisible(v);\n }\n this.repaint();\n },\n cleanup: function () {\n this.updateConnectedClass(true);\n this.endpoints = null;\n this.source = null;\n this.target = null;\n if (this.connector != null) {\n this.connector.cleanup(true);\n this.connector.destroy(true);\n }\n this.connector = null;\n },\n updateConnectedClass:function(remove) {\n if (this._jsPlumb) {\n _updateConnectedClass(this, this.source, this._jsPlumb.instance, remove);\n _updateConnectedClass(this, this.target, this._jsPlumb.instance, remove);\n }\n },\n setHover: function (state) {\n if (this.connector && this._jsPlumb && !this._jsPlumb.instance.isConnectionBeingDragged()) {\n this.connector.setHover(state);\n root.jsPlumb[state ? \"addClass\" : \"removeClass\"](this.source, this._jsPlumb.instance.hoverSourceClass);\n root.jsPlumb[state ? \"addClass\" : \"removeClass\"](this.target, this._jsPlumb.instance.hoverTargetClass);\n }\n },\n getUuids:function() {\n return [ this.endpoints[0].getUuid(), this.endpoints[1].getUuid() ];\n },\n getCost: function () {\n return this._jsPlumb ? this._jsPlumb.cost : -Infinity;\n },\n setCost: function (c) {\n this._jsPlumb.cost = c;\n },\n isDirected: function () {\n return this._jsPlumb.directed;\n },\n getConnector: function () {\n return this.connector;\n },\n prepareConnector:function(connectorSpec, typeId) {\n var connectorArgs = {\n _jsPlumb: this._jsPlumb.instance,\n cssClass: this._jsPlumb.params.cssClass,\n container: this._jsPlumb.params.container,\n \"pointer-events\": this._jsPlumb.params[\"pointer-events\"]\n },\n renderMode = this._jsPlumb.instance.getRenderMode(),\n connector;\n\n if (_ju.isString(connectorSpec)) {\n connector = makeConnector(this._jsPlumb.instance, renderMode, connectorSpec, connectorArgs, this);\n } // lets you use a string as shorthand.\n else if (_ju.isArray(connectorSpec)) {\n if (connectorSpec.length === 1) {\n connector = makeConnector(this._jsPlumb.instance, renderMode, connectorSpec[0], connectorArgs, this);\n }\n else {\n connector = makeConnector(this._jsPlumb.instance, renderMode, connectorSpec[0], _ju.merge(connectorSpec[1], connectorArgs), this);\n }\n }\n if (typeId != null) {\n connector.typeId = typeId;\n }\n return connector;\n },\n setPreparedConnector: function(connector, doNotRepaint, doNotChangeListenerComponent, typeId) {\n\n if (this.connector !== connector) {\n\n var previous, previousClasses = \"\";\n // the connector will not be cleaned up if it was set as part of a type, because `typeId` will be set on it\n // and we havent passed in `true` for \"force\" here.\n if (this.connector != null) {\n previous = this.connector;\n previousClasses = previous.getClass();\n this.connector.cleanup();\n this.connector.destroy();\n }\n\n this.connector = connector;\n if (typeId) {\n this.cacheTypeItem(\"connector\", connector, typeId);\n }\n\n this.canvas = this.connector.canvas;\n this.bgCanvas = this.connector.bgCanvas;\n\n // put classes from prior connector onto the canvas\n this.addClass(previousClasses);\n\n // new: instead of binding listeners per connector, we now just have one delegate on the container.\n // so for that handler we set the connection as the '_jsPlumb' member of the canvas element, and\n // bgCanvas, if it exists, which it does right now in the VML renderer, so it won't from v 2.0.0 onwards.\n if (this.canvas) {\n this.canvas._jsPlumb = this;\n }\n if (this.bgCanvas) {\n this.bgCanvas._jsPlumb = this;\n }\n\n if (previous != null) {\n var o = this.getOverlays();\n for (var i = 0; i < o.length; i++) {\n if (o[i].transfer) {\n o[i].transfer(this.connector);\n }\n }\n }\n\n if (!doNotChangeListenerComponent) {\n this.setListenerComponent(this.connector);\n }\n if (!doNotRepaint) {\n this.repaint();\n }\n }\n },\n setConnector: function (connectorSpec, doNotRepaint, doNotChangeListenerComponent, typeId) {\n var connector = this.prepareConnector(connectorSpec, typeId);\n this.setPreparedConnector(connector, doNotRepaint, doNotChangeListenerComponent, typeId);\n },\n paint: function (params) {\n\n if (!this._jsPlumb.instance.isSuspendDrawing() && this._jsPlumb.visible) {\n params = params || {};\n var timestamp = params.timestamp,\n // if the moving object is not the source we must transpose the two references.\n swap = false,\n tId = swap ? this.sourceId : this.targetId, sId = swap ? this.targetId : this.sourceId,\n tIdx = swap ? 0 : 1, sIdx = swap ? 1 : 0;\n\n if (timestamp == null || timestamp !== this._jsPlumb.lastPaintedAt) {\n var sourceInfo = this._jsPlumb.instance.updateOffset({elId:sId}).o,\n targetInfo = this._jsPlumb.instance.updateOffset({elId:tId}).o,\n sE = this.endpoints[sIdx], tE = this.endpoints[tIdx];\n\n var sAnchorP = sE.anchor.getCurrentLocation({xy: [sourceInfo.left, sourceInfo.top], wh: [sourceInfo.width, sourceInfo.height], element: sE, timestamp: timestamp}),\n tAnchorP = tE.anchor.getCurrentLocation({xy: [targetInfo.left, targetInfo.top], wh: [targetInfo.width, targetInfo.height], element: tE, timestamp: timestamp});\n\n this.connector.resetBounds();\n\n this.connector.compute({\n sourcePos: sAnchorP,\n targetPos: tAnchorP,\n sourceOrientation:sE.anchor.getOrientation(sE),\n targetOrientation:tE.anchor.getOrientation(tE),\n sourceEndpoint: this.endpoints[sIdx],\n targetEndpoint: this.endpoints[tIdx],\n \"stroke-width\": this._jsPlumb.paintStyleInUse.strokeWidth,\n sourceInfo: sourceInfo,\n targetInfo: targetInfo\n });\n\n var overlayExtents = { minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity };\n\n // compute overlays. we do this first so we can get their placements, and adjust the\n // container if needs be (if an overlay would be clipped)\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays.hasOwnProperty(i)) {\n var o = this._jsPlumb.overlays[i];\n if (o.isVisible()) {\n this._jsPlumb.overlayPlacements[i] = o.draw(this.connector, this._jsPlumb.paintStyleInUse, this.getAbsoluteOverlayPosition(o));\n overlayExtents.minX = Math.min(overlayExtents.minX, this._jsPlumb.overlayPlacements[i].minX);\n overlayExtents.maxX = Math.max(overlayExtents.maxX, this._jsPlumb.overlayPlacements[i].maxX);\n overlayExtents.minY = Math.min(overlayExtents.minY, this._jsPlumb.overlayPlacements[i].minY);\n overlayExtents.maxY = Math.max(overlayExtents.maxY, this._jsPlumb.overlayPlacements[i].maxY);\n }\n }\n }\n\n var lineWidth = parseFloat(this._jsPlumb.paintStyleInUse.strokeWidth || 1) / 2,\n outlineWidth = parseFloat(this._jsPlumb.paintStyleInUse.strokeWidth || 0),\n extents = {\n xmin: Math.min(this.connector.bounds.minX - (lineWidth + outlineWidth), overlayExtents.minX),\n ymin: Math.min(this.connector.bounds.minY - (lineWidth + outlineWidth), overlayExtents.minY),\n xmax: Math.max(this.connector.bounds.maxX + (lineWidth + outlineWidth), overlayExtents.maxX),\n ymax: Math.max(this.connector.bounds.maxY + (lineWidth + outlineWidth), overlayExtents.maxY)\n };\n // paint the connector.\n this.connector.paint(this._jsPlumb.paintStyleInUse, null, extents);\n // and then the overlays\n for (var j in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays.hasOwnProperty(j)) {\n var p = this._jsPlumb.overlays[j];\n if (p.isVisible()) {\n p.paint(this._jsPlumb.overlayPlacements[j], extents);\n }\n }\n }\n }\n this._jsPlumb.lastPaintedAt = timestamp;\n }\n },\n repaint: function (params) {\n var p = jsPlumb.extend(params || {}, {});\n p.elId = this.sourceId;\n this.paint(p);\n },\n prepareEndpoint: function (_jsPlumb, _newEndpoint, conn, existing, index, params, element, elementId) {\n var e;\n if (existing) {\n conn.endpoints[index] = existing;\n existing.addConnection(conn);\n } else {\n if (!params.endpoints) {\n params.endpoints = [ null, null ];\n }\n var ep = params.endpoints[index] || params.endpoint || _jsPlumb.Defaults.Endpoints[index] || _jp.Defaults.Endpoints[index] || _jsPlumb.Defaults.Endpoint || _jp.Defaults.Endpoint;\n if (!params.endpointStyles) {\n params.endpointStyles = [ null, null ];\n }\n if (!params.endpointHoverStyles) {\n params.endpointHoverStyles = [ null, null ];\n }\n var es = params.endpointStyles[index] || params.endpointStyle || _jsPlumb.Defaults.EndpointStyles[index] || _jp.Defaults.EndpointStyles[index] || _jsPlumb.Defaults.EndpointStyle || _jp.Defaults.EndpointStyle;\n // Endpoints derive their fill from the connector's stroke, if no fill was specified.\n if (es.fill == null && params.paintStyle != null) {\n es.fill = params.paintStyle.stroke;\n }\n\n if (es.outlineStroke == null && params.paintStyle != null) {\n es.outlineStroke = params.paintStyle.outlineStroke;\n }\n if (es.outlineWidth == null && params.paintStyle != null) {\n es.outlineWidth = params.paintStyle.outlineWidth;\n }\n\n var ehs = params.endpointHoverStyles[index] || params.endpointHoverStyle || _jsPlumb.Defaults.EndpointHoverStyles[index] || _jp.Defaults.EndpointHoverStyles[index] || _jsPlumb.Defaults.EndpointHoverStyle || _jp.Defaults.EndpointHoverStyle;\n // endpoint hover fill style is derived from connector's hover stroke style\n if (params.hoverPaintStyle != null) {\n if (ehs == null) {\n ehs = {};\n }\n if (ehs.fill == null) {\n ehs.fill = params.hoverPaintStyle.stroke;\n }\n }\n var a = params.anchors ? params.anchors[index] :\n params.anchor ? params.anchor :\n _makeAnchor(_jsPlumb.Defaults.Anchors[index], elementId, _jsPlumb) ||\n _makeAnchor(_jp.Defaults.Anchors[index], elementId, _jsPlumb) ||\n _makeAnchor(_jsPlumb.Defaults.Anchor, elementId, _jsPlumb) ||\n _makeAnchor(_jp.Defaults.Anchor, elementId, _jsPlumb),\n u = params.uuids ? params.uuids[index] : null;\n\n e = _newEndpoint({\n paintStyle: es, hoverPaintStyle: ehs, endpoint: ep, connections: [ conn ],\n uuid: u, anchor: a, source: element, scope: params.scope,\n reattach: params.reattach || _jsPlumb.Defaults.ReattachConnections,\n detachable: params.detachable || _jsPlumb.Defaults.ConnectionsDetachable\n });\n if (existing == null) {\n e.setDeleteOnEmpty(true);\n }\n conn.endpoints[index] = e;\n\n if (params.drawEndpoints === false) {\n e.setVisible(false, true, true);\n }\n\n }\n return e;\n }\n\n }); // END Connection class \n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the code for creating and manipulating anchors.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n\n var root = this,\n _ju = root.jsPlumbUtil,\n _jp = root.jsPlumb;\n\n //\n // manages anchors for all elements.\n //\n _jp.AnchorManager = function (params) {\n var _amEndpoints = {},\n continuousAnchorLocations = {},\n continuousAnchorOrientations = {},\n connectionsByElementId = {},\n self = this,\n anchorLists = {},\n jsPlumbInstance = params.jsPlumbInstance,\n floatingConnections = {},\n // used by placeAnchors function\n placeAnchorsOnLine = function (desc, elementDimensions, elementPosition, connections, horizontal, otherMultiplier, reverse) {\n var a = [], step = elementDimensions[horizontal ? 0 : 1] / (connections.length + 1);\n\n for (var i = 0; i < connections.length; i++) {\n var val = (i + 1) * step, other = otherMultiplier * elementDimensions[horizontal ? 1 : 0];\n if (reverse) {\n val = elementDimensions[horizontal ? 0 : 1] - val;\n }\n\n var dx = (horizontal ? val : other), x = elementPosition[0] + dx, xp = dx / elementDimensions[0],\n dy = (horizontal ? other : val), y = elementPosition[1] + dy, yp = dy / elementDimensions[1];\n\n a.push([ x, y, xp, yp, connections[i][1], connections[i][2] ]);\n }\n\n return a;\n },\n // used by edgeSortFunctions\n currySort = function (reverseAngles) {\n return function (a, b) {\n var r = true;\n if (reverseAngles) {\n r = a[0][0] < b[0][0];\n }\n else {\n r = a[0][0] > b[0][0];\n }\n return r === false ? -1 : 1;\n };\n },\n // used by edgeSortFunctions\n leftSort = function (a, b) {\n // first get adjusted values\n var p1 = a[0][0] < 0 ? -Math.PI - a[0][0] : Math.PI - a[0][0],\n p2 = b[0][0] < 0 ? -Math.PI - b[0][0] : Math.PI - b[0][0];\n if (p1 > p2) {\n return 1;\n }\n else {\n return -1;\n }\n },\n // used by placeAnchors\n edgeSortFunctions = {\n \"top\": function (a, b) {\n return a[0] > b[0] ? 1 : -1;\n },\n \"right\": currySort(true),\n \"bottom\": currySort(true),\n \"left\": leftSort\n },\n // used by placeAnchors\n _sortHelper = function (_array, _fn) {\n return _array.sort(_fn);\n },\n // used by AnchorManager.redraw\n placeAnchors = function (elementId, _anchorLists) {\n var cd = jsPlumbInstance.getCachedData(elementId), sS = cd.s, sO = cd.o,\n placeSomeAnchors = function (desc, elementDimensions, elementPosition, unsortedConnections, isHorizontal, otherMultiplier, orientation) {\n if (unsortedConnections.length > 0) {\n var sc = _sortHelper(unsortedConnections, edgeSortFunctions[desc]), // puts them in order based on the target element's pos on screen\n reverse = desc === \"right\" || desc === \"top\",\n anchors = placeAnchorsOnLine(desc, elementDimensions,\n elementPosition, sc,\n isHorizontal, otherMultiplier, reverse);\n\n // takes a computed anchor position and adjusts it for parent offset and scroll, then stores it.\n var _setAnchorLocation = function (endpoint, anchorPos) {\n continuousAnchorLocations[endpoint.id] = [ anchorPos[0], anchorPos[1], anchorPos[2], anchorPos[3] ];\n continuousAnchorOrientations[endpoint.id] = orientation;\n };\n\n for (var i = 0; i < anchors.length; i++) {\n var c = anchors[i][4], weAreSource = c.endpoints[0].elementId === elementId, weAreTarget = c.endpoints[1].elementId === elementId;\n if (weAreSource) {\n _setAnchorLocation(c.endpoints[0], anchors[i]);\n }\n if (weAreTarget) {\n _setAnchorLocation(c.endpoints[1], anchors[i]);\n }\n }\n }\n };\n\n placeSomeAnchors(\"bottom\", sS, [sO.left, sO.top], _anchorLists.bottom, true, 1, [0, 1]);\n placeSomeAnchors(\"top\", sS, [sO.left, sO.top], _anchorLists.top, true, 0, [0, -1]);\n placeSomeAnchors(\"left\", sS, [sO.left, sO.top], _anchorLists.left, false, 0, [-1, 0]);\n placeSomeAnchors(\"right\", sS, [sO.left, sO.top], _anchorLists.right, false, 1, [1, 0]);\n };\n\n this.reset = function () {\n _amEndpoints = {};\n connectionsByElementId = {};\n anchorLists = {};\n };\n this.addFloatingConnection = function (key, conn) {\n floatingConnections[key] = conn;\n };\n this.removeFloatingConnection = function (key) {\n delete floatingConnections[key];\n };\n this.newConnection = function (conn) {\n var sourceId = conn.sourceId, targetId = conn.targetId,\n ep = conn.endpoints,\n doRegisterTarget = true,\n registerConnection = function (otherIndex, otherEndpoint, otherAnchor, elId, c) {\n if ((sourceId === targetId) && otherAnchor.isContinuous) {\n // remove the target endpoint's canvas. we dont need it.\n conn._jsPlumb.instance.removeElement(ep[1].canvas);\n doRegisterTarget = false;\n }\n _ju.addToList(connectionsByElementId, elId, [c, otherEndpoint, otherAnchor.constructor === _jp.DynamicAnchor]);\n };\n\n registerConnection(0, ep[0], ep[0].anchor, targetId, conn);\n if (doRegisterTarget) {\n registerConnection(1, ep[1], ep[1].anchor, sourceId, conn);\n }\n };\n var removeEndpointFromAnchorLists = function (endpoint) {\n (function (list, eId) {\n if (list) { // transient anchors dont get entries in this list.\n var f = function (e) {\n return e[4] === eId;\n };\n _ju.removeWithFunction(list.top, f);\n _ju.removeWithFunction(list.left, f);\n _ju.removeWithFunction(list.bottom, f);\n _ju.removeWithFunction(list.right, f);\n }\n })(anchorLists[endpoint.elementId], endpoint.id);\n };\n this.connectionDetached = function (connInfo, doNotRedraw) {\n var connection = connInfo.connection || connInfo,\n sourceId = connInfo.sourceId,\n targetId = connInfo.targetId,\n ep = connection.endpoints,\n removeConnection = function (otherIndex, otherEndpoint, otherAnchor, elId, c) {\n _ju.removeWithFunction(connectionsByElementId[elId], function (_c) {\n return _c[0].id === c.id;\n });\n };\n\n removeConnection(1, ep[1], ep[1].anchor, sourceId, connection);\n removeConnection(0, ep[0], ep[0].anchor, targetId, connection);\n if (connection.floatingId) {\n removeConnection(connection.floatingIndex, connection.floatingEndpoint, connection.floatingEndpoint.anchor, connection.floatingId, connection);\n removeEndpointFromAnchorLists(connection.floatingEndpoint);\n }\n\n // remove from anchorLists\n removeEndpointFromAnchorLists(connection.endpoints[0]);\n removeEndpointFromAnchorLists(connection.endpoints[1]);\n\n if (!doNotRedraw) {\n self.redraw(connection.sourceId);\n if (connection.targetId !== connection.sourceId) {\n self.redraw(connection.targetId);\n }\n }\n };\n this.add = function (endpoint, elementId) {\n _ju.addToList(_amEndpoints, elementId, endpoint);\n };\n this.changeId = function (oldId, newId) {\n connectionsByElementId[newId] = connectionsByElementId[oldId];\n _amEndpoints[newId] = _amEndpoints[oldId];\n delete connectionsByElementId[oldId];\n delete _amEndpoints[oldId];\n };\n this.getConnectionsFor = function (elementId) {\n return connectionsByElementId[elementId] || [];\n };\n this.getEndpointsFor = function (elementId) {\n return _amEndpoints[elementId] || [];\n };\n this.deleteEndpoint = function (endpoint) {\n _ju.removeWithFunction(_amEndpoints[endpoint.elementId], function (e) {\n return e.id === endpoint.id;\n });\n removeEndpointFromAnchorLists(endpoint);\n };\n this.clearFor = function (elementId) {\n delete _amEndpoints[elementId];\n _amEndpoints[elementId] = [];\n };\n // updates the given anchor list by either updating an existing anchor's info, or adding it. this function\n // also removes the anchor from its previous list, if the edge it is on has changed.\n // all connections found along the way (those that are connected to one of the faces this function\n // operates on) are added to the connsToPaint list, as are their endpoints. in this way we know to repaint\n // them wthout having to calculate anything else about them.\n var _updateAnchorList = function (lists, theta, order, conn, aBoolean, otherElId, idx, reverse, edgeId, elId, connsToPaint, endpointsToPaint) {\n // first try to find the exact match, but keep track of the first index of a matching element id along the way.s\n var exactIdx = -1,\n firstMatchingElIdx = -1,\n endpoint = conn.endpoints[idx],\n endpointId = endpoint.id,\n oIdx = [1, 0][idx],\n values = [\n [ theta, order ],\n conn,\n aBoolean,\n otherElId,\n endpointId\n ],\n listToAddTo = lists[edgeId],\n listToRemoveFrom = endpoint._continuousAnchorEdge ? lists[endpoint._continuousAnchorEdge] : null,\n i,\n candidate;\n\n if (listToRemoveFrom) {\n var rIdx = _ju.findWithFunction(listToRemoveFrom, function (e) {\n return e[4] === endpointId;\n });\n if (rIdx !== -1) {\n listToRemoveFrom.splice(rIdx, 1);\n // get all connections from this list\n for (i = 0; i < listToRemoveFrom.length; i++) {\n candidate = listToRemoveFrom[i][1];\n _ju.addWithFunction(connsToPaint, candidate, function (c) {\n return c.id === candidate.id;\n });\n _ju.addWithFunction(endpointsToPaint, listToRemoveFrom[i][1].endpoints[idx], function (e) {\n return e.id === candidate.endpoints[idx].id;\n });\n _ju.addWithFunction(endpointsToPaint, listToRemoveFrom[i][1].endpoints[oIdx], function (e) {\n return e.id === candidate.endpoints[oIdx].id;\n });\n }\n }\n }\n\n for (i = 0; i < listToAddTo.length; i++) {\n candidate = listToAddTo[i][1];\n if (params.idx === 1 && listToAddTo[i][3] === otherElId && firstMatchingElIdx === -1) {\n firstMatchingElIdx = i;\n }\n _ju.addWithFunction(connsToPaint, candidate, function (c) {\n return c.id === candidate.id;\n });\n _ju.addWithFunction(endpointsToPaint, listToAddTo[i][1].endpoints[idx], function (e) {\n return e.id === candidate.endpoints[idx].id;\n });\n _ju.addWithFunction(endpointsToPaint, listToAddTo[i][1].endpoints[oIdx], function (e) {\n return e.id === candidate.endpoints[oIdx].id;\n });\n }\n if (exactIdx !== -1) {\n listToAddTo[exactIdx] = values;\n }\n else {\n var insertIdx = reverse ? firstMatchingElIdx !== -1 ? firstMatchingElIdx : 0 : listToAddTo.length; // of course we will get this from having looked through the array shortly.\n listToAddTo.splice(insertIdx, 0, values);\n }\n\n // store this for next time.\n endpoint._continuousAnchorEdge = edgeId;\n };\n\n //\n // find the entry in an endpoint's list for this connection and update its target endpoint\n // with the current target in the connection.\n // This method and sourceChanged need to be folder into one.\n //\n this.updateOtherEndpoint = function (sourceElId, oldTargetId, newTargetId, connection) {\n var sIndex = _ju.findWithFunction(connectionsByElementId[sourceElId], function (i) {\n return i[0].id === connection.id;\n }),\n tIndex = _ju.findWithFunction(connectionsByElementId[oldTargetId], function (i) {\n return i[0].id === connection.id;\n });\n\n // update or add data for source\n if (sIndex !== -1) {\n connectionsByElementId[sourceElId][sIndex][0] = connection;\n connectionsByElementId[sourceElId][sIndex][1] = connection.endpoints[1];\n connectionsByElementId[sourceElId][sIndex][2] = connection.endpoints[1].anchor.constructor === _jp.DynamicAnchor;\n }\n\n // remove entry for previous target (if there)\n if (tIndex > -1) {\n connectionsByElementId[oldTargetId].splice(tIndex, 1);\n // add entry for new target\n _ju.addToList(connectionsByElementId, newTargetId, [connection, connection.endpoints[0], connection.endpoints[0].anchor.constructor === _jp.DynamicAnchor]);\n }\n\n connection.updateConnectedClass();\n };\n\n //\n // notification that the connection given has changed source from the originalId to the newId.\n // This involves:\n // 1. removing the connection from the list of connections stored for the originalId\n // 2. updating the source information for the target of the connection\n // 3. re-registering the connection in connectionsByElementId with the newId\n //\n this.sourceChanged = function (originalId, newId, connection, newElement) {\n if (originalId !== newId) {\n\n connection.sourceId = newId;\n connection.source = newElement;\n\n // remove the entry that points from the old source to the target\n _ju.removeWithFunction(connectionsByElementId[originalId], function (info) {\n return info[0].id === connection.id;\n });\n // find entry for target and update it\n var tIdx = _ju.findWithFunction(connectionsByElementId[connection.targetId], function (i) {\n return i[0].id === connection.id;\n });\n if (tIdx > -1) {\n connectionsByElementId[connection.targetId][tIdx][0] = connection;\n connectionsByElementId[connection.targetId][tIdx][1] = connection.endpoints[0];\n connectionsByElementId[connection.targetId][tIdx][2] = connection.endpoints[0].anchor.constructor === _jp.DynamicAnchor;\n }\n // add entry for new source\n _ju.addToList(connectionsByElementId, newId, [connection, connection.endpoints[1], connection.endpoints[1].anchor.constructor === _jp.DynamicAnchor]);\n\n // TODO SP not final on this yet. when a user drags an existing connection and it turns into a self\n // loop, then this code hides the target endpoint (by removing it from the DOM) But I think this should\n // occur only if the anchor is Continuous\n if (connection.endpoints[1].anchor.isContinuous) {\n if (connection.source === connection.target) {\n connection._jsPlumb.instance.removeElement(connection.endpoints[1].canvas);\n }\n else {\n if (connection.endpoints[1].canvas.parentNode == null) {\n connection._jsPlumb.instance.appendElement(connection.endpoints[1].canvas);\n }\n }\n }\n\n connection.updateConnectedClass();\n }\n };\n\n //\n // moves the given endpoint from `currentId` to `element`.\n // This involves:\n //\n // 1. changing the key in _amEndpoints under which the endpoint is stored\n // 2. changing the source or target values in all of the endpoint's connections\n // 3. changing the array in connectionsByElementId in which the endpoint's connections\n // are stored (done by either sourceChanged or updateOtherEndpoint)\n //\n this.rehomeEndpoint = function (ep, currentId, element) {\n var eps = _amEndpoints[currentId] || [],\n elementId = jsPlumbInstance.getId(element);\n\n if (elementId !== currentId) {\n var idx = eps.indexOf(ep);\n if (idx > -1) {\n var _ep = eps.splice(idx, 1)[0];\n self.add(_ep, elementId);\n }\n }\n\n for (var i = 0; i < ep.connections.length; i++) {\n if (ep.connections[i].sourceId === currentId) {\n self.sourceChanged(currentId, ep.elementId, ep.connections[i], ep.element);\n }\n else if (ep.connections[i].targetId === currentId) {\n ep.connections[i].targetId = ep.elementId;\n ep.connections[i].target = ep.element;\n self.updateOtherEndpoint(ep.connections[i].sourceId, currentId, ep.elementId, ep.connections[i]);\n }\n }\n };\n\n this.redraw = function (elementId, ui, timestamp, offsetToUI, clearEdits, doNotRecalcEndpoint) {\n\n if (!jsPlumbInstance.isSuspendDrawing()) {\n // get all the endpoints for this element\n var ep = _amEndpoints[elementId] || [],\n endpointConnections = connectionsByElementId[elementId] || [],\n connectionsToPaint = [],\n endpointsToPaint = [],\n anchorsToUpdate = [];\n\n timestamp = timestamp || jsPlumbInstance.timestamp();\n // offsetToUI are values that would have been calculated in the dragManager when registering\n // an endpoint for an element that had a parent (somewhere in the hierarchy) that had been\n // registered as draggable.\n offsetToUI = offsetToUI || {left: 0, top: 0};\n if (ui) {\n ui = {\n left: ui.left + offsetToUI.left,\n top: ui.top + offsetToUI.top\n };\n }\n\n // valid for one paint cycle.\n var myOffset = jsPlumbInstance.updateOffset({ elId: elementId, offset: ui, recalc: false, timestamp: timestamp }),\n orientationCache = {};\n\n // actually, first we should compute the orientation of this element to all other elements to which\n // this element is connected with a continuous anchor (whether both ends of the connection have\n // a continuous anchor or just one)\n\n for (var i = 0; i < endpointConnections.length; i++) {\n var conn = endpointConnections[i][0],\n sourceId = conn.sourceId,\n targetId = conn.targetId,\n sourceContinuous = conn.endpoints[0].anchor.isContinuous,\n targetContinuous = conn.endpoints[1].anchor.isContinuous;\n\n if (sourceContinuous || targetContinuous) {\n var oKey = sourceId + \"_\" + targetId,\n o = orientationCache[oKey],\n oIdx = conn.sourceId === elementId ? 1 : 0;\n\n if (sourceContinuous && !anchorLists[sourceId]) {\n anchorLists[sourceId] = { top: [], right: [], bottom: [], left: [] };\n }\n if (targetContinuous && !anchorLists[targetId]) {\n anchorLists[targetId] = { top: [], right: [], bottom: [], left: [] };\n }\n\n if (elementId !== targetId) {\n jsPlumbInstance.updateOffset({ elId: targetId, timestamp: timestamp });\n }\n if (elementId !== sourceId) {\n jsPlumbInstance.updateOffset({ elId: sourceId, timestamp: timestamp });\n }\n\n var td = jsPlumbInstance.getCachedData(targetId),\n sd = jsPlumbInstance.getCachedData(sourceId);\n\n if (targetId === sourceId && (sourceContinuous || targetContinuous)) {\n // here we may want to improve this by somehow determining the face we'd like\n // to put the connector on. ideally, when drawing, the face should be calculated\n // by determining which face is closest to the point at which the mouse button\n // was released. for now, we're putting it on the top face.\n _updateAnchorList( anchorLists[sourceId], -Math.PI / 2, 0, conn, false, targetId, 0, false, \"top\", sourceId, connectionsToPaint, endpointsToPaint);\n _updateAnchorList( anchorLists[targetId], -Math.PI / 2, 0, conn, false, sourceId, 1, false, \"top\", targetId, connectionsToPaint, endpointsToPaint);\n }\n else {\n if (!o) {\n o = this.calculateOrientation(sourceId, targetId, sd.o, td.o, conn.endpoints[0].anchor, conn.endpoints[1].anchor, conn);\n orientationCache[oKey] = o;\n // this would be a performance enhancement, but the computed angles need to be clamped to\n //the (-PI/2 -> PI/2) range in order for the sorting to work properly.\n /* orientationCache[oKey2] = {\n orientation:o.orientation,\n a:[o.a[1], o.a[0]],\n theta:o.theta + Math.PI,\n theta2:o.theta2 + Math.PI\n };*/\n }\n if (sourceContinuous) {\n _updateAnchorList(anchorLists[sourceId], o.theta, 0, conn, false, targetId, 0, false, o.a[0], sourceId, connectionsToPaint, endpointsToPaint);\n }\n if (targetContinuous) {\n _updateAnchorList(anchorLists[targetId], o.theta2, -1, conn, true, sourceId, 1, true, o.a[1], targetId, connectionsToPaint, endpointsToPaint);\n }\n }\n\n if (sourceContinuous) {\n _ju.addWithFunction(anchorsToUpdate, sourceId, function (a) {\n return a === sourceId;\n });\n }\n if (targetContinuous) {\n _ju.addWithFunction(anchorsToUpdate, targetId, function (a) {\n return a === targetId;\n });\n }\n _ju.addWithFunction(connectionsToPaint, conn, function (c) {\n return c.id === conn.id;\n });\n if ((sourceContinuous && oIdx === 0) || (targetContinuous && oIdx === 1)) {\n _ju.addWithFunction(endpointsToPaint, conn.endpoints[oIdx], function (e) {\n return e.id === conn.endpoints[oIdx].id;\n });\n }\n }\n }\n\n // place Endpoints whose anchors are continuous but have no Connections\n for (i = 0; i < ep.length; i++) {\n if (ep[i].connections.length === 0 && ep[i].anchor.isContinuous) {\n if (!anchorLists[elementId]) {\n anchorLists[elementId] = { top: [], right: [], bottom: [], left: [] };\n }\n _updateAnchorList(anchorLists[elementId], -Math.PI / 2, 0, {endpoints: [ep[i], ep[i]], paint: function () {\n }}, false, elementId, 0, false, ep[i].anchor.getDefaultFace(), elementId, connectionsToPaint, endpointsToPaint);\n _ju.addWithFunction(anchorsToUpdate, elementId, function (a) {\n return a === elementId;\n });\n }\n }\n\n // now place all the continuous anchors we need to;\n for (i = 0; i < anchorsToUpdate.length; i++) {\n placeAnchors(anchorsToUpdate[i], anchorLists[anchorsToUpdate[i]]);\n }\n\n // now that continuous anchors have been placed, paint all the endpoints for this element\n for (i = 0; i < ep.length; i++) {\n ep[i].paint({ timestamp: timestamp, offset: myOffset, dimensions: myOffset.s, recalc: doNotRecalcEndpoint !== true });\n }\n\n // ... and any other endpoints we came across as a result of the continuous anchors.\n for (i = 0; i < endpointsToPaint.length; i++) {\n var cd = jsPlumbInstance.getCachedData(endpointsToPaint[i].elementId);\n //endpointsToPaint[i].paint({ timestamp: timestamp, offset: cd, dimensions: cd.s });\n endpointsToPaint[i].paint({ timestamp: null, offset: cd, dimensions: cd.s });\n }\n\n // paint all the standard and \"dynamic connections\", which are connections whose other anchor is\n // static and therefore does need to be recomputed; we make sure that happens only one time.\n\n // TODO we could have compiled a list of these in the first pass through connections; might save some time.\n for (i = 0; i < endpointConnections.length; i++) {\n var otherEndpoint = endpointConnections[i][1];\n if (otherEndpoint.anchor.constructor === _jp.DynamicAnchor) {\n otherEndpoint.paint({ elementWithPrecedence: elementId, timestamp: timestamp });\n _ju.addWithFunction(connectionsToPaint, endpointConnections[i][0], function (c) {\n return c.id === endpointConnections[i][0].id;\n });\n // all the connections for the other endpoint now need to be repainted\n for (var k = 0; k < otherEndpoint.connections.length; k++) {\n if (otherEndpoint.connections[k] !== endpointConnections[i][0]) {\n _ju.addWithFunction(connectionsToPaint, otherEndpoint.connections[k], function (c) {\n return c.id === otherEndpoint.connections[k].id;\n });\n }\n }\n } else {\n _ju.addWithFunction(connectionsToPaint, endpointConnections[i][0], function (c) {\n return c.id === endpointConnections[i][0].id;\n });\n }\n }\n\n // paint current floating connection for this element, if there is one.\n var fc = floatingConnections[elementId];\n if (fc) {\n fc.paint({timestamp: timestamp, recalc: false, elId: elementId});\n }\n\n // paint all the connections\n for (i = 0; i < connectionsToPaint.length; i++) {\n connectionsToPaint[i].paint({elId: elementId, timestamp: null, recalc: false, clearEdits: clearEdits});\n }\n }\n };\n\n var ContinuousAnchor = function (anchorParams) {\n _ju.EventGenerator.apply(this);\n this.type = \"Continuous\";\n this.isDynamic = true;\n this.isContinuous = true;\n var faces = anchorParams.faces || [\"top\", \"right\", \"bottom\", \"left\"],\n clockwise = !(anchorParams.clockwise === false),\n availableFaces = { },\n opposites = { \"top\": \"bottom\", \"right\": \"left\", \"left\": \"right\", \"bottom\": \"top\" },\n clockwiseOptions = { \"top\": \"right\", \"right\": \"bottom\", \"left\": \"top\", \"bottom\": \"left\" },\n antiClockwiseOptions = { \"top\": \"left\", \"right\": \"top\", \"left\": \"bottom\", \"bottom\": \"right\" },\n secondBest = clockwise ? clockwiseOptions : antiClockwiseOptions,\n lastChoice = clockwise ? antiClockwiseOptions : clockwiseOptions,\n cssClass = anchorParams.cssClass || \"\",\n _currentFace = null, _lockedFace = null, X_AXIS_FACES = [\"left\", \"right\"], Y_AXIS_FACES = [\"top\", \"bottom\"],\n _lockedAxis = null;\n\n for (var i = 0; i < faces.length; i++) {\n availableFaces[faces[i]] = true;\n }\n\n this.getDefaultFace = function () {\n return faces.length === 0 ? \"top\" : faces[0];\n };\n\n this.isRelocatable = function() { return true; };\n this.isSnapOnRelocate = function() { return true; };\n\n // if the given edge is supported, returns it. otherwise looks for a substitute that _is_\n // supported. if none supported we also return the request edge.\n this.verifyEdge = function (edge) {\n if (availableFaces[edge]) {\n return edge;\n }\n else if (availableFaces[opposites[edge]]) {\n return opposites[edge];\n }\n else if (availableFaces[secondBest[edge]]) {\n return secondBest[edge];\n }\n else if (availableFaces[lastChoice[edge]]) {\n return lastChoice[edge];\n }\n return edge; // we have to give them something.\n };\n\n this.isEdgeSupported = function (edge) {\n return _lockedAxis == null ?\n\n (_lockedFace == null ? availableFaces[edge] === true : _lockedFace === edge)\n\n : _lockedAxis.indexOf(edge) !== -1;\n };\n\n this.setCurrentFace = function(face, overrideLock) {\n _currentFace = face;\n // if currently locked, and the user wants to override, do that.\n if (overrideLock && _lockedFace != null) {\n _lockedFace = _currentFace;\n }\n };\n\n this.getCurrentFace = function() { return _currentFace; };\n this.getSupportedFaces = function() {\n var af = [];\n for (var k in availableFaces) {\n if (availableFaces[k]) {\n af.push(k);\n }\n }\n return af;\n };\n\n this.lock = function() {\n _lockedFace = _currentFace;\n };\n this.unlock = function() {\n _lockedFace = null;\n };\n this.isLocked = function() {\n return _lockedFace != null;\n };\n\n this.lockCurrentAxis = function() {\n if (_currentFace != null) {\n _lockedAxis = (_currentFace === \"left\" || _currentFace === \"right\") ? X_AXIS_FACES : Y_AXIS_FACES;\n }\n };\n\n this.unlockCurrentAxis = function() {\n _lockedAxis = null;\n };\n\n this.compute = function (params) {\n return continuousAnchorLocations[params.element.id] || [0, 0];\n };\n this.getCurrentLocation = function (params) {\n return continuousAnchorLocations[params.element.id] || [0, 0];\n };\n this.getOrientation = function (endpoint) {\n return continuousAnchorOrientations[endpoint.id] || [0, 0];\n };\n this.getCssClass = function () {\n return cssClass;\n };\n };\n\n // continuous anchors\n jsPlumbInstance.continuousAnchorFactory = {\n get: function (params) {\n return new ContinuousAnchor(params);\n },\n clear: function (elementId) {\n delete continuousAnchorLocations[elementId];\n }\n };\n };\n\n _jp.AnchorManager.prototype.calculateOrientation = function (sourceId, targetId, sd, td, sourceAnchor, targetAnchor) {\n\n var Orientation = { HORIZONTAL: \"horizontal\", VERTICAL: \"vertical\", DIAGONAL: \"diagonal\", IDENTITY: \"identity\" },\n axes = [\"left\", \"top\", \"right\", \"bottom\"];\n\n if (sourceId === targetId) {\n return {\n orientation: Orientation.IDENTITY,\n a: [\"top\", \"top\"]\n };\n }\n\n var theta = Math.atan2((td.centery - sd.centery), (td.centerx - sd.centerx)),\n theta2 = Math.atan2((sd.centery - td.centery), (sd.centerx - td.centerx));\n\n// --------------------------------------------------------------------------------------\n\n // improved face calculation. get midpoints of each face for source and target, then put in an array with all combinations of\n // source/target faces. sort this array by distance between midpoints. the entry at index 0 is our preferred option. we can\n // go through the array one by one until we find an entry in which each requested face is supported.\n var candidates = [], midpoints = { };\n (function (types, dim) {\n for (var i = 0; i < types.length; i++) {\n midpoints[types[i]] = {\n \"left\": [ dim[i].left, dim[i].centery ],\n \"right\": [ dim[i].right, dim[i].centery ],\n \"top\": [ dim[i].centerx, dim[i].top ],\n \"bottom\": [ dim[i].centerx , dim[i].bottom]\n };\n }\n })([ \"source\", \"target\" ], [ sd, td ]);\n\n for (var sf = 0; sf < axes.length; sf++) {\n for (var tf = 0; tf < axes.length; tf++) {\n candidates.push({\n source: axes[sf],\n target: axes[tf],\n dist: Biltong.lineLength(midpoints.source[axes[sf]], midpoints.target[axes[tf]])\n });\n }\n }\n\n candidates.sort(function (a, b) {\n return a.dist < b.dist ? -1 : a.dist > b.dist ? 1 : 0;\n });\n\n // now go through this list and try to get an entry that satisfies both (there will be one, unless one of the anchors\n // declares no available faces)\n var sourceEdge = candidates[0].source, targetEdge = candidates[0].target;\n for (var i = 0; i < candidates.length; i++) {\n\n if (!sourceAnchor.isContinuous || sourceAnchor.isEdgeSupported(candidates[i].source)) {\n sourceEdge = candidates[i].source;\n }\n else {\n sourceEdge = null;\n }\n\n if (!targetAnchor.isContinuous || targetAnchor.isEdgeSupported(candidates[i].target)) {\n targetEdge = candidates[i].target;\n }\n else {\n targetEdge = null;\n }\n\n if (sourceEdge != null && targetEdge != null) {\n break;\n }\n }\n\n if (sourceAnchor.isContinuous) {\n sourceAnchor.setCurrentFace(sourceEdge);\n }\n\n if (targetAnchor.isContinuous) {\n targetAnchor.setCurrentFace(targetEdge);\n }\n\n// --------------------------------------------------------------------------------------\n\n return {\n a: [ sourceEdge, targetEdge ],\n theta: theta,\n theta2: theta2\n };\n };\n\n /**\n * Anchors model a position on some element at which an Endpoint may be located. They began as a first class citizen of jsPlumb, ie. a user\n * was required to create these themselves, but over time this has been replaced by the concept of referring to them either by name (eg. \"TopMiddle\"),\n * or by an array describing their coordinates (eg. [ 0, 0.5, 0, -1 ], which is the same as \"TopMiddle\"). jsPlumb now handles all of the\n * creation of Anchors without user intervention.\n */\n _jp.Anchor = function (params) {\n this.x = params.x || 0;\n this.y = params.y || 0;\n this.elementId = params.elementId;\n this.cssClass = params.cssClass || \"\";\n this.userDefinedLocation = null;\n this.orientation = params.orientation || [ 0, 0 ];\n this.lastReturnValue = null;\n this.offsets = params.offsets || [ 0, 0 ];\n this.timestamp = null;\n\n var relocatable = params.relocatable !== false;\n this.isRelocatable = function() { return relocatable; };\n this.setRelocatable = function(_relocatable) { relocatable = _relocatable; };\n var snapOnRelocate = params.snapOnRelocate !== false;\n this.isSnapOnRelocate = function() { return snapOnRelocate; };\n\n var locked = false;\n this.lock = function() { locked = true; };\n this.unlock = function() { locked = false; };\n this.isLocked = function() { return locked; };\n\n _ju.EventGenerator.apply(this);\n\n this.compute = function (params) {\n\n var xy = params.xy, wh = params.wh, timestamp = params.timestamp;\n\n if (params.clearUserDefinedLocation) {\n this.userDefinedLocation = null;\n }\n\n if (timestamp && timestamp === this.timestamp) {\n return this.lastReturnValue;\n }\n\n if (this.userDefinedLocation != null) {\n this.lastReturnValue = this.userDefinedLocation;\n }\n else {\n this.lastReturnValue = [ xy[0] + (this.x * wh[0]) + this.offsets[0], xy[1] + (this.y * wh[1]) + this.offsets[1], this.x, this.y ];\n }\n\n this.timestamp = timestamp;\n return this.lastReturnValue;\n };\n\n this.getCurrentLocation = function (params) {\n params = params || {};\n return (this.lastReturnValue == null || (params.timestamp != null && this.timestamp !== params.timestamp)) ? this.compute(params) : this.lastReturnValue;\n };\n\n this.setPosition = function(x, y, ox, oy, overrideLock) {\n if (!locked || overrideLock) {\n this.x = x;\n this.y = y;\n this.orientation = [ ox, oy ];\n this.lastReturnValue = null;\n }\n };\n };\n _ju.extend(_jp.Anchor, _ju.EventGenerator, {\n equals: function (anchor) {\n if (!anchor) {\n return false;\n }\n var ao = anchor.getOrientation(),\n o = this.getOrientation();\n return this.x === anchor.x && this.y === anchor.y && this.offsets[0] === anchor.offsets[0] && this.offsets[1] === anchor.offsets[1] && o[0] === ao[0] && o[1] === ao[1];\n },\n getUserDefinedLocation: function () {\n return this.userDefinedLocation;\n },\n setUserDefinedLocation: function (l) {\n this.userDefinedLocation = l;\n },\n clearUserDefinedLocation: function () {\n this.userDefinedLocation = null;\n },\n getOrientation: function () {\n return this.orientation;\n },\n getCssClass: function () {\n return this.cssClass;\n }\n });\n\n /**\n * An Anchor that floats. its orientation is computed dynamically from\n * its position relative to the anchor it is floating relative to. It is used when creating\n * a connection through drag and drop.\n *\n * TODO FloatingAnchor could totally be refactored to extend Anchor just slightly.\n */\n _jp.FloatingAnchor = function (params) {\n\n _jp.Anchor.apply(this, arguments);\n\n // this is the anchor that this floating anchor is referenced to for\n // purposes of calculating the orientation.\n var ref = params.reference,\n // the canvas this refers to.\n refCanvas = params.referenceCanvas,\n size = _jp.getSize(refCanvas),\n // these are used to store the current relative position of our\n // anchor wrt the reference anchor. they only indicate\n // direction, so have a value of 1 or -1 (or, very rarely, 0). these\n // values are written by the compute method, and read\n // by the getOrientation method.\n xDir = 0, yDir = 0,\n // temporary member used to store an orientation when the floating\n // anchor is hovering over another anchor.\n orientation = null,\n _lastResult = null;\n\n // clear from parent. we want floating anchor orientation to always be computed.\n this.orientation = null;\n\n // set these to 0 each; they are used by certain types of connectors in the loopback case,\n // when the connector is trying to clear the element it is on. but for floating anchor it's not\n // very important.\n this.x = 0;\n this.y = 0;\n\n this.isFloating = true;\n\n this.compute = function (params) {\n var xy = params.xy,\n result = [ xy[0] + (size[0] / 2), xy[1] + (size[1] / 2) ]; // return origin of the element. we may wish to improve this so that any object can be the drag proxy.\n _lastResult = result;\n return result;\n };\n\n this.getOrientation = function (_endpoint) {\n if (orientation) {\n return orientation;\n }\n else {\n var o = ref.getOrientation(_endpoint);\n // here we take into account the orientation of the other\n // anchor: if it declares zero for some direction, we declare zero too. this might not be the most awesome. perhaps we can come\n // up with a better way. it's just so that the line we draw looks like it makes sense. maybe this wont make sense.\n return [ Math.abs(o[0]) * xDir * -1,\n Math.abs(o[1]) * yDir * -1 ];\n }\n };\n\n /**\n * notification the endpoint associated with this anchor is hovering\n * over another anchor; we want to assume that anchor's orientation\n * for the duration of the hover.\n */\n this.over = function (anchor, endpoint) {\n orientation = anchor.getOrientation(endpoint);\n };\n\n /**\n * notification the endpoint associated with this anchor is no\n * longer hovering over another anchor; we should resume calculating\n * orientation as we normally do.\n */\n this.out = function () {\n orientation = null;\n };\n\n this.getCurrentLocation = function (params) {\n return _lastResult == null ? this.compute(params) : _lastResult;\n };\n };\n _ju.extend(_jp.FloatingAnchor, _jp.Anchor);\n\n var _convertAnchor = function (anchor, jsPlumbInstance, elementId) {\n return anchor.constructor === _jp.Anchor ? anchor : jsPlumbInstance.makeAnchor(anchor, elementId, jsPlumbInstance);\n };\n\n /* \n * A DynamicAnchor is an Anchor that contains a list of other Anchors, which it cycles\n * through at compute time to find the one that is located closest to\n * the center of the target element, and returns that Anchor's compute\n * method result. this causes endpoints to follow each other with\n * respect to the orientation of their target elements, which is a useful\n * feature for some applications.\n * \n */\n _jp.DynamicAnchor = function (params) {\n _jp.Anchor.apply(this, arguments);\n\n this.isDynamic = true;\n this.anchors = [];\n this.elementId = params.elementId;\n this.jsPlumbInstance = params.jsPlumbInstance;\n\n for (var i = 0; i < params.anchors.length; i++) {\n this.anchors[i] = _convertAnchor(params.anchors[i], this.jsPlumbInstance, this.elementId);\n }\n\n this.getAnchors = function () {\n return this.anchors;\n };\n\n var _curAnchor = this.anchors.length > 0 ? this.anchors[0] : null,\n _lastAnchor = _curAnchor,\n self = this,\n\n // helper method to calculate the distance between the centers of the two elements.\n _distance = function (anchor, cx, cy, xy, wh) {\n var ax = xy[0] + (anchor.x * wh[0]), ay = xy[1] + (anchor.y * wh[1]),\n acx = xy[0] + (wh[0] / 2), acy = xy[1] + (wh[1] / 2);\n return (Math.sqrt(Math.pow(cx - ax, 2) + Math.pow(cy - ay, 2)) +\n Math.sqrt(Math.pow(acx - ax, 2) + Math.pow(acy - ay, 2)));\n },\n // default method uses distance between element centers. you can provide your own method in the dynamic anchor\n // constructor (and also to jsPlumb.makeDynamicAnchor). the arguments to it are four arrays:\n // xy - xy loc of the anchor's element\n // wh - anchor's element's dimensions\n // txy - xy loc of the element of the other anchor in the connection\n // twh - dimensions of the element of the other anchor in the connection.\n // anchors - the list of selectable anchors\n _anchorSelector = params.selector || function (xy, wh, txy, twh, anchors) {\n var cx = txy[0] + (twh[0] / 2), cy = txy[1] + (twh[1] / 2);\n var minIdx = -1, minDist = Infinity;\n for (var i = 0; i < anchors.length; i++) {\n var d = _distance(anchors[i], cx, cy, xy, wh);\n if (d < minDist) {\n minIdx = i + 0;\n minDist = d;\n }\n }\n return anchors[minIdx];\n };\n\n this.compute = function (params) {\n var xy = params.xy, wh = params.wh, txy = params.txy, twh = params.twh;\n\n this.timestamp = params.timestamp;\n\n var udl = self.getUserDefinedLocation();\n if (udl != null) {\n return udl;\n }\n\n // if anchor is locked or an opposite element was not given, we\n // maintain our state. anchor will be locked\n // if it is the source of a drag and drop.\n if (this.isLocked() || txy == null || twh == null) {\n return _curAnchor.compute(params);\n }\n else {\n params.timestamp = null; // otherwise clear this, i think. we want the anchor to compute.\n }\n\n _curAnchor = _anchorSelector(xy, wh, txy, twh, this.anchors);\n this.x = _curAnchor.x;\n this.y = _curAnchor.y;\n\n if (_curAnchor !== _lastAnchor) {\n this.fire(\"anchorChanged\", _curAnchor);\n }\n\n _lastAnchor = _curAnchor;\n\n return _curAnchor.compute(params);\n };\n\n this.getCurrentLocation = function (params) {\n return this.getUserDefinedLocation() || (_curAnchor != null ? _curAnchor.getCurrentLocation(params) : null);\n };\n\n this.getOrientation = function (_endpoint) {\n return _curAnchor != null ? _curAnchor.getOrientation(_endpoint) : [ 0, 0 ];\n };\n this.over = function (anchor, endpoint) {\n if (_curAnchor != null) {\n _curAnchor.over(anchor, endpoint);\n }\n };\n this.out = function () {\n if (_curAnchor != null) {\n _curAnchor.out();\n }\n };\n\n this.setAnchor = function(a) {\n _curAnchor = a;\n };\n\n this.getCssClass = function () {\n return (_curAnchor && _curAnchor.getCssClass()) || \"\";\n };\n\n /**\n * Attempt to match an anchor with the given coordinates and then set it.\n * @param coords\n * @returns true if matching anchor found, false otherwise.\n */\n this.setAnchorCoordinates = function(coords) {\n var idx = jsPlumbUtil.findWithFunction(this.anchors, function(a) {\n return a.x === coords[0] && a.y === coords[1];\n });\n if (idx !== -1) {\n this.setAnchor(this.anchors[idx]);\n return true;\n } else {\n return false;\n }\n };\n };\n _ju.extend(_jp.DynamicAnchor, _jp.Anchor);\n\n// -------- basic anchors ------------------ \n var _curryAnchor = function (x, y, ox, oy, type, fnInit) {\n _jp.Anchors[type] = function (params) {\n var a = params.jsPlumbInstance.makeAnchor([ x, y, ox, oy, 0, 0 ], params.elementId, params.jsPlumbInstance);\n a.type = type;\n if (fnInit) {\n fnInit(a, params);\n }\n return a;\n };\n };\n\n _curryAnchor(0.5, 0, 0, -1, \"TopCenter\");\n _curryAnchor(0.5, 1, 0, 1, \"BottomCenter\");\n _curryAnchor(0, 0.5, -1, 0, \"LeftMiddle\");\n _curryAnchor(1, 0.5, 1, 0, \"RightMiddle\");\n\n _curryAnchor(0.5, 0, 0, -1, \"Top\");\n _curryAnchor(0.5, 1, 0, 1, \"Bottom\");\n _curryAnchor(0, 0.5, -1, 0, \"Left\");\n _curryAnchor(1, 0.5, 1, 0, \"Right\");\n _curryAnchor(0.5, 0.5, 0, 0, \"Center\");\n _curryAnchor(1, 0, 0, -1, \"TopRight\");\n _curryAnchor(1, 1, 0, 1, \"BottomRight\");\n _curryAnchor(0, 0, 0, -1, \"TopLeft\");\n _curryAnchor(0, 1, 0, 1, \"BottomLeft\");\n\n// ------- dynamic anchors ------------------- \n\n // default dynamic anchors chooses from Top, Right, Bottom, Left\n _jp.Defaults.DynamicAnchors = function (params) {\n return params.jsPlumbInstance.makeAnchors([\"TopCenter\", \"RightMiddle\", \"BottomCenter\", \"LeftMiddle\"], params.elementId, params.jsPlumbInstance);\n };\n\n // default dynamic anchors bound to name 'AutoDefault'\n _jp.Anchors.AutoDefault = function (params) {\n var a = params.jsPlumbInstance.makeDynamicAnchor(_jp.Defaults.DynamicAnchors(params));\n a.type = \"AutoDefault\";\n return a;\n };\n\n// ------- continuous anchors ------------------- \n\n var _curryContinuousAnchor = function (type, faces) {\n _jp.Anchors[type] = function (params) {\n var a = params.jsPlumbInstance.makeAnchor([\"Continuous\", { faces: faces }], params.elementId, params.jsPlumbInstance);\n a.type = type;\n return a;\n };\n };\n\n _jp.Anchors.Continuous = function (params) {\n return params.jsPlumbInstance.continuousAnchorFactory.get(params);\n };\n\n _curryContinuousAnchor(\"ContinuousLeft\", [\"left\"]);\n _curryContinuousAnchor(\"ContinuousTop\", [\"top\"]);\n _curryContinuousAnchor(\"ContinuousBottom\", [\"bottom\"]);\n _curryContinuousAnchor(\"ContinuousRight\", [\"right\"]);\n\n// ------- position assign anchors ------------------- \n\n // this anchor type lets you assign the position at connection time.\n _curryAnchor(0, 0, 0, 0, \"Assign\", function (anchor, params) {\n // find what to use as the \"position finder\". the user may have supplied a String which represents\n // the id of a position finder in jsPlumb.AnchorPositionFinders, or the user may have supplied the\n // position finder as a function. we find out what to use and then set it on the anchor.\n var pf = params.position || \"Fixed\";\n anchor.positionFinder = pf.constructor === String ? params.jsPlumbInstance.AnchorPositionFinders[pf] : pf;\n // always set the constructor params; the position finder might need them later (the Grid one does,\n // for example)\n anchor.constructorParams = params;\n });\n\n // these are the default anchor positions finders, which are used by the makeTarget function. supplying\n // a position finder argument to that function allows you to specify where the resulting anchor will\n // be located\n root.jsPlumbInstance.prototype.AnchorPositionFinders = {\n \"Fixed\": function (dp, ep, es) {\n return [ (dp.left - ep.left) / es[0], (dp.top - ep.top) / es[1] ];\n },\n \"Grid\": function (dp, ep, es, params) {\n var dx = dp.left - ep.left, dy = dp.top - ep.top,\n gx = es[0] / (params.grid[0]), gy = es[1] / (params.grid[1]),\n mx = Math.floor(dx / gx), my = Math.floor(dy / gy);\n return [ ((mx * gx) + (gx / 2)) / es[0], ((my * gy) + (gy / 2)) / es[1] ];\n }\n };\n\n// ------- perimeter anchors ------------------- \n\n _jp.Anchors.Perimeter = function (params) {\n params = params || {};\n var anchorCount = params.anchorCount || 60,\n shape = params.shape;\n\n if (!shape) {\n throw new Error(\"no shape supplied to Perimeter Anchor type\");\n }\n\n var _circle = function () {\n var r = 0.5, step = Math.PI * 2 / anchorCount, current = 0, a = [];\n for (var i = 0; i < anchorCount; i++) {\n var x = r + (r * Math.sin(current)),\n y = r + (r * Math.cos(current));\n a.push([ x, y, 0, 0 ]);\n current += step;\n }\n return a;\n },\n _path = function (segments) {\n var anchorsPerFace = anchorCount / segments.length, a = [],\n _computeFace = function (x1, y1, x2, y2, fractionalLength) {\n anchorsPerFace = anchorCount * fractionalLength;\n var dx = (x2 - x1) / anchorsPerFace, dy = (y2 - y1) / anchorsPerFace;\n for (var i = 0; i < anchorsPerFace; i++) {\n a.push([\n x1 + (dx * i),\n y1 + (dy * i),\n 0,\n 0\n ]);\n }\n };\n\n for (var i = 0; i < segments.length; i++) {\n _computeFace.apply(null, segments[i]);\n }\n\n return a;\n },\n _shape = function (faces) {\n var s = [];\n for (var i = 0; i < faces.length; i++) {\n s.push([faces[i][0], faces[i][1], faces[i][2], faces[i][3], 1 / faces.length]);\n }\n return _path(s);\n },\n _rectangle = function () {\n return _shape([\n [ 0, 0, 1, 0 ],\n [ 1, 0, 1, 1 ],\n [ 1, 1, 0, 1 ],\n [ 0, 1, 0, 0 ]\n ]);\n };\n\n var _shapes = {\n \"Circle\": _circle,\n \"Ellipse\": _circle,\n \"Diamond\": function () {\n return _shape([\n [ 0.5, 0, 1, 0.5 ],\n [ 1, 0.5, 0.5, 1 ],\n [ 0.5, 1, 0, 0.5 ],\n [ 0, 0.5, 0.5, 0 ]\n ]);\n },\n \"Rectangle\": _rectangle,\n \"Square\": _rectangle,\n \"Triangle\": function () {\n return _shape([\n [ 0.5, 0, 1, 1 ],\n [ 1, 1, 0, 1 ],\n [ 0, 1, 0.5, 0]\n ]);\n },\n \"Path\": function (params) {\n var points = params.points, p = [], tl = 0;\n for (var i = 0; i < points.length - 1; i++) {\n var l = Math.sqrt(Math.pow(points[i][2] - points[i][0]) + Math.pow(points[i][3] - points[i][1]));\n tl += l;\n p.push([points[i][0], points[i][1], points[i + 1][0], points[i + 1][1], l]);\n }\n for (var j = 0; j < p.length; j++) {\n p[j][4] = p[j][4] / tl;\n }\n return _path(p);\n }\n },\n _rotate = function (points, amountInDegrees) {\n var o = [], theta = amountInDegrees / 180 * Math.PI;\n for (var i = 0; i < points.length; i++) {\n var _x = points[i][0] - 0.5,\n _y = points[i][1] - 0.5;\n\n o.push([\n 0.5 + ((_x * Math.cos(theta)) - (_y * Math.sin(theta))),\n 0.5 + ((_x * Math.sin(theta)) + (_y * Math.cos(theta))),\n points[i][2],\n points[i][3]\n ]);\n }\n return o;\n };\n\n if (!_shapes[shape]) {\n throw new Error(\"Shape [\" + shape + \"] is unknown by Perimeter Anchor type\");\n }\n\n var da = _shapes[shape](params);\n if (params.rotation) {\n da = _rotate(da, params.rotation);\n }\n var a = params.jsPlumbInstance.makeDynamicAnchor(da);\n a.type = \"Perimeter\";\n return a;\n };\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the default Connectors, Endpoint and Overlay definitions.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n * \n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil, _jg = root.Biltong;\n\n _jp.Segments = {\n\n /*\n * Class: AbstractSegment\n * A Connector is made up of 1..N Segments, each of which has a Type, such as 'Straight', 'Arc',\n * 'Bezier'. This is new from 1.4.2, and gives us a lot more flexibility when drawing connections: things such\n * as rounded corners for flowchart connectors, for example, or a straight line stub for Bezier connections, are\n * much easier to do now.\n *\n * A Segment is responsible for providing coordinates for painting it, and also must be able to report its length.\n * \n */\n AbstractSegment: function (params) {\n this.params = params;\n\n /**\n * Function: findClosestPointOnPath\n * Finds the closest point on this segment to the given [x, y],\n * returning both the x and y of the point plus its distance from\n * the supplied point, and its location along the length of the\n * path inscribed by the segment. This implementation returns\n * Infinity for distance and null values for everything else;\n * subclasses are expected to override.\n */\n this.findClosestPointOnPath = function (x, y) {\n return {\n d: Infinity,\n x: null,\n y: null,\n l: null\n };\n };\n\n this.getBounds = function () {\n return {\n minX: Math.min(params.x1, params.x2),\n minY: Math.min(params.y1, params.y2),\n maxX: Math.max(params.x1, params.x2),\n maxY: Math.max(params.y1, params.y2)\n };\n };\n\n /**\n * Computes the list of points on the segment that intersect the given line.\n * @method lineIntersection\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @returns {Array<[number, number]>}\n */\n this.lineIntersection = function(x1, y1, x2, y2) {\n return [];\n };\n\n /**\n * Computes the list of points on the segment that intersect the box with the given origin and size.\n * @method boxIntersection\n * @param {number} x1\n * @param {number} y1\n * @param {number} w\n * @param {number} h\n * @returns {Array<[number, number]>}\n */\n this.boxIntersection = function(x, y, w, h) {\n var a = [];\n a.push.apply(a, this.lineIntersection(x, y, x + w, y));\n a.push.apply(a, this.lineIntersection(x + w, y, x + w, y + h));\n a.push.apply(a, this.lineIntersection(x + w, y + h, x, y + h));\n a.push.apply(a, this.lineIntersection(x, y + h, x, y));\n return a;\n };\n\n /**\n * Computes the list of points on the segment that intersect the given bounding box, which is an object of the form { x:.., y:.., w:.., h:.. }.\n * @method lineIntersection\n * @param {BoundingRectangle} box\n * @returns {Array<[number, number]>}\n */\n this.boundingBoxIntersection = function(box) {\n return this.boxIntersection(box.x, box.y, box.w, box.y);\n };\n },\n Straight: function (params) {\n var _super = _jp.Segments.AbstractSegment.apply(this, arguments),\n length, m, m2, x1, x2, y1, y2,\n _recalc = function () {\n length = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n m = _jg.gradient({x: x1, y: y1}, {x: x2, y: y2});\n m2 = -1 / m;\n };\n\n this.type = \"Straight\";\n\n this.getLength = function () {\n return length;\n };\n this.getGradient = function () {\n return m;\n };\n\n this.getCoordinates = function () {\n return { x1: x1, y1: y1, x2: x2, y2: y2 };\n };\n this.setCoordinates = function (coords) {\n x1 = coords.x1;\n y1 = coords.y1;\n x2 = coords.x2;\n y2 = coords.y2;\n _recalc();\n };\n this.setCoordinates({x1: params.x1, y1: params.y1, x2: params.x2, y2: params.y2});\n\n this.getBounds = function () {\n return {\n minX: Math.min(x1, x2),\n minY: Math.min(y1, y2),\n maxX: Math.max(x1, x2),\n maxY: Math.max(y1, y2)\n };\n };\n\n /**\n * returns the point on the segment's path that is 'location' along the length of the path, where 'location' is a decimal from\n * 0 to 1 inclusive. for the straight line segment this is simple maths.\n */\n this.pointOnPath = function (location, absolute) {\n if (location === 0 && !absolute) {\n return { x: x1, y: y1 };\n }\n else if (location === 1 && !absolute) {\n return { x: x2, y: y2 };\n }\n else {\n var l = absolute ? location > 0 ? location : length + location : location * length;\n return _jg.pointOnLine({x: x1, y: y1}, {x: x2, y: y2}, l);\n }\n };\n\n /**\n * returns the gradient of the segment at the given point - which for us is constant.\n */\n this.gradientAtPoint = function (_) {\n return m;\n };\n\n /**\n * returns the point on the segment's path that is 'distance' along the length of the path from 'location', where\n * 'location' is a decimal from 0 to 1 inclusive, and 'distance' is a number of pixels.\n * this hands off to jsPlumbUtil to do the maths, supplying two points and the distance.\n */\n this.pointAlongPathFrom = function (location, distance, absolute) {\n var p = this.pointOnPath(location, absolute),\n farAwayPoint = distance <= 0 ? {x: x1, y: y1} : {x: x2, y: y2 };\n\n /*\n location == 1 ? {\n x:x1 + ((x2 - x1) * 10),\n y:y1 + ((y1 - y2) * 10)\n } :\n */\n\n if (distance <= 0 && Math.abs(distance) > 1) {\n distance *= -1;\n }\n\n return _jg.pointOnLine(p, farAwayPoint, distance);\n };\n\n // is c between a and b?\n var within = function (a, b, c) {\n return c >= Math.min(a, b) && c <= Math.max(a, b);\n };\n // find which of a and b is closest to c\n var closest = function (a, b, c) {\n return Math.abs(c - a) < Math.abs(c - b) ? a : b;\n };\n\n /**\n Function: findClosestPointOnPath\n Finds the closest point on this segment to [x,y]. See\n notes on this method in AbstractSegment.\n */\n this.findClosestPointOnPath = function (x, y) {\n var out = {\n d: Infinity,\n x: null,\n y: null,\n l: null,\n x1: x1,\n x2: x2,\n y1: y1,\n y2: y2\n };\n\n if (m === 0) {\n out.y = y1;\n out.x = within(x1, x2, x) ? x : closest(x1, x2, x);\n }\n else if (m === Infinity || m === -Infinity) {\n out.x = x1;\n out.y = within(y1, y2, y) ? y : closest(y1, y2, y);\n }\n else {\n // closest point lies on normal from given point to this line. \n var b = y1 - (m * x1),\n b2 = y - (m2 * x),\n // y1 = m.x1 + b and y1 = m2.x1 + b2\n // so m.x1 + b = m2.x1 + b2\n // x1(m - m2) = b2 - b\n // x1 = (b2 - b) / (m - m2)\n _x1 = (b2 - b) / (m - m2),\n _y1 = (m * _x1) + b;\n\n out.x = within(x1, x2, _x1) ? _x1 : closest(x1, x2, _x1);//_x1;\n out.y = within(y1, y2, _y1) ? _y1 : closest(y1, y2, _y1);//_y1;\n }\n\n var fractionInSegment = _jg.lineLength([ out.x, out.y ], [ x1, y1 ]);\n out.d = _jg.lineLength([x, y], [out.x, out.y]);\n out.l = fractionInSegment / length;\n return out;\n };\n\n var _pointLiesBetween = function(q, p1, p2) {\n return (p2 > p1) ? (p1 <= q && q <= p2) : (p1 >= q && q >= p2);\n }, _plb = _pointLiesBetween;\n\n /**\n * Calculates all intersections of the given line with this segment.\n * @param _x1\n * @param _y1\n * @param _x2\n * @param _y2\n * @returns {Array}\n */\n this.lineIntersection = function(_x1, _y1, _x2, _y2) {\n var m2 = Math.abs(_jg.gradient({x: _x1, y: _y1}, {x: _x2, y: _y2})),\n m1 = Math.abs(m),\n b = m1 === Infinity ? x1 : y1 - (m1 * x1),\n out = [],\n b2 = m2 === Infinity ? _x1 : _y1 - (m2 * _x1);\n\n // if lines parallel, no intersection\n if (m2 !== m1) {\n // perpendicular, segment horizontal\n if(m2 === Infinity && m1 === 0) {\n if (_plb(_x1, x1, x2) && _plb(y1, _y1, _y2)) {\n out = [ _x1, y1 ]; // we return X on the incident line and Y from the segment\n }\n } else if(m2 === 0 && m1 === Infinity) {\n // perpendicular, segment vertical\n if(_plb(_y1, y1, y2) && _plb(x1, _x1, _x2)) {\n out = [x1, _y1]; // we return X on the segment and Y from the incident line\n }\n } else {\n var X, Y;\n if (m2 === Infinity) {\n // test line is a vertical line. where does it cross the segment?\n X = _x1;\n if (_plb(X, x1, x2)) {\n Y = (m1 * _x1) + b;\n if (_plb(Y, _y1, _y2)) {\n out = [ X, Y ];\n }\n }\n } else if (m2 === 0) {\n Y = _y1;\n // test line is a horizontal line. where does it cross the segment?\n if (_plb(Y, y1, y2)) {\n X = (_y1 - b) / m1;\n if (_plb(X, _x1, _x2)) {\n out = [ X, Y ];\n }\n }\n } else {\n // mX + b = m2X + b2\n // mX - m2X = b2 - b\n // X(m - m2) = b2 - b\n // X = (b2 - b) / (m - m2)\n // Y = mX + b\n X = (b2 - b) / (m1 - m2);\n Y = (m1 * X) + b;\n if(_plb(X, x1, x2) && _plb(Y, y1, y2)) {\n out = [ X, Y];\n }\n }\n }\n }\n\n return out;\n };\n\n /**\n * Calculates all intersections of the given box with this segment. By default this method simply calls `lineIntersection` with each of the four\n * faces of the box; subclasses can override this if they think there's a faster way to compute the entire box at once.\n * @param x X position of top left corner of box\n * @param y Y position of top left corner of box\n * @param w width of box\n * @param h height of box\n * @returns {Array}\n */\n this.boxIntersection = function(x, y, w, h) {\n var a = [];\n a.push.apply(a, this.lineIntersection(x, y, x + w, y));\n a.push.apply(a, this.lineIntersection(x + w, y, x + w, y + h));\n a.push.apply(a, this.lineIntersection(x + w, y + h, x, y + h));\n a.push.apply(a, this.lineIntersection(x, y + h, x, y));\n return a;\n };\n\n /**\n * Calculates all intersections of the given bounding box with this segment. By default this method simply calls `lineIntersection` with each of the four\n * faces of the box; subclasses can override this if they think there's a faster way to compute the entire box at once.\n * @param box Bounding box, in { x:.., y:..., w:..., h:... } format.\n * @returns {Array}\n */\n this.boundingBoxIntersection = function(box) {\n return this.boxIntersection(box.x, box.y, box.w, box.h);\n };\n },\n\n /*\n Arc Segment. You need to supply:\n\n r - radius\n cx - center x for the arc\n cy - center y for the arc\n ac - whether the arc is anticlockwise or not. default is clockwise.\n\n and then either:\n\n startAngle - startAngle for the arc.\n endAngle - endAngle for the arc.\n\n or:\n\n x1 - x for start point\n y1 - y for start point\n x2 - x for end point\n y2 - y for end point\n\n */\n Arc: function (params) {\n var _super = _jp.Segments.AbstractSegment.apply(this, arguments),\n _calcAngle = function (_x, _y) {\n return _jg.theta([params.cx, params.cy], [_x, _y]);\n },\n _calcAngleForLocation = function (segment, location) {\n if (segment.anticlockwise) {\n var sa = segment.startAngle < segment.endAngle ? segment.startAngle + TWO_PI : segment.startAngle,\n s = Math.abs(sa - segment.endAngle);\n return sa - (s * location);\n }\n else {\n var ea = segment.endAngle < segment.startAngle ? segment.endAngle + TWO_PI : segment.endAngle,\n ss = Math.abs(ea - segment.startAngle);\n\n return segment.startAngle + (ss * location);\n }\n },\n TWO_PI = 2 * Math.PI;\n\n this.radius = params.r;\n this.anticlockwise = params.ac;\n this.type = \"Arc\";\n\n if (params.startAngle && params.endAngle) {\n this.startAngle = params.startAngle;\n this.endAngle = params.endAngle;\n this.x1 = params.cx + (this.radius * Math.cos(params.startAngle));\n this.y1 = params.cy + (this.radius * Math.sin(params.startAngle));\n this.x2 = params.cx + (this.radius * Math.cos(params.endAngle));\n this.y2 = params.cy + (this.radius * Math.sin(params.endAngle));\n }\n else {\n this.startAngle = _calcAngle(params.x1, params.y1);\n this.endAngle = _calcAngle(params.x2, params.y2);\n this.x1 = params.x1;\n this.y1 = params.y1;\n this.x2 = params.x2;\n this.y2 = params.y2;\n }\n\n if (this.endAngle < 0) {\n this.endAngle += TWO_PI;\n }\n if (this.startAngle < 0) {\n this.startAngle += TWO_PI;\n }\n\n // segment is used by vml \n //this.segment = _jg.quadrant([this.x1, this.y1], [this.x2, this.y2]);\n\n // we now have startAngle and endAngle as positive numbers, meaning the\n // absolute difference (|d|) between them is the sweep (s) of this arc, unless the\n // arc is 'anticlockwise' in which case 's' is given by 2PI - |d|.\n\n var ea = this.endAngle < this.startAngle ? this.endAngle + TWO_PI : this.endAngle;\n this.sweep = Math.abs(ea - this.startAngle);\n if (this.anticlockwise) {\n this.sweep = TWO_PI - this.sweep;\n }\n var circumference = 2 * Math.PI * this.radius,\n frac = this.sweep / TWO_PI,\n length = circumference * frac;\n\n this.getLength = function () {\n return length;\n };\n\n this.getBounds = function () {\n return {\n minX: params.cx - params.r,\n maxX: params.cx + params.r,\n minY: params.cy - params.r,\n maxY: params.cy + params.r\n };\n };\n\n var VERY_SMALL_VALUE = 0.0000000001,\n gentleRound = function (n) {\n var f = Math.floor(n), r = Math.ceil(n);\n if (n - f < VERY_SMALL_VALUE) {\n return f;\n }\n else if (r - n < VERY_SMALL_VALUE) {\n return r;\n }\n return n;\n };\n\n /**\n * returns the point on the segment's path that is 'location' along the length of the path, where 'location' is a decimal from\n * 0 to 1 inclusive.\n */\n this.pointOnPath = function (location, absolute) {\n\n if (location === 0) {\n return { x: this.x1, y: this.y1, theta: this.startAngle };\n }\n else if (location === 1) {\n return { x: this.x2, y: this.y2, theta: this.endAngle };\n }\n\n if (absolute) {\n location = location / length;\n }\n\n var angle = _calcAngleForLocation(this, location),\n _x = params.cx + (params.r * Math.cos(angle)),\n _y = params.cy + (params.r * Math.sin(angle));\n\n return { x: gentleRound(_x), y: gentleRound(_y), theta: angle };\n };\n\n /**\n * returns the gradient of the segment at the given point.\n */\n this.gradientAtPoint = function (location, absolute) {\n var p = this.pointOnPath(location, absolute);\n var m = _jg.normal([ params.cx, params.cy ], [p.x, p.y ]);\n if (!this.anticlockwise && (m === Infinity || m === -Infinity)) {\n m *= -1;\n }\n return m;\n };\n\n this.pointAlongPathFrom = function (location, distance, absolute) {\n var p = this.pointOnPath(location, absolute),\n arcSpan = distance / circumference * 2 * Math.PI,\n dir = this.anticlockwise ? -1 : 1,\n startAngle = p.theta + (dir * arcSpan),\n startX = params.cx + (this.radius * Math.cos(startAngle)),\n startY = params.cy + (this.radius * Math.sin(startAngle));\n\n return {x: startX, y: startY};\n };\n\n // TODO: lineIntersection\n },\n\n Bezier: function (params) {\n this.curve = [\n { x: params.x1, y: params.y1},\n { x: params.cp1x, y: params.cp1y },\n { x: params.cp2x, y: params.cp2y },\n { x: params.x2, y: params.y2 }\n ];\n\n var _super = _jp.Segments.AbstractSegment.apply(this, arguments);\n // although this is not a strictly rigorous determination of bounds\n // of a bezier curve, it works for the types of curves that this segment\n // type produces.\n this.bounds = {\n minX: Math.min(params.x1, params.x2, params.cp1x, params.cp2x),\n minY: Math.min(params.y1, params.y2, params.cp1y, params.cp2y),\n maxX: Math.max(params.x1, params.x2, params.cp1x, params.cp2x),\n maxY: Math.max(params.y1, params.y2, params.cp1y, params.cp2y)\n };\n\n this.type = \"Bezier\";\n\n var _translateLocation = function (_curve, location, absolute) {\n if (absolute) {\n location = root.jsBezier.locationAlongCurveFrom(_curve, location > 0 ? 0 : 1, location);\n }\n\n return location;\n };\n\n /**\n * returns the point on the segment's path that is 'location' along the length of the path, where 'location' is a decimal from\n * 0 to 1 inclusive.\n */\n this.pointOnPath = function (location, absolute) {\n location = _translateLocation(this.curve, location, absolute);\n return root.jsBezier.pointOnCurve(this.curve, location);\n };\n\n /**\n * returns the gradient of the segment at the given point.\n */\n this.gradientAtPoint = function (location, absolute) {\n location = _translateLocation(this.curve, location, absolute);\n return root.jsBezier.gradientAtPoint(this.curve, location);\n };\n\n this.pointAlongPathFrom = function (location, distance, absolute) {\n location = _translateLocation(this.curve, location, absolute);\n return root.jsBezier.pointAlongCurveFrom(this.curve, location, distance);\n };\n\n this.getLength = function () {\n return root.jsBezier.getLength(this.curve);\n };\n\n this.getBounds = function () {\n return this.bounds;\n };\n\n this.findClosestPointOnPath = function (x, y) {\n var p = root.jsBezier.nearestPointOnCurve({x:x,y:y}, this.curve);\n return {\n d:Math.sqrt(Math.pow(p.point.x - x, 2) + Math.pow(p.point.y - y, 2)),\n x:p.point.x,\n y:p.point.y,\n l:p.location,\n s:this\n };\n };\n\n this.lineIntersection = function(x1, y1, x2, y2) {\n return root.jsBezier.lineIntersection(x1, y1, x2, y2, this.curve);\n };\n }\n };\n\n _jp.SegmentRenderer = {\n getPath: function (segment, isFirstSegment) {\n return ({\n \"Straight\": function (isFirstSegment) {\n var d = segment.getCoordinates();\n return (isFirstSegment ? \"M \" + d.x1 + \" \" + d.y1 + \" \" : \"\") + \"L \" + d.x2 + \" \" + d.y2;\n },\n \"Bezier\": function (isFirstSegment) {\n var d = segment.params;\n return (isFirstSegment ? \"M \" + d.x2 + \" \" + d.y2 + \" \" : \"\") +\n \"C \" + d.cp2x + \" \" + d.cp2y + \" \" + d.cp1x + \" \" + d.cp1y + \" \" + d.x1 + \" \" + d.y1;\n },\n \"Arc\": function (isFirstSegment) {\n var d = segment.params,\n laf = segment.sweep > Math.PI ? 1 : 0,\n sf = segment.anticlockwise ? 0 : 1;\n\n return (isFirstSegment ? \"M\" + segment.x1 + \" \" + segment.y1 + \" \" : \"\") + \"A \" + segment.radius + \" \" + d.r + \" 0 \" + laf + \",\" + sf + \" \" + segment.x2 + \" \" + segment.y2;\n }\n })[segment.type](isFirstSegment);\n }\n };\n\n /*\n Class: UIComponent\n Superclass for Connector and AbstractEndpoint.\n */\n var AbstractComponent = function () {\n this.resetBounds = function () {\n this.bounds = { minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity };\n };\n this.resetBounds();\n };\n\n /*\n * Class: Connector\n * Superclass for all Connectors; here is where Segments are managed. This is exposed on jsPlumb just so it\n * can be accessed from other files. You should not try to instantiate one of these directly.\n *\n * When this class is asked for a pointOnPath, or gradient etc, it must first figure out which segment to dispatch\n * that request to. This is done by keeping track of the total connector length as segments are added, and also\n * their cumulative ratios to the total length. Then when the right segment is found it is a simple case of dispatching\n * the request to it (and adjusting 'location' so that it is relative to the beginning of that segment.)\n */\n _jp.Connectors.AbstractConnector = function (params) {\n\n AbstractComponent.apply(this, arguments);\n\n var segments = [],\n totalLength = 0,\n segmentProportions = [],\n segmentProportionalLengths = [],\n stub = params.stub || 0,\n sourceStub = _ju.isArray(stub) ? stub[0] : stub,\n targetStub = _ju.isArray(stub) ? stub[1] : stub,\n gap = params.gap || 0,\n sourceGap = _ju.isArray(gap) ? gap[0] : gap,\n targetGap = _ju.isArray(gap) ? gap[1] : gap,\n userProvidedSegments = null,\n paintInfo = null;\n\n this.getPathData = function() {\n var p = \"\";\n for (var i = 0; i < segments.length; i++) {\n p += _jp.SegmentRenderer.getPath(segments[i], i === 0);\n p += \" \";\n }\n return p;\n };\n\n /**\n * Function: findSegmentForPoint\n * Returns the segment that is closest to the given [x,y],\n * null if nothing found. This function returns a JS\n * object with:\n *\n * d - distance from segment\n * l - proportional location in segment\n * x - x point on the segment\n * y - y point on the segment\n * s - the segment itself.\n */\n this.findSegmentForPoint = function (x, y) {\n var out = { d: Infinity, s: null, x: null, y: null, l: null };\n for (var i = 0; i < segments.length; i++) {\n var _s = segments[i].findClosestPointOnPath(x, y);\n if (_s.d < out.d) {\n out.d = _s.d;\n out.l = _s.l;\n out.x = _s.x;\n out.y = _s.y;\n out.s = segments[i];\n out.x1 = _s.x1;\n out.x2 = _s.x2;\n out.y1 = _s.y1;\n out.y2 = _s.y2;\n out.index = i;\n }\n }\n\n return out;\n };\n\n this.lineIntersection = function(x1, y1, x2, y2) {\n var out = [];\n for (var i = 0; i < segments.length; i++) {\n out.push.apply(out, segments[i].lineIntersection(x1, y1, x2, y2));\n }\n return out;\n };\n\n this.boxIntersection = function(x, y, w, h) {\n var out = [];\n for (var i = 0; i < segments.length; i++) {\n out.push.apply(out, segments[i].boxIntersection(x, y, w, h));\n }\n return out;\n };\n\n this.boundingBoxIntersection = function(box) {\n var out = [];\n for (var i = 0; i < segments.length; i++) {\n out.push.apply(out, segments[i].boundingBoxIntersection(box));\n }\n return out;\n };\n\n var _updateSegmentProportions = function () {\n var curLoc = 0;\n for (var i = 0; i < segments.length; i++) {\n var sl = segments[i].getLength();\n segmentProportionalLengths[i] = sl / totalLength;\n segmentProportions[i] = [curLoc, (curLoc += (sl / totalLength)) ];\n }\n },\n\n /**\n * returns [segment, proportion of travel in segment, segment index] for the segment\n * that contains the point which is 'location' distance along the entire path, where\n * 'location' is a decimal between 0 and 1 inclusive. in this connector type, paths\n * are made up of a list of segments, each of which contributes some fraction to\n * the total length.\n * From 1.3.10 this also supports the 'absolute' property, which lets us specify a location\n * as the absolute distance in pixels, rather than a proportion of the total path.\n */\n _findSegmentForLocation = function (location, absolute) {\n if (absolute) {\n location = location > 0 ? location / totalLength : (totalLength + location) / totalLength;\n }\n var idx = segmentProportions.length - 1, inSegmentProportion = 1;\n for (var i = 0; i < segmentProportions.length; i++) {\n if (segmentProportions[i][1] >= location) {\n idx = i;\n // todo is this correct for all connector path types?\n inSegmentProportion = location === 1 ? 1 : location === 0 ? 0 : (location - segmentProportions[i][0]) / segmentProportionalLengths[i];\n break;\n }\n }\n return { segment: segments[idx], proportion: inSegmentProportion, index: idx };\n },\n _addSegment = function (conn, type, params) {\n if (params.x1 === params.x2 && params.y1 === params.y2) {\n return;\n }\n var s = new _jp.Segments[type](params);\n segments.push(s);\n totalLength += s.getLength();\n conn.updateBounds(s);\n },\n _clearSegments = function () {\n totalLength = segments.length = segmentProportions.length = segmentProportionalLengths.length = 0;\n };\n\n this.setSegments = function (_segs) {\n userProvidedSegments = [];\n totalLength = 0;\n for (var i = 0; i < _segs.length; i++) {\n userProvidedSegments.push(_segs[i]);\n totalLength += _segs[i].getLength();\n }\n };\n\n this.getLength = function() {\n return totalLength;\n };\n\n var _prepareCompute = function (params) {\n this.strokeWidth = params.strokeWidth;\n var segment = _jg.quadrant(params.sourcePos, params.targetPos),\n swapX = params.targetPos[0] < params.sourcePos[0],\n swapY = params.targetPos[1] < params.sourcePos[1],\n lw = params.strokeWidth || 1,\n so = params.sourceEndpoint.anchor.getOrientation(params.sourceEndpoint),\n to = params.targetEndpoint.anchor.getOrientation(params.targetEndpoint),\n x = swapX ? params.targetPos[0] : params.sourcePos[0],\n y = swapY ? params.targetPos[1] : params.sourcePos[1],\n w = Math.abs(params.targetPos[0] - params.sourcePos[0]),\n h = Math.abs(params.targetPos[1] - params.sourcePos[1]);\n\n // if either anchor does not have an orientation set, we derive one from their relative\n // positions. we fix the axis to be the one in which the two elements are further apart, and\n // point each anchor at the other element. this is also used when dragging a new connection.\n if (so[0] === 0 && so[1] === 0 || to[0] === 0 && to[1] === 0) {\n var index = w > h ? 0 : 1, oIndex = [1, 0][index];\n so = [];\n to = [];\n so[index] = params.sourcePos[index] > params.targetPos[index] ? -1 : 1;\n to[index] = params.sourcePos[index] > params.targetPos[index] ? 1 : -1;\n so[oIndex] = 0;\n to[oIndex] = 0;\n }\n\n var sx = swapX ? w + (sourceGap * so[0]) : sourceGap * so[0],\n sy = swapY ? h + (sourceGap * so[1]) : sourceGap * so[1],\n tx = swapX ? targetGap * to[0] : w + (targetGap * to[0]),\n ty = swapY ? targetGap * to[1] : h + (targetGap * to[1]),\n oProduct = ((so[0] * to[0]) + (so[1] * to[1]));\n\n var result = {\n sx: sx, sy: sy, tx: tx, ty: ty, lw: lw,\n xSpan: Math.abs(tx - sx),\n ySpan: Math.abs(ty - sy),\n mx: (sx + tx) / 2,\n my: (sy + ty) / 2,\n so: so, to: to, x: x, y: y, w: w, h: h,\n segment: segment,\n startStubX: sx + (so[0] * sourceStub),\n startStubY: sy + (so[1] * sourceStub),\n endStubX: tx + (to[0] * targetStub),\n endStubY: ty + (to[1] * targetStub),\n isXGreaterThanStubTimes2: Math.abs(sx - tx) > (sourceStub + targetStub),\n isYGreaterThanStubTimes2: Math.abs(sy - ty) > (sourceStub + targetStub),\n opposite: oProduct === -1,\n perpendicular: oProduct === 0,\n orthogonal: oProduct === 1,\n sourceAxis: so[0] === 0 ? \"y\" : \"x\",\n points: [x, y, w, h, sx, sy, tx, ty ],\n stubs:[sourceStub, targetStub]\n };\n result.anchorOrientation = result.opposite ? \"opposite\" : result.orthogonal ? \"orthogonal\" : \"perpendicular\";\n return result;\n };\n\n this.getSegments = function () {\n return segments;\n };\n\n this.updateBounds = function (segment) {\n var segBounds = segment.getBounds();\n this.bounds.minX = Math.min(this.bounds.minX, segBounds.minX);\n this.bounds.maxX = Math.max(this.bounds.maxX, segBounds.maxX);\n this.bounds.minY = Math.min(this.bounds.minY, segBounds.minY);\n this.bounds.maxY = Math.max(this.bounds.maxY, segBounds.maxY);\n };\n\n var dumpSegmentsToConsole = function () {\n console.log(\"SEGMENTS:\");\n for (var i = 0; i < segments.length; i++) {\n console.log(segments[i].type, segments[i].getLength(), segmentProportions[i]);\n }\n };\n\n this.pointOnPath = function (location, absolute) {\n var seg = _findSegmentForLocation(location, absolute);\n return seg.segment && seg.segment.pointOnPath(seg.proportion, false) || [0, 0];\n };\n\n this.gradientAtPoint = function (location, absolute) {\n var seg = _findSegmentForLocation(location, absolute);\n return seg.segment && seg.segment.gradientAtPoint(seg.proportion, false) || 0;\n };\n\n this.pointAlongPathFrom = function (location, distance, absolute) {\n var seg = _findSegmentForLocation(location, absolute);\n // TODO what happens if this crosses to the next segment?\n return seg.segment && seg.segment.pointAlongPathFrom(seg.proportion, distance, false) || [0, 0];\n };\n\n this.compute = function (params) {\n paintInfo = _prepareCompute.call(this, params);\n\n _clearSegments();\n this._compute(paintInfo, params);\n this.x = paintInfo.points[0];\n this.y = paintInfo.points[1];\n this.w = paintInfo.points[2];\n this.h = paintInfo.points[3];\n this.segment = paintInfo.segment;\n _updateSegmentProportions();\n };\n\n return {\n addSegment: _addSegment,\n prepareCompute: _prepareCompute,\n sourceStub: sourceStub,\n targetStub: targetStub,\n maxStub: Math.max(sourceStub, targetStub),\n sourceGap: sourceGap,\n targetGap: targetGap,\n maxGap: Math.max(sourceGap, targetGap)\n };\n };\n _ju.extend(_jp.Connectors.AbstractConnector, AbstractComponent);\n\n\n // ********************************* END OF CONNECTOR TYPES *******************************************************************\n\n // ********************************* ENDPOINT TYPES *******************************************************************\n\n _jp.Endpoints.AbstractEndpoint = function (params) {\n AbstractComponent.apply(this, arguments);\n var compute = this.compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n var out = this._compute.apply(this, arguments);\n this.x = out[0];\n this.y = out[1];\n this.w = out[2];\n this.h = out[3];\n this.bounds.minX = this.x;\n this.bounds.minY = this.y;\n this.bounds.maxX = this.x + this.w;\n this.bounds.maxY = this.y + this.h;\n return out;\n };\n return {\n compute: compute,\n cssClass: params.cssClass\n };\n };\n _ju.extend(_jp.Endpoints.AbstractEndpoint, AbstractComponent);\n\n /**\n * Class: Endpoints.Dot\n * A round endpoint, with default radius 10 pixels.\n */\n\n /**\n * Function: Constructor\n *\n * Parameters:\n *\n * radius - radius of the endpoint. defaults to 10 pixels.\n */\n _jp.Endpoints.Dot = function (params) {\n this.type = \"Dot\";\n var _super = _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n params = params || {};\n this.radius = params.radius || 10;\n this.defaultOffset = 0.5 * this.radius;\n this.defaultInnerRadius = this.radius / 3;\n\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n this.radius = endpointStyle.radius || this.radius;\n var x = anchorPoint[0] - this.radius,\n y = anchorPoint[1] - this.radius,\n w = this.radius * 2,\n h = this.radius * 2;\n\n if (endpointStyle.stroke) {\n var lw = endpointStyle.strokeWidth || 1;\n x -= lw;\n y -= lw;\n w += (lw * 2);\n h += (lw * 2);\n }\n return [ x, y, w, h, this.radius ];\n };\n };\n _ju.extend(_jp.Endpoints.Dot, _jp.Endpoints.AbstractEndpoint);\n\n _jp.Endpoints.Rectangle = function (params) {\n this.type = \"Rectangle\";\n var _super = _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n params = params || {};\n this.width = params.width || 20;\n this.height = params.height || 20;\n\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n var width = endpointStyle.width || this.width,\n height = endpointStyle.height || this.height,\n x = anchorPoint[0] - (width / 2),\n y = anchorPoint[1] - (height / 2);\n\n return [ x, y, width, height];\n };\n };\n _ju.extend(_jp.Endpoints.Rectangle, _jp.Endpoints.AbstractEndpoint);\n\n var DOMElementEndpoint = function (params) {\n _jp.jsPlumbUIComponent.apply(this, arguments);\n this._jsPlumb.displayElements = [];\n };\n _ju.extend(DOMElementEndpoint, _jp.jsPlumbUIComponent, {\n getDisplayElements: function () {\n return this._jsPlumb.displayElements;\n },\n appendDisplayElement: function (el) {\n this._jsPlumb.displayElements.push(el);\n }\n });\n\n /**\n * Class: Endpoints.Image\n * Draws an image as the Endpoint.\n */\n /**\n * Function: Constructor\n *\n * Parameters:\n *\n * src - location of the image to use.\n\n TODO: multiple references to self. not sure quite how to get rid of them entirely. perhaps self = null in the cleanup\n function will suffice\n\n TODO this class still might leak memory.\n\n */\n _jp.Endpoints.Image = function (params) {\n\n this.type = \"Image\";\n DOMElementEndpoint.apply(this, arguments);\n _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n\n var _onload = params.onload,\n src = params.src || params.url,\n clazz = params.cssClass ? \" \" + params.cssClass : \"\";\n\n this._jsPlumb.img = new Image();\n this._jsPlumb.ready = false;\n this._jsPlumb.initialized = false;\n this._jsPlumb.deleted = false;\n this._jsPlumb.widthToUse = params.width;\n this._jsPlumb.heightToUse = params.height;\n this._jsPlumb.endpoint = params.endpoint;\n\n this._jsPlumb.img.onload = function () {\n if (this._jsPlumb != null) {\n this._jsPlumb.ready = true;\n this._jsPlumb.widthToUse = this._jsPlumb.widthToUse || this._jsPlumb.img.width;\n this._jsPlumb.heightToUse = this._jsPlumb.heightToUse || this._jsPlumb.img.height;\n if (_onload) {\n _onload(this);\n }\n }\n }.bind(this);\n\n /*\n Function: setImage\n Sets the Image to use in this Endpoint.\n\n Parameters:\n img - may be a URL or an Image object\n onload - optional; a callback to execute once the image has loaded.\n */\n this._jsPlumb.endpoint.setImage = function (_img, onload) {\n var s = _img.constructor === String ? _img : _img.src;\n _onload = onload;\n this._jsPlumb.img.src = s;\n\n if (this.canvas != null) {\n this.canvas.setAttribute(\"src\", this._jsPlumb.img.src);\n }\n }.bind(this);\n\n this._jsPlumb.endpoint.setImage(src, _onload);\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n this.anchorPoint = anchorPoint;\n if (this._jsPlumb.ready) {\n return [anchorPoint[0] - this._jsPlumb.widthToUse / 2, anchorPoint[1] - this._jsPlumb.heightToUse / 2,\n this._jsPlumb.widthToUse, this._jsPlumb.heightToUse];\n }\n else {\n return [0, 0, 0, 0];\n }\n };\n\n this.canvas = _jp.createElement(\"img\", {\n position:\"absolute\",\n margin:0,\n padding:0,\n outline:0\n }, this._jsPlumb.instance.endpointClass + clazz);\n\n if (this._jsPlumb.widthToUse) {\n this.canvas.setAttribute(\"width\", this._jsPlumb.widthToUse);\n }\n if (this._jsPlumb.heightToUse) {\n this.canvas.setAttribute(\"height\", this._jsPlumb.heightToUse);\n }\n this._jsPlumb.instance.appendElement(this.canvas);\n\n this.actuallyPaint = function (d, style, anchor) {\n if (!this._jsPlumb.deleted) {\n if (!this._jsPlumb.initialized) {\n this.canvas.setAttribute(\"src\", this._jsPlumb.img.src);\n this.appendDisplayElement(this.canvas);\n this._jsPlumb.initialized = true;\n }\n var x = this.anchorPoint[0] - (this._jsPlumb.widthToUse / 2),\n y = this.anchorPoint[1] - (this._jsPlumb.heightToUse / 2);\n _ju.sizeElement(this.canvas, x, y, this._jsPlumb.widthToUse, this._jsPlumb.heightToUse);\n }\n };\n\n this.paint = function (style, anchor) {\n if (this._jsPlumb != null) { // may have been deleted\n if (this._jsPlumb.ready) {\n this.actuallyPaint(style, anchor);\n }\n else {\n root.setTimeout(function () {\n this.paint(style, anchor);\n }.bind(this), 200);\n }\n }\n };\n };\n _ju.extend(_jp.Endpoints.Image, [ DOMElementEndpoint, _jp.Endpoints.AbstractEndpoint ], {\n cleanup: function (force) {\n if (force) {\n this._jsPlumb.deleted = true;\n if (this.canvas) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n this.canvas = null;\n }\n }\n });\n\n /*\n * Class: Endpoints.Blank\n * An Endpoint that paints nothing (visible) on the screen. Supports cssClass and hoverClass parameters like all Endpoints.\n */\n _jp.Endpoints.Blank = function (params) {\n var _super = _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n this.type = \"Blank\";\n DOMElementEndpoint.apply(this, arguments);\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n return [anchorPoint[0], anchorPoint[1], 10, 0];\n };\n\n var clazz = params.cssClass ? \" \" + params.cssClass : \"\";\n\n this.canvas = _jp.createElement(\"div\", {\n display: \"block\",\n width: \"1px\",\n height: \"1px\",\n background: \"transparent\",\n position: \"absolute\"\n }, this._jsPlumb.instance.endpointClass + clazz);\n\n this._jsPlumb.instance.appendElement(this.canvas);\n\n this.paint = function (style, anchor) {\n _ju.sizeElement(this.canvas, this.x, this.y, this.w, this.h);\n };\n };\n _ju.extend(_jp.Endpoints.Blank, [_jp.Endpoints.AbstractEndpoint, DOMElementEndpoint], {\n cleanup: function () {\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n }\n });\n\n /*\n * Class: Endpoints.Triangle\n * A triangular Endpoint.\n */\n /*\n * Function: Constructor\n *\n * Parameters:\n *\n * width width of the triangle's base. defaults to 55 pixels.\n * height height of the triangle from base to apex. defaults to 55 pixels.\n */\n _jp.Endpoints.Triangle = function (params) {\n this.type = \"Triangle\";\n _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n var self = this;\n params = params || { };\n params.width = params.width || 55;\n params.height = params.height || 55;\n this.width = params.width;\n this.height = params.height;\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n var width = endpointStyle.width || self.width,\n height = endpointStyle.height || self.height,\n x = anchorPoint[0] - (width / 2),\n y = anchorPoint[1] - (height / 2);\n return [ x, y, width, height ];\n };\n };\n// ********************************* END OF ENDPOINT TYPES *******************************************************************\n\n\n// ********************************* OVERLAY DEFINITIONS *********************************************************************** \n\n var AbstractOverlay = _jp.Overlays.AbstractOverlay = function (params) {\n this.visible = true;\n this.isAppendedAtTopLevel = true;\n this.component = params.component;\n this.loc = params.location == null ? 0.5 : params.location;\n this.endpointLoc = params.endpointLocation == null ? [ 0.5, 0.5] : params.endpointLocation;\n this.visible = params.visible !== false;\n };\n AbstractOverlay.prototype = {\n cleanup: function (force) {\n if (force) {\n this.component = null;\n this.canvas = null;\n this.endpointLoc = null;\n }\n },\n reattach:function(instance, component) { },\n setVisible: function (val) {\n this.visible = val;\n this.component.repaint();\n },\n isVisible: function () {\n return this.visible;\n },\n hide: function () {\n this.setVisible(false);\n },\n show: function () {\n this.setVisible(true);\n },\n incrementLocation: function (amount) {\n this.loc += amount;\n this.component.repaint();\n },\n setLocation: function (l) {\n this.loc = l;\n this.component.repaint();\n },\n getLocation: function () {\n return this.loc;\n },\n updateFrom:function() { }\n };\n\n\n /*\n * Class: Overlays.Arrow\n *\n * An arrow overlay, defined by four points: the head, the two sides of the tail, and a 'foldback' point at some distance along the length\n * of the arrow that lines from each tail point converge into. The foldback point is defined using a decimal that indicates some fraction\n * of the length of the arrow and has a default value of 0.623. A foldback point value of 1 would mean that the arrow had a straight line\n * across the tail.\n */\n /*\n * @constructor\n *\n * @param {Object} params Constructor params.\n * @param {Number} [params.length] Distance in pixels from head to tail baseline. default 20.\n * @param {Number} [params.width] Width in pixels of the tail baseline. default 20.\n * @param {String} [params.fill] Style to use when filling the arrow. defaults to \"black\".\n * @param {String} [params.stroke] Style to use when stroking the arrow. defaults to null, which means the arrow is not stroked.\n * @param {Number} [params.stroke-width] Line width to use when stroking the arrow. defaults to 1, but only used if stroke is not null.\n * @param {Number} [params.foldback] Distance (as a decimal from 0 to 1 inclusive) along the length of the arrow marking the point the tail points should fold back to. defaults to 0.623.\n * @param {Number} [params.location] Distance (as a decimal from 0 to 1 inclusive) marking where the arrow should sit on the connector. defaults to 0.5.\n * @param {NUmber} [params.direction] Indicates the direction the arrow points in. valid values are -1 and 1; 1 is default.\n */\n _jp.Overlays.Arrow = function (params) {\n this.type = \"Arrow\";\n AbstractOverlay.apply(this, arguments);\n this.isAppendedAtTopLevel = false;\n params = params || {};\n var self = this;\n\n this.length = params.length || 20;\n this.width = params.width || 20;\n this.id = params.id;\n var direction = (params.direction || 1) < 0 ? -1 : 1,\n paintStyle = params.paintStyle || { \"stroke-width\": 1 },\n // how far along the arrow the lines folding back in come to. default is 62.3%.\n foldback = params.foldback || 0.623;\n\n this.computeMaxSize = function () {\n return self.width * 1.5;\n };\n\n this.elementCreated = function(p, component) {\n this.path = p;\n if (params.events) {\n for (var i in params.events) {\n _jp.on(p, i, params.events[i]);\n }\n }\n };\n\n this.draw = function (component, currentConnectionPaintStyle) {\n\n var hxy, mid, txy, tail, cxy;\n if (component.pointAlongPathFrom) {\n\n if (_ju.isString(this.loc) || this.loc > 1 || this.loc < 0) {\n var l = parseInt(this.loc, 10),\n fromLoc = this.loc < 0 ? 1 : 0;\n hxy = component.pointAlongPathFrom(fromLoc, l, false);\n mid = component.pointAlongPathFrom(fromLoc, l - (direction * this.length / 2), false);\n txy = _jg.pointOnLine(hxy, mid, this.length);\n }\n else if (this.loc === 1) {\n hxy = component.pointOnPath(this.loc);\n mid = component.pointAlongPathFrom(this.loc, -(this.length));\n txy = _jg.pointOnLine(hxy, mid, this.length);\n\n if (direction === -1) {\n var _ = txy;\n txy = hxy;\n hxy = _;\n }\n }\n else if (this.loc === 0) {\n txy = component.pointOnPath(this.loc);\n mid = component.pointAlongPathFrom(this.loc, this.length);\n hxy = _jg.pointOnLine(txy, mid, this.length);\n if (direction === -1) {\n var __ = txy;\n txy = hxy;\n hxy = __;\n }\n }\n else {\n hxy = component.pointAlongPathFrom(this.loc, direction * this.length / 2);\n mid = component.pointOnPath(this.loc);\n txy = _jg.pointOnLine(hxy, mid, this.length);\n }\n\n tail = _jg.perpendicularLineTo(hxy, txy, this.width);\n cxy = _jg.pointOnLine(hxy, txy, foldback * this.length);\n\n var d = { hxy: hxy, tail: tail, cxy: cxy },\n stroke = paintStyle.stroke || currentConnectionPaintStyle.stroke,\n fill = paintStyle.fill || currentConnectionPaintStyle.stroke,\n lineWidth = paintStyle.strokeWidth || currentConnectionPaintStyle.strokeWidth;\n\n return {\n component: component,\n d: d,\n \"stroke-width\": lineWidth,\n stroke: stroke,\n fill: fill,\n minX: Math.min(hxy.x, tail[0].x, tail[1].x),\n maxX: Math.max(hxy.x, tail[0].x, tail[1].x),\n minY: Math.min(hxy.y, tail[0].y, tail[1].y),\n maxY: Math.max(hxy.y, tail[0].y, tail[1].y)\n };\n }\n else {\n return {component: component, minX: 0, maxX: 0, minY: 0, maxY: 0};\n }\n };\n };\n _ju.extend(_jp.Overlays.Arrow, AbstractOverlay, {\n updateFrom:function(d) {\n this.length = d.length || this.length;\n this.width = d.width|| this.width;\n this.direction = d.direction != null ? d.direction : this.direction;\n this.foldback = d.foldback|| this.foldback;\n },\n cleanup:function() {\n if (this.path && this.canvas) {\n this.canvas.removeChild(this.path);\n }\n }\n });\n\n /*\n * Class: Overlays.PlainArrow\n *\n * A basic arrow. This is in fact just one instance of the more generic case in which the tail folds back on itself to some\n * point along the length of the arrow: in this case, that foldback point is the full length of the arrow. so it just does\n * a 'call' to Arrow with foldback set appropriately.\n */\n /*\n * Function: Constructor\n * See for allowed parameters for this overlay.\n */\n _jp.Overlays.PlainArrow = function (params) {\n params = params || {};\n var p = _jp.extend(params, {foldback: 1});\n _jp.Overlays.Arrow.call(this, p);\n this.type = \"PlainArrow\";\n };\n _ju.extend(_jp.Overlays.PlainArrow, _jp.Overlays.Arrow);\n\n /*\n * Class: Overlays.Diamond\n * \n * A diamond. Like PlainArrow, this is a concrete case of the more generic case of the tail points converging on some point...it just\n * happens that in this case, that point is greater than the length of the the arrow.\n *\n * this could probably do with some help with positioning...due to the way it reuses the Arrow paint code, what Arrow thinks is the\n * center is actually 1/4 of the way along for this guy. but we don't have any knowledge of pixels at this point, so we're kind of\n * stuck when it comes to helping out the Arrow class. possibly we could pass in a 'transpose' parameter or something. the value\n * would be -l/4 in this case - move along one quarter of the total length.\n */\n /*\n * Function: Constructor\n * See for allowed parameters for this overlay.\n */\n _jp.Overlays.Diamond = function (params) {\n params = params || {};\n var l = params.length || 40,\n p = _jp.extend(params, {length: l / 2, foldback: 2});\n _jp.Overlays.Arrow.call(this, p);\n this.type = \"Diamond\";\n };\n _ju.extend(_jp.Overlays.Diamond, _jp.Overlays.Arrow);\n\n var _getDimensions = function (component, forceRefresh) {\n if (component._jsPlumb.cachedDimensions == null || forceRefresh) {\n component._jsPlumb.cachedDimensions = component.getDimensions();\n }\n return component._jsPlumb.cachedDimensions;\n };\n\n // abstract superclass for overlays that add an element to the DOM.\n var AbstractDOMOverlay = function (params) {\n _jp.jsPlumbUIComponent.apply(this, arguments);\n AbstractOverlay.apply(this, arguments);\n\n // hand off fired events to associated component.\n var _f = this.fire;\n this.fire = function () {\n _f.apply(this, arguments);\n if (this.component) {\n this.component.fire.apply(this.component, arguments);\n }\n };\n\n this.detached=false;\n this.id = params.id;\n this._jsPlumb.div = null;\n this._jsPlumb.initialised = false;\n this._jsPlumb.component = params.component;\n this._jsPlumb.cachedDimensions = null;\n this._jsPlumb.create = params.create;\n this._jsPlumb.initiallyInvisible = params.visible === false;\n\n this.getElement = function () {\n if (this._jsPlumb.div == null) {\n var div = this._jsPlumb.div = _jp.getElement(this._jsPlumb.create(this._jsPlumb.component));\n div.style.position = \"absolute\";\n jsPlumb.addClass(div, this._jsPlumb.instance.overlayClass + \" \" +\n (this.cssClass ? this.cssClass :\n params.cssClass ? params.cssClass : \"\"));\n this._jsPlumb.instance.appendElement(div);\n this._jsPlumb.instance.getId(div);\n this.canvas = div;\n\n // in IE the top left corner is what it placed at the desired location. This will not\n // be fixed. IE8 is not going to be supported for much longer.\n var ts = \"translate(-50%, -50%)\";\n div.style.webkitTransform = ts;\n div.style.mozTransform = ts;\n div.style.msTransform = ts;\n div.style.oTransform = ts;\n div.style.transform = ts;\n\n // write the related component into the created element\n div._jsPlumb = this;\n\n if (params.visible === false) {\n div.style.display = \"none\";\n }\n }\n return this._jsPlumb.div;\n };\n\n this.draw = function (component, currentConnectionPaintStyle, absolutePosition) {\n var td = _getDimensions(this);\n if (td != null && td.length === 2) {\n var cxy = { x: 0, y: 0 };\n\n // absolutePosition would have been set by a call to connection.setAbsoluteOverlayPosition.\n if (absolutePosition) {\n cxy = { x: absolutePosition[0], y: absolutePosition[1] };\n }\n else if (component.pointOnPath) {\n var loc = this.loc, absolute = false;\n if (_ju.isString(this.loc) || this.loc < 0 || this.loc > 1) {\n loc = parseInt(this.loc, 10);\n absolute = true;\n }\n cxy = component.pointOnPath(loc, absolute); // a connection\n }\n else {\n var locToUse = this.loc.constructor === Array ? this.loc : this.endpointLoc;\n cxy = { x: locToUse[0] * component.w,\n y: locToUse[1] * component.h };\n }\n\n var minx = cxy.x - (td[0] / 2),\n miny = cxy.y - (td[1] / 2);\n\n return {\n component: component,\n d: { minx: minx, miny: miny, td: td, cxy: cxy },\n minX: minx,\n maxX: minx + td[0],\n minY: miny,\n maxY: miny + td[1]\n };\n }\n else {\n return {minX: 0, maxX: 0, minY: 0, maxY: 0};\n }\n };\n };\n _ju.extend(AbstractDOMOverlay, [_jp.jsPlumbUIComponent, AbstractOverlay], {\n getDimensions: function () {\n return [1,1];\n },\n setVisible: function (state) {\n if (this._jsPlumb.div) {\n this._jsPlumb.div.style.display = state ? \"block\" : \"none\";\n // if initially invisible, dimensions are 0,0 and never get updated\n if (state && this._jsPlumb.initiallyInvisible) {\n _getDimensions(this, true);\n this.component.repaint();\n this._jsPlumb.initiallyInvisible = false;\n }\n }\n },\n /*\n * Function: clearCachedDimensions\n * Clears the cached dimensions for the label. As a performance enhancement, label dimensions are\n * cached from 1.3.12 onwards. The cache is cleared when you change the label text, of course, but\n * there are other reasons why the text dimensions might change - if you make a change through CSS, for\n * example, you might change the font size. in that case you should explicitly call this method.\n */\n clearCachedDimensions: function () {\n this._jsPlumb.cachedDimensions = null;\n },\n cleanup: function (force) {\n if (force) {\n if (this._jsPlumb.div != null) {\n this._jsPlumb.div._jsPlumb = null;\n this._jsPlumb.instance.removeElement(this._jsPlumb.div);\n }\n }\n else {\n // if not a forced cleanup, just detach child from parent for now.\n if (this._jsPlumb && this._jsPlumb.div && this._jsPlumb.div.parentNode) {\n this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div);\n }\n this.detached = true;\n }\n\n },\n reattach:function(instance, component) {\n if (this._jsPlumb.div != null) {\n instance.getContainer().appendChild(this._jsPlumb.div);\n }\n this.detached = false;\n },\n computeMaxSize: function () {\n var td = _getDimensions(this);\n return Math.max(td[0], td[1]);\n },\n paint: function (p, containerExtents) {\n if (!this._jsPlumb.initialised) {\n this.getElement();\n p.component.appendDisplayElement(this._jsPlumb.div);\n this._jsPlumb.initialised = true;\n if (this.detached) {\n this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div);\n }\n }\n this._jsPlumb.div.style.left = (p.component.x + p.d.minx) + \"px\";\n this._jsPlumb.div.style.top = (p.component.y + p.d.miny) + \"px\";\n }\n });\n\n /*\n * Class: Overlays.Custom\n * A Custom overlay. You supply a 'create' function which returns some DOM element, and jsPlumb positions it.\n * The 'create' function is passed a Connection or Endpoint.\n */\n /*\n * Function: Constructor\n * \n * Parameters:\n * create - function for jsPlumb to call that returns a DOM element.\n * location - distance (as a decimal from 0 to 1 inclusive) marking where the label should sit on the connector. defaults to 0.5.\n * id - optional id to use for later retrieval of this overlay.\n *\n */\n _jp.Overlays.Custom = function (params) {\n this.type = \"Custom\";\n AbstractDOMOverlay.apply(this, arguments);\n };\n _ju.extend(_jp.Overlays.Custom, AbstractDOMOverlay);\n\n _jp.Overlays.GuideLines = function () {\n var self = this;\n self.length = 50;\n self.strokeWidth = 5;\n this.type = \"GuideLines\";\n AbstractOverlay.apply(this, arguments);\n _jp.jsPlumbUIComponent.apply(this, arguments);\n this.draw = function (connector, currentConnectionPaintStyle) {\n\n var head = connector.pointAlongPathFrom(self.loc, self.length / 2),\n mid = connector.pointOnPath(self.loc),\n tail = _jg.pointOnLine(head, mid, self.length),\n tailLine = _jg.perpendicularLineTo(head, tail, 40),\n headLine = _jg.perpendicularLineTo(tail, head, 20);\n\n return {\n connector: connector,\n head: head,\n tail: tail,\n headLine: headLine,\n tailLine: tailLine,\n minX: Math.min(head.x, tail.x, headLine[0].x, headLine[1].x),\n minY: Math.min(head.y, tail.y, headLine[0].y, headLine[1].y),\n maxX: Math.max(head.x, tail.x, headLine[0].x, headLine[1].x),\n maxY: Math.max(head.y, tail.y, headLine[0].y, headLine[1].y)\n };\n };\n\n // this.cleanup = function() { }; // nothing to clean up for GuideLines\n };\n\n /*\n * Class: Overlays.Label\n\n */\n /*\n * Function: Constructor\n * \n * Parameters:\n * cssClass - optional css class string to append to css class. This string is appended \"as-is\", so you can of course have multiple classes\n * defined. This parameter is preferred to using labelStyle, borderWidth and borderStyle.\n * label - the label to paint. May be a string or a function that returns a string. Nothing will be painted if your label is null or your\n * label function returns null. empty strings _will_ be painted.\n * location - distance (as a decimal from 0 to 1 inclusive) marking where the label should sit on the connector. defaults to 0.5.\n * id - optional id to use for later retrieval of this overlay.\n * \n *\n */\n _jp.Overlays.Label = function (params) {\n this.labelStyle = params.labelStyle;\n\n var labelWidth = null, labelHeight = null, labelText = null, labelPadding = null;\n this.cssClass = this.labelStyle != null ? this.labelStyle.cssClass : null;\n var p = _jp.extend({\n create: function () {\n return _jp.createElement(\"div\");\n }}, params);\n _jp.Overlays.Custom.call(this, p);\n this.type = \"Label\";\n this.label = params.label || \"\";\n this.labelText = null;\n if (this.labelStyle) {\n var el = this.getElement();\n this.labelStyle.font = this.labelStyle.font || \"12px sans-serif\";\n el.style.font = this.labelStyle.font;\n el.style.color = this.labelStyle.color || \"black\";\n if (this.labelStyle.fill) {\n el.style.background = this.labelStyle.fill;\n }\n if (this.labelStyle.borderWidth > 0) {\n var dStyle = this.labelStyle.borderStyle ? this.labelStyle.borderStyle : \"black\";\n el.style.border = this.labelStyle.borderWidth + \"px solid \" + dStyle;\n }\n if (this.labelStyle.padding) {\n el.style.padding = this.labelStyle.padding;\n }\n }\n\n };\n _ju.extend(_jp.Overlays.Label, _jp.Overlays.Custom, {\n cleanup: function (force) {\n if (force) {\n this.div = null;\n this.label = null;\n this.labelText = null;\n this.cssClass = null;\n this.labelStyle = null;\n }\n },\n getLabel: function () {\n return this.label;\n },\n /*\n * Function: setLabel\n * sets the label's, um, label. you would think i'd call this function\n * 'setText', but you can pass either a Function or a String to this, so\n * it makes more sense as 'setLabel'. This uses innerHTML on the label div, so keep\n * that in mind if you need escaped HTML.\n */\n setLabel: function (l) {\n this.label = l;\n this.labelText = null;\n this.clearCachedDimensions();\n this.update();\n this.component.repaint();\n },\n getDimensions: function () {\n this.update();\n return AbstractDOMOverlay.prototype.getDimensions.apply(this, arguments);\n },\n update: function () {\n if (typeof this.label === \"function\") {\n var lt = this.label(this);\n this.getElement().innerHTML = lt.replace(/\\r\\n/g, \"
\");\n }\n else {\n if (this.labelText == null) {\n this.labelText = this.label;\n this.getElement().innerHTML = this.labelText.replace(/\\r\\n/g, \"
\");\n }\n }\n },\n updateFrom:function(d) {\n if(d.label != null){\n this.setLabel(d.label);\n }\n }\n });\n\n // ********************************* END OF OVERLAY DEFINITIONS ***********************************************************************\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function() {\n \"use strict\";\n\n var root = this,\n _ju = root.jsPlumbUtil,\n _jpi = root.jsPlumbInstance;\n\n var GROUP_COLLAPSED_CLASS = \"jtk-group-collapsed\";\n var GROUP_EXPANDED_CLASS = \"jtk-group-expanded\";\n var GROUP_CONTAINER_SELECTOR = \"[jtk-group-content]\";\n var ELEMENT_DRAGGABLE_EVENT = \"elementDraggable\";\n var STOP = \"stop\";\n var REVERT = \"revert\";\n var GROUP_MANAGER = \"_groupManager\";\n var GROUP = \"_jsPlumbGroup\";\n var GROUP_DRAG_SCOPE = \"_jsPlumbGroupDrag\";\n var EVT_CHILD_ADDED = \"group:addMember\";\n var EVT_CHILD_REMOVED = \"group:removeMember\";\n var EVT_GROUP_ADDED = \"group:add\";\n var EVT_GROUP_REMOVED = \"group:remove\";\n var EVT_EXPAND = \"group:expand\";\n var EVT_COLLAPSE = \"group:collapse\";\n var EVT_GROUP_DRAG_STOP = \"groupDragStop\";\n var EVT_CONNECTION_MOVED = \"connectionMoved\";\n var EVT_INTERNAL_CONNECTION_DETACHED = \"internal.connectionDetached\";\n\n var CMD_REMOVE_ALL = \"removeAll\";\n var CMD_ORPHAN_ALL = \"orphanAll\";\n var CMD_SHOW = \"show\";\n var CMD_HIDE = \"hide\";\n\n var GroupManager = function(_jsPlumb) {\n var _managedGroups = {}, _connectionSourceMap = {}, _connectionTargetMap = {}, self = this;\n\n _jsPlumb.bind(\"connection\", function(p) {\n if (p.source[GROUP] != null && p.target[GROUP] != null && p.source[GROUP] === p.target[GROUP]) {\n _connectionSourceMap[p.connection.id] = p.source[GROUP];\n _connectionTargetMap[p.connection.id] = p.source[GROUP];\n }\n else {\n if (p.source[GROUP] != null) {\n _ju.suggest(p.source[GROUP].connections.source, p.connection);\n _connectionSourceMap[p.connection.id] = p.source[GROUP];\n }\n if (p.target[GROUP] != null) {\n _ju.suggest(p.target[GROUP].connections.target, p.connection);\n _connectionTargetMap[p.connection.id] = p.target[GROUP];\n }\n }\n });\n\n function _cleanupDetachedConnection(conn) {\n delete conn.proxies;\n var group = _connectionSourceMap[conn.id], f;\n if (group != null) {\n f = function(c) { return c.id === conn.id; };\n _ju.removeWithFunction(group.connections.source, f);\n _ju.removeWithFunction(group.connections.target, f);\n delete _connectionSourceMap[conn.id];\n }\n\n group = _connectionTargetMap[conn.id];\n if (group != null) {\n f = function(c) { return c.id === conn.id; };\n _ju.removeWithFunction(group.connections.source, f);\n _ju.removeWithFunction(group.connections.target, f);\n delete _connectionTargetMap[conn.id];\n }\n }\n\n _jsPlumb.bind(EVT_INTERNAL_CONNECTION_DETACHED, function(p) {\n _cleanupDetachedConnection(p.connection);\n });\n\n _jsPlumb.bind(EVT_CONNECTION_MOVED, function(p) {\n var connMap = p.index === 0 ? _connectionSourceMap : _connectionTargetMap;\n var group = connMap[p.connection.id];\n if (group) {\n var list = group.connections[p.index === 0 ? \"source\" : \"target\"];\n var idx = list.indexOf(p.connection);\n if (idx !== -1) {\n list.splice(idx, 1);\n }\n }\n });\n\n this.addGroup = function(group) {\n _jsPlumb.addClass(group.getEl(), GROUP_EXPANDED_CLASS);\n _managedGroups[group.id] = group;\n group.manager = this;\n _updateConnectionsForGroup(group);\n _jsPlumb.fire(EVT_GROUP_ADDED, { group:group });\n };\n\n this.addToGroup = function(group, el, doNotFireEvent) {\n group = this.getGroup(group);\n if (group) {\n var groupEl = group.getEl();\n\n if (el._isJsPlumbGroup) {\n return;\n }\n var currentGroup = el._jsPlumbGroup;\n // if already a member of this group, do nothing\n if (currentGroup !== group) {\n var elpos = _jsPlumb.getOffset(el, true);\n var cpos = group.collapsed ? _jsPlumb.getOffset(groupEl, true) : _jsPlumb.getOffset(group.getDragArea(), true);\n\n // otherwise, transfer to this group.\n if (currentGroup != null) {\n currentGroup.remove(el, false, doNotFireEvent, false, group);\n self.updateConnectionsForGroup(currentGroup);\n }\n group.add(el, doNotFireEvent/*, currentGroup*/);\n\n var handleDroppedConnections = function (list, index) {\n var oidx = index === 0 ? 1 : 0;\n list.each(function (c) {\n c.setVisible(false);\n if (c.endpoints[oidx].element._jsPlumbGroup === group) {\n c.endpoints[oidx].setVisible(false);\n self.expandConnection(c, oidx, group);\n }\n else {\n c.endpoints[index].setVisible(false);\n self.collapseConnection(c, index, group);\n }\n });\n };\n\n if (group.collapsed) {\n handleDroppedConnections(_jsPlumb.select({source: el}), 0);\n handleDroppedConnections(_jsPlumb.select({target: el}), 1);\n }\n\n var elId = _jsPlumb.getId(el);\n _jsPlumb.dragManager.setParent(el, elId, groupEl, _jsPlumb.getId(groupEl), elpos);\n\n var newPosition = { left: elpos.left - cpos.left, top: elpos.top - cpos.top };\n\n _jsPlumb.setPosition(el, newPosition);\n\n _jsPlumb.dragManager.revalidateParent(el, elId, elpos);\n\n self.updateConnectionsForGroup(group);\n\n _jsPlumb.revalidate(elId);\n\n if (!doNotFireEvent) {\n var p = {group: group, el: el};\n if (currentGroup) {\n p.sourceGroup = currentGroup;\n }\n _jsPlumb.fire(EVT_CHILD_ADDED, p);\n }\n }\n }\n };\n\n this.removeFromGroup = function(group, el, doNotFireEvent) {\n group = this.getGroup(group);\n if (group) {\n group.remove(el, null, doNotFireEvent);\n }\n };\n\n this.getGroup = function(groupId) {\n var group = groupId;\n if (_ju.isString(groupId)) {\n group = _managedGroups[groupId];\n if (group == null) {\n throw new TypeError(\"No such group [\" + groupId + \"]\");\n }\n }\n return group;\n };\n\n this.getGroups = function() {\n var o = [];\n for (var g in _managedGroups) {\n o.push(_managedGroups[g]);\n }\n return o;\n };\n\n this.removeGroup = function(group, deleteMembers, manipulateDOM, doNotFireEvent) {\n group = this.getGroup(group);\n this.expandGroup(group, true); // this reinstates any original connections and removes all proxies, but does not fire an event.\n var newPositions = group[deleteMembers ? CMD_REMOVE_ALL : CMD_ORPHAN_ALL](manipulateDOM, doNotFireEvent);\n _jsPlumb.remove(group.getEl());\n delete _managedGroups[group.id];\n delete _jsPlumb._groups[group.id];\n _jsPlumb.fire(EVT_GROUP_REMOVED, { group:group });\n return newPositions; // this will be null in the case or remove, but be a map of {id->[x,y]} in the case of orphan\n };\n\n this.removeAllGroups = function(deleteMembers, manipulateDOM, doNotFireEvent) {\n for (var g in _managedGroups) {\n this.removeGroup(_managedGroups[g], deleteMembers, manipulateDOM, doNotFireEvent);\n }\n };\n\n function _setVisible(group, state) {\n var m = group.getMembers();\n for (var i = 0; i < m.length; i++) {\n _jsPlumb[state ? CMD_SHOW : CMD_HIDE](m[i], true);\n }\n }\n\n var _collapseConnection = this.collapseConnection = function(c, index, group) {\n\n var proxyEp, groupEl = group.getEl(), groupElId = _jsPlumb.getId(groupEl),\n originalElementId = c.endpoints[index].elementId;\n\n var otherEl = c.endpoints[index === 0 ? 1 : 0].element;\n if (otherEl[GROUP] && (!otherEl[GROUP].shouldProxy() && otherEl[GROUP].collapsed)) {\n return;\n }\n\n c.proxies = c.proxies || [];\n if(c.proxies[index]) {\n proxyEp = c.proxies[index].ep;\n }else {\n proxyEp = _jsPlumb.addEndpoint(groupEl, {\n endpoint:group.getEndpoint(c, index),\n anchor:group.getAnchor(c, index),\n parameters:{\n isProxyEndpoint:true\n }\n });\n }\n proxyEp.setDeleteOnEmpty(true);\n\n // for this index, stash proxy info: the new EP, the original EP.\n c.proxies[index] = { ep:proxyEp, originalEp: c.endpoints[index] };\n\n // and advise the anchor manager\n if (index === 0) {\n // TODO why are there two differently named methods? Why is there not one method that says \"some end of this\n // connection changed (you give the index), and here's the new element and element id.\"\n _jsPlumb.anchorManager.sourceChanged(originalElementId, groupElId, c, groupEl);\n }\n else {\n _jsPlumb.anchorManager.updateOtherEndpoint(c.endpoints[0].elementId, originalElementId, groupElId, c);\n c.target = groupEl;\n c.targetId = groupElId;\n }\n\n\n // detach the original EP from the connection.\n c.proxies[index].originalEp.detachFromConnection(c, null, true);\n\n // set the proxy as the new ep\n proxyEp.connections = [ c ];\n c.endpoints[index] = proxyEp;\n\n c.setVisible(true);\n };\n\n this.collapseGroup = function(group) {\n group = this.getGroup(group);\n if (group == null || group.collapsed) {\n return;\n }\n var groupEl = group.getEl();\n\n // todo remove old proxy endpoints first, just in case?\n //group.proxies.length = 0;\n\n // hide all connections\n _setVisible(group, false);\n\n if (group.shouldProxy()) {\n // collapses all connections in a group.\n var _collapseSet = function (conns, index) {\n for (var i = 0; i < conns.length; i++) {\n var c = conns[i];\n _collapseConnection(c, index, group);\n }\n };\n\n // setup proxies for sources and targets\n _collapseSet(group.connections.source, 0);\n _collapseSet(group.connections.target, 1);\n }\n\n group.collapsed = true;\n _jsPlumb.removeClass(groupEl, GROUP_EXPANDED_CLASS);\n _jsPlumb.addClass(groupEl, GROUP_COLLAPSED_CLASS);\n _jsPlumb.revalidate(groupEl);\n _jsPlumb.fire(EVT_COLLAPSE, { group:group });\n };\n\n var _expandConnection = this.expandConnection = function(c, index, group) {\n\n // if no proxies or none for this end of the connection, abort.\n if (c.proxies == null || c.proxies[index] == null) {\n return;\n }\n\n var groupElId = _jsPlumb.getId(group.getEl()),\n originalElement = c.proxies[index].originalEp.element,\n originalElementId = c.proxies[index].originalEp.elementId;\n\n c.endpoints[index] = c.proxies[index].originalEp;\n // and advise the anchor manager\n if (index === 0) {\n // TODO why are there two differently named methods? Why is there not one method that says \"some end of this\n // connection changed (you give the index), and here's the new element and element id.\"\n _jsPlumb.anchorManager.sourceChanged(groupElId, originalElementId, c, originalElement);\n }\n else {\n _jsPlumb.anchorManager.updateOtherEndpoint(c.endpoints[0].elementId, groupElId, originalElementId, c);\n c.target = originalElement;\n c.targetId = originalElementId;\n }\n\n // detach the proxy EP from the connection (which will cause it to be removed as we no longer need it)\n c.proxies[index].ep.detachFromConnection(c, null);\n\n c.proxies[index].originalEp.addConnection(c);\n\n // cleanup\n delete c.proxies[index];\n };\n\n this.expandGroup = function(group, doNotFireEvent) {\n\n group = this.getGroup(group);\n\n if (group == null || !group.collapsed) {\n return;\n }\n var groupEl = group.getEl();\n\n _setVisible(group, true);\n\n if (group.shouldProxy()) {\n // collapses all connections in a group.\n var _expandSet = function (conns, index) {\n for (var i = 0; i < conns.length; i++) {\n var c = conns[i];\n _expandConnection(c, index, group);\n }\n };\n\n // setup proxies for sources and targets\n _expandSet(group.connections.source, 0);\n _expandSet(group.connections.target, 1);\n }\n\n group.collapsed = false;\n _jsPlumb.addClass(groupEl, GROUP_EXPANDED_CLASS);\n _jsPlumb.removeClass(groupEl, GROUP_COLLAPSED_CLASS);\n _jsPlumb.revalidate(groupEl);\n this.repaintGroup(group);\n if (!doNotFireEvent) {\n _jsPlumb.fire(EVT_EXPAND, { group: group});\n }\n };\n\n this.repaintGroup = function(group) {\n group = this.getGroup(group);\n var m = group.getMembers();\n for (var i = 0; i < m.length; i++) {\n _jsPlumb.revalidate(m[i]);\n }\n };\n\n // TODO refactor this with the code that responds to `connection` events.\n function _updateConnectionsForGroup(group) {\n var members = group.getMembers();\n var c1 = _jsPlumb.getConnections({source:members, scope:\"*\"}, true);\n var c2 = _jsPlumb.getConnections({target:members, scope:\"*\"}, true);\n var processed = {};\n group.connections.source.length = 0;\n group.connections.target.length = 0;\n var oneSet = function(c) {\n for (var i = 0; i < c.length; i++) {\n if (processed[c[i].id]) {\n continue;\n }\n processed[c[i].id] = true;\n if (c[i].source._jsPlumbGroup === group) {\n if (c[i].target._jsPlumbGroup !== group) {\n group.connections.source.push(c[i]);\n }\n _connectionSourceMap[c[i].id] = group;\n }\n else if (c[i].target._jsPlumbGroup === group) {\n group.connections.target.push(c[i]);\n _connectionTargetMap[c[i].id] = group;\n }\n }\n };\n oneSet(c1); oneSet(c2);\n }\n\n this.updateConnectionsForGroup = _updateConnectionsForGroup;\n this.refreshAllGroups = function() {\n for (var g in _managedGroups) {\n _updateConnectionsForGroup(_managedGroups[g]);\n _jsPlumb.dragManager.updateOffsets(_jsPlumb.getId(_managedGroups[g].getEl()));\n }\n };\n };\n\n /**\n *\n * @param {jsPlumbInstance} _jsPlumb Associated jsPlumb instance.\n * @param {Object} params\n * @param {Element} params.el The DOM element representing the Group.\n * @param {String} [params.id] Optional ID for the Group. A UUID will be assigned as the Group's ID if you do not provide one.\n * @param {Boolean} [params.constrain=false] If true, child elements will not be able to be dragged outside of the Group container.\n * @param {Boolean} [params.revert=true] By default, child elements revert to the container if dragged outside. You can change this by setting `revert:false`. This behaviour is also overridden if you set `orphan` or `prune`.\n * @param {Boolean} [params.orphan=false] If true, child elements dropped outside of the Group container will be removed from the Group (but not from the DOM).\n * @param {Boolean} [params.prune=false] If true, child elements dropped outside of the Group container will be removed from the Group and also from the DOM.\n * @param {Boolean} [params.dropOverride=false] If true, a child element that has been dropped onto some other Group will not be subject to the controls imposed by `prune`, `revert` or `orphan`.\n * @constructor\n */\n var Group = function(_jsPlumb, params) {\n var self = this;\n var el = params.el;\n this.getEl = function() { return el; };\n this.id = params.id || _ju.uuid();\n el._isJsPlumbGroup = true;\n\n var getDragArea = this.getDragArea = function() {\n var da = _jsPlumb.getSelector(el, GROUP_CONTAINER_SELECTOR);\n return da && da.length > 0 ? da[0] : el;\n };\n\n var ghost = params.ghost === true;\n var constrain = ghost || (params.constrain === true);\n var revert = params.revert !== false;\n var orphan = params.orphan === true;\n var prune = params.prune === true;\n var dropOverride = params.dropOverride === true;\n var proxied = params.proxied !== false;\n var elements = [];\n this.connections = { source:[], target:[], internal:[] };\n\n // this function, and getEndpoint below, are stubs for a future setup in which we can choose endpoint\n // and anchor based upon the connection and the index (source/target) of the endpoint to be proxied.\n this.getAnchor = function(conn, endpointIndex) {\n return params.anchor || \"Continuous\";\n };\n\n this.getEndpoint = function(conn, endpointIndex) {\n return params.endpoint || [ \"Dot\", { radius:10 }];\n };\n\n this.collapsed = false;\n if (params.draggable !== false) {\n var opts = {\n stop:function(params) {\n _jsPlumb.fire(EVT_GROUP_DRAG_STOP, jsPlumb.extend(params, {group:self}));\n },\n scope:GROUP_DRAG_SCOPE\n };\n if (params.dragOptions) {\n root.jsPlumb.extend(opts, params.dragOptions);\n }\n _jsPlumb.draggable(params.el, opts);\n }\n if (params.droppable !== false) {\n _jsPlumb.droppable(params.el, {\n drop:function(p) {\n var el = p.drag.el;\n if (el._isJsPlumbGroup) {\n return;\n }\n var currentGroup = el._jsPlumbGroup;\n if (currentGroup !== self) {\n if (currentGroup != null) {\n if (currentGroup.overrideDrop(el, self)) {\n return;\n }\n }\n _jsPlumb.getGroupManager().addToGroup(self, el, false);\n }\n\n }\n });\n }\n var _each = function(_el, fn) {\n var els = _el.nodeType == null ? _el : [ _el ];\n for (var i = 0; i < els.length; i++) {\n fn(els[i]);\n }\n };\n\n this.overrideDrop = function(_el, targetGroup) {\n return dropOverride && (revert || prune || orphan);\n };\n\n this.add = function(_el, doNotFireEvent/*, sourceGroup*/) {\n var dragArea = getDragArea();\n _each(_el, function(__el) {\n\n if (__el._jsPlumbGroup != null) {\n if (__el._jsPlumbGroup === self) {\n return;\n } else {\n __el._jsPlumbGroup.remove(__el, true, doNotFireEvent, false);\n }\n }\n\n __el._jsPlumbGroup = self;\n elements.push(__el);\n // test if draggable and add handlers if so.\n if (_jsPlumb.isAlreadyDraggable(__el)) {\n _bindDragHandlers(__el);\n }\n\n if (__el.parentNode !== dragArea) {\n dragArea.appendChild(__el);\n }\n\n // if (!doNotFireEvent) {\n // var p = {group: self, el: __el};\n // if (sourceGroup) {\n // p.sourceGroup = sourceGroup;\n // }\n // //_jsPlumb.fire(EVT_CHILD_ADDED, p);\n // }\n });\n\n _jsPlumb.getGroupManager().updateConnectionsForGroup(self);\n };\n\n this.remove = function(el, manipulateDOM, doNotFireEvent, doNotUpdateConnections, targetGroup) {\n\n _each(el, function(__el) {\n delete __el._jsPlumbGroup;\n _ju.removeWithFunction(elements, function(e) {\n return e === __el;\n });\n\n if (manipulateDOM) {\n try { self.getDragArea().removeChild(__el); }\n catch (e) {\n jsPlumbUtil.log(\"Could not remove element from Group \" + e);\n }\n }\n _unbindDragHandlers(__el);\n if (!doNotFireEvent) {\n var p = {group: self, el: __el};\n if (targetGroup) {\n p.targetGroup = targetGroup;\n }\n _jsPlumb.fire(EVT_CHILD_REMOVED, p);\n }\n });\n if (!doNotUpdateConnections) {\n _jsPlumb.getGroupManager().updateConnectionsForGroup(self);\n }\n };\n this.removeAll = function(manipulateDOM, doNotFireEvent) {\n for (var i = 0, l = elements.length; i < l; i++) {\n var el = elements[0];\n self.remove(el, manipulateDOM, doNotFireEvent, true);\n _jsPlumb.remove(el, true);\n }\n elements.length = 0;\n _jsPlumb.getGroupManager().updateConnectionsForGroup(self);\n };\n this.orphanAll = function() {\n var orphanedPositions = {};\n for (var i = 0; i < elements.length; i++) {\n var newPosition = _orphan(elements[i]);\n orphanedPositions[newPosition[0]] = newPosition[1];\n }\n elements.length = 0;\n\n return orphanedPositions;\n };\n this.getMembers = function() { return elements; };\n\n el[GROUP] = this;\n\n _jsPlumb.bind(ELEMENT_DRAGGABLE_EVENT, function(dragParams) {\n // if its for the current group,\n if (dragParams.el._jsPlumbGroup === this) {\n _bindDragHandlers(dragParams.el);\n }\n }.bind(this));\n\n function _findParent(_el) {\n return _el.offsetParent;\n }\n\n function _isInsideParent(_el, pos) {\n var p = _findParent(_el),\n s = _jsPlumb.getSize(p),\n ss = _jsPlumb.getSize(_el),\n leftEdge = pos[0],\n rightEdge = leftEdge + ss[0],\n topEdge = pos[1],\n bottomEdge = topEdge + ss[1];\n\n return rightEdge > 0 && leftEdge < s[0] && bottomEdge > 0 && topEdge < s[1];\n }\n\n //\n // orphaning an element means taking it out of the group and adding it to the main jsplumb container.\n // we return the new calculated position from this method and the element's id.\n //\n function _orphan(_el) {\n var id = _jsPlumb.getId(_el);\n var pos = _jsPlumb.getOffset(_el);\n _el.parentNode.removeChild(_el);\n _jsPlumb.getContainer().appendChild(_el);\n _jsPlumb.setPosition(_el, pos);\n delete _el._jsPlumbGroup;\n _unbindDragHandlers(_el);\n _jsPlumb.dragManager.clearParent(_el, id);\n return [id, pos];\n }\n\n //\n // remove an element from the group, then either prune it from the jsplumb instance, or just orphan it.\n //\n function _pruneOrOrphan(p) {\n var orphanedPosition = null;\n if (!_isInsideParent(p.el, p.pos)) {\n var group = p.el._jsPlumbGroup;\n if (prune) {\n _jsPlumb.remove(p.el);\n } else {\n orphanedPosition = _orphan(p.el);\n }\n\n group.remove(p.el);\n }\n\n return orphanedPosition;\n }\n\n //\n // redraws the element\n //\n function _revalidate(_el) {\n var id = _jsPlumb.getId(_el);\n _jsPlumb.revalidate(_el);\n _jsPlumb.dragManager.revalidateParent(_el, id);\n }\n\n //\n // unbind the group specific drag/revert handlers.\n //\n function _unbindDragHandlers(_el) {\n if (!_el._katavorioDrag) {\n return;\n }\n if (prune || orphan) {\n _el._katavorioDrag.off(STOP, _pruneOrOrphan);\n }\n if (!prune && !orphan && revert) {\n _el._katavorioDrag.off(REVERT, _revalidate);\n _el._katavorioDrag.setRevert(null);\n }\n }\n\n function _bindDragHandlers(_el) {\n if (!_el._katavorioDrag) {\n return;\n }\n if (prune || orphan) {\n _el._katavorioDrag.on(STOP, _pruneOrOrphan);\n }\n\n if (constrain) {\n _el._katavorioDrag.setConstrain(true);\n }\n\n if (ghost) {\n _el._katavorioDrag.setUseGhostProxy(true);\n }\n\n if (!prune && !orphan && revert) {\n _el._katavorioDrag.on(REVERT, _revalidate);\n _el._katavorioDrag.setRevert(function(__el, pos) {\n return !_isInsideParent(__el, pos);\n });\n }\n }\n\n this.shouldProxy = function() {\n return proxied;\n };\n\n _jsPlumb.getGroupManager().addGroup(this);\n };\n\n /**\n * Adds a group to the jsPlumb instance.\n * @method addGroup\n * @param {Object} params\n * @return {Group} The newly created Group.\n */\n _jpi.prototype.addGroup = function(params) {\n var j = this;\n j._groups = j._groups || {};\n if (j._groups[params.id] != null) {\n throw new TypeError(\"cannot create Group [\" + params.id + \"]; a Group with that ID exists\");\n }\n if (params.el[GROUP] != null) {\n throw new TypeError(\"cannot create Group [\" + params.id + \"]; the given element is already a Group\");\n }\n var group = new Group(j, params);\n j._groups[group.id] = group;\n if (params.collapsed) {\n this.collapseGroup(group);\n }\n return group;\n };\n\n /**\n * Add an element to a group.\n * @method addToGroup\n * @param {String} group Group, or ID of the group, to add the element to.\n * @param {Element} el Element to add to the group.\n */\n _jpi.prototype.addToGroup = function(group, el, doNotFireEvent) {\n\n var _one = function(_el) {\n var id = this.getId(_el);\n this.manage(id, _el);\n this.getGroupManager().addToGroup(group, _el, doNotFireEvent);\n }.bind(this);\n\n if (Array.isArray(el)) {\n for (var i = 0; i < el.length; i++) {\n _one(el[i]);\n }\n } else {\n _one(el);\n }\n };\n\n /**\n * Remove an element from a group.\n * @method removeFromGroup\n * @param {String} group Group, or ID of the group, to remove the element from.\n * @param {Element} el Element to add to the group.\n */\n _jpi.prototype.removeFromGroup = function(group, el, doNotFireEvent) {\n this.getGroupManager().removeFromGroup(group, el, doNotFireEvent);\n };\n\n /**\n * Remove a group, and optionally remove its members from the jsPlumb instance.\n * @method removeGroup\n * @param {String|Group} group Group to delete, or ID of Group to delete.\n * @param {Boolean} [deleteMembers=false] If true, group members will be removed along with the group. Otherwise they will\n * just be 'orphaned' (returned to the main container).\n * @returns {Map[String, Position}} When deleteMembers is false, this method returns a map of {id->position}\n */\n _jpi.prototype.removeGroup = function(group, deleteMembers, manipulateDOM, doNotFireEvent) {\n return this.getGroupManager().removeGroup(group, deleteMembers, manipulateDOM, doNotFireEvent);\n };\n\n /**\n * Remove all groups, and optionally remove their members from the jsPlumb instance.\n * @method removeAllGroup\n * @param {Boolean} [deleteMembers=false] If true, group members will be removed along with the groups. Otherwise they will\n * just be 'orphaned' (returned to the main container).\n */\n _jpi.prototype.removeAllGroups = function(deleteMembers, manipulateDOM, doNotFireEvent) {\n this.getGroupManager().removeAllGroups(deleteMembers, manipulateDOM, doNotFireEvent);\n };\n\n /**\n * Get a Group\n * @method getGroup\n * @param {String} groupId ID of the group to get\n * @return {Group} Group with the given ID, null if not found.\n */\n _jpi.prototype.getGroup = function(groupId) {\n return this.getGroupManager().getGroup(groupId);\n };\n\n /**\n * Gets all the Groups managed by the jsPlumb instance.\n * @returns {Group[]} List of Groups. Empty if none.\n */\n _jpi.prototype.getGroups = function() {\n return this.getGroupManager().getGroups();\n };\n\n /**\n * Expands a group element. jsPlumb doesn't do \"everything\" for you here, because what it means to expand a Group\n * will vary from application to application. jsPlumb does these things:\n *\n * - Hides any connections that are internal to the group (connections between members, and connections from member of\n * the group to the group itself)\n * - Proxies all connections for which the source or target is a member of the group.\n * - Hides the proxied connections.\n * - Adds the jtk-group-expanded class to the group's element\n * - Removes the jtk-group-collapsed class from the group's element.\n *\n * @method expandGroup\n * @param {String|Group} group Group to expand, or ID of Group to expand.\n */\n _jpi.prototype.expandGroup = function(group) {\n this.getGroupManager().expandGroup(group);\n };\n\n /**\n * Collapses a group element. jsPlumb doesn't do \"everything\" for you here, because what it means to collapse a Group\n * will vary from application to application. jsPlumb does these things:\n *\n * - Shows any connections that are internal to the group (connections between members, and connections from member of\n * the group to the group itself)\n * - Removes proxies for all connections for which the source or target is a member of the group.\n * - Shows the previously proxied connections.\n * - Adds the jtk-group-collapsed class to the group's element\n * - Removes the jtk-group-expanded class from the group's element.\n *\n * @method expandGroup\n * @param {String|Group} group Group to expand, or ID of Group to expand.\n */\n _jpi.prototype.collapseGroup = function(groupId) {\n this.getGroupManager().collapseGroup(groupId);\n };\n\n\n _jpi.prototype.repaintGroup = function(group) {\n this.getGroupManager().repaintGroup(group);\n };\n\n /**\n * Collapses or expands a group element depending on its current state. See notes in the collapseGroup and expandGroup method.\n *\n * @method toggleGroup\n * @param {String|Group} group Group to expand/collapse, or ID of Group to expand/collapse.\n */\n _jpi.prototype.toggleGroup = function(group) {\n group = this.getGroupManager().getGroup(group);\n if (group != null) {\n this.getGroupManager()[group.collapsed ? \"expandGroup\" : \"collapseGroup\"](group);\n }\n };\n\n //\n // lazy init a group manager for the given jsplumb instance.\n //\n _jpi.prototype.getGroupManager = function() {\n var mgr = this[GROUP_MANAGER];\n if (mgr == null) {\n mgr = this[GROUP_MANAGER] = new GroupManager(this);\n }\n return mgr;\n };\n\n _jpi.prototype.removeGroupManager = function() {\n delete this[GROUP_MANAGER];\n };\n\n /**\n * Gets the Group that the given element belongs to, null if none.\n * @method getGroupFor\n * @param {String|Element} el Element, or element ID.\n * @returns {Group} A Group, if found, or null.\n */\n _jpi.prototype.getGroupFor = function(el) {\n el = this.getElement(el);\n if (el) {\n return el[GROUP];\n }\n };\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n\n/*\n * This file contains the 'flowchart' connectors, consisting of vertical and horizontal line segments.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n var STRAIGHT = \"Straight\";\n var ARC = \"Arc\";\n\n var Flowchart = function (params) {\n this.type = \"Flowchart\";\n params = params || {};\n params.stub = params.stub == null ? 30 : params.stub;\n var segments,\n _super = _jp.Connectors.AbstractConnector.apply(this, arguments),\n midpoint = params.midpoint == null ? 0.5 : params.midpoint,\n alwaysRespectStubs = params.alwaysRespectStubs === true,\n lastx = null, lasty = null, lastOrientation,\n cornerRadius = params.cornerRadius != null ? params.cornerRadius : 0,\n\n // TODO now common between this and AbstractBezierEditor; refactor into superclass?\n loopbackRadius = params.loopbackRadius || 25,\n isLoopbackCurrently = false,\n\n sgn = function (n) {\n return n < 0 ? -1 : n === 0 ? 0 : 1;\n },\n segmentDirections = function(segment) {\n return [\n sgn( segment[2] - segment[0] ),\n sgn( segment[3] - segment[1] )\n ];\n },\n /**\n * helper method to add a segment.\n */\n addSegment = function (segments, x, y, paintInfo) {\n if (lastx === x && lasty === y) {\n return;\n }\n var lx = lastx == null ? paintInfo.sx : lastx,\n ly = lasty == null ? paintInfo.sy : lasty,\n o = lx === x ? \"v\" : \"h\";\n\n lastx = x;\n lasty = y;\n segments.push([ lx, ly, x, y, o ]);\n },\n segLength = function (s) {\n return Math.sqrt(Math.pow(s[0] - s[2], 2) + Math.pow(s[1] - s[3], 2));\n },\n _cloneArray = function (a) {\n var _a = [];\n _a.push.apply(_a, a);\n return _a;\n },\n writeSegments = function (conn, segments, paintInfo) {\n var current = null, next, currentDirection, nextDirection;\n for (var i = 0; i < segments.length - 1; i++) {\n\n current = current || _cloneArray(segments[i]);\n next = _cloneArray(segments[i + 1]);\n\n currentDirection = segmentDirections(current);\n nextDirection = segmentDirections(next);\n\n if (cornerRadius > 0 && current[4] !== next[4]) {\n\n var minSegLength = Math.min(segLength(current), segLength(next));\n var radiusToUse = Math.min(cornerRadius, minSegLength / 2);\n\n current[2] -= currentDirection[0] * radiusToUse;\n current[3] -= currentDirection[1] * radiusToUse;\n next[0] += nextDirection[0] * radiusToUse;\n next[1] += nextDirection[1] * radiusToUse;\n\n var ac = (currentDirection[1] === nextDirection[0] && nextDirection[0] === 1) ||\n ((currentDirection[1] === nextDirection[0] && nextDirection[0] === 0) && currentDirection[0] !== nextDirection[1]) ||\n (currentDirection[1] === nextDirection[0] && nextDirection[0] === -1),\n sgny = next[1] > current[3] ? 1 : -1,\n sgnx = next[0] > current[2] ? 1 : -1,\n sgnEqual = sgny === sgnx,\n cx = (sgnEqual && ac || (!sgnEqual && !ac)) ? next[0] : current[2],\n cy = (sgnEqual && ac || (!sgnEqual && !ac)) ? current[3] : next[1];\n\n _super.addSegment(conn, STRAIGHT, {\n x1: current[0], y1: current[1], x2: current[2], y2: current[3]\n });\n\n _super.addSegment(conn, ARC, {\n r: radiusToUse,\n x1: current[2],\n y1: current[3],\n x2: next[0],\n y2: next[1],\n cx: cx,\n cy: cy,\n ac: ac\n });\n }\n else {\n // dx + dy are used to adjust for line width.\n var dx = (current[2] === current[0]) ? 0 : (current[2] > current[0]) ? (paintInfo.lw / 2) : -(paintInfo.lw / 2),\n dy = (current[3] === current[1]) ? 0 : (current[3] > current[1]) ? (paintInfo.lw / 2) : -(paintInfo.lw / 2);\n\n _super.addSegment(conn, STRAIGHT, {\n x1: current[0] - dx, y1: current[1] - dy, x2: current[2] + dx, y2: current[3] + dy\n });\n }\n current = next;\n }\n if (next != null) {\n // last segment\n _super.addSegment(conn, STRAIGHT, {\n x1: next[0], y1: next[1], x2: next[2], y2: next[3]\n });\n }\n };\n\n this._compute = function (paintInfo, params) {\n\n segments = [];\n lastx = null;\n lasty = null;\n lastOrientation = null;\n\n var commonStubCalculator = function () {\n return [paintInfo.startStubX, paintInfo.startStubY, paintInfo.endStubX, paintInfo.endStubY];\n },\n stubCalculators = {\n perpendicular: commonStubCalculator,\n orthogonal: commonStubCalculator,\n opposite: function (axis) {\n var pi = paintInfo,\n idx = axis === \"x\" ? 0 : 1,\n areInProximity = {\n \"x\": function () {\n return ( (pi.so[idx] === 1 && (\n ( (pi.startStubX > pi.endStubX) && (pi.tx > pi.startStubX) ) ||\n ( (pi.sx > pi.endStubX) && (pi.tx > pi.sx))))) ||\n\n ( (pi.so[idx] === -1 && (\n ( (pi.startStubX < pi.endStubX) && (pi.tx < pi.startStubX) ) ||\n ( (pi.sx < pi.endStubX) && (pi.tx < pi.sx)))));\n },\n \"y\": function () {\n return ( (pi.so[idx] === 1 && (\n ( (pi.startStubY > pi.endStubY) && (pi.ty > pi.startStubY) ) ||\n ( (pi.sy > pi.endStubY) && (pi.ty > pi.sy))))) ||\n\n ( (pi.so[idx] === -1 && (\n ( (pi.startStubY < pi.endStubY) && (pi.ty < pi.startStubY) ) ||\n ( (pi.sy < pi.endStubY) && (pi.ty < pi.sy)))));\n }\n };\n\n if (!alwaysRespectStubs && areInProximity[axis]()) {\n return {\n \"x\": [(paintInfo.sx + paintInfo.tx) / 2, paintInfo.startStubY, (paintInfo.sx + paintInfo.tx) / 2, paintInfo.endStubY],\n \"y\": [paintInfo.startStubX, (paintInfo.sy + paintInfo.ty) / 2, paintInfo.endStubX, (paintInfo.sy + paintInfo.ty) / 2]\n }[axis];\n }\n else {\n return [paintInfo.startStubX, paintInfo.startStubY, paintInfo.endStubX, paintInfo.endStubY];\n }\n }\n };\n\n // calculate Stubs.\n var stubs = stubCalculators[paintInfo.anchorOrientation](paintInfo.sourceAxis),\n idx = paintInfo.sourceAxis === \"x\" ? 0 : 1,\n oidx = paintInfo.sourceAxis === \"x\" ? 1 : 0,\n ss = stubs[idx],\n oss = stubs[oidx],\n es = stubs[idx + 2],\n oes = stubs[oidx + 2];\n\n // add the start stub segment. use stubs for loopback as it will look better, with the loop spaced\n // away from the element.\n addSegment(segments, stubs[0], stubs[1], paintInfo);\n\n // if its a loopback and we should treat it differently.\n // if (false && params.sourcePos[0] === params.targetPos[0] && params.sourcePos[1] === params.targetPos[1]) {\n //\n // // we use loopbackRadius here, as statemachine connectors do.\n // // so we go radius to the left from stubs[0], then upwards by 2*radius, to the right by 2*radius,\n // // down by 2*radius, left by radius.\n // addSegment(segments, stubs[0] - loopbackRadius, stubs[1], paintInfo);\n // addSegment(segments, stubs[0] - loopbackRadius, stubs[1] - (2 * loopbackRadius), paintInfo);\n // addSegment(segments, stubs[0] + loopbackRadius, stubs[1] - (2 * loopbackRadius), paintInfo);\n // addSegment(segments, stubs[0] + loopbackRadius, stubs[1], paintInfo);\n // addSegment(segments, stubs[0], stubs[1], paintInfo);\n //\n // }\n // else {\n\n\n var midx = paintInfo.startStubX + ((paintInfo.endStubX - paintInfo.startStubX) * midpoint),\n midy = paintInfo.startStubY + ((paintInfo.endStubY - paintInfo.startStubY) * midpoint);\n\n var orientations = {x: [0, 1], y: [1, 0]},\n lineCalculators = {\n perpendicular: function (axis) {\n var pi = paintInfo,\n sis = {\n x: [\n [[1, 2, 3, 4], null, [2, 1, 4, 3]],\n null,\n [[4, 3, 2, 1], null, [3, 4, 1, 2]]\n ],\n y: [\n [[3, 2, 1, 4], null, [2, 3, 4, 1]],\n null,\n [[4, 1, 2, 3], null, [1, 4, 3, 2]]\n ]\n },\n stubs = {\n x: [[pi.startStubX, pi.endStubX], null, [pi.endStubX, pi.startStubX]],\n y: [[pi.startStubY, pi.endStubY], null, [pi.endStubY, pi.startStubY]]\n },\n midLines = {\n x: [[midx, pi.startStubY], [midx, pi.endStubY]],\n y: [[pi.startStubX, midy], [pi.endStubX, midy]]\n },\n linesToEnd = {\n x: [[pi.endStubX, pi.startStubY]],\n y: [[pi.startStubX, pi.endStubY]]\n },\n startToEnd = {\n x: [[pi.startStubX, pi.endStubY], [pi.endStubX, pi.endStubY]],\n y: [[pi.endStubX, pi.startStubY], [pi.endStubX, pi.endStubY]]\n },\n startToMidToEnd = {\n x: [[pi.startStubX, midy], [pi.endStubX, midy], [pi.endStubX, pi.endStubY]],\n y: [[midx, pi.startStubY], [midx, pi.endStubY], [pi.endStubX, pi.endStubY]]\n },\n otherStubs = {\n x: [pi.startStubY, pi.endStubY],\n y: [pi.startStubX, pi.endStubX]\n },\n soIdx = orientations[axis][0], toIdx = orientations[axis][1],\n _so = pi.so[soIdx] + 1,\n _to = pi.to[toIdx] + 1,\n otherFlipped = (pi.to[toIdx] === -1 && (otherStubs[axis][1] < otherStubs[axis][0])) || (pi.to[toIdx] === 1 && (otherStubs[axis][1] > otherStubs[axis][0])),\n stub1 = stubs[axis][_so][0],\n stub2 = stubs[axis][_so][1],\n segmentIndexes = sis[axis][_so][_to];\n\n if (pi.segment === segmentIndexes[3] || (pi.segment === segmentIndexes[2] && otherFlipped)) {\n return midLines[axis];\n }\n else if (pi.segment === segmentIndexes[2] && stub2 < stub1) {\n return linesToEnd[axis];\n }\n else if ((pi.segment === segmentIndexes[2] && stub2 >= stub1) || (pi.segment === segmentIndexes[1] && !otherFlipped)) {\n return startToMidToEnd[axis];\n }\n else if (pi.segment === segmentIndexes[0] || (pi.segment === segmentIndexes[1] && otherFlipped)) {\n return startToEnd[axis];\n }\n },\n orthogonal: function (axis, startStub, otherStartStub, endStub, otherEndStub) {\n var pi = paintInfo,\n extent = {\n \"x\": pi.so[0] === -1 ? Math.min(startStub, endStub) : Math.max(startStub, endStub),\n \"y\": pi.so[1] === -1 ? Math.min(startStub, endStub) : Math.max(startStub, endStub)\n }[axis];\n\n return {\n \"x\": [\n [extent, otherStartStub],\n [extent, otherEndStub],\n [endStub, otherEndStub]\n ],\n \"y\": [\n [otherStartStub, extent],\n [otherEndStub, extent],\n [otherEndStub, endStub]\n ]\n }[axis];\n },\n opposite: function (axis, ss, oss, es) {\n var pi = paintInfo,\n otherAxis = {\"x\": \"y\", \"y\": \"x\"}[axis],\n dim = {\"x\": \"height\", \"y\": \"width\"}[axis],\n comparator = pi[\"is\" + axis.toUpperCase() + \"GreaterThanStubTimes2\"];\n\n if (params.sourceEndpoint.elementId === params.targetEndpoint.elementId) {\n var _val = oss + ((1 - params.sourceEndpoint.anchor[otherAxis]) * params.sourceInfo[dim]) + _super.maxStub;\n return {\n \"x\": [\n [ss, _val],\n [es, _val]\n ],\n \"y\": [\n [_val, ss],\n [_val, es]\n ]\n }[axis];\n\n }\n else if (!comparator || (pi.so[idx] === 1 && ss > es) || (pi.so[idx] === -1 && ss < es)) {\n return {\n \"x\": [\n [ss, midy],\n [es, midy]\n ],\n \"y\": [\n [midx, ss],\n [midx, es]\n ]\n }[axis];\n }\n else if ((pi.so[idx] === 1 && ss < es) || (pi.so[idx] === -1 && ss > es)) {\n return {\n \"x\": [\n [midx, pi.sy],\n [midx, pi.ty]\n ],\n \"y\": [\n [pi.sx, midy],\n [pi.tx, midy]\n ]\n }[axis];\n }\n }\n };\n\n // compute the rest of the line\n var p = lineCalculators[paintInfo.anchorOrientation](paintInfo.sourceAxis, ss, oss, es, oes);\n if (p) {\n for (var i = 0; i < p.length; i++) {\n addSegment(segments, p[i][0], p[i][1], paintInfo);\n }\n }\n\n // line to end stub\n addSegment(segments, stubs[2], stubs[3], paintInfo);\n\n //}\n\n // end stub to end (common)\n addSegment(segments, paintInfo.tx, paintInfo.ty, paintInfo);\n\n\n\n // write out the segments.\n writeSegments(this, segments, paintInfo);\n\n };\n };\n\n _jp.Connectors.Flowchart = Flowchart;\n _ju.extend(_jp.Connectors.Flowchart, _jp.Connectors.AbstractConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the code for the Bezier connector type.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n _jp.Connectors.AbstractBezierConnector = function(params) {\n params = params || {};\n var showLoopback = params.showLoopback !== false,\n curviness = params.curviness || 10,\n margin = params.margin || 5,\n proximityLimit = params.proximityLimit || 80,\n clockwise = params.orientation && params.orientation === \"clockwise\",\n loopbackRadius = params.loopbackRadius || 25,\n isLoopbackCurrently = false,\n _super;\n\n this._compute = function (paintInfo, p) {\n\n var sp = p.sourcePos,\n tp = p.targetPos,\n _w = Math.abs(sp[0] - tp[0]),\n _h = Math.abs(sp[1] - tp[1]);\n\n if (!showLoopback || (p.sourceEndpoint.elementId !== p.targetEndpoint.elementId)) {\n isLoopbackCurrently = false;\n this._computeBezier(paintInfo, p, sp, tp, _w, _h);\n } else {\n isLoopbackCurrently = true;\n // a loopback connector. draw an arc from one anchor to the other.\n var x1 = p.sourcePos[0], y1 = p.sourcePos[1] - margin,\n cx = x1, cy = y1 - loopbackRadius,\n // canvas sizing stuff, to ensure the whole painted area is visible.\n _x = cx - loopbackRadius,\n _y = cy - loopbackRadius;\n\n _w = 2 * loopbackRadius;\n _h = 2 * loopbackRadius;\n\n paintInfo.points[0] = _x;\n paintInfo.points[1] = _y;\n paintInfo.points[2] = _w;\n paintInfo.points[3] = _h;\n\n // ADD AN ARC SEGMENT.\n _super.addSegment(this, \"Arc\", {\n loopback: true,\n x1: (x1 - _x) + 4,\n y1: y1 - _y,\n startAngle: 0,\n endAngle: 2 * Math.PI,\n r: loopbackRadius,\n ac: !clockwise,\n x2: (x1 - _x) - 4,\n y2: y1 - _y,\n cx: cx - _x,\n cy: cy - _y\n });\n }\n };\n\n _super = _jp.Connectors.AbstractConnector.apply(this, arguments);\n return _super;\n };\n _ju.extend(_jp.Connectors.AbstractBezierConnector, _jp.Connectors.AbstractConnector);\n\n var Bezier = function (params) {\n params = params || {};\n this.type = \"Bezier\";\n\n var _super = _jp.Connectors.AbstractBezierConnector.apply(this, arguments),\n majorAnchor = params.curviness || 150,\n minorAnchor = 10;\n\n this.getCurviness = function () {\n return majorAnchor;\n };\n\n this._findControlPoint = function (point, sourceAnchorPosition, targetAnchorPosition, sourceEndpoint, targetEndpoint, soo, too) {\n // determine if the two anchors are perpendicular to each other in their orientation. we swap the control\n // points around if so (code could be tightened up)\n var perpendicular = soo[0] !== too[0] || soo[1] === too[1],\n p = [];\n\n if (!perpendicular) {\n if (soo[0] === 0) {\n p.push(sourceAnchorPosition[0] < targetAnchorPosition[0] ? point[0] + minorAnchor : point[0] - minorAnchor);\n }\n else {\n p.push(point[0] - (majorAnchor * soo[0]));\n }\n\n if (soo[1] === 0) {\n p.push(sourceAnchorPosition[1] < targetAnchorPosition[1] ? point[1] + minorAnchor : point[1] - minorAnchor);\n }\n else {\n p.push(point[1] + (majorAnchor * too[1]));\n }\n }\n else {\n if (too[0] === 0) {\n p.push(targetAnchorPosition[0] < sourceAnchorPosition[0] ? point[0] + minorAnchor : point[0] - minorAnchor);\n }\n else {\n p.push(point[0] + (majorAnchor * too[0]));\n }\n\n if (too[1] === 0) {\n p.push(targetAnchorPosition[1] < sourceAnchorPosition[1] ? point[1] + minorAnchor : point[1] - minorAnchor);\n }\n else {\n p.push(point[1] + (majorAnchor * soo[1]));\n }\n }\n\n return p;\n };\n\n this._computeBezier = function (paintInfo, p, sp, tp, _w, _h) {\n\n var _CP, _CP2,\n _sx = sp[0] < tp[0] ? _w : 0,\n _sy = sp[1] < tp[1] ? _h : 0,\n _tx = sp[0] < tp[0] ? 0 : _w,\n _ty = sp[1] < tp[1] ? 0 : _h;\n\n _CP = this._findControlPoint([_sx, _sy], sp, tp, p.sourceEndpoint, p.targetEndpoint, paintInfo.so, paintInfo.to);\n _CP2 = this._findControlPoint([_tx, _ty], tp, sp, p.targetEndpoint, p.sourceEndpoint, paintInfo.to, paintInfo.so);\n\n\n _super.addSegment(this, \"Bezier\", {\n x1: _sx, y1: _sy, x2: _tx, y2: _ty,\n cp1x: _CP[0], cp1y: _CP[1], cp2x: _CP2[0], cp2y: _CP2[1]\n });\n };\n\n\n };\n\n _jp.Connectors.Bezier = Bezier;\n _ju.extend(Bezier, _jp.Connectors.AbstractBezierConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the state machine connectors, which extend AbstractBezierConnector.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n var _segment = function (x1, y1, x2, y2) {\n if (x1 <= x2 && y2 <= y1) {\n return 1;\n }\n else if (x1 <= x2 && y1 <= y2) {\n return 2;\n }\n else if (x2 <= x1 && y2 >= y1) {\n return 3;\n }\n return 4;\n },\n\n // the control point we will use depends on the faces to which each end of the connection is assigned, specifically whether or not the\n // two faces are parallel or perpendicular. if they are parallel then the control point lies on the midpoint of the axis in which they\n // are parellel and varies only in the other axis; this variation is proportional to the distance that the anchor points lie from the\n // center of that face. if the two faces are perpendicular then the control point is at some distance from both the midpoints; the amount and\n // direction are dependent on the orientation of the two elements. 'seg', passed in to this method, tells you which segment the target element\n // lies in with respect to the source: 1 is top right, 2 is bottom right, 3 is bottom left, 4 is top left.\n //\n // sourcePos and targetPos are arrays of info about where on the source and target each anchor is located. their contents are:\n //\n // 0 - absolute x\n // 1 - absolute y\n // 2 - proportional x in element (0 is left edge, 1 is right edge)\n // 3 - proportional y in element (0 is top edge, 1 is bottom edge)\n //\n _findControlPoint = function (midx, midy, segment, sourceEdge, targetEdge, dx, dy, distance, proximityLimit) {\n // TODO (maybe)\n // - if anchor pos is 0.5, make the control point take into account the relative position of the elements.\n if (distance <= proximityLimit) {\n return [midx, midy];\n }\n\n if (segment === 1) {\n if (sourceEdge[3] <= 0 && targetEdge[3] >= 1) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] >= 1 && targetEdge[2] <= 0) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + (-1 * dx) , midy + (-1 * dy) ];\n }\n }\n else if (segment === 2) {\n if (sourceEdge[3] >= 1 && targetEdge[3] <= 0) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] >= 1 && targetEdge[2] <= 0) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + dx, midy + (-1 * dy) ];\n }\n }\n else if (segment === 3) {\n if (sourceEdge[3] >= 1 && targetEdge[3] <= 0) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] <= 0 && targetEdge[2] >= 1) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + (-1 * dx) , midy + (-1 * dy) ];\n }\n }\n else if (segment === 4) {\n if (sourceEdge[3] <= 0 && targetEdge[3] >= 1) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] <= 0 && targetEdge[2] >= 1) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + dx , midy + (-1 * dy) ];\n }\n }\n\n };\n\n var StateMachine = function (params) {\n params = params || {};\n this.type = \"StateMachine\";\n\n var _super = _jp.Connectors.AbstractBezierConnector.apply(this, arguments),\n curviness = params.curviness || 10,\n margin = params.margin || 5,\n proximityLimit = params.proximityLimit || 80,\n clockwise = params.orientation && params.orientation === \"clockwise\",\n _controlPoint;\n\n this._computeBezier = function(paintInfo, params, sp, tp, w, h) {\n var _sx = params.sourcePos[0] < params.targetPos[0] ? 0 : w,\n _sy = params.sourcePos[1] < params.targetPos[1] ? 0 : h,\n _tx = params.sourcePos[0] < params.targetPos[0] ? w : 0,\n _ty = params.sourcePos[1] < params.targetPos[1] ? h : 0;\n\n // now adjust for the margin\n if (params.sourcePos[2] === 0) {\n _sx -= margin;\n }\n if (params.sourcePos[2] === 1) {\n _sx += margin;\n }\n if (params.sourcePos[3] === 0) {\n _sy -= margin;\n }\n if (params.sourcePos[3] === 1) {\n _sy += margin;\n }\n if (params.targetPos[2] === 0) {\n _tx -= margin;\n }\n if (params.targetPos[2] === 1) {\n _tx += margin;\n }\n if (params.targetPos[3] === 0) {\n _ty -= margin;\n }\n if (params.targetPos[3] === 1) {\n _ty += margin;\n }\n\n //\n // these connectors are quadratic bezier curves, having a single control point. if both anchors\n // are located at 0.5 on their respective faces, the control point is set to the midpoint and you\n // get a straight line. this is also the case if the two anchors are within 'proximityLimit', since\n // it seems to make good aesthetic sense to do that. outside of that, the control point is positioned\n // at 'curviness' pixels away along the normal to the straight line connecting the two anchors.\n //\n // there may be two improvements to this. firstly, we might actually support the notion of avoiding nodes\n // in the UI, or at least making a good effort at doing so. if a connection would pass underneath some node,\n // for example, we might increase the distance the control point is away from the midpoint in a bid to\n // steer it around that node. this will work within limits, but i think those limits would also be the likely\n // limits for, once again, aesthetic good sense in the layout of a chart using these connectors.\n //\n // the second possible change is actually two possible changes: firstly, it is possible we should gradually\n // decrease the 'curviness' as the distance between the anchors decreases; start tailing it off to 0 at some\n // point (which should be configurable). secondly, we might slightly increase the 'curviness' for connectors\n // with respect to how far their anchor is from the center of its respective face. this could either look cool,\n // or stupid, and may indeed work only in a way that is so subtle as to have been a waste of time.\n //\n\n var _midx = (_sx + _tx) / 2,\n _midy = (_sy + _ty) / 2,\n segment = _segment(_sx, _sy, _tx, _ty),\n distance = Math.sqrt(Math.pow(_tx - _sx, 2) + Math.pow(_ty - _sy, 2)),\n cp1x, cp2x, cp1y, cp2y;\n\n\n // calculate the control point. this code will be where we'll put in a rudimentary element avoidance scheme; it\n // will work by extending the control point to force the curve to be, um, curvier.\n _controlPoint = _findControlPoint(_midx,\n _midy,\n segment,\n params.sourcePos,\n params.targetPos,\n curviness, curviness,\n distance,\n proximityLimit);\n\n cp1x = _controlPoint[0];\n cp2x = _controlPoint[0];\n cp1y = _controlPoint[1];\n cp2y = _controlPoint[1];\n\n _super.addSegment(this, \"Bezier\", {\n x1: _tx, y1: _ty, x2: _sx, y2: _sy,\n cp1x: cp1x, cp1y: cp1y,\n cp2x: cp2x, cp2y: cp2y\n });\n };\n };\n\n _jp.Connectors.StateMachine = StateMachine;\n _ju.extend(StateMachine, _jp.Connectors.AbstractBezierConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the 'flowchart' connectors, consisting of vertical and horizontal line segments.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n var STRAIGHT = \"Straight\";\n\n var Straight = function (params) {\n this.type = STRAIGHT;\n var _super = _jp.Connectors.AbstractConnector.apply(this, arguments);\n\n this._compute = function (paintInfo, _) {\n _super.addSegment(this, STRAIGHT, {x1: paintInfo.sx, y1: paintInfo.sy, x2: paintInfo.startStubX, y2: paintInfo.startStubY});\n _super.addSegment(this, STRAIGHT, {x1: paintInfo.startStubX, y1: paintInfo.startStubY, x2: paintInfo.endStubX, y2: paintInfo.endStubY});\n _super.addSegment(this, STRAIGHT, {x1: paintInfo.endStubX, y1: paintInfo.endStubY, x2: paintInfo.tx, y2: paintInfo.ty});\n };\n };\n\n _jp.Connectors.Straight = Straight;\n _ju.extend(Straight, _jp.Connectors.AbstractConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the SVG renderers.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n * \n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n// ************************** SVG utility methods ********************************************\t\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n var svgAttributeMap = {\n \"stroke-linejoin\": \"stroke-linejoin\",\n \"stroke-dashoffset\": \"stroke-dashoffset\",\n \"stroke-linecap\": \"stroke-linecap\"\n },\n STROKE_DASHARRAY = \"stroke-dasharray\",\n DASHSTYLE = \"dashstyle\",\n LINEAR_GRADIENT = \"linearGradient\",\n RADIAL_GRADIENT = \"radialGradient\",\n DEFS = \"defs\",\n FILL = \"fill\",\n STOP = \"stop\",\n STROKE = \"stroke\",\n STROKE_WIDTH = \"stroke-width\",\n STYLE = \"style\",\n NONE = \"none\",\n JSPLUMB_GRADIENT = \"jsplumb_gradient_\",\n LINE_WIDTH = \"strokeWidth\",\n ns = {\n svg: \"http://www.w3.org/2000/svg\"\n },\n _attr = function (node, attributes) {\n for (var i in attributes) {\n node.setAttribute(i, \"\" + attributes[i]);\n }\n },\n _node = function (name, attributes) {\n attributes = attributes || {};\n attributes.version = \"1.1\";\n attributes.xmlns = ns.svg;\n return _jp.createElementNS(ns.svg, name, null, null, attributes);\n },\n _pos = function (d) {\n return \"position:absolute;left:\" + d[0] + \"px;top:\" + d[1] + \"px\";\n },\n _clearGradient = function (parent) {\n var els = parent.querySelectorAll(\" defs,linearGradient,radialGradient\");\n for (var i = 0; i < els.length; i++) {\n els[i].parentNode.removeChild(els[i]);\n }\n },\n _updateGradient = function (parent, node, style, dimensions, uiComponent) {\n var id = JSPLUMB_GRADIENT + uiComponent._jsPlumb.instance.idstamp();\n // first clear out any existing gradient\n _clearGradient(parent);\n // this checks for an 'offset' property in the gradient, and in the absence of it, assumes\n // we want a linear gradient. if it's there, we create a radial gradient.\n // it is possible that a more explicit means of defining the gradient type would be\n // better. relying on 'offset' means that we can never have a radial gradient that uses\n // some default offset, for instance.\n // issue 244 suggested the 'gradientUnits' attribute; without this, straight/flowchart connectors with gradients would\n // not show gradients when the line was perfectly horizontal or vertical.\n var g;\n if (!style.gradient.offset) {\n g = _node(LINEAR_GRADIENT, {id: id, gradientUnits: \"userSpaceOnUse\"});\n }\n else {\n g = _node(RADIAL_GRADIENT, { id: id });\n }\n\n var defs = _node(DEFS);\n parent.appendChild(defs);\n defs.appendChild(g);\n\n // the svg radial gradient seems to treat stops in the reverse\n // order to how canvas does it. so we want to keep all the maths the same, but\n // iterate the actual style declarations in reverse order, if the x indexes are not in order.\n for (var i = 0; i < style.gradient.stops.length; i++) {\n var styleToUse = uiComponent.segment === 1 || uiComponent.segment === 2 ? i : style.gradient.stops.length - 1 - i,\n stopColor = style.gradient.stops[styleToUse][1],\n s = _node(STOP, {\"offset\": Math.floor(style.gradient.stops[i][0] * 100) + \"%\", \"stop-color\": stopColor});\n\n g.appendChild(s);\n }\n var applyGradientTo = style.stroke ? STROKE : FILL;\n node.setAttribute(applyGradientTo, \"url(#\" + id + \")\");\n },\n _applyStyles = function (parent, node, style, dimensions, uiComponent) {\n\n node.setAttribute(FILL, style.fill ? style.fill : NONE);\n node.setAttribute(STROKE, style.stroke ? style.stroke : NONE);\n\n if (style.gradient) {\n _updateGradient(parent, node, style, dimensions, uiComponent);\n }\n else {\n // make sure we clear any existing gradient\n _clearGradient(parent);\n node.setAttribute(STYLE, \"\");\n }\n\n if (style.strokeWidth) {\n node.setAttribute(STROKE_WIDTH, style.strokeWidth);\n }\n\n // in SVG there is a stroke-dasharray attribute we can set, and its syntax looks like\n // the syntax in VML but is actually kind of nasty: values are given in the pixel\n // coordinate space, whereas in VML they are multiples of the width of the stroked\n // line, which makes a lot more sense. for that reason, jsPlumb is supporting both\n // the native svg 'stroke-dasharray' attribute, and also the 'dashstyle' concept from\n // VML, which will be the preferred method. the code below this converts a dashstyle\n // attribute given in terms of stroke width into a pixel representation, by using the\n // stroke's lineWidth.\n if (style[DASHSTYLE] && style[LINE_WIDTH] && !style[STROKE_DASHARRAY]) {\n var sep = style[DASHSTYLE].indexOf(\",\") === -1 ? \" \" : \",\",\n parts = style[DASHSTYLE].split(sep),\n styleToUse = \"\";\n parts.forEach(function (p) {\n styleToUse += (Math.floor(p * style.strokeWidth) + sep);\n });\n node.setAttribute(STROKE_DASHARRAY, styleToUse);\n }\n else if (style[STROKE_DASHARRAY]) {\n node.setAttribute(STROKE_DASHARRAY, style[STROKE_DASHARRAY]);\n }\n\n // extra attributes such as join type, dash offset.\n for (var i in svgAttributeMap) {\n if (style[i]) {\n node.setAttribute(svgAttributeMap[i], style[i]);\n }\n }\n },\n _appendAtIndex = function (svg, path, idx) {\n if (svg.childNodes.length > idx) {\n svg.insertBefore(path, svg.childNodes[idx]);\n }\n else {\n svg.appendChild(path);\n }\n };\n\n /**\n utility methods for other objects to use.\n */\n _ju.svg = {\n node: _node,\n attr: _attr,\n pos: _pos\n };\n\n // ************************** / SVG utility methods ********************************************\n\n /*\n * Base class for SVG components.\n */\n var SvgComponent = function (params) {\n var pointerEventsSpec = params.pointerEventsSpec || \"all\", renderer = {};\n\n _jp.jsPlumbUIComponent.apply(this, params.originalArgs);\n this.canvas = null;\n this.path = null;\n this.svg = null;\n this.bgCanvas = null;\n\n var clazz = params.cssClass + \" \" + (params.originalArgs[0].cssClass || \"\"),\n svgParams = {\n \"style\": \"\",\n \"width\": 0,\n \"height\": 0,\n \"pointer-events\": pointerEventsSpec,\n \"position\": \"absolute\"\n };\n\n this.svg = _node(\"svg\", svgParams);\n\n if (params.useDivWrapper) {\n this.canvas = _jp.createElement(\"div\", { position : \"absolute\" });\n _ju.sizeElement(this.canvas, 0, 0, 1, 1);\n this.canvas.className = clazz;\n }\n else {\n _attr(this.svg, { \"class\": clazz });\n this.canvas = this.svg;\n }\n\n params._jsPlumb.appendElement(this.canvas, params.originalArgs[0].parent);\n if (params.useDivWrapper) {\n this.canvas.appendChild(this.svg);\n }\n\n var displayElements = [ this.canvas ];\n this.getDisplayElements = function () {\n return displayElements;\n };\n\n this.appendDisplayElement = function (el) {\n displayElements.push(el);\n };\n\n this.paint = function (style, anchor, extents) {\n if (style != null) {\n\n var xy = [ this.x, this.y ], wh = [ this.w, this.h ], p;\n if (extents != null) {\n if (extents.xmin < 0) {\n xy[0] += extents.xmin;\n }\n if (extents.ymin < 0) {\n xy[1] += extents.ymin;\n }\n wh[0] = extents.xmax + ((extents.xmin < 0) ? -extents.xmin : 0);\n wh[1] = extents.ymax + ((extents.ymin < 0) ? -extents.ymin : 0);\n }\n\n if (params.useDivWrapper) {\n _ju.sizeElement(this.canvas, xy[0], xy[1], wh[0], wh[1]);\n xy[0] = 0;\n xy[1] = 0;\n p = _pos([ 0, 0 ]);\n }\n else {\n p = _pos([ xy[0], xy[1] ]);\n }\n\n renderer.paint.apply(this, arguments);\n\n _attr(this.svg, {\n \"style\": p,\n \"width\": wh[0] || 0,\n \"height\": wh[1] || 0\n });\n }\n };\n\n return {\n renderer: renderer\n };\n };\n\n _ju.extend(SvgComponent, _jp.jsPlumbUIComponent, {\n cleanup: function (force) {\n if (force || this.typeId == null) {\n if (this.canvas) {\n this.canvas._jsPlumb = null;\n }\n if (this.svg) {\n this.svg._jsPlumb = null;\n }\n if (this.bgCanvas) {\n this.bgCanvas._jsPlumb = null;\n }\n\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n if (this.bgCanvas && this.bgCanvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n\n this.svg = null;\n this.canvas = null;\n this.path = null;\n this.group = null;\n }\n else {\n // if not a forced cleanup, just detach from DOM for now.\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n if (this.bgCanvas && this.bgCanvas.parentNode) {\n this.bgCanvas.parentNode.removeChild(this.bgCanvas);\n }\n }\n },\n reattach:function(instance) {\n var c = instance.getContainer();\n if (this.canvas && this.canvas.parentNode == null) {\n c.appendChild(this.canvas);\n }\n if (this.bgCanvas && this.bgCanvas.parentNode == null) {\n c.appendChild(this.bgCanvas);\n }\n },\n setVisible: function (v) {\n if (this.canvas) {\n this.canvas.style.display = v ? \"block\" : \"none\";\n }\n }\n });\n\n /*\n * Base class for SVG connectors.\n */\n _jp.ConnectorRenderers.svg = function (params) {\n var self = this,\n _super = SvgComponent.apply(this, [\n {\n cssClass: params._jsPlumb.connectorClass,\n originalArgs: arguments,\n pointerEventsSpec: \"none\",\n _jsPlumb: params._jsPlumb\n }\n ]);\n\n _super.renderer.paint = function (style, anchor, extents) {\n\n var segments = self.getSegments(), p = \"\", offset = [0, 0];\n if (extents.xmin < 0) {\n offset[0] = -extents.xmin;\n }\n if (extents.ymin < 0) {\n offset[1] = -extents.ymin;\n }\n\n if (segments.length > 0) {\n\n p = self.getPathData();\n\n var a = {\n d: p,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\",\n \"pointer-events\": params[\"pointer-events\"] || \"visibleStroke\"\n },\n outlineStyle = null,\n d = [self.x, self.y, self.w, self.h];\n\n // outline style. actually means drawing an svg object underneath the main one.\n if (style.outlineStroke) {\n var outlineWidth = style.outlineWidth || 1,\n outlineStrokeWidth = style.strokeWidth + (2 * outlineWidth);\n outlineStyle = _jp.extend({}, style);\n delete outlineStyle.gradient;\n outlineStyle.stroke = style.outlineStroke;\n outlineStyle.strokeWidth = outlineStrokeWidth;\n\n if (self.bgPath == null) {\n self.bgPath = _node(\"path\", a);\n _jp.addClass(self.bgPath, _jp.connectorOutlineClass);\n _appendAtIndex(self.svg, self.bgPath, 0);\n }\n else {\n _attr(self.bgPath, a);\n }\n\n _applyStyles(self.svg, self.bgPath, outlineStyle, d, self);\n }\n\n if (self.path == null) {\n self.path = _node(\"path\", a);\n _appendAtIndex(self.svg, self.path, style.outlineStroke ? 1 : 0);\n }\n else {\n _attr(self.path, a);\n }\n\n _applyStyles(self.svg, self.path, style, d, self);\n }\n };\n };\n _ju.extend(_jp.ConnectorRenderers.svg, SvgComponent);\n\n// ******************************* svg segment renderer *****************************************************\t\n\n\n// ******************************* /svg segments *****************************************************\n\n /*\n * Base class for SVG endpoints.\n */\n var SvgEndpoint = _jp.SvgEndpoint = function (params) {\n var _super = SvgComponent.apply(this, [\n {\n cssClass: params._jsPlumb.endpointClass,\n originalArgs: arguments,\n pointerEventsSpec: \"all\",\n useDivWrapper: true,\n _jsPlumb: params._jsPlumb\n }\n ]);\n\n _super.renderer.paint = function (style) {\n var s = _jp.extend({}, style);\n if (s.outlineStroke) {\n s.stroke = s.outlineStroke;\n }\n\n if (this.node == null) {\n this.node = this.makeNode(s);\n this.svg.appendChild(this.node);\n }\n else if (this.updateNode != null) {\n this.updateNode(this.node);\n }\n _applyStyles(this.svg, this.node, s, [ this.x, this.y, this.w, this.h ], this);\n _pos(this.node, [ this.x, this.y ]);\n }.bind(this);\n\n };\n _ju.extend(SvgEndpoint, SvgComponent);\n\n /*\n * SVG Dot Endpoint\n */\n _jp.Endpoints.svg.Dot = function () {\n _jp.Endpoints.Dot.apply(this, arguments);\n SvgEndpoint.apply(this, arguments);\n this.makeNode = function (style) {\n return _node(\"circle\", {\n \"cx\": this.w / 2,\n \"cy\": this.h / 2,\n \"r\": this.radius\n });\n };\n this.updateNode = function (node) {\n _attr(node, {\n \"cx\": this.w / 2,\n \"cy\": this.h / 2,\n \"r\": this.radius\n });\n };\n };\n _ju.extend(_jp.Endpoints.svg.Dot, [_jp.Endpoints.Dot, SvgEndpoint]);\n\n /*\n * SVG Rectangle Endpoint\n */\n _jp.Endpoints.svg.Rectangle = function () {\n _jp.Endpoints.Rectangle.apply(this, arguments);\n SvgEndpoint.apply(this, arguments);\n this.makeNode = function (style) {\n return _node(\"rect\", {\n \"width\": this.w,\n \"height\": this.h\n });\n };\n this.updateNode = function (node) {\n _attr(node, {\n \"width\": this.w,\n \"height\": this.h\n });\n };\n };\n _ju.extend(_jp.Endpoints.svg.Rectangle, [_jp.Endpoints.Rectangle, SvgEndpoint]);\n\n /*\n * SVG Image Endpoint is the default image endpoint.\n */\n _jp.Endpoints.svg.Image = _jp.Endpoints.Image;\n /*\n * Blank endpoint in svg renderer is the default Blank endpoint.\n */\n _jp.Endpoints.svg.Blank = _jp.Endpoints.Blank;\n /*\n * Label overlay in svg renderer is the default Label overlay.\n */\n _jp.Overlays.svg.Label = _jp.Overlays.Label;\n /*\n * Custom overlay in svg renderer is the default Custom overlay.\n */\n _jp.Overlays.svg.Custom = _jp.Overlays.Custom;\n\n var AbstractSvgArrowOverlay = function (superclass, originalArgs) {\n superclass.apply(this, originalArgs);\n _jp.jsPlumbUIComponent.apply(this, originalArgs);\n this.isAppendedAtTopLevel = false;\n var self = this;\n this.path = null;\n this.paint = function (params, containerExtents) {\n // only draws on connections, not endpoints.\n if (params.component.svg && containerExtents) {\n if (this.path == null) {\n this.path = _node(\"path\", {\n \"pointer-events\": \"all\"\n });\n params.component.svg.appendChild(this.path);\n if (this.elementCreated) {\n this.elementCreated(this.path, params.component);\n }\n\n this.canvas = params.component.svg; // for the sake of completeness; this behaves the same as other overlays\n }\n var clazz = originalArgs && (originalArgs.length === 1) ? (originalArgs[0].cssClass || \"\") : \"\",\n offset = [0, 0];\n\n if (containerExtents.xmin < 0) {\n offset[0] = -containerExtents.xmin;\n }\n if (containerExtents.ymin < 0) {\n offset[1] = -containerExtents.ymin;\n }\n\n _attr(this.path, {\n \"d\": makePath(params.d),\n \"class\": clazz,\n stroke: params.stroke ? params.stroke : null,\n fill: params.fill ? params.fill : null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n }\n };\n var makePath = function (d) {\n return (isNaN(d.cxy.x) || isNaN(d.cxy.y)) ? \"\" : \"M\" + d.hxy.x + \",\" + d.hxy.y +\n \" L\" + d.tail[0].x + \",\" + d.tail[0].y +\n \" L\" + d.cxy.x + \",\" + d.cxy.y +\n \" L\" + d.tail[1].x + \",\" + d.tail[1].y +\n \" L\" + d.hxy.x + \",\" + d.hxy.y;\n };\n this.transfer = function(target) {\n if (target.canvas && this.path && this.path.parentNode) {\n this.path.parentNode.removeChild(this.path);\n target.canvas.appendChild(this.path);\n }\n };\n };\n _ju.extend(AbstractSvgArrowOverlay, [_jp.jsPlumbUIComponent, _jp.Overlays.AbstractOverlay], {\n cleanup: function (force) {\n if (this.path != null) {\n if (force) {\n this._jsPlumb.instance.removeElement(this.path);\n }\n else {\n if (this.path.parentNode) {\n this.path.parentNode.removeChild(this.path);\n }\n }\n }\n },\n reattach:function(instance, component) {\n if (this.path && component.canvas) {\n component.canvas.appendChild(this.path);\n }\n },\n setVisible: function (v) {\n if (this.path != null) {\n (this.path.style.display = (v ? \"block\" : \"none\"));\n }\n }\n });\n\n _jp.Overlays.svg.Arrow = function () {\n AbstractSvgArrowOverlay.apply(this, [_jp.Overlays.Arrow, arguments]);\n };\n _ju.extend(_jp.Overlays.svg.Arrow, [ _jp.Overlays.Arrow, AbstractSvgArrowOverlay ]);\n\n _jp.Overlays.svg.PlainArrow = function () {\n AbstractSvgArrowOverlay.apply(this, [_jp.Overlays.PlainArrow, arguments]);\n };\n _ju.extend(_jp.Overlays.svg.PlainArrow, [ _jp.Overlays.PlainArrow, AbstractSvgArrowOverlay ]);\n\n _jp.Overlays.svg.Diamond = function () {\n AbstractSvgArrowOverlay.apply(this, [_jp.Overlays.Diamond, arguments]);\n };\n _ju.extend(_jp.Overlays.svg.Diamond, [ _jp.Overlays.Diamond, AbstractSvgArrowOverlay ]);\n\n // a test\n _jp.Overlays.svg.GuideLines = function () {\n var path = null, self = this, p1_1, p1_2;\n _jp.Overlays.GuideLines.apply(this, arguments);\n this.paint = function (params, containerExtents) {\n if (path == null) {\n path = _node(\"path\");\n params.connector.svg.appendChild(path);\n self.attachListeners(path, params.connector);\n self.attachListeners(path, self);\n\n p1_1 = _node(\"path\");\n params.connector.svg.appendChild(p1_1);\n self.attachListeners(p1_1, params.connector);\n self.attachListeners(p1_1, self);\n\n p1_2 = _node(\"path\");\n params.connector.svg.appendChild(p1_2);\n self.attachListeners(p1_2, params.connector);\n self.attachListeners(p1_2, self);\n }\n\n var offset = [0, 0];\n if (containerExtents.xmin < 0) {\n offset[0] = -containerExtents.xmin;\n }\n if (containerExtents.ymin < 0) {\n offset[1] = -containerExtents.ymin;\n }\n\n _attr(path, {\n \"d\": makePath(params.head, params.tail),\n stroke: \"red\",\n fill: null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n\n _attr(p1_1, {\n \"d\": makePath(params.tailLine[0], params.tailLine[1]),\n stroke: \"blue\",\n fill: null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n\n _attr(p1_2, {\n \"d\": makePath(params.headLine[0], params.headLine[1]),\n stroke: \"green\",\n fill: null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n };\n\n var makePath = function (d1, d2) {\n return \"M \" + d1.x + \",\" + d1.y +\n \" L\" + d2.x + \",\" + d2.y;\n };\n };\n _ju.extend(_jp.Overlays.svg.GuideLines, _jp.Overlays.GuideLines);\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains code used when jsPlumb is being rendered in a DOM.\n *\n * Copyright (c) 2010 - 2019 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil,\n _jk = root.Katavorio, _jg = root.Biltong;\n\n var _getEventManager = function(instance) {\n var e = instance._mottle;\n if (!e) {\n e = instance._mottle = new root.Mottle();\n }\n return e;\n };\n\n var _getDragManager = function (instance, category) {\n\n category = category || \"main\";\n var key = \"_katavorio_\" + category;\n var k = instance[key],\n e = instance.getEventManager();\n\n if (!k) {\n k = new _jk({\n bind: e.on,\n unbind: e.off,\n getSize: _jp.getSize,\n getConstrainingRectangle:function(el) {\n return [ el.parentNode.scrollWidth, el.parentNode.scrollHeight ];\n },\n getPosition: function (el, relativeToRoot) {\n // if this is a nested draggable then compute the offset against its own offsetParent, otherwise\n // compute against the Container's origin. see also the getUIPosition method below.\n var o = instance.getOffset(el, relativeToRoot, el._katavorioDrag ? el.offsetParent : null);\n return [o.left, o.top];\n },\n setPosition: function (el, xy) {\n el.style.left = xy[0] + \"px\";\n el.style.top = xy[1] + \"px\";\n },\n addClass: _jp.addClass,\n removeClass: _jp.removeClass,\n intersects: _jg.intersects,\n indexOf: function(l, i) { return l.indexOf(i); },\n scope:instance.getDefaultScope(),\n css: {\n noSelect: instance.dragSelectClass,\n droppable: \"jtk-droppable\",\n draggable: \"jtk-draggable\",\n drag: \"jtk-drag\",\n selected: \"jtk-drag-selected\",\n active: \"jtk-drag-active\",\n hover: \"jtk-drag-hover\",\n ghostProxy:\"jtk-ghost-proxy\"\n }\n });\n k.setZoom(instance.getZoom());\n instance[key] = k;\n instance.bind(\"zoom\", k.setZoom);\n }\n return k;\n };\n\n var _dragStart=function(params) {\n var options = params.el._jsPlumbDragOptions;\n var cont = true;\n if (options.canDrag) {\n cont = options.canDrag();\n }\n if (cont) {\n this.setHoverSuspended(true);\n this.select({source: params.el}).addClass(this.elementDraggingClass + \" \" + this.sourceElementDraggingClass, true);\n this.select({target: params.el}).addClass(this.elementDraggingClass + \" \" + this.targetElementDraggingClass, true);\n this.setConnectionBeingDragged(true);\n }\n return cont;\n };\n var _dragMove=function(params) {\n var ui = this.getUIPosition(arguments, this.getZoom());\n if (ui != null) {\n var o = params.el._jsPlumbDragOptions;\n this.draw(params.el, ui, null, true);\n if (o._dragging) {\n this.addClass(params.el, \"jtk-dragged\");\n }\n o._dragging = true;\n }\n };\n var _dragStop=function(params) {\n var elements = params.selection, uip;\n\n var _one = function (_e) {\n if (_e[1] != null) {\n // run the reported offset through the code that takes parent containers\n // into account, to adjust if necessary (issue 554)\n uip = this.getUIPosition([{\n el:_e[2].el,\n pos:[_e[1].left, _e[1].top]\n }]);\n this.draw(_e[2].el, uip);\n }\n\n delete _e[0]._jsPlumbDragOptions._dragging;\n\n this.removeClass(_e[0], \"jtk-dragged\");\n this.select({source: _e[2].el}).removeClass(this.elementDraggingClass + \" \" + this.sourceElementDraggingClass, true);\n this.select({target: _e[2].el}).removeClass(this.elementDraggingClass + \" \" + this.targetElementDraggingClass, true);\n this.getDragManager().dragEnded(_e[2].el);\n }.bind(this);\n\n for (var i = 0; i < elements.length; i++) {\n _one(elements[i]);\n }\n\n this.setHoverSuspended(false);\n this.setConnectionBeingDragged(false);\n };\n\n var _animProps = function (o, p) {\n var _one = function (pName) {\n if (p[pName] != null) {\n if (_ju.isString(p[pName])) {\n var m = p[pName].match(/-=/) ? -1 : 1,\n v = p[pName].substring(2);\n return o[pName] + (m * v);\n }\n else {\n return p[pName];\n }\n }\n else {\n return o[pName];\n }\n };\n return [ _one(\"left\"), _one(\"top\") ];\n };\n\n var _genLoc = function (prefix, e) {\n if (e == null) {\n return [ 0, 0 ];\n }\n var ts = _touches(e), t = _getTouch(ts, 0);\n return [t[prefix + \"X\"], t[prefix + \"Y\"]];\n },\n _pageLocation = _genLoc.bind(this, \"page\"),\n _screenLocation = _genLoc.bind(this, \"screen\"),\n _clientLocation = _genLoc.bind(this, \"client\"),\n _getTouch = function (touches, idx) {\n return touches.item ? touches.item(idx) : touches[idx];\n },\n _touches = function (e) {\n return e.touches && e.touches.length > 0 ? e.touches :\n e.changedTouches && e.changedTouches.length > 0 ? e.changedTouches :\n e.targetTouches && e.targetTouches.length > 0 ? e.targetTouches :\n [ e ];\n };\n\n /**\n Manages dragging for some instance of jsPlumb.\n\n TODO instead of this being accessed directly, it should subscribe to events on the jsPlumb instance: every method\n in here is called directly by jsPlumb. But what should happen is that we have unpublished events that this listens\n to. The only trick is getting one of these instantiated with every jsPlumb instance: it needs to have a hook somehow.\n Basically the general idea is to pull ALL the drag code out (prototype method registrations plus this) into a\n dedicated drag script), that does not necessarily need to be included.\n\n\n */\n var DragManager = function (_currentInstance) {\n var _draggables = {}, _dlist = [], _delements = {}, _elementsWithEndpoints = {},\n // elementids mapped to the draggable to which they belong.\n _draggablesForElements = {};\n\n /**\n register some element as draggable. right now the drag init stuff is done elsewhere, and it is\n possible that will continue to be the case.\n */\n this.register = function (el) {\n var id = _currentInstance.getId(el),\n parentOffset;\n\n if (!_draggables[id]) {\n _draggables[id] = el;\n _dlist.push(el);\n _delements[id] = {};\n }\n\n // look for child elements that have endpoints and register them against this draggable.\n var _oneLevel = function (p) {\n if (p) {\n for (var i = 0; i < p.childNodes.length; i++) {\n if (p.childNodes[i].nodeType !== 3 && p.childNodes[i].nodeType !== 8) {\n var cEl = jsPlumb.getElement(p.childNodes[i]),\n cid = _currentInstance.getId(p.childNodes[i], null, true);\n if (cid && _elementsWithEndpoints[cid] && _elementsWithEndpoints[cid] > 0) {\n if (!parentOffset) {\n parentOffset = _currentInstance.getOffset(el);\n }\n var cOff = _currentInstance.getOffset(cEl);\n _delements[id][cid] = {\n id: cid,\n offset: {\n left: cOff.left - parentOffset.left,\n top: cOff.top - parentOffset.top\n }\n };\n _draggablesForElements[cid] = id;\n }\n _oneLevel(p.childNodes[i]);\n }\n }\n }\n };\n\n _oneLevel(el);\n };\n\n // refresh the offsets for child elements of this element.\n this.updateOffsets = function (elId, childOffsetOverrides) {\n if (elId != null) {\n childOffsetOverrides = childOffsetOverrides || {};\n var domEl = jsPlumb.getElement(elId),\n id = _currentInstance.getId(domEl),\n children = _delements[id],\n parentOffset;\n\n if (children) {\n for (var i in children) {\n if (children.hasOwnProperty(i)) {\n var cel = jsPlumb.getElement(i),\n cOff = childOffsetOverrides[i] || _currentInstance.getOffset(cel);\n\n // do not update if we have a value already and we'd just be writing 0,0\n if (cel.offsetParent == null && _delements[id][i] != null) {\n continue;\n }\n\n if (!parentOffset) {\n parentOffset = _currentInstance.getOffset(domEl);\n }\n\n _delements[id][i] = {\n id: i,\n offset: {\n left: cOff.left - parentOffset.left,\n top: cOff.top - parentOffset.top\n }\n };\n _draggablesForElements[i] = id;\n }\n }\n }\n }\n };\n\n /**\n notification that an endpoint was added to the given el. we go up from that el's parent\n node, looking for a parent that has been registered as a draggable. if we find one, we add this\n el to that parent's list of elements to update on drag (if it is not there already)\n */\n this.endpointAdded = function (el, id) {\n\n id = id || _currentInstance.getId(el);\n\n var b = document.body,\n p = el.parentNode;\n\n _elementsWithEndpoints[id] = _elementsWithEndpoints[id] ? _elementsWithEndpoints[id] + 1 : 1;\n\n while (p != null && p !== b) {\n var pid = _currentInstance.getId(p, null, true);\n if (pid && _draggables[pid]) {\n var pLoc = _currentInstance.getOffset(p);\n\n if (_delements[pid][id] == null) {\n var cLoc = _currentInstance.getOffset(el);\n _delements[pid][id] = {\n id: id,\n offset: {\n left: cLoc.left - pLoc.left,\n top: cLoc.top - pLoc.top\n }\n };\n _draggablesForElements[id] = pid;\n }\n break;\n }\n p = p.parentNode;\n }\n };\n\n this.endpointDeleted = function (endpoint) {\n if (_elementsWithEndpoints[endpoint.elementId]) {\n _elementsWithEndpoints[endpoint.elementId]--;\n if (_elementsWithEndpoints[endpoint.elementId] <= 0) {\n for (var i in _delements) {\n if (_delements.hasOwnProperty(i) && _delements[i]) {\n delete _delements[i][endpoint.elementId];\n delete _draggablesForElements[endpoint.elementId];\n }\n }\n }\n }\n };\n\n this.changeId = function (oldId, newId) {\n _delements[newId] = _delements[oldId];\n _delements[oldId] = {};\n _draggablesForElements[newId] = _draggablesForElements[oldId];\n _draggablesForElements[oldId] = null;\n };\n\n this.getElementsForDraggable = function (id) {\n return _delements[id];\n };\n\n this.elementRemoved = function (elementId) {\n var elId = _draggablesForElements[elementId];\n if (elId) {\n delete _delements[elId][elementId];\n delete _draggablesForElements[elementId];\n }\n };\n\n this.reset = function () {\n _draggables = {};\n _dlist = [];\n _delements = {};\n _elementsWithEndpoints = {};\n };\n\n //\n // notification drag ended. We check automatically if need to update some\n // ancestor's offsets.\n //\n this.dragEnded = function (el) {\n if (el.offsetParent != null) {\n var id = _currentInstance.getId(el),\n ancestor = _draggablesForElements[id];\n\n if (ancestor) {\n this.updateOffsets(ancestor);\n }\n }\n };\n\n this.setParent = function (el, elId, p, pId, currentChildLocation) {\n var current = _draggablesForElements[elId];\n if (!_delements[pId]) {\n _delements[pId] = {};\n }\n var pLoc = _currentInstance.getOffset(p),\n cLoc = currentChildLocation || _currentInstance.getOffset(el);\n\n if (current && _delements[current]) {\n delete _delements[current][elId];\n }\n\n _delements[pId][elId] = {\n id:elId,\n offset : {\n left: cLoc.left - pLoc.left,\n top: cLoc.top - pLoc.top\n }\n };\n _draggablesForElements[elId] = pId;\n };\n\n this.clearParent = function(el, elId) {\n var current = _draggablesForElements[elId];\n if (current) {\n delete _delements[current][elId];\n delete _draggablesForElements[elId];\n }\n };\n\n this.revalidateParent = function(el, elId, childOffset) {\n var current = _draggablesForElements[elId];\n if (current) {\n var co = {};\n co[elId] = childOffset;\n this.updateOffsets(current, co);\n _currentInstance.revalidate(current);\n }\n };\n\n this.getDragAncestor = function (el) {\n var de = jsPlumb.getElement(el),\n id = _currentInstance.getId(de),\n aid = _draggablesForElements[id];\n\n if (aid) {\n return jsPlumb.getElement(aid);\n }\n else {\n return null;\n }\n };\n\n };\n\n var _setClassName = function (el, cn, classList) {\n cn = _ju.fastTrim(cn);\n if (typeof el.className.baseVal !== \"undefined\") {\n el.className.baseVal = cn;\n }\n else {\n el.className = cn;\n }\n\n // recent (i currently have 61.0.3163.100) version of chrome do not update classList when you set the base val\n // of an svg element's className. in the long run we'd like to move to just using classList anyway\n try {\n var cl = el.classList;\n if (cl != null) {\n while (cl.length > 0) {\n cl.remove(cl.item(0));\n }\n for (var i = 0; i < classList.length; i++) {\n if (classList[i]) {\n cl.add(classList[i]);\n }\n }\n }\n }\n catch(e) {\n // not fatal\n _ju.log(\"JSPLUMB: cannot set class list\", e);\n }\n },\n _getClassName = function (el) {\n return (typeof el.className.baseVal === \"undefined\") ? el.className : el.className.baseVal;\n },\n _classManip = function (el, classesToAdd, classesToRemove) {\n classesToAdd = classesToAdd == null ? [] : _ju.isArray(classesToAdd) ? classesToAdd : classesToAdd.split(/\\s+/);\n classesToRemove = classesToRemove == null ? [] : _ju.isArray(classesToRemove) ? classesToRemove : classesToRemove.split(/\\s+/);\n\n var className = _getClassName(el),\n curClasses = className.split(/\\s+/);\n\n var _oneSet = function (add, classes) {\n for (var i = 0; i < classes.length; i++) {\n if (add) {\n if (curClasses.indexOf(classes[i]) === -1) {\n curClasses.push(classes[i]);\n }\n }\n else {\n var idx = curClasses.indexOf(classes[i]);\n if (idx !== -1) {\n curClasses.splice(idx, 1);\n }\n }\n }\n };\n\n _oneSet(true, classesToAdd);\n _oneSet(false, classesToRemove);\n\n _setClassName(el, curClasses.join(\" \"), curClasses);\n };\n\n root.jsPlumb.extend(root.jsPlumbInstance.prototype, {\n\n headless: false,\n\n pageLocation: _pageLocation,\n screenLocation: _screenLocation,\n clientLocation: _clientLocation,\n\n getDragManager:function() {\n if (this.dragManager == null) {\n this.dragManager = new DragManager(this);\n }\n\n return this.dragManager;\n },\n\n recalculateOffsets:function(elId) {\n this.getDragManager().updateOffsets(elId);\n },\n\n createElement:function(tag, style, clazz, atts) {\n return this.createElementNS(null, tag, style, clazz, atts);\n },\n\n createElementNS:function(ns, tag, style, clazz, atts) {\n var e = ns == null ? document.createElement(tag) : document.createElementNS(ns, tag);\n var i;\n style = style || {};\n for (i in style) {\n e.style[i] = style[i];\n }\n\n if (clazz) {\n e.className = clazz;\n }\n\n atts = atts || {};\n for (i in atts) {\n e.setAttribute(i, \"\" + atts[i]);\n }\n\n return e;\n },\n\n getAttribute: function (el, attName) {\n return el.getAttribute != null ? el.getAttribute(attName) : null;\n },\n\n setAttribute: function (el, a, v) {\n if (el.setAttribute != null) {\n el.setAttribute(a, v);\n }\n },\n\n setAttributes: function (el, atts) {\n for (var i in atts) {\n if (atts.hasOwnProperty(i)) {\n el.setAttribute(i, atts[i]);\n }\n }\n },\n appendToRoot: function (node) {\n document.body.appendChild(node);\n },\n getRenderModes: function () {\n return [ \"svg\" ];\n },\n getClass:_getClassName,\n addClass: function (el, clazz) {\n jsPlumb.each(el, function (e) {\n _classManip(e, clazz);\n });\n },\n hasClass: function (el, clazz) {\n el = jsPlumb.getElement(el);\n if (el.classList) {\n return el.classList.contains(clazz);\n }\n else {\n return _getClassName(el).indexOf(clazz) !== -1;\n }\n },\n removeClass: function (el, clazz) {\n jsPlumb.each(el, function (e) {\n _classManip(e, null, clazz);\n });\n },\n toggleClass:function(el, clazz) {\n if (jsPlumb.hasClass(el, clazz)) {\n jsPlumb.removeClass(el, clazz);\n } else {\n jsPlumb.addClass(el, clazz);\n }\n },\n updateClasses: function (el, toAdd, toRemove) {\n jsPlumb.each(el, function (e) {\n _classManip(e, toAdd, toRemove);\n });\n },\n setClass: function (el, clazz) {\n if (clazz != null) {\n jsPlumb.each(el, function (e) {\n _setClassName(e, clazz, clazz.split(/\\s+/));\n });\n }\n },\n setPosition: function (el, p) {\n el.style.left = p.left + \"px\";\n el.style.top = p.top + \"px\";\n },\n getPosition: function (el) {\n var _one = function (prop) {\n var v = el.style[prop];\n return v ? v.substring(0, v.length - 2) : 0;\n };\n return {\n left: _one(\"left\"),\n top: _one(\"top\")\n };\n },\n getStyle:function(el, prop) {\n if (typeof window.getComputedStyle !== 'undefined') {\n return getComputedStyle(el, null).getPropertyValue(prop);\n } else {\n return el.currentStyle[prop];\n }\n },\n getSelector: function (ctx, spec) {\n var sel = null;\n if (arguments.length === 1) {\n sel = ctx.nodeType != null ? ctx : document.querySelectorAll(ctx);\n }\n else {\n sel = ctx.querySelectorAll(spec);\n }\n\n return sel;\n },\n getOffset:function(el, relativeToRoot, container) {\n el = jsPlumb.getElement(el);\n container = container || this.getContainer();\n var out = {\n left: el.offsetLeft,\n top: el.offsetTop\n },\n op = (relativeToRoot || (container != null && (el !== container && el.offsetParent !== container))) ? el.offsetParent : null,\n _maybeAdjustScroll = function(offsetParent) {\n if (offsetParent != null && offsetParent !== document.body && (offsetParent.scrollTop > 0 || offsetParent.scrollLeft > 0)) {\n out.left -= offsetParent.scrollLeft;\n out.top -= offsetParent.scrollTop;\n }\n }.bind(this);\n\n while (op != null) {\n out.left += op.offsetLeft;\n out.top += op.offsetTop;\n _maybeAdjustScroll(op);\n op = relativeToRoot ? op.offsetParent :\n op.offsetParent === container ? null : op.offsetParent;\n }\n\n // if container is scrolled and the element (or its offset parent) is not absolute or fixed, adjust accordingly.\n if (container != null && !relativeToRoot && (container.scrollTop > 0 || container.scrollLeft > 0)) {\n var pp = el.offsetParent != null ? this.getStyle(el.offsetParent, \"position\") : \"static\",\n p = this.getStyle(el, \"position\");\n if (p !== \"absolute\" && p !== \"fixed\" && pp !== \"absolute\" && pp !== \"fixed\") {\n out.left -= container.scrollLeft;\n out.top -= container.scrollTop;\n }\n }\n return out;\n },\n //\n // return x+y proportion of the given element's size corresponding to the location of the given event.\n //\n getPositionOnElement: function (evt, el, zoom) {\n var box = typeof el.getBoundingClientRect !== \"undefined\" ? el.getBoundingClientRect() : { left: 0, top: 0, width: 0, height: 0 },\n body = document.body,\n docElem = document.documentElement,\n scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop,\n scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft,\n clientTop = docElem.clientTop || body.clientTop || 0,\n clientLeft = docElem.clientLeft || body.clientLeft || 0,\n pst = 0,\n psl = 0,\n top = box.top + scrollTop - clientTop + (pst * zoom),\n left = box.left + scrollLeft - clientLeft + (psl * zoom),\n cl = jsPlumb.pageLocation(evt),\n w = box.width || (el.offsetWidth * zoom),\n h = box.height || (el.offsetHeight * zoom),\n x = (cl[0] - left) / w,\n y = (cl[1] - top) / h;\n\n return [ x, y ];\n },\n\n /**\n * Gets the absolute position of some element as read from the left/top properties in its style.\n * @method getAbsolutePosition\n * @param {Element} el The element to retrieve the absolute coordinates from. **Note** this is a DOM element, not a selector from the underlying library.\n * @return {Number[]} [left, top] pixel values.\n */\n getAbsolutePosition: function (el) {\n var _one = function (s) {\n var ss = el.style[s];\n if (ss) {\n return parseFloat(ss.substring(0, ss.length - 2));\n }\n };\n return [ _one(\"left\"), _one(\"top\") ];\n },\n\n /**\n * Sets the absolute position of some element by setting the left/top properties in its style.\n * @method setAbsolutePosition\n * @param {Element} el The element to set the absolute coordinates on. **Note** this is a DOM element, not a selector from the underlying library.\n * @param {Number[]} xy x and y coordinates\n * @param {Number[]} [animateFrom] Optional previous xy to animate from.\n * @param {Object} [animateOptions] Options for the animation.\n */\n setAbsolutePosition: function (el, xy, animateFrom, animateOptions) {\n if (animateFrom) {\n this.animate(el, {\n left: \"+=\" + (xy[0] - animateFrom[0]),\n top: \"+=\" + (xy[1] - animateFrom[1])\n }, animateOptions);\n }\n else {\n el.style.left = xy[0] + \"px\";\n el.style.top = xy[1] + \"px\";\n }\n },\n /**\n * gets the size for the element, in an array : [ width, height ].\n */\n getSize: function (el) {\n return [ el.offsetWidth, el.offsetHeight ];\n },\n getWidth: function (el) {\n return el.offsetWidth;\n },\n getHeight: function (el) {\n return el.offsetHeight;\n },\n getRenderMode : function() { return \"svg\"; },\n draggable : function (el, options) {\n var info;\n el = _ju.isArray(el) || (el.length != null && !_ju.isString(el)) ? el: [ el ];\n Array.prototype.slice.call(el).forEach(function(_el) {\n info = this.info(_el);\n if (info.el) {\n this._initDraggableIfNecessary(info.el, true, options, info.id, true);\n }\n }.bind(this));\n return this;\n },\n initDraggable: function (el, options, category) {\n _getDragManager(this, category).draggable(el, options);\n el._jsPlumbDragOptions = options;\n },\n destroyDraggable: function (el, category) {\n _getDragManager(this, category).destroyDraggable(el);\n delete el._jsPlumbDragOptions;\n },\n unbindDraggable: function (el, evt, fn, category) {\n _getDragManager(this, category).destroyDraggable(el, evt, fn);\n },\n setDraggable : function (element, draggable) {\n return jsPlumb.each(element, function (el) {\n if (this.isDragSupported(el)) {\n this._draggableStates[this.getAttribute(el, \"id\")] = draggable;\n this.setElementDraggable(el, draggable);\n }\n }.bind(this));\n },\n _draggableStates : {},\n /*\n * toggles the draggable state of the given element(s).\n * el is either an id, or an element object, or a list of ids/element objects.\n */\n toggleDraggable : function (el) {\n var state;\n jsPlumb.each(el, function (el) {\n var elId = this.getAttribute(el, \"id\");\n state = this._draggableStates[elId] == null ? false : this._draggableStates[elId];\n state = !state;\n this._draggableStates[elId] = state;\n this.setDraggable(el, state);\n return state;\n }.bind(this));\n return state;\n },\n _initDraggableIfNecessary : function (element, isDraggable, dragOptions, id, fireEvent) {\n // TODO FIRST: move to DragManager. including as much of the decision to init dragging as possible.\n if (!jsPlumb.headless) {\n var _draggable = isDraggable == null ? false : isDraggable;\n if (_draggable) {\n if (jsPlumb.isDragSupported(element, this)) {\n var options = dragOptions || this.Defaults.DragOptions;\n options = jsPlumb.extend({}, options); // make a copy.\n if (!jsPlumb.isAlreadyDraggable(element, this)) {\n var dragEvent = jsPlumb.dragEvents.drag,\n stopEvent = jsPlumb.dragEvents.stop,\n startEvent = jsPlumb.dragEvents.start;\n\n this.manage(id, element);\n\n options[startEvent] = _ju.wrap(options[startEvent], _dragStart.bind(this));\n\n options[dragEvent] = _ju.wrap(options[dragEvent], _dragMove.bind(this));\n\n options[stopEvent] = _ju.wrap(options[stopEvent], _dragStop.bind(this));\n\n var elId = this.getId(element); // need ID\n\n this._draggableStates[elId] = true;\n var draggable = this._draggableStates[elId];\n\n options.disabled = draggable == null ? false : !draggable;\n this.initDraggable(element, options);\n this.getDragManager().register(element);\n if (fireEvent) {\n this.fire(\"elementDraggable\", {el:element, options:options});\n }\n }\n else {\n // already draggable. attach any start, drag or stop listeners to the current Drag.\n if (dragOptions.force) {\n this.initDraggable(element, options);\n }\n }\n }\n }\n }\n },\n animationSupported:true,\n getElement: function (el) {\n if (el == null) {\n return null;\n }\n // here we pluck the first entry if el was a list of entries.\n // this is not my favourite thing to do, but previous versions of\n // jsplumb supported jquery selectors, and it is possible a selector\n // will be passed in here.\n el = typeof el === \"string\" ? el : el.length != null && el.enctype == null ? el[0] : el;\n return typeof el === \"string\" ? document.getElementById(el) : el;\n },\n removeElement: function (element) {\n _getDragManager(this).elementRemoved(element);\n this.getEventManager().remove(element);\n },\n //\n // this adapter supports a rudimentary animation function. no easing is supported. only\n // left/top properties are supported. property delta args are expected to be in the form\n //\n // +=x.xxxx\n //\n // or\n //\n // -=x.xxxx\n //\n doAnimate: function (el, properties, options) {\n options = options || {};\n var o = this.getOffset(el),\n ap = _animProps(o, properties),\n ldist = ap[0] - o.left,\n tdist = ap[1] - o.top,\n d = options.duration || 250,\n step = 15, steps = d / step,\n linc = (step / d) * ldist,\n tinc = (step / d) * tdist,\n idx = 0,\n _int = setInterval(function () {\n _jp.setPosition(el, {\n left: o.left + (linc * (idx + 1)),\n top: o.top + (tinc * (idx + 1))\n });\n if (options.step != null) {\n options.step(idx, Math.ceil(steps));\n }\n idx++;\n if (idx >= steps) {\n window.clearInterval(_int);\n if (options.complete != null) {\n options.complete();\n }\n }\n }, step);\n },\n // DRAG/DROP\n\n\n destroyDroppable: function (el, category) {\n _getDragManager(this, category).destroyDroppable(el);\n },\n unbindDroppable: function (el, evt, fn, category) {\n _getDragManager(this, category).destroyDroppable(el, evt, fn);\n },\n\n droppable :function(el, options) {\n el = _ju.isArray(el) || (el.length != null && !_ju.isString(el)) ? el: [ el ];\n var info;\n options = options || {};\n options.allowLoopback = false;\n Array.prototype.slice.call(el).forEach(function(_el) {\n info = this.info(_el);\n if (info.el) {\n this.initDroppable(info.el, options);\n }\n }.bind(this));\n return this;\n },\n\n initDroppable: function (el, options, category) {\n _getDragManager(this, category).droppable(el, options);\n },\n isAlreadyDraggable: function (el) {\n return el._katavorioDrag != null;\n },\n isDragSupported: function (el, options) {\n return true;\n },\n isDropSupported: function (el, options) {\n return true;\n },\n isElementDraggable: function (el) {\n el = _jp.getElement(el);\n return el._katavorioDrag && el._katavorioDrag.isEnabled();\n },\n getDragObject: function (eventArgs) {\n return eventArgs[0].drag.getDragElement();\n },\n getDragScope: function (el) {\n return el._katavorioDrag && el._katavorioDrag.scopes.join(\" \") || \"\";\n },\n getDropEvent: function (args) {\n return args[0].e;\n },\n getUIPosition: function (eventArgs, zoom) {\n // here the position reported to us by Katavorio is relative to the element's offsetParent. For top\n // level nodes that is fine, but if we have a nested draggable then its offsetParent is actually\n // not going to be the jsplumb container; it's going to be some child of that element. In that case\n // we want to adjust the UI position to account for the offsetParent's position relative to the Container\n // origin.\n var el = eventArgs[0].el;\n if (el.offsetParent == null) {\n return null;\n }\n var finalPos = eventArgs[0].finalPos || eventArgs[0].pos;\n var p = { left:finalPos[0], top:finalPos[1] };\n if (el._katavorioDrag && el.offsetParent !== this.getContainer()) {\n var oc = this.getOffset(el.offsetParent);\n p.left += oc.left;\n p.top += oc.top;\n }\n return p;\n },\n setDragFilter: function (el, filter, _exclude) {\n if (el._katavorioDrag) {\n el._katavorioDrag.setFilter(filter, _exclude);\n }\n },\n setElementDraggable: function (el, draggable) {\n el = _jp.getElement(el);\n if (el._katavorioDrag) {\n el._katavorioDrag.setEnabled(draggable);\n }\n },\n setDragScope: function (el, scope) {\n if (el._katavorioDrag) {\n el._katavorioDrag.k.setDragScope(el, scope);\n }\n },\n setDropScope:function(el, scope) {\n if (el._katavorioDrop && el._katavorioDrop.length > 0) {\n el._katavorioDrop[0].k.setDropScope(el, scope);\n }\n },\n addToPosse:function(el, spec) {\n var specs = Array.prototype.slice.call(arguments, 1);\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) {\n _el = [ _jp.getElement(_el) ];\n _el.push.apply(_el, specs );\n dm.addToPosse.apply(dm, _el);\n });\n },\n setPosse:function(el, spec) {\n var specs = Array.prototype.slice.call(arguments, 1);\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) {\n _el = [ _jp.getElement(_el) ];\n _el.push.apply(_el, specs );\n dm.setPosse.apply(dm, _el);\n });\n },\n removeFromPosse:function(el, posseId) {\n var specs = Array.prototype.slice.call(arguments, 1);\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) {\n _el = [ _jp.getElement(_el) ];\n _el.push.apply(_el, specs );\n dm.removeFromPosse.apply(dm, _el);\n });\n },\n removeFromAllPosses:function(el) {\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) { dm.removeFromAllPosses(_jp.getElement(_el)); });\n },\n setPosseState:function(el, posseId, state) {\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) { dm.setPosseState(_jp.getElement(_el), posseId, state); });\n },\n dragEvents: {\n 'start': 'start', 'stop': 'stop', 'drag': 'drag', 'step': 'step',\n 'over': 'over', 'out': 'out', 'drop': 'drop', 'complete': 'complete',\n 'beforeStart':'beforeStart'\n },\n animEvents: {\n 'step': \"step\", 'complete': 'complete'\n },\n stopDrag: function (el) {\n if (el._katavorioDrag) {\n el._katavorioDrag.abort();\n }\n },\n addToDragSelection: function (spec) {\n _getDragManager(this).select(spec);\n },\n removeFromDragSelection: function (spec) {\n _getDragManager(this).deselect(spec);\n },\n clearDragSelection: function () {\n _getDragManager(this).deselectAll();\n },\n trigger: function (el, event, originalEvent, payload) {\n this.getEventManager().trigger(el, event, originalEvent, payload);\n },\n doReset:function() {\n // look for katavorio instances and reset each one if found.\n for (var key in this) {\n if (key.indexOf(\"_katavorio_\") === 0) {\n this[key].reset();\n }\n }\n },\n getEventManager:function() {\n return _getEventManager(this);\n },\n on : function(el, event, callback) {\n // TODO: here we would like to map the tap event if we know its\n // an internal bind to a click. we have to know its internal because only\n // then can we be sure that the UP event wont be consumed (tap is a synthesized\n // event from a mousedown followed by a mouseup).\n //event = { \"click\":\"tap\", \"dblclick\":\"dbltap\"}[event] || event;\n this.getEventManager().on.apply(this, arguments);\n return this;\n },\n off : function(el, event, callback) {\n this.getEventManager().off.apply(this, arguments);\n return this;\n }\n\n });\n\n var ready = function (f) {\n var _do = function () {\n if (/complete|loaded|interactive/.test(document.readyState) && typeof(document.body) !== \"undefined\" && document.body != null) {\n f();\n }\n else {\n setTimeout(_do, 9);\n }\n };\n\n _do();\n };\n ready(_jp.init);\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/jsplumb/dist/js/jsplumb.js\n// module id = 721\n// module chunks = 3 4 5","\nimport i18n from '@/module/i18n'\n\n/**\n * cycle\n */\nconst cycleList = [\n {\n value: 'month',\n label: `${i18n.$t('月')}`\n },\n {\n value: 'week',\n label: `${i18n.$t('周')}`\n },\n {\n value: 'day',\n label: `${i18n.$t('日')}`\n },\n {\n value: 'hour',\n label: `${i18n.$t('时')}`\n }\n]\n\n/**\n * cycle value\n */\nconst dateValueList = {\n 'hour': [\n {\n value: 'last1Hour',\n label: `${i18n.$t('前1小时')}`\n },\n {\n value: 'last2Hours',\n label: `${i18n.$t('前2小时')}`\n },\n {\n value: 'last3Hours',\n label: `${i18n.$t('前3小时')}`\n }\n ],\n 'day': [\n {\n value: 'last1Days',\n label: `${i18n.$t('昨天')}`\n },\n {\n value: 'last2Days',\n label: `${i18n.$t('前两天')}`\n },\n {\n value: 'last3Days',\n label: `${i18n.$t('前三天')}`\n },\n {\n value: 'last7Days',\n label: `${i18n.$t('前七天')}`\n }\n ],\n 'week': [\n {\n value: 'lastWeek',\n label: `${i18n.$t('上周')}`\n },\n {\n value: 'lastMonday',\n label: `${i18n.$t('上周一')}`\n },\n {\n value: 'lastTuesday',\n label: `${i18n.$t('上周二')}`\n },\n {\n value: 'lastWednesday',\n label: `${i18n.$t('上周三')}`\n },\n {\n value: 'lastThursday',\n label: `${i18n.$t('上周四')}`\n },\n {\n value: 'lastFriday',\n label: `${i18n.$t('上周五')}`\n },\n {\n value: 'lastSaturday',\n label: `${i18n.$t('上周六')}`\n },\n {\n value: 'lastSunday',\n label: `${i18n.$t('上周日')}`\n }\n ],\n 'month': [\n {\n value: 'lastMonth',\n label: `${i18n.$t('上月')}`\n },\n {\n value: 'lastMonthBegin',\n label: `${i18n.$t('上月初')}`\n },\n {\n value: 'lastMonthEnd',\n label: `${i18n.$t('上月末')}`\n }\n ]\n}\n\n/**\n * direct\n */\nconst directList = [\n {\n id: 1,\n code: 'IN',\n disabled: false\n },\n {\n id: 2,\n code: 'OUT',\n disabled: false\n }\n]\n\n/**\n * type\n */\nconst typeList = [\n {\n id: 1,\n code: 'VARCHAR',\n disabled: false\n },\n {\n id: 2,\n code: 'INTEGER',\n disabled: false\n },\n {\n id: 3,\n code: 'LONG',\n disabled: false\n },\n {\n id: 4,\n code: 'FLOAT',\n disabled: false\n },\n {\n id: 5,\n code: 'DOUBLE',\n disabled: false\n },\n {\n id: 6,\n code: 'DATE',\n disabled: false\n },\n {\n id: 7,\n code: 'TIME',\n disabled: false\n },\n {\n id: 8,\n code: 'TIMESTAMP',\n disabled: false\n },\n {\n id: 9,\n code: 'BOOLEAN',\n disabled: false\n }\n]\n\n/**\n * sqlType\n */\nconst sqlTypeList = [\n {\n id: 0,\n code: `${i18n.$t('查询')}`\n },\n {\n id: 1,\n code: `${i18n.$t('非查询')}`\n }\n]\n\nexport {\n cycleList,\n dateValueList,\n typeList,\n directList,\n sqlTypeList\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/formModel/tasks/_source/commcon.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/log.vue","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var HINT_ELEMENT_CLASS = \"CodeMirror-hint\";\n var ACTIVE_HINT_ELEMENT_CLASS = \"CodeMirror-hint-active\";\n\n // This is the old interface, kept around for now to stay\n // backwards-compatible.\n CodeMirror.showHint = function(cm, getHints, options) {\n if (!getHints) return cm.showHint(options);\n if (options && options.async) getHints.async = true;\n var newOpts = {hint: getHints};\n if (options) for (var prop in options) newOpts[prop] = options[prop];\n return cm.showHint(newOpts);\n };\n\n CodeMirror.defineExtension(\"showHint\", function(options) {\n options = parseOptions(this, this.getCursor(\"start\"), options);\n var selections = this.listSelections()\n if (selections.length > 1) return;\n // By default, don't allow completion when something is selected.\n // A hint function can have a `supportsSelection` property to\n // indicate that it can handle selections.\n if (this.somethingSelected()) {\n if (!options.hint.supportsSelection) return;\n // Don't try with cross-line selections\n for (var i = 0; i < selections.length; i++)\n if (selections[i].head.line != selections[i].anchor.line) return;\n }\n\n if (this.state.completionActive) this.state.completionActive.close();\n var completion = this.state.completionActive = new Completion(this, options);\n if (!completion.options.hint) return;\n\n CodeMirror.signal(this, \"startCompletion\", this);\n completion.update(true);\n });\n\n CodeMirror.defineExtension(\"closeHint\", function() {\n if (this.state.completionActive) this.state.completionActive.close()\n })\n\n function Completion(cm, options) {\n this.cm = cm;\n this.options = options;\n this.widget = null;\n this.debounce = 0;\n this.tick = 0;\n this.startPos = this.cm.getCursor(\"start\");\n this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length;\n\n var self = this;\n cm.on(\"cursorActivity\", this.activityFunc = function() { self.cursorActivity(); });\n }\n\n var requestAnimationFrame = window.requestAnimationFrame || function(fn) {\n return setTimeout(fn, 1000/60);\n };\n var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;\n\n Completion.prototype = {\n close: function() {\n if (!this.active()) return;\n this.cm.state.completionActive = null;\n this.tick = null;\n this.cm.off(\"cursorActivity\", this.activityFunc);\n\n if (this.widget && this.data) CodeMirror.signal(this.data, \"close\");\n if (this.widget) this.widget.close();\n CodeMirror.signal(this.cm, \"endCompletion\", this.cm);\n },\n\n active: function() {\n return this.cm.state.completionActive == this;\n },\n\n pick: function(data, i) {\n var completion = data.list[i];\n if (completion.hint) completion.hint(this.cm, data, completion);\n else this.cm.replaceRange(getText(completion), completion.from || data.from,\n completion.to || data.to, \"complete\");\n CodeMirror.signal(data, \"pick\", completion);\n this.close();\n },\n\n cursorActivity: function() {\n if (this.debounce) {\n cancelAnimationFrame(this.debounce);\n this.debounce = 0;\n }\n\n var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line);\n if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch ||\n pos.ch < this.startPos.ch || this.cm.somethingSelected() ||\n (!pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {\n this.close();\n } else {\n var self = this;\n this.debounce = requestAnimationFrame(function() {self.update();});\n if (this.widget) this.widget.disable();\n }\n },\n\n update: function(first) {\n if (this.tick == null) return\n var self = this, myTick = ++this.tick\n fetchHints(this.options.hint, this.cm, this.options, function(data) {\n if (self.tick == myTick) self.finishUpdate(data, first)\n })\n },\n\n finishUpdate: function(data, first) {\n if (this.data) CodeMirror.signal(this.data, \"update\");\n\n var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);\n if (this.widget) this.widget.close();\n\n this.data = data;\n\n if (data && data.list.length) {\n if (picked && data.list.length == 1) {\n this.pick(data, 0);\n } else {\n this.widget = new Widget(this, data);\n CodeMirror.signal(data, \"shown\");\n }\n }\n }\n };\n\n function parseOptions(cm, pos, options) {\n var editor = cm.options.hintOptions;\n var out = {};\n for (var prop in defaultOptions) out[prop] = defaultOptions[prop];\n if (editor) for (var prop in editor)\n if (editor[prop] !== undefined) out[prop] = editor[prop];\n if (options) for (var prop in options)\n if (options[prop] !== undefined) out[prop] = options[prop];\n if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos)\n return out;\n }\n\n function getText(completion) {\n if (typeof completion == \"string\") return completion;\n else return completion.text;\n }\n\n function buildKeyMap(completion, handle) {\n var baseMap = {\n Up: function() {handle.moveFocus(-1);},\n Down: function() {handle.moveFocus(1);},\n PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);},\n PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);},\n Home: function() {handle.setFocus(0);},\n End: function() {handle.setFocus(handle.length - 1);},\n Enter: handle.pick,\n Tab: handle.pick,\n Esc: handle.close\n };\n\n var mac = /Mac/.test(navigator.platform);\n\n if (mac) {\n baseMap[\"Ctrl-P\"] = function() {handle.moveFocus(-1);};\n baseMap[\"Ctrl-N\"] = function() {handle.moveFocus(1);};\n }\n\n var custom = completion.options.customKeys;\n var ourMap = custom ? {} : baseMap;\n function addBinding(key, val) {\n var bound;\n if (typeof val != \"string\")\n bound = function(cm) { return val(cm, handle); };\n // This mechanism is deprecated\n else if (baseMap.hasOwnProperty(val))\n bound = baseMap[val];\n else\n bound = val;\n ourMap[key] = bound;\n }\n if (custom)\n for (var key in custom) if (custom.hasOwnProperty(key))\n addBinding(key, custom[key]);\n var extra = completion.options.extraKeys;\n if (extra)\n for (var key in extra) if (extra.hasOwnProperty(key))\n addBinding(key, extra[key]);\n return ourMap;\n }\n\n function getHintElement(hintsElement, el) {\n while (el && el != hintsElement) {\n if (el.nodeName.toUpperCase() === \"LI\" && el.parentNode == hintsElement) return el;\n el = el.parentNode;\n }\n }\n\n function Widget(completion, data) {\n this.completion = completion;\n this.data = data;\n this.picked = false;\n var widget = this, cm = completion.cm;\n var ownerDocument = cm.getInputField().ownerDocument;\n var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow;\n\n var hints = this.hints = ownerDocument.createElement(\"ul\");\n var theme = completion.cm.options.theme;\n hints.className = \"CodeMirror-hints \" + theme;\n this.selectedHint = data.selectedHint || 0;\n\n var completions = data.list;\n for (var i = 0; i < completions.length; ++i) {\n var elt = hints.appendChild(ownerDocument.createElement(\"li\")), cur = completions[i];\n var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? \"\" : \" \" + ACTIVE_HINT_ELEMENT_CLASS);\n if (cur.className != null) className = cur.className + \" \" + className;\n elt.className = className;\n if (cur.render) cur.render(elt, data, cur);\n else elt.appendChild(ownerDocument.createTextNode(cur.displayText || getText(cur)));\n elt.hintId = i;\n }\n\n var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);\n var left = pos.left, top = pos.bottom, below = true;\n hints.style.left = left + \"px\";\n hints.style.top = top + \"px\";\n // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.\n var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth);\n var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight);\n (completion.options.container || ownerDocument.body).appendChild(hints);\n var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH;\n var scrolls = hints.scrollHeight > hints.clientHeight + 1\n var startScroll = cm.getScrollInfo();\n\n if (overlapY > 0) {\n var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);\n if (curTop - height > 0) { // Fits above cursor\n hints.style.top = (top = pos.top - height) + \"px\";\n below = false;\n } else if (height > winH) {\n hints.style.height = (winH - 5) + \"px\";\n hints.style.top = (top = pos.bottom - box.top) + \"px\";\n var cursor = cm.getCursor();\n if (data.from.ch != cursor.ch) {\n pos = cm.cursorCoords(cursor);\n hints.style.left = (left = pos.left) + \"px\";\n box = hints.getBoundingClientRect();\n }\n }\n }\n var overlapX = box.right - winW;\n if (overlapX > 0) {\n if (box.right - box.left > winW) {\n hints.style.width = (winW - 5) + \"px\";\n overlapX -= (box.right - box.left) - winW;\n }\n hints.style.left = (left = pos.left - overlapX) + \"px\";\n }\n if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling)\n node.style.paddingRight = cm.display.nativeBarWidth + \"px\"\n\n cm.addKeyMap(this.keyMap = buildKeyMap(completion, {\n moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },\n setFocus: function(n) { widget.changeActive(n); },\n menuSize: function() { return widget.screenAmount(); },\n length: completions.length,\n close: function() { completion.close(); },\n pick: function() { widget.pick(); },\n data: data\n }));\n\n if (completion.options.closeOnUnfocus) {\n var closingOnBlur;\n cm.on(\"blur\", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });\n cm.on(\"focus\", this.onFocus = function() { clearTimeout(closingOnBlur); });\n }\n\n cm.on(\"scroll\", this.onScroll = function() {\n var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();\n var newTop = top + startScroll.top - curScroll.top;\n var point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop);\n if (!below) point += hints.offsetHeight;\n if (point <= editor.top || point >= editor.bottom) return completion.close();\n hints.style.top = newTop + \"px\";\n hints.style.left = (left + startScroll.left - curScroll.left) + \"px\";\n });\n\n CodeMirror.on(hints, \"dblclick\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}\n });\n\n CodeMirror.on(hints, \"click\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {\n widget.changeActive(t.hintId);\n if (completion.options.completeOnSingleClick) widget.pick();\n }\n });\n\n CodeMirror.on(hints, \"mousedown\", function() {\n setTimeout(function(){cm.focus();}, 20);\n });\n\n CodeMirror.signal(data, \"select\", completions[this.selectedHint], hints.childNodes[this.selectedHint]);\n return true;\n }\n\n Widget.prototype = {\n close: function() {\n if (this.completion.widget != this) return;\n this.completion.widget = null;\n this.hints.parentNode.removeChild(this.hints);\n this.completion.cm.removeKeyMap(this.keyMap);\n\n var cm = this.completion.cm;\n if (this.completion.options.closeOnUnfocus) {\n cm.off(\"blur\", this.onBlur);\n cm.off(\"focus\", this.onFocus);\n }\n cm.off(\"scroll\", this.onScroll);\n },\n\n disable: function() {\n this.completion.cm.removeKeyMap(this.keyMap);\n var widget = this;\n this.keyMap = {Enter: function() { widget.picked = true; }};\n this.completion.cm.addKeyMap(this.keyMap);\n },\n\n pick: function() {\n this.completion.pick(this.data, this.selectedHint);\n },\n\n changeActive: function(i, avoidWrap) {\n if (i >= this.data.list.length)\n i = avoidWrap ? this.data.list.length - 1 : 0;\n else if (i < 0)\n i = avoidWrap ? 0 : this.data.list.length - 1;\n if (this.selectedHint == i) return;\n var node = this.hints.childNodes[this.selectedHint];\n if (node) node.className = node.className.replace(\" \" + ACTIVE_HINT_ELEMENT_CLASS, \"\");\n node = this.hints.childNodes[this.selectedHint = i];\n node.className += \" \" + ACTIVE_HINT_ELEMENT_CLASS;\n if (node.offsetTop < this.hints.scrollTop)\n this.hints.scrollTop = node.offsetTop - 3;\n else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)\n this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3;\n CodeMirror.signal(this.data, \"select\", this.data.list[this.selectedHint], node);\n },\n\n screenAmount: function() {\n return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;\n }\n };\n\n function applicableHelpers(cm, helpers) {\n if (!cm.somethingSelected()) return helpers\n var result = []\n for (var i = 0; i < helpers.length; i++)\n if (helpers[i].supportsSelection) result.push(helpers[i])\n return result\n }\n\n function fetchHints(hint, cm, options, callback) {\n if (hint.async) {\n hint(cm, callback, options)\n } else {\n var result = hint(cm, options)\n if (result && result.then) result.then(callback)\n else callback(result)\n }\n }\n\n function resolveAutoHints(cm, pos) {\n var helpers = cm.getHelpers(pos, \"hint\"), words\n if (helpers.length) {\n var resolved = function(cm, callback, options) {\n var app = applicableHelpers(cm, helpers);\n function run(i) {\n if (i == app.length) return callback(null)\n fetchHints(app[i], cm, options, function(result) {\n if (result && result.list.length > 0) callback(result)\n else run(i + 1)\n })\n }\n run(0)\n }\n resolved.async = true\n resolved.supportsSelection = true\n return resolved\n } else if (words = cm.getHelper(cm.getCursor(), \"hintWords\")) {\n return function(cm) { return CodeMirror.hint.fromList(cm, {words: words}) }\n } else if (CodeMirror.hint.anyword) {\n return function(cm, options) { return CodeMirror.hint.anyword(cm, options) }\n } else {\n return function() {}\n }\n }\n\n CodeMirror.registerHelper(\"hint\", \"auto\", {\n resolve: resolveAutoHints\n });\n\n CodeMirror.registerHelper(\"hint\", \"fromList\", function(cm, options) {\n var cur = cm.getCursor(), token = cm.getTokenAt(cur)\n var term, from = CodeMirror.Pos(cur.line, token.start), to = cur\n if (token.start < cur.ch && /\\w/.test(token.string.charAt(cur.ch - token.start - 1))) {\n term = token.string.substr(0, cur.ch - token.start)\n } else {\n term = \"\"\n from = cur\n }\n var found = [];\n for (var i = 0; i < options.words.length; i++) {\n var word = options.words[i];\n if (word.slice(0, term.length) == term)\n found.push(word);\n }\n\n if (found.length) return {list: found, from: from, to: to};\n });\n\n CodeMirror.commands.autocomplete = CodeMirror.showHint;\n\n var defaultOptions = {\n hint: CodeMirror.hint.auto,\n completeSingle: true,\n alignWithWord: true,\n closeCharacters: /[\\s()\\[\\]{};:>,]/,\n closeOnUnfocus: true,\n completeOnSingleClick: true,\n container: null,\n customKeys: null,\n extraKeys: null\n };\n\n CodeMirror.defineOption(\"hintOptions\", null);\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/addon/hint/show-hint.js\n// module id = 725\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"../../mode/sql/sql\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"../../mode/sql/sql\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var tables;\n var defaultTable;\n var keywords;\n var identifierQuote;\n var CONS = {\n QUERY_DIV: \";\",\n ALIAS_KEYWORD: \"AS\"\n };\n var Pos = CodeMirror.Pos, cmpPos = CodeMirror.cmpPos;\n\n function isArray(val) { return Object.prototype.toString.call(val) == \"[object Array]\" }\n\n function getKeywords(editor) {\n var mode = editor.doc.modeOption;\n if (mode === \"sql\") mode = \"text/x-sql\";\n return CodeMirror.resolveMode(mode).keywords;\n }\n\n function getIdentifierQuote(editor) {\n var mode = editor.doc.modeOption;\n if (mode === \"sql\") mode = \"text/x-sql\";\n return CodeMirror.resolveMode(mode).identifierQuote || \"`\";\n }\n\n function getText(item) {\n return typeof item == \"string\" ? item : item.text;\n }\n\n function wrapTable(name, value) {\n if (isArray(value)) value = {columns: value}\n if (!value.text) value.text = name\n return value\n }\n\n function parseTables(input) {\n var result = {}\n if (isArray(input)) {\n for (var i = input.length - 1; i >= 0; i--) {\n var item = input[i]\n result[getText(item).toUpperCase()] = wrapTable(getText(item), item)\n }\n } else if (input) {\n for (var name in input)\n result[name.toUpperCase()] = wrapTable(name, input[name])\n }\n return result\n }\n\n function getTable(name) {\n return tables[name.toUpperCase()]\n }\n\n function shallowClone(object) {\n var result = {};\n for (var key in object) if (object.hasOwnProperty(key))\n result[key] = object[key];\n return result;\n }\n\n function match(string, word) {\n var len = string.length;\n var sub = getText(word).substr(0, len);\n return string.toUpperCase() === sub.toUpperCase();\n }\n\n function addMatches(result, search, wordlist, formatter) {\n if (isArray(wordlist)) {\n for (var i = 0; i < wordlist.length; i++)\n if (match(search, wordlist[i])) result.push(formatter(wordlist[i]))\n } else {\n for (var word in wordlist) if (wordlist.hasOwnProperty(word)) {\n var val = wordlist[word]\n if (!val || val === true)\n val = word\n else\n val = val.displayText ? {text: val.text, displayText: val.displayText} : val.text\n if (match(search, val)) result.push(formatter(val))\n }\n }\n }\n\n function cleanName(name) {\n // Get rid name from identifierQuote and preceding dot(.)\n if (name.charAt(0) == \".\") {\n name = name.substr(1);\n }\n // replace doublicated identifierQuotes with single identifierQuotes\n // and remove single identifierQuotes\n var nameParts = name.split(identifierQuote+identifierQuote);\n for (var i = 0; i < nameParts.length; i++)\n nameParts[i] = nameParts[i].replace(new RegExp(identifierQuote,\"g\"), \"\");\n return nameParts.join(identifierQuote);\n }\n\n function insertIdentifierQuotes(name) {\n var nameParts = getText(name).split(\".\");\n for (var i = 0; i < nameParts.length; i++)\n nameParts[i] = identifierQuote +\n // doublicate identifierQuotes\n nameParts[i].replace(new RegExp(identifierQuote,\"g\"), identifierQuote+identifierQuote) +\n identifierQuote;\n var escaped = nameParts.join(\".\");\n if (typeof name == \"string\") return escaped;\n name = shallowClone(name);\n name.text = escaped;\n return name;\n }\n\n function nameCompletion(cur, token, result, editor) {\n // Try to complete table, column names and return start position of completion\n var useIdentifierQuotes = false;\n var nameParts = [];\n var start = token.start;\n var cont = true;\n while (cont) {\n cont = (token.string.charAt(0) == \".\");\n useIdentifierQuotes = useIdentifierQuotes || (token.string.charAt(0) == identifierQuote);\n\n start = token.start;\n nameParts.unshift(cleanName(token.string));\n\n token = editor.getTokenAt(Pos(cur.line, token.start));\n if (token.string == \".\") {\n cont = true;\n token = editor.getTokenAt(Pos(cur.line, token.start));\n }\n }\n\n // Try to complete table names\n var string = nameParts.join(\".\");\n addMatches(result, string, tables, function(w) {\n return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;\n });\n\n // Try to complete columns from defaultTable\n addMatches(result, string, defaultTable, function(w) {\n return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;\n });\n\n // Try to complete columns\n string = nameParts.pop();\n var table = nameParts.join(\".\");\n\n var alias = false;\n var aliasTable = table;\n // Check if table is available. If not, find table by Alias\n if (!getTable(table)) {\n var oldTable = table;\n table = findTableByAlias(table, editor);\n if (table !== oldTable) alias = true;\n }\n\n var columns = getTable(table);\n if (columns && columns.columns)\n columns = columns.columns;\n\n if (columns) {\n addMatches(result, string, columns, function(w) {\n var tableInsert = table;\n if (alias == true) tableInsert = aliasTable;\n if (typeof w == \"string\") {\n w = tableInsert + \".\" + w;\n } else {\n w = shallowClone(w);\n w.text = tableInsert + \".\" + w.text;\n }\n return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;\n });\n }\n\n return start;\n }\n\n function eachWord(lineText, f) {\n var words = lineText.split(/\\s+/)\n for (var i = 0; i < words.length; i++)\n if (words[i]) f(words[i].replace(/[,;]/g, ''))\n }\n\n function findTableByAlias(alias, editor) {\n var doc = editor.doc;\n var fullQuery = doc.getValue();\n var aliasUpperCase = alias.toUpperCase();\n var previousWord = \"\";\n var table = \"\";\n var separator = [];\n var validRange = {\n start: Pos(0, 0),\n end: Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).length)\n };\n\n //add separator\n var indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV);\n while(indexOfSeparator != -1) {\n separator.push(doc.posFromIndex(indexOfSeparator));\n indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV, indexOfSeparator+1);\n }\n separator.unshift(Pos(0, 0));\n separator.push(Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).text.length));\n\n //find valid range\n var prevItem = null;\n var current = editor.getCursor()\n for (var i = 0; i < separator.length; i++) {\n if ((prevItem == null || cmpPos(current, prevItem) > 0) && cmpPos(current, separator[i]) <= 0) {\n validRange = {start: prevItem, end: separator[i]};\n break;\n }\n prevItem = separator[i];\n }\n\n if (validRange.start) {\n var query = doc.getRange(validRange.start, validRange.end, false);\n\n for (var i = 0; i < query.length; i++) {\n var lineText = query[i];\n eachWord(lineText, function(word) {\n var wordUpperCase = word.toUpperCase();\n if (wordUpperCase === aliasUpperCase && getTable(previousWord))\n table = previousWord;\n if (wordUpperCase !== CONS.ALIAS_KEYWORD)\n previousWord = word;\n });\n if (table) break;\n }\n }\n return table;\n }\n\n CodeMirror.registerHelper(\"hint\", \"sql\", function(editor, options) {\n tables = parseTables(options && options.tables)\n var defaultTableName = options && options.defaultTable;\n var disableKeywords = options && options.disableKeywords;\n defaultTable = defaultTableName && getTable(defaultTableName);\n keywords = getKeywords(editor);\n identifierQuote = getIdentifierQuote(editor);\n\n if (defaultTableName && !defaultTable)\n defaultTable = findTableByAlias(defaultTableName, editor);\n\n defaultTable = defaultTable || [];\n\n if (defaultTable.columns)\n defaultTable = defaultTable.columns;\n\n var cur = editor.getCursor();\n var result = [];\n var token = editor.getTokenAt(cur), start, end, search;\n if (token.end > cur.ch) {\n token.end = cur.ch;\n token.string = token.string.slice(0, cur.ch - token.start);\n }\n\n if (token.string.match(/^[.`\"\\w@]\\w*$/)) {\n search = token.string;\n start = token.start;\n end = token.end;\n } else {\n start = end = cur.ch;\n search = \"\";\n }\n if (search.charAt(0) == \".\" || search.charAt(0) == identifierQuote) {\n start = nameCompletion(cur, token, result, editor);\n } else {\n var objectOrClass = function(w, className) {\n if (typeof w === \"object\") {\n w.className = className;\n } else {\n w = { text: w, className: className };\n }\n return w;\n };\n addMatches(result, search, defaultTable, function(w) {\n return objectOrClass(w, \"CodeMirror-hint-table CodeMirror-hint-default-table\");\n });\n addMatches(\n result,\n search,\n tables, function(w) {\n return objectOrClass(w, \"CodeMirror-hint-table\");\n }\n );\n if (!disableKeywords)\n addMatches(result, search, keywords, function(w) {\n return objectOrClass(w.toUpperCase(), \"CodeMirror-hint-keyword\");\n });\n }\n\n return {list: result, from: Pos(cur.line, start), to: Pos(cur.line, end)};\n });\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/addon/hint/sql-hint.js\n// module id = 726\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var Pos = CodeMirror.Pos;\n\n function matches(hint, typed, matchInMiddle) {\n if (matchInMiddle) return hint.indexOf(typed) >= 0;\n else return hint.lastIndexOf(typed, 0) == 0;\n }\n\n function getHints(cm, options) {\n var tags = options && options.schemaInfo;\n var quote = (options && options.quoteChar) || '\"';\n var matchInMiddle = options && options.matchInMiddle;\n if (!tags) return;\n var cur = cm.getCursor(), token = cm.getTokenAt(cur);\n if (token.end > cur.ch) {\n token.end = cur.ch;\n token.string = token.string.slice(0, cur.ch - token.start);\n }\n var inner = CodeMirror.innerMode(cm.getMode(), token.state);\n if (inner.mode.name != \"xml\") return;\n var result = [], replaceToken = false, prefix;\n var tag = /\\btag\\b/.test(token.type) && !/>$/.test(token.string);\n var tagName = tag && /^\\w/.test(token.string), tagStart;\n\n if (tagName) {\n var before = cm.getLine(cur.line).slice(Math.max(0, token.start - 2), token.start);\n var tagType = /<\\/$/.test(before) ? \"close\" : /<$/.test(before) ? \"open\" : null;\n if (tagType) tagStart = token.start - (tagType == \"close\" ? 2 : 1);\n } else if (tag && token.string == \"<\") {\n tagType = \"open\";\n } else if (tag && token.string == \"\");\n } else {\n // Attribute completion\n var curTag = tags[inner.state.tagName], attrs = curTag && curTag.attrs;\n var globalAttrs = tags[\"!attrs\"];\n if (!attrs && !globalAttrs) return;\n if (!attrs) {\n attrs = globalAttrs;\n } else if (globalAttrs) { // Combine tag-local and global attributes\n var set = {};\n for (var nm in globalAttrs) if (globalAttrs.hasOwnProperty(nm)) set[nm] = globalAttrs[nm];\n for (var nm in attrs) if (attrs.hasOwnProperty(nm)) set[nm] = attrs[nm];\n attrs = set;\n }\n if (token.type == \"string\" || token.string == \"=\") { // A value\n var before = cm.getRange(Pos(cur.line, Math.max(0, cur.ch - 60)),\n Pos(cur.line, token.type == \"string\" ? token.start : token.end));\n var atName = before.match(/([^\\s\\u00a0=<>\\\"\\']+)=$/), atValues;\n if (!atName || !attrs.hasOwnProperty(atName[1]) || !(atValues = attrs[atName[1]])) return;\n if (typeof atValues == 'function') atValues = atValues.call(this, cm); // Functions can be used to supply values for autocomplete widget\n if (token.type == \"string\") {\n prefix = token.string;\n var n = 0;\n if (/['\"]/.test(token.string.charAt(0))) {\n quote = token.string.charAt(0);\n prefix = token.string.slice(1);\n n++;\n }\n var len = token.string.length;\n if (/['\"]/.test(token.string.charAt(len - 1))) {\n quote = token.string.charAt(len - 1);\n prefix = token.string.substr(n, len - 2);\n }\n replaceToken = true;\n }\n for (var i = 0; i < atValues.length; ++i) if (!prefix || matches(atValues[i], prefix, matchInMiddle))\n result.push(quote + atValues[i] + quote);\n } else { // An attribute name\n if (token.type == \"attribute\") {\n prefix = token.string;\n replaceToken = true;\n }\n for (var attr in attrs) if (attrs.hasOwnProperty(attr) && (!prefix || matches(attr, prefix, matchInMiddle)))\n result.push(attr);\n }\n }\n return {\n list: result,\n from: replaceToken ? Pos(cur.line, tagStart == null ? token.start : tagStart) : cur,\n to: replaceToken ? Pos(cur.line, token.end) : cur\n };\n }\n\n CodeMirror.registerHelper(\"hint\", \"xml\", getHints);\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/addon/hint/xml-hint.js\n// module id = 727\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n function wordRegexp(words) {\n return new RegExp(\"^((\" + words.join(\")|(\") + \"))\\\\b\");\n }\n\n var wordOperators = wordRegexp([\"and\", \"or\", \"not\", \"is\"]);\n var commonKeywords = [\"as\", \"assert\", \"break\", \"class\", \"continue\",\n \"def\", \"del\", \"elif\", \"else\", \"except\", \"finally\",\n \"for\", \"from\", \"global\", \"if\", \"import\",\n \"lambda\", \"pass\", \"raise\", \"return\",\n \"try\", \"while\", \"with\", \"yield\", \"in\"];\n var commonBuiltins = [\"abs\", \"all\", \"any\", \"bin\", \"bool\", \"bytearray\", \"callable\", \"chr\",\n \"classmethod\", \"compile\", \"complex\", \"delattr\", \"dict\", \"dir\", \"divmod\",\n \"enumerate\", \"eval\", \"filter\", \"float\", \"format\", \"frozenset\",\n \"getattr\", \"globals\", \"hasattr\", \"hash\", \"help\", \"hex\", \"id\",\n \"input\", \"int\", \"isinstance\", \"issubclass\", \"iter\", \"len\",\n \"list\", \"locals\", \"map\", \"max\", \"memoryview\", \"min\", \"next\",\n \"object\", \"oct\", \"open\", \"ord\", \"pow\", \"property\", \"range\",\n \"repr\", \"reversed\", \"round\", \"set\", \"setattr\", \"slice\",\n \"sorted\", \"staticmethod\", \"str\", \"sum\", \"super\", \"tuple\",\n \"type\", \"vars\", \"zip\", \"__import__\", \"NotImplemented\",\n \"Ellipsis\", \"__debug__\"];\n CodeMirror.registerHelper(\"hintWords\", \"python\", commonKeywords.concat(commonBuiltins));\n\n function top(state) {\n return state.scopes[state.scopes.length - 1];\n }\n\n CodeMirror.defineMode(\"python\", function(conf, parserConf) {\n var ERRORCLASS = \"error\";\n\n var delimiters = parserConf.delimiters || parserConf.singleDelimiters || /^[\\(\\)\\[\\]\\{\\}@,:`=;\\.\\\\]/;\n // (Backwards-compatiblity with old, cumbersome config system)\n var operators = [parserConf.singleOperators, parserConf.doubleOperators, parserConf.doubleDelimiters, parserConf.tripleDelimiters,\n parserConf.operators || /^([-+*/%\\/&|^]=?|[<>=]+|\\/\\/=?|\\*\\*=?|!=|[~!@])/]\n for (var i = 0; i < operators.length; i++) if (!operators[i]) operators.splice(i--, 1)\n\n var hangingIndent = parserConf.hangingIndent || conf.indentUnit;\n\n var myKeywords = commonKeywords, myBuiltins = commonBuiltins;\n if (parserConf.extra_keywords != undefined)\n myKeywords = myKeywords.concat(parserConf.extra_keywords);\n\n if (parserConf.extra_builtins != undefined)\n myBuiltins = myBuiltins.concat(parserConf.extra_builtins);\n\n var py3 = !(parserConf.version && Number(parserConf.version) < 3)\n if (py3) {\n // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator\n var identifiers = parserConf.identifiers|| /^[_A-Za-z\\u00A1-\\uFFFF][_A-Za-z0-9\\u00A1-\\uFFFF]*/;\n myKeywords = myKeywords.concat([\"nonlocal\", \"False\", \"True\", \"None\", \"async\", \"await\"]);\n myBuiltins = myBuiltins.concat([\"ascii\", \"bytes\", \"exec\", \"print\"]);\n var stringPrefixes = new RegExp(\"^(([rbuf]|(br)|(fr))?('{3}|\\\"{3}|['\\\"]))\", \"i\");\n } else {\n var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/;\n myKeywords = myKeywords.concat([\"exec\", \"print\"]);\n myBuiltins = myBuiltins.concat([\"apply\", \"basestring\", \"buffer\", \"cmp\", \"coerce\", \"execfile\",\n \"file\", \"intern\", \"long\", \"raw_input\", \"reduce\", \"reload\",\n \"unichr\", \"unicode\", \"xrange\", \"False\", \"True\", \"None\"]);\n var stringPrefixes = new RegExp(\"^(([rubf]|(ur)|(br))?('{3}|\\\"{3}|['\\\"]))\", \"i\");\n }\n var keywords = wordRegexp(myKeywords);\n var builtins = wordRegexp(myBuiltins);\n\n // tokenizers\n function tokenBase(stream, state) {\n var sol = stream.sol() && state.lastToken != \"\\\\\"\n if (sol) state.indent = stream.indentation()\n // Handle scope changes\n if (sol && top(state).type == \"py\") {\n var scopeOffset = top(state).offset;\n if (stream.eatSpace()) {\n var lineOffset = stream.indentation();\n if (lineOffset > scopeOffset)\n pushPyScope(state);\n else if (lineOffset < scopeOffset && dedent(stream, state) && stream.peek() != \"#\")\n state.errorToken = true;\n return null;\n } else {\n var style = tokenBaseInner(stream, state);\n if (scopeOffset > 0 && dedent(stream, state))\n style += \" \" + ERRORCLASS;\n return style;\n }\n }\n return tokenBaseInner(stream, state);\n }\n\n function tokenBaseInner(stream, state) {\n if (stream.eatSpace()) return null;\n\n // Handle Comments\n if (stream.match(/^#.*/)) return \"comment\";\n\n // Handle Number Literals\n if (stream.match(/^[0-9\\.]/, false)) {\n var floatLiteral = false;\n // Floats\n if (stream.match(/^[\\d_]*\\.\\d+(e[\\+\\-]?\\d+)?/i)) { floatLiteral = true; }\n if (stream.match(/^[\\d_]+\\.\\d*/)) { floatLiteral = true; }\n if (stream.match(/^\\.\\d+/)) { floatLiteral = true; }\n if (floatLiteral) {\n // Float literals may be \"imaginary\"\n stream.eat(/J/i);\n return \"number\";\n }\n // Integers\n var intLiteral = false;\n // Hex\n if (stream.match(/^0x[0-9a-f_]+/i)) intLiteral = true;\n // Binary\n if (stream.match(/^0b[01_]+/i)) intLiteral = true;\n // Octal\n if (stream.match(/^0o[0-7_]+/i)) intLiteral = true;\n // Decimal\n if (stream.match(/^[1-9][\\d_]*(e[\\+\\-]?[\\d_]+)?/)) {\n // Decimal literals may be \"imaginary\"\n stream.eat(/J/i);\n // TODO - Can you have imaginary longs?\n intLiteral = true;\n }\n // Zero by itself with no other piece of number.\n if (stream.match(/^0(?![\\dx])/i)) intLiteral = true;\n if (intLiteral) {\n // Integer literals may be \"long\"\n stream.eat(/L/i);\n return \"number\";\n }\n }\n\n // Handle Strings\n if (stream.match(stringPrefixes)) {\n var isFmtString = stream.current().toLowerCase().indexOf('f') !== -1;\n if (!isFmtString) {\n state.tokenize = tokenStringFactory(stream.current(), state.tokenize);\n return state.tokenize(stream, state);\n } else {\n state.tokenize = formatStringFactory(stream.current(), state.tokenize);\n return state.tokenize(stream, state);\n }\n }\n\n for (var i = 0; i < operators.length; i++)\n if (stream.match(operators[i])) return \"operator\"\n\n if (stream.match(delimiters)) return \"punctuation\";\n\n if (state.lastToken == \".\" && stream.match(identifiers))\n return \"property\";\n\n if (stream.match(keywords) || stream.match(wordOperators))\n return \"keyword\";\n\n if (stream.match(builtins))\n return \"builtin\";\n\n if (stream.match(/^(self|cls)\\b/))\n return \"variable-2\";\n\n if (stream.match(identifiers)) {\n if (state.lastToken == \"def\" || state.lastToken == \"class\")\n return \"def\";\n return \"variable\";\n }\n\n // Handle non-detected items\n stream.next();\n return ERRORCLASS;\n }\n\n function formatStringFactory(delimiter, tokenOuter) {\n while (\"rubf\".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)\n delimiter = delimiter.substr(1);\n\n var singleline = delimiter.length == 1;\n var OUTCLASS = \"string\";\n\n function tokenNestedExpr(depth) {\n return function(stream, state) {\n var inner = tokenBaseInner(stream, state)\n if (inner == \"punctuation\") {\n if (stream.current() == \"{\") {\n state.tokenize = tokenNestedExpr(depth + 1)\n } else if (stream.current() == \"}\") {\n if (depth > 1) state.tokenize = tokenNestedExpr(depth - 1)\n else state.tokenize = tokenString\n }\n }\n return inner\n }\n }\n\n function tokenString(stream, state) {\n while (!stream.eol()) {\n stream.eatWhile(/[^'\"\\{\\}\\\\]/);\n if (stream.eat(\"\\\\\")) {\n stream.next();\n if (singleline && stream.eol())\n return OUTCLASS;\n } else if (stream.match(delimiter)) {\n state.tokenize = tokenOuter;\n return OUTCLASS;\n } else if (stream.match('{{')) {\n // ignore {{ in f-str\n return OUTCLASS;\n } else if (stream.match('{', false)) {\n // switch to nested mode\n state.tokenize = tokenNestedExpr(0)\n if (stream.current()) return OUTCLASS;\n else return state.tokenize(stream, state)\n } else if (stream.match('}}')) {\n return OUTCLASS;\n } else if (stream.match('}')) {\n // single } in f-string is an error\n return ERRORCLASS;\n } else {\n stream.eat(/['\"]/);\n }\n }\n if (singleline) {\n if (parserConf.singleLineStringErrors)\n return ERRORCLASS;\n else\n state.tokenize = tokenOuter;\n }\n return OUTCLASS;\n }\n tokenString.isString = true;\n return tokenString;\n }\n\n function tokenStringFactory(delimiter, tokenOuter) {\n while (\"rubf\".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)\n delimiter = delimiter.substr(1);\n\n var singleline = delimiter.length == 1;\n var OUTCLASS = \"string\";\n\n function tokenString(stream, state) {\n while (!stream.eol()) {\n stream.eatWhile(/[^'\"\\\\]/);\n if (stream.eat(\"\\\\\")) {\n stream.next();\n if (singleline && stream.eol())\n return OUTCLASS;\n } else if (stream.match(delimiter)) {\n state.tokenize = tokenOuter;\n return OUTCLASS;\n } else {\n stream.eat(/['\"]/);\n }\n }\n if (singleline) {\n if (parserConf.singleLineStringErrors)\n return ERRORCLASS;\n else\n state.tokenize = tokenOuter;\n }\n return OUTCLASS;\n }\n tokenString.isString = true;\n return tokenString;\n }\n\n function pushPyScope(state) {\n while (top(state).type != \"py\") state.scopes.pop()\n state.scopes.push({offset: top(state).offset + conf.indentUnit,\n type: \"py\",\n align: null})\n }\n\n function pushBracketScope(stream, state, type) {\n var align = stream.match(/^([\\s\\[\\{\\(]|#.*)*$/, false) ? null : stream.column() + 1\n state.scopes.push({offset: state.indent + hangingIndent,\n type: type,\n align: align})\n }\n\n function dedent(stream, state) {\n var indented = stream.indentation();\n while (state.scopes.length > 1 && top(state).offset > indented) {\n if (top(state).type != \"py\") return true;\n state.scopes.pop();\n }\n return top(state).offset != indented;\n }\n\n function tokenLexer(stream, state) {\n if (stream.sol()) state.beginningOfLine = true;\n\n var style = state.tokenize(stream, state);\n var current = stream.current();\n\n // Handle decorators\n if (state.beginningOfLine && current == \"@\")\n return stream.match(identifiers, false) ? \"meta\" : py3 ? \"operator\" : ERRORCLASS;\n\n if (/\\S/.test(current)) state.beginningOfLine = false;\n\n if ((style == \"variable\" || style == \"builtin\")\n && state.lastToken == \"meta\")\n style = \"meta\";\n\n // Handle scope changes.\n if (current == \"pass\" || current == \"return\")\n state.dedent += 1;\n\n if (current == \"lambda\") state.lambda = true;\n if (current == \":\" && !state.lambda && top(state).type == \"py\")\n pushPyScope(state);\n\n if (current.length == 1 && !/string|comment/.test(style)) {\n var delimiter_index = \"[({\".indexOf(current);\n if (delimiter_index != -1)\n pushBracketScope(stream, state, \"])}\".slice(delimiter_index, delimiter_index+1));\n\n delimiter_index = \"])}\".indexOf(current);\n if (delimiter_index != -1) {\n if (top(state).type == current) state.indent = state.scopes.pop().offset - hangingIndent\n else return ERRORCLASS;\n }\n }\n if (state.dedent > 0 && stream.eol() && top(state).type == \"py\") {\n if (state.scopes.length > 1) state.scopes.pop();\n state.dedent -= 1;\n }\n\n return style;\n }\n\n var external = {\n startState: function(basecolumn) {\n return {\n tokenize: tokenBase,\n scopes: [{offset: basecolumn || 0, type: \"py\", align: null}],\n indent: basecolumn || 0,\n lastToken: null,\n lambda: false,\n dedent: 0\n };\n },\n\n token: function(stream, state) {\n var addErr = state.errorToken;\n if (addErr) state.errorToken = false;\n var style = tokenLexer(stream, state);\n\n if (style && style != \"comment\")\n state.lastToken = (style == \"keyword\" || style == \"punctuation\") ? stream.current() : style;\n if (style == \"punctuation\") style = null;\n\n if (stream.eol() && state.lambda)\n state.lambda = false;\n return addErr ? style + \" \" + ERRORCLASS : style;\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize != tokenBase)\n return state.tokenize.isString ? CodeMirror.Pass : 0;\n\n var scope = top(state), closing = scope.type == textAfter.charAt(0)\n if (scope.align != null)\n return scope.align - (closing ? 1 : 0)\n else\n return scope.offset - (closing ? hangingIndent : 0)\n },\n\n electricInput: /^\\s*[\\}\\]\\)]$/,\n closeBrackets: {triples: \"'\\\"\"},\n lineComment: \"#\",\n fold: \"indent\"\n };\n return external;\n });\n\n CodeMirror.defineMIME(\"text/x-python\", \"python\");\n\n var words = function(str) { return str.split(\" \"); };\n\n CodeMirror.defineMIME(\"text/x-cython\", {\n name: \"python\",\n extra_keywords: words(\"by cdef cimport cpdef ctypedef enum except \"+\n \"extern gil include nogil property public \"+\n \"readonly struct union DEF IF ELIF ELSE\")\n });\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/python/python.js\n// module id = 728\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nvar htmlConfig = {\n autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,\n 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,\n 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,\n 'track': true, 'wbr': true, 'menuitem': true},\n implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,\n 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,\n 'th': true, 'tr': true},\n contextGrabbers: {\n 'dd': {'dd': true, 'dt': true},\n 'dt': {'dd': true, 'dt': true},\n 'li': {'li': true},\n 'option': {'option': true, 'optgroup': true},\n 'optgroup': {'optgroup': true},\n 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,\n 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,\n 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,\n 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,\n 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},\n 'rp': {'rp': true, 'rt': true},\n 'rt': {'rp': true, 'rt': true},\n 'tbody': {'tbody': true, 'tfoot': true},\n 'td': {'td': true, 'th': true},\n 'tfoot': {'tbody': true},\n 'th': {'td': true, 'th': true},\n 'thead': {'tbody': true, 'tfoot': true},\n 'tr': {'tr': true}\n },\n doNotIndent: {\"pre\": true},\n allowUnquoted: true,\n allowMissing: true,\n caseFold: true\n}\n\nvar xmlConfig = {\n autoSelfClosers: {},\n implicitlyClosed: {},\n contextGrabbers: {},\n doNotIndent: {},\n allowUnquoted: false,\n allowMissing: false,\n allowMissingTagName: false,\n caseFold: false\n}\n\nCodeMirror.defineMode(\"xml\", function(editorConf, config_) {\n var indentUnit = editorConf.indentUnit\n var config = {}\n var defaults = config_.htmlMode ? htmlConfig : xmlConfig\n for (var prop in defaults) config[prop] = defaults[prop]\n for (var prop in config_) config[prop] = config_[prop]\n\n // Return variables for tokenizers\n var type, setStyle;\n\n function inText(stream, state) {\n function chain(parser) {\n state.tokenize = parser;\n return parser(stream, state);\n }\n\n var ch = stream.next();\n if (ch == \"<\") {\n if (stream.eat(\"!\")) {\n if (stream.eat(\"[\")) {\n if (stream.match(\"CDATA[\")) return chain(inBlock(\"atom\", \"]]>\"));\n else return null;\n } else if (stream.match(\"--\")) {\n return chain(inBlock(\"comment\", \"-->\"));\n } else if (stream.match(\"DOCTYPE\", true, true)) {\n stream.eatWhile(/[\\w\\._\\-]/);\n return chain(doctype(1));\n } else {\n return null;\n }\n } else if (stream.eat(\"?\")) {\n stream.eatWhile(/[\\w\\._\\-]/);\n state.tokenize = inBlock(\"meta\", \"?>\");\n return \"meta\";\n } else {\n type = stream.eat(\"/\") ? \"closeTag\" : \"openTag\";\n state.tokenize = inTag;\n return \"tag bracket\";\n }\n } else if (ch == \"&\") {\n var ok;\n if (stream.eat(\"#\")) {\n if (stream.eat(\"x\")) {\n ok = stream.eatWhile(/[a-fA-F\\d]/) && stream.eat(\";\");\n } else {\n ok = stream.eatWhile(/[\\d]/) && stream.eat(\";\");\n }\n } else {\n ok = stream.eatWhile(/[\\w\\.\\-:]/) && stream.eat(\";\");\n }\n return ok ? \"atom\" : \"error\";\n } else {\n stream.eatWhile(/[^&<]/);\n return null;\n }\n }\n inText.isInText = true;\n\n function inTag(stream, state) {\n var ch = stream.next();\n if (ch == \">\" || (ch == \"/\" && stream.eat(\">\"))) {\n state.tokenize = inText;\n type = ch == \">\" ? \"endTag\" : \"selfcloseTag\";\n return \"tag bracket\";\n } else if (ch == \"=\") {\n type = \"equals\";\n return null;\n } else if (ch == \"<\") {\n state.tokenize = inText;\n state.state = baseState;\n state.tagName = state.tagStart = null;\n var next = state.tokenize(stream, state);\n return next ? next + \" tag error\" : \"tag error\";\n } else if (/[\\'\\\"]/.test(ch)) {\n state.tokenize = inAttribute(ch);\n state.stringStartCol = stream.column();\n return state.tokenize(stream, state);\n } else {\n stream.match(/^[^\\s\\u00a0=<>\\\"\\']*[^\\s\\u00a0=<>\\\"\\'\\/]/);\n return \"word\";\n }\n }\n\n function inAttribute(quote) {\n var closure = function(stream, state) {\n while (!stream.eol()) {\n if (stream.next() == quote) {\n state.tokenize = inTag;\n break;\n }\n }\n return \"string\";\n };\n closure.isInAttribute = true;\n return closure;\n }\n\n function inBlock(style, terminator) {\n return function(stream, state) {\n while (!stream.eol()) {\n if (stream.match(terminator)) {\n state.tokenize = inText;\n break;\n }\n stream.next();\n }\n return style;\n }\n }\n\n function doctype(depth) {\n return function(stream, state) {\n var ch;\n while ((ch = stream.next()) != null) {\n if (ch == \"<\") {\n state.tokenize = doctype(depth + 1);\n return state.tokenize(stream, state);\n } else if (ch == \">\") {\n if (depth == 1) {\n state.tokenize = inText;\n break;\n } else {\n state.tokenize = doctype(depth - 1);\n return state.tokenize(stream, state);\n }\n }\n }\n return \"meta\";\n };\n }\n\n function Context(state, tagName, startOfLine) {\n this.prev = state.context;\n this.tagName = tagName;\n this.indent = state.indented;\n this.startOfLine = startOfLine;\n if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))\n this.noIndent = true;\n }\n function popContext(state) {\n if (state.context) state.context = state.context.prev;\n }\n function maybePopContext(state, nextTagName) {\n var parentTagName;\n while (true) {\n if (!state.context) {\n return;\n }\n parentTagName = state.context.tagName;\n if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||\n !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {\n return;\n }\n popContext(state);\n }\n }\n\n function baseState(type, stream, state) {\n if (type == \"openTag\") {\n state.tagStart = stream.column();\n return tagNameState;\n } else if (type == \"closeTag\") {\n return closeTagNameState;\n } else {\n return baseState;\n }\n }\n function tagNameState(type, stream, state) {\n if (type == \"word\") {\n state.tagName = stream.current();\n setStyle = \"tag\";\n return attrState;\n } else if (config.allowMissingTagName && type == \"endTag\") {\n setStyle = \"tag bracket\";\n return attrState(type, stream, state);\n } else {\n setStyle = \"error\";\n return tagNameState;\n }\n }\n function closeTagNameState(type, stream, state) {\n if (type == \"word\") {\n var tagName = stream.current();\n if (state.context && state.context.tagName != tagName &&\n config.implicitlyClosed.hasOwnProperty(state.context.tagName))\n popContext(state);\n if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {\n setStyle = \"tag\";\n return closeState;\n } else {\n setStyle = \"tag error\";\n return closeStateErr;\n }\n } else if (config.allowMissingTagName && type == \"endTag\") {\n setStyle = \"tag bracket\";\n return closeState(type, stream, state);\n } else {\n setStyle = \"error\";\n return closeStateErr;\n }\n }\n\n function closeState(type, _stream, state) {\n if (type != \"endTag\") {\n setStyle = \"error\";\n return closeState;\n }\n popContext(state);\n return baseState;\n }\n function closeStateErr(type, stream, state) {\n setStyle = \"error\";\n return closeState(type, stream, state);\n }\n\n function attrState(type, _stream, state) {\n if (type == \"word\") {\n setStyle = \"attribute\";\n return attrEqState;\n } else if (type == \"endTag\" || type == \"selfcloseTag\") {\n var tagName = state.tagName, tagStart = state.tagStart;\n state.tagName = state.tagStart = null;\n if (type == \"selfcloseTag\" ||\n config.autoSelfClosers.hasOwnProperty(tagName)) {\n maybePopContext(state, tagName);\n } else {\n maybePopContext(state, tagName);\n state.context = new Context(state, tagName, tagStart == state.indented);\n }\n return baseState;\n }\n setStyle = \"error\";\n return attrState;\n }\n function attrEqState(type, stream, state) {\n if (type == \"equals\") return attrValueState;\n if (!config.allowMissing) setStyle = \"error\";\n return attrState(type, stream, state);\n }\n function attrValueState(type, stream, state) {\n if (type == \"string\") return attrContinuedState;\n if (type == \"word\" && config.allowUnquoted) {setStyle = \"string\"; return attrState;}\n setStyle = \"error\";\n return attrState(type, stream, state);\n }\n function attrContinuedState(type, stream, state) {\n if (type == \"string\") return attrContinuedState;\n return attrState(type, stream, state);\n }\n\n return {\n startState: function(baseIndent) {\n var state = {tokenize: inText,\n state: baseState,\n indented: baseIndent || 0,\n tagName: null, tagStart: null,\n context: null}\n if (baseIndent != null) state.baseIndent = baseIndent\n return state\n },\n\n token: function(stream, state) {\n if (!state.tagName && stream.sol())\n state.indented = stream.indentation();\n\n if (stream.eatSpace()) return null;\n type = null;\n var style = state.tokenize(stream, state);\n if ((style || type) && style != \"comment\") {\n setStyle = null;\n state.state = state.state(type || style, stream, state);\n if (setStyle)\n style = setStyle == \"error\" ? style + \" error\" : setStyle;\n }\n return style;\n },\n\n indent: function(state, textAfter, fullLine) {\n var context = state.context;\n // Indent multi-line strings (e.g. css).\n if (state.tokenize.isInAttribute) {\n if (state.tagStart == state.indented)\n return state.stringStartCol + 1;\n else\n return state.indented + indentUnit;\n }\n if (context && context.noIndent) return CodeMirror.Pass;\n if (state.tokenize != inTag && state.tokenize != inText)\n return fullLine ? fullLine.match(/^(\\s*)/)[0].length : 0;\n // Indent the starts of attribute names.\n if (state.tagName) {\n if (config.multilineTagIndentPastTag !== false)\n return state.tagStart + state.tagName.length + 2;\n else\n return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);\n }\n if (config.alignCDATA && /$/,\n blockCommentStart: \"\",\n\n configuration: config.htmlMode ? \"html\" : \"xml\",\n helperType: config.htmlMode ? \"html\" : \"xml\",\n\n skipAttribute: function(state) {\n if (state.state == attrValueState)\n state.state = attrState\n }\n };\n});\n\nCodeMirror.defineMIME(\"text/xml\", \"xml\");\nCodeMirror.defineMIME(\"application/xml\", \"xml\");\nif (!CodeMirror.mimeModes.hasOwnProperty(\"text/html\"))\n CodeMirror.defineMIME(\"text/html\", {name: \"xml\", htmlMode: true});\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/xml/xml.js\n// module id = 729\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") { // CommonJS\n mod(require(\"../../lib/codemirror\"));\n } else if (typeof define == \"function\" && define.amd) { // AMD\n define([\"../../lib/codemirror\"], mod);\n } else { // Plain browser env\n mod(CodeMirror);\n }\n})(function(CodeMirror) {\n \"use strict\";\n\n var TOKEN_STYLES = {\n addition: \"positive\",\n attributes: \"attribute\",\n bold: \"strong\",\n cite: \"keyword\",\n code: \"atom\",\n definitionList: \"number\",\n deletion: \"negative\",\n div: \"punctuation\",\n em: \"em\",\n footnote: \"variable\",\n footCite: \"qualifier\",\n header: \"header\",\n html: \"comment\",\n image: \"string\",\n italic: \"em\",\n link: \"link\",\n linkDefinition: \"link\",\n list1: \"variable-2\",\n list2: \"variable-3\",\n list3: \"keyword\",\n notextile: \"string-2\",\n pre: \"operator\",\n p: \"property\",\n quote: \"bracket\",\n span: \"quote\",\n specialChar: \"tag\",\n strong: \"strong\",\n sub: \"builtin\",\n sup: \"builtin\",\n table: \"variable-3\",\n tableHeading: \"operator\"\n };\n\n function startNewLine(stream, state) {\n state.mode = Modes.newLayout;\n state.tableHeading = false;\n\n if (state.layoutType === \"definitionList\" && state.spanningLayout &&\n stream.match(RE(\"definitionListEnd\"), false))\n state.spanningLayout = false;\n }\n\n function handlePhraseModifier(stream, state, ch) {\n if (ch === \"_\") {\n if (stream.eat(\"_\"))\n return togglePhraseModifier(stream, state, \"italic\", /__/, 2);\n else\n return togglePhraseModifier(stream, state, \"em\", /_/, 1);\n }\n\n if (ch === \"*\") {\n if (stream.eat(\"*\")) {\n return togglePhraseModifier(stream, state, \"bold\", /\\*\\*/, 2);\n }\n return togglePhraseModifier(stream, state, \"strong\", /\\*/, 1);\n }\n\n if (ch === \"[\") {\n if (stream.match(/\\d+\\]/)) state.footCite = true;\n return tokenStyles(state);\n }\n\n if (ch === \"(\") {\n var spec = stream.match(/^(r|tm|c)\\)/);\n if (spec)\n return tokenStylesWith(state, TOKEN_STYLES.specialChar);\n }\n\n if (ch === \"<\" && stream.match(/(\\w+)[^>]+>[^<]+<\\/\\1>/))\n return tokenStylesWith(state, TOKEN_STYLES.html);\n\n if (ch === \"?\" && stream.eat(\"?\"))\n return togglePhraseModifier(stream, state, \"cite\", /\\?\\?/, 2);\n\n if (ch === \"=\" && stream.eat(\"=\"))\n return togglePhraseModifier(stream, state, \"notextile\", /==/, 2);\n\n if (ch === \"-\" && !stream.eat(\"-\"))\n return togglePhraseModifier(stream, state, \"deletion\", /-/, 1);\n\n if (ch === \"+\")\n return togglePhraseModifier(stream, state, \"addition\", /\\+/, 1);\n\n if (ch === \"~\")\n return togglePhraseModifier(stream, state, \"sub\", /~/, 1);\n\n if (ch === \"^\")\n return togglePhraseModifier(stream, state, \"sup\", /\\^/, 1);\n\n if (ch === \"%\")\n return togglePhraseModifier(stream, state, \"span\", /%/, 1);\n\n if (ch === \"@\")\n return togglePhraseModifier(stream, state, \"code\", /@/, 1);\n\n if (ch === \"!\") {\n var type = togglePhraseModifier(stream, state, \"image\", /(?:\\([^\\)]+\\))?!/, 1);\n stream.match(/^:\\S+/); // optional Url portion\n return type;\n }\n return tokenStyles(state);\n }\n\n function togglePhraseModifier(stream, state, phraseModifier, closeRE, openSize) {\n var charBefore = stream.pos > openSize ? stream.string.charAt(stream.pos - openSize - 1) : null;\n var charAfter = stream.peek();\n if (state[phraseModifier]) {\n if ((!charAfter || /\\W/.test(charAfter)) && charBefore && /\\S/.test(charBefore)) {\n var type = tokenStyles(state);\n state[phraseModifier] = false;\n return type;\n }\n } else if ((!charBefore || /\\W/.test(charBefore)) && charAfter && /\\S/.test(charAfter) &&\n stream.match(new RegExp(\"^.*\\\\S\" + closeRE.source + \"(?:\\\\W|$)\"), false)) {\n state[phraseModifier] = true;\n state.mode = Modes.attributes;\n }\n return tokenStyles(state);\n };\n\n function tokenStyles(state) {\n var disabled = textileDisabled(state);\n if (disabled) return disabled;\n\n var styles = [];\n if (state.layoutType) styles.push(TOKEN_STYLES[state.layoutType]);\n\n styles = styles.concat(activeStyles(\n state, \"addition\", \"bold\", \"cite\", \"code\", \"deletion\", \"em\", \"footCite\",\n \"image\", \"italic\", \"link\", \"span\", \"strong\", \"sub\", \"sup\", \"table\", \"tableHeading\"));\n\n if (state.layoutType === \"header\")\n styles.push(TOKEN_STYLES.header + \"-\" + state.header);\n\n return styles.length ? styles.join(\" \") : null;\n }\n\n function textileDisabled(state) {\n var type = state.layoutType;\n\n switch(type) {\n case \"notextile\":\n case \"code\":\n case \"pre\":\n return TOKEN_STYLES[type];\n default:\n if (state.notextile)\n return TOKEN_STYLES.notextile + (type ? (\" \" + TOKEN_STYLES[type]) : \"\");\n return null;\n }\n }\n\n function tokenStylesWith(state, extraStyles) {\n var disabled = textileDisabled(state);\n if (disabled) return disabled;\n\n var type = tokenStyles(state);\n if (extraStyles)\n return type ? (type + \" \" + extraStyles) : extraStyles;\n else\n return type;\n }\n\n function activeStyles(state) {\n var styles = [];\n for (var i = 1; i < arguments.length; ++i) {\n if (state[arguments[i]])\n styles.push(TOKEN_STYLES[arguments[i]]);\n }\n return styles;\n }\n\n function blankLine(state) {\n var spanningLayout = state.spanningLayout, type = state.layoutType;\n\n for (var key in state) if (state.hasOwnProperty(key))\n delete state[key];\n\n state.mode = Modes.newLayout;\n if (spanningLayout) {\n state.layoutType = type;\n state.spanningLayout = true;\n }\n }\n\n var REs = {\n cache: {},\n single: {\n bc: \"bc\",\n bq: \"bq\",\n definitionList: /- .*?:=+/,\n definitionListEnd: /.*=:\\s*$/,\n div: \"div\",\n drawTable: /\\|.*\\|/,\n foot: /fn\\d+/,\n header: /h[1-6]/,\n html: /\\s*<(?:\\/)?(\\w+)(?:[^>]+)?>(?:[^<]+<\\/\\1>)?/,\n link: /[^\"]+\":\\S/,\n linkDefinition: /\\[[^\\s\\]]+\\]\\S+/,\n list: /(?:#+|\\*+)/,\n notextile: \"notextile\",\n para: \"p\",\n pre: \"pre\",\n table: \"table\",\n tableCellAttributes: /[\\/\\\\]\\d+/,\n tableHeading: /\\|_\\./,\n tableText: /[^\"_\\*\\[\\(\\?\\+~\\^%@|-]+/,\n text: /[^!\"_=\\*\\[\\(<\\?\\+~\\^%@-]+/\n },\n attributes: {\n align: /(?:<>|<|>|=)/,\n selector: /\\([^\\(][^\\)]+\\)/,\n lang: /\\[[^\\[\\]]+\\]/,\n pad: /(?:\\(+|\\)+){1,2}/,\n css: /\\{[^\\}]+\\}/\n },\n createRe: function(name) {\n switch (name) {\n case \"drawTable\":\n return REs.makeRe(\"^\", REs.single.drawTable, \"$\");\n case \"html\":\n return REs.makeRe(\"^\", REs.single.html, \"(?:\", REs.single.html, \")*\", \"$\");\n case \"linkDefinition\":\n return REs.makeRe(\"^\", REs.single.linkDefinition, \"$\");\n case \"listLayout\":\n return REs.makeRe(\"^\", REs.single.list, RE(\"allAttributes\"), \"*\\\\s+\");\n case \"tableCellAttributes\":\n return REs.makeRe(\"^\", REs.choiceRe(REs.single.tableCellAttributes,\n RE(\"allAttributes\")), \"+\\\\.\");\n case \"type\":\n return REs.makeRe(\"^\", RE(\"allTypes\"));\n case \"typeLayout\":\n return REs.makeRe(\"^\", RE(\"allTypes\"), RE(\"allAttributes\"),\n \"*\\\\.\\\\.?\", \"(\\\\s+|$)\");\n case \"attributes\":\n return REs.makeRe(\"^\", RE(\"allAttributes\"), \"+\");\n\n case \"allTypes\":\n return REs.choiceRe(REs.single.div, REs.single.foot,\n REs.single.header, REs.single.bc, REs.single.bq,\n REs.single.notextile, REs.single.pre, REs.single.table,\n REs.single.para);\n\n case \"allAttributes\":\n return REs.choiceRe(REs.attributes.selector, REs.attributes.css,\n REs.attributes.lang, REs.attributes.align, REs.attributes.pad);\n\n default:\n return REs.makeRe(\"^\", REs.single[name]);\n }\n },\n makeRe: function() {\n var pattern = \"\";\n for (var i = 0; i < arguments.length; ++i) {\n var arg = arguments[i];\n pattern += (typeof arg === \"string\") ? arg : arg.source;\n }\n return new RegExp(pattern);\n },\n choiceRe: function() {\n var parts = [arguments[0]];\n for (var i = 1; i < arguments.length; ++i) {\n parts[i * 2 - 1] = \"|\";\n parts[i * 2] = arguments[i];\n }\n\n parts.unshift(\"(?:\");\n parts.push(\")\");\n return REs.makeRe.apply(null, parts);\n }\n };\n\n function RE(name) {\n return (REs.cache[name] || (REs.cache[name] = REs.createRe(name)));\n }\n\n var Modes = {\n newLayout: function(stream, state) {\n if (stream.match(RE(\"typeLayout\"), false)) {\n state.spanningLayout = false;\n return (state.mode = Modes.blockType)(stream, state);\n }\n var newMode;\n if (!textileDisabled(state)) {\n if (stream.match(RE(\"listLayout\"), false))\n newMode = Modes.list;\n else if (stream.match(RE(\"drawTable\"), false))\n newMode = Modes.table;\n else if (stream.match(RE(\"linkDefinition\"), false))\n newMode = Modes.linkDefinition;\n else if (stream.match(RE(\"definitionList\")))\n newMode = Modes.definitionList;\n else if (stream.match(RE(\"html\"), false))\n newMode = Modes.html;\n }\n return (state.mode = (newMode || Modes.text))(stream, state);\n },\n\n blockType: function(stream, state) {\n var match, type;\n state.layoutType = null;\n\n if (match = stream.match(RE(\"type\")))\n type = match[0];\n else\n return (state.mode = Modes.text)(stream, state);\n\n if (match = type.match(RE(\"header\"))) {\n state.layoutType = \"header\";\n state.header = parseInt(match[0][1]);\n } else if (type.match(RE(\"bq\"))) {\n state.layoutType = \"quote\";\n } else if (type.match(RE(\"bc\"))) {\n state.layoutType = \"code\";\n } else if (type.match(RE(\"foot\"))) {\n state.layoutType = \"footnote\";\n } else if (type.match(RE(\"notextile\"))) {\n state.layoutType = \"notextile\";\n } else if (type.match(RE(\"pre\"))) {\n state.layoutType = \"pre\";\n } else if (type.match(RE(\"div\"))) {\n state.layoutType = \"div\";\n } else if (type.match(RE(\"table\"))) {\n state.layoutType = \"table\";\n }\n\n state.mode = Modes.attributes;\n return tokenStyles(state);\n },\n\n text: function(stream, state) {\n if (stream.match(RE(\"text\"))) return tokenStyles(state);\n\n var ch = stream.next();\n if (ch === '\"')\n return (state.mode = Modes.link)(stream, state);\n return handlePhraseModifier(stream, state, ch);\n },\n\n attributes: function(stream, state) {\n state.mode = Modes.layoutLength;\n\n if (stream.match(RE(\"attributes\")))\n return tokenStylesWith(state, TOKEN_STYLES.attributes);\n else\n return tokenStyles(state);\n },\n\n layoutLength: function(stream, state) {\n if (stream.eat(\".\") && stream.eat(\".\"))\n state.spanningLayout = true;\n\n state.mode = Modes.text;\n return tokenStyles(state);\n },\n\n list: function(stream, state) {\n var match = stream.match(RE(\"list\"));\n state.listDepth = match[0].length;\n var listMod = (state.listDepth - 1) % 3;\n if (!listMod)\n state.layoutType = \"list1\";\n else if (listMod === 1)\n state.layoutType = \"list2\";\n else\n state.layoutType = \"list3\";\n\n state.mode = Modes.attributes;\n return tokenStyles(state);\n },\n\n link: function(stream, state) {\n state.mode = Modes.text;\n if (stream.match(RE(\"link\"))) {\n stream.match(/\\S+/);\n return tokenStylesWith(state, TOKEN_STYLES.link);\n }\n return tokenStyles(state);\n },\n\n linkDefinition: function(stream, state) {\n stream.skipToEnd();\n return tokenStylesWith(state, TOKEN_STYLES.linkDefinition);\n },\n\n definitionList: function(stream, state) {\n stream.match(RE(\"definitionList\"));\n\n state.layoutType = \"definitionList\";\n\n if (stream.match(/\\s*$/))\n state.spanningLayout = true;\n else\n state.mode = Modes.attributes;\n\n return tokenStyles(state);\n },\n\n html: function(stream, state) {\n stream.skipToEnd();\n return tokenStylesWith(state, TOKEN_STYLES.html);\n },\n\n table: function(stream, state) {\n state.layoutType = \"table\";\n return (state.mode = Modes.tableCell)(stream, state);\n },\n\n tableCell: function(stream, state) {\n if (stream.match(RE(\"tableHeading\")))\n state.tableHeading = true;\n else\n stream.eat(\"|\");\n\n state.mode = Modes.tableCellAttributes;\n return tokenStyles(state);\n },\n\n tableCellAttributes: function(stream, state) {\n state.mode = Modes.tableText;\n\n if (stream.match(RE(\"tableCellAttributes\")))\n return tokenStylesWith(state, TOKEN_STYLES.attributes);\n else\n return tokenStyles(state);\n },\n\n tableText: function(stream, state) {\n if (stream.match(RE(\"tableText\")))\n return tokenStyles(state);\n\n if (stream.peek() === \"|\") { // end of cell\n state.mode = Modes.tableCell;\n return tokenStyles(state);\n }\n return handlePhraseModifier(stream, state, stream.next());\n }\n };\n\n CodeMirror.defineMode(\"textile\", function() {\n return {\n startState: function() {\n return { mode: Modes.newLayout };\n },\n token: function(stream, state) {\n if (stream.sol()) startNewLine(stream, state);\n return state.mode(stream, state);\n },\n blankLine: blankLine\n };\n });\n\n CodeMirror.defineMIME(\"text/x-textile\", \"textile\");\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/textile/textile.js\n// module id = 730\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode('shell', function() {\n\n var words = {};\n function define(style, dict) {\n for(var i = 0; i < dict.length; i++) {\n words[dict[i]] = style;\n }\n };\n\n var commonAtoms = [\"true\", \"false\"];\n var commonKeywords = [\"if\", \"then\", \"do\", \"else\", \"elif\", \"while\", \"until\", \"for\", \"in\", \"esac\", \"fi\",\n \"fin\", \"fil\", \"done\", \"exit\", \"set\", \"unset\", \"export\", \"function\"];\n var commonCommands = [\"ab\", \"awk\", \"bash\", \"beep\", \"cat\", \"cc\", \"cd\", \"chown\", \"chmod\", \"chroot\", \"clear\",\n \"cp\", \"curl\", \"cut\", \"diff\", \"echo\", \"find\", \"gawk\", \"gcc\", \"get\", \"git\", \"grep\", \"hg\", \"kill\", \"killall\",\n \"ln\", \"ls\", \"make\", \"mkdir\", \"openssl\", \"mv\", \"nc\", \"nl\", \"node\", \"npm\", \"ping\", \"ps\", \"restart\", \"rm\",\n \"rmdir\", \"sed\", \"service\", \"sh\", \"shopt\", \"shred\", \"source\", \"sort\", \"sleep\", \"ssh\", \"start\", \"stop\",\n \"su\", \"sudo\", \"svn\", \"tee\", \"telnet\", \"top\", \"touch\", \"vi\", \"vim\", \"wall\", \"wc\", \"wget\", \"who\", \"write\",\n \"yes\", \"zsh\"];\n\n CodeMirror.registerHelper(\"hintWords\", \"shell\", commonAtoms.concat(commonKeywords, commonCommands));\n\n define('atom', commonAtoms);\n define('keyword', commonKeywords);\n define('builtin', commonCommands);\n\n function tokenBase(stream, state) {\n if (stream.eatSpace()) return null;\n\n var sol = stream.sol();\n var ch = stream.next();\n\n if (ch === '\\\\') {\n stream.next();\n return null;\n }\n if (ch === '\\'' || ch === '\"' || ch === '`') {\n state.tokens.unshift(tokenString(ch, ch === \"`\" ? \"quote\" : \"string\"));\n return tokenize(stream, state);\n }\n if (ch === '#') {\n if (sol && stream.eat('!')) {\n stream.skipToEnd();\n return 'meta'; // 'comment'?\n }\n stream.skipToEnd();\n return 'comment';\n }\n if (ch === '$') {\n state.tokens.unshift(tokenDollar);\n return tokenize(stream, state);\n }\n if (ch === '+' || ch === '=') {\n return 'operator';\n }\n if (ch === '-') {\n stream.eat('-');\n stream.eatWhile(/\\w/);\n return 'attribute';\n }\n if (/\\d/.test(ch)) {\n stream.eatWhile(/\\d/);\n if(stream.eol() || !/\\w/.test(stream.peek())) {\n return 'number';\n }\n }\n stream.eatWhile(/[\\w-]/);\n var cur = stream.current();\n if (stream.peek() === '=' && /\\w+/.test(cur)) return 'def';\n return words.hasOwnProperty(cur) ? words[cur] : null;\n }\n\n function tokenString(quote, style) {\n var close = quote == \"(\" ? \")\" : quote == \"{\" ? \"}\" : quote\n return function(stream, state) {\n var next, escaped = false;\n while ((next = stream.next()) != null) {\n if (next === close && !escaped) {\n state.tokens.shift();\n break;\n } else if (next === '$' && !escaped && quote !== \"'\" && stream.peek() != close) {\n escaped = true;\n stream.backUp(1);\n state.tokens.unshift(tokenDollar);\n break;\n } else if (!escaped && quote !== close && next === quote) {\n state.tokens.unshift(tokenString(quote, style))\n return tokenize(stream, state)\n } else if (!escaped && /['\"]/.test(next) && !/['\"]/.test(quote)) {\n state.tokens.unshift(tokenStringStart(next, \"string\"));\n stream.backUp(1);\n break;\n }\n escaped = !escaped && next === '\\\\';\n }\n return style;\n };\n };\n\n function tokenStringStart(quote, style) {\n return function(stream, state) {\n state.tokens[0] = tokenString(quote, style)\n stream.next()\n return tokenize(stream, state)\n }\n }\n\n var tokenDollar = function(stream, state) {\n if (state.tokens.length > 1) stream.eat('$');\n var ch = stream.next()\n if (/['\"({]/.test(ch)) {\n state.tokens[0] = tokenString(ch, ch == \"(\" ? \"quote\" : ch == \"{\" ? \"def\" : \"string\");\n return tokenize(stream, state);\n }\n if (!/\\d/.test(ch)) stream.eatWhile(/\\w/);\n state.tokens.shift();\n return 'def';\n };\n\n function tokenize(stream, state) {\n return (state.tokens[0] || tokenBase) (stream, state);\n };\n\n return {\n startState: function() {return {tokens:[]};},\n token: function(stream, state) {\n return tokenize(stream, state);\n },\n closeBrackets: \"()[]{}''\\\"\\\"``\",\n lineComment: '#',\n fold: \"brace\"\n };\n});\n\nCodeMirror.defineMIME('text/x-sh', 'shell');\n// Apache uses a slightly different Media Type for Shell scripts\n// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types\nCodeMirror.defineMIME('application/x-sh', 'shell');\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/shell/shell.js\n// module id = 731\n// module chunks = 3 4 5 7 8 14","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-17a2306c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./email.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./email.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./email.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-17a2306c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./email.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue\n// module id = 734\n// module chunks = 0 3 4 5 6","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/dag.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Vue from 'vue'\nimport $ from 'jquery'\nimport _ from 'lodash'\nimport i18n from '@/module/i18n'\nimport { jsPlumb } from 'jsplumb'\nimport DragZoom from './dragZoom'\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\nimport Permissions from '@/module/permissions'\nimport { uuid, findComponentDownward } from '@/module/util/'\nimport {\n tasksAll,\n rtTasksTpl,\n setSvgColor,\n saveTargetarr,\n rtTargetarrArr } from './util'\nimport mStart from '@/conf/home/pages/projects/pages/definition/pages/list/_source/start'\n\nlet JSP = function () {\n this.dag = {}\n this.selectedElement = {}\n\n this.config = {\n // Whether to drag\n isDrag: true,\n // Whether to allow connection\n isAttachment: false,\n // Whether to drag a new node\n isNewNodes: true,\n // Whether to support double-click node events\n isDblclick: true,\n // Whether to support right-click menu events\n isContextmenu: true,\n // Whether to allow click events\n isClick: false\n }\n}\n\n/**\n * dag init\n */\nJSP.prototype.init = function ({ dag, instance }) {\n // Get the dag component instance\n this.dag = dag\n // Get jsplumb instance\n this.JspInstance = instance\n // Register jsplumb connection type and configuration\n this.JspInstance.registerConnectionType('basic', {\n anchor: 'Continuous',\n connector: 'Straight' // Line type\n })\n\n // Initial configuration\n this.setConfig({\n isDrag: !store.state.dag.isDetails,\n isAttachment: false,\n isNewNodes: Permissions.getAuth() === false ? false : !store.state.dag.isDetails,\n isDblclick: true,\n isContextmenu: true,\n isClick: false\n })\n\n // Monitor line click\n this.JspInstance.bind('click', e => {\n if (this.config.isClick) {\n this.connectClick(e)\n }\n })\n\n // Drag and drop\n if (this.config.isNewNodes) {\n DragZoom.init()\n }\n}\n\n/**\n * set config attribute\n */\nJSP.prototype.setConfig = function (o) {\n this.config = Object.assign(this.config, {}, o)\n}\n\n/**\n * Node binding event\n */\nJSP.prototype.tasksEvent = function (selfId) {\n let tasks = $(`#${selfId}`)\n // Bind right event\n tasks.on('contextmenu', e => {\n this.tasksContextmenu(e)\n return false\n })\n\n // Binding double click event\n tasks.find('.icos').bind('dblclick', e => {\n this.tasksDblclick(e)\n })\n\n // Binding click event\n tasks.on('click', e => {\n this.tasksClick(e)\n })\n}\n\n/**\n * Dag node drag and drop processing\n */\nJSP.prototype.draggable = function () {\n if (this.config.isNewNodes) {\n let selfId\n let self = this\n $('.toolbar-btn .roundedRect').draggable({\n scope: 'plant',\n helper: 'clone',\n containment: $('.dag-model'),\n stop: function (e, ui) {\n self.tasksEvent(selfId)\n\n // Dom structure is not generated without pop-up form form\n if ($(`#${selfId}`).html()) {\n // dag event\n findComponentDownward(self.dag.$root, 'dag-chart')._createNodes({\n id: selfId\n })\n }\n },\n drag: function () {\n $('body').find('.tooltip.fade.top.in').remove()\n }\n })\n\n $('#canvas').droppable({\n scope: 'plant',\n drop: function (ev, ui) {\n let id = 'tasks-' + Math.ceil(Math.random() * 100000) // eslint-disable-line\n // Get mouse coordinates\n let left = parseInt(ui.offset.left - $(this).offset().left)\n let top = parseInt(ui.offset.top - $(this).offset().top) - 10\n if (top < 25) {\n top = 25\n }\n // Generate template node\n $('#canvas').append(rtTasksTpl({\n id: id,\n name: id,\n x: left,\n y: top,\n isAttachment: self.config.isAttachment,\n taskType: findComponentDownward(self.dag.$root, 'dag-chart').dagBarId\n }))\n\n // Get the generated node\n let thisDom = jsPlumb.getSelector('.statemachine-demo .w')\n\n // Generating a connection node\n self.JspInstance.batch(() => {\n self.initNode(thisDom[thisDom.length - 1])\n })\n selfId = id\n }\n })\n }\n}\n\n/**\n * Echo json processing and old data structure processing\n */\nJSP.prototype.jsonHandle = function ({ largeJson, locations }) {\n _.map(largeJson, v => {\n // Generate template\n $('#canvas').append(rtTasksTpl({\n id: v.id,\n name: v.name,\n x: locations[v.id]['x'],\n y: locations[v.id]['y'],\n targetarr: locations[v.id]['targetarr'],\n isAttachment: this.config.isAttachment,\n taskType: v.type,\n runFlag:v.runFlag\n }))\n\n // contextmenu event\n $(`#${v.id}`).on('contextmenu', e => {\n this.tasksContextmenu(e)\n return false\n })\n\n // dblclick event\n $(`#${v.id}`).find('.icos').bind('dblclick', e => {\n this.tasksDblclick(e)\n })\n\n // click event\n $(`#${v.id}`).bind('click', e => {\n this.tasksClick(e)\n })\n })\n}\n\n/**\n * Initialize a single node\n */\nJSP.prototype.initNode = function (el) {\n // Whether to drag\n if (this.config.isDrag) {\n this.JspInstance.draggable(el, {\n containment: 'dag-container'\n })\n }\n\n // Node attribute configuration\n this.JspInstance.makeSource(el, {\n filter: '.ep',\n anchor: 'Continuous',\n connectorStyle: {\n stroke: '#555',\n strokeWidth: 2,\n outlineStroke: 'transparent',\n outlineWidth: 4\n },\n // This place is leaking\n // connectionType: \"basic\",\n extract: {\n action: 'the-action'\n },\n maxConnections: -1\n })\n\n // Node connection property configuration\n this.JspInstance.makeTarget(el, {\n dropOptions: { hoverClass: 'dragHover' },\n anchor: 'Continuous',\n allowLoopback: false // Forbid yourself to connect yourself\n })\n this.JspInstance.fire('jsPlumbDemoNodeAdded', el)\n}\n\n/**\n * Node right click menu\n */\nJSP.prototype.tasksContextmenu = function (event) {\n if (this.config.isContextmenu) {\n let routerName = router.history.current.name\n // state\n let isOne = routerName === 'projects-definition-details' && this.dag.releaseState !== 'NOT_RELEASE'\n // hide\n let isTwo = store.state.dag.isDetails\n\n let html = [\n `${i18n.$t('开始运行')}`,\n `${i18n.$t('编辑节点')}`,\n `${i18n.$t('复制节点')}`,\n `${i18n.$t('删除节点')}`\n ]\n\n let operationHtml = () => {\n return html.splice(',')\n }\n\n let e = event\n let $id = e.currentTarget.id\n let $contextmenu = $('#contextmenu')\n let $name = $(`#${$id}`).find('.name-p').text()\n let $left = e.pageX + document.body.scrollLeft - 5\n let $top = e.pageY + document.body.scrollTop - 5\n $contextmenu.css({\n left: $left,\n top: $top,\n visibility: 'visible'\n })\n // Action bar\n $contextmenu.html('').append(operationHtml)\n\n if (isOne) {\n // start run\n $('#startRunning').on('click', () => {\n let id = router.history.current.params.id\n store.dispatch('dag/getStartCheck', { processDefinitionId: id }).then(res => {\n let modal = Vue.$modal.dialog({\n closable: false,\n showMask: true,\n escClose: true,\n className: 'v-modal-custom',\n transitionName: 'opacityp',\n render (h) {\n return h(mStart, {\n on: {\n onUpdate () {\n modal.remove()\n },\n close () {\n modal.remove()\n }\n },\n props: {\n item: {\n id: id\n },\n startNodeList: $name,\n sourceType: 'contextmenu'\n }\n })\n }\n })\n }).catch(e => {\n Vue.$message.error(e.msg || '')\n })\n })\n }\n if (!isTwo) {\n // edit node\n $(`#editNodes`).click(ev => {\n findComponentDownward(this.dag.$root, 'dag-chart')._createNodes({\n id: $id,\n type: $(`#${$id}`).attr('data-tasks-type')\n })\n })\n // delete node\n $('#removeNodes').click(ev => {\n this.removeNodes($id)\n })\n\n // copy node\n $('#copyNodes').click(res => {\n this.copyNodes($id)\n })\n }\n }\n}\n\n/**\n * Node double click event\n */\nJSP.prototype.tasksDblclick = function (e) {\n // Untie event\n if (this.config.isDblclick) {\n let id = $(e.currentTarget.offsetParent).attr('id')\n\n findComponentDownward(this.dag.$root, 'dag-chart')._createNodes({\n id: id,\n type: $(`#${id}`).attr('data-tasks-type')\n })\n }\n}\n\n/**\n * Node click event\n */\nJSP.prototype.tasksClick = function (e) {\n let $id\n let self = this\n let $body = $(`body`)\n if (this.config.isClick) {\n let $connect = this.selectedElement.connect\n $('.w').removeClass('jtk-tasks-active')\n $(e.currentTarget).addClass('jtk-tasks-active')\n if ($connect) {\n setSvgColor($connect, '#555')\n this.selectedElement.connect = null\n }\n this.selectedElement.id = $(e.currentTarget).attr('id')\n\n // Unbind copy and paste events\n $body.unbind('copy').unbind('paste')\n // Copy binding id\n $id = self.selectedElement.id\n\n $body.bind({\n copy: function () {\n $id = self.selectedElement.id\n },\n paste: function () {\n $id && self.copyNodes($id)\n }\n })\n }\n}\n\n/**\n * Remove binding events\n * paste\n */\nJSP.prototype.removePaste = function () {\n let $body = $(`body`)\n // Unbind copy and paste events\n $body.unbind('copy').unbind('paste')\n // Remove selected node parameters\n this.selectedElement.id = null\n // Remove node selection effect\n $('.w').removeClass('jtk-tasks-active')\n}\n\n/**\n * Line click event\n */\nJSP.prototype.connectClick = function (e) {\n // Set svg color\n setSvgColor(e, '#0097e0')\n let $id = this.selectedElement.id\n if ($id) {\n $(`#${$id}`).removeClass('jtk-tasks-active')\n this.selectedElement.id = null\n }\n this.selectedElement.connect = e\n}\n\n/**\n * toolbarEvent\n * @param {Pointer}\n */\nJSP.prototype.handleEventPointer = function (is) {\n let wDom = $('.w')\n this.setConfig({\n isClick: is,\n isAttachment: false\n })\n wDom.removeClass('jtk-ep')\n if (!is) {\n wDom.removeClass('jtk-tasks-active')\n this.selectedElement = {}\n _.map($('#canvas svg'), v => {\n if ($(v).attr('class')) {\n _.map($(v).find('path'), v1 => {\n $(v1).attr('fill', '#555')\n $(v1).attr('stroke', '#555')\n })\n }\n })\n }\n}\n\n/**\n * toolbarEvent\n * @param {Line}\n */\nJSP.prototype.handleEventLine = function (is) {\n let wDom = $('.w')\n this.setConfig({\n isAttachment: is\n })\n is ? wDom.addClass('jtk-ep') : wDom.removeClass('jtk-ep')\n}\n\n/**\n * toolbarEvent\n * @param {Remove}\n */\nJSP.prototype.handleEventRemove = function () {\n let $id = this.selectedElement.id || null\n let $connect = this.selectedElement.connect || null\n if ($id) {\n this.removeNodes(this.selectedElement.id)\n } else {\n this.removeConnect($connect)\n }\n\n // Monitor whether to edit DAG\n store.commit('dag/setIsEditDag', true)\n}\n\n/**\n * Delete node\n */\nJSP.prototype.removeNodes = function ($id) {\n // Delete node processing(data-targetarr)\n _.map(tasksAll(), v => {\n let targetarr = v.targetarr.split(',')\n if (targetarr.length) {\n let newArr = _.filter(targetarr, v1 => v1 !== $id)\n $(`#${v.id}`).attr('data-targetarr', newArr.toString())\n }\n })\n // delete node\n this.JspInstance.remove($id)\n}\n\n/**\n * Delete connection\n */\nJSP.prototype.removeConnect = function ($connect) {\n if (!$connect) {\n return\n }\n // Remove connections and remove node and node dependencies\n let targetId = $connect.targetId\n let sourceId = $connect.sourceId\n let targetarr = rtTargetarrArr(targetId)\n if (targetarr.length) {\n targetarr = _.filter(targetarr, v => v !== sourceId)\n $(`#${targetId}`).attr('data-targetarr', targetarr.toString())\n }\n this.JspInstance.deleteConnection($connect)\n\n this.selectedElement = {}\n}\n\n/**\n * Copy node\n */\nJSP.prototype.copyNodes = function ($id) {\n let newNodeInfo = _.cloneDeep(_.find(store.state.dag.tasks, v => v.id === $id))\n let newNodePors = store.state.dag.locations[$id]\n // Unstored nodes do not allow replication\n if (!newNodePors) {\n return\n }\n // Generate random id\n let newUuId = `${uuid() + uuid()}`\n let id = newNodeInfo.id.length > 8 ? newNodeInfo.id.substr(0, 7) : newNodeInfo.id\n let name = newNodeInfo.name.length > 8 ? newNodeInfo.name.substr(0, 7) : newNodeInfo.name\n\n // new id\n let newId = `${id || ''}-${newUuId}`\n // new name\n let newName = `${name || ''}-${newUuId}`\n // coordinate x\n let newX = newNodePors.x + 100\n // coordinate y\n let newY = newNodePors.y + 40\n\n // Generate template node\n $('#canvas').append(rtTasksTpl({\n id: newId,\n name: newName,\n x: newX,\n y: newY,\n isAttachment: this.config.isAttachment,\n taskType: newNodeInfo.type\n }))\n\n // Get the generated node\n let thisDom = jsPlumb.getSelector('.statemachine-demo .w')\n\n // Copy node information\n newNodeInfo = Object.assign(newNodeInfo, {\n id: newId,\n name: newName\n })\n\n // Add new node\n store.commit('dag/addTasks', newNodeInfo)\n // Add node location information\n store.commit('dag/setLocations', {\n [newId]: {\n name: newName,\n targetarr: '',\n x: newX,\n y: newY\n }\n })\n\n // Generating a connection node\n this.JspInstance.batch(() => {\n this.initNode(thisDom[thisDom.length - 1])\n // Add events to nodes\n this.tasksEvent(newId)\n })\n}\n/**\n * toolbarEvent\n * @param {Screen}\n */\nJSP.prototype.handleEventScreen = function ({ item, is }) {\n let screenOpen = true\n if (is) {\n item.icon = ''\n screenOpen = true\n } else {\n item.icon = ''\n screenOpen = false\n }\n let $mainLayoutModel = $('.main-layout-model')\n if (screenOpen) {\n $mainLayoutModel.addClass('dag-screen')\n } else {\n $mainLayoutModel.removeClass('dag-screen')\n }\n}\n/**\n * save task\n * @param tasks\n * @param locations\n * @param connects\n */\nJSP.prototype.saveStore = function () {\n return new Promise((resolve, reject) => {\n let connects = []\n let locations = {}\n let tasks = []\n\n let is = (id) => {\n return !!_.filter(tasksAll(), v => v.id === id).length\n }\n\n // task\n _.map(_.cloneDeep(store.state.dag.tasks), v => {\n if (is(v.id)) {\n let preTasks = []\n let id = $(`#${v.id}`)\n let tar = id.attr('data-targetarr')\n let idDep = tar ? id.attr('data-targetarr').split(',') : []\n if (idDep.length) {\n _.map(idDep, v1 => {\n preTasks.push($(`#${v1}`).find('.name-p').text())\n })\n }\n\n let tasksParam = _.assign(v, {\n preTasks: preTasks\n })\n\n // Sub-workflow has no retries and interval\n if (v.type === 'SUB_PROCESS') {\n tasksParam = _.omit(tasksParam, ['maxRetryTimes', 'retryInterval'])\n }\n\n tasks.push(tasksParam)\n }\n })\n\n _.map(this.JspInstance.getConnections(), v => {\n connects.push({\n 'endPointSourceId': v.sourceId,\n 'endPointTargetId': v.targetId\n })\n })\n\n _.map(tasksAll(), v => {\n locations[v.id] = {\n name: v.name,\n targetarr: v.targetarr,\n x: v.x,\n y: v.y\n }\n })\n\n // Storage node\n store.commit('dag/setTasks', tasks)\n // Store coordinate information\n store.commit('dag/setLocations', locations)\n // Storage line dependence\n store.commit('dag/setConnects', connects)\n\n resolve({\n connects: connects,\n tasks: tasks,\n locations: locations\n })\n })\n}\n/**\n * Event processing\n */\nJSP.prototype.handleEvent = function () {\n this.JspInstance.bind('beforeDrop', function (info) {\n let sourceId = info['sourceId']// 出\n let targetId = info['targetId']// 入\n\n /**\n * Recursive search for nodes\n */\n let recursiveVal\n const recursiveTargetarr = (arr, targetId) => {\n for (var i in arr) {\n if (arr[i] === targetId) {\n recursiveVal = targetId\n } else {\n let recTargetarrArr = rtTargetarrArr(arr[i])\n if (recTargetarrArr.length) {\n recursiveTargetarr(recTargetarrArr, targetId)\n } else {\n return recursiveTargetarr(targetId)\n }\n }\n }\n return recursiveVal\n }\n\n // Connection to connected nodes is not allowed\n if (_.findIndex(rtTargetarrArr(targetId), v => v === sourceId) !== -1) {\n return false\n }\n\n // Recursive form to find if the target Targetarr has a sourceId\n if (recursiveTargetarr(rtTargetarrArr(sourceId), targetId)) {\n // setRecursiveVal(null)\n return false\n }\n\n // Storage node dependency information\n saveTargetarr(sourceId, targetId)\n\n // Monitor whether to edit DAG\n store.commit('dag/setIsEditDag', true)\n\n return true\n })\n}\n/**\n * Backfill data processing\n */\nJSP.prototype.jspBackfill = function ({ connects, locations, largeJson }) {\n // Backfill nodes\n this.jsonHandle({\n largeJson: largeJson,\n locations: locations\n })\n\n let wNodes = jsPlumb.getSelector('.statemachine-demo .w')\n\n // Backfill line\n this.JspInstance.batch(() => {\n for (let i = 0; i < wNodes.length; i++) {\n this.initNode(wNodes[i])\n }\n _.map(connects, v => {\n let sourceId = v.endPointSourceId.split('-')\n let targetId = v.endPointTargetId.split('-')\n if (sourceId.length === 4 && targetId.length === 4) {\n sourceId = `${sourceId[0]}-${sourceId[1]}-${sourceId[2]}`\n targetId = `${targetId[0]}-${targetId[1]}-${targetId[2]}`\n } else {\n sourceId = v.endPointSourceId\n targetId = v.endPointTargetId\n }\n\n this.JspInstance.connect({\n source: sourceId,\n target: targetId,\n type: 'basic',\n paintStyle: { strokeWidth: 2, stroke: '#555' }\n })\n })\n })\n\n jsPlumb.fire('jsPlumbDemoLoaded', this.JspInstance)\n\n // Connection monitoring\n this.handleEvent()\n\n // Drag and drop new nodes\n this.draggable()\n}\n\nexport default new JSP()\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/udp/udp.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/localParams.vue","\nimport Vue from 'vue'\nimport mAffirm from './jumpAffirm'\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\nimport { uuid, findComponentDownward } from '@/module/util/'\n\nlet Affirm = {}\nlet $root = {}\nlet $routerType = ''\nlet $isPop = true\n\n/**\n * Listen for route changes\n */\nrouter.beforeEach((to, from, next) => {\n if (from.name === 'projects-definition-details' || from.name === 'projects-instance-details' || from.name === 'definition-create') {\n if (!Affirm.paramVerification(from.name)) {\n Affirm.isPop(() => {\n next()\n })\n } else {\n next()\n }\n } else {\n next()\n }\n})\n\n/**\n * Get judgment initialization data\n */\nAffirm.init = (root) => {\n $isPop = true\n $root = root\n $routerType = router.history.current.name\n}\n\n/**\n * Parameter verification\n */\nAffirm.paramVerification = (name) => {\n if (!$isPop) {\n return true\n }\n let dagStore = store.state.dag\n let flag = false\n if ($routerType === 'definition-create') {\n // No nodes jump out directly\n if (dagStore.tasks.length) {\n if (!dagStore.name) {\n store.commit('dag/setName', `${uuid('dag_')}${uuid() + uuid()}`)\n }\n flag = false\n } else {\n flag = true\n }\n } else {\n // View history direct jump\n flag = name === 'projects-instance-details' ? true : !dagStore.isEditDag\n }\n return flag\n}\n\n/**\n * Pop-up judgment\n */\nAffirm.isPop = (fn) => {\n Vue.$modal.dialog({\n closable: false,\n showMask: true,\n escClose: true,\n className: 'v-modal-custom',\n transitionName: 'opacityp',\n render (h) {\n return h(mAffirm, {\n on: {\n ok () {\n // save\n findComponentDownward($root, 'dag-chart')._save('affirm').then(() => {\n fn()\n Vue.$modal.destroy()\n }).catch(() => {\n fn()\n Vue.$modal.destroy()\n })\n },\n close () {\n fn()\n Vue.$modal.destroy()\n }\n },\n props: {\n }\n })\n }\n })\n}\n\n/**\n * Whether the external setting pops up\n */\nAffirm.setIsPop = (is) => {\n $isPop = is\n}\n\nexport default Affirm\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/jumpAffirm/index.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/jumpAffirm/jumpAffirm.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/formModel.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/listBox.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/resources.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/udfs.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/sqlType.vue","var normalizeComponent = require(\"!../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./datasource.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./datasource.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-62aa87e3\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./datasource.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/dag/_source/formModel/tasks/_source/datasource.vue\n// module id = 786\n// module chunks = 3 4 5","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/datasource.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/procedure.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/dependItemList.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/sub_process.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/_source/selectInput.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/_source/timeoutAlarm.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-2175c153\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./start.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./start.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./start.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-2175c153\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./start.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue\n// module id = 798\n// module chunks = 0 3 4 5","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\n\nexport default {\n data () {\n return {\n router,\n store,\n isDetails: false\n }\n },\n created () {\n this.isDetails = this.store.state.dag.isDetails\n },\n methods: {\n },\n computed: {\n _isDetails () {\n return this.isDetails ? 'icon-disabled' : ''\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/module/mixin/disabledState.js","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n// This is CodeMirror (https://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\//.test(userAgent);\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\\/\\w+/.test(userAgent);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt() {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var activeElement;\n try {\n activeElement = document.activeElement;\n } catch(e) {\n activeElement = document.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {this.id = null;};\n Delayed.prototype.set = function (ms, f) {\n clearTimeout(this.id);\n this.id = setTimeout(f, ms);\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 30;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\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]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n input.init(d);\n }\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n // Add a span to a line.\n function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers || (emitter._handlers = {});\n map$$1[type] = (map$$1[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers, arr = map$$1 && map$$1[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map$$1[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range$$1;\n try {range$$1 = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range$$1 || range$$1.parentElement() != te) { return false }\n return range$$1.compareEndPoints(\"StartToEnd\", range$$1) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var this$1 = this;\n\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n var this$1 = this;\n\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this$1.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\s)\" + lineClass[2] + \"(?:$|\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {\n var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (node.className == \"CodeMirror-linewidget\")\n { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\");\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map$$1, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map$$1.length; i += 3) {\n mStart = map$$1[i];\n mEnd = map$$1[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map$$1.length - 3 || ch == mEnd && map$$1[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map$$1[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map$$1[i - 2] == map$$1[i - 3] && map$$1[i - 1].insertLeft) {\n node = map$$1[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map$$1.length - 3 && map$$1[i + 3] == map$$1[i + 4] && !map$$1[i + 5].insertLeft) {\n node = map$$1[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX() {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }\n return window.pageXOffset || (document.documentElement || document.body).scrollLeft\n }\n function pageScrollY() {\n if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }\n return window.pageYOffset || (document.documentElement || document.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var height = 0;\n if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above)\n { height += widgetHeight(lineObj.widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = true; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo$$1, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight$$1 = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo$$1, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight$$1; box.bottom += widgetHeight$$1;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight$$1 <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo$$1, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top || y >= coords.bottom;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo$$1, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo$$1, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo$$1, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo$$1, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range$$1 = doc.sel.ranges[i];\n if (range$$1.from().line >= cm.display.viewTo || range$$1.to().line < cm.display.viewFrom) { continue }\n var collapsed = range$$1.empty();\n if (collapsed || cm.options.showCursorWhenSelecting)\n { drawSelectionCursor(cm, range$$1.head, curFragment); }\n if (!collapsed)\n { drawSelectionRange(cm, range$$1, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\"; },\n cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n onBlur(cm);\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range$$1) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range$$1;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val);\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.pointerEvents = this.vert.style.pointerEvents = \"none\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.pointerEvents = \"auto\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt$$1 = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt$$1 != bar) { bar.style.pointerEvents = \"none\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt();\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this$1.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt();\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = window.getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }\n snapshot.activeElt.focus();\n if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var sel = window.getSelection(), range$$1 = document.createRange();\n range$$1.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range$$1.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range$$1);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(cm) {\n var width = cm.display.gutters.offsetWidth;\n cm.display.sizer.style.marginLeft = width + \"px\";\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }\n\n // Make sure the gutters options contains the element\n // \"CodeMirror-linenumbers\" when the lineNumbers option is true.\n function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && wheelPixelsPerUnit != null) {\n var pixels = dy * wheelPixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n var this$1 = this;\n\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this$1.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var this$1 = this;\n\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this$1.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n var this$1 = this;\n\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this$1.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(startGen) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = startGen || 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm)\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n var this$1 = this;\n\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this$1;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n var this$1 = this;\n\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this$1.lines[i];\n this$1.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var e = at + n; at < e; ++at)\n { if (op(this$1.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n var this$1 = this;\n\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this$1;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n var this$1 = this;\n\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this$1.height -= oldHeight - child.height;\n if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this$1.children.splice(++i, 0, leaf);\n leaf.parent = this$1;\n }\n child.lines = child.lines.slice(0, remaining);\n this$1.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n var this$1 = this;\n\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this$1[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var this$1 = this;\n\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n var this$1 = this;\n\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null));\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n var this$1 = this;\n\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this$1; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this$1.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range$$1 = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range$$1.head; }\n else if (start == \"anchor\") { pos = range$$1.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range$$1.to(); }\n else { pos = range$$1.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n var this$1 = this;\n\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this$1, ranges[i].anchor),\n clipPos(this$1, ranges[i].head)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var this$1 = this;\n\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var this$1 = this;\n\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var this$1 = this;\n\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range$$1 = sel.ranges[i];\n changes[i] = {from: range$$1.from(), to: range$$1.to(), text: this$1.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this$1, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {this.history = new History(this.history.maxGeneration);},\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history.maxGeneration);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo$$1 = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo$$1 == from.line && from.ch >= span.to ||\n span.from == null && lineNo$$1 != from.line ||\n span.from != null && lineNo$$1 == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo$$1;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo$$1 = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo$$1;\n });\n return clipPos(this, Pos(lineNo$$1, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n var this$1 = this;\n\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this$1.linked[i];\n if (link.doc != other) { continue }\n this$1.linked.splice(i, 1);\n other.unlinkDoc(this$1);\n detachSharedMarkers(findSharedMarkers(this$1));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var loadFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1)\n { return }\n\n var reader = new FileReader;\n reader.onload = operation(cm, function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) { content = \"\"; }\n text[i] = content;\n if (++read == n) {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)));\n }\n });\n reader.readAsText(file);\n };\n for (var i = 0; i < n; ++i) { loadFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 127: \"Delete\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Alt-F\": \"goWordRight\", \"Alt-B\": \"goWordLeft\", \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\",\n \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\", \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\",\n \"Alt-D\": \"delWordAfter\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\", \"Ctrl-T\": \"transposeChars\",\n \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map$$1, handle, context) {\n map$$1 = getKeyMap(map$$1);\n var found = map$$1.call ? map$$1.call(key, context) : map$$1[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map$$1.fallthrough) {\n if (Object.prototype.toString.call(map$$1.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map$$1.fallthrough, handle, context) }\n for (var i = 0; i < map$$1.fallthrough.length; i++) {\n var result = lookupKey(key, map$$1.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Cmd\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"char\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(0, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n cm.curOp.focus = activeElt();\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if (webkit || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n delayBlurEvent(cm);\n setTimeout(function () { return display.input.focus(); }, 20);\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.options.gutters.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.options.gutters[i];\n signal(cm, type, cm, line, gutter, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b-\\u200f\\u2028\\u2029\\ufeff]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n guttersChanged(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"firstLineNumber\", 1, guttersChanged, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, guttersChanged, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function guttersChanged(cm) {\n updateGutters(cm);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n setGuttersForLineNumbers(options);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input);\n display.wrapper.CodeMirror = this;\n updateGutters(this);\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(bind(onFocus, this), 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this$1, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range$$1 = sel.ranges[i$1];\n var from = range$$1.from(), to = range$$1.to();\n if (range$$1.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == inserted)\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput)\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range$$1 = sel.ranges[i];\n if (range$$1.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range$$1.head.line)) { continue }\n var mode = cm.getModeAt(range$$1.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range$$1.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range$$1.head.line).text.slice(0, range$$1.head.ch)))\n { indented = indentLine(cm, range$$1.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range$$1.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", !!autocorrect);\n field.setAttribute(\"autocapitalize\", !!autocapitalize);\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n disableBrowserMagic(te);\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map$$1, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n },\n removeKeyMap: function(map$$1) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this$1.state.modeGen++;\n regChange(this$1);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range$$1 = ranges[i];\n if (!range$$1.empty()) {\n var from = range$$1.from(), to = range$$1.to();\n var start = Math.max(end, from.line);\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how); }\n var newRanges = this$1.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range$$1.head.line > end) {\n indentLine(this$1, range$$1.head.line, how, true);\n end = range$$1.head.line;\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range$$1 = this.doc.sel.primary();\n if (start == null) { pos = range$$1.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range$$1.from() : range$$1.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range$$1) {\n if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range$$1) {\n var other = findPosH(doc, range$$1.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this$1, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range$$1) {\n if (collapse)\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range$$1 == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range$$1, margin) {\n if (range$$1 == null) {\n range$$1 = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range$$1 == \"number\") {\n range$$1 = {from: Pos(range$$1, 0), to: null};\n } else if (range$$1.from == null) {\n range$$1 = {from: range$$1, to: null};\n }\n if (!range$$1.to) { range$$1.to = range$$1.from; }\n range$$1.margin = margin || 0;\n\n if (range$$1.from.line != null) {\n scrollToRange(this, range$$1);\n } else {\n scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo$$1 = this.display.viewFrom;\n this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n ++lineNo$$1;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"char\", \"column\" (like char, but doesn't\n // cross line boundaries), \"word\" (across next word), or \"group\" (to\n // the start of next group of word or non-word-non-whitespace\n // chars). The visually param controls whether, in right-to-left\n // text, direction 1 means to move towards the next index in the\n // string, or towards the character to the right of the current\n // position. The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n function findNextLine() {\n var l = pos.line + dir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n on(div, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = document.activeElement;\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = this.cm.state.focused;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map$$1 = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map$$1[map$$1.length - 1], offset: map$$1[map$$1.length - 2] - map$$1[map$$1.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor())\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var input = this;\n if (this.selectionInEditor())\n { this.pollSelection(); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range$$1;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range$$1 = found[0].find(0)))\n { addText(getBetween(cm.doc, range$$1.from, range$$1.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map$$1 = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map$$1.length; j += 3) {\n var curNode = map$$1[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map$$1[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map$$1[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing) { return }\n var cm = this.cm;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt() != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { window.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt();\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, …*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.45.0\";\n\n return CodeMirror;\n\n})));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/lib/codemirror.js\n// module id = 644\n// module chunks = 3 4 5 7 8 14","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-f72bdd3a\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./secondaryMenu.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./secondaryMenu.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./secondaryMenu.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-f72bdd3a\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./secondaryMenu.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/secondaryMenu/secondaryMenu.vue\n// module id = 654\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 25 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/priority/priority.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport _ from 'lodash'\nimport $ from 'jquery'\nimport i18n from '@/module/i18n'\nimport store from '@/conf/home/store'\n\n/**\n * Node, to array\n */\nconst rtTargetarrArr = (id) => {\n let a = $(`#${id}`).attr('data-targetarr')\n return a ? a.split(',') : []\n}\n\n/**\n * Store node id to targetarr\n */\nconst saveTargetarr = (valId, domId) => {\n let $target = $(`#${domId}`)\n let targetStr = $target.attr('data-targetarr') ? $target.attr('data-targetarr') + `,${valId}` : `${valId}`\n $target.attr('data-targetarr', targetStr)\n}\n\nconst rtBantpl = () => {\n return ``\n}\n\n/**\n * return node html\n */\nconst rtTasksTpl = ({ id, name, x, y, targetarr, isAttachment, taskType,runFlag }) => {\n let tpl = ``\n tpl += `
`\n tpl += `
`\n tpl += `
`\n tpl += `
`\n tpl += `${name}`\n tpl += `
`\n tpl += `
`\n tpl += `
`\n if (runFlag === 'FORBIDDEN') {\n tpl += rtBantpl()\n }\n tpl += `
`\n tpl += `
`\n\n return tpl\n}\n\n/**\n * Get all tasks nodes\n */\nconst tasksAll = () => {\n let a = []\n $('#canvas .w').each(function (idx, elem) {\n let e = $(elem)\n a.push({\n id: e.attr('id'),\n name: e.find('.name-p').text(),\n targetarr: e.attr('data-targetarr') || '',\n x: parseInt(e.css('left'), 10),\n y: parseInt(e.css('top'), 10)\n })\n })\n return a\n}\n\n/**\n * Determine if name is in the current dag map\n * rely dom / backfill\n */\nconst isNameExDag = (name, rely) => {\n if (rely === 'dom') {\n return _.findIndex(tasksAll(), v => v.name === name) !== -1\n } else {\n return _.findIndex(store.state.dag.tasks, v => v.name === name) !== -1\n }\n}\n\n/**\n * Change svg line color\n */\nconst setSvgColor = (e, color) => {\n // Traverse clear all colors\n $('.jtk-connector').each((i, o) => {\n _.map($(o)[0].childNodes, v => {\n $(v).attr('fill', '#555').attr('stroke', '#555').attr('stroke-width', 2)\n })\n })\n\n // Add color to the selection\n _.map($(e.canvas)[0].childNodes, (v, i) => {\n $(v).attr('fill', color).attr('stroke', color)\n if ($(v).attr('class')) {\n $(v).attr('stroke-width', 2)\n }\n })\n}\n\n/**\n * Get all node ids\n */\nconst allNodesId = () => {\n let idArr = []\n $('.w').each((i, o) => {\n let $obj = $(o)\n let $span = $obj.find('.name-p').text()\n if ($span) {\n idArr.push({\n id: $obj.attr('id'),\n name: $span\n })\n }\n })\n return idArr\n}\n\nexport {\n rtTargetarrArr,\n saveTargetarr,\n rtTasksTpl,\n tasksAll,\n isNameExDag,\n setSvgColor,\n allNodesId,\n rtBantpl\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/plugIn/util.js","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-5b25ea8f\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./resources.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./resources.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./resources.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-5b25ea8f\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./resources.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/dag/_source/formModel/tasks/_source/resources.vue\n// module id = 699\n// module chunks = 3 4 5","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-6a4fc01c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./priority.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./priority.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./priority.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-6a4fc01c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./priority.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/priority/priority.vue\n// module id = 700\n// module chunks = 0 3 4 5 6","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport i18n from '@/module/i18n'\n/**\n * download file\n */\nlet downloadFile = ($url, $obj) => {\n let param = {\n url: $url,\n obj: $obj\n }\n\n if (!param.url) {\n this.$message.warning(`${i18n.$t('无下载url无法下载')}`)\n return\n }\n\n let generatorInput = function (obj) {\n let result = ''\n let keyArr = Object.keys(obj)\n keyArr.forEach(function (key) {\n result += \"\"\n })\n return result\n }\n $(`
${generatorInput(param.obj)}
`).appendTo('body').submit().remove()\n}\n\nexport { downloadFile }\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/module/download/index.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue","/**\n * jsBezier\n *\n * Copyright (c) 2010 - 2017 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * licensed under the MIT license.\n *\n * a set of Bezier curve functions that deal with Beziers, used by jsPlumb, and perhaps useful for other people. These functions work with Bezier\n * curves of arbitrary degree.\n *\n * - functions are all in the 'jsBezier' namespace.\n *\n * - all input points should be in the format {x:.., y:..}. all output points are in this format too.\n *\n * - all input curves should be in the format [ {x:.., y:..}, {x:.., y:..}, {x:.., y:..}, {x:.., y:..} ]\n *\n * - 'location' as used as an input here refers to a decimal in the range 0-1 inclusive, which indicates a point some proportion along the length\n * of the curve. location as output has the same format and meaning.\n *\n *\n * Function List:\n * --------------\n *\n * distanceFromCurve(point, curve)\n *\n * \tCalculates the distance that the given point lies from the given Bezier. Note that it is computed relative to the center of the Bezier,\n * so if you have stroked the curve with a wide pen you may wish to take that into account! The distance returned is relative to the values\n * of the curve and the point - it will most likely be pixels.\n *\n * gradientAtPoint(curve, location)\n *\n * \tCalculates the gradient to the curve at the given location, as a decimal between 0 and 1 inclusive.\n *\n * gradientAtPointAlongCurveFrom (curve, location)\n *\n *\tCalculates the gradient at the point on the given curve that is 'distance' units from location.\n *\n * nearestPointOnCurve(point, curve)\n *\n *\tCalculates the nearest point to the given point on the given curve. The return value of this is a JS object literal, containing both the\n *point's coordinates and also the 'location' of the point (see above), for example: { point:{x:551,y:150}, location:0.263365 }.\n *\n * pointOnCurve(curve, location)\n *\n * \tCalculates the coordinates of the point on the given Bezier curve at the given location.\n *\n * pointAlongCurveFrom(curve, location, distance)\n *\n * \tCalculates the coordinates of the point on the given curve that is 'distance' units from location. 'distance' should be in the same coordinate\n * space as that used to construct the Bezier curve. For an HTML Canvas usage, for example, distance would be a measure of pixels.\n *\n * locationAlongCurveFrom(curve, location, distance)\n *\n * \tCalculates the location on the given curve that is 'distance' units from location. 'distance' should be in the same coordinate\n * space as that used to construct the Bezier curve. For an HTML Canvas usage, for example, distance would be a measure of pixels.\n *\n * perpendicularToCurveAt(curve, location, length, distance)\n *\n * \tCalculates the perpendicular to the given curve at the given location. length is the length of the line you wish for (it will be centered\n * on the point at 'location'). distance is optional, and allows you to specify a point along the path from the given location as the center of\n * the perpendicular returned. The return value of this is an array of two points: [ {x:...,y:...}, {x:...,y:...} ].\n *\n *\n */\n\n(function() {\n\n var root = this;\n\n if(typeof Math.sgn == \"undefined\") {\n Math.sgn = function(x) { return x == 0 ? 0 : x > 0 ? 1 :-1; };\n }\n\n var Vectors = {\n subtract \t: \tfunction(v1, v2) { return {x:v1.x - v2.x, y:v1.y - v2.y }; },\n dotProduct\t: \tfunction(v1, v2) { return (v1.x * v2.x) + (v1.y * v2.y); },\n square\t\t:\tfunction(v) { return Math.sqrt((v.x * v.x) + (v.y * v.y)); },\n scale\t\t:\tfunction(v, s) { return {x:v.x * s, y:v.y * s }; }\n },\n\n maxRecursion = 64,\n flatnessTolerance = Math.pow(2.0,-maxRecursion-1);\n\n /**\n * Calculates the distance that the point lies from the curve.\n *\n * @param point a point in the form {x:567, y:3342}\n * @param curve a Bezier curve in the form [{x:..., y:...}, {x:..., y:...}, {x:..., y:...}, {x:..., y:...}]. note that this is currently\n * hardcoded to assume cubiz beziers, but would be better off supporting any degree.\n * @return a JS object literal containing location and distance, for example: {location:0.35, distance:10}. Location is analogous to the location\n * argument you pass to the pointOnPath function: it is a ratio of distance travelled along the curve. Distance is the distance in pixels from\n * the point to the curve.\n */\n var _distanceFromCurve = function(point, curve) {\n var candidates = [],\n w = _convertToBezier(point, curve),\n degree = curve.length - 1, higherDegree = (2 * degree) - 1,\n numSolutions = _findRoots(w, higherDegree, candidates, 0),\n v = Vectors.subtract(point, curve[0]), dist = Vectors.square(v), t = 0.0;\n\n for (var i = 0; i < numSolutions; i++) {\n v = Vectors.subtract(point, _bezier(curve, degree, candidates[i], null, null));\n var newDist = Vectors.square(v);\n if (newDist < dist) {\n dist = newDist;\n t = candidates[i];\n }\n }\n v = Vectors.subtract(point, curve[degree]);\n newDist = Vectors.square(v);\n if (newDist < dist) {\n dist = newDist;\n t = 1.0;\n }\n return {location:t, distance:dist};\n };\n /**\n * finds the nearest point on the curve to the given point.\n */\n var _nearestPointOnCurve = function(point, curve) {\n var td = _distanceFromCurve(point, curve);\n return {point:_bezier(curve, curve.length - 1, td.location, null, null), location:td.location};\n };\n var _convertToBezier = function(point, curve) {\n var degree = curve.length - 1, higherDegree = (2 * degree) - 1,\n c = [], d = [], cdTable = [], w = [],\n z = [ [1.0, 0.6, 0.3, 0.1], [0.4, 0.6, 0.6, 0.4], [0.1, 0.3, 0.6, 1.0] ];\n\n for (var i = 0; i <= degree; i++) c[i] = Vectors.subtract(curve[i], point);\n for (var i = 0; i <= degree - 1; i++) {\n d[i] = Vectors.subtract(curve[i+1], curve[i]);\n d[i] = Vectors.scale(d[i], 3.0);\n }\n for (var row = 0; row <= degree - 1; row++) {\n for (var column = 0; column <= degree; column++) {\n if (!cdTable[row]) cdTable[row] = [];\n cdTable[row][column] = Vectors.dotProduct(d[row], c[column]);\n }\n }\n for (i = 0; i <= higherDegree; i++) {\n if (!w[i]) w[i] = [];\n w[i].y = 0.0;\n w[i].x = parseFloat(i) / higherDegree;\n }\n var n = degree, m = degree-1;\n for (var k = 0; k <= n + m; k++) {\n var lb = Math.max(0, k - m),\n ub = Math.min(k, n);\n for (i = lb; i <= ub; i++) {\n var j = k - i;\n w[i+j].y += cdTable[j][i] * z[j][i];\n }\n }\n return w;\n };\n /**\n * counts how many roots there are.\n */\n var _findRoots = function(w, degree, t, depth) {\n var left = [], right = [],\n left_count, right_count,\n left_t = [], right_t = [];\n\n switch (_getCrossingCount(w, degree)) {\n case 0 : {\n return 0;\n }\n case 1 : {\n if (depth >= maxRecursion) {\n t[0] = (w[0].x + w[degree].x) / 2.0;\n return 1;\n }\n if (_isFlatEnough(w, degree)) {\n t[0] = _computeXIntercept(w, degree);\n return 1;\n }\n break;\n }\n }\n _bezier(w, degree, 0.5, left, right);\n left_count = _findRoots(left, degree, left_t, depth+1);\n right_count = _findRoots(right, degree, right_t, depth+1);\n for (var i = 0; i < left_count; i++) t[i] = left_t[i];\n for (var i = 0; i < right_count; i++) t[i+left_count] = right_t[i];\n return (left_count+right_count);\n };\n var _getCrossingCount = function(curve, degree) {\n var n_crossings = 0, sign, old_sign;\n sign = old_sign = Math.sgn(curve[0].y);\n for (var i = 1; i <= degree; i++) {\n sign = Math.sgn(curve[i].y);\n if (sign != old_sign) n_crossings++;\n old_sign = sign;\n }\n return n_crossings;\n };\n var _isFlatEnough = function(curve, degree) {\n var error,\n intercept_1, intercept_2, left_intercept, right_intercept,\n a, b, c, det, dInv, a1, b1, c1, a2, b2, c2;\n a = curve[0].y - curve[degree].y;\n b = curve[degree].x - curve[0].x;\n c = curve[0].x * curve[degree].y - curve[degree].x * curve[0].y;\n\n var max_distance_above, max_distance_below;\n max_distance_above = max_distance_below = 0.0;\n\n for (var i = 1; i < degree; i++) {\n var value = a * curve[i].x + b * curve[i].y + c;\n if (value > max_distance_above)\n max_distance_above = value;\n else if (value < max_distance_below)\n max_distance_below = value;\n }\n\n a1 = 0.0; b1 = 1.0; c1 = 0.0; a2 = a; b2 = b;\n c2 = c - max_distance_above;\n det = a1 * b2 - a2 * b1;\n dInv = 1.0/det;\n intercept_1 = (b1 * c2 - b2 * c1) * dInv;\n a2 = a; b2 = b; c2 = c - max_distance_below;\n det = a1 * b2 - a2 * b1;\n dInv = 1.0/det;\n intercept_2 = (b1 * c2 - b2 * c1) * dInv;\n left_intercept = Math.min(intercept_1, intercept_2);\n right_intercept = Math.max(intercept_1, intercept_2);\n error = right_intercept - left_intercept;\n return (error < flatnessTolerance)? 1 : 0;\n };\n var _computeXIntercept = function(curve, degree) {\n var XLK = 1.0, YLK = 0.0,\n XNM = curve[degree].x - curve[0].x, YNM = curve[degree].y - curve[0].y,\n XMK = curve[0].x - 0.0, YMK = curve[0].y - 0.0,\n det = XNM*YLK - YNM*XLK, detInv = 1.0/det,\n S = (XNM*YMK - YNM*XMK) * detInv;\n return 0.0 + XLK * S;\n };\n var _bezier = function(curve, degree, t, left, right) {\n var temp = [[]];\n for (var j =0; j <= degree; j++) temp[0][j] = curve[j];\n for (var i = 1; i <= degree; i++) {\n for (var j =0 ; j <= degree - i; j++) {\n if (!temp[i]) temp[i] = [];\n if (!temp[i][j]) temp[i][j] = {};\n temp[i][j].x = (1.0 - t) * temp[i-1][j].x + t * temp[i-1][j+1].x;\n temp[i][j].y = (1.0 - t) * temp[i-1][j].y + t * temp[i-1][j+1].y;\n }\n }\n if (left != null)\n for (j = 0; j <= degree; j++) left[j] = temp[j][0];\n if (right != null)\n for (j = 0; j <= degree; j++) right[j] = temp[degree-j][j];\n\n return (temp[degree][0]);\n };\n\n var _curveFunctionCache = {};\n var _getCurveFunctions = function(order) {\n var fns = _curveFunctionCache[order];\n if (!fns) {\n fns = [];\n var f_term = function() { return function(t) { return Math.pow(t, order); }; },\n l_term = function() { return function(t) { return Math.pow((1-t), order); }; },\n c_term = function(c) { return function(t) { return c; }; },\n t_term = function() { return function(t) { return t; }; },\n one_minus_t_term = function() { return function(t) { return 1-t; }; },\n _termFunc = function(terms) {\n return function(t) {\n var p = 1;\n for (var i = 0; i < terms.length; i++) p = p * terms[i](t);\n return p;\n };\n };\n\n fns.push(new f_term()); // first is t to the power of the curve order\n for (var i = 1; i < order; i++) {\n var terms = [new c_term(order)];\n for (var j = 0 ; j < (order - i); j++) terms.push(new t_term());\n for (var j = 0 ; j < i; j++) terms.push(new one_minus_t_term());\n fns.push(new _termFunc(terms));\n }\n fns.push(new l_term()); // last is (1-t) to the power of the curve order\n\n _curveFunctionCache[order] = fns;\n }\n\n return fns;\n };\n\n\n /**\n * calculates a point on the curve, for a Bezier of arbitrary order.\n * @param curve an array of control points, eg [{x:10,y:20}, {x:50,y:50}, {x:100,y:100}, {x:120,y:100}]. For a cubic bezier this should have four points.\n * @param location a decimal indicating the distance along the curve the point should be located at. this is the distance along the curve as it travels, taking the way it bends into account. should be a number from 0 to 1, inclusive.\n */\n var _pointOnPath = function(curve, location) {\n var cc = _getCurveFunctions(curve.length - 1),\n _x = 0, _y = 0;\n for (var i = 0; i < curve.length ; i++) {\n _x = _x + (curve[i].x * cc[i](location));\n _y = _y + (curve[i].y * cc[i](location));\n }\n\n return {x:_x, y:_y};\n };\n\n var _dist = function(p1,p2) {\n return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));\n };\n\n var _isPoint = function(curve) {\n return curve[0].x === curve[1].x && curve[0].y === curve[1].y;\n };\n\n /**\n * finds the point that is 'distance' along the path from 'location'. this method returns both the x,y location of the point and also\n * its 'location' (proportion of travel along the path); the method below - _pointAlongPathFrom - calls this method and just returns the\n * point.\n */\n var _pointAlongPath = function(curve, location, distance) {\n\n if (_isPoint(curve)) {\n return {\n point:curve[0],\n location:location\n };\n }\n\n var prev = _pointOnPath(curve, location),\n tally = 0,\n curLoc = location,\n direction = distance > 0 ? 1 : -1,\n cur = null;\n\n while (tally < Math.abs(distance)) {\n curLoc += (0.005 * direction);\n cur = _pointOnPath(curve, curLoc);\n tally += _dist(cur, prev);\n prev = cur;\n }\n return {point:cur, location:curLoc};\n };\n\n var _length = function(curve) {\n if (_isPoint(curve)) return 0;\n\n var prev = _pointOnPath(curve, 0),\n tally = 0,\n curLoc = 0,\n direction = 1,\n cur = null;\n\n while (curLoc < 1) {\n curLoc += (0.005 * direction);\n cur = _pointOnPath(curve, curLoc);\n tally += _dist(cur, prev);\n prev = cur;\n }\n return tally;\n };\n\n /**\n * finds the point that is 'distance' along the path from 'location'.\n */\n var _pointAlongPathFrom = function(curve, location, distance) {\n return _pointAlongPath(curve, location, distance).point;\n };\n\n /**\n * finds the location that is 'distance' along the path from 'location'.\n */\n var _locationAlongPathFrom = function(curve, location, distance) {\n return _pointAlongPath(curve, location, distance).location;\n };\n\n /**\n * returns the gradient of the curve at the given location, which is a decimal between 0 and 1 inclusive.\n *\n * thanks // http://bimixual.org/AnimationLibrary/beziertangents.html\n */\n var _gradientAtPoint = function(curve, location) {\n var p1 = _pointOnPath(curve, location),\n p2 = _pointOnPath(curve.slice(0, curve.length - 1), location),\n dy = p2.y - p1.y, dx = p2.x - p1.x;\n return dy === 0 ? Infinity : Math.atan(dy / dx);\n };\n\n /**\n returns the gradient of the curve at the point which is 'distance' from the given location.\n if this point is greater than location 1, the gradient at location 1 is returned.\n if this point is less than location 0, the gradient at location 0 is returned.\n */\n var _gradientAtPointAlongPathFrom = function(curve, location, distance) {\n var p = _pointAlongPath(curve, location, distance);\n if (p.location > 1) p.location = 1;\n if (p.location < 0) p.location = 0;\n return _gradientAtPoint(curve, p.location);\n };\n\n /**\n * calculates a line that is 'length' pixels long, perpendicular to, and centered on, the path at 'distance' pixels from the given location.\n * if distance is not supplied, the perpendicular for the given location is computed (ie. we set distance to zero).\n */\n var _perpendicularToPathAt = function(curve, location, length, distance) {\n distance = distance == null ? 0 : distance;\n var p = _pointAlongPath(curve, location, distance),\n m = _gradientAtPoint(curve, p.location),\n _theta2 = Math.atan(-1 / m),\n y = length / 2 * Math.sin(_theta2),\n x = length / 2 * Math.cos(_theta2);\n return [{x:p.point.x + x, y:p.point.y + y}, {x:p.point.x - x, y:p.point.y - y}];\n };\n\n /**\n * Calculates all intersections of the given line with the given curve.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param curve\n * @returns {Array}\n */\n var _lineIntersection = function(x1, y1, x2, y2, curve) {\n var a = y2 - y1,\n b = x1 - x2,\n c = (x1 * (y1 - y2)) + (y1 * (x2-x1)),\n coeffs = _computeCoefficients(curve),\n p = [\n (a*coeffs[0][0]) + (b * coeffs[1][0]),\n (a*coeffs[0][1])+(b*coeffs[1][1]),\n (a*coeffs[0][2])+(b*coeffs[1][2]),\n (a*coeffs[0][3])+(b*coeffs[1][3]) + c\n ],\n r = _cubicRoots.apply(null, p),\n intersections = [];\n\n if (r != null) {\n\n for (var i = 0; i < 3; i++) {\n var t = r[i],\n t2 = Math.pow(t, 2),\n t3 = Math.pow(t, 3),\n x = [\n (coeffs[0][0] * t3) + (coeffs[0][1] * t2) + (coeffs[0][2] * t) + coeffs[0][3],\n (coeffs[1][0] * t3) + (coeffs[1][1] * t2) + (coeffs[1][2] * t) + coeffs[1][3]\n ];\n\n // check bounds of the line\n var s;\n if ((x2 - x1) !== 0) {\n s = (x[0] - x1) / (x2 - x1);\n }\n else {\n s = (x[1] - y1) / (y2 - y1);\n }\n\n if (t >= 0 && t <= 1.0 && s >= 0 && s <= 1.0) {\n intersections.push(x);\n }\n }\n }\n\n return intersections;\n };\n\n /**\n * Calculates all intersections of the given box with the given curve.\n * @param x X position of top left corner of box\n * @param y Y position of top left corner of box\n * @param w width of box\n * @param h height of box\n * @param curve\n * @returns {Array}\n */\n var _boxIntersection = function(x, y, w, h, curve) {\n var i = [];\n i.push.apply(i, _lineIntersection(x, y, x + w, y, curve));\n i.push.apply(i, _lineIntersection(x + w, y, x + w, y + h, curve));\n i.push.apply(i, _lineIntersection(x + w, y + h, x, y + h, curve));\n i.push.apply(i, _lineIntersection(x, y + h, x, y, curve));\n return i;\n };\n\n /**\n * Calculates all intersections of the given bounding box with the given curve.\n * @param boundingBox Bounding box, in { x:.., y:..., w:..., h:... } format.\n * @param curve\n * @returns {Array}\n */\n var _boundingBoxIntersection = function(boundingBox, curve) {\n var i = [];\n i.push.apply(i, _lineIntersection(boundingBox.x, boundingBox.y, boundingBox.x + boundingBox.w, boundingBox.y, curve));\n i.push.apply(i, _lineIntersection(boundingBox.x + boundingBox.w, boundingBox.y, boundingBox.x + boundingBox.w, boundingBox.y + boundingBox.h, curve));\n i.push.apply(i, _lineIntersection(boundingBox.x + boundingBox.w, boundingBox.y + boundingBox.h, boundingBox.x, boundingBox.y + boundingBox.h, curve));\n i.push.apply(i, _lineIntersection(boundingBox.x, boundingBox.y + boundingBox.h, boundingBox.x, boundingBox.y, curve));\n return i;\n };\n\n\n function _computeCoefficientsForAxis(curve, axis) {\n return [\n -(curve[0][axis]) + (3*curve[1][axis]) + (-3 * curve[2][axis]) + curve[3][axis],\n (3*(curve[0][axis])) - (6*(curve[1][axis])) + (3*(curve[2][axis])),\n -3*curve[0][axis] + 3*curve[1][axis],\n curve[0][axis]\n ];\n }\n\n function _computeCoefficients(curve)\n {\n return [\n _computeCoefficientsForAxis(curve, \"x\"),\n _computeCoefficientsForAxis(curve, \"y\")\n ];\n }\n\n function sgn(x) {\n return x < 0 ? -1 : x > 0 ? 1 : 0;\n }\n\n function _cubicRoots(a, b, c, d) {\n var A = b / a,\n B = c / a,\n C = d / a,\n Q = (3*B - Math.pow(A, 2))/9,\n R = (9*A*B - 27*C - 2*Math.pow(A, 3))/54,\n D = Math.pow(Q, 3) + Math.pow(R, 2),\n S,\n T,\n t = [];\n\n if (D >= 0) // complex or duplicate roots\n {\n S = sgn(R + Math.sqrt(D))*Math.pow(Math.abs(R + Math.sqrt(D)),(1/3));\n T = sgn(R - Math.sqrt(D))*Math.pow(Math.abs(R - Math.sqrt(D)),(1/3));\n\n t[0] = -A/3 + (S + T);\n t[1] = -A/3 - (S + T)/2;\n t[2] = -A/3 - (S + T)/2;\n\n /*discard complex roots*/\n if (Math.abs(Math.sqrt(3)*(S - T)/2) !== 0) {\n t[1] = -1;\n t[2] = -1;\n }\n }\n else // distinct real roots\n {\n var th = Math.acos(R/Math.sqrt(-Math.pow(Q, 3)));\n t[0] = 2*Math.sqrt(-Q)*Math.cos(th/3) - A/3;\n t[1] = 2*Math.sqrt(-Q)*Math.cos((th + 2*Math.PI)/3) - A/3;\n t[2] = 2*Math.sqrt(-Q)*Math.cos((th + 4*Math.PI)/3) - A/3;\n }\n\n // discard out of spec roots\n for (var i = 0; i < 3; i++) {\n if (t[i] < 0 || t[i] > 1.0) {\n t[i] = -1;\n }\n }\n\n return t;\n }\n\n var jsBezier = this.jsBezier = {\n distanceFromCurve : _distanceFromCurve,\n gradientAtPoint : _gradientAtPoint,\n gradientAtPointAlongCurveFrom : _gradientAtPointAlongPathFrom,\n nearestPointOnCurve : _nearestPointOnCurve,\n pointOnCurve : _pointOnPath,\n pointAlongCurveFrom : _pointAlongPathFrom,\n perpendicularToCurveAt : _perpendicularToPathAt,\n locationAlongCurveFrom:_locationAlongPathFrom,\n getLength:_length,\n lineIntersection:_lineIntersection,\n boxIntersection:_boxIntersection,\n boundingBoxIntersection:_boundingBoxIntersection,\n version:\"0.9.0\"\n };\n\n if (typeof exports !== \"undefined\") {\n exports.jsBezier = jsBezier;\n }\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/**\n * Biltong v0.4.0\n *\n * Various geometry functions written as part of jsPlumb and perhaps useful for others.\n *\n * Copyright (c) 2017 jsPlumb\n * https://jsplumbtoolkit.com\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n;(function() {\n\n \"use strict\";\n var root = this;\n\n var Biltong = root.Biltong = {\n version:\"0.4.0\"\n };\n\n if (typeof exports !== \"undefined\") {\n exports.Biltong = Biltong;\n }\n\n var _isa = function(a) { return Object.prototype.toString.call(a) === \"[object Array]\"; },\n _pointHelper = function(p1, p2, fn) {\n p1 = _isa(p1) ? p1 : [p1.x, p1.y];\n p2 = _isa(p2) ? p2 : [p2.x, p2.y];\n return fn(p1, p2);\n },\n /**\n * @name Biltong.gradient\n * @function\n * @desc Calculates the gradient of a line between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The gradient of a line between the two points.\n */\n _gradient = Biltong.gradient = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n if (_p2[0] == _p1[0])\n return _p2[1] > _p1[1] ? Infinity : -Infinity;\n else if (_p2[1] == _p1[1])\n return _p2[0] > _p1[0] ? 0 : -0;\n else\n return (_p2[1] - _p1[1]) / (_p2[0] - _p1[0]);\n });\n },\n /**\n * @name Biltong.normal\n * @function\n * @desc Calculates the gradient of a normal to a line between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The gradient of a normal to a line between the two points.\n */\n _normal = Biltong.normal = function(p1, p2) {\n return -1 / _gradient(p1, p2);\n },\n /**\n * @name Biltong.lineLength\n * @function\n * @desc Calculates the length of a line between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The length of a line between the two points.\n */\n _lineLength = Biltong.lineLength = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n return Math.sqrt(Math.pow(_p2[1] - _p1[1], 2) + Math.pow(_p2[0] - _p1[0], 2));\n });\n },\n /**\n * @name Biltong.quadrant\n * @function\n * @desc Calculates the quadrant in which the angle between the two points lies.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Integer} The quadrant - 1 for upper right, 2 for lower right, 3 for lower left, 4 for upper left.\n */\n _quadrant = Biltong.quadrant = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n if (_p2[0] > _p1[0]) {\n return (_p2[1] > _p1[1]) ? 2 : 1;\n }\n else if (_p2[0] == _p1[0]) {\n return _p2[1] > _p1[1] ? 2 : 1;\n }\n else {\n return (_p2[1] > _p1[1]) ? 3 : 4;\n }\n });\n },\n /**\n * @name Biltong.theta\n * @function\n * @desc Calculates the angle between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The angle between the two points.\n */\n _theta = Biltong.theta = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n var m = _gradient(_p1, _p2),\n t = Math.atan(m),\n s = _quadrant(_p1, _p2);\n if ((s == 4 || s== 3)) t += Math.PI;\n if (t < 0) t += (2 * Math.PI);\n\n return t;\n });\n },\n /**\n * @name Biltong.intersects\n * @function\n * @desc Calculates whether or not the two rectangles intersect.\n * @param {Rectangle} r1 First rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @param {Rectangle} r2 Second rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @return {Boolean} True if the rectangles intersect, false otherwise.\n */\n _intersects = Biltong.intersects = function(r1, r2) {\n var x1 = r1.x, x2 = r1.x + r1.w, y1 = r1.y, y2 = r1.y + r1.h,\n a1 = r2.x, a2 = r2.x + r2.w, b1 = r2.y, b2 = r2.y + r2.h;\n\n return ( (x1 <= a1 && a1 <= x2) && (y1 <= b1 && b1 <= y2) ) ||\n ( (x1 <= a2 && a2 <= x2) && (y1 <= b1 && b1 <= y2) ) ||\n ( (x1 <= a1 && a1 <= x2) && (y1 <= b2 && b2 <= y2) ) ||\n ( (x1 <= a2 && a1 <= x2) && (y1 <= b2 && b2 <= y2) ) ||\n ( (a1 <= x1 && x1 <= a2) && (b1 <= y1 && y1 <= b2) ) ||\n ( (a1 <= x2 && x2 <= a2) && (b1 <= y1 && y1 <= b2) ) ||\n ( (a1 <= x1 && x1 <= a2) && (b1 <= y2 && y2 <= b2) ) ||\n ( (a1 <= x2 && x1 <= a2) && (b1 <= y2 && y2 <= b2) );\n },\n /**\n * @name Biltong.encloses\n * @function\n * @desc Calculates whether or not r2 is completely enclosed by r1.\n * @param {Rectangle} r1 First rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @param {Rectangle} r2 Second rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @param {Boolean} [allowSharedEdges=false] If true, the concept of enclosure allows for one or more edges to be shared by the two rectangles.\n * @return {Boolean} True if r1 encloses r2, false otherwise.\n */\n _encloses = Biltong.encloses = function(r1, r2, allowSharedEdges) {\n var x1 = r1.x, x2 = r1.x + r1.w, y1 = r1.y, y2 = r1.y + r1.h,\n a1 = r2.x, a2 = r2.x + r2.w, b1 = r2.y, b2 = r2.y + r2.h,\n c = function(v1, v2, v3, v4) { return allowSharedEdges ? v1 <= v2 && v3>= v4 : v1 < v2 && v3 > v4; };\n\n return c(x1,a1,x2,a2) && c(y1,b1,y2,b2);\n },\n _segmentMultipliers = [null, [1, -1], [1, 1], [-1, 1], [-1, -1] ],\n _inverseSegmentMultipliers = [null, [-1, -1], [-1, 1], [1, 1], [1, -1] ],\n /**\n * @name Biltong.pointOnLine\n * @function\n * @desc Calculates a point on the line from `fromPoint` to `toPoint` that is `distance` units along the length of the line.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Point} Point on the line, in the form `{ x:..., y:... }`.\n */\n _pointOnLine = Biltong.pointOnLine = function(fromPoint, toPoint, distance) {\n var m = _gradient(fromPoint, toPoint),\n s = _quadrant(fromPoint, toPoint),\n segmentMultiplier = distance > 0 ? _segmentMultipliers[s] : _inverseSegmentMultipliers[s],\n theta = Math.atan(m),\n y = Math.abs(distance * Math.sin(theta)) * segmentMultiplier[1],\n x = Math.abs(distance * Math.cos(theta)) * segmentMultiplier[0];\n return { x:fromPoint.x + x, y:fromPoint.y + y };\n },\n /**\n * @name Biltong.perpendicularLineTo\n * @function\n * @desc Calculates a line of length `length` that is perpendicular to the line from `fromPoint` to `toPoint` and passes through `toPoint`.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Line} Perpendicular line, in the form `[ { x:..., y:... }, { x:..., y:... } ]`.\n */\n _perpendicularLineTo = Biltong.perpendicularLineTo = function(fromPoint, toPoint, length) {\n var m = _gradient(fromPoint, toPoint),\n theta2 = Math.atan(-1 / m),\n y = length / 2 * Math.sin(theta2),\n x = length / 2 * Math.cos(theta2);\n return [{x:toPoint.x + x, y:toPoint.y + y}, {x:toPoint.x - x, y:toPoint.y - y}];\n };\n}).call(typeof window !== 'undefined' ? window : this);\n;\n(function () {\n\n \"use strict\";\n\n /**\n * Creates a Touch object.\n * @param view\n * @param target\n * @param pageX\n * @param pageY\n * @param screenX\n * @param screenY\n * @param clientX\n * @param clientY\n * @returns {Touch}\n * @private\n */\n function _touch(view, target, pageX, pageY, screenX, screenY, clientX, clientY) {\n\n return new Touch({\n target:target,\n identifier:_uuid(),\n pageX: pageX,\n pageY: pageY,\n screenX: screenX,\n screenY: screenY,\n clientX: clientX || screenX,\n clientY: clientY || screenY\n });\n }\n\n /**\n * Create a synthetic touch list from the given list of Touch objects.\n * @returns {Array}\n * @private\n */\n function _touchList() {\n var list = [];\n Array.prototype.push.apply(list, arguments);\n list.item = function(index) { return this[index]; };\n return list;\n }\n\n /**\n * Create a Touch object and then insert it into a synthetic touch list, returning the list.s\n * @param view\n * @param target\n * @param pageX\n * @param pageY\n * @param screenX\n * @param screenY\n * @param clientX\n * @param clientY\n * @returns {Array}\n * @private\n */\n function _touchAndList(view, target, pageX, pageY, screenX, screenY, clientX, clientY) {\n return _touchList(_touch.apply(null, arguments));\n }\n\n var root = this,\n matchesSelector = function (el, selector, ctx) {\n ctx = ctx || el.parentNode;\n var possibles = ctx.querySelectorAll(selector);\n for (var i = 0; i < possibles.length; i++) {\n if (possibles[i] === el) {\n return true;\n }\n }\n return false;\n },\n _gel = function (el) {\n return (typeof el == \"string\" || el.constructor === String) ? document.getElementById(el) : el;\n },\n _t = function (e) {\n return e.srcElement || e.target;\n },\n //\n // gets path info for the given event - the path from target to obj, in the event's bubble chain. if doCompute\n // is false we just return target for the path.\n //\n _pi = function(e, target, obj, doCompute) {\n if (!doCompute) return { path:[target], end:1 };\n else if (typeof e.path !== \"undefined\" && e.path.indexOf) {\n return { path: e.path, end: e.path.indexOf(obj) };\n } else {\n var out = { path:[], end:-1 }, _one = function(el) {\n out.path.push(el);\n if (el === obj) {\n out.end = out.path.length - 1;\n }\n else if (el.parentNode != null) {\n _one(el.parentNode)\n }\n };\n _one(target);\n return out;\n }\n },\n _d = function (l, fn) {\n for (var i = 0, j = l.length; i < j; i++) {\n if (l[i] == fn) break;\n }\n if (i < l.length) l.splice(i, 1);\n },\n guid = 1,\n //\n // this function generates a guid for every handler, sets it on the handler, then adds\n // it to the associated object's map of handlers for the given event. this is what enables us\n // to unbind all events of some type, or all events (the second of which can be requested by the user,\n // but it also used by Mottle when an element is removed.)\n _store = function (obj, event, fn) {\n var g = guid++;\n obj.__ta = obj.__ta || {};\n obj.__ta[event] = obj.__ta[event] || {};\n // store each handler with a unique guid.\n obj.__ta[event][g] = fn;\n // set the guid on the handler.\n fn.__tauid = g;\n return g;\n },\n _unstore = function (obj, event, fn) {\n obj.__ta && obj.__ta[event] && delete obj.__ta[event][fn.__tauid];\n // a handler might have attached extra functions, so we unbind those too.\n if (fn.__taExtra) {\n for (var i = 0; i < fn.__taExtra.length; i++) {\n _unbind(obj, fn.__taExtra[i][0], fn.__taExtra[i][1]);\n }\n fn.__taExtra.length = 0;\n }\n // a handler might have attached an unstore callback\n fn.__taUnstore && fn.__taUnstore();\n },\n _curryChildFilter = function (children, obj, fn, evt) {\n if (children == null) return fn;\n else {\n var c = children.split(\",\"),\n _fn = function (e) {\n _fn.__tauid = fn.__tauid;\n var t = _t(e), target = t; // t is the target element on which the event occurred. it is the\n // element we will wish to pass to any callbacks.\n var pathInfo = _pi(e, t, obj, children != null)\n if (pathInfo.end != -1) {\n for (var p = 0; p < pathInfo.end; p++) {\n target = pathInfo.path[p];\n for (var i = 0; i < c.length; i++) {\n if (matchesSelector(target, c[i], obj)) {\n fn.apply(target, arguments);\n }\n }\n }\n }\n };\n registerExtraFunction(fn, evt, _fn);\n return _fn;\n }\n },\n //\n // registers an 'extra' function on some event listener function we were given - a function that we\n // created and bound to the element as part of our housekeeping, and which we want to unbind and remove\n // whenever the given function is unbound.\n registerExtraFunction = function (fn, evt, newFn) {\n fn.__taExtra = fn.__taExtra || [];\n fn.__taExtra.push([evt, newFn]);\n },\n DefaultHandler = function (obj, evt, fn, children) {\n if (isTouchDevice && touchMap[evt]) {\n var tfn = _curryChildFilter(children, obj, fn, touchMap[evt]);\n _bind(obj, touchMap[evt], tfn , fn);\n }\n if (evt === \"focus\" && obj.getAttribute(\"tabindex\") == null) {\n obj.setAttribute(\"tabindex\", \"1\");\n }\n _bind(obj, evt, _curryChildFilter(children, obj, fn, evt), fn);\n },\n SmartClickHandler = function (obj, evt, fn, children) {\n if (obj.__taSmartClicks == null) {\n var down = function (e) {\n obj.__tad = _pageLocation(e);\n },\n up = function (e) {\n obj.__tau = _pageLocation(e);\n },\n click = function (e) {\n if (obj.__tad && obj.__tau && obj.__tad[0] === obj.__tau[0] && obj.__tad[1] === obj.__tau[1]) {\n for (var i = 0; i < obj.__taSmartClicks.length; i++)\n obj.__taSmartClicks[i].apply(_t(e), [ e ]);\n }\n };\n DefaultHandler(obj, \"mousedown\", down, children);\n DefaultHandler(obj, \"mouseup\", up, children);\n DefaultHandler(obj, \"click\", click, children);\n obj.__taSmartClicks = [];\n }\n\n // store in the list of callbacks\n obj.__taSmartClicks.push(fn);\n // the unstore function removes this function from the object's listener list for this type.\n fn.__taUnstore = function () {\n _d(obj.__taSmartClicks, fn);\n };\n },\n _tapProfiles = {\n \"tap\": {touches: 1, taps: 1},\n \"dbltap\": {touches: 1, taps: 2},\n \"contextmenu\": {touches: 2, taps: 1}\n },\n TapHandler = function (clickThreshold, dblClickThreshold) {\n return function (obj, evt, fn, children) {\n // if event is contextmenu, for devices which are mouse only, we want to\n // use the default bind.\n if (evt == \"contextmenu\" && isMouseDevice)\n DefaultHandler(obj, evt, fn, children);\n else {\n // the issue here is that this down handler gets registered only for the\n // child nodes in the first registration. in fact it should be registered with\n // no child selector and then on down we should cycle through the registered\n // functions to see if one of them matches. on mouseup we should execute ALL of\n // the functions whose children are either null or match the element.\n if (obj.__taTapHandler == null) {\n var tt = obj.__taTapHandler = {\n tap: [],\n dbltap: [],\n contextmenu: [],\n down: false,\n taps: 0,\n downSelectors: []\n };\n var down = function (e) {\n var target = _t(e), pathInfo = _pi(e, target, obj, children != null), finished = false;\n for (var p = 0; p < pathInfo.end; p++) {\n if (finished) return;\n target = pathInfo.path[p];\n for (var i = 0; i < tt.downSelectors.length; i++) {\n if (tt.downSelectors[i] == null || matchesSelector(target, tt.downSelectors[i], obj)) {\n tt.down = true;\n setTimeout(clearSingle, clickThreshold);\n setTimeout(clearDouble, dblClickThreshold);\n finished = true;\n break; // we only need one match on mousedown\n }\n }\n }\n },\n up = function (e) {\n if (tt.down) {\n var target = _t(e), currentTarget, pathInfo;\n tt.taps++;\n var tc = _touchCount(e);\n for (var eventId in _tapProfiles) {\n if (_tapProfiles.hasOwnProperty(eventId)) {\n var p = _tapProfiles[eventId];\n if (p.touches === tc && (p.taps === 1 || p.taps === tt.taps)) {\n for (var i = 0; i < tt[eventId].length; i++) {\n pathInfo = _pi(e, target, obj, tt[eventId][i][1] != null);\n for (var pLoop = 0; pLoop < pathInfo.end; pLoop++) {\n currentTarget = pathInfo.path[pLoop];\n // this is a single event registration handler.\n if (tt[eventId][i][1] == null || matchesSelector(currentTarget, tt[eventId][i][1], obj)) {\n tt[eventId][i][0].apply(currentTarget, [ e ]);\n break;\n }\n }\n }\n }\n }\n }\n }\n },\n clearSingle = function () {\n tt.down = false;\n },\n clearDouble = function () {\n tt.taps = 0;\n };\n\n DefaultHandler(obj, \"mousedown\", down);\n DefaultHandler(obj, \"mouseup\", up);\n }\n // add this child selector (it can be null, that's fine).\n obj.__taTapHandler.downSelectors.push(children);\n\n obj.__taTapHandler[evt].push([fn, children]);\n // the unstore function removes this function from the object's listener list for this type.\n fn.__taUnstore = function () {\n _d(obj.__taTapHandler[evt], fn);\n };\n }\n };\n },\n meeHelper = function (type, evt, obj, target) {\n for (var i in obj.__tamee[type]) {\n if (obj.__tamee[type].hasOwnProperty(i)) {\n obj.__tamee[type][i].apply(target, [ evt ]);\n }\n }\n },\n MouseEnterExitHandler = function () {\n var activeElements = [];\n return function (obj, evt, fn, children) {\n if (!obj.__tamee) {\n // __tamee holds a flag saying whether the mouse is currently \"in\" the element, and a list of\n // both mouseenter and mouseexit functions.\n obj.__tamee = { over: false, mouseenter: [], mouseexit: [] };\n // register over and out functions\n var over = function (e) {\n var t = _t(e);\n if ((children == null && (t == obj && !obj.__tamee.over)) || (matchesSelector(t, children, obj) && (t.__tamee == null || !t.__tamee.over))) {\n meeHelper(\"mouseenter\", e, obj, t);\n t.__tamee = t.__tamee || {};\n t.__tamee.over = true;\n activeElements.push(t);\n }\n },\n out = function (e) {\n var t = _t(e);\n // is the current target one of the activeElements? and is the\n // related target NOT a descendant of it?\n for (var i = 0; i < activeElements.length; i++) {\n if (t == activeElements[i] && !matchesSelector((e.relatedTarget || e.toElement), \"*\", t)) {\n t.__tamee.over = false;\n activeElements.splice(i, 1);\n meeHelper(\"mouseexit\", e, obj, t);\n }\n }\n };\n\n _bind(obj, \"mouseover\", _curryChildFilter(children, obj, over, \"mouseover\"), over);\n _bind(obj, \"mouseout\", _curryChildFilter(children, obj, out, \"mouseout\"), out);\n }\n\n fn.__taUnstore = function () {\n delete obj.__tamee[evt][fn.__tauid];\n };\n\n _store(obj, evt, fn);\n obj.__tamee[evt][fn.__tauid] = fn;\n };\n },\n isTouchDevice = \"ontouchstart\" in document.documentElement,\n isMouseDevice = \"onmousedown\" in document.documentElement,\n touchMap = { \"mousedown\": \"touchstart\", \"mouseup\": \"touchend\", \"mousemove\": \"touchmove\" },\n touchstart = \"touchstart\", touchend = \"touchend\", touchmove = \"touchmove\",\n iev = (function () {\n var rv = -1;\n if (navigator.appName == 'Microsoft Internet Explorer') {\n var ua = navigator.userAgent,\n re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n return rv;\n })(),\n isIELT9 = iev > -1 && iev < 9,\n _genLoc = function (e, prefix) {\n if (e == null) return [ 0, 0 ];\n var ts = _touches(e), t = _getTouch(ts, 0);\n return [t[prefix + \"X\"], t[prefix + \"Y\"]];\n },\n _pageLocation = function (e) {\n if (e == null) return [ 0, 0 ];\n if (isIELT9) {\n return [ e.clientX + document.documentElement.scrollLeft, e.clientY + document.documentElement.scrollTop ];\n }\n else {\n return _genLoc(e, \"page\");\n }\n },\n _screenLocation = function (e) {\n return _genLoc(e, \"screen\");\n },\n _clientLocation = function (e) {\n return _genLoc(e, \"client\");\n },\n _getTouch = function (touches, idx) {\n return touches.item ? touches.item(idx) : touches[idx];\n },\n _touches = function (e) {\n return e.touches && e.touches.length > 0 ? e.touches :\n e.changedTouches && e.changedTouches.length > 0 ? e.changedTouches :\n e.targetTouches && e.targetTouches.length > 0 ? e.targetTouches :\n [ e ];\n },\n _touchCount = function (e) {\n return _touches(e).length;\n },\n //http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html\n _bind = function (obj, type, fn, originalFn) {\n _store(obj, type, fn);\n originalFn.__tauid = fn.__tauid;\n if (obj.addEventListener)\n obj.addEventListener(type, fn, false);\n else if (obj.attachEvent) {\n var key = type + fn.__tauid;\n obj[\"e\" + key] = fn;\n // TODO look at replacing with .call(..)\n obj[key] = function () {\n obj[\"e\" + key] && obj[\"e\" + key](window.event);\n };\n obj.attachEvent(\"on\" + type, obj[key]);\n }\n },\n _unbind = function (obj, type, fn) {\n if (fn == null) return;\n _each(obj, function () {\n var _el = _gel(this);\n _unstore(_el, type, fn);\n // it has been bound if there is a tauid. otherwise it was not bound and we can ignore it.\n if (fn.__tauid != null) {\n if (_el.removeEventListener) {\n _el.removeEventListener(type, fn, false);\n if (isTouchDevice && touchMap[type]) _el.removeEventListener(touchMap[type], fn, false);\n }\n else if (this.detachEvent) {\n var key = type + fn.__tauid;\n _el[key] && _el.detachEvent(\"on\" + type, _el[key]);\n _el[key] = null;\n _el[\"e\" + key] = null;\n }\n }\n\n // if a touch event was also registered, deregister now.\n if (fn.__taTouchProxy) {\n _unbind(obj, fn.__taTouchProxy[1], fn.__taTouchProxy[0]);\n }\n });\n },\n _each = function (obj, fn) {\n if (obj == null) return;\n // if a list (or list-like), use it. if a string, get a list\n // by running the string through querySelectorAll. else, assume\n // it's an Element.\n // obj.top is \"unknown\" in IE8.\n obj = (typeof Window !== \"undefined\" && (typeof obj.top !== \"unknown\" && obj == obj.top)) ? [ obj ] :\n (typeof obj !== \"string\") && (obj.tagName == null && obj.length != null) ? obj :\n typeof obj === \"string\" ? document.querySelectorAll(obj)\n : [ obj ];\n\n for (var i = 0; i < obj.length; i++)\n fn.apply(obj[i]);\n },\n _uuid = function () {\n return ('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n }));\n };\n\n /**\n * Mottle offers support for abstracting out the differences\n * between touch and mouse devices, plus \"smart click\" functionality\n * (don't fire click if the mouse has moved between mousedown and mouseup),\n * and synthesized click/tap events.\n * @class Mottle\n * @constructor\n * @param {Object} params Constructor params\n * @param {Number} [params.clickThreshold=250] Threshold, in milliseconds beyond which a touchstart followed by a touchend is not considered to be a click.\n * @param {Number} [params.dblClickThreshold=450] Threshold, in milliseconds beyond which two successive tap events are not considered to be a click.\n * @param {Boolean} [params.smartClicks=false] If true, won't fire click events if the mouse has moved between mousedown and mouseup. Note that this functionality\n * requires that Mottle consume the mousedown event, and so may not be viable in all use cases.\n */\n root.Mottle = function (params) {\n params = params || {};\n var clickThreshold = params.clickThreshold || 250,\n dblClickThreshold = params.dblClickThreshold || 450,\n mouseEnterExitHandler = new MouseEnterExitHandler(),\n tapHandler = new TapHandler(clickThreshold, dblClickThreshold),\n _smartClicks = params.smartClicks,\n _doBind = function (obj, evt, fn, children) {\n if (fn == null) return;\n _each(obj, function () {\n var _el = _gel(this);\n if (_smartClicks && evt === \"click\")\n SmartClickHandler(_el, evt, fn, children);\n else if (evt === \"tap\" || evt === \"dbltap\" || evt === \"contextmenu\") {\n tapHandler(_el, evt, fn, children);\n }\n else if (evt === \"mouseenter\" || evt == \"mouseexit\")\n mouseEnterExitHandler(_el, evt, fn, children);\n else\n DefaultHandler(_el, evt, fn, children);\n });\n };\n\n /**\n * Removes an element from the DOM, and deregisters all event handlers for it. You should use this\n * to ensure you don't leak memory.\n * @method remove\n * @param {String|Element} el Element, or id of the element, to remove.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.remove = function (el) {\n _each(el, function () {\n var _el = _gel(this);\n if (_el.__ta) {\n for (var evt in _el.__ta) {\n if (_el.__ta.hasOwnProperty(evt)) {\n for (var h in _el.__ta[evt]) {\n if (_el.__ta[evt].hasOwnProperty(h))\n _unbind(_el, evt, _el.__ta[evt][h]);\n }\n }\n }\n }\n _el.parentNode && _el.parentNode.removeChild(_el);\n });\n return this;\n };\n\n /**\n * Register an event handler, optionally as a delegate for some set of descendant elements. Note\n * that this method takes either 3 or 4 arguments - if you supply 3 arguments it is assumed you have\n * omitted the `children` parameter, and that the event handler should be bound directly to the given element.\n * @method on\n * @param {Element[]|Element|String} el Either an Element, or a CSS spec for a list of elements, or an array of Elements.\n * @param {String} [children] Comma-delimited list of selectors identifying allowed children.\n * @param {String} event Event ID.\n * @param {Function} fn Event handler function.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.on = function (el, event, children, fn) {\n var _el = arguments[0],\n _c = arguments.length == 4 ? arguments[2] : null,\n _e = arguments[1],\n _f = arguments[arguments.length - 1];\n\n _doBind(_el, _e, _f, _c);\n return this;\n };\n\n /**\n * Cancel delegate event handling for the given function. Note that unlike with 'on' you do not supply\n * a list of child selectors here: it removes event delegation from all of the child selectors for which the\n * given function was registered (if any).\n * @method off\n * @param {Element[]|Element|String} el Element - or ID of element - from which to remove event listener.\n * @param {String} event Event ID.\n * @param {Function} fn Event handler function.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.off = function (el, event, fn) {\n _unbind(el, event, fn);\n return this;\n };\n\n /**\n * Triggers some event for a given element.\n * @method trigger\n * @param {Element} el Element for which to trigger the event.\n * @param {String} event Event ID.\n * @param {Event} originalEvent The original event. Should be optional of course, but currently is not, due\n * to the jsPlumb use case that caused this method to be added.\n * @param {Object} [payload] Optional object to set as `payload` on the generated event; useful for message passing.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.trigger = function (el, event, originalEvent, payload) {\n // MouseEvent undefined in old IE; that's how we know it's a mouse event. A fine Microsoft paradox.\n var originalIsMouse = isMouseDevice && (typeof MouseEvent === \"undefined\" || originalEvent == null || originalEvent.constructor === MouseEvent);\n\n var eventToBind = (isTouchDevice && !isMouseDevice && touchMap[event]) ? touchMap[event] : event,\n bindingAMouseEvent = !(isTouchDevice && !isMouseDevice && touchMap[event]);\n\n var pl = _pageLocation(originalEvent), sl = _screenLocation(originalEvent), cl = _clientLocation(originalEvent);\n _each(el, function () {\n var _el = _gel(this), evt;\n originalEvent = originalEvent || {\n screenX: sl[0],\n screenY: sl[1],\n clientX: cl[0],\n clientY: cl[1]\n };\n\n var _decorate = function (_evt) {\n if (payload) _evt.payload = payload;\n };\n\n var eventGenerators = {\n \"TouchEvent\": function (evt) {\n\n var touchList = _touchAndList(window, _el, 0, pl[0], pl[1], sl[0], sl[1], cl[0], cl[1]),\n init = evt.initTouchEvent || evt.initEvent;\n\n init(eventToBind, true, true, window, null, sl[0], sl[1],\n cl[0], cl[1], false, false, false, false,\n touchList, touchList, touchList, 1, 0);\n },\n \"MouseEvents\": function (evt) {\n evt.initMouseEvent(eventToBind, true, true, window, 0,\n sl[0], sl[1],\n cl[0], cl[1],\n false, false, false, false, 1, _el);\n }\n };\n\n if (document.createEvent) {\n\n var ite = !bindingAMouseEvent && !originalIsMouse && (isTouchDevice && touchMap[event]),\n evtName = ite ? \"TouchEvent\" : \"MouseEvents\";\n\n evt = document.createEvent(evtName);\n eventGenerators[evtName](evt);\n _decorate(evt);\n _el.dispatchEvent(evt);\n }\n else if (document.createEventObject) {\n evt = document.createEventObject();\n evt.eventType = evt.eventName = eventToBind;\n evt.screenX = sl[0];\n evt.screenY = sl[1];\n evt.clientX = cl[0];\n evt.clientY = cl[1];\n _decorate(evt);\n _el.fireEvent('on' + eventToBind, evt);\n }\n });\n return this;\n }\n };\n\n /**\n * Static method to assist in 'consuming' an element: uses `stopPropagation` where available, or sets\n * `e.returnValue=false` where it is not.\n * @method Mottle.consume\n * @param {Event} e Event to consume\n * @param {Boolean} [doNotPreventDefault=false] If true, does not call `preventDefault()` on the event.\n */\n root.Mottle.consume = function (e, doNotPreventDefault) {\n if (e.stopPropagation)\n e.stopPropagation();\n else\n e.returnValue = false;\n\n if (!doNotPreventDefault && e.preventDefault)\n e.preventDefault();\n };\n\n /**\n * Gets the page location corresponding to the given event. For touch events this means get the page location of the first touch.\n * @method Mottle.pageLocation\n * @param {Event} e Event to get page location for.\n * @return {Number[]} [left, top] for the given event.\n */\n root.Mottle.pageLocation = _pageLocation;\n\n /**\n * Forces touch events to be turned \"on\". Useful for testing: even if you don't have a touch device, you can still\n * trigger a touch event when this is switched on and it will be captured and acted on.\n * @method setForceTouchEvents\n * @param {Boolean} value If true, force touch events to be on.\n */\n root.Mottle.setForceTouchEvents = function (value) {\n isTouchDevice = value;\n };\n\n /**\n * Forces mouse events to be turned \"on\". Useful for testing: even if you don't have a mouse, you can still\n * trigger a mouse event when this is switched on and it will be captured and acted on.\n * @method setForceMouseEvents\n * @param {Boolean} value If true, force mouse events to be on.\n */\n root.Mottle.setForceMouseEvents = function (value) {\n isMouseDevice = value;\n };\n\n root.Mottle.version = \"0.8.0\";\n\n if (typeof exports !== \"undefined\") {\n exports.Mottle = root.Mottle;\n }\n\n}).call(typeof window === \"undefined\" ? this : window);\n\n/**\n drag/drop functionality for use with jsPlumb but with\n no knowledge of jsPlumb. supports multiple scopes (separated by whitespace), dragging\n multiple elements, constrain to parent, drop filters, drag start filters, custom\n css classes.\n\n a lot of the functionality of this script is expected to be plugged in:\n\n addClass\n removeClass\n\n addEvent\n removeEvent\n\n getPosition\n setPosition\n getSize\n\n indexOf\n intersects\n\n the name came from here:\n\n http://mrsharpoblunto.github.io/foswig.js/\n\n copyright 2016 jsPlumb\n */\n\n;(function() {\n\n \"use strict\";\n var root = this;\n\n var _suggest = function(list, item, head) {\n if (list.indexOf(item) === -1) {\n head ? list.unshift(item) : list.push(item);\n return true;\n }\n return false;\n };\n\n var _vanquish = function(list, item) {\n var idx = list.indexOf(item);\n if (idx !== -1) list.splice(idx, 1);\n };\n\n var _difference = function(l1, l2) {\n var d = [];\n for (var i = 0; i < l1.length; i++) {\n if (l2.indexOf(l1[i]) === -1)\n d.push(l1[i]);\n }\n return d;\n };\n\n var _isString = function(f) {\n return f == null ? false : (typeof f === \"string\" || f.constructor === String);\n };\n\n var getOffsetRect = function (elem) {\n // (1)\n var box = elem.getBoundingClientRect(),\n body = document.body,\n docElem = document.documentElement,\n // (2)\n scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop,\n scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft,\n // (3)\n clientTop = docElem.clientTop || body.clientTop || 0,\n clientLeft = docElem.clientLeft || body.clientLeft || 0,\n // (4)\n top = box.top + scrollTop - clientTop,\n left = box.left + scrollLeft - clientLeft;\n\n return { top: Math.round(top), left: Math.round(left) };\n };\n\n var matchesSelector = function(el, selector, ctx) {\n ctx = ctx || el.parentNode;\n var possibles = ctx.querySelectorAll(selector);\n for (var i = 0; i < possibles.length; i++) {\n if (possibles[i] === el)\n return true;\n }\n return false;\n };\n\n var findDelegateElement = function(parentElement, childElement, selector) {\n if (matchesSelector(childElement, selector, parentElement)) {\n return childElement;\n } else {\n var currentParent = childElement.parentNode;\n while (currentParent != null && currentParent !== parentElement) {\n if (matchesSelector(currentParent, selector, parentElement)) {\n return currentParent;\n } else {\n currentParent = currentParent.parentNode;\n }\n }\n }\n };\n\n var iev = (function() {\n var rv = -1;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var ua = navigator.userAgent,\n re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n return rv;\n })(),\n DEFAULT_GRID_X = 10,\n DEFAULT_GRID_Y = 10,\n isIELT9 = iev > -1 && iev < 9,\n isIE9 = iev === 9,\n _pl = function(e) {\n if (isIELT9) {\n return [ e.clientX + document.documentElement.scrollLeft, e.clientY + document.documentElement.scrollTop ];\n }\n else {\n var ts = _touches(e), t = _getTouch(ts, 0);\n // for IE9 pageX might be null if the event was synthesized. We try for pageX/pageY first,\n // falling back to clientX/clientY if necessary. In every other browser we want to use pageX/pageY.\n return isIE9 ? [t.pageX || t.clientX, t.pageY || t.clientY] : [t.pageX, t.pageY];\n }\n },\n _getTouch = function(touches, idx) { return touches.item ? touches.item(idx) : touches[idx]; },\n _touches = function(e) {\n return e.touches && e.touches.length > 0 ? e.touches :\n e.changedTouches && e.changedTouches.length > 0 ? e.changedTouches :\n e.targetTouches && e.targetTouches.length > 0 ? e.targetTouches :\n [ e ];\n },\n _classes = {\n draggable:\"katavorio-draggable\", // draggable elements\n droppable:\"katavorio-droppable\", // droppable elements\n drag : \"katavorio-drag\", // elements currently being dragged\n selected:\"katavorio-drag-selected\", // elements in current drag selection\n active : \"katavorio-drag-active\", // droppables that are targets of a currently dragged element\n hover : \"katavorio-drag-hover\", // droppables over which a matching drag element is hovering\n noSelect : \"katavorio-drag-no-select\", // added to the body to provide a hook to suppress text selection\n ghostProxy:\"katavorio-ghost-proxy\", // added to a ghost proxy element in use when a drag has exited the bounds of its parent.\n clonedDrag:\"katavorio-clone-drag\" // added to a node that is a clone of an element created at the start of a drag\n },\n _defaultScope = \"katavorio-drag-scope\",\n _events = [ \"stop\", \"start\", \"drag\", \"drop\", \"over\", \"out\", \"beforeStart\" ],\n _devNull = function() {},\n _true = function() { return true; },\n _foreach = function(l, fn, from) {\n for (var i = 0; i < l.length; i++) {\n if (l[i] != from)\n fn(l[i]);\n }\n },\n _setDroppablesActive = function(dd, val, andHover, drag) {\n _foreach(dd, function(e) {\n e.setActive(val);\n if (val) e.updatePosition();\n if (andHover) e.setHover(drag, val);\n });\n },\n _each = function(obj, fn) {\n if (obj == null) return;\n obj = !_isString(obj) && (obj.tagName == null && obj.length != null) ? obj : [ obj ];\n for (var i = 0; i < obj.length; i++)\n fn.apply(obj[i], [ obj[i] ]);\n },\n _consume = function(e) {\n if (e.stopPropagation) {\n e.stopPropagation();\n e.preventDefault();\n }\n else {\n e.returnValue = false;\n }\n },\n _defaultInputFilterSelector = \"input,textarea,select,button,option\",\n //\n // filters out events on all input elements, like textarea, checkbox, input, select.\n _inputFilter = function(e, el, _katavorio) {\n var t = e.srcElement || e.target;\n return !matchesSelector(t, _katavorio.getInputFilterSelector(), el);\n };\n\n var Super = function(el, params, css, scope) {\n this.params = params || {};\n this.el = el;\n this.params.addClass(this.el, this._class);\n this.uuid = _uuid();\n var enabled = true;\n this.setEnabled = function(e) { enabled = e; };\n this.isEnabled = function() { return enabled; };\n this.toggleEnabled = function() { enabled = !enabled; };\n this.setScope = function(scopes) {\n this.scopes = scopes ? scopes.split(/\\s+/) : [ scope ];\n };\n this.addScope = function(scopes) {\n var m = {};\n _each(this.scopes, function(s) { m[s] = true;});\n _each(scopes ? scopes.split(/\\s+/) : [], function(s) { m[s] = true;});\n this.scopes = [];\n for (var i in m) this.scopes.push(i);\n };\n this.removeScope = function(scopes) {\n var m = {};\n _each(this.scopes, function(s) { m[s] = true;});\n _each(scopes ? scopes.split(/\\s+/) : [], function(s) { delete m[s];});\n this.scopes = [];\n for (var i in m) this.scopes.push(i);\n };\n this.toggleScope = function(scopes) {\n var m = {};\n _each(this.scopes, function(s) { m[s] = true;});\n _each(scopes ? scopes.split(/\\s+/) : [], function(s) {\n if (m[s]) delete m[s];\n else m[s] = true;\n });\n this.scopes = [];\n for (var i in m) this.scopes.push(i);\n };\n this.setScope(params.scope);\n this.k = params.katavorio;\n return params.katavorio;\n };\n\n var TRUE = function() { return true; };\n var FALSE = function() { return false; };\n\n var Drag = function(el, params, css, scope) {\n this._class = css.draggable;\n var k = Super.apply(this, arguments);\n this.rightButtonCanDrag = this.params.rightButtonCanDrag;\n var downAt = [0,0], posAtDown = null, pagePosAtDown = null, pageDelta = [0,0], moving = false, initialScroll = [0,0],\n consumeStartEvent = this.params.consumeStartEvent !== false,\n dragEl = this.el,\n clone = this.params.clone,\n scroll = this.params.scroll,\n _multipleDrop = params.multipleDrop !== false,\n isConstrained = false,\n useGhostProxy = params.ghostProxy === true ? TRUE : params.ghostProxy && typeof params.ghostProxy === \"function\" ? params.ghostProxy : FALSE,\n ghostProxy = function(el) { return el.cloneNode(true); },\n selector = params.selector,\n elementToDrag = null;\n\n var snapThreshold = params.snapThreshold,\n _snap = function(pos, gridX, gridY, thresholdX, thresholdY) {\n var _dx = Math.floor(pos[0] / gridX),\n _dxl = gridX * _dx,\n _dxt = _dxl + gridX,\n _x = Math.abs(pos[0] - _dxl) <= thresholdX ? _dxl : Math.abs(_dxt - pos[0]) <= thresholdX ? _dxt : pos[0];\n\n var _dy = Math.floor(pos[1] / gridY),\n _dyl = gridY * _dy,\n _dyt = _dyl + gridY,\n _y = Math.abs(pos[1] - _dyl) <= thresholdY ? _dyl : Math.abs(_dyt - pos[1]) <= thresholdY ? _dyt : pos[1];\n\n return [ _x, _y];\n };\n\n this.posses = [];\n this.posseRoles = {};\n\n this.toGrid = function(pos) {\n if (this.params.grid == null) {\n return pos;\n }\n else {\n var tx = this.params.grid ? this.params.grid[0] / 2 : snapThreshold ? snapThreshold : DEFAULT_GRID_X / 2,\n ty = this.params.grid ? this.params.grid[1] / 2 : snapThreshold ? snapThreshold : DEFAULT_GRID_Y / 2;\n\n return _snap(pos, this.params.grid[0], this.params.grid[1], tx, ty);\n }\n };\n\n this.snap = function(x, y) {\n if (dragEl == null) return;\n x = x || (this.params.grid ? this.params.grid[0] : DEFAULT_GRID_X);\n y = y || (this.params.grid ? this.params.grid[1] : DEFAULT_GRID_Y);\n var p = this.params.getPosition(dragEl),\n tx = this.params.grid ? this.params.grid[0] / 2 : snapThreshold,\n ty = this.params.grid ? this.params.grid[1] / 2 : snapThreshold;\n\n this.params.setPosition(dragEl, _snap(p, x, y, tx, ty));\n };\n\n this.setUseGhostProxy = function(val) {\n useGhostProxy = val ? TRUE : FALSE;\n };\n\n var constrain;\n var negativeFilter = function(pos) {\n return (params.allowNegative === false) ? [ Math.max (0, pos[0]), Math.max(0, pos[1]) ] : pos;\n };\n\n var _setConstrain = function(value) {\n constrain = typeof value === \"function\" ? value : value ? function(pos, dragEl, _constrainRect, _size) {\n return negativeFilter([\n Math.max(0, Math.min(_constrainRect.w - _size[0], pos[0])),\n Math.max(0, Math.min(_constrainRect.h - _size[1], pos[1]))\n ]);\n }.bind(this) : function(pos) { return negativeFilter(pos); };\n }.bind(this);\n\n _setConstrain(typeof this.params.constrain === \"function\" ? this.params.constrain : (this.params.constrain || this.params.containment));\n\n\n /**\n * Sets whether or not the Drag is constrained. A value of 'true' means constrain to parent bounds; a function\n * will be executed and returns true if the position is allowed.\n * @param value\n */\n this.setConstrain = function(value) {\n _setConstrain(value);\n };\n\n var revertFunction;\n /**\n * Sets a function to call on drag stop, which, if it returns true, indicates that the given element should\n * revert to its position before the previous drag.\n * @param fn\n */\n this.setRevert = function(fn) {\n revertFunction = fn;\n };\n\n var _assignId = function(obj) {\n if (typeof obj === \"function\") {\n obj._katavorioId = _uuid();\n return obj._katavorioId;\n } else {\n return obj;\n }\n },\n // a map of { spec -> [ fn, exclusion ] } entries.\n _filters = {},\n _testFilter = function(e) {\n for (var key in _filters) {\n var f = _filters[key];\n var rv = f[0](e);\n if (f[1]) rv = !rv;\n if (!rv) return false;\n }\n return true;\n },\n _setFilter = this.setFilter = function(f, _exclude) {\n if (f) {\n var key = _assignId(f);\n _filters[key] = [\n function(e) {\n var t = e.srcElement || e.target, m;\n if (_isString(f)) {\n m = matchesSelector(t, f, el);\n }\n else if (typeof f === \"function\") {\n m = f(e, el);\n }\n return m;\n },\n _exclude !== false\n ];\n\n }\n },\n _addFilter = this.addFilter = _setFilter,\n _removeFilter = this.removeFilter = function(f) {\n var key = typeof f === \"function\" ? f._katavorioId : f;\n delete _filters[key];\n };\n\n this.clearAllFilters = function() {\n _filters = {};\n };\n\n this.canDrag = this.params.canDrag || _true;\n\n var constrainRect,\n matchingDroppables = [],\n intersectingDroppables = [];\n\n this.downListener = function(e) {\n var isNotRightClick = this.rightButtonCanDrag || (e.which !== 3 && e.button !== 2);\n if (isNotRightClick && this.isEnabled() && this.canDrag()) {\n\n var _f = _testFilter(e) && _inputFilter(e, this.el, this.k);\n if (_f) {\n\n if (selector) {\n elementToDrag = findDelegateElement(this.el, e.target || e.srcElement, selector);\n if(elementToDrag == null) {\n return;\n }\n }\n else {\n elementToDrag = this.el;\n }\n\n if (clone) {\n dragEl = elementToDrag.cloneNode(true);\n this.params.addClass(dragEl, _classes.clonedDrag);\n\n dragEl.setAttribute(\"id\", null);\n dragEl.style.position = \"absolute\";\n\n if (this.params.parent != null) {\n var p = this.params.getPosition(this.el);\n dragEl.style.left = p[0] + \"px\";\n dragEl.style.top = p[1] + \"px\";\n this.params.parent.appendChild(dragEl);\n } else {\n // the clone node is added to the body; getOffsetRect gives us a value\n // relative to the body.\n var b = getOffsetRect(elementToDrag);\n dragEl.style.left = b.left + \"px\";\n dragEl.style.top = b.top + \"px\";\n\n document.body.appendChild(dragEl);\n }\n\n } else {\n dragEl = elementToDrag;\n }\n\n consumeStartEvent && _consume(e);\n downAt = _pl(e);\n if (dragEl && dragEl.parentNode)\n {\n initialScroll = [dragEl.parentNode.scrollLeft, dragEl.parentNode.scrollTop];\n }\n //\n this.params.bind(document, \"mousemove\", this.moveListener);\n this.params.bind(document, \"mouseup\", this.upListener);\n k.markSelection(this);\n k.markPosses(this);\n this.params.addClass(document.body, css.noSelect);\n _dispatch(\"beforeStart\", {el:this.el, pos:posAtDown, e:e, drag:this});\n }\n else if (this.params.consumeFilteredEvents) {\n _consume(e);\n }\n }\n }.bind(this);\n\n this.moveListener = function(e) {\n if (downAt) {\n if (!moving) {\n var _continue = _dispatch(\"start\", {el:this.el, pos:posAtDown, e:e, drag:this});\n if (_continue !== false) {\n if (!downAt) {\n return;\n }\n this.mark(true);\n moving = true;\n } else {\n this.abort();\n }\n }\n\n // it is possible that the start event caused the drag to be aborted. So we check\n // again that we are currently dragging.\n if (downAt) {\n intersectingDroppables.length = 0;\n var pos = _pl(e), dx = pos[0] - downAt[0], dy = pos[1] - downAt[1],\n z = this.params.ignoreZoom ? 1 : k.getZoom();\n if (dragEl && dragEl.parentNode)\n {\n dx += dragEl.parentNode.scrollLeft - initialScroll[0];\n dy += dragEl.parentNode.scrollTop - initialScroll[1];\n }\n dx /= z;\n dy /= z;\n this.moveBy(dx, dy, e);\n k.updateSelection(dx, dy, this);\n k.updatePosses(dx, dy, this);\n }\n }\n }.bind(this);\n\n this.upListener = function(e) {\n if (downAt) {\n downAt = null;\n this.params.unbind(document, \"mousemove\", this.moveListener);\n this.params.unbind(document, \"mouseup\", this.upListener);\n this.params.removeClass(document.body, css.noSelect);\n this.unmark(e);\n k.unmarkSelection(this, e);\n k.unmarkPosses(this, e);\n this.stop(e);\n\n //k.notifySelectionDragStop(this, e); removed in 1.1.0 under the \"leave it for one release in case it breaks\" rule.\n // it isnt necessary to fire this as the normal stop event now includes a `selection` member that has every dragged element.\n // firing this event causes consumers who use the `selection` array to process a lot more drag stop events than is necessary\n\n k.notifyPosseDragStop(this, e);\n moving = false;\n if (clone) {\n dragEl && dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n dragEl = null;\n }\n\n intersectingDroppables.length = 0;\n\n if (revertFunction && revertFunction(this.el, this.params.getPosition(this.el)) === true) {\n this.params.setPosition(this.el, posAtDown);\n _dispatch(\"revert\", this.el);\n }\n }\n }.bind(this);\n\n this.getFilters = function() { return _filters; };\n\n this.abort = function() {\n if (downAt != null) {\n this.upListener();\n }\n };\n\n /**\n * Returns the element that was last dragged. This may be some original element from the DOM, or if `clone` is\n * set, then its actually a copy of some original DOM element. In some client calls to this method, it is the\n * actual element that was dragged that is desired. In others, it is the original DOM element that the user\n * wishes to get - in which case, pass true for `retrieveOriginalElement`.\n *\n * @returns {*}\n */\n this.getDragElement = function(retrieveOriginalElement) {\n return retrieveOriginalElement ? elementToDrag || this.el : dragEl || this.el;\n };\n\n var listeners = {\"start\":[], \"drag\":[], \"stop\":[], \"over\":[], \"out\":[], \"beforeStart\":[], \"revert\":[] };\n if (params.events.start) listeners.start.push(params.events.start);\n if (params.events.beforeStart) listeners.beforeStart.push(params.events.beforeStart);\n if (params.events.stop) listeners.stop.push(params.events.stop);\n if (params.events.drag) listeners.drag.push(params.events.drag);\n if (params.events.revert) listeners.revert.push(params.events.revert);\n\n this.on = function(evt, fn) {\n if (listeners[evt]) listeners[evt].push(fn);\n };\n\n this.off = function(evt, fn) {\n if (listeners[evt]) {\n var l = [];\n for (var i = 0; i < listeners[evt].length; i++) {\n if (listeners[evt][i] !== fn) l.push(listeners[evt][i]);\n }\n listeners[evt] = l;\n }\n };\n\n var _dispatch = function(evt, value) {\n var result = null;\n if (listeners[evt]) {\n for (var i = 0; i < listeners[evt].length; i++) {\n try {\n var v = listeners[evt][i](value);\n if (v != null) {\n result = v;\n }\n }\n catch (e) { }\n }\n }\n return result;\n };\n\n this.notifyStart = function(e) {\n _dispatch(\"start\", {el:this.el, pos:this.params.getPosition(dragEl), e:e, drag:this});\n };\n\n this.stop = function(e, force) {\n if (force || moving) {\n var positions = [],\n sel = k.getSelection(),\n dPos = this.params.getPosition(dragEl);\n\n if (sel.length > 1) {\n for (var i = 0; i < sel.length; i++) {\n var p = this.params.getPosition(sel[i].el);\n positions.push([ sel[i].el, { left: p[0], top: p[1] }, sel[i] ]);\n }\n }\n else {\n positions.push([ dragEl, {left:dPos[0], top:dPos[1]}, this ]);\n }\n\n _dispatch(\"stop\", {\n el: dragEl,\n pos: ghostProxyOffsets || dPos,\n finalPos:dPos,\n e: e,\n drag: this,\n selection:positions\n });\n }\n };\n\n this.mark = function(andNotify) {\n posAtDown = this.params.getPosition(dragEl);\n pagePosAtDown = this.params.getPosition(dragEl, true);\n pageDelta = [pagePosAtDown[0] - posAtDown[0], pagePosAtDown[1] - posAtDown[1]];\n this.size = this.params.getSize(dragEl);\n matchingDroppables = k.getMatchingDroppables(this);\n _setDroppablesActive(matchingDroppables, true, false, this);\n this.params.addClass(dragEl, this.params.dragClass || css.drag);\n\n var cs;\n if (this.params.getConstrainingRectangle) {\n cs = this.params.getConstrainingRectangle(dragEl)\n } else {\n cs = this.params.getSize(dragEl.parentNode);\n }\n constrainRect = {w: cs[0], h: cs[1]};\n\n if (andNotify) {\n k.notifySelectionDragStart(this);\n }\n };\n var ghostProxyOffsets;\n this.unmark = function(e, doNotCheckDroppables) {\n _setDroppablesActive(matchingDroppables, false, true, this);\n\n if (isConstrained && useGhostProxy(elementToDrag)) {\n ghostProxyOffsets = [dragEl.offsetLeft, dragEl.offsetTop];\n elementToDrag.parentNode.removeChild(dragEl);\n dragEl = elementToDrag;\n }\n else {\n ghostProxyOffsets = null;\n }\n\n this.params.removeClass(dragEl, this.params.dragClass || css.drag);\n matchingDroppables.length = 0;\n isConstrained = false;\n if (!doNotCheckDroppables) {\n if (intersectingDroppables.length > 0 && ghostProxyOffsets) {\n params.setPosition(elementToDrag, ghostProxyOffsets);\n }\n intersectingDroppables.sort(_rankSort);\n for (var i = 0; i < intersectingDroppables.length; i++) {\n var retVal = intersectingDroppables[i].drop(this, e);\n if (retVal === true) break;\n }\n }\n };\n this.moveBy = function(dx, dy, e) {\n intersectingDroppables.length = 0;\n var desiredLoc = this.toGrid([posAtDown[0] + dx, posAtDown[1] + dy]),\n cPos = constrain(desiredLoc, dragEl, constrainRect, this.size);\n\n if (useGhostProxy(this.el)) {\n if (desiredLoc[0] !== cPos[0] || desiredLoc[1] !== cPos[1]) {\n if (!isConstrained) {\n var gp = ghostProxy(elementToDrag);\n params.addClass(gp, _classes.ghostProxy);\n elementToDrag.parentNode.appendChild(gp);\n dragEl = gp;\n isConstrained = true;\n }\n cPos = desiredLoc;\n }\n else {\n if (isConstrained) {\n elementToDrag.parentNode.removeChild(dragEl);\n dragEl = elementToDrag;\n isConstrained = false;\n }\n }\n }\n\n var rect = { x:cPos[0], y:cPos[1], w:this.size[0], h:this.size[1]},\n pageRect = { x:rect.x + pageDelta[0], y:rect.y + pageDelta[1], w:rect.w, h:rect.h},\n focusDropElement = null;\n\n this.params.setPosition(dragEl, cPos);\n for (var i = 0; i < matchingDroppables.length; i++) {\n var r2 = { x:matchingDroppables[i].pagePosition[0], y:matchingDroppables[i].pagePosition[1], w:matchingDroppables[i].size[0], h:matchingDroppables[i].size[1]};\n if (this.params.intersects(pageRect, r2) && (_multipleDrop || focusDropElement == null || focusDropElement === matchingDroppables[i].el) && matchingDroppables[i].canDrop(this)) {\n if (!focusDropElement) focusDropElement = matchingDroppables[i].el;\n intersectingDroppables.push(matchingDroppables[i]);\n matchingDroppables[i].setHover(this, true, e);\n }\n else if (matchingDroppables[i].isHover()) {\n matchingDroppables[i].setHover(this, false, e);\n }\n }\n\n _dispatch(\"drag\", {el:this.el, pos:cPos, e:e, drag:this});\n\n /* test to see if the parent needs to be scrolled (future)\n if (scroll) {\n var pnsl = dragEl.parentNode.scrollLeft, pnst = dragEl.parentNode.scrollTop;\n console.log(\"scroll!\", pnsl, pnst);\n }*/\n };\n this.destroy = function() {\n this.params.unbind(this.el, \"mousedown\", this.downListener);\n this.params.unbind(document, \"mousemove\", this.moveListener);\n this.params.unbind(document, \"mouseup\", this.upListener);\n this.downListener = null;\n this.upListener = null;\n this.moveListener = null;\n };\n\n // init:register mousedown, and perhaps set a filter\n this.params.bind(this.el, \"mousedown\", this.downListener);\n\n // if handle provded, use that. otherwise, try to set a filter.\n // note that a `handle` selector always results in filterExclude being set to false, ie.\n // the selector defines the handle element(s).\n if (this.params.handle)\n _setFilter(this.params.handle, false);\n else\n _setFilter(this.params.filter, this.params.filterExclude);\n };\n\n var Drop = function(el, params, css, scope) {\n this._class = css.droppable;\n this.params = params || {};\n this.rank = params.rank || 0;\n this._activeClass = this.params.activeClass || css.active;\n this._hoverClass = this.params.hoverClass || css.hover;\n Super.apply(this, arguments);\n var hover = false;\n this.allowLoopback = this.params.allowLoopback !== false;\n\n this.setActive = function(val) {\n this.params[val ? \"addClass\" : \"removeClass\"](this.el, this._activeClass);\n };\n\n this.updatePosition = function() {\n this.position = this.params.getPosition(this.el);\n this.pagePosition = this.params.getPosition(this.el, true);\n this.size = this.params.getSize(this.el);\n };\n\n this.canDrop = this.params.canDrop || function(drag) {\n return true;\n };\n\n this.isHover = function() { return hover; };\n\n this.setHover = function(drag, val, e) {\n // if turning off hover but this was not the drag that caused the hover, ignore.\n if (val || this.el._katavorioDragHover == null || this.el._katavorioDragHover === drag.el._katavorio) {\n this.params[val ? \"addClass\" : \"removeClass\"](this.el, this._hoverClass);\n this.el._katavorioDragHover = val ? drag.el._katavorio : null;\n if (hover !== val) {\n this.params.events[val ? \"over\" : \"out\"]({el: this.el, e: e, drag: drag, drop: this});\n }\n hover = val;\n }\n };\n\n /**\n * A drop event. `drag` is the corresponding Drag object, which may be a Drag for some specific element, or it\n * may be a Drag on some element acting as a delegate for elements contained within it.\n * @param drag\n * @param event\n * @returns {*}\n */\n this.drop = function(drag, event) {\n return this.params.events[\"drop\"]({ drag:drag, e:event, drop:this });\n };\n\n this.destroy = function() {\n this._class = null;\n this._activeClass = null;\n this._hoverClass = null;\n hover = null;\n };\n };\n\n var _uuid = function() {\n return ('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random()*16|0, v = c === 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n }));\n };\n\n var _rankSort = function(a,b) {\n return a.rank < b.rank ? 1 : a.rank > b.rank ? -1 : 0;\n };\n\n var _gel = function(el) {\n if (el == null) return null;\n el = (typeof el === \"string\" || el.constructor === String) ? document.getElementById(el) : el;\n if (el == null) return null;\n el._katavorio = el._katavorio || _uuid();\n return el;\n };\n\n root.Katavorio = function(katavorioParams) {\n\n var _selection = [],\n _selectionMap = {};\n\n this._dragsByScope = {};\n this._dropsByScope = {};\n var _zoom = 1,\n _reg = function(obj, map) {\n _each(obj, function(_obj) {\n for(var i = 0; i < _obj.scopes.length; i++) {\n map[_obj.scopes[i]] = map[_obj.scopes[i]] || [];\n map[_obj.scopes[i]].push(_obj);\n }\n });\n },\n _unreg = function(obj, map) {\n var c = 0;\n _each(obj, function(_obj) {\n for(var i = 0; i < _obj.scopes.length; i++) {\n if (map[_obj.scopes[i]]) {\n var idx = katavorioParams.indexOf(map[_obj.scopes[i]], _obj);\n if (idx !== -1) {\n map[_obj.scopes[i]].splice(idx, 1);\n c++;\n }\n }\n }\n });\n\n return c > 0 ;\n },\n _getMatchingDroppables = this.getMatchingDroppables = function(drag) {\n var dd = [], _m = {};\n for (var i = 0; i < drag.scopes.length; i++) {\n var _dd = this._dropsByScope[drag.scopes[i]];\n if (_dd) {\n for (var j = 0; j < _dd.length; j++) {\n if (_dd[j].canDrop(drag) && !_m[_dd[j].uuid] && (_dd[j].allowLoopback || _dd[j].el !== drag.el)) {\n _m[_dd[j].uuid] = true;\n dd.push(_dd[j]);\n }\n }\n }\n }\n dd.sort(_rankSort);\n return dd;\n },\n _prepareParams = function(p) {\n p = p || {};\n var _p = {\n events:{}\n }, i;\n for (i in katavorioParams) _p[i] = katavorioParams[i];\n for (i in p) _p[i] = p[i];\n // events\n\n for (i = 0; i < _events.length; i++) {\n _p.events[_events[i]] = p[_events[i]] || _devNull;\n }\n _p.katavorio = this;\n return _p;\n }.bind(this),\n _mistletoe = function(existingDrag, params) {\n for (var i = 0; i < _events.length; i++) {\n if (params[_events[i]]) {\n existingDrag.on(_events[i], params[_events[i]]);\n }\n }\n }.bind(this),\n _css = {},\n overrideCss = katavorioParams.css || {},\n _scope = katavorioParams.scope || _defaultScope;\n\n // prepare map of css classes based on defaults frst, then optional overrides\n for (var i in _classes) _css[i] = _classes[i];\n for (var i in overrideCss) _css[i] = overrideCss[i];\n\n var inputFilterSelector = katavorioParams.inputFilterSelector || _defaultInputFilterSelector;\n /**\n * Gets the selector identifying which input elements to filter from drag events.\n * @method getInputFilterSelector\n * @return {String} Current input filter selector.\n */\n this.getInputFilterSelector = function() { return inputFilterSelector; };\n\n /**\n * Sets the selector identifying which input elements to filter from drag events.\n * @method setInputFilterSelector\n * @param {String} selector Input filter selector to set.\n * @return {Katavorio} Current instance; method may be chained.\n */\n this.setInputFilterSelector = function(selector) {\n inputFilterSelector = selector;\n return this;\n };\n\n /**\n * Either makes the given element draggable, or identifies it as an element inside which some identified list\n * of elements may be draggable.\n * @param el\n * @param params\n * @returns {Array}\n */\n this.draggable = function(el, params) {\n var o = [];\n _each(el, function (_el) {\n _el = _gel(_el);\n if (_el != null) {\n if (_el._katavorioDrag == null) {\n var p = _prepareParams(params);\n _el._katavorioDrag = new Drag(_el, p, _css, _scope);\n _reg(_el._katavorioDrag, this._dragsByScope);\n o.push(_el._katavorioDrag);\n katavorioParams.addClass(_el, _css.draggable);\n }\n else {\n _mistletoe(_el._katavorioDrag, params);\n }\n }\n }.bind(this));\n return o;\n };\n\n this.droppable = function(el, params) {\n var o = [];\n _each(el, function(_el) {\n _el = _gel(_el);\n if (_el != null) {\n var drop = new Drop(_el, _prepareParams(params), _css, _scope);\n _el._katavorioDrop = _el._katavorioDrop || [];\n _el._katavorioDrop.push(drop);\n _reg(drop, this._dropsByScope);\n o.push(drop);\n katavorioParams.addClass(_el, _css.droppable);\n }\n }.bind(this));\n return o;\n };\n\n /**\n * @name Katavorio#select\n * @function\n * @desc Adds an element to the current selection (for multiple node drag)\n * @param {Element|String} DOM element - or id of the element - to add.\n */\n this.select = function(el) {\n _each(el, function() {\n var _el = _gel(this);\n if (_el && _el._katavorioDrag) {\n if (!_selectionMap[_el._katavorio]) {\n _selection.push(_el._katavorioDrag);\n _selectionMap[_el._katavorio] = [ _el, _selection.length - 1 ];\n katavorioParams.addClass(_el, _css.selected);\n }\n }\n });\n return this;\n };\n\n /**\n * @name Katavorio#deselect\n * @function\n * @desc Removes an element from the current selection (for multiple node drag)\n * @param {Element|String} DOM element - or id of the element - to remove.\n */\n this.deselect = function(el) {\n _each(el, function() {\n var _el = _gel(this);\n if (_el && _el._katavorio) {\n var e = _selectionMap[_el._katavorio];\n if (e) {\n var _s = [];\n for (var i = 0; i < _selection.length; i++)\n if (_selection[i].el !== _el) _s.push(_selection[i]);\n _selection = _s;\n delete _selectionMap[_el._katavorio];\n katavorioParams.removeClass(_el, _css.selected);\n }\n }\n });\n return this;\n };\n\n this.deselectAll = function() {\n for (var i in _selectionMap) {\n var d = _selectionMap[i];\n katavorioParams.removeClass(d[0], _css.selected);\n }\n\n _selection.length = 0;\n _selectionMap = {};\n };\n\n this.markSelection = function(drag) {\n _foreach(_selection, function(e) { e.mark(); }, drag);\n };\n\n this.markPosses = function(drag) {\n if (drag.posses) {\n _each(drag.posses, function(p) {\n if (drag.posseRoles[p] && _posses[p]) {\n _foreach(_posses[p].members, function (d) {\n d.mark();\n }, drag);\n }\n })\n }\n };\n\n this.unmarkSelection = function(drag, event) {\n _foreach(_selection, function(e) { e.unmark(event); }, drag);\n };\n\n this.unmarkPosses = function(drag, event) {\n if (drag.posses) {\n _each(drag.posses, function(p) {\n if (drag.posseRoles[p] && _posses[p]) {\n _foreach(_posses[p].members, function (d) {\n d.unmark(event, true);\n }, drag);\n }\n });\n }\n };\n\n this.getSelection = function() { return _selection.slice(0); };\n\n this.updateSelection = function(dx, dy, drag) {\n _foreach(_selection, function(e) { e.moveBy(dx, dy); }, drag);\n };\n\n var _posseAction = function(fn, drag) {\n if (drag.posses) {\n _each(drag.posses, function(p) {\n if (drag.posseRoles[p] && _posses[p]) {\n _foreach(_posses[p].members, function (e) {\n fn(e);\n }, drag);\n }\n });\n }\n };\n\n this.updatePosses = function(dx, dy, drag) {\n _posseAction(function(e) { e.moveBy(dx, dy); }, drag);\n };\n\n this.notifyPosseDragStop = function(drag, evt) {\n _posseAction(function(e) { e.stop(evt, true); }, drag);\n };\n\n this.notifySelectionDragStop = function(drag, evt) {\n _foreach(_selection, function(e) { e.stop(evt, true); }, drag);\n };\n\n this.notifySelectionDragStart = function(drag, evt) {\n _foreach(_selection, function(e) { e.notifyStart(evt);}, drag);\n };\n\n this.setZoom = function(z) { _zoom = z; };\n this.getZoom = function() { return _zoom; };\n\n // does the work of changing scopes\n var _scopeManip = function(kObj, scopes, map, fn) {\n _each(kObj, function(_kObj) {\n _unreg(_kObj, map); // deregister existing scopes\n _kObj[fn](scopes); // set scopes\n _reg(_kObj, map); // register new ones\n });\n };\n\n _each([ \"set\", \"add\", \"remove\", \"toggle\"], function(v) {\n this[v + \"Scope\"] = function(el, scopes) {\n _scopeManip(el._katavorioDrag, scopes, this._dragsByScope, v + \"Scope\");\n _scopeManip(el._katavorioDrop, scopes, this._dropsByScope, v + \"Scope\");\n }.bind(this);\n this[v + \"DragScope\"] = function(el, scopes) {\n _scopeManip(el.constructor === Drag ? el : el._katavorioDrag, scopes, this._dragsByScope, v + \"Scope\");\n }.bind(this);\n this[v + \"DropScope\"] = function(el, scopes) {\n _scopeManip(el.constructor === Drop ? el : el._katavorioDrop, scopes, this._dropsByScope, v + \"Scope\");\n }.bind(this);\n }.bind(this));\n\n this.snapToGrid = function(x, y) {\n for (var s in this._dragsByScope) {\n _foreach(this._dragsByScope[s], function(d) { d.snap(x, y); });\n }\n };\n\n this.getDragsForScope = function(s) { return this._dragsByScope[s]; };\n this.getDropsForScope = function(s) { return this._dropsByScope[s]; };\n\n var _destroy = function(el, type, map) {\n el = _gel(el);\n if (el[type]) {\n\n // remove from selection, if present.\n var selIdx = _selection.indexOf(el[type]);\n if (selIdx >= 0) {\n _selection.splice(selIdx, 1);\n }\n\n if (_unreg(el[type], map)) {\n _each(el[type], function(kObj) { kObj.destroy() });\n }\n\n delete el[type];\n }\n };\n\n var _removeListener = function(el, type, evt, fn) {\n el = _gel(el);\n if (el[type]) {\n el[type].off(evt, fn);\n }\n };\n\n this.elementRemoved = function(el) {\n this.destroyDraggable(el);\n this.destroyDroppable(el);\n };\n\n /**\n * Either completely remove drag functionality from the given element, or remove a specific event handler. If you\n * call this method with a single argument - the element - all drag functionality is removed from it. Otherwise, if\n * you provide an event name and listener function, this function is de-registered (if found).\n * @param el Element to update\n * @param {string} [evt] Optional event name to unsubscribe\n * @param {Function} [fn] Optional function to unsubscribe\n */\n this.destroyDraggable = function(el, evt, fn) {\n if (arguments.length === 1) {\n _destroy(el, \"_katavorioDrag\", this._dragsByScope);\n } else {\n _removeListener(el, \"_katavorioDrag\", evt, fn);\n }\n };\n\n /**\n * Either completely remove drop functionality from the given element, or remove a specific event handler. If you\n * call this method with a single argument - the element - all drop functionality is removed from it. Otherwise, if\n * you provide an event name and listener function, this function is de-registered (if found).\n * @param el Element to update\n * @param {string} [evt] Optional event name to unsubscribe\n * @param {Function} [fn] Optional function to unsubscribe\n */\n this.destroyDroppable = function(el, evt, fn) {\n if (arguments.length === 1) {\n _destroy(el, \"_katavorioDrop\", this._dropsByScope);\n } else {\n _removeListener(el, \"_katavorioDrop\", evt, fn);\n }\n };\n\n this.reset = function() {\n this._dragsByScope = {};\n this._dropsByScope = {};\n _selection = [];\n _selectionMap = {};\n _posses = {};\n };\n\n // ----- groups\n var _posses = {};\n\n var _processOneSpec = function(el, _spec, dontAddExisting) {\n var posseId = _isString(_spec) ? _spec : _spec.id;\n var active = _isString(_spec) ? true : _spec.active !== false;\n var posse = _posses[posseId] || (function() {\n var g = {name:posseId, members:[]};\n _posses[posseId] = g;\n return g;\n })();\n _each(el, function(_el) {\n if (_el._katavorioDrag) {\n\n if (dontAddExisting && _el._katavorioDrag.posseRoles[posse.name] != null) return;\n\n _suggest(posse.members, _el._katavorioDrag);\n _suggest(_el._katavorioDrag.posses, posse.name);\n _el._katavorioDrag.posseRoles[posse.name] = active;\n }\n });\n return posse;\n };\n\n /**\n * Add the given element to the posse with the given id, creating the group if it at first does not exist.\n * @method addToPosse\n * @param {Element} el Element to add.\n * @param {String...|Object...} spec Variable args parameters. Each argument can be a either a String, indicating\n * the ID of a Posse to which the element should be added as an active participant, or an Object containing\n * `{ id:\"posseId\", active:false/true}`. In the latter case, if `active` is not provided it is assumed to be\n * true.\n * @returns {Posse|Posse[]} The Posse(s) to which the element(s) was/were added.\n */\n this.addToPosse = function(el, spec) {\n\n var posses = [];\n\n for (var i = 1; i < arguments.length; i++) {\n posses.push(_processOneSpec(el, arguments[i]));\n }\n\n return posses.length === 1 ? posses[0] : posses;\n };\n\n /**\n * Sets the posse(s) for the element with the given id, creating those that do not yet exist, and removing from\n * the element any current Posses that are not specified by this method call. This method will not change the\n * active/passive state if it is given a posse in which the element is already a member.\n * @method setPosse\n * @param {Element} el Element to set posse(s) on.\n * @param {String...|Object...} spec Variable args parameters. Each argument can be a either a String, indicating\n * the ID of a Posse to which the element should be added as an active participant, or an Object containing\n * `{ id:\"posseId\", active:false/true}`. In the latter case, if `active` is not provided it is assumed to be\n * true.\n * @returns {Posse|Posse[]} The Posse(s) to which the element(s) now belongs.\n */\n this.setPosse = function(el, spec) {\n\n var posses = [];\n\n for (var i = 1; i < arguments.length; i++) {\n posses.push(_processOneSpec(el, arguments[i], true).name);\n }\n\n _each(el, function(_el) {\n if (_el._katavorioDrag) {\n var diff = _difference(_el._katavorioDrag.posses, posses);\n var p = [];\n Array.prototype.push.apply(p, _el._katavorioDrag.posses);\n for (var i = 0; i < diff.length; i++) {\n this.removeFromPosse(_el, diff[i]);\n }\n }\n }.bind(this));\n\n return posses.length === 1 ? posses[0] : posses;\n };\n\n /**\n * Remove the given element from the given posse(s).\n * @method removeFromPosse\n * @param {Element} el Element to remove.\n * @param {String...} posseId Varargs parameter: one value for each posse to remove the element from.\n */\n this.removeFromPosse = function(el, posseId) {\n if (arguments.length < 2) throw new TypeError(\"No posse id provided for remove operation\");\n for(var i = 1; i < arguments.length; i++) {\n posseId = arguments[i];\n _each(el, function (_el) {\n if (_el._katavorioDrag && _el._katavorioDrag.posses) {\n var d = _el._katavorioDrag;\n _each(posseId, function (p) {\n _vanquish(_posses[p].members, d);\n _vanquish(d.posses, p);\n delete d.posseRoles[p];\n });\n }\n });\n }\n };\n\n /**\n * Remove the given element from all Posses to which it belongs.\n * @method removeFromAllPosses\n * @param {Element|Element[]} el Element to remove from Posses.\n */\n this.removeFromAllPosses = function(el) {\n _each(el, function(_el) {\n if (_el._katavorioDrag && _el._katavorioDrag.posses) {\n var d = _el._katavorioDrag;\n _each(d.posses, function(p) {\n _vanquish(_posses[p].members, d);\n });\n d.posses.length = 0;\n d.posseRoles = {};\n }\n });\n };\n\n /**\n * Changes the participation state for the element in the Posse with the given ID.\n * @param {Element|Element[]} el Element(s) to change state for.\n * @param {String} posseId ID of the Posse to change element state for.\n * @param {Boolean} state True to make active, false to make passive.\n */\n this.setPosseState = function(el, posseId, state) {\n var posse = _posses[posseId];\n if (posse) {\n _each(el, function(_el) {\n if (_el._katavorioDrag && _el._katavorioDrag.posses) {\n _el._katavorioDrag.posseRoles[posse.name] = state;\n }\n });\n }\n };\n\n };\n\n root.Katavorio.version = \"1.0.0\";\n\n if (typeof exports !== \"undefined\") {\n exports.Katavorio = root.Katavorio;\n }\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n\n(function() {\n\n var root = this;\n root.jsPlumbUtil = root.jsPlumbUtil || {};\n var jsPlumbUtil = root.jsPlumbUtil;\n\n if (typeof exports !=='undefined') { exports.jsPlumbUtil = jsPlumbUtil;}\n\n\n function isArray(a) {\n return Object.prototype.toString.call(a) === \"[object Array]\";\n }\n jsPlumbUtil.isArray = isArray;\n function isNumber(n) {\n return Object.prototype.toString.call(n) === \"[object Number]\";\n }\n jsPlumbUtil.isNumber = isNumber;\n function isString(s) {\n return typeof s === \"string\";\n }\n jsPlumbUtil.isString = isString;\n function isBoolean(s) {\n return typeof s === \"boolean\";\n }\n jsPlumbUtil.isBoolean = isBoolean;\n function isNull(s) {\n return s == null;\n }\n jsPlumbUtil.isNull = isNull;\n function isObject(o) {\n return o == null ? false : Object.prototype.toString.call(o) === \"[object Object]\";\n }\n jsPlumbUtil.isObject = isObject;\n function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n }\n jsPlumbUtil.isDate = isDate;\n function isFunction(o) {\n return Object.prototype.toString.call(o) === \"[object Function]\";\n }\n jsPlumbUtil.isFunction = isFunction;\n function isNamedFunction(o) {\n return isFunction(o) && o.name != null && o.name.length > 0;\n }\n jsPlumbUtil.isNamedFunction = isNamedFunction;\n function isEmpty(o) {\n for (var i in o) {\n if (o.hasOwnProperty(i)) {\n return false;\n }\n }\n return true;\n }\n jsPlumbUtil.isEmpty = isEmpty;\n function clone(a) {\n if (isString(a)) {\n return \"\" + a;\n }\n else if (isBoolean(a)) {\n return !!a;\n }\n else if (isDate(a)) {\n return new Date(a.getTime());\n }\n else if (isFunction(a)) {\n return a;\n }\n else if (isArray(a)) {\n var b = [];\n for (var i = 0; i < a.length; i++) {\n b.push(clone(a[i]));\n }\n return b;\n }\n else if (isObject(a)) {\n var c = {};\n for (var j in a) {\n c[j] = clone(a[j]);\n }\n return c;\n }\n else {\n return a;\n }\n }\n jsPlumbUtil.clone = clone;\n function merge(a, b, collations, overwrites) {\n // first change the collations array - if present - into a lookup table, because its faster.\n var cMap = {}, ar, i, oMap = {};\n collations = collations || [];\n overwrites = overwrites || [];\n for (i = 0; i < collations.length; i++) {\n cMap[collations[i]] = true;\n }\n for (i = 0; i < overwrites.length; i++) {\n oMap[overwrites[i]] = true;\n }\n var c = clone(a);\n for (i in b) {\n if (c[i] == null || oMap[i]) {\n c[i] = b[i];\n }\n else if (isString(b[i]) || isBoolean(b[i])) {\n if (!cMap[i]) {\n c[i] = b[i]; // if we dont want to collate, just copy it in.\n }\n else {\n ar = [];\n // if c's object is also an array we can keep its values.\n ar.push.apply(ar, isArray(c[i]) ? c[i] : [c[i]]);\n ar.push.apply(ar, isBoolean(b[i]) ? b[i] : [b[i]]);\n c[i] = ar;\n }\n }\n else {\n if (isArray(b[i])) {\n ar = [];\n // if c's object is also an array we can keep its values.\n if (isArray(c[i])) {\n ar.push.apply(ar, c[i]);\n }\n ar.push.apply(ar, b[i]);\n c[i] = ar;\n }\n else if (isObject(b[i])) {\n // overwrite c's value with an object if it is not already one.\n if (!isObject(c[i])) {\n c[i] = {};\n }\n for (var j in b[i]) {\n c[i][j] = b[i][j];\n }\n }\n }\n }\n return c;\n }\n jsPlumbUtil.merge = merge;\n function replace(inObj, path, value) {\n if (inObj == null) {\n return;\n }\n var q = inObj, t = q;\n path.replace(/([^\\.])+/g, function (term, lc, pos, str) {\n var array = term.match(/([^\\[0-9]+){1}(\\[)([0-9+])/), last = pos + term.length >= str.length, _getArray = function () {\n return t[array[1]] || (function () {\n t[array[1]] = [];\n return t[array[1]];\n })();\n };\n if (last) {\n // set term = value on current t, creating term as array if necessary.\n if (array) {\n _getArray()[array[3]] = value;\n }\n else {\n t[term] = value;\n }\n }\n else {\n // set to current t[term], creating t[term] if necessary.\n if (array) {\n var a_1 = _getArray();\n t = a_1[array[3]] || (function () {\n a_1[array[3]] = {};\n return a_1[array[3]];\n })();\n }\n else {\n t = t[term] || (function () {\n t[term] = {};\n return t[term];\n })();\n }\n }\n return \"\";\n });\n return inObj;\n }\n jsPlumbUtil.replace = replace;\n //\n // chain a list of functions, supplied by [ object, method name, args ], and return on the first\n // one that returns the failValue. if none return the failValue, return the successValue.\n //\n function functionChain(successValue, failValue, fns) {\n for (var i = 0; i < fns.length; i++) {\n var o = fns[i][0][fns[i][1]].apply(fns[i][0], fns[i][2]);\n if (o === failValue) {\n return o;\n }\n }\n return successValue;\n }\n jsPlumbUtil.functionChain = functionChain;\n /**\n *\n * Take the given model and expand out any parameters. 'functionPrefix' is optional, and if present, helps jsplumb figure out what to do if a value is a Function.\n * if you do not provide it (and doNotExpandFunctions is null, or false), jsplumb will run the given values through any functions it finds, and use the function's\n * output as the value in the result. if you do provide the prefix, only functions that are named and have this prefix\n * will be executed; other functions will be passed as values to the output.\n *\n * @param model\n * @param values\n * @param functionPrefix\n * @param doNotExpandFunctions\n * @returns {any}\n */\n function populate(model, values, functionPrefix, doNotExpandFunctions) {\n // for a string, see if it has parameter matches, and if so, try to make the substitutions.\n var getValue = function (fromString) {\n var matches = fromString.match(/(\\${.*?})/g);\n if (matches != null) {\n for (var i = 0; i < matches.length; i++) {\n var val = values[matches[i].substring(2, matches[i].length - 1)] || \"\";\n if (val != null) {\n fromString = fromString.replace(matches[i], val);\n }\n }\n }\n return fromString;\n };\n // process one entry.\n var _one = function (d) {\n if (d != null) {\n if (isString(d)) {\n return getValue(d);\n }\n else if (isFunction(d) && !doNotExpandFunctions && (functionPrefix == null || (d.name || \"\").indexOf(functionPrefix) === 0)) {\n return d(values);\n }\n else if (isArray(d)) {\n var r = [];\n for (var i = 0; i < d.length; i++) {\n r.push(_one(d[i]));\n }\n return r;\n }\n else if (isObject(d)) {\n var s = {};\n for (var j in d) {\n s[j] = _one(d[j]);\n }\n return s;\n }\n else {\n return d;\n }\n }\n };\n return _one(model);\n }\n jsPlumbUtil.populate = populate;\n function findWithFunction(a, f) {\n if (a) {\n for (var i = 0; i < a.length; i++) {\n if (f(a[i])) {\n return i;\n }\n }\n }\n return -1;\n }\n jsPlumbUtil.findWithFunction = findWithFunction;\n function removeWithFunction(a, f) {\n var idx = findWithFunction(a, f);\n if (idx > -1) {\n a.splice(idx, 1);\n }\n return idx !== -1;\n }\n jsPlumbUtil.removeWithFunction = removeWithFunction;\n function remove(l, v) {\n var idx = l.indexOf(v);\n if (idx > -1) {\n l.splice(idx, 1);\n }\n return idx !== -1;\n }\n jsPlumbUtil.remove = remove;\n function addWithFunction(list, item, hashFunction) {\n if (findWithFunction(list, hashFunction) === -1) {\n list.push(item);\n }\n }\n jsPlumbUtil.addWithFunction = addWithFunction;\n function addToList(map, key, value, insertAtStart) {\n var l = map[key];\n if (l == null) {\n l = [];\n map[key] = l;\n }\n l[insertAtStart ? \"unshift\" : \"push\"](value);\n return l;\n }\n jsPlumbUtil.addToList = addToList;\n function suggest(list, item, insertAtHead) {\n if (list.indexOf(item) === -1) {\n if (insertAtHead) {\n list.unshift(item);\n }\n else {\n list.push(item);\n }\n return true;\n }\n return false;\n }\n jsPlumbUtil.suggest = suggest;\n //\n // extends the given obj (which can be an array) with the given constructor function, prototype functions, and\n // class members, any of which may be null.\n //\n function extend(child, parent, _protoFn) {\n var i;\n parent = isArray(parent) ? parent : [parent];\n var _copyProtoChain = function (focus) {\n var proto = focus.__proto__;\n while (proto != null) {\n if (proto.prototype != null) {\n for (var j in proto.prototype) {\n if (proto.prototype.hasOwnProperty(j) && !child.prototype.hasOwnProperty(j)) {\n child.prototype[j] = proto.prototype[j];\n }\n }\n proto = proto.prototype.__proto__;\n }\n else {\n proto = null;\n }\n }\n };\n for (i = 0; i < parent.length; i++) {\n for (var j in parent[i].prototype) {\n if (parent[i].prototype.hasOwnProperty(j) && !child.prototype.hasOwnProperty(j)) {\n child.prototype[j] = parent[i].prototype[j];\n }\n }\n _copyProtoChain(parent[i]);\n }\n var _makeFn = function (name, protoFn) {\n return function () {\n for (i = 0; i < parent.length; i++) {\n if (parent[i].prototype[name]) {\n parent[i].prototype[name].apply(this, arguments);\n }\n }\n return protoFn.apply(this, arguments);\n };\n };\n var _oneSet = function (fns) {\n for (var k in fns) {\n child.prototype[k] = _makeFn(k, fns[k]);\n }\n };\n if (arguments.length > 2) {\n for (i = 2; i < arguments.length; i++) {\n _oneSet(arguments[i]);\n }\n }\n return child;\n }\n jsPlumbUtil.extend = extend;\n function uuid() {\n return ('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n }));\n }\n jsPlumbUtil.uuid = uuid;\n function fastTrim(s) {\n if (s == null) {\n return null;\n }\n var str = s.replace(/^\\s\\s*/, ''), ws = /\\s/, i = str.length;\n while (ws.test(str.charAt(--i))) {\n }\n return str.slice(0, i + 1);\n }\n jsPlumbUtil.fastTrim = fastTrim;\n function each(obj, fn) {\n obj = obj.length == null || typeof obj === \"string\" ? [obj] : obj;\n for (var i = 0; i < obj.length; i++) {\n fn(obj[i]);\n }\n }\n jsPlumbUtil.each = each;\n function map(obj, fn) {\n var o = [];\n for (var i = 0; i < obj.length; i++) {\n o.push(fn(obj[i]));\n }\n return o;\n }\n jsPlumbUtil.map = map;\n function mergeWithParents(type, map, parentAttribute) {\n parentAttribute = parentAttribute || \"parent\";\n var _def = function (id) {\n return id ? map[id] : null;\n };\n var _parent = function (def) {\n return def ? _def(def[parentAttribute]) : null;\n };\n var _one = function (parent, def) {\n if (parent == null) {\n return def;\n }\n else {\n var d_1 = merge(parent, def);\n return _one(_parent(parent), d_1);\n }\n };\n var _getDef = function (t) {\n if (t == null) {\n return {};\n }\n if (typeof t === \"string\") {\n return _def(t);\n }\n else if (t.length) {\n var done = false, i = 0, _dd = void 0;\n while (!done && i < t.length) {\n _dd = _getDef(t[i]);\n if (_dd) {\n done = true;\n }\n else {\n i++;\n }\n }\n return _dd;\n }\n };\n var d = _getDef(type);\n if (d) {\n return _one(_parent(d), d);\n }\n else {\n return {};\n }\n }\n jsPlumbUtil.mergeWithParents = mergeWithParents;\n jsPlumbUtil.logEnabled = true;\n function log() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (jsPlumbUtil.logEnabled && typeof console !== \"undefined\") {\n try {\n var msg = arguments[arguments.length - 1];\n console.log(msg);\n }\n catch (e) {\n }\n }\n }\n jsPlumbUtil.log = log;\n /**\n * Wraps one function with another, creating a placeholder for the\n * wrapped function if it was null. this is used to wrap the various\n * drag/drop event functions - to allow jsPlumb to be notified of\n * important lifecycle events without imposing itself on the user's\n * drag/drop functionality.\n * @method jsPlumbUtil.wrap\n * @param {Function} wrappedFunction original function to wrap; may be null.\n * @param {Function} newFunction function to wrap the original with.\n * @param {Object} [returnOnThisValue] Optional. Indicates that the wrappedFunction should\n * not be executed if the newFunction returns a value matching 'returnOnThisValue'.\n * note that this is a simple comparison and only works for primitives right now.\n */\n function wrap(wrappedFunction, newFunction, returnOnThisValue) {\n return function () {\n var r = null;\n try {\n if (newFunction != null) {\n r = newFunction.apply(this, arguments);\n }\n }\n catch (e) {\n log(\"jsPlumb function failed : \" + e);\n }\n if ((wrappedFunction != null) && (returnOnThisValue == null || (r !== returnOnThisValue))) {\n try {\n r = wrappedFunction.apply(this, arguments);\n }\n catch (e) {\n log(\"wrapped function failed : \" + e);\n }\n }\n return r;\n };\n }\n jsPlumbUtil.wrap = wrap;\n var EventGenerator = /** @class */ (function () {\n function EventGenerator() {\n var _this = this;\n this._listeners = {};\n this.eventsSuspended = false;\n this.tick = false;\n // this is a list of events that should re-throw any errors that occur during their dispatch.\n this.eventsToDieOn = { \"ready\": true };\n this.queue = [];\n this.bind = function (event, listener, insertAtStart) {\n var _one = function (evt) {\n addToList(_this._listeners, evt, listener, insertAtStart);\n listener.__jsPlumb = listener.__jsPlumb || {};\n listener.__jsPlumb[uuid()] = evt;\n };\n if (typeof event === \"string\") {\n _one(event);\n }\n else if (event.length != null) {\n for (var i = 0; i < event.length; i++) {\n _one(event[i]);\n }\n }\n return _this;\n };\n this.fire = function (event, value, originalEvent) {\n if (!this.tick) {\n this.tick = true;\n if (!this.eventsSuspended && this._listeners[event]) {\n var l = this._listeners[event].length, i = 0, _gone = false, ret = null;\n if (!this.shouldFireEvent || this.shouldFireEvent(event, value, originalEvent)) {\n while (!_gone && i < l && ret !== false) {\n // doing it this way rather than catching and then possibly re-throwing means that an error propagated by this\n // method will have the whole call stack available in the debugger.\n if (this.eventsToDieOn[event]) {\n this._listeners[event][i].apply(this, [value, originalEvent]);\n }\n else {\n try {\n ret = this._listeners[event][i].apply(this, [value, originalEvent]);\n }\n catch (e) {\n log(\"jsPlumb: fire failed for event \" + event + \" : \" + e);\n }\n }\n i++;\n if (this._listeners == null || this._listeners[event] == null) {\n _gone = true;\n }\n }\n }\n }\n this.tick = false;\n this._drain();\n }\n else {\n this.queue.unshift(arguments);\n }\n return this;\n };\n this._drain = function () {\n var n = _this.queue.pop();\n if (n) {\n _this.fire.apply(_this, n);\n }\n };\n this.unbind = function (eventOrListener, listener) {\n if (arguments.length === 0) {\n this._listeners = {};\n }\n else if (arguments.length === 1) {\n if (typeof eventOrListener === \"string\") {\n delete this._listeners[eventOrListener];\n }\n else if (eventOrListener.__jsPlumb) {\n var evt = void 0;\n for (var i in eventOrListener.__jsPlumb) {\n evt = eventOrListener.__jsPlumb[i];\n remove(this._listeners[evt] || [], eventOrListener);\n }\n }\n }\n else if (arguments.length === 2) {\n remove(this._listeners[eventOrListener] || [], listener);\n }\n return this;\n };\n this.getListener = function (forEvent) {\n return _this._listeners[forEvent];\n };\n this.setSuspendEvents = function (val) {\n _this.eventsSuspended = val;\n };\n this.isSuspendEvents = function () {\n return _this.eventsSuspended;\n };\n this.silently = function (fn) {\n _this.setSuspendEvents(true);\n try {\n fn();\n }\n catch (e) {\n log(\"Cannot execute silent function \" + e);\n }\n _this.setSuspendEvents(false);\n };\n this.cleanupListeners = function () {\n for (var i in _this._listeners) {\n _this._listeners[i] = null;\n }\n };\n }\n return EventGenerator;\n }());\n jsPlumbUtil.EventGenerator = EventGenerator;\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains utility functions that run in browsers only.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n ;(function() {\n\n \"use strict\";\n\n var root = this;\n\n root.jsPlumbUtil.matchesSelector = function(el, selector, ctx) {\n ctx = ctx || el.parentNode;\n var possibles = ctx.querySelectorAll(selector);\n for (var i = 0; i < possibles.length; i++) {\n if (possibles[i] === el) {\n return true;\n }\n }\n return false;\n };\n\n root.jsPlumbUtil.consume = function(e, doNotPreventDefault) {\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n else {\n e.returnValue = false;\n }\n\n if (!doNotPreventDefault && e.preventDefault){\n e.preventDefault();\n }\n };\n\n /*\n * Function: sizeElement\n * Helper to size and position an element. You would typically use\n * this when writing your own Connector or Endpoint implementation.\n *\n * Parameters:\n * x - [int] x position for the element origin\n * y - [int] y position for the element origin\n * w - [int] width of the element\n * h - [int] height of the element\n *\n */\n root.jsPlumbUtil.sizeElement = function(el, x, y, w, h) {\n if (el) {\n el.style.height = h + \"px\";\n el.height = h;\n el.style.width = w + \"px\";\n el.width = w;\n el.style.left = x + \"px\";\n el.style.top = y + \"px\";\n }\n };\n\n }).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the core code.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function () {\n\n \"use strict\";\n\n var root = this;\n\n var _ju = root.jsPlumbUtil,\n\n /**\n * creates a timestamp, using milliseconds since 1970, but as a string.\n */\n _timestamp = function () {\n return \"\" + (new Date()).getTime();\n },\n\n // helper method to update the hover style whenever it, or paintStyle, changes.\n // we use paintStyle as the foundation and merge hoverPaintStyle over the\n // top.\n _updateHoverStyle = function (component) {\n if (component._jsPlumb.paintStyle && component._jsPlumb.hoverPaintStyle) {\n var mergedHoverStyle = {};\n jsPlumb.extend(mergedHoverStyle, component._jsPlumb.paintStyle);\n jsPlumb.extend(mergedHoverStyle, component._jsPlumb.hoverPaintStyle);\n delete component._jsPlumb.hoverPaintStyle;\n // we want the fill of paintStyle to override a gradient, if possible.\n if (mergedHoverStyle.gradient && component._jsPlumb.paintStyle.fill) {\n delete mergedHoverStyle.gradient;\n }\n component._jsPlumb.hoverPaintStyle = mergedHoverStyle;\n }\n },\n events = [\"tap\", \"dbltap\", \"click\", \"dblclick\", \"mouseover\", \"mouseout\", \"mousemove\", \"mousedown\", \"mouseup\", \"contextmenu\" ],\n eventFilters = { \"mouseout\": \"mouseleave\", \"mouseexit\": \"mouseleave\" },\n _updateAttachedElements = function (component, state, timestamp, sourceElement) {\n var affectedElements = component.getAttachedElements();\n if (affectedElements) {\n for (var i = 0, j = affectedElements.length; i < j; i++) {\n if (!sourceElement || sourceElement !== affectedElements[i]) {\n affectedElements[i].setHover(state, true, timestamp);\t\t\t// tell the attached elements not to inform their own attached elements.\n }\n }\n }\n },\n _splitType = function (t) {\n return t == null ? null : t.split(\" \");\n },\n _mapType = function(map, obj, typeId) {\n for (var i in obj) {\n map[i] = typeId;\n }\n },\n _each = function(fn, obj) {\n obj = _ju.isArray(obj) || (obj.length != null && !_ju.isString(obj)) ? obj : [ obj ];\n for (var i = 0; i < obj.length; i++) {\n try {\n fn.apply(obj[i], [ obj[i] ]);\n }\n catch (e) {\n _ju.log(\".each iteration failed : \" + e);\n }\n }\n },\n _applyTypes = function (component, params, doNotRepaint) {\n if (component.getDefaultType) {\n var td = component.getTypeDescriptor(), map = {};\n var defType = component.getDefaultType();\n var o = _ju.merge({}, defType);\n _mapType(map, defType, \"__default\");\n for (var i = 0, j = component._jsPlumb.types.length; i < j; i++) {\n var tid = component._jsPlumb.types[i];\n if (tid !== \"__default\") {\n var _t = component._jsPlumb.instance.getType(tid, td);\n if (_t != null) {\n o = _ju.merge(o, _t, [ \"cssClass\" ], [ \"connector\" ]);\n _mapType(map, _t, tid);\n }\n }\n }\n\n if (params) {\n o = _ju.populate(o, params, \"_\");\n }\n\n component.applyType(o, doNotRepaint, map);\n if (!doNotRepaint) {\n component.repaint();\n }\n }\n },\n\n// ------------------------------ BEGIN jsPlumbUIComponent --------------------------------------------\n\n jsPlumbUIComponent = root.jsPlumbUIComponent = function (params) {\n\n _ju.EventGenerator.apply(this, arguments);\n\n var self = this,\n a = arguments,\n idPrefix = self.idPrefix,\n id = idPrefix + (new Date()).getTime();\n\n this._jsPlumb = {\n instance: params._jsPlumb,\n parameters: params.parameters || {},\n paintStyle: null,\n hoverPaintStyle: null,\n paintStyleInUse: null,\n hover: false,\n beforeDetach: params.beforeDetach,\n beforeDrop: params.beforeDrop,\n overlayPlacements: [],\n hoverClass: params.hoverClass || params._jsPlumb.Defaults.HoverClass,\n types: [],\n typeCache:{}\n };\n\n this.cacheTypeItem = function(key, item, typeId) {\n this._jsPlumb.typeCache[typeId] = this._jsPlumb.typeCache[typeId] || {};\n this._jsPlumb.typeCache[typeId][key] = item;\n };\n this.getCachedTypeItem = function(key, typeId) {\n return this._jsPlumb.typeCache[typeId] ? this._jsPlumb.typeCache[typeId][key] : null;\n };\n\n this.getId = function () {\n return id;\n };\n\n// ----------------------------- default type --------------------------------------------\n\n\n var o = params.overlays || [], oo = {};\n if (this.defaultOverlayKeys) {\n for (var i = 0; i < this.defaultOverlayKeys.length; i++) {\n Array.prototype.push.apply(o, this._jsPlumb.instance.Defaults[this.defaultOverlayKeys[i]] || []);\n }\n\n for (i = 0; i < o.length; i++) {\n // if a string, convert to object representation so that we can store the typeid on it.\n // also assign an id.\n var fo = jsPlumb.convertToFullOverlaySpec(o[i]);\n oo[fo[1].id] = fo;\n }\n }\n\n var _defaultType = {\n overlays:oo,\n parameters: params.parameters || {},\n scope: params.scope || this._jsPlumb.instance.getDefaultScope()\n };\n this.getDefaultType = function() {\n return _defaultType;\n };\n this.appendToDefaultType = function(obj) {\n for (var i in obj) {\n _defaultType[i] = obj[i];\n }\n };\n\n// ----------------------------- end default type --------------------------------------------\n\n // all components can generate events\n\n if (params.events) {\n for (var evtName in params.events) {\n self.bind(evtName, params.events[evtName]);\n }\n }\n\n // all components get this clone function.\n // TODO issue 116 showed a problem with this - it seems 'a' that is in\n // the clone function's scope is shared by all invocations of it, the classic\n // JS closure problem. for now, jsPlumb does a version of this inline where\n // it used to call clone. but it would be nice to find some time to look\n // further at this.\n this.clone = function () {\n var o = Object.create(this.constructor.prototype);\n this.constructor.apply(o, a);\n return o;\n }.bind(this);\n\n // user can supply a beforeDetach callback, which will be executed before a detach\n // is performed; returning false prevents the detach.\n this.isDetachAllowed = function (connection) {\n var r = true;\n if (this._jsPlumb.beforeDetach) {\n try {\n r = this._jsPlumb.beforeDetach(connection);\n }\n catch (e) {\n _ju.log(\"jsPlumb: beforeDetach callback failed\", e);\n }\n }\n return r;\n };\n\n // user can supply a beforeDrop callback, which will be executed before a dropped\n // connection is confirmed. user can return false to reject connection.\n this.isDropAllowed = function (sourceId, targetId, scope, connection, dropEndpoint, source, target) {\n var r = this._jsPlumb.instance.checkCondition(\"beforeDrop\", {\n sourceId: sourceId,\n targetId: targetId,\n scope: scope,\n connection: connection,\n dropEndpoint: dropEndpoint,\n source: source, target: target\n });\n if (this._jsPlumb.beforeDrop) {\n try {\n r = this._jsPlumb.beforeDrop({\n sourceId: sourceId,\n targetId: targetId,\n scope: scope,\n connection: connection,\n dropEndpoint: dropEndpoint,\n source: source, target: target\n });\n }\n catch (e) {\n _ju.log(\"jsPlumb: beforeDrop callback failed\", e);\n }\n }\n return r;\n };\n\n var domListeners = [];\n\n // sets the component associated with listener events. for instance, an overlay delegates\n // its events back to a connector. but if the connector is swapped on the underlying connection,\n // then this component must be changed. This is called by setConnector in the Connection class.\n this.setListenerComponent = function (c) {\n for (var i = 0; i < domListeners.length; i++) {\n domListeners[i][3] = c;\n }\n };\n\n\n };\n\n var _removeTypeCssHelper = function (component, typeIndex) {\n var typeId = component._jsPlumb.types[typeIndex],\n type = component._jsPlumb.instance.getType(typeId, component.getTypeDescriptor());\n\n if (type != null && type.cssClass && component.canvas) {\n component._jsPlumb.instance.removeClass(component.canvas, type.cssClass);\n }\n };\n\n _ju.extend(root.jsPlumbUIComponent, _ju.EventGenerator, {\n\n getParameter: function (name) {\n return this._jsPlumb.parameters[name];\n },\n\n setParameter: function (name, value) {\n this._jsPlumb.parameters[name] = value;\n },\n\n getParameters: function () {\n return this._jsPlumb.parameters;\n },\n\n setParameters: function (p) {\n this._jsPlumb.parameters = p;\n },\n\n getClass:function() {\n return jsPlumb.getClass(this.canvas);\n },\n\n hasClass:function(clazz) {\n return jsPlumb.hasClass(this.canvas, clazz);\n },\n\n addClass: function (clazz) {\n jsPlumb.addClass(this.canvas, clazz);\n },\n\n removeClass: function (clazz) {\n jsPlumb.removeClass(this.canvas, clazz);\n },\n\n updateClasses: function (classesToAdd, classesToRemove) {\n jsPlumb.updateClasses(this.canvas, classesToAdd, classesToRemove);\n },\n\n setType: function (typeId, params, doNotRepaint) {\n this.clearTypes();\n this._jsPlumb.types = _splitType(typeId) || [];\n _applyTypes(this, params, doNotRepaint);\n },\n\n getType: function () {\n return this._jsPlumb.types;\n },\n\n reapplyTypes: function (params, doNotRepaint) {\n _applyTypes(this, params, doNotRepaint);\n },\n\n hasType: function (typeId) {\n return this._jsPlumb.types.indexOf(typeId) !== -1;\n },\n\n addType: function (typeId, params, doNotRepaint) {\n var t = _splitType(typeId), _cont = false;\n if (t != null) {\n for (var i = 0, j = t.length; i < j; i++) {\n if (!this.hasType(t[i])) {\n this._jsPlumb.types.push(t[i]);\n _cont = true;\n }\n }\n if (_cont) {\n _applyTypes(this, params, doNotRepaint);\n }\n }\n },\n\n removeType: function (typeId, params, doNotRepaint) {\n var t = _splitType(typeId), _cont = false, _one = function (tt) {\n var idx = this._jsPlumb.types.indexOf(tt);\n if (idx !== -1) {\n // remove css class if necessary\n _removeTypeCssHelper(this, idx);\n this._jsPlumb.types.splice(idx, 1);\n return true;\n }\n return false;\n }.bind(this);\n\n if (t != null) {\n for (var i = 0, j = t.length; i < j; i++) {\n _cont = _one(t[i]) || _cont;\n }\n if (_cont) {\n _applyTypes(this, params, doNotRepaint);\n }\n }\n },\n clearTypes: function (params, doNotRepaint) {\n var i = this._jsPlumb.types.length;\n for (var j = 0; j < i; j++) {\n _removeTypeCssHelper(this, 0);\n this._jsPlumb.types.splice(0, 1);\n }\n _applyTypes(this, params, doNotRepaint);\n },\n\n toggleType: function (typeId, params, doNotRepaint) {\n var t = _splitType(typeId);\n if (t != null) {\n for (var i = 0, j = t.length; i < j; i++) {\n var idx = this._jsPlumb.types.indexOf(t[i]);\n if (idx !== -1) {\n _removeTypeCssHelper(this, idx);\n this._jsPlumb.types.splice(idx, 1);\n }\n else {\n this._jsPlumb.types.push(t[i]);\n }\n }\n\n _applyTypes(this, params, doNotRepaint);\n }\n },\n applyType: function (t, doNotRepaint) {\n this.setPaintStyle(t.paintStyle, doNotRepaint);\n this.setHoverPaintStyle(t.hoverPaintStyle, doNotRepaint);\n if (t.parameters) {\n for (var i in t.parameters) {\n this.setParameter(i, t.parameters[i]);\n }\n }\n this._jsPlumb.paintStyleInUse = this.getPaintStyle();\n },\n setPaintStyle: function (style, doNotRepaint) {\n // this._jsPlumb.paintStyle = jsPlumb.extend({}, style);\n // TODO figure out if we want components to clone paintStyle so as not to share it.\n this._jsPlumb.paintStyle = style;\n this._jsPlumb.paintStyleInUse = this._jsPlumb.paintStyle;\n _updateHoverStyle(this);\n if (!doNotRepaint) {\n this.repaint();\n }\n },\n getPaintStyle: function () {\n return this._jsPlumb.paintStyle;\n },\n setHoverPaintStyle: function (style, doNotRepaint) {\n //this._jsPlumb.hoverPaintStyle = jsPlumb.extend({}, style);\n // TODO figure out if we want components to clone paintStyle so as not to share it.\n this._jsPlumb.hoverPaintStyle = style;\n _updateHoverStyle(this);\n if (!doNotRepaint) {\n this.repaint();\n }\n },\n getHoverPaintStyle: function () {\n return this._jsPlumb.hoverPaintStyle;\n },\n destroy: function (force) {\n if (force || this.typeId == null) {\n this.cleanupListeners(); // this is on EventGenerator\n this.clone = null;\n this._jsPlumb = null;\n }\n },\n\n isHover: function () {\n return this._jsPlumb.hover;\n },\n\n setHover: function (hover, ignoreAttachedElements, timestamp) {\n // while dragging, we ignore these events. this keeps the UI from flashing and\n // swishing and whatevering.\n if (this._jsPlumb && !this._jsPlumb.instance.currentlyDragging && !this._jsPlumb.instance.isHoverSuspended()) {\n\n this._jsPlumb.hover = hover;\n var method = hover ? \"addClass\" : \"removeClass\";\n\n if (this.canvas != null) {\n if (this._jsPlumb.instance.hoverClass != null) {\n this._jsPlumb.instance[method](this.canvas, this._jsPlumb.instance.hoverClass);\n }\n if (this._jsPlumb.hoverClass != null) {\n this._jsPlumb.instance[method](this.canvas, this._jsPlumb.hoverClass);\n }\n }\n if (this._jsPlumb.hoverPaintStyle != null) {\n this._jsPlumb.paintStyleInUse = hover ? this._jsPlumb.hoverPaintStyle : this._jsPlumb.paintStyle;\n if (!this._jsPlumb.instance.isSuspendDrawing()) {\n timestamp = timestamp || _timestamp();\n this.repaint({timestamp: timestamp, recalc: false});\n }\n }\n // get the list of other affected elements, if supported by this component.\n // for a connection, its the endpoints. for an endpoint, its the connections! surprise.\n if (this.getAttachedElements && !ignoreAttachedElements) {\n _updateAttachedElements(this, hover, _timestamp(), this);\n }\n }\n }\n });\n\n// ------------------------------ END jsPlumbUIComponent --------------------------------------------\n\n var _jsPlumbInstanceIndex = 0,\n getInstanceIndex = function () {\n var i = _jsPlumbInstanceIndex + 1;\n _jsPlumbInstanceIndex++;\n return i;\n };\n\n var jsPlumbInstance = root.jsPlumbInstance = function (_defaults) {\n\n this.version = \"2.9.0\";\n\n this.Defaults = {\n Anchor: \"Bottom\",\n Anchors: [ null, null ],\n ConnectionsDetachable: true,\n ConnectionOverlays: [ ],\n Connector: \"Bezier\",\n Container: null,\n DoNotThrowErrors: false,\n DragOptions: { },\n DropOptions: { },\n Endpoint: \"Dot\",\n EndpointOverlays: [ ],\n Endpoints: [ null, null ],\n EndpointStyle: { fill: \"#456\" },\n EndpointStyles: [ null, null ],\n EndpointHoverStyle: null,\n EndpointHoverStyles: [ null, null ],\n HoverPaintStyle: null,\n LabelStyle: { color: \"black\" },\n LogEnabled: false,\n Overlays: [ ],\n MaxConnections: 1,\n PaintStyle: { \"stroke-width\": 4, stroke: \"#456\" },\n ReattachConnections: false,\n RenderMode: \"svg\",\n Scope: \"jsPlumb_DefaultScope\"\n };\n\n if (_defaults) {\n jsPlumb.extend(this.Defaults, _defaults);\n }\n\n this.logEnabled = this.Defaults.LogEnabled;\n this._connectionTypes = {};\n this._endpointTypes = {};\n\n _ju.EventGenerator.apply(this);\n\n var _currentInstance = this,\n _instanceIndex = getInstanceIndex(),\n _bb = _currentInstance.bind,\n _initialDefaults = {},\n _zoom = 1,\n _info = function (el) {\n if (el == null) {\n return null;\n }\n else if (el.nodeType === 3 || el.nodeType === 8) {\n return { el:el, text:true };\n }\n else {\n var _el = _currentInstance.getElement(el);\n return { el: _el, id: (_ju.isString(el) && _el == null) ? el : _getId(_el) };\n }\n };\n\n this.getInstanceIndex = function () {\n return _instanceIndex;\n };\n\n // CONVERTED\n this.setZoom = function (z, repaintEverything) {\n _zoom = z;\n _currentInstance.fire(\"zoom\", _zoom);\n if (repaintEverything) {\n _currentInstance.repaintEverything();\n }\n return true;\n };\n // CONVERTED\n this.getZoom = function () {\n return _zoom;\n };\n\n for (var i in this.Defaults) {\n _initialDefaults[i] = this.Defaults[i];\n }\n\n var _container, _containerDelegations = [];\n this.unbindContainer = function() {\n if (_container != null && _containerDelegations.length > 0) {\n for (var i = 0; i < _containerDelegations.length; i++) {\n _currentInstance.off(_container, _containerDelegations[i][0], _containerDelegations[i][1]);\n }\n }\n };\n this.setContainer = function (c) {\n\n this.unbindContainer();\n\n // get container as dom element.\n c = this.getElement(c);\n // move existing connections and endpoints, if any.\n this.select().each(function (conn) {\n conn.moveParent(c);\n });\n this.selectEndpoints().each(function (ep) {\n ep.moveParent(c);\n });\n\n // set container.\n var previousContainer = _container;\n _container = c;\n _containerDelegations.length = 0;\n var eventAliases = {\n \"endpointclick\":\"endpointClick\",\n \"endpointdblclick\":\"endpointDblClick\"\n };\n\n var _oneDelegateHandler = function (id, e, componentType) {\n var t = e.srcElement || e.target,\n jp = (t && t.parentNode ? t.parentNode._jsPlumb : null) || (t ? t._jsPlumb : null) || (t && t.parentNode && t.parentNode.parentNode ? t.parentNode.parentNode._jsPlumb : null);\n if (jp) {\n jp.fire(id, jp, e);\n var alias = componentType ? eventAliases[componentType + id] || id : id;\n // jsplumb also fires every event coming from components/overlays. That's what the test for `jp.component` is for.\n _currentInstance.fire(alias, jp.component || jp, e);\n }\n };\n\n var _addOneDelegate = function(eventId, selector, fn) {\n _containerDelegations.push([eventId, fn]);\n _currentInstance.on(_container, eventId, selector, fn);\n };\n\n // delegate one event on the container to jsplumb elements. it might be possible to\n // abstract this out: each of endpoint, connection and overlay could register themselves with\n // jsplumb as \"component types\" or whatever, and provide a suitable selector. this would be\n // done by the renderer (although admittedly from 2.0 onwards we're not supporting vml anymore)\n var _oneDelegate = function (id) {\n // connections.\n _addOneDelegate(id, \".jtk-connector\", function (e) {\n _oneDelegateHandler(id, e);\n });\n // endpoints. note they can have an enclosing div, or not.\n _addOneDelegate(id, \".jtk-endpoint\", function (e) {\n _oneDelegateHandler(id, e, \"endpoint\");\n });\n // overlays\n _addOneDelegate(id, \".jtk-overlay\", function (e) {\n _oneDelegateHandler(id, e);\n });\n };\n\n for (var i = 0; i < events.length; i++) {\n _oneDelegate(events[i]);\n }\n\n // managed elements\n for (var elId in managedElements) {\n var el = managedElements[elId].el;\n if (el.parentNode === previousContainer) {\n previousContainer.removeChild(el);\n _container.appendChild(el);\n }\n }\n\n };\n this.getContainer = function () {\n return _container;\n };\n\n this.bind = function (event, fn) {\n if (\"ready\" === event && initialized) {\n fn();\n }\n else {\n _bb.apply(_currentInstance, [event, fn]);\n }\n };\n\n _currentInstance.importDefaults = function (d) {\n for (var i in d) {\n _currentInstance.Defaults[i] = d[i];\n }\n if (d.Container) {\n _currentInstance.setContainer(d.Container);\n }\n\n return _currentInstance;\n };\n\n _currentInstance.restoreDefaults = function () {\n _currentInstance.Defaults = jsPlumb.extend({}, _initialDefaults);\n return _currentInstance;\n };\n\n var log = null,\n initialized = false,\n // TODO remove from window scope\n connections = [],\n // map of element id -> endpoint lists. an element can have an arbitrary\n // number of endpoints on it, and not all of them have to be connected\n // to anything.\n endpointsByElement = {},\n endpointsByUUID = {},\n managedElements = {},\n offsets = {},\n offsetTimestamps = {},\n draggableStates = {},\n connectionBeingDragged = false,\n sizes = [],\n _suspendDrawing = false,\n _suspendedAt = null,\n DEFAULT_SCOPE = this.Defaults.Scope,\n _curIdStamp = 1,\n _idstamp = function () {\n return \"\" + _curIdStamp++;\n },\n\n //\n // appends an element to some other element, which is calculated as follows:\n //\n // 1. if Container exists, use that element.\n // 2. if the 'parent' parameter exists, use that.\n // 3. otherwise just use the root element.\n //\n //\n _appendElement = function (el, parent) {\n if (_container) {\n _container.appendChild(el);\n }\n else if (!parent) {\n this.appendToRoot(el);\n }\n else {\n this.getElement(parent).appendChild(el);\n }\n }.bind(this),\n\n //\n // Draws an endpoint and its connections. this is the main entry point into drawing connections as well\n // as endpoints, since jsPlumb is endpoint-centric under the hood.\n //\n // @param element element to draw (of type library specific element object)\n // @param ui UI object from current library's event system. optional.\n // @param timestamp timestamp for this paint cycle. used to speed things up a little by cutting down the amount of offset calculations we do.\n // @param clearEdits defaults to false; indicates that mouse edits for connectors should be cleared\n ///\n _draw = function (element, ui, timestamp, clearEdits) {\n\n if (!_suspendDrawing) {\n var id = _getId(element),\n repaintEls,\n dm = _currentInstance.getDragManager();\n\n if (dm) {\n repaintEls = dm.getElementsForDraggable(id);\n }\n\n if (timestamp == null) {\n timestamp = _timestamp();\n }\n\n // update the offset of everything _before_ we try to draw anything.\n var o = _updateOffset({ elId: id, offset: ui, recalc: false, timestamp: timestamp });\n\n if (repaintEls && o && o.o) {\n for (var i in repaintEls) {\n _updateOffset({\n elId: repaintEls[i].id,\n offset: {\n left: o.o.left + repaintEls[i].offset.left,\n top: o.o.top + repaintEls[i].offset.top\n },\n recalc: false,\n timestamp: timestamp\n });\n }\n }\n\n _currentInstance.anchorManager.redraw(id, ui, timestamp, null, clearEdits);\n\n if (repaintEls) {\n for (var j in repaintEls) {\n _currentInstance.anchorManager.redraw(repaintEls[j].id, ui, timestamp, repaintEls[j].offset, clearEdits, true);\n }\n }\n }\n },\n\n //\n // gets an Endpoint by uuid.\n //\n _getEndpoint = function (uuid) {\n return endpointsByUUID[uuid];\n },\n\n /**\n * inits a draggable if it's not already initialised.\n * TODO: somehow abstract this to the adapter, because the concept of \"draggable\" has no\n * place on the server.\n */\n\n\n _scopeMatch = function (e1, e2) {\n var s1 = e1.scope.split(/\\s/), s2 = e2.scope.split(/\\s/);\n for (var i = 0; i < s1.length; i++) {\n for (var j = 0; j < s2.length; j++) {\n if (s2[j] === s1[i]) {\n return true;\n }\n }\n }\n\n return false;\n },\n\n _mergeOverrides = function (def, values) {\n var m = jsPlumb.extend({}, def);\n for (var i in values) {\n if (values[i]) {\n m[i] = values[i];\n }\n }\n return m;\n },\n\n /*\n * prepares a final params object that can be passed to _newConnection, taking into account defaults, events, etc.\n */\n _prepareConnectionParams = function (params, referenceParams) {\n var _p = jsPlumb.extend({ }, params);\n if (referenceParams) {\n jsPlumb.extend(_p, referenceParams);\n }\n\n // hotwire endpoints passed as source or target to sourceEndpoint/targetEndpoint, respectively.\n if (_p.source) {\n if (_p.source.endpoint) {\n _p.sourceEndpoint = _p.source;\n }\n else {\n _p.source = _currentInstance.getElement(_p.source);\n }\n }\n if (_p.target) {\n if (_p.target.endpoint) {\n _p.targetEndpoint = _p.target;\n }\n else {\n _p.target = _currentInstance.getElement(_p.target);\n }\n }\n\n // test for endpoint uuids to connect\n if (params.uuids) {\n _p.sourceEndpoint = _getEndpoint(params.uuids[0]);\n _p.targetEndpoint = _getEndpoint(params.uuids[1]);\n }\n\n // now ensure that if we do have Endpoints already, they're not full.\n // source:\n if (_p.sourceEndpoint && _p.sourceEndpoint.isFull()) {\n _ju.log(_currentInstance, \"could not add connection; source endpoint is full\");\n return;\n }\n\n // target:\n if (_p.targetEndpoint && _p.targetEndpoint.isFull()) {\n _ju.log(_currentInstance, \"could not add connection; target endpoint is full\");\n return;\n }\n\n // if source endpoint mandates connection type and nothing specified in our params, use it.\n if (!_p.type && _p.sourceEndpoint) {\n _p.type = _p.sourceEndpoint.connectionType;\n }\n\n // copy in any connectorOverlays that were specified on the source endpoint.\n // it doesnt copy target endpoint overlays. i'm not sure if we want it to or not.\n if (_p.sourceEndpoint && _p.sourceEndpoint.connectorOverlays) {\n _p.overlays = _p.overlays || [];\n for (var i = 0, j = _p.sourceEndpoint.connectorOverlays.length; i < j; i++) {\n _p.overlays.push(_p.sourceEndpoint.connectorOverlays[i]);\n }\n }\n\n // scope\n if (_p.sourceEndpoint && _p.sourceEndpoint.scope) {\n _p.scope = _p.sourceEndpoint.scope;\n }\n\n // pointer events\n if (!_p[\"pointer-events\"] && _p.sourceEndpoint && _p.sourceEndpoint.connectorPointerEvents) {\n _p[\"pointer-events\"] = _p.sourceEndpoint.connectorPointerEvents;\n }\n\n\n var _addEndpoint = function (el, def, idx) {\n return _currentInstance.addEndpoint(el, _mergeOverrides(def, {\n anchor: _p.anchors ? _p.anchors[idx] : _p.anchor,\n endpoint: _p.endpoints ? _p.endpoints[idx] : _p.endpoint,\n paintStyle: _p.endpointStyles ? _p.endpointStyles[idx] : _p.endpointStyle,\n hoverPaintStyle: _p.endpointHoverStyles ? _p.endpointHoverStyles[idx] : _p.endpointHoverStyle\n }));\n };\n\n // check for makeSource/makeTarget specs.\n\n var _oneElementDef = function (type, idx, defs, matchType) {\n if (_p[type] && !_p[type].endpoint && !_p[type + \"Endpoint\"] && !_p.newConnection) {\n var tid = _getId(_p[type]), tep = defs[tid];\n\n tep = tep ? tep[matchType] : null;\n\n if (tep) {\n // if not enabled, return.\n if (!tep.enabled) {\n return false;\n }\n var newEndpoint = tep.endpoint != null && tep.endpoint._jsPlumb ? tep.endpoint : _addEndpoint(_p[type], tep.def, idx);\n if (newEndpoint.isFull()) {\n return false;\n }\n _p[type + \"Endpoint\"] = newEndpoint;\n if (!_p.scope && tep.def.scope) {\n _p.scope = tep.def.scope;\n } // provide scope if not already provided and endpoint def has one.\n if (tep.uniqueEndpoint) {\n if (!tep.endpoint) {\n tep.endpoint = newEndpoint;\n newEndpoint.setDeleteOnEmpty(false);\n }\n else {\n newEndpoint.finalEndpoint = tep.endpoint;\n }\n } else {\n newEndpoint.setDeleteOnEmpty(true);\n }\n\n //\n // copy in connector overlays if present on the source definition.\n //\n if (idx === 0 && tep.def.connectorOverlays) {\n _p.overlays = _p.overlays || [];\n Array.prototype.push.apply(_p.overlays, tep.def.connectorOverlays);\n }\n }\n }\n };\n\n if (_oneElementDef(\"source\", 0, this.sourceEndpointDefinitions, _p.type || \"default\") === false) {\n return;\n }\n if (_oneElementDef(\"target\", 1, this.targetEndpointDefinitions, _p.type || \"default\") === false) {\n return;\n }\n\n // last, ensure scopes match\n if (_p.sourceEndpoint && _p.targetEndpoint) {\n if (!_scopeMatch(_p.sourceEndpoint, _p.targetEndpoint)) {\n _p = null;\n }\n }\n\n return _p;\n }.bind(_currentInstance),\n\n _newConnection = function (params) {\n var connectionFunc = _currentInstance.Defaults.ConnectionType || _currentInstance.getDefaultConnectionType();\n\n params._jsPlumb = _currentInstance;\n params.newConnection = _newConnection;\n params.newEndpoint = _newEndpoint;\n params.endpointsByUUID = endpointsByUUID;\n params.endpointsByElement = endpointsByElement;\n params.finaliseConnection = _finaliseConnection;\n params.id = \"con_\" + _idstamp();\n var con = new connectionFunc(params);\n\n // if the connection is draggable, then maybe we need to tell the target endpoint to init the\n // dragging code. it won't run again if it already configured to be draggable.\n if (con.isDetachable()) {\n con.endpoints[0].initDraggable(\"_jsPlumbSource\");\n con.endpoints[1].initDraggable(\"_jsPlumbTarget\");\n }\n\n return con;\n },\n\n //\n // adds the connection to the backing model, fires an event if necessary and then redraws\n //\n _finaliseConnection = _currentInstance.finaliseConnection = function (jpc, params, originalEvent, doInformAnchorManager) {\n params = params || {};\n // add to list of connections (by scope).\n if (!jpc.suspendedEndpoint) {\n connections.push(jpc);\n }\n\n jpc.pending = null;\n\n // turn off isTemporarySource on the source endpoint (only viable on first draw)\n jpc.endpoints[0].isTemporarySource = false;\n\n // always inform the anchor manager\n // except that if jpc has a suspended endpoint it's not true to say the\n // connection is new; it has just (possibly) moved. the question is whether\n // to make that call here or in the anchor manager. i think perhaps here.\n if (doInformAnchorManager !== false) {\n _currentInstance.anchorManager.newConnection(jpc);\n }\n\n // force a paint\n _draw(jpc.source);\n\n // fire an event\n if (!params.doNotFireConnectionEvent && params.fireEvent !== false) {\n\n var eventArgs = {\n connection: jpc,\n source: jpc.source, target: jpc.target,\n sourceId: jpc.sourceId, targetId: jpc.targetId,\n sourceEndpoint: jpc.endpoints[0], targetEndpoint: jpc.endpoints[1]\n };\n\n _currentInstance.fire(\"connection\", eventArgs, originalEvent);\n }\n },\n\n /*\n factory method to prepare a new endpoint. this should always be used instead of creating Endpoints\n manually, since this method attaches event listeners and an id.\n */\n _newEndpoint = function (params, id) {\n var endpointFunc = _currentInstance.Defaults.EndpointType || jsPlumb.Endpoint;\n var _p = jsPlumb.extend({}, params);\n _p._jsPlumb = _currentInstance;\n _p.newConnection = _newConnection;\n _p.newEndpoint = _newEndpoint;\n _p.endpointsByUUID = endpointsByUUID;\n _p.endpointsByElement = endpointsByElement;\n _p.fireDetachEvent = fireDetachEvent;\n _p.elementId = id || _getId(_p.source);\n var ep = new endpointFunc(_p);\n ep.id = \"ep_\" + _idstamp();\n _manage(_p.elementId, _p.source);\n\n if (!jsPlumb.headless) {\n _currentInstance.getDragManager().endpointAdded(_p.source, id);\n }\n\n return ep;\n },\n\n /*\n * performs the given function operation on all the connections found\n * for the given element id; this means we find all the endpoints for\n * the given element, and then for each endpoint find the connectors\n * connected to it. then we pass each connection in to the given\n * function.\n */\n _operation = function (elId, func, endpointFunc) {\n var endpoints = endpointsByElement[elId];\n if (endpoints && endpoints.length) {\n for (var i = 0, ii = endpoints.length; i < ii; i++) {\n for (var j = 0, jj = endpoints[i].connections.length; j < jj; j++) {\n var retVal = func(endpoints[i].connections[j]);\n // if the function passed in returns true, we exit.\n // most functions return false.\n if (retVal) {\n return;\n }\n }\n if (endpointFunc) {\n endpointFunc(endpoints[i]);\n }\n }\n }\n },\n\n _setDraggable = function (element, draggable) {\n return jsPlumb.each(element, function (el) {\n if (_currentInstance.isDragSupported(el)) {\n draggableStates[_currentInstance.getAttribute(el, \"id\")] = draggable;\n _currentInstance.setElementDraggable(el, draggable);\n }\n });\n },\n /*\n * private method to do the business of hiding/showing.\n *\n * @param el\n * either Id of the element in question or a library specific\n * object for the element.\n * @param state\n * String specifying a value for the css 'display' property\n * ('block' or 'none').\n */\n _setVisible = function (el, state, alsoChangeEndpoints) {\n state = state === \"block\";\n var endpointFunc = null;\n if (alsoChangeEndpoints) {\n endpointFunc = function (ep) {\n ep.setVisible(state, true, true);\n };\n }\n var info = _info(el);\n _operation(info.id, function (jpc) {\n if (state && alsoChangeEndpoints) {\n // this test is necessary because this functionality is new, and i wanted to maintain backwards compatibility.\n // this block will only set a connection to be visible if the other endpoint in the connection is also visible.\n var oidx = jpc.sourceId === info.id ? 1 : 0;\n if (jpc.endpoints[oidx].isVisible()) {\n jpc.setVisible(true);\n }\n }\n else { // the default behaviour for show, and what always happens for hide, is to just set the visibility without getting clever.\n jpc.setVisible(state);\n }\n }, endpointFunc);\n },\n /**\n * private method to do the business of toggling hiding/showing.\n */\n _toggleVisible = function (elId, changeEndpoints) {\n var endpointFunc = null;\n if (changeEndpoints) {\n endpointFunc = function (ep) {\n var state = ep.isVisible();\n ep.setVisible(!state);\n };\n }\n _operation(elId, function (jpc) {\n var state = jpc.isVisible();\n jpc.setVisible(!state);\n }, endpointFunc);\n },\n\n // TODO comparison performance\n _getCachedData = function (elId) {\n var o = offsets[elId];\n if (!o) {\n return _updateOffset({elId: elId});\n }\n else {\n return {o: o, s: sizes[elId]};\n }\n },\n\n /**\n * gets an id for the given element, creating and setting one if\n * necessary. the id is of the form\n *\n * jsPlumb__\n *\n * where \"index in instance\" is a monotonically increasing integer that starts at 0,\n * for each instance. this method is used not only to assign ids to elements that do not\n * have them but also to connections and endpoints.\n */\n _getId = function (element, uuid, doNotCreateIfNotFound) {\n if (_ju.isString(element)) {\n return element;\n }\n if (element == null) {\n return null;\n }\n var id = _currentInstance.getAttribute(element, \"id\");\n if (!id || id === \"undefined\") {\n // check if fixed uuid parameter is given\n if (arguments.length === 2 && arguments[1] !== undefined) {\n id = uuid;\n }\n else if (arguments.length === 1 || (arguments.length === 3 && !arguments[2])) {\n id = \"jsPlumb_\" + _instanceIndex + \"_\" + _idstamp();\n }\n\n if (!doNotCreateIfNotFound) {\n _currentInstance.setAttribute(element, \"id\", id);\n }\n }\n return id;\n };\n\n this.setConnectionBeingDragged = function (v) {\n connectionBeingDragged = v;\n };\n this.isConnectionBeingDragged = function () {\n return connectionBeingDragged;\n };\n\n /**\n * Returns a map of all the elements this jsPlumbInstance is currently managing.\n * @returns {Object} Map of [id-> {el, endpoint[], connection, position}] information.\n */\n this.getManagedElements = function() {\n return managedElements;\n };\n\n this.connectorClass = \"jtk-connector\";\n this.connectorOutlineClass = \"jtk-connector-outline\";\n this.connectedClass = \"jtk-connected\";\n this.hoverClass = \"jtk-hover\";\n this.endpointClass = \"jtk-endpoint\";\n this.endpointConnectedClass = \"jtk-endpoint-connected\";\n this.endpointFullClass = \"jtk-endpoint-full\";\n this.endpointDropAllowedClass = \"jtk-endpoint-drop-allowed\";\n this.endpointDropForbiddenClass = \"jtk-endpoint-drop-forbidden\";\n this.overlayClass = \"jtk-overlay\";\n this.draggingClass = \"jtk-dragging\";// CONVERTED\n this.elementDraggingClass = \"jtk-element-dragging\";// CONVERTED\n this.sourceElementDraggingClass = \"jtk-source-element-dragging\"; // CONVERTED\n this.targetElementDraggingClass = \"jtk-target-element-dragging\";// CONVERTED\n this.endpointAnchorClassPrefix = \"jtk-endpoint-anchor\";\n this.hoverSourceClass = \"jtk-source-hover\";\n this.hoverTargetClass = \"jtk-target-hover\";\n this.dragSelectClass = \"jtk-drag-select\";\n\n this.Anchors = {};\n this.Connectors = { \"svg\": {} };\n this.Endpoints = { \"svg\": {} };\n this.Overlays = { \"svg\": {} } ;\n this.ConnectorRenderers = {};\n this.SVG = \"svg\";\n\n// --------------------------- jsPlumbInstance public API ---------------------------------------------------------\n\n\n this.addEndpoint = function (el, params, referenceParams) {\n referenceParams = referenceParams || {};\n var p = jsPlumb.extend({}, referenceParams);\n jsPlumb.extend(p, params);\n p.endpoint = p.endpoint || _currentInstance.Defaults.Endpoint;\n p.paintStyle = p.paintStyle || _currentInstance.Defaults.EndpointStyle;\n\n var results = [],\n inputs = (_ju.isArray(el) || (el.length != null && !_ju.isString(el))) ? el : [ el ];\n\n for (var i = 0, j = inputs.length; i < j; i++) {\n p.source = _currentInstance.getElement(inputs[i]);\n _ensureContainer(p.source);\n\n var id = _getId(p.source), e = _newEndpoint(p, id);\n\n // ensure element is managed.\n var myOffset = _manage(id, p.source).info.o;\n _ju.addToList(endpointsByElement, id, e);\n\n if (!_suspendDrawing) {\n e.paint({\n anchorLoc: e.anchor.compute({ xy: [ myOffset.left, myOffset.top ], wh: sizes[id], element: e, timestamp: _suspendedAt }),\n timestamp: _suspendedAt\n });\n }\n\n results.push(e);\n }\n\n return results.length === 1 ? results[0] : results;\n };\n\n this.addEndpoints = function (el, endpoints, referenceParams) {\n var results = [];\n for (var i = 0, j = endpoints.length; i < j; i++) {\n var e = _currentInstance.addEndpoint(el, endpoints[i], referenceParams);\n if (_ju.isArray(e)) {\n Array.prototype.push.apply(results, e);\n }\n else {\n results.push(e);\n }\n }\n return results;\n };\n\n this.animate = function (el, properties, options) {\n if (!this.animationSupported) {\n return false;\n }\n\n options = options || {};\n var del = _currentInstance.getElement(el),\n id = _getId(del),\n stepFunction = jsPlumb.animEvents.step,\n completeFunction = jsPlumb.animEvents.complete;\n\n options[stepFunction] = _ju.wrap(options[stepFunction], function () {\n _currentInstance.revalidate(id);\n });\n\n // onComplete repaints, just to make sure everything looks good at the end of the animation.\n options[completeFunction] = _ju.wrap(options[completeFunction], function () {\n _currentInstance.revalidate(id);\n });\n\n _currentInstance.doAnimate(del, properties, options);\n };\n\n /**\n * checks for a listener for the given condition, executing it if found, passing in the given value.\n * condition listeners would have been attached using \"bind\" (which is, you could argue, now overloaded, since\n * firing click events etc is a bit different to what this does). i thought about adding a \"bindCondition\"\n * or something, but decided against it, for the sake of simplicity. jsPlumb will never fire one of these\n * condition events anyway.\n */\n this.checkCondition = function (conditionName, args) {\n var l = _currentInstance.getListener(conditionName),\n r = true;\n\n if (l && l.length > 0) {\n var values = Array.prototype.slice.call(arguments, 1);\n try {\n for (var i = 0, j = l.length; i < j; i++) {\n r = r && l[i].apply(l[i], values);\n }\n }\n catch (e) {\n _ju.log(_currentInstance, \"cannot check condition [\" + conditionName + \"]\" + e);\n }\n }\n return r;\n };\n\n this.connect = function (params, referenceParams) {\n // prepare a final set of parameters to create connection with\n var _p = _prepareConnectionParams(params, referenceParams), jpc;\n // TODO probably a nicer return value if the connection was not made. _prepareConnectionParams\n // will return null (and log something) if either endpoint was full. what would be nicer is to\n // create a dedicated 'error' object.\n if (_p) {\n if (_p.source == null && _p.sourceEndpoint == null) {\n _ju.log(\"Cannot establish connection - source does not exist\");\n return;\n }\n if (_p.target == null && _p.targetEndpoint == null) {\n _ju.log(\"Cannot establish connection - target does not exist\");\n return;\n }\n _ensureContainer(_p.source);\n // create the connection. it is not yet registered\n jpc = _newConnection(_p);\n // now add it the model, fire an event, and redraw\n _finaliseConnection(jpc, _p);\n }\n return jpc;\n };\n\n var stTypes = [\n { el: \"source\", elId: \"sourceId\", epDefs: \"sourceEndpointDefinitions\" },\n { el: \"target\", elId: \"targetId\", epDefs: \"targetEndpointDefinitions\" }\n ];\n\n var _set = function (c, el, idx, doNotRepaint) {\n var ep, _st = stTypes[idx], cId = c[_st.elId], cEl = c[_st.el], sid, sep,\n oldEndpoint = c.endpoints[idx];\n\n var evtParams = {\n index: idx,\n originalSourceId: idx === 0 ? cId : c.sourceId,\n newSourceId: c.sourceId,\n originalTargetId: idx === 1 ? cId : c.targetId,\n newTargetId: c.targetId,\n connection: c\n };\n\n if (el.constructor === jsPlumb.Endpoint) {\n ep = el;\n ep.addConnection(c);\n el = ep.element;\n }\n else {\n sid = _getId(el);\n sep = this[_st.epDefs][sid];\n\n if (sid === c[_st.elId]) {\n ep = null; // dont change source/target if the element is already the one given.\n }\n else if (sep) {\n for (var t in sep) {\n if (!sep[t].enabled) {\n return;\n }\n ep = sep[t].endpoint != null && sep[t].endpoint._jsPlumb ? sep[t].endpoint : this.addEndpoint(el, sep[t].def);\n if (sep[t].uniqueEndpoint) {\n sep[t].endpoint = ep;\n }\n ep.addConnection(c);\n }\n }\n else {\n ep = c.makeEndpoint(idx === 0, el, sid);\n }\n }\n\n if (ep != null) {\n oldEndpoint.detachFromConnection(c);\n c.endpoints[idx] = ep;\n c[_st.el] = ep.element;\n c[_st.elId] = ep.elementId;\n evtParams[idx === 0 ? \"newSourceId\" : \"newTargetId\"] = ep.elementId;\n\n fireMoveEvent(evtParams);\n\n if (!doNotRepaint) {\n c.repaint();\n }\n }\n\n evtParams.element = el;\n return evtParams;\n\n }.bind(this);\n\n this.setSource = function (connection, el, doNotRepaint) {\n var p = _set(connection, el, 0, doNotRepaint);\n this.anchorManager.sourceChanged(p.originalSourceId, p.newSourceId, connection, p.el);\n };\n this.setTarget = function (connection, el, doNotRepaint) {\n var p = _set(connection, el, 1, doNotRepaint);\n this.anchorManager.updateOtherEndpoint(p.originalSourceId, p.originalTargetId, p.newTargetId, connection);\n };\n\n this.deleteEndpoint = function (object, dontUpdateHover, deleteAttachedObjects) {\n var endpoint = (typeof object === \"string\") ? endpointsByUUID[object] : object;\n if (endpoint) {\n _currentInstance.deleteObject({ endpoint: endpoint, dontUpdateHover: dontUpdateHover, deleteAttachedObjects:deleteAttachedObjects });\n }\n return _currentInstance;\n };\n\n this.deleteEveryEndpoint = function () {\n var _is = _currentInstance.setSuspendDrawing(true);\n for (var id in endpointsByElement) {\n var endpoints = endpointsByElement[id];\n if (endpoints && endpoints.length) {\n for (var i = 0, j = endpoints.length; i < j; i++) {\n _currentInstance.deleteEndpoint(endpoints[i], true);\n }\n }\n }\n endpointsByElement = {};\n managedElements = {};\n endpointsByUUID = {};\n offsets = {};\n offsetTimestamps = {};\n _currentInstance.anchorManager.reset();\n var dm = _currentInstance.getDragManager();\n if (dm) {\n dm.reset();\n }\n if (!_is) {\n _currentInstance.setSuspendDrawing(false);\n }\n return _currentInstance;\n };\n\n var fireDetachEvent = function (jpc, doFireEvent, originalEvent) {\n // may have been given a connection, or in special cases, an object\n var connType = _currentInstance.Defaults.ConnectionType || _currentInstance.getDefaultConnectionType(),\n argIsConnection = jpc.constructor === connType,\n params = argIsConnection ? {\n connection: jpc,\n source: jpc.source, target: jpc.target,\n sourceId: jpc.sourceId, targetId: jpc.targetId,\n sourceEndpoint: jpc.endpoints[0], targetEndpoint: jpc.endpoints[1]\n } : jpc;\n\n if (doFireEvent) {\n _currentInstance.fire(\"connectionDetached\", params, originalEvent);\n }\n\n // always fire this. used by internal jsplumb stuff.\n _currentInstance.fire(\"internal.connectionDetached\", params, originalEvent);\n\n _currentInstance.anchorManager.connectionDetached(params);\n };\n\n var fireMoveEvent = _currentInstance.fireMoveEvent = function (params, evt) {\n _currentInstance.fire(\"connectionMoved\", params, evt);\n };\n\n this.unregisterEndpoint = function (endpoint) {\n if (endpoint._jsPlumb.uuid) {\n endpointsByUUID[endpoint._jsPlumb.uuid] = null;\n }\n _currentInstance.anchorManager.deleteEndpoint(endpoint);\n // TODO at least replace this with a removeWithFunction call.\n for (var e in endpointsByElement) {\n var endpoints = endpointsByElement[e];\n if (endpoints) {\n var newEndpoints = [];\n for (var i = 0, j = endpoints.length; i < j; i++) {\n if (endpoints[i] !== endpoint) {\n newEndpoints.push(endpoints[i]);\n }\n }\n\n endpointsByElement[e] = newEndpoints;\n }\n if (endpointsByElement[e].length < 1) {\n delete endpointsByElement[e];\n }\n }\n };\n\n var IS_DETACH_ALLOWED = \"isDetachAllowed\";\n var BEFORE_DETACH = \"beforeDetach\";\n var CHECK_CONDITION = \"checkCondition\";\n\n /**\n * Deletes a Connection.\n * @method deleteConnection\n * @param connection Connection to delete\n * @param {Object} [params] Optional delete parameters\n * @param {Boolean} [params.doNotFireEvent=false] If true, a connection detached event will not be fired. Otherwise one will.\n * @param {Boolean} [params.force=false] If true, the connection will be deleted even if a beforeDetach interceptor tries to stop the deletion.\n * @returns {Boolean} True if the connection was deleted, false otherwise.\n */\n this.deleteConnection = function(connection, params) {\n\n if (connection != null) {\n params = params || {};\n\n if (params.force || _ju.functionChain(true, false, [\n [ connection.endpoints[0], IS_DETACH_ALLOWED, [ connection ] ],\n [ connection.endpoints[1], IS_DETACH_ALLOWED, [ connection ] ],\n [ connection, IS_DETACH_ALLOWED, [ connection ] ],\n [ _currentInstance, CHECK_CONDITION, [ BEFORE_DETACH, connection ] ]\n ])) {\n\n connection.setHover(false);\n fireDetachEvent(connection, !connection.pending && params.fireEvent !== false, params.originalEvent);\n\n connection.endpoints[0].detachFromConnection(connection);\n connection.endpoints[1].detachFromConnection(connection);\n _ju.removeWithFunction(connections, function (_c) {\n return connection.id === _c.id;\n });\n\n connection.cleanup();\n connection.destroy();\n return true;\n }\n }\n return false;\n };\n\n /**\n * Remove all Connections from all elements, but leaves Endpoints in place ((unless a connection is set to auto delete its Endpoints).\n * @method deleteEveryConnection\n * @param {Object} [params] optional params object for the call\n * @param {Boolean} [params.fireEvent=true] Whether or not to fire detach events\n * @param {Boolean} [params.forceDetach=false] If true, this call will ignore any `beforeDetach` interceptors.\n * @returns {Number} The number of connections that were deleted.\n */\n this.deleteEveryConnection = function (params) {\n params = params || {};\n var count = connections.length, deletedCount = 0;\n _currentInstance.batch(function () {\n for (var i = 0; i < count; i++) {\n deletedCount += _currentInstance.deleteConnection(connections[0], params) ? 1 : 0;\n }\n });\n return deletedCount;\n };\n\n /**\n * Removes all an element's Connections.\n * @method deleteConnectionsForElement\n * @param {Object} el Either the id of the element, or a selector for the element.\n * @param {Object} [params] Optional parameters.\n * @param {Boolean} [params.fireEvent=true] Whether or not to fire the detach event.\n * @param {Boolean} [params.forceDetach=false] If true, this call will ignore any `beforeDetach` interceptors.\n * @return {jsPlumbInstance} The current jsPlumb instance.\n */\n this.deleteConnectionsForElement = function (el, params) {\n params = params || {};\n el = _currentInstance.getElement(el);\n var id = _getId(el), endpoints = endpointsByElement[id];\n if (endpoints && endpoints.length) {\n for (var i = 0, j = endpoints.length; i < j; i++) {\n endpoints[i].deleteEveryConnection(params);\n }\n }\n return _currentInstance;\n };\n\n /// not public. but of course its exposed. how to change this.\n this.deleteObject = function (params) {\n var result = {\n endpoints: {},\n connections: {},\n endpointCount: 0,\n connectionCount: 0\n },\n deleteAttachedObjects = params.deleteAttachedObjects !== false;\n\n var unravelConnection = function (connection) {\n if (connection != null && result.connections[connection.id] == null) {\n if (!params.dontUpdateHover && connection._jsPlumb != null) {\n connection.setHover(false);\n }\n result.connections[connection.id] = connection;\n result.connectionCount++;\n }\n };\n var unravelEndpoint = function (endpoint) {\n if (endpoint != null && result.endpoints[endpoint.id] == null) {\n if (!params.dontUpdateHover && endpoint._jsPlumb != null) {\n endpoint.setHover(false);\n }\n result.endpoints[endpoint.id] = endpoint;\n result.endpointCount++;\n\n if (deleteAttachedObjects) {\n for (var i = 0; i < endpoint.connections.length; i++) {\n var c = endpoint.connections[i];\n unravelConnection(c);\n }\n }\n }\n };\n\n if (params.connection) {\n unravelConnection(params.connection);\n }\n else {\n unravelEndpoint(params.endpoint);\n }\n\n // loop through connections\n for (var i in result.connections) {\n var c = result.connections[i];\n if (c._jsPlumb) {\n _ju.removeWithFunction(connections, function (_c) {\n return c.id === _c.id;\n });\n\n fireDetachEvent(c, params.fireEvent === false ? false : !c.pending, params.originalEvent);\n var doNotCleanup = params.deleteAttachedObjects == null ? null : !params.deleteAttachedObjects;\n\n c.endpoints[0].detachFromConnection(c, null, doNotCleanup);\n c.endpoints[1].detachFromConnection(c, null, doNotCleanup);\n\n c.cleanup(true);\n c.destroy(true);\n }\n }\n\n // loop through endpoints\n for (var j in result.endpoints) {\n var e = result.endpoints[j];\n if (e._jsPlumb) {\n _currentInstance.unregisterEndpoint(e);\n // FIRE some endpoint deleted event?\n e.cleanup(true);\n e.destroy(true);\n }\n }\n\n return result;\n };\n\n\n // helpers for select/selectEndpoints\n var _setOperation = function (list, func, args, selector) {\n for (var i = 0, j = list.length; i < j; i++) {\n list[i][func].apply(list[i], args);\n }\n return selector(list);\n },\n _getOperation = function (list, func, args) {\n var out = [];\n for (var i = 0, j = list.length; i < j; i++) {\n out.push([ list[i][func].apply(list[i], args), list[i] ]);\n }\n return out;\n },\n setter = function (list, func, selector) {\n return function () {\n return _setOperation(list, func, arguments, selector);\n };\n },\n getter = function (list, func) {\n return function () {\n return _getOperation(list, func, arguments);\n };\n },\n prepareList = function (input, doNotGetIds) {\n var r = [];\n if (input) {\n if (typeof input === 'string') {\n if (input === \"*\") {\n return input;\n }\n r.push(input);\n }\n else {\n if (doNotGetIds) {\n r = input;\n }\n else {\n if (input.length) {\n for (var i = 0, j = input.length; i < j; i++) {\n r.push(_info(input[i]).id);\n }\n }\n else {\n r.push(_info(input).id);\n }\n }\n }\n }\n return r;\n },\n filterList = function (list, value, missingIsFalse) {\n if (list === \"*\") {\n return true;\n }\n return list.length > 0 ? list.indexOf(value) !== -1 : !missingIsFalse;\n };\n\n // get some connections, specifying source/target/scope\n this.getConnections = function (options, flat) {\n if (!options) {\n options = {};\n } else if (options.constructor === String) {\n options = { \"scope\": options };\n }\n var scope = options.scope || _currentInstance.getDefaultScope(),\n scopes = prepareList(scope, true),\n sources = prepareList(options.source),\n targets = prepareList(options.target),\n results = (!flat && scopes.length > 1) ? {} : [],\n _addOne = function (scope, obj) {\n if (!flat && scopes.length > 1) {\n var ss = results[scope];\n if (ss == null) {\n ss = results[scope] = [];\n }\n ss.push(obj);\n } else {\n results.push(obj);\n }\n };\n\n for (var j = 0, jj = connections.length; j < jj; j++) {\n var c = connections[j],\n sourceId = c.proxies && c.proxies[0] ? c.proxies[0].originalEp.elementId : c.sourceId,\n targetId = c.proxies && c.proxies[1] ? c.proxies[1].originalEp.elementId : c.targetId;\n\n if (filterList(scopes, c.scope) && filterList(sources, sourceId) && filterList(targets, targetId)) {\n _addOne(c.scope, c);\n }\n }\n\n return results;\n };\n\n var _curryEach = function (list, executor) {\n return function (f) {\n for (var i = 0, ii = list.length; i < ii; i++) {\n f(list[i]);\n }\n return executor(list);\n };\n },\n _curryGet = function (list) {\n return function (idx) {\n return list[idx];\n };\n };\n\n var _makeCommonSelectHandler = function (list, executor) {\n var out = {\n length: list.length,\n each: _curryEach(list, executor),\n get: _curryGet(list)\n },\n setters = [\"setHover\", \"removeAllOverlays\", \"setLabel\", \"addClass\", \"addOverlay\", \"removeOverlay\",\n \"removeOverlays\", \"showOverlay\", \"hideOverlay\", \"showOverlays\", \"hideOverlays\", \"setPaintStyle\",\n \"setHoverPaintStyle\", \"setSuspendEvents\", \"setParameter\", \"setParameters\", \"setVisible\",\n \"repaint\", \"addType\", \"toggleType\", \"removeType\", \"removeClass\", \"setType\", \"bind\", \"unbind\" ],\n\n getters = [\"getLabel\", \"getOverlay\", \"isHover\", \"getParameter\", \"getParameters\", \"getPaintStyle\",\n \"getHoverPaintStyle\", \"isVisible\", \"hasType\", \"getType\", \"isSuspendEvents\" ],\n i, ii;\n\n for (i = 0, ii = setters.length; i < ii; i++) {\n out[setters[i]] = setter(list, setters[i], executor);\n }\n\n for (i = 0, ii = getters.length; i < ii; i++) {\n out[getters[i]] = getter(list, getters[i]);\n }\n\n return out;\n };\n\n var _makeConnectionSelectHandler = function (list) {\n var common = _makeCommonSelectHandler(list, _makeConnectionSelectHandler);\n return jsPlumb.extend(common, {\n // setters\n setDetachable: setter(list, \"setDetachable\", _makeConnectionSelectHandler),\n setReattach: setter(list, \"setReattach\", _makeConnectionSelectHandler),\n setConnector: setter(list, \"setConnector\", _makeConnectionSelectHandler),\n delete: function () {\n for (var i = 0, ii = list.length; i < ii; i++) {\n _currentInstance.deleteConnection(list[i]);\n }\n },\n // getters\n isDetachable: getter(list, \"isDetachable\"),\n isReattach: getter(list, \"isReattach\")\n });\n };\n\n var _makeEndpointSelectHandler = function (list) {\n var common = _makeCommonSelectHandler(list, _makeEndpointSelectHandler);\n return jsPlumb.extend(common, {\n setEnabled: setter(list, \"setEnabled\", _makeEndpointSelectHandler),\n setAnchor: setter(list, \"setAnchor\", _makeEndpointSelectHandler),\n isEnabled: getter(list, \"isEnabled\"),\n deleteEveryConnection: function () {\n for (var i = 0, ii = list.length; i < ii; i++) {\n list[i].deleteEveryConnection();\n }\n },\n \"delete\": function () {\n for (var i = 0, ii = list.length; i < ii; i++) {\n _currentInstance.deleteEndpoint(list[i]);\n }\n }\n });\n };\n\n this.select = function (params) {\n params = params || {};\n params.scope = params.scope || \"*\";\n return _makeConnectionSelectHandler(params.connections || _currentInstance.getConnections(params, true));\n };\n\n this.selectEndpoints = function (params) {\n params = params || {};\n params.scope = params.scope || \"*\";\n var noElementFilters = !params.element && !params.source && !params.target,\n elements = noElementFilters ? \"*\" : prepareList(params.element),\n sources = noElementFilters ? \"*\" : prepareList(params.source),\n targets = noElementFilters ? \"*\" : prepareList(params.target),\n scopes = prepareList(params.scope, true);\n\n var ep = [];\n\n for (var el in endpointsByElement) {\n var either = filterList(elements, el, true),\n source = filterList(sources, el, true),\n sourceMatchExact = sources !== \"*\",\n target = filterList(targets, el, true),\n targetMatchExact = targets !== \"*\";\n\n // if they requested 'either' then just match scope. otherwise if they requested 'source' (not as a wildcard) then we have to match only endpoints that have isSource set to to true, and the same thing with isTarget.\n if (either || source || target) {\n inner:\n for (var i = 0, ii = endpointsByElement[el].length; i < ii; i++) {\n var _ep = endpointsByElement[el][i];\n if (filterList(scopes, _ep.scope, true)) {\n\n var noMatchSource = (sourceMatchExact && sources.length > 0 && !_ep.isSource),\n noMatchTarget = (targetMatchExact && targets.length > 0 && !_ep.isTarget);\n\n if (noMatchSource || noMatchTarget) {\n continue inner;\n }\n\n ep.push(_ep);\n }\n }\n }\n }\n\n return _makeEndpointSelectHandler(ep);\n };\n\n // get all connections managed by the instance of jsplumb.\n this.getAllConnections = function () {\n return connections;\n };\n this.getDefaultScope = function () {\n return DEFAULT_SCOPE;\n };\n // get an endpoint by uuid.\n this.getEndpoint = _getEndpoint;\n /**\n * Gets the list of Endpoints for a given element.\n * @method getEndpoints\n * @param {String|Element|Selector} el The element to get endpoints for.\n * @return {Endpoint[]} An array of Endpoints for the specified element.\n */\n this.getEndpoints = function (el) {\n return endpointsByElement[_info(el).id] || [];\n };\n // gets the default endpoint type. used when subclassing. see wiki.\n this.getDefaultEndpointType = function () {\n return jsPlumb.Endpoint;\n };\n // gets the default connection type. used when subclassing. see wiki.\n this.getDefaultConnectionType = function () {\n return jsPlumb.Connection;\n };\n /*\n * Gets an element's id, creating one if necessary. really only exposed\n * for the lib-specific functionality to access; would be better to pass\n * the current instance into the lib-specific code (even though this is\n * a static call. i just don't want to expose it to the public API).\n */\n this.getId = _getId;\n this.draw = _draw;\n this.info = _info;\n\n this.appendElement = _appendElement;\n\n var _hoverSuspended = false;\n this.isHoverSuspended = function () {\n return _hoverSuspended;\n };\n this.setHoverSuspended = function (s) {\n _hoverSuspended = s;\n };\n\n // set an element's connections to be hidden\n this.hide = function (el, changeEndpoints) {\n _setVisible(el, \"none\", changeEndpoints);\n return _currentInstance;\n };\n\n // exposed for other objects to use to get a unique id.\n this.idstamp = _idstamp;\n\n // ensure that, if the current container exists, it is a DOM element and not a selector.\n // if it does not exist and `candidate` is supplied, the offset parent of that element will be set as the Container.\n // this is used to do a better default behaviour for the case that the user has not set a container:\n // addEndpoint, makeSource, makeTarget and connect all call this method with the offsetParent of the\n // element in question (for connect it is the source element). So if no container is set, it is inferred\n // to be the offsetParent of the first element the user tries to connect.\n var _ensureContainer = function (candidate) {\n if (!_container && candidate) {\n var can = _currentInstance.getElement(candidate);\n if (can.offsetParent) {\n _currentInstance.setContainer(can.offsetParent);\n }\n }\n };\n\n var _getContainerFromDefaults = function () {\n if (_currentInstance.Defaults.Container) {\n _currentInstance.setContainer(_currentInstance.Defaults.Container);\n }\n };\n\n // check if a given element is managed or not. if not, add to our map. if drawing is not suspended then\n // we'll also stash its dimensions; otherwise we'll do this in a lazy way through updateOffset.\n var _manage = _currentInstance.manage = function (id, element, _transient) {\n if (!managedElements[id]) {\n managedElements[id] = {\n el: element,\n endpoints: [],\n connections: []\n };\n\n managedElements[id].info = _updateOffset({ elId: id, timestamp: _suspendedAt });\n _currentInstance.addClass(element, \"jtk-managed\");\n if (!_transient) {\n _currentInstance.fire(\"manageElement\", { id:id, info:managedElements[id].info, el:element });\n }\n }\n\n return managedElements[id];\n };\n\n var _unmanage = _currentInstance.unmanage = function(id) {\n if (managedElements[id]) {\n _currentInstance.removeClass(managedElements[id].el, \"jtk-managed\");\n delete managedElements[id];\n _currentInstance.fire(\"unmanageElement\", id);\n }\n };\n\n /**\n * updates the offset and size for a given element, and stores the\n * values. if 'offset' is not null we use that (it would have been\n * passed in from a drag call) because it's faster; but if it is null,\n * or if 'recalc' is true in order to force a recalculation, we get the current values.\n * @method updateOffset\n */\n var _updateOffset = function (params) {\n\n var timestamp = params.timestamp, recalc = params.recalc, offset = params.offset, elId = params.elId, s;\n if (_suspendDrawing && !timestamp) {\n timestamp = _suspendedAt;\n }\n if (!recalc) {\n if (timestamp && timestamp === offsetTimestamps[elId]) {\n return {o: params.offset || offsets[elId], s: sizes[elId]};\n }\n }\n if (recalc || (!offset && offsets[elId] == null)) { // if forced repaint or no offset available, we recalculate.\n\n // get the current size and offset, and store them\n s = managedElements[elId] ? managedElements[elId].el : null;\n if (s != null) {\n sizes[elId] = _currentInstance.getSize(s);\n offsets[elId] = _currentInstance.getOffset(s);\n offsetTimestamps[elId] = timestamp;\n }\n } else {\n offsets[elId] = offset || offsets[elId];\n if (sizes[elId] == null) {\n s = managedElements[elId].el;\n if (s != null) {\n sizes[elId] = _currentInstance.getSize(s);\n }\n }\n offsetTimestamps[elId] = timestamp;\n }\n\n if (offsets[elId] && !offsets[elId].right) {\n offsets[elId].right = offsets[elId].left + sizes[elId][0];\n offsets[elId].bottom = offsets[elId].top + sizes[elId][1];\n offsets[elId].width = sizes[elId][0];\n offsets[elId].height = sizes[elId][1];\n offsets[elId].centerx = offsets[elId].left + (offsets[elId].width / 2);\n offsets[elId].centery = offsets[elId].top + (offsets[elId].height / 2);\n }\n\n return {o: offsets[elId], s: sizes[elId]};\n };\n\n this.updateOffset = _updateOffset;\n\n /**\n * callback from the current library to tell us to prepare ourselves (attach\n * mouse listeners etc; can't do that until the library has provided a bind method)\n */\n this.init = function () {\n if (!initialized) {\n _getContainerFromDefaults();\n _currentInstance.anchorManager = new root.jsPlumb.AnchorManager({jsPlumbInstance: _currentInstance});\n initialized = true;\n _currentInstance.fire(\"ready\", _currentInstance);\n }\n }.bind(this);\n\n this.log = log;\n this.jsPlumbUIComponent = jsPlumbUIComponent;\n\n /*\n * Creates an anchor with the given params.\n *\n *\n * Returns: The newly created Anchor.\n * Throws: an error if a named anchor was not found.\n */\n this.makeAnchor = function () {\n var pp, _a = function (t, p) {\n if (root.jsPlumb.Anchors[t]) {\n return new root.jsPlumb.Anchors[t](p);\n }\n if (!_currentInstance.Defaults.DoNotThrowErrors) {\n throw { msg: \"jsPlumb: unknown anchor type '\" + t + \"'\" };\n }\n };\n if (arguments.length === 0) {\n return null;\n }\n var specimen = arguments[0], elementId = arguments[1], jsPlumbInstance = arguments[2], newAnchor = null;\n // if it appears to be an anchor already...\n if (specimen.compute && specimen.getOrientation) {\n return specimen;\n } //TODO hazy here about whether it should be added or is already added somehow.\n // is it the name of an anchor type?\n else if (typeof specimen === \"string\") {\n newAnchor = _a(arguments[0], {elementId: elementId, jsPlumbInstance: _currentInstance});\n }\n // is it an array? it will be one of:\n // an array of [spec, params] - this defines a single anchor, which may be dynamic, but has parameters.\n // an array of arrays - this defines some dynamic anchors\n // an array of numbers - this defines a single anchor.\n else if (_ju.isArray(specimen)) {\n if (_ju.isArray(specimen[0]) || _ju.isString(specimen[0])) {\n // if [spec, params] format\n if (specimen.length === 2 && _ju.isObject(specimen[1])) {\n // if first arg is a string, its a named anchor with params\n if (_ju.isString(specimen[0])) {\n pp = root.jsPlumb.extend({elementId: elementId, jsPlumbInstance: _currentInstance}, specimen[1]);\n newAnchor = _a(specimen[0], pp);\n }\n // otherwise first arg is array, second is params. we treat as a dynamic anchor, which is fine\n // even if the first arg has only one entry. you could argue all anchors should be implicitly dynamic in fact.\n else {\n pp = root.jsPlumb.extend({elementId: elementId, jsPlumbInstance: _currentInstance, anchors: specimen[0]}, specimen[1]);\n newAnchor = new root.jsPlumb.DynamicAnchor(pp);\n }\n }\n else {\n newAnchor = new jsPlumb.DynamicAnchor({anchors: specimen, selector: null, elementId: elementId, jsPlumbInstance: _currentInstance});\n }\n\n }\n else {\n var anchorParams = {\n x: specimen[0], y: specimen[1],\n orientation: (specimen.length >= 4) ? [ specimen[2], specimen[3] ] : [0, 0],\n offsets: (specimen.length >= 6) ? [ specimen[4], specimen[5] ] : [ 0, 0 ],\n elementId: elementId,\n jsPlumbInstance: _currentInstance,\n cssClass: specimen.length === 7 ? specimen[6] : null\n };\n newAnchor = new root.jsPlumb.Anchor(anchorParams);\n newAnchor.clone = function () {\n return new root.jsPlumb.Anchor(anchorParams);\n };\n }\n }\n\n if (!newAnchor.id) {\n newAnchor.id = \"anchor_\" + _idstamp();\n }\n return newAnchor;\n };\n\n /**\n * makes a list of anchors from the given list of types or coords, eg\n * [\"TopCenter\", \"RightMiddle\", \"BottomCenter\", [0, 1, -1, -1] ]\n */\n this.makeAnchors = function (types, elementId, jsPlumbInstance) {\n var r = [];\n for (var i = 0, ii = types.length; i < ii; i++) {\n if (typeof types[i] === \"string\") {\n r.push(root.jsPlumb.Anchors[types[i]]({elementId: elementId, jsPlumbInstance: jsPlumbInstance}));\n }\n else if (_ju.isArray(types[i])) {\n r.push(_currentInstance.makeAnchor(types[i], elementId, jsPlumbInstance));\n }\n }\n return r;\n };\n\n /**\n * Makes a dynamic anchor from the given list of anchors (which may be in shorthand notation as strings or dimension arrays, or Anchor\n * objects themselves) and the given, optional, anchorSelector function (jsPlumb uses a default if this is not provided; most people will\n * not need to provide this - i think).\n */\n this.makeDynamicAnchor = function (anchors, anchorSelector) {\n return new root.jsPlumb.DynamicAnchor({anchors: anchors, selector: anchorSelector, elementId: null, jsPlumbInstance: _currentInstance});\n };\n\n// --------------------- makeSource/makeTarget ----------------------------------------------\n\n this.targetEndpointDefinitions = {};\n this.sourceEndpointDefinitions = {};\n\n var selectorFilter = function (evt, _el, selector, _instance, negate) {\n var t = evt.target || evt.srcElement, ok = false,\n sel = _instance.getSelector(_el, selector);\n for (var j = 0; j < sel.length; j++) {\n if (sel[j] === t) {\n ok = true;\n break;\n }\n }\n return negate ? !ok : ok;\n };\n\n var _makeElementDropHandler = function (elInfo, p, dropOptions, isSource, isTarget) {\n var proxyComponent = new jsPlumbUIComponent(p);\n var _drop = p._jsPlumb.EndpointDropHandler({\n jsPlumb: _currentInstance,\n enabled: function () {\n return elInfo.def.enabled;\n },\n isFull: function () {\n var targetCount = _currentInstance.select({target: elInfo.id}).length;\n return elInfo.def.maxConnections > 0 && targetCount >= elInfo.def.maxConnections;\n },\n element: elInfo.el,\n elementId: elInfo.id,\n isSource: isSource,\n isTarget: isTarget,\n addClass: function (clazz) {\n _currentInstance.addClass(elInfo.el, clazz);\n },\n removeClass: function (clazz) {\n _currentInstance.removeClass(elInfo.el, clazz);\n },\n onDrop: function (jpc) {\n var source = jpc.endpoints[0];\n source.anchor.unlock();\n },\n isDropAllowed: function () {\n return proxyComponent.isDropAllowed.apply(proxyComponent, arguments);\n },\n isRedrop:function(jpc) {\n return (jpc.suspendedElement != null && jpc.suspendedEndpoint != null && jpc.suspendedEndpoint.element === elInfo.el);\n },\n getEndpoint: function (jpc) {\n\n // make a new Endpoint for the target, or get it from the cache if uniqueEndpoint\n // is set. if its a redrop the new endpoint will be immediately cleaned up.\n\n var newEndpoint = elInfo.def.endpoint;\n\n // if no cached endpoint, or there was one but it has been cleaned up\n // (ie. detached), create a new one\n if (newEndpoint == null || newEndpoint._jsPlumb == null) {\n var eps = _currentInstance.deriveEndpointAndAnchorSpec(jpc.getType().join(\" \"), true);\n var pp = eps.endpoints ? root.jsPlumb.extend(p, {\n endpoint:elInfo.def.def.endpoint || eps.endpoints[1]\n }) :p;\n if (eps.anchors) {\n pp = root.jsPlumb.extend(pp, {\n anchor:elInfo.def.def.anchor || eps.anchors[1]\n });\n }\n newEndpoint = _currentInstance.addEndpoint(elInfo.el, pp);\n newEndpoint._mtNew = true;\n }\n\n if (p.uniqueEndpoint) {\n elInfo.def.endpoint = newEndpoint;\n }\n\n newEndpoint.setDeleteOnEmpty(true);\n\n // if connection is detachable, init the new endpoint to be draggable, to support that happening.\n if (jpc.isDetachable()) {\n newEndpoint.initDraggable();\n }\n\n // if the anchor has a 'positionFinder' set, then delegate to that function to find\n // out where to locate the anchor.\n if (newEndpoint.anchor.positionFinder != null) {\n var dropPosition = _currentInstance.getUIPosition(arguments, _currentInstance.getZoom()),\n elPosition = _currentInstance.getOffset(elInfo.el),\n elSize = _currentInstance.getSize(elInfo.el),\n ap = dropPosition == null ? [0,0] : newEndpoint.anchor.positionFinder(dropPosition, elPosition, elSize, newEndpoint.anchor.constructorParams);\n\n newEndpoint.anchor.x = ap[0];\n newEndpoint.anchor.y = ap[1];\n // now figure an orientation for it..kind of hard to know what to do actually. probably the best thing i can do is to\n // support specifying an orientation in the anchor's spec. if one is not supplied then i will make the orientation\n // be what will cause the most natural link to the source: it will be pointing at the source, but it needs to be\n // specified in one axis only, and so how to make that choice? i think i will use whichever axis is the one in which\n // the target is furthest away from the source.\n }\n\n return newEndpoint;\n },\n maybeCleanup: function (ep) {\n if (ep._mtNew && ep.connections.length === 0) {\n _currentInstance.deleteObject({endpoint: ep});\n }\n else {\n delete ep._mtNew;\n }\n }\n });\n\n // wrap drop events as needed and initialise droppable\n var dropEvent = root.jsPlumb.dragEvents.drop;\n dropOptions.scope = dropOptions.scope || (p.scope || _currentInstance.Defaults.Scope);\n dropOptions[dropEvent] = _ju.wrap(dropOptions[dropEvent], _drop, true);\n dropOptions.rank = p.rank || 0;\n\n // if target, return true from the over event. this will cause katavorio to stop setting drops to hover\n // if multipleDrop is set to false.\n if (isTarget) {\n dropOptions[root.jsPlumb.dragEvents.over] = function () { return true; };\n }\n\n // vanilla jsplumb only\n if (p.allowLoopback === false) {\n dropOptions.canDrop = function (_drag) {\n var de = _drag.getDragElement()._jsPlumbRelatedElement;\n return de !== elInfo.el;\n };\n }\n _currentInstance.initDroppable(elInfo.el, dropOptions, \"internal\");\n\n return _drop;\n\n };\n\n // see API docs\n this.makeTarget = function (el, params, referenceParams) {\n\n // put jsplumb ref into params without altering the params passed in\n var p = root.jsPlumb.extend({_jsPlumb: this}, referenceParams);\n root.jsPlumb.extend(p, params);\n\n var maxConnections = p.maxConnections || -1,\n\n _doOne = function (el) {\n\n // get the element's id and store the endpoint definition for it. jsPlumb.connect calls will look for one of these,\n // and use the endpoint definition if found.\n // decode the info for this element (id and element)\n var elInfo = _info(el),\n elid = elInfo.id,\n dropOptions = root.jsPlumb.extend({}, p.dropOptions || {}),\n type = p.connectionType || \"default\";\n\n this.targetEndpointDefinitions[elid] = this.targetEndpointDefinitions[elid] || {};\n\n _ensureContainer(elid);\n\n // if this is a group and the user has not mandated a rank, set to -1 so that Nodes takes\n // precedence.\n if (elInfo.el._isJsPlumbGroup && dropOptions.rank == null) {\n dropOptions.rank = -1;\n }\n\n // store the definition\n var _def = {\n def: root.jsPlumb.extend({}, p),\n uniqueEndpoint: p.uniqueEndpoint,\n maxConnections: maxConnections,\n enabled: true\n };\n\n if (p.createEndpoint) {\n _def.uniqueEndpoint = true;\n _def.endpoint = _currentInstance.addEndpoint(el, _def.def);\n _def.endpoint.setDeleteOnEmpty(false);\n }\n\n elInfo.def = _def;\n this.targetEndpointDefinitions[elid][type] = _def;\n _makeElementDropHandler(elInfo, p, dropOptions, p.isSource === true, true);\n // stash the definition on the drop\n elInfo.el._katavorioDrop[elInfo.el._katavorioDrop.length - 1].targetDef = _def;\n\n }.bind(this);\n\n // make an array if only given one element\n var inputs = el.length && el.constructor !== String ? el : [ el ];\n\n // register each one in the list.\n for (var i = 0, ii = inputs.length; i < ii; i++) {\n _doOne(inputs[i]);\n }\n\n return this;\n };\n\n // see api docs\n this.unmakeTarget = function (el, doNotClearArrays) {\n var info = _info(el);\n _currentInstance.destroyDroppable(info.el, \"internal\");\n if (!doNotClearArrays) {\n delete this.targetEndpointDefinitions[info.id];\n }\n\n return this;\n };\n\n // see api docs\n this.makeSource = function (el, params, referenceParams) {\n var p = root.jsPlumb.extend({_jsPlumb: this}, referenceParams);\n root.jsPlumb.extend(p, params);\n var type = p.connectionType || \"default\";\n var aae = _currentInstance.deriveEndpointAndAnchorSpec(type);\n p.endpoint = p.endpoint || aae.endpoints[0];\n p.anchor = p.anchor || aae.anchors[0];\n var maxConnections = p.maxConnections || -1,\n onMaxConnections = p.onMaxConnections,\n _doOne = function (elInfo) {\n // get the element's id and store the endpoint definition for it. jsPlumb.connect calls will look for one of these,\n // and use the endpoint definition if found.\n var elid = elInfo.id,\n _del = this.getElement(elInfo.el);\n\n this.sourceEndpointDefinitions[elid] = this.sourceEndpointDefinitions[elid] || {};\n _ensureContainer(elid);\n\n var _def = {\n def:root.jsPlumb.extend({}, p),\n uniqueEndpoint: p.uniqueEndpoint,\n maxConnections: maxConnections,\n enabled: true\n };\n\n if (p.createEndpoint) {\n _def.uniqueEndpoint = true;\n _def.endpoint = _currentInstance.addEndpoint(el, _def.def);\n _def.endpoint.setDeleteOnEmpty(false);\n }\n\n this.sourceEndpointDefinitions[elid][type] = _def;\n elInfo.def = _def;\n\n var stopEvent = root.jsPlumb.dragEvents.stop,\n dragEvent = root.jsPlumb.dragEvents.drag,\n dragOptions = root.jsPlumb.extend({ }, p.dragOptions || {}),\n existingDrag = dragOptions.drag,\n existingStop = dragOptions.stop,\n ep = null,\n endpointAddedButNoDragYet = false;\n\n // set scope if its not set in dragOptions but was passed in in params\n dragOptions.scope = dragOptions.scope || p.scope;\n\n dragOptions[dragEvent] = _ju.wrap(dragOptions[dragEvent], function () {\n if (existingDrag) {\n existingDrag.apply(this, arguments);\n }\n endpointAddedButNoDragYet = false;\n });\n\n dragOptions[stopEvent] = _ju.wrap(dragOptions[stopEvent], function () {\n\n if (existingStop) {\n existingStop.apply(this, arguments);\n }\n this.currentlyDragging = false;\n if (ep._jsPlumb != null) { // if not cleaned up...\n\n // reset the anchor to the anchor that was initially provided. the one we were using to drag\n // the connection was just a placeholder that was located at the place the user pressed the\n // mouse button to initiate the drag.\n var anchorDef = p.anchor || this.Defaults.Anchor,\n oldAnchor = ep.anchor,\n oldConnection = ep.connections[0];\n\n var newAnchor = this.makeAnchor(anchorDef, elid, this),\n _el = ep.element;\n\n // if the anchor has a 'positionFinder' set, then delegate to that function to find\n // out where to locate the anchor. issue 117.\n if (newAnchor.positionFinder != null) {\n var elPosition = _currentInstance.getOffset(_el),\n elSize = this.getSize(_el),\n dropPosition = { left: elPosition.left + (oldAnchor.x * elSize[0]), top: elPosition.top + (oldAnchor.y * elSize[1]) },\n ap = newAnchor.positionFinder(dropPosition, elPosition, elSize, newAnchor.constructorParams);\n\n newAnchor.x = ap[0];\n newAnchor.y = ap[1];\n }\n\n ep.setAnchor(newAnchor, true);\n ep.repaint();\n this.repaint(ep.elementId);\n if (oldConnection != null) {\n this.repaint(oldConnection.targetId);\n }\n }\n }.bind(this));\n\n // when the user presses the mouse, add an Endpoint, if we are enabled.\n var mouseDownListener = function (e) {\n // on right mouse button, abort.\n if (e.which === 3 || e.button === 2) {\n return;\n }\n\n // TODO store def on element.\n var def = this.sourceEndpointDefinitions[elid][type];\n\n // if disabled, return.\n if (!def.enabled) {\n return;\n }\n\n elid = this.getId(this.getElement(elInfo.el)); // elid might have changed since this method was called to configure the element.\n\n // if a filter was given, run it, and return if it says no.\n if (p.filter) {\n var r = _ju.isString(p.filter) ? selectorFilter(e, elInfo.el, p.filter, this, p.filterExclude) : p.filter(e, elInfo.el);\n if (r === false) {\n return;\n }\n }\n\n // if maxConnections reached\n var sourceCount = this.select({source: elid}).length;\n if (def.maxConnections >= 0 && (sourceCount >= def.maxConnections)) {\n if (onMaxConnections) {\n onMaxConnections({\n element: elInfo.el,\n maxConnections: maxConnections\n }, e);\n }\n return false;\n }\n\n // find the position on the element at which the mouse was pressed; this is where the endpoint\n // will be located.\n var elxy = root.jsPlumb.getPositionOnElement(e, _del, _zoom);\n\n // we need to override the anchor in here, and force 'isSource', but we don't want to mess with\n // the params passed in, because after a connection is established we're going to reset the endpoint\n // to have the anchor we were given.\n var tempEndpointParams = {};\n root.jsPlumb.extend(tempEndpointParams, p);\n tempEndpointParams.isTemporarySource = true;\n tempEndpointParams.anchor = [ elxy[0], elxy[1] , 0, 0];\n tempEndpointParams.dragOptions = dragOptions;\n\n if (def.def.scope) {\n tempEndpointParams.scope = def.def.scope;\n }\n\n ep = this.addEndpoint(elid, tempEndpointParams);\n endpointAddedButNoDragYet = true;\n ep.setDeleteOnEmpty(true);\n\n // if unique endpoint and it's already been created, push it onto the endpoint we create. at the end\n // of a successful connection we'll switch to that endpoint.\n // TODO this is the same code as the programmatic endpoints create on line 1050 ish\n if (def.uniqueEndpoint) {\n if (!def.endpoint) {\n def.endpoint = ep;\n ep.setDeleteOnEmpty(false);\n }\n else {\n ep.finalEndpoint = def.endpoint;\n }\n }\n\n var _delTempEndpoint = function () {\n // this mouseup event is fired only if no dragging occurred, by jquery and yui, but for mootools\n // it is fired even if dragging has occurred, in which case we would blow away a perfectly\n // legitimate endpoint, were it not for this check. the flag is set after adding an\n // endpoint and cleared in a drag listener we set in the dragOptions above.\n _currentInstance.off(ep.canvas, \"mouseup\", _delTempEndpoint);\n _currentInstance.off(elInfo.el, \"mouseup\", _delTempEndpoint);\n if (endpointAddedButNoDragYet) {\n endpointAddedButNoDragYet = false;\n _currentInstance.deleteEndpoint(ep);\n }\n };\n\n _currentInstance.on(ep.canvas, \"mouseup\", _delTempEndpoint);\n _currentInstance.on(elInfo.el, \"mouseup\", _delTempEndpoint);\n\n // optionally check for attributes to extract from the source element\n var payload = {};\n if (def.def.extract) {\n for (var att in def.def.extract) {\n var v = (e.srcElement || e.target).getAttribute(att);\n if (v) {\n payload[def.def.extract[att]] = v;\n }\n }\n }\n\n // and then trigger its mousedown event, which will kick off a drag, which will start dragging\n // a new connection from this endpoint.\n _currentInstance.trigger(ep.canvas, \"mousedown\", e, payload);\n\n _ju.consume(e);\n\n }.bind(this);\n\n this.on(elInfo.el, \"mousedown\", mouseDownListener);\n _def.trigger = mouseDownListener;\n\n // if a filter was provided, set it as a dragFilter on the element,\n // to prevent the element drag function from kicking in when we want to\n // drag a new connection\n if (p.filter && (_ju.isString(p.filter) || _ju.isFunction(p.filter))) {\n _currentInstance.setDragFilter(elInfo.el, p.filter);\n }\n\n var dropOptions = root.jsPlumb.extend({}, p.dropOptions || {});\n\n _makeElementDropHandler(elInfo, p, dropOptions, true, p.isTarget === true);\n\n }.bind(this);\n\n var inputs = el.length && el.constructor !== String ? el : [ el ];\n for (var i = 0, ii = inputs.length; i < ii; i++) {\n _doOne(_info(inputs[i]));\n }\n\n return this;\n };\n\n // see api docs\n this.unmakeSource = function (el, connectionType, doNotClearArrays) {\n var info = _info(el);\n _currentInstance.destroyDroppable(info.el, \"internal\");\n var eldefs = this.sourceEndpointDefinitions[info.id];\n if (eldefs) {\n for (var def in eldefs) {\n if (connectionType == null || connectionType === def) {\n var mouseDownListener = eldefs[def].trigger;\n if (mouseDownListener) {\n _currentInstance.off(info.el, \"mousedown\", mouseDownListener);\n }\n if (!doNotClearArrays) {\n delete this.sourceEndpointDefinitions[info.id][def];\n }\n }\n }\n }\n\n return this;\n };\n\n // see api docs\n this.unmakeEverySource = function () {\n for (var i in this.sourceEndpointDefinitions) {\n _currentInstance.unmakeSource(i, null, true);\n }\n\n this.sourceEndpointDefinitions = {};\n return this;\n };\n\n var _getScope = function (el, types, connectionType) {\n types = _ju.isArray(types) ? types : [ types ];\n var id = _getId(el);\n connectionType = connectionType || \"default\";\n for (var i = 0; i < types.length; i++) {\n var eldefs = this[types[i]][id];\n if (eldefs && eldefs[connectionType]) {\n return eldefs[connectionType].def.scope || this.Defaults.Scope;\n }\n }\n }.bind(this);\n\n var _setScope = function (el, scope, types, connectionType) {\n types = _ju.isArray(types) ? types : [ types ];\n var id = _getId(el);\n connectionType = connectionType || \"default\";\n for (var i = 0; i < types.length; i++) {\n var eldefs = this[types[i]][id];\n if (eldefs && eldefs[connectionType]) {\n eldefs[connectionType].def.scope = scope;\n }\n }\n\n }.bind(this);\n\n this.getScope = function (el, scope) {\n return _getScope(el, [ \"sourceEndpointDefinitions\", \"targetEndpointDefinitions\" ]);\n };\n this.getSourceScope = function (el) {\n return _getScope(el, \"sourceEndpointDefinitions\");\n };\n this.getTargetScope = function (el) {\n return _getScope(el, \"targetEndpointDefinitions\");\n };\n this.setScope = function (el, scope, connectionType) {\n this.setSourceScope(el, scope, connectionType);\n this.setTargetScope(el, scope, connectionType);\n };\n this.setSourceScope = function (el, scope, connectionType) {\n _setScope(el, scope, \"sourceEndpointDefinitions\", connectionType);\n // we get the source scope during the mousedown event, but we also want to set this.\n this.setDragScope(el, scope);\n };\n this.setTargetScope = function (el, scope, connectionType) {\n _setScope(el, scope, \"targetEndpointDefinitions\", connectionType);\n this.setDropScope(el, scope);\n };\n\n // see api docs\n this.unmakeEveryTarget = function () {\n for (var i in this.targetEndpointDefinitions) {\n _currentInstance.unmakeTarget(i, true);\n }\n\n this.targetEndpointDefinitions = {};\n return this;\n };\n\n // does the work of setting a source enabled or disabled.\n var _setEnabled = function (type, el, state, toggle, connectionType) {\n var a = type === \"source\" ? this.sourceEndpointDefinitions : this.targetEndpointDefinitions,\n originalState, info, newState;\n\n connectionType = connectionType || \"default\";\n\n // a selector or an array\n if (el.length && !_ju.isString(el)) {\n originalState = [];\n for (var i = 0, ii = el.length; i < ii; i++) {\n info = _info(el[i]);\n if (a[info.id] && a[info.id][connectionType]) {\n originalState[i] = a[info.id][connectionType].enabled;\n newState = toggle ? !originalState[i] : state;\n a[info.id][connectionType].enabled = newState;\n _currentInstance[newState ? \"removeClass\" : \"addClass\"](info.el, \"jtk-\" + type + \"-disabled\");\n }\n }\n }\n // otherwise a DOM element or a String ID.\n else {\n info = _info(el);\n var id = info.id;\n if (a[id] && a[id][connectionType]) {\n originalState = a[id][connectionType].enabled;\n newState = toggle ? !originalState : state;\n a[id][connectionType].enabled = newState;\n _currentInstance[newState ? \"removeClass\" : \"addClass\"](info.el, \"jtk-\" + type + \"-disabled\");\n }\n }\n return originalState;\n }.bind(this);\n\n var _first = function (el, fn) {\n if (_ju.isString(el) || !el.length) {\n return fn.apply(this, [ el ]);\n }\n else if (el.length) {\n return fn.apply(this, [ el[0] ]);\n }\n\n }.bind(this);\n\n this.toggleSourceEnabled = function (el, connectionType) {\n _setEnabled(\"source\", el, null, true, connectionType);\n return this.isSourceEnabled(el, connectionType);\n };\n\n this.setSourceEnabled = function (el, state, connectionType) {\n return _setEnabled(\"source\", el, state, null, connectionType);\n };\n this.isSource = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var eldefs = this.sourceEndpointDefinitions[_info(_el).id];\n return eldefs != null && eldefs[connectionType] != null;\n }.bind(this));\n };\n this.isSourceEnabled = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var sep = this.sourceEndpointDefinitions[_info(_el).id];\n return sep && sep[connectionType] && sep[connectionType].enabled === true;\n }.bind(this));\n };\n\n this.toggleTargetEnabled = function (el, connectionType) {\n _setEnabled(\"target\", el, null, true, connectionType);\n return this.isTargetEnabled(el, connectionType);\n };\n\n this.isTarget = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var eldefs = this.targetEndpointDefinitions[_info(_el).id];\n return eldefs != null && eldefs[connectionType] != null;\n }.bind(this));\n };\n this.isTargetEnabled = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var tep = this.targetEndpointDefinitions[_info(_el).id];\n return tep && tep[connectionType] && tep[connectionType].enabled === true;\n }.bind(this));\n };\n this.setTargetEnabled = function (el, state, connectionType) {\n return _setEnabled(\"target\", el, state, null, connectionType);\n };\n\n// --------------------- end makeSource/makeTarget ----------------------------------------------\n\n this.ready = function (fn) {\n _currentInstance.bind(\"ready\", fn);\n };\n\n var _elEach = function(el, fn) {\n // support both lists...\n if (typeof el === 'object' && el.length) {\n for (var i = 0, ii = el.length; i < ii; i++) {\n fn(el[i]);\n }\n }\n else {// ...and single strings or elements.\n fn(el);\n }\n\n return _currentInstance;\n };\n\n // repaint some element's endpoints and connections\n this.repaint = function (el, ui, timestamp) {\n return _elEach(el, function(_el) {\n _draw(_el, ui, timestamp);\n });\n };\n\n this.revalidate = function (el, timestamp, isIdAlready) {\n return _elEach(el, function(_el) {\n var elId = isIdAlready ? _el : _currentInstance.getId(_el);\n _currentInstance.updateOffset({ elId: elId, recalc: true, timestamp:timestamp });\n var dm = _currentInstance.getDragManager();\n if (dm) {\n dm.updateOffsets(elId);\n }\n _currentInstance.repaint(_el);\n });\n };\n\n // repaint every endpoint and connection.\n this.repaintEverything = function () {\n // TODO this timestamp causes continuous anchors to not repaint properly.\n // fix this. do not just take out the timestamp. it runs a lot faster with\n // the timestamp included.\n var timestamp = _timestamp(), elId;\n\n for (elId in endpointsByElement) {\n _currentInstance.updateOffset({ elId: elId, recalc: true, timestamp: timestamp });\n }\n\n for (elId in endpointsByElement) {\n _draw(elId, null, timestamp);\n }\n\n return this;\n };\n\n this.removeAllEndpoints = function (el, recurse, affectedElements) {\n affectedElements = affectedElements || [];\n var _one = function (_el) {\n var info = _info(_el),\n ebe = endpointsByElement[info.id],\n i, ii;\n\n if (ebe) {\n affectedElements.push(info);\n for (i = 0, ii = ebe.length; i < ii; i++) {\n _currentInstance.deleteEndpoint(ebe[i], false);\n }\n }\n delete endpointsByElement[info.id];\n\n if (recurse) {\n if (info.el && info.el.nodeType !== 3 && info.el.nodeType !== 8) {\n for (i = 0, ii = info.el.childNodes.length; i < ii; i++) {\n _one(info.el.childNodes[i]);\n }\n }\n }\n\n };\n _one(el);\n return this;\n };\n\n var _doRemove = function(info, affectedElements) {\n _currentInstance.removeAllEndpoints(info.id, true, affectedElements);\n var dm = _currentInstance.getDragManager();\n var _one = function(_info) {\n\n if (dm) {\n dm.elementRemoved(_info.id);\n }\n _currentInstance.anchorManager.clearFor(_info.id);\n _currentInstance.anchorManager.removeFloatingConnection(_info.id);\n\n if (_currentInstance.isSource(_info.el)) {\n _currentInstance.unmakeSource(_info.el);\n }\n if (_currentInstance.isTarget(_info.el)) {\n _currentInstance.unmakeTarget(_info.el);\n }\n _currentInstance.destroyDraggable(_info.el);\n _currentInstance.destroyDroppable(_info.el);\n\n\n delete _currentInstance.floatingConnections[_info.id];\n delete managedElements[_info.id];\n delete offsets[_info.id];\n if (_info.el) {\n _currentInstance.removeElement(_info.el);\n _info.el._jsPlumb = null;\n }\n };\n\n // remove all affected child elements\n for (var ae = 1; ae < affectedElements.length; ae++) {\n _one(affectedElements[ae]);\n }\n // and always remove the requested one from the dom.\n _one(info);\n };\n\n /**\n * Remove the given element, including cleaning up all endpoints registered for it.\n * This is exposed in the public API but also used internally by jsPlumb when removing the\n * element associated with a connection drag.\n */\n this.remove = function (el, doNotRepaint) {\n var info = _info(el), affectedElements = [];\n if (info.text) {\n info.el.parentNode.removeChild(info.el);\n }\n else if (info.id) {\n _currentInstance.batch(function () {\n _doRemove(info, affectedElements);\n }, doNotRepaint === true);\n }\n return _currentInstance;\n };\n\n this.empty = function (el, doNotRepaint) {\n var affectedElements = [];\n var _one = function(el, dontRemoveFocus) {\n var info = _info(el);\n if (info.text) {\n info.el.parentNode.removeChild(info.el);\n }\n else if (info.el) {\n while(info.el.childNodes.length > 0) {\n _one(info.el.childNodes[0]);\n }\n if (!dontRemoveFocus) {\n _doRemove(info, affectedElements);\n }\n }\n };\n\n _currentInstance.batch(function() {\n _one(el, true);\n }, doNotRepaint === false);\n\n return _currentInstance;\n };\n\n this.reset = function (doNotUnbindInstanceEventListeners) {\n _currentInstance.silently(function() {\n _hoverSuspended = false;\n _currentInstance.removeAllGroups();\n _currentInstance.removeGroupManager();\n _currentInstance.deleteEveryEndpoint();\n if (!doNotUnbindInstanceEventListeners) {\n _currentInstance.unbind();\n }\n this.targetEndpointDefinitions = {};\n this.sourceEndpointDefinitions = {};\n connections.length = 0;\n if (this.doReset) {\n this.doReset();\n }\n }.bind(this));\n };\n\n var _clearObject = function (obj) {\n if (obj.canvas && obj.canvas.parentNode) {\n obj.canvas.parentNode.removeChild(obj.canvas);\n }\n obj.cleanup();\n obj.destroy();\n };\n\n this.clear = function () {\n _currentInstance.select().each(_clearObject);\n _currentInstance.selectEndpoints().each(_clearObject);\n\n endpointsByElement = {};\n endpointsByUUID = {};\n };\n\n this.setDefaultScope = function (scope) {\n DEFAULT_SCOPE = scope;\n return _currentInstance;\n };\n\n this.deriveEndpointAndAnchorSpec = function(type, dontPrependDefault) {\n var bits = ((dontPrependDefault ? \"\" : \"default \") + type).split(/[\\s]/), eps = null, ep = null, a = null, as = null;\n for (var i = 0; i < bits.length; i++) {\n var _t = _currentInstance.getType(bits[i], \"connection\");\n if (_t) {\n if (_t.endpoints) {\n eps = _t.endpoints;\n }\n if (_t.endpoint) {\n ep = _t.endpoint;\n }\n if (_t.anchors) {\n as = _t.anchors;\n }\n if (_t.anchor) {\n a = _t.anchor;\n }\n }\n }\n return { endpoints: eps ? eps : [ ep, ep ], anchors: as ? as : [a, a ]};\n };\n\n // sets the id of some element, changing whatever we need to to keep track.\n this.setId = function (el, newId, doNotSetAttribute) {\n //\n var id;\n\n if (_ju.isString(el)) {\n id = el;\n }\n else {\n el = this.getElement(el);\n id = this.getId(el);\n }\n\n var sConns = this.getConnections({source: id, scope: '*'}, true),\n tConns = this.getConnections({target: id, scope: '*'}, true);\n\n newId = \"\" + newId;\n\n if (!doNotSetAttribute) {\n el = this.getElement(id);\n this.setAttribute(el, \"id\", newId);\n }\n else {\n el = this.getElement(newId);\n }\n\n endpointsByElement[newId] = endpointsByElement[id] || [];\n for (var i = 0, ii = endpointsByElement[newId].length; i < ii; i++) {\n endpointsByElement[newId][i].setElementId(newId);\n endpointsByElement[newId][i].setReferenceElement(el);\n }\n delete endpointsByElement[id];\n\n this.sourceEndpointDefinitions[newId] = this.sourceEndpointDefinitions[id];\n delete this.sourceEndpointDefinitions[id];\n this.targetEndpointDefinitions[newId] = this.targetEndpointDefinitions[id];\n delete this.targetEndpointDefinitions[id];\n\n this.anchorManager.changeId(id, newId);\n var dm = this.getDragManager();\n if (dm) {\n dm.changeId(id, newId);\n }\n managedElements[newId] = managedElements[id];\n delete managedElements[id];\n\n var _conns = function (list, epIdx, type) {\n for (var i = 0, ii = list.length; i < ii; i++) {\n list[i].endpoints[epIdx].setElementId(newId);\n list[i].endpoints[epIdx].setReferenceElement(el);\n list[i][type + \"Id\"] = newId;\n list[i][type] = el;\n }\n };\n _conns(sConns, 0, \"source\");\n _conns(tConns, 1, \"target\");\n\n this.repaint(newId);\n };\n\n this.setDebugLog = function (debugLog) {\n log = debugLog;\n };\n\n this.setSuspendDrawing = function (val, repaintAfterwards) {\n var curVal = _suspendDrawing;\n _suspendDrawing = val;\n if (val) {\n _suspendedAt = new Date().getTime();\n } else {\n _suspendedAt = null;\n }\n if (repaintAfterwards) {\n this.repaintEverything();\n }\n return curVal;\n };\n\n // returns whether or not drawing is currently suspended.\n this.isSuspendDrawing = function () {\n return _suspendDrawing;\n };\n\n // return timestamp for when drawing was suspended.\n this.getSuspendedAt = function () {\n return _suspendedAt;\n };\n\n this.batch = function (fn, doNotRepaintAfterwards) {\n var _wasSuspended = this.isSuspendDrawing();\n if (!_wasSuspended) {\n this.setSuspendDrawing(true);\n }\n try {\n fn();\n }\n catch (e) {\n _ju.log(\"Function run while suspended failed\", e);\n }\n if (!_wasSuspended) {\n this.setSuspendDrawing(false, !doNotRepaintAfterwards);\n }\n };\n\n this.doWhileSuspended = this.batch;\n\n this.getCachedData = _getCachedData;\n this.timestamp = _timestamp;\n this.show = function (el, changeEndpoints) {\n _setVisible(el, \"block\", changeEndpoints);\n return _currentInstance;\n };\n\n // TODO: update this method to return the current state.\n this.toggleVisible = _toggleVisible;\n this.addListener = this.bind;\n\n var floatingConnections = [];\n this.registerFloatingConnection = function(info, conn, ep) {\n floatingConnections[info.id] = conn;\n // only register for the target endpoint; we will not be dragging the source at any time\n // before this connection is either discarded or made into a permanent connection.\n _ju.addToList(endpointsByElement, info.id, ep);\n };\n this.getFloatingConnectionFor = function(id) {\n return floatingConnections[id];\n };\n };\n\n _ju.extend(root.jsPlumbInstance, _ju.EventGenerator, {\n setAttribute: function (el, a, v) {\n this.setAttribute(el, a, v);\n },\n getAttribute: function (el, a) {\n return this.getAttribute(root.jsPlumb.getElement(el), a);\n },\n convertToFullOverlaySpec: function(spec) {\n if (_ju.isString(spec)) {\n spec = [ spec, { } ];\n }\n spec[1].id = spec[1].id || _ju.uuid();\n return spec;\n },\n registerConnectionType: function (id, type) {\n this._connectionTypes[id] = root.jsPlumb.extend({}, type);\n if (type.overlays) {\n var to = {};\n for (var i = 0; i < type.overlays.length; i++) {\n // if a string, convert to object representation so that we can store the typeid on it.\n // also assign an id.\n var fo = this.convertToFullOverlaySpec(type.overlays[i]);\n to[fo[1].id] = fo;\n }\n this._connectionTypes[id].overlays = to;\n }\n },\n registerConnectionTypes: function (types) {\n for (var i in types) {\n this.registerConnectionType(i, types[i]);\n }\n },\n registerEndpointType: function (id, type) {\n this._endpointTypes[id] = root.jsPlumb.extend({}, type);\n if (type.overlays) {\n var to = {};\n for (var i = 0; i < type.overlays.length; i++) {\n // if a string, convert to object representation so that we can store the typeid on it.\n // also assign an id.\n var fo = this.convertToFullOverlaySpec(type.overlays[i]);\n to[fo[1].id] = fo;\n }\n this._endpointTypes[id].overlays = to;\n }\n },\n registerEndpointTypes: function (types) {\n for (var i in types) {\n this.registerEndpointType(i, types[i]);\n }\n },\n getType: function (id, typeDescriptor) {\n return typeDescriptor === \"connection\" ? this._connectionTypes[id] : this._endpointTypes[id];\n },\n setIdChanged: function (oldId, newId) {\n this.setId(oldId, newId, true);\n },\n // set parent: change the parent for some node and update all the registrations we need to.\n setParent: function (el, newParent) {\n var _dom = this.getElement(el),\n _id = this.getId(_dom),\n _pdom = this.getElement(newParent),\n _pid = this.getId(_pdom),\n dm = this.getDragManager();\n\n _dom.parentNode.removeChild(_dom);\n _pdom.appendChild(_dom);\n if (dm) {\n dm.setParent(_dom, _id, _pdom, _pid);\n }\n },\n extend: function (o1, o2, names) {\n var i;\n if (names) {\n for (i = 0; i < names.length; i++) {\n o1[names[i]] = o2[names[i]];\n }\n }\n else {\n for (i in o2) {\n o1[i] = o2[i];\n }\n }\n\n return o1;\n },\n floatingConnections: {},\n getFloatingAnchorIndex: function (jpc) {\n return jpc.endpoints[0].isFloating() ? 0 : jpc.endpoints[1].isFloating() ? 1 : -1;\n }\n });\n\n// --------------------- static instance + module registration -------------------------------------------\n\n// create static instance and assign to window if window exists.\n var jsPlumb = new jsPlumbInstance();\n // register on 'root' (lets us run on server or browser)\n root.jsPlumb = jsPlumb;\n // add 'getInstance' method to static instance\n jsPlumb.getInstance = function (_defaults, overrideFns) {\n var j = new jsPlumbInstance(_defaults);\n if (overrideFns) {\n for (var ovf in overrideFns) {\n j[ovf] = overrideFns[ovf];\n }\n }\n j.init();\n return j;\n };\n jsPlumb.each = function (spec, fn) {\n if (spec == null) {\n return;\n }\n if (typeof spec === \"string\") {\n fn(jsPlumb.getElement(spec));\n }\n else if (spec.length != null) {\n for (var i = 0; i < spec.length; i++) {\n fn(jsPlumb.getElement(spec[i]));\n }\n }\n else {\n fn(spec);\n } // assume it's an element.\n };\n\n // CommonJS\n if (typeof exports !== 'undefined') {\n exports.jsPlumb = jsPlumb;\n }\n\n// --------------------- end static instance + AMD registration -------------------------------------------\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function() {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n // ------------------------------ BEGIN OverlayCapablejsPlumbUIComponent --------------------------------------------\n\n var _internalLabelOverlayId = \"__label\",\n // this is a shortcut helper method to let people add a label as\n // overlay.\n _makeLabelOverlay = function (component, params) {\n\n var _params = {\n cssClass: params.cssClass,\n labelStyle: component.labelStyle,\n id: _internalLabelOverlayId,\n component: component,\n _jsPlumb: component._jsPlumb.instance // TODO not necessary, since the instance can be accessed through the component.\n },\n mergedParams = _jp.extend(_params, params);\n\n return new _jp.Overlays[component._jsPlumb.instance.getRenderMode()].Label(mergedParams);\n },\n _processOverlay = function (component, o) {\n var _newOverlay = null;\n if (_ju.isArray(o)) {\t// this is for the shorthand [\"Arrow\", { width:50 }] syntax\n // there's also a three arg version:\n // [\"Arrow\", { width:50 }, {location:0.7}]\n // which merges the 3rd arg into the 2nd.\n var type = o[0],\n // make a copy of the object so as not to mess up anyone else's reference...\n p = _jp.extend({component: component, _jsPlumb: component._jsPlumb.instance}, o[1]);\n if (o.length === 3) {\n _jp.extend(p, o[2]);\n }\n _newOverlay = new _jp.Overlays[component._jsPlumb.instance.getRenderMode()][type](p);\n } else if (o.constructor === String) {\n _newOverlay = new _jp.Overlays[component._jsPlumb.instance.getRenderMode()][o]({component: component, _jsPlumb: component._jsPlumb.instance});\n } else {\n _newOverlay = o;\n }\n\n _newOverlay.id = _newOverlay.id || _ju.uuid();\n component.cacheTypeItem(\"overlay\", _newOverlay, _newOverlay.id);\n component._jsPlumb.overlays[_newOverlay.id] = _newOverlay;\n\n return _newOverlay;\n };\n\n _jp.OverlayCapableJsPlumbUIComponent = function (params) {\n\n root.jsPlumbUIComponent.apply(this, arguments);\n this._jsPlumb.overlays = {};\n this._jsPlumb.overlayPositions = {};\n\n if (params.label) {\n this.getDefaultType().overlays[_internalLabelOverlayId] = [\"Label\", {\n label: params.label,\n location: params.labelLocation || this.defaultLabelLocation || 0.5,\n labelStyle: params.labelStyle || this._jsPlumb.instance.Defaults.LabelStyle,\n id:_internalLabelOverlayId\n }];\n }\n\n this.setListenerComponent = function (c) {\n if (this._jsPlumb) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].setListenerComponent(c);\n }\n }\n };\n };\n\n _jp.OverlayCapableJsPlumbUIComponent.applyType = function (component, t) {\n if (t.overlays) {\n // loop through the ones in the type. if already present on the component,\n // dont remove or re-add.\n var keep = {}, i;\n\n for (i in t.overlays) {\n\n var existing = component._jsPlumb.overlays[t.overlays[i][1].id];\n if (existing) {\n // maybe update from data, if there were parameterised values for instance.\n existing.updateFrom(t.overlays[i][1]);\n keep[t.overlays[i][1].id] = true;\n }\n else {\n var c = component.getCachedTypeItem(\"overlay\", t.overlays[i][1].id);\n if (c != null) {\n c.reattach(component._jsPlumb.instance, component);\n c.setVisible(true);\n // maybe update from data, if there were parameterised values for instance.\n c.updateFrom(t.overlays[i][1]);\n component._jsPlumb.overlays[c.id] = c;\n }\n else {\n c = component.addOverlay(t.overlays[i], true);\n }\n keep[c.id] = true;\n }\n }\n\n // now loop through the full overlays and remove those that we dont want to keep\n for (i in component._jsPlumb.overlays) {\n if (keep[component._jsPlumb.overlays[i].id] == null) {\n component.removeOverlay(component._jsPlumb.overlays[i].id, true); // remove overlay but dont clean it up.\n // that would remove event listeners etc; overlays are never discarded by the types stuff, they are\n // just detached/reattached.\n }\n }\n }\n };\n\n _ju.extend(_jp.OverlayCapableJsPlumbUIComponent, root.jsPlumbUIComponent, {\n\n setHover: function (hover, ignoreAttachedElements) {\n if (this._jsPlumb && !this._jsPlumb.instance.isConnectionBeingDragged()) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i][hover ? \"addClass\" : \"removeClass\"](this._jsPlumb.instance.hoverClass);\n }\n }\n },\n addOverlay: function (overlay, doNotRepaint) {\n var o = _processOverlay(this, overlay);\n if (!doNotRepaint) {\n this.repaint();\n }\n return o;\n },\n getOverlay: function (id) {\n return this._jsPlumb.overlays[id];\n },\n getOverlays: function () {\n return this._jsPlumb.overlays;\n },\n hideOverlay: function (id) {\n var o = this.getOverlay(id);\n if (o) {\n o.hide();\n }\n },\n hideOverlays: function () {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].hide();\n }\n },\n showOverlay: function (id) {\n var o = this.getOverlay(id);\n if (o) {\n o.show();\n }\n },\n showOverlays: function () {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].show();\n }\n },\n removeAllOverlays: function (doNotRepaint) {\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays[i].cleanup) {\n this._jsPlumb.overlays[i].cleanup();\n }\n }\n\n this._jsPlumb.overlays = {};\n this._jsPlumb.overlayPositions = null;\n this._jsPlumb.overlayPlacements= {};\n if (!doNotRepaint) {\n this.repaint();\n }\n },\n removeOverlay: function (overlayId, dontCleanup) {\n var o = this._jsPlumb.overlays[overlayId];\n if (o) {\n o.setVisible(false);\n if (!dontCleanup && o.cleanup) {\n o.cleanup();\n }\n delete this._jsPlumb.overlays[overlayId];\n if (this._jsPlumb.overlayPositions) {\n delete this._jsPlumb.overlayPositions[overlayId];\n }\n\n if (this._jsPlumb.overlayPlacements) {\n delete this._jsPlumb.overlayPlacements[overlayId];\n }\n }\n },\n removeOverlays: function () {\n for (var i = 0, j = arguments.length; i < j; i++) {\n this.removeOverlay(arguments[i]);\n }\n },\n moveParent: function (newParent) {\n if (this.bgCanvas) {\n this.bgCanvas.parentNode.removeChild(this.bgCanvas);\n newParent.appendChild(this.bgCanvas);\n }\n\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n newParent.appendChild(this.canvas);\n\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays[i].isAppendedAtTopLevel) {\n var el = this._jsPlumb.overlays[i].getElement();\n el.parentNode.removeChild(el);\n newParent.appendChild(el);\n }\n }\n }\n },\n getLabel: function () {\n var lo = this.getOverlay(_internalLabelOverlayId);\n return lo != null ? lo.getLabel() : null;\n },\n getLabelOverlay: function () {\n return this.getOverlay(_internalLabelOverlayId);\n },\n setLabel: function (l) {\n var lo = this.getOverlay(_internalLabelOverlayId);\n if (!lo) {\n var params = l.constructor === String || l.constructor === Function ? { label: l } : l;\n lo = _makeLabelOverlay(this, params);\n this._jsPlumb.overlays[_internalLabelOverlayId] = lo;\n }\n else {\n if (l.constructor === String || l.constructor === Function) {\n lo.setLabel(l);\n }\n else {\n if (l.label) {\n lo.setLabel(l.label);\n }\n if (l.location) {\n lo.setLocation(l.location);\n }\n }\n }\n\n if (!this._jsPlumb.instance.isSuspendDrawing()) {\n this.repaint();\n }\n },\n cleanup: function (force) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].cleanup(force);\n this._jsPlumb.overlays[i].destroy(force);\n }\n if (force) {\n this._jsPlumb.overlays = {};\n this._jsPlumb.overlayPositions = null;\n }\n },\n setVisible: function (v) {\n this[v ? \"showOverlays\" : \"hideOverlays\"]();\n },\n setAbsoluteOverlayPosition: function (overlay, xy) {\n this._jsPlumb.overlayPositions[overlay.id] = xy;\n },\n getAbsoluteOverlayPosition: function (overlay) {\n return this._jsPlumb.overlayPositions ? this._jsPlumb.overlayPositions[overlay.id] : null;\n },\n _clazzManip:function(action, clazz, dontUpdateOverlays) {\n if (!dontUpdateOverlays) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i][action + \"Class\"](clazz);\n }\n }\n },\n addClass:function(clazz, dontUpdateOverlays) {\n this._clazzManip(\"add\", clazz, dontUpdateOverlays);\n },\n removeClass:function(clazz, dontUpdateOverlays) {\n this._clazzManip(\"remove\", clazz, dontUpdateOverlays);\n }\n });\n\n// ------------------------------ END OverlayCapablejsPlumbUIComponent --------------------------------------------\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the code for Endpoints.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n * \n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n // create the drag handler for a connection\n var _makeConnectionDragHandler = function (endpoint, placeholder, _jsPlumb) {\n var stopped = false;\n return {\n drag: function () {\n if (stopped) {\n stopped = false;\n return true;\n }\n\n if (placeholder.element) {\n var _ui = _jsPlumb.getUIPosition(arguments, _jsPlumb.getZoom());\n if (_ui != null) {\n _jsPlumb.setPosition(placeholder.element, _ui);\n }\n _jsPlumb.repaint(placeholder.element, _ui);\n // always repaint the source endpoint, because only continuous/dynamic anchors cause the endpoint\n // to be repainted, so static anchors need to be told (or the endpoint gets dragged around)\n endpoint.paint({anchorPoint:endpoint.anchor.getCurrentLocation({element:endpoint})});\n }\n },\n stopDrag: function () {\n stopped = true;\n }\n };\n };\n\n // creates a placeholder div for dragging purposes, adds it, and pre-computes its offset.\n var _makeDraggablePlaceholder = function (placeholder, _jsPlumb, ipco, ips) {\n var n = _jsPlumb.createElement(\"div\", { position : \"absolute\" });\n _jsPlumb.appendElement(n);\n var id = _jsPlumb.getId(n);\n _jsPlumb.setPosition(n, ipco);\n n.style.width = ips[0] + \"px\";\n n.style.height = ips[1] + \"px\";\n _jsPlumb.manage(id, n, true); // TRANSIENT MANAGE\n // create and assign an id, and initialize the offset.\n placeholder.id = id;\n placeholder.element = n;\n };\n\n // create a floating endpoint (for drag connections)\n var _makeFloatingEndpoint = function (paintStyle, referenceAnchor, endpoint, referenceCanvas, sourceElement, _jsPlumb, _newEndpoint, scope) {\n var floatingAnchor = new _jp.FloatingAnchor({ reference: referenceAnchor, referenceCanvas: referenceCanvas, jsPlumbInstance: _jsPlumb });\n //setting the scope here should not be the way to fix that mootools issue. it should be fixed by not\n // adding the floating endpoint as a droppable. that makes more sense anyway!\n // TRANSIENT MANAGE\n return _newEndpoint({\n paintStyle: paintStyle,\n endpoint: endpoint,\n anchor: floatingAnchor,\n source: sourceElement,\n scope: scope\n });\n };\n\n var typeParameters = [ \"connectorStyle\", \"connectorHoverStyle\", \"connectorOverlays\",\n \"connector\", \"connectionType\", \"connectorClass\", \"connectorHoverClass\" ];\n\n // a helper function that tries to find a connection to the given element, and returns it if so. if elementWithPrecedence is null,\n // or no connection to it is found, we return the first connection in our list.\n var findConnectionToUseForDynamicAnchor = function (ep, elementWithPrecedence) {\n var idx = 0;\n if (elementWithPrecedence != null) {\n for (var i = 0; i < ep.connections.length; i++) {\n if (ep.connections[i].sourceId === elementWithPrecedence || ep.connections[i].targetId === elementWithPrecedence) {\n idx = i;\n break;\n }\n }\n }\n\n return ep.connections[idx];\n };\n\n _jp.Endpoint = function (params) {\n var _jsPlumb = params._jsPlumb,\n _newConnection = params.newConnection,\n _newEndpoint = params.newEndpoint;\n\n this.idPrefix = \"_jsplumb_e_\";\n this.defaultLabelLocation = [ 0.5, 0.5 ];\n this.defaultOverlayKeys = [\"Overlays\", \"EndpointOverlays\"];\n _jp.OverlayCapableJsPlumbUIComponent.apply(this, arguments);\n\n// TYPE\n\n this.appendToDefaultType({\n connectionType:params.connectionType,\n maxConnections: params.maxConnections == null ? this._jsPlumb.instance.Defaults.MaxConnections : params.maxConnections, // maximum number of connections this endpoint can be the source of.,\n paintStyle: params.endpointStyle || params.paintStyle || params.style || this._jsPlumb.instance.Defaults.EndpointStyle || _jp.Defaults.EndpointStyle,\n hoverPaintStyle: params.endpointHoverStyle || params.hoverPaintStyle || this._jsPlumb.instance.Defaults.EndpointHoverStyle || _jp.Defaults.EndpointHoverStyle,\n connectorStyle: params.connectorStyle,\n connectorHoverStyle: params.connectorHoverStyle,\n connectorClass: params.connectorClass,\n connectorHoverClass: params.connectorHoverClass,\n connectorOverlays: params.connectorOverlays,\n connector: params.connector,\n connectorTooltip: params.connectorTooltip\n });\n\n// END TYPE\n\n this._jsPlumb.enabled = !(params.enabled === false);\n this._jsPlumb.visible = true;\n this.element = _jp.getElement(params.source);\n this._jsPlumb.uuid = params.uuid;\n this._jsPlumb.floatingEndpoint = null;\n var inPlaceCopy = null;\n if (this._jsPlumb.uuid) {\n params.endpointsByUUID[this._jsPlumb.uuid] = this;\n }\n this.elementId = params.elementId;\n this.dragProxy = params.dragProxy;\n\n this._jsPlumb.connectionCost = params.connectionCost;\n this._jsPlumb.connectionsDirected = params.connectionsDirected;\n this._jsPlumb.currentAnchorClass = \"\";\n this._jsPlumb.events = {};\n\n var deleteOnEmpty = params.deleteOnEmpty === true;\n this.setDeleteOnEmpty = function(d) {\n deleteOnEmpty = d;\n };\n\n var _updateAnchorClass = function () {\n // stash old, get new\n var oldAnchorClass = _jsPlumb.endpointAnchorClassPrefix + \"-\" + this._jsPlumb.currentAnchorClass;\n this._jsPlumb.currentAnchorClass = this.anchor.getCssClass();\n var anchorClass = _jsPlumb.endpointAnchorClassPrefix + (this._jsPlumb.currentAnchorClass ? \"-\" + this._jsPlumb.currentAnchorClass : \"\");\n\n this.removeClass(oldAnchorClass);\n this.addClass(anchorClass);\n // add and remove at the same time to reduce the number of reflows.\n _jp.updateClasses(this.element, anchorClass, oldAnchorClass);\n }.bind(this);\n\n this.prepareAnchor = function(anchorParams) {\n var a = this._jsPlumb.instance.makeAnchor(anchorParams, this.elementId, _jsPlumb);\n a.bind(\"anchorChanged\", function (currentAnchor) {\n this.fire(\"anchorChanged\", {endpoint: this, anchor: currentAnchor});\n _updateAnchorClass();\n }.bind(this));\n return a;\n };\n\n this.setPreparedAnchor = function(anchor, doNotRepaint) {\n this._jsPlumb.instance.continuousAnchorFactory.clear(this.elementId);\n this.anchor = anchor;\n _updateAnchorClass();\n\n if (!doNotRepaint) {\n this._jsPlumb.instance.repaint(this.elementId);\n }\n\n return this;\n };\n\n this.setAnchor = function (anchorParams, doNotRepaint) {\n var a = this.prepareAnchor(anchorParams);\n this.setPreparedAnchor(a, doNotRepaint);\n return this;\n };\n\n var internalHover = function (state) {\n if (this.connections.length > 0) {\n for (var i = 0; i < this.connections.length; i++) {\n this.connections[i].setHover(state, false);\n }\n }\n else {\n this.setHover(state);\n }\n }.bind(this);\n\n this.bind(\"mouseover\", function () {\n internalHover(true);\n });\n this.bind(\"mouseout\", function () {\n internalHover(false);\n });\n\n // ANCHOR MANAGER\n if (!params._transient) { // in place copies, for example, are transient. they will never need to be retrieved during a paint cycle, because they dont move, and then they are deleted.\n this._jsPlumb.instance.anchorManager.add(this, this.elementId);\n }\n\n this.prepareEndpoint = function(ep, typeId) {\n var _e = function (t, p) {\n var rm = _jsPlumb.getRenderMode();\n if (_jp.Endpoints[rm][t]) {\n return new _jp.Endpoints[rm][t](p);\n }\n if (!_jsPlumb.Defaults.DoNotThrowErrors) {\n throw { msg: \"jsPlumb: unknown endpoint type '\" + t + \"'\" };\n }\n };\n\n var endpointArgs = {\n _jsPlumb: this._jsPlumb.instance,\n cssClass: params.cssClass,\n container: params.container,\n tooltip: params.tooltip,\n connectorTooltip: params.connectorTooltip,\n endpoint: this\n };\n\n var endpoint;\n\n if (_ju.isString(ep)) {\n endpoint = _e(ep, endpointArgs);\n }\n else if (_ju.isArray(ep)) {\n endpointArgs = _ju.merge(ep[1], endpointArgs);\n endpoint = _e(ep[0], endpointArgs);\n }\n else {\n endpoint = ep.clone();\n }\n\n // assign a clone function using a copy of endpointArgs. this is used when a drag starts: the endpoint that was dragged is cloned,\n // and the clone is left in its place while the original one goes off on a magical journey.\n // the copy is to get around a closure problem, in which endpointArgs ends up getting shared by\n // the whole world.\n //var argsForClone = jsPlumb.extend({}, endpointArgs);\n endpoint.clone = function () {\n // TODO this, and the code above, can be refactored to be more dry.\n if (_ju.isString(ep)) {\n return _e(ep, endpointArgs);\n }\n else if (_ju.isArray(ep)) {\n endpointArgs = _ju.merge(ep[1], endpointArgs);\n return _e(ep[0], endpointArgs);\n }\n }.bind(this);\n\n endpoint.typeId = typeId;\n return endpoint;\n };\n\n this.setEndpoint = function(ep, doNotRepaint) {\n var _ep = this.prepareEndpoint(ep);\n this.setPreparedEndpoint(_ep, true);\n };\n\n this.setPreparedEndpoint = function (ep, doNotRepaint) {\n if (this.endpoint != null) {\n this.endpoint.cleanup();\n this.endpoint.destroy();\n }\n this.endpoint = ep;\n this.type = this.endpoint.type;\n this.canvas = this.endpoint.canvas;\n };\n\n _jp.extend(this, params, typeParameters);\n\n this.isSource = params.isSource || false;\n this.isTemporarySource = params.isTemporarySource || false;\n this.isTarget = params.isTarget || false;\n\n this.connections = params.connections || [];\n this.connectorPointerEvents = params[\"connector-pointer-events\"];\n\n this.scope = params.scope || _jsPlumb.getDefaultScope();\n this.timestamp = null;\n this.reattachConnections = params.reattach || _jsPlumb.Defaults.ReattachConnections;\n this.connectionsDetachable = _jsPlumb.Defaults.ConnectionsDetachable;\n if (params.connectionsDetachable === false || params.detachable === false) {\n this.connectionsDetachable = false;\n }\n this.dragAllowedWhenFull = params.dragAllowedWhenFull !== false;\n\n if (params.onMaxConnections) {\n this.bind(\"maxConnections\", params.onMaxConnections);\n }\n\n //\n // add a connection. not part of public API.\n //\n this.addConnection = function (connection) {\n this.connections.push(connection);\n this[(this.connections.length > 0 ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointConnectedClass);\n this[(this.isFull() ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointFullClass);\n };\n\n this.detachFromConnection = function (connection, idx, doNotCleanup) {\n idx = idx == null ? this.connections.indexOf(connection) : idx;\n if (idx >= 0) {\n this.connections.splice(idx, 1);\n this[(this.connections.length > 0 ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointConnectedClass);\n this[(this.isFull() ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointFullClass);\n }\n\n if (!doNotCleanup && deleteOnEmpty && this.connections.length === 0) {\n _jsPlumb.deleteObject({\n endpoint: this,\n fireEvent: false,\n deleteAttachedObjects: doNotCleanup !== true\n });\n }\n };\n\n this.deleteEveryConnection = function(params) {\n var c = this.connections.length;\n for (var i = 0; i < c; i++) {\n _jsPlumb.deleteConnection(this.connections[0], params);\n }\n };\n\n this.detachFrom = function (targetEndpoint, fireEvent, originalEvent) {\n var c = [];\n for (var i = 0; i < this.connections.length; i++) {\n if (this.connections[i].endpoints[1] === targetEndpoint || this.connections[i].endpoints[0] === targetEndpoint) {\n c.push(this.connections[i]);\n }\n }\n for (var j = 0, count = c.length; j < count; j++) {\n _jsPlumb.deleteConnection(c[0]);\n }\n return this;\n };\n\n this.getElement = function () {\n return this.element;\n };\n\n this.setElement = function (el) {\n var parentId = this._jsPlumb.instance.getId(el),\n curId = this.elementId;\n // remove the endpoint from the list for the current endpoint's element\n _ju.removeWithFunction(params.endpointsByElement[this.elementId], function (e) {\n return e.id === this.id;\n }.bind(this));\n this.element = _jp.getElement(el);\n this.elementId = _jsPlumb.getId(this.element);\n _jsPlumb.anchorManager.rehomeEndpoint(this, curId, this.element);\n _jsPlumb.dragManager.endpointAdded(this.element);\n _ju.addToList(params.endpointsByElement, parentId, this);\n return this;\n };\n\n /**\n * private but must be exposed.\n */\n this.makeInPlaceCopy = function () {\n var loc = this.anchor.getCurrentLocation({element: this}),\n o = this.anchor.getOrientation(this),\n acc = this.anchor.getCssClass(),\n inPlaceAnchor = {\n bind: function () {\n },\n compute: function () {\n return [ loc[0], loc[1] ];\n },\n getCurrentLocation: function () {\n return [ loc[0], loc[1] ];\n },\n getOrientation: function () {\n return o;\n },\n getCssClass: function () {\n return acc;\n }\n };\n\n return _newEndpoint({\n dropOptions: params.dropOptions,\n anchor: inPlaceAnchor,\n source: this.element,\n paintStyle: this.getPaintStyle(),\n endpoint: params.hideOnDrag ? \"Blank\" : this.endpoint,\n _transient: true,\n scope: this.scope,\n reference:this\n });\n };\n\n /**\n * returns a connection from the pool; used when dragging starts. just gets the head of the array if it can.\n */\n this.connectorSelector = function () {\n return this.connections[0];\n };\n\n this.setStyle = this.setPaintStyle;\n\n this.paint = function (params) {\n params = params || {};\n var timestamp = params.timestamp, recalc = !(params.recalc === false);\n if (!timestamp || this.timestamp !== timestamp) {\n\n var info = _jsPlumb.updateOffset({ elId: this.elementId, timestamp: timestamp });\n\n var xy = params.offset ? params.offset.o : info.o;\n if (xy != null) {\n var ap = params.anchorPoint, connectorPaintStyle = params.connectorPaintStyle;\n if (ap == null) {\n var wh = params.dimensions || info.s,\n anchorParams = { xy: [ xy.left, xy.top ], wh: wh, element: this, timestamp: timestamp };\n if (recalc && this.anchor.isDynamic && this.connections.length > 0) {\n var c = findConnectionToUseForDynamicAnchor(this, params.elementWithPrecedence),\n oIdx = c.endpoints[0] === this ? 1 : 0,\n oId = oIdx === 0 ? c.sourceId : c.targetId,\n oInfo = _jsPlumb.getCachedData(oId),\n oOffset = oInfo.o, oWH = oInfo.s;\n\n anchorParams.index = oIdx === 0 ? 1 : 0;\n anchorParams.connection = c;\n anchorParams.txy = [ oOffset.left, oOffset.top ];\n anchorParams.twh = oWH;\n anchorParams.tElement = c.endpoints[oIdx];\n } else if (this.connections.length > 0) {\n anchorParams.connection = this.connections[0];\n }\n ap = this.anchor.compute(anchorParams);\n }\n\n this.endpoint.compute(ap, this.anchor.getOrientation(this), this._jsPlumb.paintStyleInUse, connectorPaintStyle || this.paintStyleInUse);\n this.endpoint.paint(this._jsPlumb.paintStyleInUse, this.anchor);\n this.timestamp = timestamp;\n\n // paint overlays\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays.hasOwnProperty(i)) {\n var o = this._jsPlumb.overlays[i];\n if (o.isVisible()) {\n this._jsPlumb.overlayPlacements[i] = o.draw(this.endpoint, this._jsPlumb.paintStyleInUse);\n o.paint(this._jsPlumb.overlayPlacements[i]);\n }\n }\n }\n }\n }\n };\n\n this.getTypeDescriptor = function () {\n return \"endpoint\";\n };\n this.isVisible = function () {\n return this._jsPlumb.visible;\n };\n\n this.repaint = this.paint;\n\n var draggingInitialised = false;\n this.initDraggable = function () {\n\n // is this a connection source? we make it draggable and have the\n // drag listener maintain a connection with a floating endpoint.\n if (!draggingInitialised && _jp.isDragSupported(this.element)) {\n var placeholderInfo = { id: null, element: null },\n jpc = null,\n existingJpc = false,\n existingJpcParams = null,\n _dragHandler = _makeConnectionDragHandler(this, placeholderInfo, _jsPlumb),\n dragOptions = params.dragOptions || {},\n defaultOpts = {},\n startEvent = _jp.dragEvents.start,\n stopEvent = _jp.dragEvents.stop,\n dragEvent = _jp.dragEvents.drag,\n beforeStartEvent = _jp.dragEvents.beforeStart,\n payload;\n\n // respond to beforeStart from katavorio; this will have, optionally, a payload of attribute values\n // that were placed there by the makeSource mousedown listener.\n var beforeStart = function(beforeStartParams) {\n payload = beforeStartParams.e.payload || {};\n };\n\n var start = function (startParams) {\n\n// ------------- first, get a connection to drag. this may be null, in which case we are dragging a new one.\n\n jpc = this.connectorSelector();\n\n// -------------------------------- now a bunch of tests about whether or not to proceed -------------------------\n\n var _continue = true;\n // if not enabled, return\n if (!this.isEnabled()) {\n _continue = false;\n }\n // if no connection and we're not a source - or temporarily a source, as is the case with makeSource - return.\n if (jpc == null && !this.isSource && !this.isTemporarySource) {\n _continue = false;\n }\n // otherwise if we're full and not allowed to drag, also return false.\n if (this.isSource && this.isFull() && !(jpc != null && this.dragAllowedWhenFull)) {\n _continue = false;\n }\n // if the connection was setup as not detachable or one of its endpoints\n // was setup as connectionsDetachable = false, or Defaults.ConnectionsDetachable\n // is set to false...\n if (jpc != null && !jpc.isDetachable(this)) {\n // .. and the endpoint is full\n if (this.isFull()) {\n _continue = false;\n } else {\n // otherwise, if not full, set the connection to null, and we will now proceed\n // to drag a new connection.\n jpc = null;\n }\n }\n\n var beforeDrag = _jsPlumb.checkCondition(jpc == null ? \"beforeDrag\" : \"beforeStartDetach\", {\n endpoint:this,\n source:this.element,\n sourceId:this.elementId,\n connection:jpc\n });\n if (beforeDrag === false) {\n _continue = false;\n }\n // else we might have been given some data. we'll pass it in to a new connection as 'data'.\n // here we also merge in the optional payload we were given on mousedown.\n else if (typeof beforeDrag === \"object\") {\n _jp.extend(beforeDrag, payload || {});\n }\n else {\n // or if no beforeDrag data, maybe use the payload on its own.\n beforeDrag = payload || {};\n }\n\n if (_continue === false) {\n // this is for mootools and yui. returning false from this causes jquery to stop drag.\n // the events are wrapped in both mootools and yui anyway, but i don't think returning\n // false from the start callback would stop a drag.\n if (_jsPlumb.stopDrag) {\n _jsPlumb.stopDrag(this.canvas);\n }\n _dragHandler.stopDrag();\n return false;\n }\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n // ok to proceed.\n\n // clear hover for all connections for this endpoint before continuing.\n for (var i = 0; i < this.connections.length; i++) {\n this.connections[i].setHover(false);\n }\n\n this.addClass(\"endpointDrag\");\n _jsPlumb.setConnectionBeingDragged(true);\n\n // if we're not full but there was a connection, make it null. we'll create a new one.\n if (jpc && !this.isFull() && this.isSource) {\n jpc = null;\n }\n\n _jsPlumb.updateOffset({ elId: this.elementId });\n\n// ---------------- make the element we will drag around, and position it -----------------------------\n\n var ipco = this._jsPlumb.instance.getOffset(this.canvas),\n canvasElement = this.canvas,\n ips = this._jsPlumb.instance.getSize(this.canvas);\n\n _makeDraggablePlaceholder(placeholderInfo, _jsPlumb, ipco, ips);\n\n // store the id of the dragging div and the source element. the drop function will pick these up. \n _jsPlumb.setAttributes(this.canvas, {\n \"dragId\": placeholderInfo.id,\n \"elId\": this.elementId\n });\n\n// ------------------- create an endpoint that will be our floating endpoint ------------------------------------\n\n var endpointToFloat = this.dragProxy || this.endpoint;\n if (this.dragProxy == null && this.connectionType != null) {\n var aae = this._jsPlumb.instance.deriveEndpointAndAnchorSpec(this.connectionType);\n if (aae.endpoints[1]) {\n endpointToFloat = aae.endpoints[1];\n }\n }\n var centerAnchor = this._jsPlumb.instance.makeAnchor(\"Center\");\n centerAnchor.isFloating = true;\n this._jsPlumb.floatingEndpoint = _makeFloatingEndpoint(this.getPaintStyle(), centerAnchor, endpointToFloat, this.canvas, placeholderInfo.element, _jsPlumb, _newEndpoint, this.scope);\n var _savedAnchor = this._jsPlumb.floatingEndpoint.anchor;\n\n\n if (jpc == null) {\n\n this.setHover(false, false);\n // create a connection. one end is this endpoint, the other is a floating endpoint. \n jpc = _newConnection({\n sourceEndpoint: this,\n targetEndpoint: this._jsPlumb.floatingEndpoint,\n source: this.element, // for makeSource with parent option. ensure source element is represented correctly.\n target: placeholderInfo.element,\n anchors: [ this.anchor, this._jsPlumb.floatingEndpoint.anchor ],\n paintStyle: params.connectorStyle, // this can be null. Connection will use the default.\n hoverPaintStyle: params.connectorHoverStyle,\n connector: params.connector, // this can also be null. Connection will use the default.\n overlays: params.connectorOverlays,\n type: this.connectionType,\n cssClass: this.connectorClass,\n hoverClass: this.connectorHoverClass,\n scope:params.scope,\n data:beforeDrag\n });\n jpc.pending = true;\n jpc.addClass(_jsPlumb.draggingClass);\n this._jsPlumb.floatingEndpoint.addClass(_jsPlumb.draggingClass);\n this._jsPlumb.floatingEndpoint.anchor = _savedAnchor;\n // fire an event that informs that a connection is being dragged\n _jsPlumb.fire(\"connectionDrag\", jpc);\n\n // register the new connection on the drag manager. This connection, at this point, is 'pending',\n // and has as its target a temporary element (the 'placeholder'). If the connection subsequently\n // becomes established, the anchor manager is informed that the target of the connection has\n // changed.\n\n _jsPlumb.anchorManager.newConnection(jpc);\n\n } else {\n existingJpc = true;\n jpc.setHover(false);\n // new anchor idx\n var anchorIdx = jpc.endpoints[0].id === this.id ? 0 : 1;\n this.detachFromConnection(jpc, null, true); // detach from the connection while dragging is occurring. but dont cleanup automatically.\n\n // store the original scope (issue 57)\n var dragScope = _jsPlumb.getDragScope(canvasElement);\n _jsPlumb.setAttribute(this.canvas, \"originalScope\", dragScope);\n\n // fire an event that informs that a connection is being dragged. we do this before\n // replacing the original target with the floating element info.\n _jsPlumb.fire(\"connectionDrag\", jpc);\n\n // now we replace ourselves with the temporary div we created above:\n if (anchorIdx === 0) {\n existingJpcParams = [ jpc.source, jpc.sourceId, canvasElement, dragScope ];\n _jsPlumb.anchorManager.sourceChanged(jpc.endpoints[anchorIdx].elementId, placeholderInfo.id, jpc, placeholderInfo.element);\n\n } else {\n existingJpcParams = [ jpc.target, jpc.targetId, canvasElement, dragScope ];\n jpc.target = placeholderInfo.element;\n jpc.targetId = placeholderInfo.id;\n\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.endpoints[anchorIdx].elementId, jpc.targetId, jpc);\n }\n\n // store the original endpoint and assign the new floating endpoint for the drag.\n jpc.suspendedEndpoint = jpc.endpoints[anchorIdx];\n\n // PROVIDE THE SUSPENDED ELEMENT, BE IT A SOURCE OR TARGET (ISSUE 39)\n jpc.suspendedElement = jpc.endpoints[anchorIdx].getElement();\n jpc.suspendedElementId = jpc.endpoints[anchorIdx].elementId;\n jpc.suspendedElementType = anchorIdx === 0 ? \"source\" : \"target\";\n\n jpc.suspendedEndpoint.setHover(false);\n this._jsPlumb.floatingEndpoint.referenceEndpoint = jpc.suspendedEndpoint;\n jpc.endpoints[anchorIdx] = this._jsPlumb.floatingEndpoint;\n\n jpc.addClass(_jsPlumb.draggingClass);\n this._jsPlumb.floatingEndpoint.addClass(_jsPlumb.draggingClass);\n }\n\n _jsPlumb.registerFloatingConnection(placeholderInfo, jpc, this._jsPlumb.floatingEndpoint);\n\n // // register it and register connection on it.\n // _jsPlumb.floatingConnections[placeholderInfo.id] = jpc;\n //\n // // only register for the target endpoint; we will not be dragging the source at any time\n // // before this connection is either discarded or made into a permanent connection.\n // _ju.addToList(params.endpointsByElement, placeholderInfo.id, this._jsPlumb.floatingEndpoint);\n\n\n // tell jsplumb about it\n _jsPlumb.currentlyDragging = true;\n }.bind(this);\n\n var stop = function () {\n _jsPlumb.setConnectionBeingDragged(false);\n\n if (jpc && jpc.endpoints != null) {\n // get the actual drop event (decode from library args to stop function)\n var originalEvent = _jsPlumb.getDropEvent(arguments);\n // unlock the other endpoint (if it is dynamic, it would have been locked at drag start)\n var idx = _jsPlumb.getFloatingAnchorIndex(jpc);\n jpc.endpoints[idx === 0 ? 1 : 0].anchor.unlock();\n // TODO: Dont want to know about css classes inside jsplumb, ideally.\n jpc.removeClass(_jsPlumb.draggingClass);\n\n // if we have the floating endpoint then the connection has not been dropped\n // on another endpoint. If it is a new connection we throw it away. If it is an\n // existing connection we check to see if we should reattach it, throwing it away\n // if not.\n if (this._jsPlumb && (jpc.deleteConnectionNow || jpc.endpoints[idx] === this._jsPlumb.floatingEndpoint)) {\n // 6a. if the connection was an existing one...\n if (existingJpc && jpc.suspendedEndpoint) {\n // fix for issue35, thanks Sylvain Gizard: when firing the detach event make sure the\n // floating endpoint has been replaced.\n if (idx === 0) {\n jpc.floatingElement = jpc.source;\n jpc.floatingId = jpc.sourceId;\n jpc.floatingEndpoint = jpc.endpoints[0];\n jpc.floatingIndex = 0;\n jpc.source = existingJpcParams[0];\n jpc.sourceId = existingJpcParams[1];\n } else {\n // keep a copy of the floating element; the anchor manager will want to clean up.\n jpc.floatingElement = jpc.target;\n jpc.floatingId = jpc.targetId;\n jpc.floatingEndpoint = jpc.endpoints[1];\n jpc.floatingIndex = 1;\n jpc.target = existingJpcParams[0];\n jpc.targetId = existingJpcParams[1];\n }\n\n var fe = this._jsPlumb.floatingEndpoint; // store for later removal.\n // restore the original scope (issue 57)\n _jsPlumb.setDragScope(existingJpcParams[2], existingJpcParams[3]);\n jpc.endpoints[idx] = jpc.suspendedEndpoint;\n // if the connection should be reattached, or the other endpoint refuses detach, then\n // reset the connection to its original state\n if (jpc.isReattach() || jpc._forceReattach || jpc._forceDetach || !_jsPlumb.deleteConnection(jpc, {originalEvent: originalEvent})) {\n\n jpc.setHover(false);\n jpc._forceDetach = null;\n jpc._forceReattach = null;\n this._jsPlumb.floatingEndpoint.detachFromConnection(jpc);\n jpc.suspendedEndpoint.addConnection(jpc);\n\n // TODO this code is duplicated in lots of places...and there is nothing external\n // in the code; it all refers to the connection itself. we could add a\n // `checkSanity(connection)` method to anchorManager that did this.\n if (idx === 1) {\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.floatingId, jpc.targetId, jpc);\n }\n else {\n _jsPlumb.anchorManager.sourceChanged(jpc.floatingId, jpc.sourceId, jpc, jpc.source);\n }\n\n _jsPlumb.repaint(existingJpcParams[1]);\n }\n else {\n _jsPlumb.deleteObject({endpoint: fe});\n }\n }\n }\n\n // makeTargets sets this flag, to tell us we have been replaced and should delete this object.\n if (this.deleteAfterDragStop) {\n _jsPlumb.deleteObject({endpoint: this});\n }\n else {\n if (this._jsPlumb) {\n this.paint({recalc: false});\n }\n }\n\n // although the connection is no longer valid, there are use cases where this is useful.\n _jsPlumb.fire(\"connectionDragStop\", jpc, originalEvent);\n // fire this event to give people more fine-grained control (connectionDragStop fires a lot)\n if (jpc.pending) {\n _jsPlumb.fire(\"connectionAborted\", jpc, originalEvent);\n }\n // tell jsplumb that dragging is finished.\n _jsPlumb.currentlyDragging = false;\n jpc.suspendedElement = null;\n jpc.suspendedEndpoint = null;\n jpc = null;\n }\n\n // if no endpoints, jpc already cleaned up. but still we want to ensure we're reset properly.\n // remove the element associated with the floating endpoint\n // (and its associated floating endpoint and visual artefacts)\n if (placeholderInfo && placeholderInfo.element) {\n _jsPlumb.remove(placeholderInfo.element, false, false);\n }\n // remove the inplace copy\n if (inPlaceCopy) {\n _jsPlumb.deleteObject({endpoint: inPlaceCopy});\n }\n\n if (this._jsPlumb) {\n // make our canvas visible (TODO: hand off to library; we should not know about DOM)\n this.canvas.style.visibility = \"visible\";\n // unlock our anchor\n this.anchor.unlock();\n // clear floating anchor.\n this._jsPlumb.floatingEndpoint = null;\n }\n\n }.bind(this);\n\n dragOptions = _jp.extend(defaultOpts, dragOptions);\n dragOptions.scope = this.scope || dragOptions.scope;\n dragOptions[beforeStartEvent] = _ju.wrap(dragOptions[beforeStartEvent], beforeStart, false);\n dragOptions[startEvent] = _ju.wrap(dragOptions[startEvent], start, false);\n // extracted drag handler function so can be used by makeSource\n dragOptions[dragEvent] = _ju.wrap(dragOptions[dragEvent], _dragHandler.drag);\n dragOptions[stopEvent] = _ju.wrap(dragOptions[stopEvent], stop);\n dragOptions.multipleDrop = false;\n\n dragOptions.canDrag = function () {\n return this.isSource || this.isTemporarySource || (this.connections.length > 0 && this.connectionsDetachable !== false);\n }.bind(this);\n\n _jsPlumb.initDraggable(this.canvas, dragOptions, \"internal\");\n\n this.canvas._jsPlumbRelatedElement = this.element;\n\n draggingInitialised = true;\n }\n };\n\n var ep = params.endpoint || this._jsPlumb.instance.Defaults.Endpoint || _jp.Defaults.Endpoint;\n this.setEndpoint(ep, true);\n var anchorParamsToUse = params.anchor ? params.anchor : params.anchors ? params.anchors : (_jsPlumb.Defaults.Anchor || \"Top\");\n this.setAnchor(anchorParamsToUse, true);\n\n // finally, set type if it was provided\n var type = [ \"default\", (params.type || \"\")].join(\" \");\n this.addType(type, params.data, true);\n this.canvas = this.endpoint.canvas;\n this.canvas._jsPlumb = this;\n\n this.initDraggable();\n\n // pulled this out into a function so we can reuse it for the inPlaceCopy canvas; you can now drop detached connections\n // back onto the endpoint you detached it from.\n var _initDropTarget = function (canvas, isTransient, endpoint, referenceEndpoint) {\n\n if (_jp.isDropSupported(this.element)) {\n var dropOptions = params.dropOptions || _jsPlumb.Defaults.DropOptions || _jp.Defaults.DropOptions;\n dropOptions = _jp.extend({}, dropOptions);\n dropOptions.scope = dropOptions.scope || this.scope;\n var dropEvent = _jp.dragEvents.drop,\n overEvent = _jp.dragEvents.over,\n outEvent = _jp.dragEvents.out,\n _ep = this,\n drop = _jsPlumb.EndpointDropHandler({\n getEndpoint: function () {\n return _ep;\n },\n jsPlumb: _jsPlumb,\n enabled: function () {\n return endpoint != null ? endpoint.isEnabled() : true;\n },\n isFull: function () {\n return endpoint.isFull();\n },\n element: this.element,\n elementId: this.elementId,\n isSource: this.isSource,\n isTarget: this.isTarget,\n addClass: function (clazz) {\n _ep.addClass(clazz);\n },\n removeClass: function (clazz) {\n _ep.removeClass(clazz);\n },\n isDropAllowed: function () {\n return _ep.isDropAllowed.apply(_ep, arguments);\n },\n reference:referenceEndpoint,\n isRedrop:function(jpc, dhParams) {\n return jpc.suspendedEndpoint && dhParams.reference && (jpc.suspendedEndpoint.id === dhParams.reference.id);\n }\n });\n\n dropOptions[dropEvent] = _ju.wrap(dropOptions[dropEvent], drop, true);\n dropOptions[overEvent] = _ju.wrap(dropOptions[overEvent], function () {\n var draggable = _jp.getDragObject(arguments),\n id = _jsPlumb.getAttribute(_jp.getElement(draggable), \"dragId\"),\n _jpc = _jsPlumb.getFloatingConnectionFor(id);//_jsPlumb.floatingConnections[id];\n\n if (_jpc != null) {\n var idx = _jsPlumb.getFloatingAnchorIndex(_jpc);\n // here we should fire the 'over' event if we are a target and this is a new connection,\n // or we are the same as the floating endpoint.\n var _cont = (this.isTarget && idx !== 0) || (_jpc.suspendedEndpoint && this.referenceEndpoint && this.referenceEndpoint.id === _jpc.suspendedEndpoint.id);\n if (_cont) {\n var bb = _jsPlumb.checkCondition(\"checkDropAllowed\", {\n sourceEndpoint: _jpc.endpoints[idx],\n targetEndpoint: this,\n connection: _jpc\n });\n this[(bb ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointDropAllowedClass);\n this[(bb ? \"remove\" : \"add\") + \"Class\"](_jsPlumb.endpointDropForbiddenClass);\n _jpc.endpoints[idx].anchor.over(this.anchor, this);\n }\n }\n }.bind(this));\n\n dropOptions[outEvent] = _ju.wrap(dropOptions[outEvent], function () {\n var draggable = _jp.getDragObject(arguments),\n id = draggable == null ? null : _jsPlumb.getAttribute(_jp.getElement(draggable), \"dragId\"),\n _jpc = id ? _jsPlumb.getFloatingConnectionFor(id) : null;\n\n if (_jpc != null) {\n var idx = _jsPlumb.getFloatingAnchorIndex(_jpc);\n var _cont = (this.isTarget && idx !== 0) || (_jpc.suspendedEndpoint && this.referenceEndpoint && this.referenceEndpoint.id === _jpc.suspendedEndpoint.id);\n if (_cont) {\n this.removeClass(_jsPlumb.endpointDropAllowedClass);\n this.removeClass(_jsPlumb.endpointDropForbiddenClass);\n _jpc.endpoints[idx].anchor.out();\n }\n }\n }.bind(this));\n\n _jsPlumb.initDroppable(canvas, dropOptions, \"internal\", isTransient);\n }\n }.bind(this);\n\n // Initialise the endpoint's canvas as a drop target. The drop handler will take care of the logic of whether\n // something can actually be dropped.\n if (!this.anchor.isFloating) {\n _initDropTarget(this.canvas, !(params._transient || this.anchor.isFloating), this, params.reference);\n }\n\n return this;\n };\n\n _ju.extend(_jp.Endpoint, _jp.OverlayCapableJsPlumbUIComponent, {\n\n setVisible: function (v, doNotChangeConnections, doNotNotifyOtherEndpoint) {\n this._jsPlumb.visible = v;\n if (this.canvas) {\n this.canvas.style.display = v ? \"block\" : \"none\";\n }\n this[v ? \"showOverlays\" : \"hideOverlays\"]();\n if (!doNotChangeConnections) {\n for (var i = 0; i < this.connections.length; i++) {\n this.connections[i].setVisible(v);\n if (!doNotNotifyOtherEndpoint) {\n var oIdx = this === this.connections[i].endpoints[0] ? 1 : 0;\n // only change the other endpoint if this is its only connection.\n if (this.connections[i].endpoints[oIdx].connections.length === 1) {\n this.connections[i].endpoints[oIdx].setVisible(v, true, true);\n }\n }\n }\n }\n },\n getAttachedElements: function () {\n return this.connections;\n },\n applyType: function (t, doNotRepaint) {\n this.setPaintStyle(t.endpointStyle || t.paintStyle, doNotRepaint);\n this.setHoverPaintStyle(t.endpointHoverStyle || t.hoverPaintStyle, doNotRepaint);\n if (t.maxConnections != null) {\n this._jsPlumb.maxConnections = t.maxConnections;\n }\n if (t.scope) {\n this.scope = t.scope;\n }\n _jp.extend(this, t, typeParameters);\n if (t.cssClass != null && this.canvas) {\n this._jsPlumb.instance.addClass(this.canvas, t.cssClass);\n }\n _jp.OverlayCapableJsPlumbUIComponent.applyType(this, t);\n },\n isEnabled: function () {\n return this._jsPlumb.enabled;\n },\n setEnabled: function (e) {\n this._jsPlumb.enabled = e;\n },\n cleanup: function () {\n var anchorClass = this._jsPlumb.instance.endpointAnchorClassPrefix + (this._jsPlumb.currentAnchorClass ? \"-\" + this._jsPlumb.currentAnchorClass : \"\");\n _jp.removeClass(this.element, anchorClass);\n this.anchor = null;\n this.endpoint.cleanup(true);\n this.endpoint.destroy();\n this.endpoint = null;\n // drag/drop\n this._jsPlumb.instance.destroyDraggable(this.canvas, \"internal\");\n this._jsPlumb.instance.destroyDroppable(this.canvas, \"internal\");\n },\n setHover: function (h) {\n if (this.endpoint && this._jsPlumb && !this._jsPlumb.instance.isConnectionBeingDragged()) {\n this.endpoint.setHover(h);\n }\n },\n isFull: function () {\n return this._jsPlumb.maxConnections === 0 ? true : !(this.isFloating() || this._jsPlumb.maxConnections < 0 || this.connections.length < this._jsPlumb.maxConnections);\n },\n /**\n * private but needs to be exposed.\n */\n isFloating: function () {\n return this.anchor != null && this.anchor.isFloating;\n },\n isConnectedTo: function (endpoint) {\n var found = false;\n if (endpoint) {\n for (var i = 0; i < this.connections.length; i++) {\n if (this.connections[i].endpoints[1] === endpoint || this.connections[i].endpoints[0] === endpoint) {\n found = true;\n break;\n }\n }\n }\n return found;\n },\n getConnectionCost: function () {\n return this._jsPlumb.connectionCost;\n },\n setConnectionCost: function (c) {\n this._jsPlumb.connectionCost = c;\n },\n areConnectionsDirected: function () {\n return this._jsPlumb.connectionsDirected;\n },\n setConnectionsDirected: function (b) {\n this._jsPlumb.connectionsDirected = b;\n },\n setElementId: function (_elId) {\n this.elementId = _elId;\n this.anchor.elementId = _elId;\n },\n setReferenceElement: function (_el) {\n this.element = _jp.getElement(_el);\n },\n setDragAllowedWhenFull: function (allowed) {\n this.dragAllowedWhenFull = allowed;\n },\n equals: function (endpoint) {\n return this.anchor.equals(endpoint.anchor);\n },\n getUuid: function () {\n return this._jsPlumb.uuid;\n },\n computeAnchor: function (params) {\n return this.anchor.compute(params);\n }\n });\n\n root.jsPlumbInstance.prototype.EndpointDropHandler = function (dhParams) {\n return function (e) {\n\n var _jsPlumb = dhParams.jsPlumb;\n\n // remove the classes that are added dynamically. drop is neither forbidden nor allowed now that\n // the drop is finishing.\n dhParams.removeClass(_jsPlumb.endpointDropAllowedClass);\n dhParams.removeClass(_jsPlumb.endpointDropForbiddenClass);\n\n var originalEvent = _jsPlumb.getDropEvent(arguments),\n draggable = _jsPlumb.getDragObject(arguments),\n id = _jsPlumb.getAttribute(draggable, \"dragId\"),\n elId = _jsPlumb.getAttribute(draggable, \"elId\"),\n scope = _jsPlumb.getAttribute(draggable, \"originalScope\"),\n jpc = _jsPlumb.getFloatingConnectionFor(id);\n\n // if no active connection, bail.\n if (jpc == null) {\n return;\n }\n\n // calculate if this is an existing connection.\n var existingConnection = jpc.suspendedEndpoint != null;\n\n // if suspended endpoint exists but has been cleaned up, bail. This means it's an existing connection\n // that has been detached and will shortly be discarded.\n if (existingConnection && jpc.suspendedEndpoint._jsPlumb == null) {\n return;\n }\n\n // get the drop endpoint. for a normal connection this is just the one that would replace the currently\n // floating endpoint. for a makeTarget this is a new endpoint that is created on drop. But we leave that to\n // the handler to figure out.\n var _ep = dhParams.getEndpoint(jpc);\n\n // If we're not given an endpoint to use, bail.\n if (_ep == null) {\n return;\n }\n\n // if this is a drop back where the connection came from, mark it force reattach and\n // return; the stop handler will reattach. without firing an event.\n if (dhParams.isRedrop(jpc, dhParams)) {\n jpc._forceReattach = true;\n jpc.setHover(false);\n if (dhParams.maybeCleanup) {\n dhParams.maybeCleanup(_ep);\n }\n return;\n }\n\n // ensure we dont bother trying to drop sources on non-source eps, and same for target.\n var idx = _jsPlumb.getFloatingAnchorIndex(jpc);\n if ((idx === 0 && !dhParams.isSource)|| (idx === 1 && !dhParams.isTarget)){\n if (dhParams.maybeCleanup) {\n dhParams.maybeCleanup(_ep);\n }\n return;\n }\n\n if (dhParams.onDrop) {\n dhParams.onDrop(jpc);\n }\n\n // restore the original scope if necessary (issue 57)\n if (scope) {\n _jsPlumb.setDragScope(draggable, scope);\n }\n\n // if the target of the drop is full, fire an event (we abort below)\n // makeTarget: keep.\n var isFull = dhParams.isFull(e);\n if (isFull) {\n _ep.fire(\"maxConnections\", {\n endpoint: this,\n connection: jpc,\n maxConnections: _ep._jsPlumb.maxConnections\n }, originalEvent);\n }\n //\n // if endpoint enabled, not full, and matches the index of the floating endpoint...\n if (!isFull && dhParams.enabled()) {\n var _doContinue = true;\n\n // before testing for beforeDrop, reset the connection's source/target to be the actual DOM elements\n // involved (that is, stash any temporary stuff used for dragging. but we need to keep it around in\n // order that the anchor manager can clean things up properly).\n if (idx === 0) {\n jpc.floatingElement = jpc.source;\n jpc.floatingId = jpc.sourceId;\n jpc.floatingEndpoint = jpc.endpoints[0];\n jpc.floatingIndex = 0;\n jpc.source = dhParams.element;\n jpc.sourceId = dhParams.elementId;\n } else {\n jpc.floatingElement = jpc.target;\n jpc.floatingId = jpc.targetId;\n jpc.floatingEndpoint = jpc.endpoints[1];\n jpc.floatingIndex = 1;\n jpc.target = dhParams.element;\n jpc.targetId = dhParams.elementId;\n }\n\n // if this is an existing connection and detach is not allowed we won't continue. The connection's\n // endpoints have been reinstated; everything is back to how it was.\n if (existingConnection && jpc.suspendedEndpoint.id !== _ep.id) {\n if (!jpc.isDetachAllowed(jpc) || !jpc.endpoints[idx].isDetachAllowed(jpc) || !jpc.suspendedEndpoint.isDetachAllowed(jpc) || !_jsPlumb.checkCondition(\"beforeDetach\", jpc)) {\n _doContinue = false;\n }\n }\n\n// ------------ wrap the execution path in a function so we can support asynchronous beforeDrop\n\n var continueFunction = function (optionalData) {\n // remove this jpc from the current endpoint, which is a floating endpoint that we will\n // subsequently discard.\n jpc.endpoints[idx].detachFromConnection(jpc);\n\n // if there's a suspended endpoint, detach it from the connection.\n if (jpc.suspendedEndpoint) {\n jpc.suspendedEndpoint.detachFromConnection(jpc);\n }\n\n jpc.endpoints[idx] = _ep;\n _ep.addConnection(jpc);\n\n // copy our parameters in to the connection:\n var params = _ep.getParameters();\n for (var aParam in params) {\n jpc.setParameter(aParam, params[aParam]);\n }\n\n if (!existingConnection) {\n // if not an existing connection and\n if (params.draggable) {\n _jsPlumb.initDraggable(this.element, dhParams.dragOptions, \"internal\", _jsPlumb);\n }\n }\n else {\n var suspendedElementId = jpc.suspendedEndpoint.elementId;\n _jsPlumb.fireMoveEvent({\n index: idx,\n originalSourceId: idx === 0 ? suspendedElementId : jpc.sourceId,\n newSourceId: idx === 0 ? _ep.elementId : jpc.sourceId,\n originalTargetId: idx === 1 ? suspendedElementId : jpc.targetId,\n newTargetId: idx === 1 ? _ep.elementId : jpc.targetId,\n originalSourceEndpoint: idx === 0 ? jpc.suspendedEndpoint : jpc.endpoints[0],\n newSourceEndpoint: idx === 0 ? _ep : jpc.endpoints[0],\n originalTargetEndpoint: idx === 1 ? jpc.suspendedEndpoint : jpc.endpoints[1],\n newTargetEndpoint: idx === 1 ? _ep : jpc.endpoints[1],\n connection: jpc\n }, originalEvent);\n }\n\n if (idx === 1) {\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.floatingId, jpc.targetId, jpc);\n }\n else {\n _jsPlumb.anchorManager.sourceChanged(jpc.floatingId, jpc.sourceId, jpc, jpc.source);\n }\n\n // when makeSource has uniqueEndpoint:true, we want to create connections with new endpoints\n // that are subsequently deleted. So makeSource sets `finalEndpoint`, which is the Endpoint to\n // which the connection should be attached. The `detachFromConnection` call below results in the\n // temporary endpoint being cleaned up.\n if (jpc.endpoints[0].finalEndpoint) {\n var _toDelete = jpc.endpoints[0];\n _toDelete.detachFromConnection(jpc);\n jpc.endpoints[0] = jpc.endpoints[0].finalEndpoint;\n jpc.endpoints[0].addConnection(jpc);\n }\n\n // if optionalData was given, merge it onto the connection's data.\n if (_ju.isObject(optionalData)) {\n jpc.mergeData(optionalData);\n }\n // finalise will inform the anchor manager and also add to\n // connectionsByScope if necessary.\n _jsPlumb.finaliseConnection(jpc, null, originalEvent, false);\n jpc.setHover(false);\n\n // SP continuous anchor flush\n _jsPlumb.revalidate(jpc.endpoints[0].element);\n\n }.bind(this);\n\n var dontContinueFunction = function () {\n // otherwise just put it back on the endpoint it was on before the drag.\n if (jpc.suspendedEndpoint) {\n jpc.endpoints[idx] = jpc.suspendedEndpoint;\n jpc.setHover(false);\n jpc._forceDetach = true;\n if (idx === 0) {\n jpc.source = jpc.suspendedEndpoint.element;\n jpc.sourceId = jpc.suspendedEndpoint.elementId;\n } else {\n jpc.target = jpc.suspendedEndpoint.element;\n jpc.targetId = jpc.suspendedEndpoint.elementId;\n }\n jpc.suspendedEndpoint.addConnection(jpc);\n\n // TODO checkSanity\n if (idx === 1) {\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.floatingId, jpc.targetId, jpc);\n }\n else {\n _jsPlumb.anchorManager.sourceChanged(jpc.floatingId, jpc.sourceId, jpc, jpc.source);\n }\n\n _jsPlumb.repaint(jpc.sourceId);\n jpc._forceDetach = false;\n }\n };\n\n// --------------------------------------\n // now check beforeDrop. this will be available only on Endpoints that are setup to\n // have a beforeDrop condition (although, secretly, under the hood all Endpoints and\n // the Connection have them, because they are on jsPlumbUIComponent. shhh!), because\n // it only makes sense to have it on a target endpoint.\n _doContinue = _doContinue && dhParams.isDropAllowed(jpc.sourceId, jpc.targetId, jpc.scope, jpc, _ep);// && jpc.pending;\n\n if (_doContinue) {\n continueFunction(_doContinue);\n return true;\n }\n else {\n dontContinueFunction();\n }\n }\n\n if (dhParams.maybeCleanup) {\n dhParams.maybeCleanup(_ep);\n }\n\n _jsPlumb.currentlyDragging = false;\n };\n };\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the code for Connections.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this,\n _jp = root.jsPlumb,\n _ju = root.jsPlumbUtil;\n\n var makeConnector = function (_jsPlumb, renderMode, connectorName, connectorArgs, forComponent) {\n // first make sure we have a cache for the specified renderer\n _jp.Connectors[renderMode] = _jp.Connectors[renderMode] || {};\n\n // now see if the one we want exists; if not we will try to make it\n if (_jp.Connectors[renderMode][connectorName] == null) {\n\n if (_jp.Connectors[connectorName] == null) {\n if (!_jsPlumb.Defaults.DoNotThrowErrors) {\n throw new TypeError(\"jsPlumb: unknown connector type '\" + connectorName + \"'\");\n } else {\n return null;\n }\n }\n\n _jp.Connectors[renderMode][connectorName] = function() {\n _jp.Connectors[connectorName].apply(this, arguments);\n _jp.ConnectorRenderers[renderMode].apply(this, arguments);\n };\n\n _ju.extend(_jp.Connectors[renderMode][connectorName], [ _jp.Connectors[connectorName], _jp.ConnectorRenderers[renderMode]]);\n\n }\n\n return new _jp.Connectors[renderMode][connectorName](connectorArgs, forComponent);\n },\n _makeAnchor = function (anchorParams, elementId, _jsPlumb) {\n return (anchorParams) ? _jsPlumb.makeAnchor(anchorParams, elementId, _jsPlumb) : null;\n },\n _updateConnectedClass = function (conn, element, _jsPlumb, remove) {\n if (element != null) {\n element._jsPlumbConnections = element._jsPlumbConnections || {};\n if (remove) {\n delete element._jsPlumbConnections[conn.id];\n }\n else {\n element._jsPlumbConnections[conn.id] = true;\n }\n\n if (_ju.isEmpty(element._jsPlumbConnections)) {\n _jsPlumb.removeClass(element, _jsPlumb.connectedClass);\n }\n else {\n _jsPlumb.addClass(element, _jsPlumb.connectedClass);\n }\n }\n };\n\n _jp.Connection = function (params) {\n var _newEndpoint = params.newEndpoint;\n\n this.id = params.id;\n this.connector = null;\n this.idPrefix = \"_jsplumb_c_\";\n this.defaultLabelLocation = 0.5;\n this.defaultOverlayKeys = [\"Overlays\", \"ConnectionOverlays\"];\n // if a new connection is the result of moving some existing connection, params.previousConnection\n // will have that Connection in it. listeners for the jsPlumbConnection event can look for that\n // member and take action if they need to.\n this.previousConnection = params.previousConnection;\n this.source = _jp.getElement(params.source);\n this.target = _jp.getElement(params.target);\n\n\n _jp.OverlayCapableJsPlumbUIComponent.apply(this, arguments);\n\n // sourceEndpoint and targetEndpoint override source/target, if they are present. but \n // source is not overridden if the Endpoint has declared it is not the final target of a connection;\n // instead we use the source that the Endpoint declares will be the final source element.\n if (params.sourceEndpoint) {\n this.source = params.sourceEndpoint.getElement();\n this.sourceId = params.sourceEndpoint.elementId;\n } else {\n this.sourceId = this._jsPlumb.instance.getId(this.source);\n }\n\n if (params.targetEndpoint) {\n this.target = params.targetEndpoint.getElement();\n this.targetId = params.targetEndpoint.elementId;\n } else {\n this.targetId = this._jsPlumb.instance.getId(this.target);\n }\n\n\n this.scope = params.scope; // scope may have been passed in to the connect call. if it wasn't, we will pull it from the source endpoint, after having initialised the endpoints. \n this.endpoints = [];\n this.endpointStyles = [];\n\n var _jsPlumb = this._jsPlumb.instance;\n\n _jsPlumb.manage(this.sourceId, this.source);\n _jsPlumb.manage(this.targetId, this.target);\n\n this._jsPlumb.visible = true;\n\n this._jsPlumb.params = {\n cssClass: params.cssClass,\n container: params.container,\n \"pointer-events\": params[\"pointer-events\"],\n editorParams: params.editorParams,\n overlays: params.overlays\n };\n this._jsPlumb.lastPaintedAt = null;\n\n // listen to mouseover and mouseout events passed from the container delegate.\n this.bind(\"mouseover\", function () {\n this.setHover(true);\n }.bind(this));\n this.bind(\"mouseout\", function () {\n this.setHover(false);\n }.bind(this));\n\n\n// INITIALISATION CODE\n\n this.makeEndpoint = function (isSource, el, elId, ep) {\n elId = elId || this._jsPlumb.instance.getId(el);\n return this.prepareEndpoint(_jsPlumb, _newEndpoint, this, ep, isSource ? 0 : 1, params, el, elId);\n };\n\n // if type given, get the endpoint definitions mapping to that type from the jsplumb instance, and use those.\n // we apply types at the end of this constructor but endpoints are only honoured in a type definition at\n // create time.\n if (params.type) {\n params.endpoints = params.endpoints || this._jsPlumb.instance.deriveEndpointAndAnchorSpec(params.type).endpoints;\n }\n\n var eS = this.makeEndpoint(true, this.source, this.sourceId, params.sourceEndpoint),\n eT = this.makeEndpoint(false, this.target, this.targetId, params.targetEndpoint);\n\n if (eS) {\n _ju.addToList(params.endpointsByElement, this.sourceId, eS);\n }\n if (eT) {\n _ju.addToList(params.endpointsByElement, this.targetId, eT);\n }\n // if scope not set, set it to be the scope for the source endpoint.\n if (!this.scope) {\n this.scope = this.endpoints[0].scope;\n }\n\n // if explicitly told to (or not to) delete endpoints when empty, override endpoint's preferences\n if (params.deleteEndpointsOnEmpty != null) {\n this.endpoints[0].setDeleteOnEmpty(params.deleteEndpointsOnEmpty);\n this.endpoints[1].setDeleteOnEmpty(params.deleteEndpointsOnEmpty);\n }\n\n// -------------------------- DEFAULT TYPE ---------------------------------------------\n\n // DETACHABLE\n var _detachable = _jsPlumb.Defaults.ConnectionsDetachable;\n if (params.detachable === false) {\n _detachable = false;\n }\n if (this.endpoints[0].connectionsDetachable === false) {\n _detachable = false;\n }\n if (this.endpoints[1].connectionsDetachable === false) {\n _detachable = false;\n }\n // REATTACH\n var _reattach = params.reattach || this.endpoints[0].reattachConnections || this.endpoints[1].reattachConnections || _jsPlumb.Defaults.ReattachConnections;\n\n this.appendToDefaultType({\n detachable: _detachable,\n reattach: _reattach,\n paintStyle:this.endpoints[0].connectorStyle || this.endpoints[1].connectorStyle || params.paintStyle || _jsPlumb.Defaults.PaintStyle || _jp.Defaults.PaintStyle,\n hoverPaintStyle:this.endpoints[0].connectorHoverStyle || this.endpoints[1].connectorHoverStyle || params.hoverPaintStyle || _jsPlumb.Defaults.HoverPaintStyle || _jp.Defaults.HoverPaintStyle\n });\n\n var _suspendedAt = _jsPlumb.getSuspendedAt();\n if (!_jsPlumb.isSuspendDrawing()) {\n // paint the endpoints\n var myInfo = _jsPlumb.getCachedData(this.sourceId),\n myOffset = myInfo.o, myWH = myInfo.s,\n otherInfo = _jsPlumb.getCachedData(this.targetId),\n otherOffset = otherInfo.o,\n otherWH = otherInfo.s,\n initialTimestamp = _suspendedAt || _jsPlumb.timestamp(),\n anchorLoc = this.endpoints[0].anchor.compute({\n xy: [ myOffset.left, myOffset.top ], wh: myWH, element: this.endpoints[0],\n elementId: this.endpoints[0].elementId,\n txy: [ otherOffset.left, otherOffset.top ], twh: otherWH, tElement: this.endpoints[1],\n timestamp: initialTimestamp\n });\n\n this.endpoints[0].paint({ anchorLoc: anchorLoc, timestamp: initialTimestamp });\n\n anchorLoc = this.endpoints[1].anchor.compute({\n xy: [ otherOffset.left, otherOffset.top ], wh: otherWH, element: this.endpoints[1],\n elementId: this.endpoints[1].elementId,\n txy: [ myOffset.left, myOffset.top ], twh: myWH, tElement: this.endpoints[0],\n timestamp: initialTimestamp\n });\n this.endpoints[1].paint({ anchorLoc: anchorLoc, timestamp: initialTimestamp });\n }\n\n this.getTypeDescriptor = function () {\n return \"connection\";\n };\n this.getAttachedElements = function () {\n return this.endpoints;\n };\n\n this.isDetachable = function (ep) {\n return this._jsPlumb.detachable === false ? false : ep != null ? ep.connectionsDetachable === true : this._jsPlumb.detachable === true;\n };\n this.setDetachable = function (detachable) {\n this._jsPlumb.detachable = detachable === true;\n };\n this.isReattach = function () {\n return this._jsPlumb.reattach === true || this.endpoints[0].reattachConnections === true || this.endpoints[1].reattachConnections === true;\n };\n this.setReattach = function (reattach) {\n this._jsPlumb.reattach = reattach === true;\n };\n\n// END INITIALISATION CODE\n\n\n// COST + DIRECTIONALITY\n // if cost not supplied, try to inherit from source endpoint\n this._jsPlumb.cost = params.cost || this.endpoints[0].getConnectionCost();\n this._jsPlumb.directed = params.directed;\n // inherit directed flag if set no source endpoint\n if (params.directed == null) {\n this._jsPlumb.directed = this.endpoints[0].areConnectionsDirected();\n }\n// END COST + DIRECTIONALITY\n\n// PARAMETERS\n // merge all the parameters objects into the connection. parameters set\n // on the connection take precedence; then source endpoint params, then\n // finally target endpoint params.\n var _p = _jp.extend({}, this.endpoints[1].getParameters());\n _jp.extend(_p, this.endpoints[0].getParameters());\n _jp.extend(_p, this.getParameters());\n this.setParameters(_p);\n// END PARAMETERS\n\n// PAINTING\n\n this.setConnector(this.endpoints[0].connector || this.endpoints[1].connector || params.connector || _jsPlumb.Defaults.Connector || _jp.Defaults.Connector, true);\n var data = params.data == null || !_ju.isObject(params.data) ? {} : params.data;\n this.getData = function() { return data; };\n this.setData = function(d) { data = d || {}; };\n this.mergeData = function(d) { data = _jp.extend(data, d); };\n\n // the very last thing we do is apply types, if there are any.\n var _types = [ \"default\", this.endpoints[0].connectionType, this.endpoints[1].connectionType, params.type ].join(\" \");\n if (/[^\\s]/.test(_types)) {\n this.addType(_types, params.data, true);\n }\n\n this.updateConnectedClass();\n\n// END PAINTING \n };\n\n _ju.extend(_jp.Connection, _jp.OverlayCapableJsPlumbUIComponent, {\n applyType: function (t, doNotRepaint, typeMap) {\n\n var _connector = null;\n if (t.connector != null) {\n _connector = this.getCachedTypeItem(\"connector\", typeMap.connector);\n if (_connector == null) {\n _connector = this.prepareConnector(t.connector, typeMap.connector);\n this.cacheTypeItem(\"connector\", _connector, typeMap.connector);\n }\n this.setPreparedConnector(_connector);\n }\n\n // none of these things result in the creation of objects so can be ignored.\n if (t.detachable != null) {\n this.setDetachable(t.detachable);\n }\n if (t.reattach != null) {\n this.setReattach(t.reattach);\n }\n if (t.scope) {\n this.scope = t.scope;\n }\n\n if (t.cssClass != null && this.canvas) {\n this._jsPlumb.instance.addClass(this.canvas, t.cssClass);\n }\n\n var _anchors = null;\n // this also results in the creation of objects.\n if (t.anchor) {\n // note that even if the param was anchor, we store `anchors`.\n _anchors = this.getCachedTypeItem(\"anchors\", typeMap.anchor);\n if (_anchors == null) {\n _anchors = [ this._jsPlumb.instance.makeAnchor(t.anchor), this._jsPlumb.instance.makeAnchor(t.anchor) ];\n this.cacheTypeItem(\"anchors\", _anchors, typeMap.anchor);\n }\n }\n else if (t.anchors) {\n _anchors = this.getCachedTypeItem(\"anchors\", typeMap.anchors);\n if (_anchors == null) {\n _anchors = [\n this._jsPlumb.instance.makeAnchor(t.anchors[0]),\n this._jsPlumb.instance.makeAnchor(t.anchors[1])\n ];\n this.cacheTypeItem(\"anchors\", _anchors, typeMap.anchors);\n }\n }\n if (_anchors != null) {\n this.endpoints[0].anchor = _anchors[0];\n this.endpoints[1].anchor = _anchors[1];\n if (this.endpoints[1].anchor.isDynamic) {\n this._jsPlumb.instance.repaint(this.endpoints[1].elementId);\n }\n }\n\n _jp.OverlayCapableJsPlumbUIComponent.applyType(this, t);\n },\n addClass: function (c, informEndpoints) {\n if (informEndpoints) {\n this.endpoints[0].addClass(c);\n this.endpoints[1].addClass(c);\n if (this.suspendedEndpoint) {\n this.suspendedEndpoint.addClass(c);\n }\n }\n if (this.connector) {\n this.connector.addClass(c);\n }\n },\n removeClass: function (c, informEndpoints) {\n if (informEndpoints) {\n this.endpoints[0].removeClass(c);\n this.endpoints[1].removeClass(c);\n if (this.suspendedEndpoint) {\n this.suspendedEndpoint.removeClass(c);\n }\n }\n if (this.connector) {\n this.connector.removeClass(c);\n }\n },\n isVisible: function () {\n return this._jsPlumb.visible;\n },\n setVisible: function (v) {\n this._jsPlumb.visible = v;\n if (this.connector) {\n this.connector.setVisible(v);\n }\n this.repaint();\n },\n cleanup: function () {\n this.updateConnectedClass(true);\n this.endpoints = null;\n this.source = null;\n this.target = null;\n if (this.connector != null) {\n this.connector.cleanup(true);\n this.connector.destroy(true);\n }\n this.connector = null;\n },\n updateConnectedClass:function(remove) {\n if (this._jsPlumb) {\n _updateConnectedClass(this, this.source, this._jsPlumb.instance, remove);\n _updateConnectedClass(this, this.target, this._jsPlumb.instance, remove);\n }\n },\n setHover: function (state) {\n if (this.connector && this._jsPlumb && !this._jsPlumb.instance.isConnectionBeingDragged()) {\n this.connector.setHover(state);\n root.jsPlumb[state ? \"addClass\" : \"removeClass\"](this.source, this._jsPlumb.instance.hoverSourceClass);\n root.jsPlumb[state ? \"addClass\" : \"removeClass\"](this.target, this._jsPlumb.instance.hoverTargetClass);\n }\n },\n getUuids:function() {\n return [ this.endpoints[0].getUuid(), this.endpoints[1].getUuid() ];\n },\n getCost: function () {\n return this._jsPlumb ? this._jsPlumb.cost : -Infinity;\n },\n setCost: function (c) {\n this._jsPlumb.cost = c;\n },\n isDirected: function () {\n return this._jsPlumb.directed;\n },\n getConnector: function () {\n return this.connector;\n },\n prepareConnector:function(connectorSpec, typeId) {\n var connectorArgs = {\n _jsPlumb: this._jsPlumb.instance,\n cssClass: this._jsPlumb.params.cssClass,\n container: this._jsPlumb.params.container,\n \"pointer-events\": this._jsPlumb.params[\"pointer-events\"]\n },\n renderMode = this._jsPlumb.instance.getRenderMode(),\n connector;\n\n if (_ju.isString(connectorSpec)) {\n connector = makeConnector(this._jsPlumb.instance, renderMode, connectorSpec, connectorArgs, this);\n } // lets you use a string as shorthand.\n else if (_ju.isArray(connectorSpec)) {\n if (connectorSpec.length === 1) {\n connector = makeConnector(this._jsPlumb.instance, renderMode, connectorSpec[0], connectorArgs, this);\n }\n else {\n connector = makeConnector(this._jsPlumb.instance, renderMode, connectorSpec[0], _ju.merge(connectorSpec[1], connectorArgs), this);\n }\n }\n if (typeId != null) {\n connector.typeId = typeId;\n }\n return connector;\n },\n setPreparedConnector: function(connector, doNotRepaint, doNotChangeListenerComponent, typeId) {\n\n if (this.connector !== connector) {\n\n var previous, previousClasses = \"\";\n // the connector will not be cleaned up if it was set as part of a type, because `typeId` will be set on it\n // and we havent passed in `true` for \"force\" here.\n if (this.connector != null) {\n previous = this.connector;\n previousClasses = previous.getClass();\n this.connector.cleanup();\n this.connector.destroy();\n }\n\n this.connector = connector;\n if (typeId) {\n this.cacheTypeItem(\"connector\", connector, typeId);\n }\n\n this.canvas = this.connector.canvas;\n this.bgCanvas = this.connector.bgCanvas;\n\n // put classes from prior connector onto the canvas\n this.addClass(previousClasses);\n\n // new: instead of binding listeners per connector, we now just have one delegate on the container.\n // so for that handler we set the connection as the '_jsPlumb' member of the canvas element, and\n // bgCanvas, if it exists, which it does right now in the VML renderer, so it won't from v 2.0.0 onwards.\n if (this.canvas) {\n this.canvas._jsPlumb = this;\n }\n if (this.bgCanvas) {\n this.bgCanvas._jsPlumb = this;\n }\n\n if (previous != null) {\n var o = this.getOverlays();\n for (var i = 0; i < o.length; i++) {\n if (o[i].transfer) {\n o[i].transfer(this.connector);\n }\n }\n }\n\n if (!doNotChangeListenerComponent) {\n this.setListenerComponent(this.connector);\n }\n if (!doNotRepaint) {\n this.repaint();\n }\n }\n },\n setConnector: function (connectorSpec, doNotRepaint, doNotChangeListenerComponent, typeId) {\n var connector = this.prepareConnector(connectorSpec, typeId);\n this.setPreparedConnector(connector, doNotRepaint, doNotChangeListenerComponent, typeId);\n },\n paint: function (params) {\n\n if (!this._jsPlumb.instance.isSuspendDrawing() && this._jsPlumb.visible) {\n params = params || {};\n var timestamp = params.timestamp,\n // if the moving object is not the source we must transpose the two references.\n swap = false,\n tId = swap ? this.sourceId : this.targetId, sId = swap ? this.targetId : this.sourceId,\n tIdx = swap ? 0 : 1, sIdx = swap ? 1 : 0;\n\n if (timestamp == null || timestamp !== this._jsPlumb.lastPaintedAt) {\n var sourceInfo = this._jsPlumb.instance.updateOffset({elId:sId}).o,\n targetInfo = this._jsPlumb.instance.updateOffset({elId:tId}).o,\n sE = this.endpoints[sIdx], tE = this.endpoints[tIdx];\n\n var sAnchorP = sE.anchor.getCurrentLocation({xy: [sourceInfo.left, sourceInfo.top], wh: [sourceInfo.width, sourceInfo.height], element: sE, timestamp: timestamp}),\n tAnchorP = tE.anchor.getCurrentLocation({xy: [targetInfo.left, targetInfo.top], wh: [targetInfo.width, targetInfo.height], element: tE, timestamp: timestamp});\n\n this.connector.resetBounds();\n\n this.connector.compute({\n sourcePos: sAnchorP,\n targetPos: tAnchorP,\n sourceOrientation:sE.anchor.getOrientation(sE),\n targetOrientation:tE.anchor.getOrientation(tE),\n sourceEndpoint: this.endpoints[sIdx],\n targetEndpoint: this.endpoints[tIdx],\n \"stroke-width\": this._jsPlumb.paintStyleInUse.strokeWidth,\n sourceInfo: sourceInfo,\n targetInfo: targetInfo\n });\n\n var overlayExtents = { minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity };\n\n // compute overlays. we do this first so we can get their placements, and adjust the\n // container if needs be (if an overlay would be clipped)\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays.hasOwnProperty(i)) {\n var o = this._jsPlumb.overlays[i];\n if (o.isVisible()) {\n this._jsPlumb.overlayPlacements[i] = o.draw(this.connector, this._jsPlumb.paintStyleInUse, this.getAbsoluteOverlayPosition(o));\n overlayExtents.minX = Math.min(overlayExtents.minX, this._jsPlumb.overlayPlacements[i].minX);\n overlayExtents.maxX = Math.max(overlayExtents.maxX, this._jsPlumb.overlayPlacements[i].maxX);\n overlayExtents.minY = Math.min(overlayExtents.minY, this._jsPlumb.overlayPlacements[i].minY);\n overlayExtents.maxY = Math.max(overlayExtents.maxY, this._jsPlumb.overlayPlacements[i].maxY);\n }\n }\n }\n\n var lineWidth = parseFloat(this._jsPlumb.paintStyleInUse.strokeWidth || 1) / 2,\n outlineWidth = parseFloat(this._jsPlumb.paintStyleInUse.strokeWidth || 0),\n extents = {\n xmin: Math.min(this.connector.bounds.minX - (lineWidth + outlineWidth), overlayExtents.minX),\n ymin: Math.min(this.connector.bounds.minY - (lineWidth + outlineWidth), overlayExtents.minY),\n xmax: Math.max(this.connector.bounds.maxX + (lineWidth + outlineWidth), overlayExtents.maxX),\n ymax: Math.max(this.connector.bounds.maxY + (lineWidth + outlineWidth), overlayExtents.maxY)\n };\n // paint the connector.\n this.connector.paint(this._jsPlumb.paintStyleInUse, null, extents);\n // and then the overlays\n for (var j in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays.hasOwnProperty(j)) {\n var p = this._jsPlumb.overlays[j];\n if (p.isVisible()) {\n p.paint(this._jsPlumb.overlayPlacements[j], extents);\n }\n }\n }\n }\n this._jsPlumb.lastPaintedAt = timestamp;\n }\n },\n repaint: function (params) {\n var p = jsPlumb.extend(params || {}, {});\n p.elId = this.sourceId;\n this.paint(p);\n },\n prepareEndpoint: function (_jsPlumb, _newEndpoint, conn, existing, index, params, element, elementId) {\n var e;\n if (existing) {\n conn.endpoints[index] = existing;\n existing.addConnection(conn);\n } else {\n if (!params.endpoints) {\n params.endpoints = [ null, null ];\n }\n var ep = params.endpoints[index] || params.endpoint || _jsPlumb.Defaults.Endpoints[index] || _jp.Defaults.Endpoints[index] || _jsPlumb.Defaults.Endpoint || _jp.Defaults.Endpoint;\n if (!params.endpointStyles) {\n params.endpointStyles = [ null, null ];\n }\n if (!params.endpointHoverStyles) {\n params.endpointHoverStyles = [ null, null ];\n }\n var es = params.endpointStyles[index] || params.endpointStyle || _jsPlumb.Defaults.EndpointStyles[index] || _jp.Defaults.EndpointStyles[index] || _jsPlumb.Defaults.EndpointStyle || _jp.Defaults.EndpointStyle;\n // Endpoints derive their fill from the connector's stroke, if no fill was specified.\n if (es.fill == null && params.paintStyle != null) {\n es.fill = params.paintStyle.stroke;\n }\n\n if (es.outlineStroke == null && params.paintStyle != null) {\n es.outlineStroke = params.paintStyle.outlineStroke;\n }\n if (es.outlineWidth == null && params.paintStyle != null) {\n es.outlineWidth = params.paintStyle.outlineWidth;\n }\n\n var ehs = params.endpointHoverStyles[index] || params.endpointHoverStyle || _jsPlumb.Defaults.EndpointHoverStyles[index] || _jp.Defaults.EndpointHoverStyles[index] || _jsPlumb.Defaults.EndpointHoverStyle || _jp.Defaults.EndpointHoverStyle;\n // endpoint hover fill style is derived from connector's hover stroke style\n if (params.hoverPaintStyle != null) {\n if (ehs == null) {\n ehs = {};\n }\n if (ehs.fill == null) {\n ehs.fill = params.hoverPaintStyle.stroke;\n }\n }\n var a = params.anchors ? params.anchors[index] :\n params.anchor ? params.anchor :\n _makeAnchor(_jsPlumb.Defaults.Anchors[index], elementId, _jsPlumb) ||\n _makeAnchor(_jp.Defaults.Anchors[index], elementId, _jsPlumb) ||\n _makeAnchor(_jsPlumb.Defaults.Anchor, elementId, _jsPlumb) ||\n _makeAnchor(_jp.Defaults.Anchor, elementId, _jsPlumb),\n u = params.uuids ? params.uuids[index] : null;\n\n e = _newEndpoint({\n paintStyle: es, hoverPaintStyle: ehs, endpoint: ep, connections: [ conn ],\n uuid: u, anchor: a, source: element, scope: params.scope,\n reattach: params.reattach || _jsPlumb.Defaults.ReattachConnections,\n detachable: params.detachable || _jsPlumb.Defaults.ConnectionsDetachable\n });\n if (existing == null) {\n e.setDeleteOnEmpty(true);\n }\n conn.endpoints[index] = e;\n\n if (params.drawEndpoints === false) {\n e.setVisible(false, true, true);\n }\n\n }\n return e;\n }\n\n }); // END Connection class \n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the code for creating and manipulating anchors.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n\n var root = this,\n _ju = root.jsPlumbUtil,\n _jp = root.jsPlumb;\n\n //\n // manages anchors for all elements.\n //\n _jp.AnchorManager = function (params) {\n var _amEndpoints = {},\n continuousAnchorLocations = {},\n continuousAnchorOrientations = {},\n connectionsByElementId = {},\n self = this,\n anchorLists = {},\n jsPlumbInstance = params.jsPlumbInstance,\n floatingConnections = {},\n // used by placeAnchors function\n placeAnchorsOnLine = function (desc, elementDimensions, elementPosition, connections, horizontal, otherMultiplier, reverse) {\n var a = [], step = elementDimensions[horizontal ? 0 : 1] / (connections.length + 1);\n\n for (var i = 0; i < connections.length; i++) {\n var val = (i + 1) * step, other = otherMultiplier * elementDimensions[horizontal ? 1 : 0];\n if (reverse) {\n val = elementDimensions[horizontal ? 0 : 1] - val;\n }\n\n var dx = (horizontal ? val : other), x = elementPosition[0] + dx, xp = dx / elementDimensions[0],\n dy = (horizontal ? other : val), y = elementPosition[1] + dy, yp = dy / elementDimensions[1];\n\n a.push([ x, y, xp, yp, connections[i][1], connections[i][2] ]);\n }\n\n return a;\n },\n // used by edgeSortFunctions\n currySort = function (reverseAngles) {\n return function (a, b) {\n var r = true;\n if (reverseAngles) {\n r = a[0][0] < b[0][0];\n }\n else {\n r = a[0][0] > b[0][0];\n }\n return r === false ? -1 : 1;\n };\n },\n // used by edgeSortFunctions\n leftSort = function (a, b) {\n // first get adjusted values\n var p1 = a[0][0] < 0 ? -Math.PI - a[0][0] : Math.PI - a[0][0],\n p2 = b[0][0] < 0 ? -Math.PI - b[0][0] : Math.PI - b[0][0];\n if (p1 > p2) {\n return 1;\n }\n else {\n return -1;\n }\n },\n // used by placeAnchors\n edgeSortFunctions = {\n \"top\": function (a, b) {\n return a[0] > b[0] ? 1 : -1;\n },\n \"right\": currySort(true),\n \"bottom\": currySort(true),\n \"left\": leftSort\n },\n // used by placeAnchors\n _sortHelper = function (_array, _fn) {\n return _array.sort(_fn);\n },\n // used by AnchorManager.redraw\n placeAnchors = function (elementId, _anchorLists) {\n var cd = jsPlumbInstance.getCachedData(elementId), sS = cd.s, sO = cd.o,\n placeSomeAnchors = function (desc, elementDimensions, elementPosition, unsortedConnections, isHorizontal, otherMultiplier, orientation) {\n if (unsortedConnections.length > 0) {\n var sc = _sortHelper(unsortedConnections, edgeSortFunctions[desc]), // puts them in order based on the target element's pos on screen\n reverse = desc === \"right\" || desc === \"top\",\n anchors = placeAnchorsOnLine(desc, elementDimensions,\n elementPosition, sc,\n isHorizontal, otherMultiplier, reverse);\n\n // takes a computed anchor position and adjusts it for parent offset and scroll, then stores it.\n var _setAnchorLocation = function (endpoint, anchorPos) {\n continuousAnchorLocations[endpoint.id] = [ anchorPos[0], anchorPos[1], anchorPos[2], anchorPos[3] ];\n continuousAnchorOrientations[endpoint.id] = orientation;\n };\n\n for (var i = 0; i < anchors.length; i++) {\n var c = anchors[i][4], weAreSource = c.endpoints[0].elementId === elementId, weAreTarget = c.endpoints[1].elementId === elementId;\n if (weAreSource) {\n _setAnchorLocation(c.endpoints[0], anchors[i]);\n }\n if (weAreTarget) {\n _setAnchorLocation(c.endpoints[1], anchors[i]);\n }\n }\n }\n };\n\n placeSomeAnchors(\"bottom\", sS, [sO.left, sO.top], _anchorLists.bottom, true, 1, [0, 1]);\n placeSomeAnchors(\"top\", sS, [sO.left, sO.top], _anchorLists.top, true, 0, [0, -1]);\n placeSomeAnchors(\"left\", sS, [sO.left, sO.top], _anchorLists.left, false, 0, [-1, 0]);\n placeSomeAnchors(\"right\", sS, [sO.left, sO.top], _anchorLists.right, false, 1, [1, 0]);\n };\n\n this.reset = function () {\n _amEndpoints = {};\n connectionsByElementId = {};\n anchorLists = {};\n };\n this.addFloatingConnection = function (key, conn) {\n floatingConnections[key] = conn;\n };\n this.removeFloatingConnection = function (key) {\n delete floatingConnections[key];\n };\n this.newConnection = function (conn) {\n var sourceId = conn.sourceId, targetId = conn.targetId,\n ep = conn.endpoints,\n doRegisterTarget = true,\n registerConnection = function (otherIndex, otherEndpoint, otherAnchor, elId, c) {\n if ((sourceId === targetId) && otherAnchor.isContinuous) {\n // remove the target endpoint's canvas. we dont need it.\n conn._jsPlumb.instance.removeElement(ep[1].canvas);\n doRegisterTarget = false;\n }\n _ju.addToList(connectionsByElementId, elId, [c, otherEndpoint, otherAnchor.constructor === _jp.DynamicAnchor]);\n };\n\n registerConnection(0, ep[0], ep[0].anchor, targetId, conn);\n if (doRegisterTarget) {\n registerConnection(1, ep[1], ep[1].anchor, sourceId, conn);\n }\n };\n var removeEndpointFromAnchorLists = function (endpoint) {\n (function (list, eId) {\n if (list) { // transient anchors dont get entries in this list.\n var f = function (e) {\n return e[4] === eId;\n };\n _ju.removeWithFunction(list.top, f);\n _ju.removeWithFunction(list.left, f);\n _ju.removeWithFunction(list.bottom, f);\n _ju.removeWithFunction(list.right, f);\n }\n })(anchorLists[endpoint.elementId], endpoint.id);\n };\n this.connectionDetached = function (connInfo, doNotRedraw) {\n var connection = connInfo.connection || connInfo,\n sourceId = connInfo.sourceId,\n targetId = connInfo.targetId,\n ep = connection.endpoints,\n removeConnection = function (otherIndex, otherEndpoint, otherAnchor, elId, c) {\n _ju.removeWithFunction(connectionsByElementId[elId], function (_c) {\n return _c[0].id === c.id;\n });\n };\n\n removeConnection(1, ep[1], ep[1].anchor, sourceId, connection);\n removeConnection(0, ep[0], ep[0].anchor, targetId, connection);\n if (connection.floatingId) {\n removeConnection(connection.floatingIndex, connection.floatingEndpoint, connection.floatingEndpoint.anchor, connection.floatingId, connection);\n removeEndpointFromAnchorLists(connection.floatingEndpoint);\n }\n\n // remove from anchorLists\n removeEndpointFromAnchorLists(connection.endpoints[0]);\n removeEndpointFromAnchorLists(connection.endpoints[1]);\n\n if (!doNotRedraw) {\n self.redraw(connection.sourceId);\n if (connection.targetId !== connection.sourceId) {\n self.redraw(connection.targetId);\n }\n }\n };\n this.add = function (endpoint, elementId) {\n _ju.addToList(_amEndpoints, elementId, endpoint);\n };\n this.changeId = function (oldId, newId) {\n connectionsByElementId[newId] = connectionsByElementId[oldId];\n _amEndpoints[newId] = _amEndpoints[oldId];\n delete connectionsByElementId[oldId];\n delete _amEndpoints[oldId];\n };\n this.getConnectionsFor = function (elementId) {\n return connectionsByElementId[elementId] || [];\n };\n this.getEndpointsFor = function (elementId) {\n return _amEndpoints[elementId] || [];\n };\n this.deleteEndpoint = function (endpoint) {\n _ju.removeWithFunction(_amEndpoints[endpoint.elementId], function (e) {\n return e.id === endpoint.id;\n });\n removeEndpointFromAnchorLists(endpoint);\n };\n this.clearFor = function (elementId) {\n delete _amEndpoints[elementId];\n _amEndpoints[elementId] = [];\n };\n // updates the given anchor list by either updating an existing anchor's info, or adding it. this function\n // also removes the anchor from its previous list, if the edge it is on has changed.\n // all connections found along the way (those that are connected to one of the faces this function\n // operates on) are added to the connsToPaint list, as are their endpoints. in this way we know to repaint\n // them wthout having to calculate anything else about them.\n var _updateAnchorList = function (lists, theta, order, conn, aBoolean, otherElId, idx, reverse, edgeId, elId, connsToPaint, endpointsToPaint) {\n // first try to find the exact match, but keep track of the first index of a matching element id along the way.s\n var exactIdx = -1,\n firstMatchingElIdx = -1,\n endpoint = conn.endpoints[idx],\n endpointId = endpoint.id,\n oIdx = [1, 0][idx],\n values = [\n [ theta, order ],\n conn,\n aBoolean,\n otherElId,\n endpointId\n ],\n listToAddTo = lists[edgeId],\n listToRemoveFrom = endpoint._continuousAnchorEdge ? lists[endpoint._continuousAnchorEdge] : null,\n i,\n candidate;\n\n if (listToRemoveFrom) {\n var rIdx = _ju.findWithFunction(listToRemoveFrom, function (e) {\n return e[4] === endpointId;\n });\n if (rIdx !== -1) {\n listToRemoveFrom.splice(rIdx, 1);\n // get all connections from this list\n for (i = 0; i < listToRemoveFrom.length; i++) {\n candidate = listToRemoveFrom[i][1];\n _ju.addWithFunction(connsToPaint, candidate, function (c) {\n return c.id === candidate.id;\n });\n _ju.addWithFunction(endpointsToPaint, listToRemoveFrom[i][1].endpoints[idx], function (e) {\n return e.id === candidate.endpoints[idx].id;\n });\n _ju.addWithFunction(endpointsToPaint, listToRemoveFrom[i][1].endpoints[oIdx], function (e) {\n return e.id === candidate.endpoints[oIdx].id;\n });\n }\n }\n }\n\n for (i = 0; i < listToAddTo.length; i++) {\n candidate = listToAddTo[i][1];\n if (params.idx === 1 && listToAddTo[i][3] === otherElId && firstMatchingElIdx === -1) {\n firstMatchingElIdx = i;\n }\n _ju.addWithFunction(connsToPaint, candidate, function (c) {\n return c.id === candidate.id;\n });\n _ju.addWithFunction(endpointsToPaint, listToAddTo[i][1].endpoints[idx], function (e) {\n return e.id === candidate.endpoints[idx].id;\n });\n _ju.addWithFunction(endpointsToPaint, listToAddTo[i][1].endpoints[oIdx], function (e) {\n return e.id === candidate.endpoints[oIdx].id;\n });\n }\n if (exactIdx !== -1) {\n listToAddTo[exactIdx] = values;\n }\n else {\n var insertIdx = reverse ? firstMatchingElIdx !== -1 ? firstMatchingElIdx : 0 : listToAddTo.length; // of course we will get this from having looked through the array shortly.\n listToAddTo.splice(insertIdx, 0, values);\n }\n\n // store this for next time.\n endpoint._continuousAnchorEdge = edgeId;\n };\n\n //\n // find the entry in an endpoint's list for this connection and update its target endpoint\n // with the current target in the connection.\n // This method and sourceChanged need to be folder into one.\n //\n this.updateOtherEndpoint = function (sourceElId, oldTargetId, newTargetId, connection) {\n var sIndex = _ju.findWithFunction(connectionsByElementId[sourceElId], function (i) {\n return i[0].id === connection.id;\n }),\n tIndex = _ju.findWithFunction(connectionsByElementId[oldTargetId], function (i) {\n return i[0].id === connection.id;\n });\n\n // update or add data for source\n if (sIndex !== -1) {\n connectionsByElementId[sourceElId][sIndex][0] = connection;\n connectionsByElementId[sourceElId][sIndex][1] = connection.endpoints[1];\n connectionsByElementId[sourceElId][sIndex][2] = connection.endpoints[1].anchor.constructor === _jp.DynamicAnchor;\n }\n\n // remove entry for previous target (if there)\n if (tIndex > -1) {\n connectionsByElementId[oldTargetId].splice(tIndex, 1);\n // add entry for new target\n _ju.addToList(connectionsByElementId, newTargetId, [connection, connection.endpoints[0], connection.endpoints[0].anchor.constructor === _jp.DynamicAnchor]);\n }\n\n connection.updateConnectedClass();\n };\n\n //\n // notification that the connection given has changed source from the originalId to the newId.\n // This involves:\n // 1. removing the connection from the list of connections stored for the originalId\n // 2. updating the source information for the target of the connection\n // 3. re-registering the connection in connectionsByElementId with the newId\n //\n this.sourceChanged = function (originalId, newId, connection, newElement) {\n if (originalId !== newId) {\n\n connection.sourceId = newId;\n connection.source = newElement;\n\n // remove the entry that points from the old source to the target\n _ju.removeWithFunction(connectionsByElementId[originalId], function (info) {\n return info[0].id === connection.id;\n });\n // find entry for target and update it\n var tIdx = _ju.findWithFunction(connectionsByElementId[connection.targetId], function (i) {\n return i[0].id === connection.id;\n });\n if (tIdx > -1) {\n connectionsByElementId[connection.targetId][tIdx][0] = connection;\n connectionsByElementId[connection.targetId][tIdx][1] = connection.endpoints[0];\n connectionsByElementId[connection.targetId][tIdx][2] = connection.endpoints[0].anchor.constructor === _jp.DynamicAnchor;\n }\n // add entry for new source\n _ju.addToList(connectionsByElementId, newId, [connection, connection.endpoints[1], connection.endpoints[1].anchor.constructor === _jp.DynamicAnchor]);\n\n // TODO SP not final on this yet. when a user drags an existing connection and it turns into a self\n // loop, then this code hides the target endpoint (by removing it from the DOM) But I think this should\n // occur only if the anchor is Continuous\n if (connection.endpoints[1].anchor.isContinuous) {\n if (connection.source === connection.target) {\n connection._jsPlumb.instance.removeElement(connection.endpoints[1].canvas);\n }\n else {\n if (connection.endpoints[1].canvas.parentNode == null) {\n connection._jsPlumb.instance.appendElement(connection.endpoints[1].canvas);\n }\n }\n }\n\n connection.updateConnectedClass();\n }\n };\n\n //\n // moves the given endpoint from `currentId` to `element`.\n // This involves:\n //\n // 1. changing the key in _amEndpoints under which the endpoint is stored\n // 2. changing the source or target values in all of the endpoint's connections\n // 3. changing the array in connectionsByElementId in which the endpoint's connections\n // are stored (done by either sourceChanged or updateOtherEndpoint)\n //\n this.rehomeEndpoint = function (ep, currentId, element) {\n var eps = _amEndpoints[currentId] || [],\n elementId = jsPlumbInstance.getId(element);\n\n if (elementId !== currentId) {\n var idx = eps.indexOf(ep);\n if (idx > -1) {\n var _ep = eps.splice(idx, 1)[0];\n self.add(_ep, elementId);\n }\n }\n\n for (var i = 0; i < ep.connections.length; i++) {\n if (ep.connections[i].sourceId === currentId) {\n self.sourceChanged(currentId, ep.elementId, ep.connections[i], ep.element);\n }\n else if (ep.connections[i].targetId === currentId) {\n ep.connections[i].targetId = ep.elementId;\n ep.connections[i].target = ep.element;\n self.updateOtherEndpoint(ep.connections[i].sourceId, currentId, ep.elementId, ep.connections[i]);\n }\n }\n };\n\n this.redraw = function (elementId, ui, timestamp, offsetToUI, clearEdits, doNotRecalcEndpoint) {\n\n if (!jsPlumbInstance.isSuspendDrawing()) {\n // get all the endpoints for this element\n var ep = _amEndpoints[elementId] || [],\n endpointConnections = connectionsByElementId[elementId] || [],\n connectionsToPaint = [],\n endpointsToPaint = [],\n anchorsToUpdate = [];\n\n timestamp = timestamp || jsPlumbInstance.timestamp();\n // offsetToUI are values that would have been calculated in the dragManager when registering\n // an endpoint for an element that had a parent (somewhere in the hierarchy) that had been\n // registered as draggable.\n offsetToUI = offsetToUI || {left: 0, top: 0};\n if (ui) {\n ui = {\n left: ui.left + offsetToUI.left,\n top: ui.top + offsetToUI.top\n };\n }\n\n // valid for one paint cycle.\n var myOffset = jsPlumbInstance.updateOffset({ elId: elementId, offset: ui, recalc: false, timestamp: timestamp }),\n orientationCache = {};\n\n // actually, first we should compute the orientation of this element to all other elements to which\n // this element is connected with a continuous anchor (whether both ends of the connection have\n // a continuous anchor or just one)\n\n for (var i = 0; i < endpointConnections.length; i++) {\n var conn = endpointConnections[i][0],\n sourceId = conn.sourceId,\n targetId = conn.targetId,\n sourceContinuous = conn.endpoints[0].anchor.isContinuous,\n targetContinuous = conn.endpoints[1].anchor.isContinuous;\n\n if (sourceContinuous || targetContinuous) {\n var oKey = sourceId + \"_\" + targetId,\n o = orientationCache[oKey],\n oIdx = conn.sourceId === elementId ? 1 : 0;\n\n if (sourceContinuous && !anchorLists[sourceId]) {\n anchorLists[sourceId] = { top: [], right: [], bottom: [], left: [] };\n }\n if (targetContinuous && !anchorLists[targetId]) {\n anchorLists[targetId] = { top: [], right: [], bottom: [], left: [] };\n }\n\n if (elementId !== targetId) {\n jsPlumbInstance.updateOffset({ elId: targetId, timestamp: timestamp });\n }\n if (elementId !== sourceId) {\n jsPlumbInstance.updateOffset({ elId: sourceId, timestamp: timestamp });\n }\n\n var td = jsPlumbInstance.getCachedData(targetId),\n sd = jsPlumbInstance.getCachedData(sourceId);\n\n if (targetId === sourceId && (sourceContinuous || targetContinuous)) {\n // here we may want to improve this by somehow determining the face we'd like\n // to put the connector on. ideally, when drawing, the face should be calculated\n // by determining which face is closest to the point at which the mouse button\n // was released. for now, we're putting it on the top face.\n _updateAnchorList( anchorLists[sourceId], -Math.PI / 2, 0, conn, false, targetId, 0, false, \"top\", sourceId, connectionsToPaint, endpointsToPaint);\n _updateAnchorList( anchorLists[targetId], -Math.PI / 2, 0, conn, false, sourceId, 1, false, \"top\", targetId, connectionsToPaint, endpointsToPaint);\n }\n else {\n if (!o) {\n o = this.calculateOrientation(sourceId, targetId, sd.o, td.o, conn.endpoints[0].anchor, conn.endpoints[1].anchor, conn);\n orientationCache[oKey] = o;\n // this would be a performance enhancement, but the computed angles need to be clamped to\n //the (-PI/2 -> PI/2) range in order for the sorting to work properly.\n /* orientationCache[oKey2] = {\n orientation:o.orientation,\n a:[o.a[1], o.a[0]],\n theta:o.theta + Math.PI,\n theta2:o.theta2 + Math.PI\n };*/\n }\n if (sourceContinuous) {\n _updateAnchorList(anchorLists[sourceId], o.theta, 0, conn, false, targetId, 0, false, o.a[0], sourceId, connectionsToPaint, endpointsToPaint);\n }\n if (targetContinuous) {\n _updateAnchorList(anchorLists[targetId], o.theta2, -1, conn, true, sourceId, 1, true, o.a[1], targetId, connectionsToPaint, endpointsToPaint);\n }\n }\n\n if (sourceContinuous) {\n _ju.addWithFunction(anchorsToUpdate, sourceId, function (a) {\n return a === sourceId;\n });\n }\n if (targetContinuous) {\n _ju.addWithFunction(anchorsToUpdate, targetId, function (a) {\n return a === targetId;\n });\n }\n _ju.addWithFunction(connectionsToPaint, conn, function (c) {\n return c.id === conn.id;\n });\n if ((sourceContinuous && oIdx === 0) || (targetContinuous && oIdx === 1)) {\n _ju.addWithFunction(endpointsToPaint, conn.endpoints[oIdx], function (e) {\n return e.id === conn.endpoints[oIdx].id;\n });\n }\n }\n }\n\n // place Endpoints whose anchors are continuous but have no Connections\n for (i = 0; i < ep.length; i++) {\n if (ep[i].connections.length === 0 && ep[i].anchor.isContinuous) {\n if (!anchorLists[elementId]) {\n anchorLists[elementId] = { top: [], right: [], bottom: [], left: [] };\n }\n _updateAnchorList(anchorLists[elementId], -Math.PI / 2, 0, {endpoints: [ep[i], ep[i]], paint: function () {\n }}, false, elementId, 0, false, ep[i].anchor.getDefaultFace(), elementId, connectionsToPaint, endpointsToPaint);\n _ju.addWithFunction(anchorsToUpdate, elementId, function (a) {\n return a === elementId;\n });\n }\n }\n\n // now place all the continuous anchors we need to;\n for (i = 0; i < anchorsToUpdate.length; i++) {\n placeAnchors(anchorsToUpdate[i], anchorLists[anchorsToUpdate[i]]);\n }\n\n // now that continuous anchors have been placed, paint all the endpoints for this element\n for (i = 0; i < ep.length; i++) {\n ep[i].paint({ timestamp: timestamp, offset: myOffset, dimensions: myOffset.s, recalc: doNotRecalcEndpoint !== true });\n }\n\n // ... and any other endpoints we came across as a result of the continuous anchors.\n for (i = 0; i < endpointsToPaint.length; i++) {\n var cd = jsPlumbInstance.getCachedData(endpointsToPaint[i].elementId);\n //endpointsToPaint[i].paint({ timestamp: timestamp, offset: cd, dimensions: cd.s });\n endpointsToPaint[i].paint({ timestamp: null, offset: cd, dimensions: cd.s });\n }\n\n // paint all the standard and \"dynamic connections\", which are connections whose other anchor is\n // static and therefore does need to be recomputed; we make sure that happens only one time.\n\n // TODO we could have compiled a list of these in the first pass through connections; might save some time.\n for (i = 0; i < endpointConnections.length; i++) {\n var otherEndpoint = endpointConnections[i][1];\n if (otherEndpoint.anchor.constructor === _jp.DynamicAnchor) {\n otherEndpoint.paint({ elementWithPrecedence: elementId, timestamp: timestamp });\n _ju.addWithFunction(connectionsToPaint, endpointConnections[i][0], function (c) {\n return c.id === endpointConnections[i][0].id;\n });\n // all the connections for the other endpoint now need to be repainted\n for (var k = 0; k < otherEndpoint.connections.length; k++) {\n if (otherEndpoint.connections[k] !== endpointConnections[i][0]) {\n _ju.addWithFunction(connectionsToPaint, otherEndpoint.connections[k], function (c) {\n return c.id === otherEndpoint.connections[k].id;\n });\n }\n }\n } else {\n _ju.addWithFunction(connectionsToPaint, endpointConnections[i][0], function (c) {\n return c.id === endpointConnections[i][0].id;\n });\n }\n }\n\n // paint current floating connection for this element, if there is one.\n var fc = floatingConnections[elementId];\n if (fc) {\n fc.paint({timestamp: timestamp, recalc: false, elId: elementId});\n }\n\n // paint all the connections\n for (i = 0; i < connectionsToPaint.length; i++) {\n connectionsToPaint[i].paint({elId: elementId, timestamp: null, recalc: false, clearEdits: clearEdits});\n }\n }\n };\n\n var ContinuousAnchor = function (anchorParams) {\n _ju.EventGenerator.apply(this);\n this.type = \"Continuous\";\n this.isDynamic = true;\n this.isContinuous = true;\n var faces = anchorParams.faces || [\"top\", \"right\", \"bottom\", \"left\"],\n clockwise = !(anchorParams.clockwise === false),\n availableFaces = { },\n opposites = { \"top\": \"bottom\", \"right\": \"left\", \"left\": \"right\", \"bottom\": \"top\" },\n clockwiseOptions = { \"top\": \"right\", \"right\": \"bottom\", \"left\": \"top\", \"bottom\": \"left\" },\n antiClockwiseOptions = { \"top\": \"left\", \"right\": \"top\", \"left\": \"bottom\", \"bottom\": \"right\" },\n secondBest = clockwise ? clockwiseOptions : antiClockwiseOptions,\n lastChoice = clockwise ? antiClockwiseOptions : clockwiseOptions,\n cssClass = anchorParams.cssClass || \"\",\n _currentFace = null, _lockedFace = null, X_AXIS_FACES = [\"left\", \"right\"], Y_AXIS_FACES = [\"top\", \"bottom\"],\n _lockedAxis = null;\n\n for (var i = 0; i < faces.length; i++) {\n availableFaces[faces[i]] = true;\n }\n\n this.getDefaultFace = function () {\n return faces.length === 0 ? \"top\" : faces[0];\n };\n\n this.isRelocatable = function() { return true; };\n this.isSnapOnRelocate = function() { return true; };\n\n // if the given edge is supported, returns it. otherwise looks for a substitute that _is_\n // supported. if none supported we also return the request edge.\n this.verifyEdge = function (edge) {\n if (availableFaces[edge]) {\n return edge;\n }\n else if (availableFaces[opposites[edge]]) {\n return opposites[edge];\n }\n else if (availableFaces[secondBest[edge]]) {\n return secondBest[edge];\n }\n else if (availableFaces[lastChoice[edge]]) {\n return lastChoice[edge];\n }\n return edge; // we have to give them something.\n };\n\n this.isEdgeSupported = function (edge) {\n return _lockedAxis == null ?\n\n (_lockedFace == null ? availableFaces[edge] === true : _lockedFace === edge)\n\n : _lockedAxis.indexOf(edge) !== -1;\n };\n\n this.setCurrentFace = function(face, overrideLock) {\n _currentFace = face;\n // if currently locked, and the user wants to override, do that.\n if (overrideLock && _lockedFace != null) {\n _lockedFace = _currentFace;\n }\n };\n\n this.getCurrentFace = function() { return _currentFace; };\n this.getSupportedFaces = function() {\n var af = [];\n for (var k in availableFaces) {\n if (availableFaces[k]) {\n af.push(k);\n }\n }\n return af;\n };\n\n this.lock = function() {\n _lockedFace = _currentFace;\n };\n this.unlock = function() {\n _lockedFace = null;\n };\n this.isLocked = function() {\n return _lockedFace != null;\n };\n\n this.lockCurrentAxis = function() {\n if (_currentFace != null) {\n _lockedAxis = (_currentFace === \"left\" || _currentFace === \"right\") ? X_AXIS_FACES : Y_AXIS_FACES;\n }\n };\n\n this.unlockCurrentAxis = function() {\n _lockedAxis = null;\n };\n\n this.compute = function (params) {\n return continuousAnchorLocations[params.element.id] || [0, 0];\n };\n this.getCurrentLocation = function (params) {\n return continuousAnchorLocations[params.element.id] || [0, 0];\n };\n this.getOrientation = function (endpoint) {\n return continuousAnchorOrientations[endpoint.id] || [0, 0];\n };\n this.getCssClass = function () {\n return cssClass;\n };\n };\n\n // continuous anchors\n jsPlumbInstance.continuousAnchorFactory = {\n get: function (params) {\n return new ContinuousAnchor(params);\n },\n clear: function (elementId) {\n delete continuousAnchorLocations[elementId];\n }\n };\n };\n\n _jp.AnchorManager.prototype.calculateOrientation = function (sourceId, targetId, sd, td, sourceAnchor, targetAnchor) {\n\n var Orientation = { HORIZONTAL: \"horizontal\", VERTICAL: \"vertical\", DIAGONAL: \"diagonal\", IDENTITY: \"identity\" },\n axes = [\"left\", \"top\", \"right\", \"bottom\"];\n\n if (sourceId === targetId) {\n return {\n orientation: Orientation.IDENTITY,\n a: [\"top\", \"top\"]\n };\n }\n\n var theta = Math.atan2((td.centery - sd.centery), (td.centerx - sd.centerx)),\n theta2 = Math.atan2((sd.centery - td.centery), (sd.centerx - td.centerx));\n\n// --------------------------------------------------------------------------------------\n\n // improved face calculation. get midpoints of each face for source and target, then put in an array with all combinations of\n // source/target faces. sort this array by distance between midpoints. the entry at index 0 is our preferred option. we can\n // go through the array one by one until we find an entry in which each requested face is supported.\n var candidates = [], midpoints = { };\n (function (types, dim) {\n for (var i = 0; i < types.length; i++) {\n midpoints[types[i]] = {\n \"left\": [ dim[i].left, dim[i].centery ],\n \"right\": [ dim[i].right, dim[i].centery ],\n \"top\": [ dim[i].centerx, dim[i].top ],\n \"bottom\": [ dim[i].centerx , dim[i].bottom]\n };\n }\n })([ \"source\", \"target\" ], [ sd, td ]);\n\n for (var sf = 0; sf < axes.length; sf++) {\n for (var tf = 0; tf < axes.length; tf++) {\n candidates.push({\n source: axes[sf],\n target: axes[tf],\n dist: Biltong.lineLength(midpoints.source[axes[sf]], midpoints.target[axes[tf]])\n });\n }\n }\n\n candidates.sort(function (a, b) {\n return a.dist < b.dist ? -1 : a.dist > b.dist ? 1 : 0;\n });\n\n // now go through this list and try to get an entry that satisfies both (there will be one, unless one of the anchors\n // declares no available faces)\n var sourceEdge = candidates[0].source, targetEdge = candidates[0].target;\n for (var i = 0; i < candidates.length; i++) {\n\n if (!sourceAnchor.isContinuous || sourceAnchor.isEdgeSupported(candidates[i].source)) {\n sourceEdge = candidates[i].source;\n }\n else {\n sourceEdge = null;\n }\n\n if (!targetAnchor.isContinuous || targetAnchor.isEdgeSupported(candidates[i].target)) {\n targetEdge = candidates[i].target;\n }\n else {\n targetEdge = null;\n }\n\n if (sourceEdge != null && targetEdge != null) {\n break;\n }\n }\n\n if (sourceAnchor.isContinuous) {\n sourceAnchor.setCurrentFace(sourceEdge);\n }\n\n if (targetAnchor.isContinuous) {\n targetAnchor.setCurrentFace(targetEdge);\n }\n\n// --------------------------------------------------------------------------------------\n\n return {\n a: [ sourceEdge, targetEdge ],\n theta: theta,\n theta2: theta2\n };\n };\n\n /**\n * Anchors model a position on some element at which an Endpoint may be located. They began as a first class citizen of jsPlumb, ie. a user\n * was required to create these themselves, but over time this has been replaced by the concept of referring to them either by name (eg. \"TopMiddle\"),\n * or by an array describing their coordinates (eg. [ 0, 0.5, 0, -1 ], which is the same as \"TopMiddle\"). jsPlumb now handles all of the\n * creation of Anchors without user intervention.\n */\n _jp.Anchor = function (params) {\n this.x = params.x || 0;\n this.y = params.y || 0;\n this.elementId = params.elementId;\n this.cssClass = params.cssClass || \"\";\n this.userDefinedLocation = null;\n this.orientation = params.orientation || [ 0, 0 ];\n this.lastReturnValue = null;\n this.offsets = params.offsets || [ 0, 0 ];\n this.timestamp = null;\n\n var relocatable = params.relocatable !== false;\n this.isRelocatable = function() { return relocatable; };\n this.setRelocatable = function(_relocatable) { relocatable = _relocatable; };\n var snapOnRelocate = params.snapOnRelocate !== false;\n this.isSnapOnRelocate = function() { return snapOnRelocate; };\n\n var locked = false;\n this.lock = function() { locked = true; };\n this.unlock = function() { locked = false; };\n this.isLocked = function() { return locked; };\n\n _ju.EventGenerator.apply(this);\n\n this.compute = function (params) {\n\n var xy = params.xy, wh = params.wh, timestamp = params.timestamp;\n\n if (params.clearUserDefinedLocation) {\n this.userDefinedLocation = null;\n }\n\n if (timestamp && timestamp === this.timestamp) {\n return this.lastReturnValue;\n }\n\n if (this.userDefinedLocation != null) {\n this.lastReturnValue = this.userDefinedLocation;\n }\n else {\n this.lastReturnValue = [ xy[0] + (this.x * wh[0]) + this.offsets[0], xy[1] + (this.y * wh[1]) + this.offsets[1], this.x, this.y ];\n }\n\n this.timestamp = timestamp;\n return this.lastReturnValue;\n };\n\n this.getCurrentLocation = function (params) {\n params = params || {};\n return (this.lastReturnValue == null || (params.timestamp != null && this.timestamp !== params.timestamp)) ? this.compute(params) : this.lastReturnValue;\n };\n\n this.setPosition = function(x, y, ox, oy, overrideLock) {\n if (!locked || overrideLock) {\n this.x = x;\n this.y = y;\n this.orientation = [ ox, oy ];\n this.lastReturnValue = null;\n }\n };\n };\n _ju.extend(_jp.Anchor, _ju.EventGenerator, {\n equals: function (anchor) {\n if (!anchor) {\n return false;\n }\n var ao = anchor.getOrientation(),\n o = this.getOrientation();\n return this.x === anchor.x && this.y === anchor.y && this.offsets[0] === anchor.offsets[0] && this.offsets[1] === anchor.offsets[1] && o[0] === ao[0] && o[1] === ao[1];\n },\n getUserDefinedLocation: function () {\n return this.userDefinedLocation;\n },\n setUserDefinedLocation: function (l) {\n this.userDefinedLocation = l;\n },\n clearUserDefinedLocation: function () {\n this.userDefinedLocation = null;\n },\n getOrientation: function () {\n return this.orientation;\n },\n getCssClass: function () {\n return this.cssClass;\n }\n });\n\n /**\n * An Anchor that floats. its orientation is computed dynamically from\n * its position relative to the anchor it is floating relative to. It is used when creating\n * a connection through drag and drop.\n *\n * TODO FloatingAnchor could totally be refactored to extend Anchor just slightly.\n */\n _jp.FloatingAnchor = function (params) {\n\n _jp.Anchor.apply(this, arguments);\n\n // this is the anchor that this floating anchor is referenced to for\n // purposes of calculating the orientation.\n var ref = params.reference,\n // the canvas this refers to.\n refCanvas = params.referenceCanvas,\n size = _jp.getSize(refCanvas),\n // these are used to store the current relative position of our\n // anchor wrt the reference anchor. they only indicate\n // direction, so have a value of 1 or -1 (or, very rarely, 0). these\n // values are written by the compute method, and read\n // by the getOrientation method.\n xDir = 0, yDir = 0,\n // temporary member used to store an orientation when the floating\n // anchor is hovering over another anchor.\n orientation = null,\n _lastResult = null;\n\n // clear from parent. we want floating anchor orientation to always be computed.\n this.orientation = null;\n\n // set these to 0 each; they are used by certain types of connectors in the loopback case,\n // when the connector is trying to clear the element it is on. but for floating anchor it's not\n // very important.\n this.x = 0;\n this.y = 0;\n\n this.isFloating = true;\n\n this.compute = function (params) {\n var xy = params.xy,\n result = [ xy[0] + (size[0] / 2), xy[1] + (size[1] / 2) ]; // return origin of the element. we may wish to improve this so that any object can be the drag proxy.\n _lastResult = result;\n return result;\n };\n\n this.getOrientation = function (_endpoint) {\n if (orientation) {\n return orientation;\n }\n else {\n var o = ref.getOrientation(_endpoint);\n // here we take into account the orientation of the other\n // anchor: if it declares zero for some direction, we declare zero too. this might not be the most awesome. perhaps we can come\n // up with a better way. it's just so that the line we draw looks like it makes sense. maybe this wont make sense.\n return [ Math.abs(o[0]) * xDir * -1,\n Math.abs(o[1]) * yDir * -1 ];\n }\n };\n\n /**\n * notification the endpoint associated with this anchor is hovering\n * over another anchor; we want to assume that anchor's orientation\n * for the duration of the hover.\n */\n this.over = function (anchor, endpoint) {\n orientation = anchor.getOrientation(endpoint);\n };\n\n /**\n * notification the endpoint associated with this anchor is no\n * longer hovering over another anchor; we should resume calculating\n * orientation as we normally do.\n */\n this.out = function () {\n orientation = null;\n };\n\n this.getCurrentLocation = function (params) {\n return _lastResult == null ? this.compute(params) : _lastResult;\n };\n };\n _ju.extend(_jp.FloatingAnchor, _jp.Anchor);\n\n var _convertAnchor = function (anchor, jsPlumbInstance, elementId) {\n return anchor.constructor === _jp.Anchor ? anchor : jsPlumbInstance.makeAnchor(anchor, elementId, jsPlumbInstance);\n };\n\n /* \n * A DynamicAnchor is an Anchor that contains a list of other Anchors, which it cycles\n * through at compute time to find the one that is located closest to\n * the center of the target element, and returns that Anchor's compute\n * method result. this causes endpoints to follow each other with\n * respect to the orientation of their target elements, which is a useful\n * feature for some applications.\n * \n */\n _jp.DynamicAnchor = function (params) {\n _jp.Anchor.apply(this, arguments);\n\n this.isDynamic = true;\n this.anchors = [];\n this.elementId = params.elementId;\n this.jsPlumbInstance = params.jsPlumbInstance;\n\n for (var i = 0; i < params.anchors.length; i++) {\n this.anchors[i] = _convertAnchor(params.anchors[i], this.jsPlumbInstance, this.elementId);\n }\n\n this.getAnchors = function () {\n return this.anchors;\n };\n\n var _curAnchor = this.anchors.length > 0 ? this.anchors[0] : null,\n _lastAnchor = _curAnchor,\n self = this,\n\n // helper method to calculate the distance between the centers of the two elements.\n _distance = function (anchor, cx, cy, xy, wh) {\n var ax = xy[0] + (anchor.x * wh[0]), ay = xy[1] + (anchor.y * wh[1]),\n acx = xy[0] + (wh[0] / 2), acy = xy[1] + (wh[1] / 2);\n return (Math.sqrt(Math.pow(cx - ax, 2) + Math.pow(cy - ay, 2)) +\n Math.sqrt(Math.pow(acx - ax, 2) + Math.pow(acy - ay, 2)));\n },\n // default method uses distance between element centers. you can provide your own method in the dynamic anchor\n // constructor (and also to jsPlumb.makeDynamicAnchor). the arguments to it are four arrays:\n // xy - xy loc of the anchor's element\n // wh - anchor's element's dimensions\n // txy - xy loc of the element of the other anchor in the connection\n // twh - dimensions of the element of the other anchor in the connection.\n // anchors - the list of selectable anchors\n _anchorSelector = params.selector || function (xy, wh, txy, twh, anchors) {\n var cx = txy[0] + (twh[0] / 2), cy = txy[1] + (twh[1] / 2);\n var minIdx = -1, minDist = Infinity;\n for (var i = 0; i < anchors.length; i++) {\n var d = _distance(anchors[i], cx, cy, xy, wh);\n if (d < minDist) {\n minIdx = i + 0;\n minDist = d;\n }\n }\n return anchors[minIdx];\n };\n\n this.compute = function (params) {\n var xy = params.xy, wh = params.wh, txy = params.txy, twh = params.twh;\n\n this.timestamp = params.timestamp;\n\n var udl = self.getUserDefinedLocation();\n if (udl != null) {\n return udl;\n }\n\n // if anchor is locked or an opposite element was not given, we\n // maintain our state. anchor will be locked\n // if it is the source of a drag and drop.\n if (this.isLocked() || txy == null || twh == null) {\n return _curAnchor.compute(params);\n }\n else {\n params.timestamp = null; // otherwise clear this, i think. we want the anchor to compute.\n }\n\n _curAnchor = _anchorSelector(xy, wh, txy, twh, this.anchors);\n this.x = _curAnchor.x;\n this.y = _curAnchor.y;\n\n if (_curAnchor !== _lastAnchor) {\n this.fire(\"anchorChanged\", _curAnchor);\n }\n\n _lastAnchor = _curAnchor;\n\n return _curAnchor.compute(params);\n };\n\n this.getCurrentLocation = function (params) {\n return this.getUserDefinedLocation() || (_curAnchor != null ? _curAnchor.getCurrentLocation(params) : null);\n };\n\n this.getOrientation = function (_endpoint) {\n return _curAnchor != null ? _curAnchor.getOrientation(_endpoint) : [ 0, 0 ];\n };\n this.over = function (anchor, endpoint) {\n if (_curAnchor != null) {\n _curAnchor.over(anchor, endpoint);\n }\n };\n this.out = function () {\n if (_curAnchor != null) {\n _curAnchor.out();\n }\n };\n\n this.setAnchor = function(a) {\n _curAnchor = a;\n };\n\n this.getCssClass = function () {\n return (_curAnchor && _curAnchor.getCssClass()) || \"\";\n };\n\n /**\n * Attempt to match an anchor with the given coordinates and then set it.\n * @param coords\n * @returns true if matching anchor found, false otherwise.\n */\n this.setAnchorCoordinates = function(coords) {\n var idx = jsPlumbUtil.findWithFunction(this.anchors, function(a) {\n return a.x === coords[0] && a.y === coords[1];\n });\n if (idx !== -1) {\n this.setAnchor(this.anchors[idx]);\n return true;\n } else {\n return false;\n }\n };\n };\n _ju.extend(_jp.DynamicAnchor, _jp.Anchor);\n\n// -------- basic anchors ------------------ \n var _curryAnchor = function (x, y, ox, oy, type, fnInit) {\n _jp.Anchors[type] = function (params) {\n var a = params.jsPlumbInstance.makeAnchor([ x, y, ox, oy, 0, 0 ], params.elementId, params.jsPlumbInstance);\n a.type = type;\n if (fnInit) {\n fnInit(a, params);\n }\n return a;\n };\n };\n\n _curryAnchor(0.5, 0, 0, -1, \"TopCenter\");\n _curryAnchor(0.5, 1, 0, 1, \"BottomCenter\");\n _curryAnchor(0, 0.5, -1, 0, \"LeftMiddle\");\n _curryAnchor(1, 0.5, 1, 0, \"RightMiddle\");\n\n _curryAnchor(0.5, 0, 0, -1, \"Top\");\n _curryAnchor(0.5, 1, 0, 1, \"Bottom\");\n _curryAnchor(0, 0.5, -1, 0, \"Left\");\n _curryAnchor(1, 0.5, 1, 0, \"Right\");\n _curryAnchor(0.5, 0.5, 0, 0, \"Center\");\n _curryAnchor(1, 0, 0, -1, \"TopRight\");\n _curryAnchor(1, 1, 0, 1, \"BottomRight\");\n _curryAnchor(0, 0, 0, -1, \"TopLeft\");\n _curryAnchor(0, 1, 0, 1, \"BottomLeft\");\n\n// ------- dynamic anchors ------------------- \n\n // default dynamic anchors chooses from Top, Right, Bottom, Left\n _jp.Defaults.DynamicAnchors = function (params) {\n return params.jsPlumbInstance.makeAnchors([\"TopCenter\", \"RightMiddle\", \"BottomCenter\", \"LeftMiddle\"], params.elementId, params.jsPlumbInstance);\n };\n\n // default dynamic anchors bound to name 'AutoDefault'\n _jp.Anchors.AutoDefault = function (params) {\n var a = params.jsPlumbInstance.makeDynamicAnchor(_jp.Defaults.DynamicAnchors(params));\n a.type = \"AutoDefault\";\n return a;\n };\n\n// ------- continuous anchors ------------------- \n\n var _curryContinuousAnchor = function (type, faces) {\n _jp.Anchors[type] = function (params) {\n var a = params.jsPlumbInstance.makeAnchor([\"Continuous\", { faces: faces }], params.elementId, params.jsPlumbInstance);\n a.type = type;\n return a;\n };\n };\n\n _jp.Anchors.Continuous = function (params) {\n return params.jsPlumbInstance.continuousAnchorFactory.get(params);\n };\n\n _curryContinuousAnchor(\"ContinuousLeft\", [\"left\"]);\n _curryContinuousAnchor(\"ContinuousTop\", [\"top\"]);\n _curryContinuousAnchor(\"ContinuousBottom\", [\"bottom\"]);\n _curryContinuousAnchor(\"ContinuousRight\", [\"right\"]);\n\n// ------- position assign anchors ------------------- \n\n // this anchor type lets you assign the position at connection time.\n _curryAnchor(0, 0, 0, 0, \"Assign\", function (anchor, params) {\n // find what to use as the \"position finder\". the user may have supplied a String which represents\n // the id of a position finder in jsPlumb.AnchorPositionFinders, or the user may have supplied the\n // position finder as a function. we find out what to use and then set it on the anchor.\n var pf = params.position || \"Fixed\";\n anchor.positionFinder = pf.constructor === String ? params.jsPlumbInstance.AnchorPositionFinders[pf] : pf;\n // always set the constructor params; the position finder might need them later (the Grid one does,\n // for example)\n anchor.constructorParams = params;\n });\n\n // these are the default anchor positions finders, which are used by the makeTarget function. supplying\n // a position finder argument to that function allows you to specify where the resulting anchor will\n // be located\n root.jsPlumbInstance.prototype.AnchorPositionFinders = {\n \"Fixed\": function (dp, ep, es) {\n return [ (dp.left - ep.left) / es[0], (dp.top - ep.top) / es[1] ];\n },\n \"Grid\": function (dp, ep, es, params) {\n var dx = dp.left - ep.left, dy = dp.top - ep.top,\n gx = es[0] / (params.grid[0]), gy = es[1] / (params.grid[1]),\n mx = Math.floor(dx / gx), my = Math.floor(dy / gy);\n return [ ((mx * gx) + (gx / 2)) / es[0], ((my * gy) + (gy / 2)) / es[1] ];\n }\n };\n\n// ------- perimeter anchors ------------------- \n\n _jp.Anchors.Perimeter = function (params) {\n params = params || {};\n var anchorCount = params.anchorCount || 60,\n shape = params.shape;\n\n if (!shape) {\n throw new Error(\"no shape supplied to Perimeter Anchor type\");\n }\n\n var _circle = function () {\n var r = 0.5, step = Math.PI * 2 / anchorCount, current = 0, a = [];\n for (var i = 0; i < anchorCount; i++) {\n var x = r + (r * Math.sin(current)),\n y = r + (r * Math.cos(current));\n a.push([ x, y, 0, 0 ]);\n current += step;\n }\n return a;\n },\n _path = function (segments) {\n var anchorsPerFace = anchorCount / segments.length, a = [],\n _computeFace = function (x1, y1, x2, y2, fractionalLength) {\n anchorsPerFace = anchorCount * fractionalLength;\n var dx = (x2 - x1) / anchorsPerFace, dy = (y2 - y1) / anchorsPerFace;\n for (var i = 0; i < anchorsPerFace; i++) {\n a.push([\n x1 + (dx * i),\n y1 + (dy * i),\n 0,\n 0\n ]);\n }\n };\n\n for (var i = 0; i < segments.length; i++) {\n _computeFace.apply(null, segments[i]);\n }\n\n return a;\n },\n _shape = function (faces) {\n var s = [];\n for (var i = 0; i < faces.length; i++) {\n s.push([faces[i][0], faces[i][1], faces[i][2], faces[i][3], 1 / faces.length]);\n }\n return _path(s);\n },\n _rectangle = function () {\n return _shape([\n [ 0, 0, 1, 0 ],\n [ 1, 0, 1, 1 ],\n [ 1, 1, 0, 1 ],\n [ 0, 1, 0, 0 ]\n ]);\n };\n\n var _shapes = {\n \"Circle\": _circle,\n \"Ellipse\": _circle,\n \"Diamond\": function () {\n return _shape([\n [ 0.5, 0, 1, 0.5 ],\n [ 1, 0.5, 0.5, 1 ],\n [ 0.5, 1, 0, 0.5 ],\n [ 0, 0.5, 0.5, 0 ]\n ]);\n },\n \"Rectangle\": _rectangle,\n \"Square\": _rectangle,\n \"Triangle\": function () {\n return _shape([\n [ 0.5, 0, 1, 1 ],\n [ 1, 1, 0, 1 ],\n [ 0, 1, 0.5, 0]\n ]);\n },\n \"Path\": function (params) {\n var points = params.points, p = [], tl = 0;\n for (var i = 0; i < points.length - 1; i++) {\n var l = Math.sqrt(Math.pow(points[i][2] - points[i][0]) + Math.pow(points[i][3] - points[i][1]));\n tl += l;\n p.push([points[i][0], points[i][1], points[i + 1][0], points[i + 1][1], l]);\n }\n for (var j = 0; j < p.length; j++) {\n p[j][4] = p[j][4] / tl;\n }\n return _path(p);\n }\n },\n _rotate = function (points, amountInDegrees) {\n var o = [], theta = amountInDegrees / 180 * Math.PI;\n for (var i = 0; i < points.length; i++) {\n var _x = points[i][0] - 0.5,\n _y = points[i][1] - 0.5;\n\n o.push([\n 0.5 + ((_x * Math.cos(theta)) - (_y * Math.sin(theta))),\n 0.5 + ((_x * Math.sin(theta)) + (_y * Math.cos(theta))),\n points[i][2],\n points[i][3]\n ]);\n }\n return o;\n };\n\n if (!_shapes[shape]) {\n throw new Error(\"Shape [\" + shape + \"] is unknown by Perimeter Anchor type\");\n }\n\n var da = _shapes[shape](params);\n if (params.rotation) {\n da = _rotate(da, params.rotation);\n }\n var a = params.jsPlumbInstance.makeDynamicAnchor(da);\n a.type = \"Perimeter\";\n return a;\n };\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the default Connectors, Endpoint and Overlay definitions.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n * \n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil, _jg = root.Biltong;\n\n _jp.Segments = {\n\n /*\n * Class: AbstractSegment\n * A Connector is made up of 1..N Segments, each of which has a Type, such as 'Straight', 'Arc',\n * 'Bezier'. This is new from 1.4.2, and gives us a lot more flexibility when drawing connections: things such\n * as rounded corners for flowchart connectors, for example, or a straight line stub for Bezier connections, are\n * much easier to do now.\n *\n * A Segment is responsible for providing coordinates for painting it, and also must be able to report its length.\n * \n */\n AbstractSegment: function (params) {\n this.params = params;\n\n /**\n * Function: findClosestPointOnPath\n * Finds the closest point on this segment to the given [x, y],\n * returning both the x and y of the point plus its distance from\n * the supplied point, and its location along the length of the\n * path inscribed by the segment. This implementation returns\n * Infinity for distance and null values for everything else;\n * subclasses are expected to override.\n */\n this.findClosestPointOnPath = function (x, y) {\n return {\n d: Infinity,\n x: null,\n y: null,\n l: null\n };\n };\n\n this.getBounds = function () {\n return {\n minX: Math.min(params.x1, params.x2),\n minY: Math.min(params.y1, params.y2),\n maxX: Math.max(params.x1, params.x2),\n maxY: Math.max(params.y1, params.y2)\n };\n };\n\n /**\n * Computes the list of points on the segment that intersect the given line.\n * @method lineIntersection\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @returns {Array<[number, number]>}\n */\n this.lineIntersection = function(x1, y1, x2, y2) {\n return [];\n };\n\n /**\n * Computes the list of points on the segment that intersect the box with the given origin and size.\n * @method boxIntersection\n * @param {number} x1\n * @param {number} y1\n * @param {number} w\n * @param {number} h\n * @returns {Array<[number, number]>}\n */\n this.boxIntersection = function(x, y, w, h) {\n var a = [];\n a.push.apply(a, this.lineIntersection(x, y, x + w, y));\n a.push.apply(a, this.lineIntersection(x + w, y, x + w, y + h));\n a.push.apply(a, this.lineIntersection(x + w, y + h, x, y + h));\n a.push.apply(a, this.lineIntersection(x, y + h, x, y));\n return a;\n };\n\n /**\n * Computes the list of points on the segment that intersect the given bounding box, which is an object of the form { x:.., y:.., w:.., h:.. }.\n * @method lineIntersection\n * @param {BoundingRectangle} box\n * @returns {Array<[number, number]>}\n */\n this.boundingBoxIntersection = function(box) {\n return this.boxIntersection(box.x, box.y, box.w, box.y);\n };\n },\n Straight: function (params) {\n var _super = _jp.Segments.AbstractSegment.apply(this, arguments),\n length, m, m2, x1, x2, y1, y2,\n _recalc = function () {\n length = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n m = _jg.gradient({x: x1, y: y1}, {x: x2, y: y2});\n m2 = -1 / m;\n };\n\n this.type = \"Straight\";\n\n this.getLength = function () {\n return length;\n };\n this.getGradient = function () {\n return m;\n };\n\n this.getCoordinates = function () {\n return { x1: x1, y1: y1, x2: x2, y2: y2 };\n };\n this.setCoordinates = function (coords) {\n x1 = coords.x1;\n y1 = coords.y1;\n x2 = coords.x2;\n y2 = coords.y2;\n _recalc();\n };\n this.setCoordinates({x1: params.x1, y1: params.y1, x2: params.x2, y2: params.y2});\n\n this.getBounds = function () {\n return {\n minX: Math.min(x1, x2),\n minY: Math.min(y1, y2),\n maxX: Math.max(x1, x2),\n maxY: Math.max(y1, y2)\n };\n };\n\n /**\n * returns the point on the segment's path that is 'location' along the length of the path, where 'location' is a decimal from\n * 0 to 1 inclusive. for the straight line segment this is simple maths.\n */\n this.pointOnPath = function (location, absolute) {\n if (location === 0 && !absolute) {\n return { x: x1, y: y1 };\n }\n else if (location === 1 && !absolute) {\n return { x: x2, y: y2 };\n }\n else {\n var l = absolute ? location > 0 ? location : length + location : location * length;\n return _jg.pointOnLine({x: x1, y: y1}, {x: x2, y: y2}, l);\n }\n };\n\n /**\n * returns the gradient of the segment at the given point - which for us is constant.\n */\n this.gradientAtPoint = function (_) {\n return m;\n };\n\n /**\n * returns the point on the segment's path that is 'distance' along the length of the path from 'location', where\n * 'location' is a decimal from 0 to 1 inclusive, and 'distance' is a number of pixels.\n * this hands off to jsPlumbUtil to do the maths, supplying two points and the distance.\n */\n this.pointAlongPathFrom = function (location, distance, absolute) {\n var p = this.pointOnPath(location, absolute),\n farAwayPoint = distance <= 0 ? {x: x1, y: y1} : {x: x2, y: y2 };\n\n /*\n location == 1 ? {\n x:x1 + ((x2 - x1) * 10),\n y:y1 + ((y1 - y2) * 10)\n } :\n */\n\n if (distance <= 0 && Math.abs(distance) > 1) {\n distance *= -1;\n }\n\n return _jg.pointOnLine(p, farAwayPoint, distance);\n };\n\n // is c between a and b?\n var within = function (a, b, c) {\n return c >= Math.min(a, b) && c <= Math.max(a, b);\n };\n // find which of a and b is closest to c\n var closest = function (a, b, c) {\n return Math.abs(c - a) < Math.abs(c - b) ? a : b;\n };\n\n /**\n Function: findClosestPointOnPath\n Finds the closest point on this segment to [x,y]. See\n notes on this method in AbstractSegment.\n */\n this.findClosestPointOnPath = function (x, y) {\n var out = {\n d: Infinity,\n x: null,\n y: null,\n l: null,\n x1: x1,\n x2: x2,\n y1: y1,\n y2: y2\n };\n\n if (m === 0) {\n out.y = y1;\n out.x = within(x1, x2, x) ? x : closest(x1, x2, x);\n }\n else if (m === Infinity || m === -Infinity) {\n out.x = x1;\n out.y = within(y1, y2, y) ? y : closest(y1, y2, y);\n }\n else {\n // closest point lies on normal from given point to this line. \n var b = y1 - (m * x1),\n b2 = y - (m2 * x),\n // y1 = m.x1 + b and y1 = m2.x1 + b2\n // so m.x1 + b = m2.x1 + b2\n // x1(m - m2) = b2 - b\n // x1 = (b2 - b) / (m - m2)\n _x1 = (b2 - b) / (m - m2),\n _y1 = (m * _x1) + b;\n\n out.x = within(x1, x2, _x1) ? _x1 : closest(x1, x2, _x1);//_x1;\n out.y = within(y1, y2, _y1) ? _y1 : closest(y1, y2, _y1);//_y1;\n }\n\n var fractionInSegment = _jg.lineLength([ out.x, out.y ], [ x1, y1 ]);\n out.d = _jg.lineLength([x, y], [out.x, out.y]);\n out.l = fractionInSegment / length;\n return out;\n };\n\n var _pointLiesBetween = function(q, p1, p2) {\n return (p2 > p1) ? (p1 <= q && q <= p2) : (p1 >= q && q >= p2);\n }, _plb = _pointLiesBetween;\n\n /**\n * Calculates all intersections of the given line with this segment.\n * @param _x1\n * @param _y1\n * @param _x2\n * @param _y2\n * @returns {Array}\n */\n this.lineIntersection = function(_x1, _y1, _x2, _y2) {\n var m2 = Math.abs(_jg.gradient({x: _x1, y: _y1}, {x: _x2, y: _y2})),\n m1 = Math.abs(m),\n b = m1 === Infinity ? x1 : y1 - (m1 * x1),\n out = [],\n b2 = m2 === Infinity ? _x1 : _y1 - (m2 * _x1);\n\n // if lines parallel, no intersection\n if (m2 !== m1) {\n // perpendicular, segment horizontal\n if(m2 === Infinity && m1 === 0) {\n if (_plb(_x1, x1, x2) && _plb(y1, _y1, _y2)) {\n out = [ _x1, y1 ]; // we return X on the incident line and Y from the segment\n }\n } else if(m2 === 0 && m1 === Infinity) {\n // perpendicular, segment vertical\n if(_plb(_y1, y1, y2) && _plb(x1, _x1, _x2)) {\n out = [x1, _y1]; // we return X on the segment and Y from the incident line\n }\n } else {\n var X, Y;\n if (m2 === Infinity) {\n // test line is a vertical line. where does it cross the segment?\n X = _x1;\n if (_plb(X, x1, x2)) {\n Y = (m1 * _x1) + b;\n if (_plb(Y, _y1, _y2)) {\n out = [ X, Y ];\n }\n }\n } else if (m2 === 0) {\n Y = _y1;\n // test line is a horizontal line. where does it cross the segment?\n if (_plb(Y, y1, y2)) {\n X = (_y1 - b) / m1;\n if (_plb(X, _x1, _x2)) {\n out = [ X, Y ];\n }\n }\n } else {\n // mX + b = m2X + b2\n // mX - m2X = b2 - b\n // X(m - m2) = b2 - b\n // X = (b2 - b) / (m - m2)\n // Y = mX + b\n X = (b2 - b) / (m1 - m2);\n Y = (m1 * X) + b;\n if(_plb(X, x1, x2) && _plb(Y, y1, y2)) {\n out = [ X, Y];\n }\n }\n }\n }\n\n return out;\n };\n\n /**\n * Calculates all intersections of the given box with this segment. By default this method simply calls `lineIntersection` with each of the four\n * faces of the box; subclasses can override this if they think there's a faster way to compute the entire box at once.\n * @param x X position of top left corner of box\n * @param y Y position of top left corner of box\n * @param w width of box\n * @param h height of box\n * @returns {Array}\n */\n this.boxIntersection = function(x, y, w, h) {\n var a = [];\n a.push.apply(a, this.lineIntersection(x, y, x + w, y));\n a.push.apply(a, this.lineIntersection(x + w, y, x + w, y + h));\n a.push.apply(a, this.lineIntersection(x + w, y + h, x, y + h));\n a.push.apply(a, this.lineIntersection(x, y + h, x, y));\n return a;\n };\n\n /**\n * Calculates all intersections of the given bounding box with this segment. By default this method simply calls `lineIntersection` with each of the four\n * faces of the box; subclasses can override this if they think there's a faster way to compute the entire box at once.\n * @param box Bounding box, in { x:.., y:..., w:..., h:... } format.\n * @returns {Array}\n */\n this.boundingBoxIntersection = function(box) {\n return this.boxIntersection(box.x, box.y, box.w, box.h);\n };\n },\n\n /*\n Arc Segment. You need to supply:\n\n r - radius\n cx - center x for the arc\n cy - center y for the arc\n ac - whether the arc is anticlockwise or not. default is clockwise.\n\n and then either:\n\n startAngle - startAngle for the arc.\n endAngle - endAngle for the arc.\n\n or:\n\n x1 - x for start point\n y1 - y for start point\n x2 - x for end point\n y2 - y for end point\n\n */\n Arc: function (params) {\n var _super = _jp.Segments.AbstractSegment.apply(this, arguments),\n _calcAngle = function (_x, _y) {\n return _jg.theta([params.cx, params.cy], [_x, _y]);\n },\n _calcAngleForLocation = function (segment, location) {\n if (segment.anticlockwise) {\n var sa = segment.startAngle < segment.endAngle ? segment.startAngle + TWO_PI : segment.startAngle,\n s = Math.abs(sa - segment.endAngle);\n return sa - (s * location);\n }\n else {\n var ea = segment.endAngle < segment.startAngle ? segment.endAngle + TWO_PI : segment.endAngle,\n ss = Math.abs(ea - segment.startAngle);\n\n return segment.startAngle + (ss * location);\n }\n },\n TWO_PI = 2 * Math.PI;\n\n this.radius = params.r;\n this.anticlockwise = params.ac;\n this.type = \"Arc\";\n\n if (params.startAngle && params.endAngle) {\n this.startAngle = params.startAngle;\n this.endAngle = params.endAngle;\n this.x1 = params.cx + (this.radius * Math.cos(params.startAngle));\n this.y1 = params.cy + (this.radius * Math.sin(params.startAngle));\n this.x2 = params.cx + (this.radius * Math.cos(params.endAngle));\n this.y2 = params.cy + (this.radius * Math.sin(params.endAngle));\n }\n else {\n this.startAngle = _calcAngle(params.x1, params.y1);\n this.endAngle = _calcAngle(params.x2, params.y2);\n this.x1 = params.x1;\n this.y1 = params.y1;\n this.x2 = params.x2;\n this.y2 = params.y2;\n }\n\n if (this.endAngle < 0) {\n this.endAngle += TWO_PI;\n }\n if (this.startAngle < 0) {\n this.startAngle += TWO_PI;\n }\n\n // segment is used by vml \n //this.segment = _jg.quadrant([this.x1, this.y1], [this.x2, this.y2]);\n\n // we now have startAngle and endAngle as positive numbers, meaning the\n // absolute difference (|d|) between them is the sweep (s) of this arc, unless the\n // arc is 'anticlockwise' in which case 's' is given by 2PI - |d|.\n\n var ea = this.endAngle < this.startAngle ? this.endAngle + TWO_PI : this.endAngle;\n this.sweep = Math.abs(ea - this.startAngle);\n if (this.anticlockwise) {\n this.sweep = TWO_PI - this.sweep;\n }\n var circumference = 2 * Math.PI * this.radius,\n frac = this.sweep / TWO_PI,\n length = circumference * frac;\n\n this.getLength = function () {\n return length;\n };\n\n this.getBounds = function () {\n return {\n minX: params.cx - params.r,\n maxX: params.cx + params.r,\n minY: params.cy - params.r,\n maxY: params.cy + params.r\n };\n };\n\n var VERY_SMALL_VALUE = 0.0000000001,\n gentleRound = function (n) {\n var f = Math.floor(n), r = Math.ceil(n);\n if (n - f < VERY_SMALL_VALUE) {\n return f;\n }\n else if (r - n < VERY_SMALL_VALUE) {\n return r;\n }\n return n;\n };\n\n /**\n * returns the point on the segment's path that is 'location' along the length of the path, where 'location' is a decimal from\n * 0 to 1 inclusive.\n */\n this.pointOnPath = function (location, absolute) {\n\n if (location === 0) {\n return { x: this.x1, y: this.y1, theta: this.startAngle };\n }\n else if (location === 1) {\n return { x: this.x2, y: this.y2, theta: this.endAngle };\n }\n\n if (absolute) {\n location = location / length;\n }\n\n var angle = _calcAngleForLocation(this, location),\n _x = params.cx + (params.r * Math.cos(angle)),\n _y = params.cy + (params.r * Math.sin(angle));\n\n return { x: gentleRound(_x), y: gentleRound(_y), theta: angle };\n };\n\n /**\n * returns the gradient of the segment at the given point.\n */\n this.gradientAtPoint = function (location, absolute) {\n var p = this.pointOnPath(location, absolute);\n var m = _jg.normal([ params.cx, params.cy ], [p.x, p.y ]);\n if (!this.anticlockwise && (m === Infinity || m === -Infinity)) {\n m *= -1;\n }\n return m;\n };\n\n this.pointAlongPathFrom = function (location, distance, absolute) {\n var p = this.pointOnPath(location, absolute),\n arcSpan = distance / circumference * 2 * Math.PI,\n dir = this.anticlockwise ? -1 : 1,\n startAngle = p.theta + (dir * arcSpan),\n startX = params.cx + (this.radius * Math.cos(startAngle)),\n startY = params.cy + (this.radius * Math.sin(startAngle));\n\n return {x: startX, y: startY};\n };\n\n // TODO: lineIntersection\n },\n\n Bezier: function (params) {\n this.curve = [\n { x: params.x1, y: params.y1},\n { x: params.cp1x, y: params.cp1y },\n { x: params.cp2x, y: params.cp2y },\n { x: params.x2, y: params.y2 }\n ];\n\n var _super = _jp.Segments.AbstractSegment.apply(this, arguments);\n // although this is not a strictly rigorous determination of bounds\n // of a bezier curve, it works for the types of curves that this segment\n // type produces.\n this.bounds = {\n minX: Math.min(params.x1, params.x2, params.cp1x, params.cp2x),\n minY: Math.min(params.y1, params.y2, params.cp1y, params.cp2y),\n maxX: Math.max(params.x1, params.x2, params.cp1x, params.cp2x),\n maxY: Math.max(params.y1, params.y2, params.cp1y, params.cp2y)\n };\n\n this.type = \"Bezier\";\n\n var _translateLocation = function (_curve, location, absolute) {\n if (absolute) {\n location = root.jsBezier.locationAlongCurveFrom(_curve, location > 0 ? 0 : 1, location);\n }\n\n return location;\n };\n\n /**\n * returns the point on the segment's path that is 'location' along the length of the path, where 'location' is a decimal from\n * 0 to 1 inclusive.\n */\n this.pointOnPath = function (location, absolute) {\n location = _translateLocation(this.curve, location, absolute);\n return root.jsBezier.pointOnCurve(this.curve, location);\n };\n\n /**\n * returns the gradient of the segment at the given point.\n */\n this.gradientAtPoint = function (location, absolute) {\n location = _translateLocation(this.curve, location, absolute);\n return root.jsBezier.gradientAtPoint(this.curve, location);\n };\n\n this.pointAlongPathFrom = function (location, distance, absolute) {\n location = _translateLocation(this.curve, location, absolute);\n return root.jsBezier.pointAlongCurveFrom(this.curve, location, distance);\n };\n\n this.getLength = function () {\n return root.jsBezier.getLength(this.curve);\n };\n\n this.getBounds = function () {\n return this.bounds;\n };\n\n this.findClosestPointOnPath = function (x, y) {\n var p = root.jsBezier.nearestPointOnCurve({x:x,y:y}, this.curve);\n return {\n d:Math.sqrt(Math.pow(p.point.x - x, 2) + Math.pow(p.point.y - y, 2)),\n x:p.point.x,\n y:p.point.y,\n l:p.location,\n s:this\n };\n };\n\n this.lineIntersection = function(x1, y1, x2, y2) {\n return root.jsBezier.lineIntersection(x1, y1, x2, y2, this.curve);\n };\n }\n };\n\n _jp.SegmentRenderer = {\n getPath: function (segment, isFirstSegment) {\n return ({\n \"Straight\": function (isFirstSegment) {\n var d = segment.getCoordinates();\n return (isFirstSegment ? \"M \" + d.x1 + \" \" + d.y1 + \" \" : \"\") + \"L \" + d.x2 + \" \" + d.y2;\n },\n \"Bezier\": function (isFirstSegment) {\n var d = segment.params;\n return (isFirstSegment ? \"M \" + d.x2 + \" \" + d.y2 + \" \" : \"\") +\n \"C \" + d.cp2x + \" \" + d.cp2y + \" \" + d.cp1x + \" \" + d.cp1y + \" \" + d.x1 + \" \" + d.y1;\n },\n \"Arc\": function (isFirstSegment) {\n var d = segment.params,\n laf = segment.sweep > Math.PI ? 1 : 0,\n sf = segment.anticlockwise ? 0 : 1;\n\n return (isFirstSegment ? \"M\" + segment.x1 + \" \" + segment.y1 + \" \" : \"\") + \"A \" + segment.radius + \" \" + d.r + \" 0 \" + laf + \",\" + sf + \" \" + segment.x2 + \" \" + segment.y2;\n }\n })[segment.type](isFirstSegment);\n }\n };\n\n /*\n Class: UIComponent\n Superclass for Connector and AbstractEndpoint.\n */\n var AbstractComponent = function () {\n this.resetBounds = function () {\n this.bounds = { minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity };\n };\n this.resetBounds();\n };\n\n /*\n * Class: Connector\n * Superclass for all Connectors; here is where Segments are managed. This is exposed on jsPlumb just so it\n * can be accessed from other files. You should not try to instantiate one of these directly.\n *\n * When this class is asked for a pointOnPath, or gradient etc, it must first figure out which segment to dispatch\n * that request to. This is done by keeping track of the total connector length as segments are added, and also\n * their cumulative ratios to the total length. Then when the right segment is found it is a simple case of dispatching\n * the request to it (and adjusting 'location' so that it is relative to the beginning of that segment.)\n */\n _jp.Connectors.AbstractConnector = function (params) {\n\n AbstractComponent.apply(this, arguments);\n\n var segments = [],\n totalLength = 0,\n segmentProportions = [],\n segmentProportionalLengths = [],\n stub = params.stub || 0,\n sourceStub = _ju.isArray(stub) ? stub[0] : stub,\n targetStub = _ju.isArray(stub) ? stub[1] : stub,\n gap = params.gap || 0,\n sourceGap = _ju.isArray(gap) ? gap[0] : gap,\n targetGap = _ju.isArray(gap) ? gap[1] : gap,\n userProvidedSegments = null,\n paintInfo = null;\n\n this.getPathData = function() {\n var p = \"\";\n for (var i = 0; i < segments.length; i++) {\n p += _jp.SegmentRenderer.getPath(segments[i], i === 0);\n p += \" \";\n }\n return p;\n };\n\n /**\n * Function: findSegmentForPoint\n * Returns the segment that is closest to the given [x,y],\n * null if nothing found. This function returns a JS\n * object with:\n *\n * d - distance from segment\n * l - proportional location in segment\n * x - x point on the segment\n * y - y point on the segment\n * s - the segment itself.\n */\n this.findSegmentForPoint = function (x, y) {\n var out = { d: Infinity, s: null, x: null, y: null, l: null };\n for (var i = 0; i < segments.length; i++) {\n var _s = segments[i].findClosestPointOnPath(x, y);\n if (_s.d < out.d) {\n out.d = _s.d;\n out.l = _s.l;\n out.x = _s.x;\n out.y = _s.y;\n out.s = segments[i];\n out.x1 = _s.x1;\n out.x2 = _s.x2;\n out.y1 = _s.y1;\n out.y2 = _s.y2;\n out.index = i;\n }\n }\n\n return out;\n };\n\n this.lineIntersection = function(x1, y1, x2, y2) {\n var out = [];\n for (var i = 0; i < segments.length; i++) {\n out.push.apply(out, segments[i].lineIntersection(x1, y1, x2, y2));\n }\n return out;\n };\n\n this.boxIntersection = function(x, y, w, h) {\n var out = [];\n for (var i = 0; i < segments.length; i++) {\n out.push.apply(out, segments[i].boxIntersection(x, y, w, h));\n }\n return out;\n };\n\n this.boundingBoxIntersection = function(box) {\n var out = [];\n for (var i = 0; i < segments.length; i++) {\n out.push.apply(out, segments[i].boundingBoxIntersection(box));\n }\n return out;\n };\n\n var _updateSegmentProportions = function () {\n var curLoc = 0;\n for (var i = 0; i < segments.length; i++) {\n var sl = segments[i].getLength();\n segmentProportionalLengths[i] = sl / totalLength;\n segmentProportions[i] = [curLoc, (curLoc += (sl / totalLength)) ];\n }\n },\n\n /**\n * returns [segment, proportion of travel in segment, segment index] for the segment\n * that contains the point which is 'location' distance along the entire path, where\n * 'location' is a decimal between 0 and 1 inclusive. in this connector type, paths\n * are made up of a list of segments, each of which contributes some fraction to\n * the total length.\n * From 1.3.10 this also supports the 'absolute' property, which lets us specify a location\n * as the absolute distance in pixels, rather than a proportion of the total path.\n */\n _findSegmentForLocation = function (location, absolute) {\n if (absolute) {\n location = location > 0 ? location / totalLength : (totalLength + location) / totalLength;\n }\n var idx = segmentProportions.length - 1, inSegmentProportion = 1;\n for (var i = 0; i < segmentProportions.length; i++) {\n if (segmentProportions[i][1] >= location) {\n idx = i;\n // todo is this correct for all connector path types?\n inSegmentProportion = location === 1 ? 1 : location === 0 ? 0 : (location - segmentProportions[i][0]) / segmentProportionalLengths[i];\n break;\n }\n }\n return { segment: segments[idx], proportion: inSegmentProportion, index: idx };\n },\n _addSegment = function (conn, type, params) {\n if (params.x1 === params.x2 && params.y1 === params.y2) {\n return;\n }\n var s = new _jp.Segments[type](params);\n segments.push(s);\n totalLength += s.getLength();\n conn.updateBounds(s);\n },\n _clearSegments = function () {\n totalLength = segments.length = segmentProportions.length = segmentProportionalLengths.length = 0;\n };\n\n this.setSegments = function (_segs) {\n userProvidedSegments = [];\n totalLength = 0;\n for (var i = 0; i < _segs.length; i++) {\n userProvidedSegments.push(_segs[i]);\n totalLength += _segs[i].getLength();\n }\n };\n\n this.getLength = function() {\n return totalLength;\n };\n\n var _prepareCompute = function (params) {\n this.strokeWidth = params.strokeWidth;\n var segment = _jg.quadrant(params.sourcePos, params.targetPos),\n swapX = params.targetPos[0] < params.sourcePos[0],\n swapY = params.targetPos[1] < params.sourcePos[1],\n lw = params.strokeWidth || 1,\n so = params.sourceEndpoint.anchor.getOrientation(params.sourceEndpoint),\n to = params.targetEndpoint.anchor.getOrientation(params.targetEndpoint),\n x = swapX ? params.targetPos[0] : params.sourcePos[0],\n y = swapY ? params.targetPos[1] : params.sourcePos[1],\n w = Math.abs(params.targetPos[0] - params.sourcePos[0]),\n h = Math.abs(params.targetPos[1] - params.sourcePos[1]);\n\n // if either anchor does not have an orientation set, we derive one from their relative\n // positions. we fix the axis to be the one in which the two elements are further apart, and\n // point each anchor at the other element. this is also used when dragging a new connection.\n if (so[0] === 0 && so[1] === 0 || to[0] === 0 && to[1] === 0) {\n var index = w > h ? 0 : 1, oIndex = [1, 0][index];\n so = [];\n to = [];\n so[index] = params.sourcePos[index] > params.targetPos[index] ? -1 : 1;\n to[index] = params.sourcePos[index] > params.targetPos[index] ? 1 : -1;\n so[oIndex] = 0;\n to[oIndex] = 0;\n }\n\n var sx = swapX ? w + (sourceGap * so[0]) : sourceGap * so[0],\n sy = swapY ? h + (sourceGap * so[1]) : sourceGap * so[1],\n tx = swapX ? targetGap * to[0] : w + (targetGap * to[0]),\n ty = swapY ? targetGap * to[1] : h + (targetGap * to[1]),\n oProduct = ((so[0] * to[0]) + (so[1] * to[1]));\n\n var result = {\n sx: sx, sy: sy, tx: tx, ty: ty, lw: lw,\n xSpan: Math.abs(tx - sx),\n ySpan: Math.abs(ty - sy),\n mx: (sx + tx) / 2,\n my: (sy + ty) / 2,\n so: so, to: to, x: x, y: y, w: w, h: h,\n segment: segment,\n startStubX: sx + (so[0] * sourceStub),\n startStubY: sy + (so[1] * sourceStub),\n endStubX: tx + (to[0] * targetStub),\n endStubY: ty + (to[1] * targetStub),\n isXGreaterThanStubTimes2: Math.abs(sx - tx) > (sourceStub + targetStub),\n isYGreaterThanStubTimes2: Math.abs(sy - ty) > (sourceStub + targetStub),\n opposite: oProduct === -1,\n perpendicular: oProduct === 0,\n orthogonal: oProduct === 1,\n sourceAxis: so[0] === 0 ? \"y\" : \"x\",\n points: [x, y, w, h, sx, sy, tx, ty ],\n stubs:[sourceStub, targetStub]\n };\n result.anchorOrientation = result.opposite ? \"opposite\" : result.orthogonal ? \"orthogonal\" : \"perpendicular\";\n return result;\n };\n\n this.getSegments = function () {\n return segments;\n };\n\n this.updateBounds = function (segment) {\n var segBounds = segment.getBounds();\n this.bounds.minX = Math.min(this.bounds.minX, segBounds.minX);\n this.bounds.maxX = Math.max(this.bounds.maxX, segBounds.maxX);\n this.bounds.minY = Math.min(this.bounds.minY, segBounds.minY);\n this.bounds.maxY = Math.max(this.bounds.maxY, segBounds.maxY);\n };\n\n var dumpSegmentsToConsole = function () {\n console.log(\"SEGMENTS:\");\n for (var i = 0; i < segments.length; i++) {\n console.log(segments[i].type, segments[i].getLength(), segmentProportions[i]);\n }\n };\n\n this.pointOnPath = function (location, absolute) {\n var seg = _findSegmentForLocation(location, absolute);\n return seg.segment && seg.segment.pointOnPath(seg.proportion, false) || [0, 0];\n };\n\n this.gradientAtPoint = function (location, absolute) {\n var seg = _findSegmentForLocation(location, absolute);\n return seg.segment && seg.segment.gradientAtPoint(seg.proportion, false) || 0;\n };\n\n this.pointAlongPathFrom = function (location, distance, absolute) {\n var seg = _findSegmentForLocation(location, absolute);\n // TODO what happens if this crosses to the next segment?\n return seg.segment && seg.segment.pointAlongPathFrom(seg.proportion, distance, false) || [0, 0];\n };\n\n this.compute = function (params) {\n paintInfo = _prepareCompute.call(this, params);\n\n _clearSegments();\n this._compute(paintInfo, params);\n this.x = paintInfo.points[0];\n this.y = paintInfo.points[1];\n this.w = paintInfo.points[2];\n this.h = paintInfo.points[3];\n this.segment = paintInfo.segment;\n _updateSegmentProportions();\n };\n\n return {\n addSegment: _addSegment,\n prepareCompute: _prepareCompute,\n sourceStub: sourceStub,\n targetStub: targetStub,\n maxStub: Math.max(sourceStub, targetStub),\n sourceGap: sourceGap,\n targetGap: targetGap,\n maxGap: Math.max(sourceGap, targetGap)\n };\n };\n _ju.extend(_jp.Connectors.AbstractConnector, AbstractComponent);\n\n\n // ********************************* END OF CONNECTOR TYPES *******************************************************************\n\n // ********************************* ENDPOINT TYPES *******************************************************************\n\n _jp.Endpoints.AbstractEndpoint = function (params) {\n AbstractComponent.apply(this, arguments);\n var compute = this.compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n var out = this._compute.apply(this, arguments);\n this.x = out[0];\n this.y = out[1];\n this.w = out[2];\n this.h = out[3];\n this.bounds.minX = this.x;\n this.bounds.minY = this.y;\n this.bounds.maxX = this.x + this.w;\n this.bounds.maxY = this.y + this.h;\n return out;\n };\n return {\n compute: compute,\n cssClass: params.cssClass\n };\n };\n _ju.extend(_jp.Endpoints.AbstractEndpoint, AbstractComponent);\n\n /**\n * Class: Endpoints.Dot\n * A round endpoint, with default radius 10 pixels.\n */\n\n /**\n * Function: Constructor\n *\n * Parameters:\n *\n * radius - radius of the endpoint. defaults to 10 pixels.\n */\n _jp.Endpoints.Dot = function (params) {\n this.type = \"Dot\";\n var _super = _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n params = params || {};\n this.radius = params.radius || 10;\n this.defaultOffset = 0.5 * this.radius;\n this.defaultInnerRadius = this.radius / 3;\n\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n this.radius = endpointStyle.radius || this.radius;\n var x = anchorPoint[0] - this.radius,\n y = anchorPoint[1] - this.radius,\n w = this.radius * 2,\n h = this.radius * 2;\n\n if (endpointStyle.stroke) {\n var lw = endpointStyle.strokeWidth || 1;\n x -= lw;\n y -= lw;\n w += (lw * 2);\n h += (lw * 2);\n }\n return [ x, y, w, h, this.radius ];\n };\n };\n _ju.extend(_jp.Endpoints.Dot, _jp.Endpoints.AbstractEndpoint);\n\n _jp.Endpoints.Rectangle = function (params) {\n this.type = \"Rectangle\";\n var _super = _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n params = params || {};\n this.width = params.width || 20;\n this.height = params.height || 20;\n\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n var width = endpointStyle.width || this.width,\n height = endpointStyle.height || this.height,\n x = anchorPoint[0] - (width / 2),\n y = anchorPoint[1] - (height / 2);\n\n return [ x, y, width, height];\n };\n };\n _ju.extend(_jp.Endpoints.Rectangle, _jp.Endpoints.AbstractEndpoint);\n\n var DOMElementEndpoint = function (params) {\n _jp.jsPlumbUIComponent.apply(this, arguments);\n this._jsPlumb.displayElements = [];\n };\n _ju.extend(DOMElementEndpoint, _jp.jsPlumbUIComponent, {\n getDisplayElements: function () {\n return this._jsPlumb.displayElements;\n },\n appendDisplayElement: function (el) {\n this._jsPlumb.displayElements.push(el);\n }\n });\n\n /**\n * Class: Endpoints.Image\n * Draws an image as the Endpoint.\n */\n /**\n * Function: Constructor\n *\n * Parameters:\n *\n * src - location of the image to use.\n\n TODO: multiple references to self. not sure quite how to get rid of them entirely. perhaps self = null in the cleanup\n function will suffice\n\n TODO this class still might leak memory.\n\n */\n _jp.Endpoints.Image = function (params) {\n\n this.type = \"Image\";\n DOMElementEndpoint.apply(this, arguments);\n _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n\n var _onload = params.onload,\n src = params.src || params.url,\n clazz = params.cssClass ? \" \" + params.cssClass : \"\";\n\n this._jsPlumb.img = new Image();\n this._jsPlumb.ready = false;\n this._jsPlumb.initialized = false;\n this._jsPlumb.deleted = false;\n this._jsPlumb.widthToUse = params.width;\n this._jsPlumb.heightToUse = params.height;\n this._jsPlumb.endpoint = params.endpoint;\n\n this._jsPlumb.img.onload = function () {\n if (this._jsPlumb != null) {\n this._jsPlumb.ready = true;\n this._jsPlumb.widthToUse = this._jsPlumb.widthToUse || this._jsPlumb.img.width;\n this._jsPlumb.heightToUse = this._jsPlumb.heightToUse || this._jsPlumb.img.height;\n if (_onload) {\n _onload(this);\n }\n }\n }.bind(this);\n\n /*\n Function: setImage\n Sets the Image to use in this Endpoint.\n\n Parameters:\n img - may be a URL or an Image object\n onload - optional; a callback to execute once the image has loaded.\n */\n this._jsPlumb.endpoint.setImage = function (_img, onload) {\n var s = _img.constructor === String ? _img : _img.src;\n _onload = onload;\n this._jsPlumb.img.src = s;\n\n if (this.canvas != null) {\n this.canvas.setAttribute(\"src\", this._jsPlumb.img.src);\n }\n }.bind(this);\n\n this._jsPlumb.endpoint.setImage(src, _onload);\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n this.anchorPoint = anchorPoint;\n if (this._jsPlumb.ready) {\n return [anchorPoint[0] - this._jsPlumb.widthToUse / 2, anchorPoint[1] - this._jsPlumb.heightToUse / 2,\n this._jsPlumb.widthToUse, this._jsPlumb.heightToUse];\n }\n else {\n return [0, 0, 0, 0];\n }\n };\n\n this.canvas = _jp.createElement(\"img\", {\n position:\"absolute\",\n margin:0,\n padding:0,\n outline:0\n }, this._jsPlumb.instance.endpointClass + clazz);\n\n if (this._jsPlumb.widthToUse) {\n this.canvas.setAttribute(\"width\", this._jsPlumb.widthToUse);\n }\n if (this._jsPlumb.heightToUse) {\n this.canvas.setAttribute(\"height\", this._jsPlumb.heightToUse);\n }\n this._jsPlumb.instance.appendElement(this.canvas);\n\n this.actuallyPaint = function (d, style, anchor) {\n if (!this._jsPlumb.deleted) {\n if (!this._jsPlumb.initialized) {\n this.canvas.setAttribute(\"src\", this._jsPlumb.img.src);\n this.appendDisplayElement(this.canvas);\n this._jsPlumb.initialized = true;\n }\n var x = this.anchorPoint[0] - (this._jsPlumb.widthToUse / 2),\n y = this.anchorPoint[1] - (this._jsPlumb.heightToUse / 2);\n _ju.sizeElement(this.canvas, x, y, this._jsPlumb.widthToUse, this._jsPlumb.heightToUse);\n }\n };\n\n this.paint = function (style, anchor) {\n if (this._jsPlumb != null) { // may have been deleted\n if (this._jsPlumb.ready) {\n this.actuallyPaint(style, anchor);\n }\n else {\n root.setTimeout(function () {\n this.paint(style, anchor);\n }.bind(this), 200);\n }\n }\n };\n };\n _ju.extend(_jp.Endpoints.Image, [ DOMElementEndpoint, _jp.Endpoints.AbstractEndpoint ], {\n cleanup: function (force) {\n if (force) {\n this._jsPlumb.deleted = true;\n if (this.canvas) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n this.canvas = null;\n }\n }\n });\n\n /*\n * Class: Endpoints.Blank\n * An Endpoint that paints nothing (visible) on the screen. Supports cssClass and hoverClass parameters like all Endpoints.\n */\n _jp.Endpoints.Blank = function (params) {\n var _super = _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n this.type = \"Blank\";\n DOMElementEndpoint.apply(this, arguments);\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n return [anchorPoint[0], anchorPoint[1], 10, 0];\n };\n\n var clazz = params.cssClass ? \" \" + params.cssClass : \"\";\n\n this.canvas = _jp.createElement(\"div\", {\n display: \"block\",\n width: \"1px\",\n height: \"1px\",\n background: \"transparent\",\n position: \"absolute\"\n }, this._jsPlumb.instance.endpointClass + clazz);\n\n this._jsPlumb.instance.appendElement(this.canvas);\n\n this.paint = function (style, anchor) {\n _ju.sizeElement(this.canvas, this.x, this.y, this.w, this.h);\n };\n };\n _ju.extend(_jp.Endpoints.Blank, [_jp.Endpoints.AbstractEndpoint, DOMElementEndpoint], {\n cleanup: function () {\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n }\n });\n\n /*\n * Class: Endpoints.Triangle\n * A triangular Endpoint.\n */\n /*\n * Function: Constructor\n *\n * Parameters:\n *\n * width width of the triangle's base. defaults to 55 pixels.\n * height height of the triangle from base to apex. defaults to 55 pixels.\n */\n _jp.Endpoints.Triangle = function (params) {\n this.type = \"Triangle\";\n _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n var self = this;\n params = params || { };\n params.width = params.width || 55;\n params.height = params.height || 55;\n this.width = params.width;\n this.height = params.height;\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n var width = endpointStyle.width || self.width,\n height = endpointStyle.height || self.height,\n x = anchorPoint[0] - (width / 2),\n y = anchorPoint[1] - (height / 2);\n return [ x, y, width, height ];\n };\n };\n// ********************************* END OF ENDPOINT TYPES *******************************************************************\n\n\n// ********************************* OVERLAY DEFINITIONS *********************************************************************** \n\n var AbstractOverlay = _jp.Overlays.AbstractOverlay = function (params) {\n this.visible = true;\n this.isAppendedAtTopLevel = true;\n this.component = params.component;\n this.loc = params.location == null ? 0.5 : params.location;\n this.endpointLoc = params.endpointLocation == null ? [ 0.5, 0.5] : params.endpointLocation;\n this.visible = params.visible !== false;\n };\n AbstractOverlay.prototype = {\n cleanup: function (force) {\n if (force) {\n this.component = null;\n this.canvas = null;\n this.endpointLoc = null;\n }\n },\n reattach:function(instance, component) { },\n setVisible: function (val) {\n this.visible = val;\n this.component.repaint();\n },\n isVisible: function () {\n return this.visible;\n },\n hide: function () {\n this.setVisible(false);\n },\n show: function () {\n this.setVisible(true);\n },\n incrementLocation: function (amount) {\n this.loc += amount;\n this.component.repaint();\n },\n setLocation: function (l) {\n this.loc = l;\n this.component.repaint();\n },\n getLocation: function () {\n return this.loc;\n },\n updateFrom:function() { }\n };\n\n\n /*\n * Class: Overlays.Arrow\n *\n * An arrow overlay, defined by four points: the head, the two sides of the tail, and a 'foldback' point at some distance along the length\n * of the arrow that lines from each tail point converge into. The foldback point is defined using a decimal that indicates some fraction\n * of the length of the arrow and has a default value of 0.623. A foldback point value of 1 would mean that the arrow had a straight line\n * across the tail.\n */\n /*\n * @constructor\n *\n * @param {Object} params Constructor params.\n * @param {Number} [params.length] Distance in pixels from head to tail baseline. default 20.\n * @param {Number} [params.width] Width in pixels of the tail baseline. default 20.\n * @param {String} [params.fill] Style to use when filling the arrow. defaults to \"black\".\n * @param {String} [params.stroke] Style to use when stroking the arrow. defaults to null, which means the arrow is not stroked.\n * @param {Number} [params.stroke-width] Line width to use when stroking the arrow. defaults to 1, but only used if stroke is not null.\n * @param {Number} [params.foldback] Distance (as a decimal from 0 to 1 inclusive) along the length of the arrow marking the point the tail points should fold back to. defaults to 0.623.\n * @param {Number} [params.location] Distance (as a decimal from 0 to 1 inclusive) marking where the arrow should sit on the connector. defaults to 0.5.\n * @param {NUmber} [params.direction] Indicates the direction the arrow points in. valid values are -1 and 1; 1 is default.\n */\n _jp.Overlays.Arrow = function (params) {\n this.type = \"Arrow\";\n AbstractOverlay.apply(this, arguments);\n this.isAppendedAtTopLevel = false;\n params = params || {};\n var self = this;\n\n this.length = params.length || 20;\n this.width = params.width || 20;\n this.id = params.id;\n var direction = (params.direction || 1) < 0 ? -1 : 1,\n paintStyle = params.paintStyle || { \"stroke-width\": 1 },\n // how far along the arrow the lines folding back in come to. default is 62.3%.\n foldback = params.foldback || 0.623;\n\n this.computeMaxSize = function () {\n return self.width * 1.5;\n };\n\n this.elementCreated = function(p, component) {\n this.path = p;\n if (params.events) {\n for (var i in params.events) {\n _jp.on(p, i, params.events[i]);\n }\n }\n };\n\n this.draw = function (component, currentConnectionPaintStyle) {\n\n var hxy, mid, txy, tail, cxy;\n if (component.pointAlongPathFrom) {\n\n if (_ju.isString(this.loc) || this.loc > 1 || this.loc < 0) {\n var l = parseInt(this.loc, 10),\n fromLoc = this.loc < 0 ? 1 : 0;\n hxy = component.pointAlongPathFrom(fromLoc, l, false);\n mid = component.pointAlongPathFrom(fromLoc, l - (direction * this.length / 2), false);\n txy = _jg.pointOnLine(hxy, mid, this.length);\n }\n else if (this.loc === 1) {\n hxy = component.pointOnPath(this.loc);\n mid = component.pointAlongPathFrom(this.loc, -(this.length));\n txy = _jg.pointOnLine(hxy, mid, this.length);\n\n if (direction === -1) {\n var _ = txy;\n txy = hxy;\n hxy = _;\n }\n }\n else if (this.loc === 0) {\n txy = component.pointOnPath(this.loc);\n mid = component.pointAlongPathFrom(this.loc, this.length);\n hxy = _jg.pointOnLine(txy, mid, this.length);\n if (direction === -1) {\n var __ = txy;\n txy = hxy;\n hxy = __;\n }\n }\n else {\n hxy = component.pointAlongPathFrom(this.loc, direction * this.length / 2);\n mid = component.pointOnPath(this.loc);\n txy = _jg.pointOnLine(hxy, mid, this.length);\n }\n\n tail = _jg.perpendicularLineTo(hxy, txy, this.width);\n cxy = _jg.pointOnLine(hxy, txy, foldback * this.length);\n\n var d = { hxy: hxy, tail: tail, cxy: cxy },\n stroke = paintStyle.stroke || currentConnectionPaintStyle.stroke,\n fill = paintStyle.fill || currentConnectionPaintStyle.stroke,\n lineWidth = paintStyle.strokeWidth || currentConnectionPaintStyle.strokeWidth;\n\n return {\n component: component,\n d: d,\n \"stroke-width\": lineWidth,\n stroke: stroke,\n fill: fill,\n minX: Math.min(hxy.x, tail[0].x, tail[1].x),\n maxX: Math.max(hxy.x, tail[0].x, tail[1].x),\n minY: Math.min(hxy.y, tail[0].y, tail[1].y),\n maxY: Math.max(hxy.y, tail[0].y, tail[1].y)\n };\n }\n else {\n return {component: component, minX: 0, maxX: 0, minY: 0, maxY: 0};\n }\n };\n };\n _ju.extend(_jp.Overlays.Arrow, AbstractOverlay, {\n updateFrom:function(d) {\n this.length = d.length || this.length;\n this.width = d.width|| this.width;\n this.direction = d.direction != null ? d.direction : this.direction;\n this.foldback = d.foldback|| this.foldback;\n },\n cleanup:function() {\n if (this.path && this.canvas) {\n this.canvas.removeChild(this.path);\n }\n }\n });\n\n /*\n * Class: Overlays.PlainArrow\n *\n * A basic arrow. This is in fact just one instance of the more generic case in which the tail folds back on itself to some\n * point along the length of the arrow: in this case, that foldback point is the full length of the arrow. so it just does\n * a 'call' to Arrow with foldback set appropriately.\n */\n /*\n * Function: Constructor\n * See for allowed parameters for this overlay.\n */\n _jp.Overlays.PlainArrow = function (params) {\n params = params || {};\n var p = _jp.extend(params, {foldback: 1});\n _jp.Overlays.Arrow.call(this, p);\n this.type = \"PlainArrow\";\n };\n _ju.extend(_jp.Overlays.PlainArrow, _jp.Overlays.Arrow);\n\n /*\n * Class: Overlays.Diamond\n * \n * A diamond. Like PlainArrow, this is a concrete case of the more generic case of the tail points converging on some point...it just\n * happens that in this case, that point is greater than the length of the the arrow.\n *\n * this could probably do with some help with positioning...due to the way it reuses the Arrow paint code, what Arrow thinks is the\n * center is actually 1/4 of the way along for this guy. but we don't have any knowledge of pixels at this point, so we're kind of\n * stuck when it comes to helping out the Arrow class. possibly we could pass in a 'transpose' parameter or something. the value\n * would be -l/4 in this case - move along one quarter of the total length.\n */\n /*\n * Function: Constructor\n * See for allowed parameters for this overlay.\n */\n _jp.Overlays.Diamond = function (params) {\n params = params || {};\n var l = params.length || 40,\n p = _jp.extend(params, {length: l / 2, foldback: 2});\n _jp.Overlays.Arrow.call(this, p);\n this.type = \"Diamond\";\n };\n _ju.extend(_jp.Overlays.Diamond, _jp.Overlays.Arrow);\n\n var _getDimensions = function (component, forceRefresh) {\n if (component._jsPlumb.cachedDimensions == null || forceRefresh) {\n component._jsPlumb.cachedDimensions = component.getDimensions();\n }\n return component._jsPlumb.cachedDimensions;\n };\n\n // abstract superclass for overlays that add an element to the DOM.\n var AbstractDOMOverlay = function (params) {\n _jp.jsPlumbUIComponent.apply(this, arguments);\n AbstractOverlay.apply(this, arguments);\n\n // hand off fired events to associated component.\n var _f = this.fire;\n this.fire = function () {\n _f.apply(this, arguments);\n if (this.component) {\n this.component.fire.apply(this.component, arguments);\n }\n };\n\n this.detached=false;\n this.id = params.id;\n this._jsPlumb.div = null;\n this._jsPlumb.initialised = false;\n this._jsPlumb.component = params.component;\n this._jsPlumb.cachedDimensions = null;\n this._jsPlumb.create = params.create;\n this._jsPlumb.initiallyInvisible = params.visible === false;\n\n this.getElement = function () {\n if (this._jsPlumb.div == null) {\n var div = this._jsPlumb.div = _jp.getElement(this._jsPlumb.create(this._jsPlumb.component));\n div.style.position = \"absolute\";\n jsPlumb.addClass(div, this._jsPlumb.instance.overlayClass + \" \" +\n (this.cssClass ? this.cssClass :\n params.cssClass ? params.cssClass : \"\"));\n this._jsPlumb.instance.appendElement(div);\n this._jsPlumb.instance.getId(div);\n this.canvas = div;\n\n // in IE the top left corner is what it placed at the desired location. This will not\n // be fixed. IE8 is not going to be supported for much longer.\n var ts = \"translate(-50%, -50%)\";\n div.style.webkitTransform = ts;\n div.style.mozTransform = ts;\n div.style.msTransform = ts;\n div.style.oTransform = ts;\n div.style.transform = ts;\n\n // write the related component into the created element\n div._jsPlumb = this;\n\n if (params.visible === false) {\n div.style.display = \"none\";\n }\n }\n return this._jsPlumb.div;\n };\n\n this.draw = function (component, currentConnectionPaintStyle, absolutePosition) {\n var td = _getDimensions(this);\n if (td != null && td.length === 2) {\n var cxy = { x: 0, y: 0 };\n\n // absolutePosition would have been set by a call to connection.setAbsoluteOverlayPosition.\n if (absolutePosition) {\n cxy = { x: absolutePosition[0], y: absolutePosition[1] };\n }\n else if (component.pointOnPath) {\n var loc = this.loc, absolute = false;\n if (_ju.isString(this.loc) || this.loc < 0 || this.loc > 1) {\n loc = parseInt(this.loc, 10);\n absolute = true;\n }\n cxy = component.pointOnPath(loc, absolute); // a connection\n }\n else {\n var locToUse = this.loc.constructor === Array ? this.loc : this.endpointLoc;\n cxy = { x: locToUse[0] * component.w,\n y: locToUse[1] * component.h };\n }\n\n var minx = cxy.x - (td[0] / 2),\n miny = cxy.y - (td[1] / 2);\n\n return {\n component: component,\n d: { minx: minx, miny: miny, td: td, cxy: cxy },\n minX: minx,\n maxX: minx + td[0],\n minY: miny,\n maxY: miny + td[1]\n };\n }\n else {\n return {minX: 0, maxX: 0, minY: 0, maxY: 0};\n }\n };\n };\n _ju.extend(AbstractDOMOverlay, [_jp.jsPlumbUIComponent, AbstractOverlay], {\n getDimensions: function () {\n return [1,1];\n },\n setVisible: function (state) {\n if (this._jsPlumb.div) {\n this._jsPlumb.div.style.display = state ? \"block\" : \"none\";\n // if initially invisible, dimensions are 0,0 and never get updated\n if (state && this._jsPlumb.initiallyInvisible) {\n _getDimensions(this, true);\n this.component.repaint();\n this._jsPlumb.initiallyInvisible = false;\n }\n }\n },\n /*\n * Function: clearCachedDimensions\n * Clears the cached dimensions for the label. As a performance enhancement, label dimensions are\n * cached from 1.3.12 onwards. The cache is cleared when you change the label text, of course, but\n * there are other reasons why the text dimensions might change - if you make a change through CSS, for\n * example, you might change the font size. in that case you should explicitly call this method.\n */\n clearCachedDimensions: function () {\n this._jsPlumb.cachedDimensions = null;\n },\n cleanup: function (force) {\n if (force) {\n if (this._jsPlumb.div != null) {\n this._jsPlumb.div._jsPlumb = null;\n this._jsPlumb.instance.removeElement(this._jsPlumb.div);\n }\n }\n else {\n // if not a forced cleanup, just detach child from parent for now.\n if (this._jsPlumb && this._jsPlumb.div && this._jsPlumb.div.parentNode) {\n this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div);\n }\n this.detached = true;\n }\n\n },\n reattach:function(instance, component) {\n if (this._jsPlumb.div != null) {\n instance.getContainer().appendChild(this._jsPlumb.div);\n }\n this.detached = false;\n },\n computeMaxSize: function () {\n var td = _getDimensions(this);\n return Math.max(td[0], td[1]);\n },\n paint: function (p, containerExtents) {\n if (!this._jsPlumb.initialised) {\n this.getElement();\n p.component.appendDisplayElement(this._jsPlumb.div);\n this._jsPlumb.initialised = true;\n if (this.detached) {\n this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div);\n }\n }\n this._jsPlumb.div.style.left = (p.component.x + p.d.minx) + \"px\";\n this._jsPlumb.div.style.top = (p.component.y + p.d.miny) + \"px\";\n }\n });\n\n /*\n * Class: Overlays.Custom\n * A Custom overlay. You supply a 'create' function which returns some DOM element, and jsPlumb positions it.\n * The 'create' function is passed a Connection or Endpoint.\n */\n /*\n * Function: Constructor\n * \n * Parameters:\n * create - function for jsPlumb to call that returns a DOM element.\n * location - distance (as a decimal from 0 to 1 inclusive) marking where the label should sit on the connector. defaults to 0.5.\n * id - optional id to use for later retrieval of this overlay.\n *\n */\n _jp.Overlays.Custom = function (params) {\n this.type = \"Custom\";\n AbstractDOMOverlay.apply(this, arguments);\n };\n _ju.extend(_jp.Overlays.Custom, AbstractDOMOverlay);\n\n _jp.Overlays.GuideLines = function () {\n var self = this;\n self.length = 50;\n self.strokeWidth = 5;\n this.type = \"GuideLines\";\n AbstractOverlay.apply(this, arguments);\n _jp.jsPlumbUIComponent.apply(this, arguments);\n this.draw = function (connector, currentConnectionPaintStyle) {\n\n var head = connector.pointAlongPathFrom(self.loc, self.length / 2),\n mid = connector.pointOnPath(self.loc),\n tail = _jg.pointOnLine(head, mid, self.length),\n tailLine = _jg.perpendicularLineTo(head, tail, 40),\n headLine = _jg.perpendicularLineTo(tail, head, 20);\n\n return {\n connector: connector,\n head: head,\n tail: tail,\n headLine: headLine,\n tailLine: tailLine,\n minX: Math.min(head.x, tail.x, headLine[0].x, headLine[1].x),\n minY: Math.min(head.y, tail.y, headLine[0].y, headLine[1].y),\n maxX: Math.max(head.x, tail.x, headLine[0].x, headLine[1].x),\n maxY: Math.max(head.y, tail.y, headLine[0].y, headLine[1].y)\n };\n };\n\n // this.cleanup = function() { }; // nothing to clean up for GuideLines\n };\n\n /*\n * Class: Overlays.Label\n\n */\n /*\n * Function: Constructor\n * \n * Parameters:\n * cssClass - optional css class string to append to css class. This string is appended \"as-is\", so you can of course have multiple classes\n * defined. This parameter is preferred to using labelStyle, borderWidth and borderStyle.\n * label - the label to paint. May be a string or a function that returns a string. Nothing will be painted if your label is null or your\n * label function returns null. empty strings _will_ be painted.\n * location - distance (as a decimal from 0 to 1 inclusive) marking where the label should sit on the connector. defaults to 0.5.\n * id - optional id to use for later retrieval of this overlay.\n * \n *\n */\n _jp.Overlays.Label = function (params) {\n this.labelStyle = params.labelStyle;\n\n var labelWidth = null, labelHeight = null, labelText = null, labelPadding = null;\n this.cssClass = this.labelStyle != null ? this.labelStyle.cssClass : null;\n var p = _jp.extend({\n create: function () {\n return _jp.createElement(\"div\");\n }}, params);\n _jp.Overlays.Custom.call(this, p);\n this.type = \"Label\";\n this.label = params.label || \"\";\n this.labelText = null;\n if (this.labelStyle) {\n var el = this.getElement();\n this.labelStyle.font = this.labelStyle.font || \"12px sans-serif\";\n el.style.font = this.labelStyle.font;\n el.style.color = this.labelStyle.color || \"black\";\n if (this.labelStyle.fill) {\n el.style.background = this.labelStyle.fill;\n }\n if (this.labelStyle.borderWidth > 0) {\n var dStyle = this.labelStyle.borderStyle ? this.labelStyle.borderStyle : \"black\";\n el.style.border = this.labelStyle.borderWidth + \"px solid \" + dStyle;\n }\n if (this.labelStyle.padding) {\n el.style.padding = this.labelStyle.padding;\n }\n }\n\n };\n _ju.extend(_jp.Overlays.Label, _jp.Overlays.Custom, {\n cleanup: function (force) {\n if (force) {\n this.div = null;\n this.label = null;\n this.labelText = null;\n this.cssClass = null;\n this.labelStyle = null;\n }\n },\n getLabel: function () {\n return this.label;\n },\n /*\n * Function: setLabel\n * sets the label's, um, label. you would think i'd call this function\n * 'setText', but you can pass either a Function or a String to this, so\n * it makes more sense as 'setLabel'. This uses innerHTML on the label div, so keep\n * that in mind if you need escaped HTML.\n */\n setLabel: function (l) {\n this.label = l;\n this.labelText = null;\n this.clearCachedDimensions();\n this.update();\n this.component.repaint();\n },\n getDimensions: function () {\n this.update();\n return AbstractDOMOverlay.prototype.getDimensions.apply(this, arguments);\n },\n update: function () {\n if (typeof this.label === \"function\") {\n var lt = this.label(this);\n this.getElement().innerHTML = lt.replace(/\\r\\n/g, \"
\");\n }\n else {\n if (this.labelText == null) {\n this.labelText = this.label;\n this.getElement().innerHTML = this.labelText.replace(/\\r\\n/g, \"
\");\n }\n }\n },\n updateFrom:function(d) {\n if(d.label != null){\n this.setLabel(d.label);\n }\n }\n });\n\n // ********************************* END OF OVERLAY DEFINITIONS ***********************************************************************\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function() {\n \"use strict\";\n\n var root = this,\n _ju = root.jsPlumbUtil,\n _jpi = root.jsPlumbInstance;\n\n var GROUP_COLLAPSED_CLASS = \"jtk-group-collapsed\";\n var GROUP_EXPANDED_CLASS = \"jtk-group-expanded\";\n var GROUP_CONTAINER_SELECTOR = \"[jtk-group-content]\";\n var ELEMENT_DRAGGABLE_EVENT = \"elementDraggable\";\n var STOP = \"stop\";\n var REVERT = \"revert\";\n var GROUP_MANAGER = \"_groupManager\";\n var GROUP = \"_jsPlumbGroup\";\n var GROUP_DRAG_SCOPE = \"_jsPlumbGroupDrag\";\n var EVT_CHILD_ADDED = \"group:addMember\";\n var EVT_CHILD_REMOVED = \"group:removeMember\";\n var EVT_GROUP_ADDED = \"group:add\";\n var EVT_GROUP_REMOVED = \"group:remove\";\n var EVT_EXPAND = \"group:expand\";\n var EVT_COLLAPSE = \"group:collapse\";\n var EVT_GROUP_DRAG_STOP = \"groupDragStop\";\n var EVT_CONNECTION_MOVED = \"connectionMoved\";\n var EVT_INTERNAL_CONNECTION_DETACHED = \"internal.connectionDetached\";\n\n var CMD_REMOVE_ALL = \"removeAll\";\n var CMD_ORPHAN_ALL = \"orphanAll\";\n var CMD_SHOW = \"show\";\n var CMD_HIDE = \"hide\";\n\n var GroupManager = function(_jsPlumb) {\n var _managedGroups = {}, _connectionSourceMap = {}, _connectionTargetMap = {}, self = this;\n\n _jsPlumb.bind(\"connection\", function(p) {\n if (p.source[GROUP] != null && p.target[GROUP] != null && p.source[GROUP] === p.target[GROUP]) {\n _connectionSourceMap[p.connection.id] = p.source[GROUP];\n _connectionTargetMap[p.connection.id] = p.source[GROUP];\n }\n else {\n if (p.source[GROUP] != null) {\n _ju.suggest(p.source[GROUP].connections.source, p.connection);\n _connectionSourceMap[p.connection.id] = p.source[GROUP];\n }\n if (p.target[GROUP] != null) {\n _ju.suggest(p.target[GROUP].connections.target, p.connection);\n _connectionTargetMap[p.connection.id] = p.target[GROUP];\n }\n }\n });\n\n function _cleanupDetachedConnection(conn) {\n delete conn.proxies;\n var group = _connectionSourceMap[conn.id], f;\n if (group != null) {\n f = function(c) { return c.id === conn.id; };\n _ju.removeWithFunction(group.connections.source, f);\n _ju.removeWithFunction(group.connections.target, f);\n delete _connectionSourceMap[conn.id];\n }\n\n group = _connectionTargetMap[conn.id];\n if (group != null) {\n f = function(c) { return c.id === conn.id; };\n _ju.removeWithFunction(group.connections.source, f);\n _ju.removeWithFunction(group.connections.target, f);\n delete _connectionTargetMap[conn.id];\n }\n }\n\n _jsPlumb.bind(EVT_INTERNAL_CONNECTION_DETACHED, function(p) {\n _cleanupDetachedConnection(p.connection);\n });\n\n _jsPlumb.bind(EVT_CONNECTION_MOVED, function(p) {\n var connMap = p.index === 0 ? _connectionSourceMap : _connectionTargetMap;\n var group = connMap[p.connection.id];\n if (group) {\n var list = group.connections[p.index === 0 ? \"source\" : \"target\"];\n var idx = list.indexOf(p.connection);\n if (idx !== -1) {\n list.splice(idx, 1);\n }\n }\n });\n\n this.addGroup = function(group) {\n _jsPlumb.addClass(group.getEl(), GROUP_EXPANDED_CLASS);\n _managedGroups[group.id] = group;\n group.manager = this;\n _updateConnectionsForGroup(group);\n _jsPlumb.fire(EVT_GROUP_ADDED, { group:group });\n };\n\n this.addToGroup = function(group, el, doNotFireEvent) {\n group = this.getGroup(group);\n if (group) {\n var groupEl = group.getEl();\n\n if (el._isJsPlumbGroup) {\n return;\n }\n var currentGroup = el._jsPlumbGroup;\n // if already a member of this group, do nothing\n if (currentGroup !== group) {\n var elpos = _jsPlumb.getOffset(el, true);\n var cpos = group.collapsed ? _jsPlumb.getOffset(groupEl, true) : _jsPlumb.getOffset(group.getDragArea(), true);\n\n // otherwise, transfer to this group.\n if (currentGroup != null) {\n currentGroup.remove(el, false, doNotFireEvent, false, group);\n self.updateConnectionsForGroup(currentGroup);\n }\n group.add(el, doNotFireEvent/*, currentGroup*/);\n\n var handleDroppedConnections = function (list, index) {\n var oidx = index === 0 ? 1 : 0;\n list.each(function (c) {\n c.setVisible(false);\n if (c.endpoints[oidx].element._jsPlumbGroup === group) {\n c.endpoints[oidx].setVisible(false);\n self.expandConnection(c, oidx, group);\n }\n else {\n c.endpoints[index].setVisible(false);\n self.collapseConnection(c, index, group);\n }\n });\n };\n\n if (group.collapsed) {\n handleDroppedConnections(_jsPlumb.select({source: el}), 0);\n handleDroppedConnections(_jsPlumb.select({target: el}), 1);\n }\n\n var elId = _jsPlumb.getId(el);\n _jsPlumb.dragManager.setParent(el, elId, groupEl, _jsPlumb.getId(groupEl), elpos);\n\n var newPosition = { left: elpos.left - cpos.left, top: elpos.top - cpos.top };\n\n _jsPlumb.setPosition(el, newPosition);\n\n _jsPlumb.dragManager.revalidateParent(el, elId, elpos);\n\n self.updateConnectionsForGroup(group);\n\n _jsPlumb.revalidate(elId);\n\n if (!doNotFireEvent) {\n var p = {group: group, el: el};\n if (currentGroup) {\n p.sourceGroup = currentGroup;\n }\n _jsPlumb.fire(EVT_CHILD_ADDED, p);\n }\n }\n }\n };\n\n this.removeFromGroup = function(group, el, doNotFireEvent) {\n group = this.getGroup(group);\n if (group) {\n group.remove(el, null, doNotFireEvent);\n }\n };\n\n this.getGroup = function(groupId) {\n var group = groupId;\n if (_ju.isString(groupId)) {\n group = _managedGroups[groupId];\n if (group == null) {\n throw new TypeError(\"No such group [\" + groupId + \"]\");\n }\n }\n return group;\n };\n\n this.getGroups = function() {\n var o = [];\n for (var g in _managedGroups) {\n o.push(_managedGroups[g]);\n }\n return o;\n };\n\n this.removeGroup = function(group, deleteMembers, manipulateDOM, doNotFireEvent) {\n group = this.getGroup(group);\n this.expandGroup(group, true); // this reinstates any original connections and removes all proxies, but does not fire an event.\n var newPositions = group[deleteMembers ? CMD_REMOVE_ALL : CMD_ORPHAN_ALL](manipulateDOM, doNotFireEvent);\n _jsPlumb.remove(group.getEl());\n delete _managedGroups[group.id];\n delete _jsPlumb._groups[group.id];\n _jsPlumb.fire(EVT_GROUP_REMOVED, { group:group });\n return newPositions; // this will be null in the case or remove, but be a map of {id->[x,y]} in the case of orphan\n };\n\n this.removeAllGroups = function(deleteMembers, manipulateDOM, doNotFireEvent) {\n for (var g in _managedGroups) {\n this.removeGroup(_managedGroups[g], deleteMembers, manipulateDOM, doNotFireEvent);\n }\n };\n\n function _setVisible(group, state) {\n var m = group.getMembers();\n for (var i = 0; i < m.length; i++) {\n _jsPlumb[state ? CMD_SHOW : CMD_HIDE](m[i], true);\n }\n }\n\n var _collapseConnection = this.collapseConnection = function(c, index, group) {\n\n var proxyEp, groupEl = group.getEl(), groupElId = _jsPlumb.getId(groupEl),\n originalElementId = c.endpoints[index].elementId;\n\n var otherEl = c.endpoints[index === 0 ? 1 : 0].element;\n if (otherEl[GROUP] && (!otherEl[GROUP].shouldProxy() && otherEl[GROUP].collapsed)) {\n return;\n }\n\n c.proxies = c.proxies || [];\n if(c.proxies[index]) {\n proxyEp = c.proxies[index].ep;\n }else {\n proxyEp = _jsPlumb.addEndpoint(groupEl, {\n endpoint:group.getEndpoint(c, index),\n anchor:group.getAnchor(c, index),\n parameters:{\n isProxyEndpoint:true\n }\n });\n }\n proxyEp.setDeleteOnEmpty(true);\n\n // for this index, stash proxy info: the new EP, the original EP.\n c.proxies[index] = { ep:proxyEp, originalEp: c.endpoints[index] };\n\n // and advise the anchor manager\n if (index === 0) {\n // TODO why are there two differently named methods? Why is there not one method that says \"some end of this\n // connection changed (you give the index), and here's the new element and element id.\"\n _jsPlumb.anchorManager.sourceChanged(originalElementId, groupElId, c, groupEl);\n }\n else {\n _jsPlumb.anchorManager.updateOtherEndpoint(c.endpoints[0].elementId, originalElementId, groupElId, c);\n c.target = groupEl;\n c.targetId = groupElId;\n }\n\n\n // detach the original EP from the connection.\n c.proxies[index].originalEp.detachFromConnection(c, null, true);\n\n // set the proxy as the new ep\n proxyEp.connections = [ c ];\n c.endpoints[index] = proxyEp;\n\n c.setVisible(true);\n };\n\n this.collapseGroup = function(group) {\n group = this.getGroup(group);\n if (group == null || group.collapsed) {\n return;\n }\n var groupEl = group.getEl();\n\n // todo remove old proxy endpoints first, just in case?\n //group.proxies.length = 0;\n\n // hide all connections\n _setVisible(group, false);\n\n if (group.shouldProxy()) {\n // collapses all connections in a group.\n var _collapseSet = function (conns, index) {\n for (var i = 0; i < conns.length; i++) {\n var c = conns[i];\n _collapseConnection(c, index, group);\n }\n };\n\n // setup proxies for sources and targets\n _collapseSet(group.connections.source, 0);\n _collapseSet(group.connections.target, 1);\n }\n\n group.collapsed = true;\n _jsPlumb.removeClass(groupEl, GROUP_EXPANDED_CLASS);\n _jsPlumb.addClass(groupEl, GROUP_COLLAPSED_CLASS);\n _jsPlumb.revalidate(groupEl);\n _jsPlumb.fire(EVT_COLLAPSE, { group:group });\n };\n\n var _expandConnection = this.expandConnection = function(c, index, group) {\n\n // if no proxies or none for this end of the connection, abort.\n if (c.proxies == null || c.proxies[index] == null) {\n return;\n }\n\n var groupElId = _jsPlumb.getId(group.getEl()),\n originalElement = c.proxies[index].originalEp.element,\n originalElementId = c.proxies[index].originalEp.elementId;\n\n c.endpoints[index] = c.proxies[index].originalEp;\n // and advise the anchor manager\n if (index === 0) {\n // TODO why are there two differently named methods? Why is there not one method that says \"some end of this\n // connection changed (you give the index), and here's the new element and element id.\"\n _jsPlumb.anchorManager.sourceChanged(groupElId, originalElementId, c, originalElement);\n }\n else {\n _jsPlumb.anchorManager.updateOtherEndpoint(c.endpoints[0].elementId, groupElId, originalElementId, c);\n c.target = originalElement;\n c.targetId = originalElementId;\n }\n\n // detach the proxy EP from the connection (which will cause it to be removed as we no longer need it)\n c.proxies[index].ep.detachFromConnection(c, null);\n\n c.proxies[index].originalEp.addConnection(c);\n\n // cleanup\n delete c.proxies[index];\n };\n\n this.expandGroup = function(group, doNotFireEvent) {\n\n group = this.getGroup(group);\n\n if (group == null || !group.collapsed) {\n return;\n }\n var groupEl = group.getEl();\n\n _setVisible(group, true);\n\n if (group.shouldProxy()) {\n // collapses all connections in a group.\n var _expandSet = function (conns, index) {\n for (var i = 0; i < conns.length; i++) {\n var c = conns[i];\n _expandConnection(c, index, group);\n }\n };\n\n // setup proxies for sources and targets\n _expandSet(group.connections.source, 0);\n _expandSet(group.connections.target, 1);\n }\n\n group.collapsed = false;\n _jsPlumb.addClass(groupEl, GROUP_EXPANDED_CLASS);\n _jsPlumb.removeClass(groupEl, GROUP_COLLAPSED_CLASS);\n _jsPlumb.revalidate(groupEl);\n this.repaintGroup(group);\n if (!doNotFireEvent) {\n _jsPlumb.fire(EVT_EXPAND, { group: group});\n }\n };\n\n this.repaintGroup = function(group) {\n group = this.getGroup(group);\n var m = group.getMembers();\n for (var i = 0; i < m.length; i++) {\n _jsPlumb.revalidate(m[i]);\n }\n };\n\n // TODO refactor this with the code that responds to `connection` events.\n function _updateConnectionsForGroup(group) {\n var members = group.getMembers();\n var c1 = _jsPlumb.getConnections({source:members, scope:\"*\"}, true);\n var c2 = _jsPlumb.getConnections({target:members, scope:\"*\"}, true);\n var processed = {};\n group.connections.source.length = 0;\n group.connections.target.length = 0;\n var oneSet = function(c) {\n for (var i = 0; i < c.length; i++) {\n if (processed[c[i].id]) {\n continue;\n }\n processed[c[i].id] = true;\n if (c[i].source._jsPlumbGroup === group) {\n if (c[i].target._jsPlumbGroup !== group) {\n group.connections.source.push(c[i]);\n }\n _connectionSourceMap[c[i].id] = group;\n }\n else if (c[i].target._jsPlumbGroup === group) {\n group.connections.target.push(c[i]);\n _connectionTargetMap[c[i].id] = group;\n }\n }\n };\n oneSet(c1); oneSet(c2);\n }\n\n this.updateConnectionsForGroup = _updateConnectionsForGroup;\n this.refreshAllGroups = function() {\n for (var g in _managedGroups) {\n _updateConnectionsForGroup(_managedGroups[g]);\n _jsPlumb.dragManager.updateOffsets(_jsPlumb.getId(_managedGroups[g].getEl()));\n }\n };\n };\n\n /**\n *\n * @param {jsPlumbInstance} _jsPlumb Associated jsPlumb instance.\n * @param {Object} params\n * @param {Element} params.el The DOM element representing the Group.\n * @param {String} [params.id] Optional ID for the Group. A UUID will be assigned as the Group's ID if you do not provide one.\n * @param {Boolean} [params.constrain=false] If true, child elements will not be able to be dragged outside of the Group container.\n * @param {Boolean} [params.revert=true] By default, child elements revert to the container if dragged outside. You can change this by setting `revert:false`. This behaviour is also overridden if you set `orphan` or `prune`.\n * @param {Boolean} [params.orphan=false] If true, child elements dropped outside of the Group container will be removed from the Group (but not from the DOM).\n * @param {Boolean} [params.prune=false] If true, child elements dropped outside of the Group container will be removed from the Group and also from the DOM.\n * @param {Boolean} [params.dropOverride=false] If true, a child element that has been dropped onto some other Group will not be subject to the controls imposed by `prune`, `revert` or `orphan`.\n * @constructor\n */\n var Group = function(_jsPlumb, params) {\n var self = this;\n var el = params.el;\n this.getEl = function() { return el; };\n this.id = params.id || _ju.uuid();\n el._isJsPlumbGroup = true;\n\n var getDragArea = this.getDragArea = function() {\n var da = _jsPlumb.getSelector(el, GROUP_CONTAINER_SELECTOR);\n return da && da.length > 0 ? da[0] : el;\n };\n\n var ghost = params.ghost === true;\n var constrain = ghost || (params.constrain === true);\n var revert = params.revert !== false;\n var orphan = params.orphan === true;\n var prune = params.prune === true;\n var dropOverride = params.dropOverride === true;\n var proxied = params.proxied !== false;\n var elements = [];\n this.connections = { source:[], target:[], internal:[] };\n\n // this function, and getEndpoint below, are stubs for a future setup in which we can choose endpoint\n // and anchor based upon the connection and the index (source/target) of the endpoint to be proxied.\n this.getAnchor = function(conn, endpointIndex) {\n return params.anchor || \"Continuous\";\n };\n\n this.getEndpoint = function(conn, endpointIndex) {\n return params.endpoint || [ \"Dot\", { radius:10 }];\n };\n\n this.collapsed = false;\n if (params.draggable !== false) {\n var opts = {\n stop:function(params) {\n _jsPlumb.fire(EVT_GROUP_DRAG_STOP, jsPlumb.extend(params, {group:self}));\n },\n scope:GROUP_DRAG_SCOPE\n };\n if (params.dragOptions) {\n root.jsPlumb.extend(opts, params.dragOptions);\n }\n _jsPlumb.draggable(params.el, opts);\n }\n if (params.droppable !== false) {\n _jsPlumb.droppable(params.el, {\n drop:function(p) {\n var el = p.drag.el;\n if (el._isJsPlumbGroup) {\n return;\n }\n var currentGroup = el._jsPlumbGroup;\n if (currentGroup !== self) {\n if (currentGroup != null) {\n if (currentGroup.overrideDrop(el, self)) {\n return;\n }\n }\n _jsPlumb.getGroupManager().addToGroup(self, el, false);\n }\n\n }\n });\n }\n var _each = function(_el, fn) {\n var els = _el.nodeType == null ? _el : [ _el ];\n for (var i = 0; i < els.length; i++) {\n fn(els[i]);\n }\n };\n\n this.overrideDrop = function(_el, targetGroup) {\n return dropOverride && (revert || prune || orphan);\n };\n\n this.add = function(_el, doNotFireEvent/*, sourceGroup*/) {\n var dragArea = getDragArea();\n _each(_el, function(__el) {\n\n if (__el._jsPlumbGroup != null) {\n if (__el._jsPlumbGroup === self) {\n return;\n } else {\n __el._jsPlumbGroup.remove(__el, true, doNotFireEvent, false);\n }\n }\n\n __el._jsPlumbGroup = self;\n elements.push(__el);\n // test if draggable and add handlers if so.\n if (_jsPlumb.isAlreadyDraggable(__el)) {\n _bindDragHandlers(__el);\n }\n\n if (__el.parentNode !== dragArea) {\n dragArea.appendChild(__el);\n }\n\n // if (!doNotFireEvent) {\n // var p = {group: self, el: __el};\n // if (sourceGroup) {\n // p.sourceGroup = sourceGroup;\n // }\n // //_jsPlumb.fire(EVT_CHILD_ADDED, p);\n // }\n });\n\n _jsPlumb.getGroupManager().updateConnectionsForGroup(self);\n };\n\n this.remove = function(el, manipulateDOM, doNotFireEvent, doNotUpdateConnections, targetGroup) {\n\n _each(el, function(__el) {\n delete __el._jsPlumbGroup;\n _ju.removeWithFunction(elements, function(e) {\n return e === __el;\n });\n\n if (manipulateDOM) {\n try { self.getDragArea().removeChild(__el); }\n catch (e) {\n jsPlumbUtil.log(\"Could not remove element from Group \" + e);\n }\n }\n _unbindDragHandlers(__el);\n if (!doNotFireEvent) {\n var p = {group: self, el: __el};\n if (targetGroup) {\n p.targetGroup = targetGroup;\n }\n _jsPlumb.fire(EVT_CHILD_REMOVED, p);\n }\n });\n if (!doNotUpdateConnections) {\n _jsPlumb.getGroupManager().updateConnectionsForGroup(self);\n }\n };\n this.removeAll = function(manipulateDOM, doNotFireEvent) {\n for (var i = 0, l = elements.length; i < l; i++) {\n var el = elements[0];\n self.remove(el, manipulateDOM, doNotFireEvent, true);\n _jsPlumb.remove(el, true);\n }\n elements.length = 0;\n _jsPlumb.getGroupManager().updateConnectionsForGroup(self);\n };\n this.orphanAll = function() {\n var orphanedPositions = {};\n for (var i = 0; i < elements.length; i++) {\n var newPosition = _orphan(elements[i]);\n orphanedPositions[newPosition[0]] = newPosition[1];\n }\n elements.length = 0;\n\n return orphanedPositions;\n };\n this.getMembers = function() { return elements; };\n\n el[GROUP] = this;\n\n _jsPlumb.bind(ELEMENT_DRAGGABLE_EVENT, function(dragParams) {\n // if its for the current group,\n if (dragParams.el._jsPlumbGroup === this) {\n _bindDragHandlers(dragParams.el);\n }\n }.bind(this));\n\n function _findParent(_el) {\n return _el.offsetParent;\n }\n\n function _isInsideParent(_el, pos) {\n var p = _findParent(_el),\n s = _jsPlumb.getSize(p),\n ss = _jsPlumb.getSize(_el),\n leftEdge = pos[0],\n rightEdge = leftEdge + ss[0],\n topEdge = pos[1],\n bottomEdge = topEdge + ss[1];\n\n return rightEdge > 0 && leftEdge < s[0] && bottomEdge > 0 && topEdge < s[1];\n }\n\n //\n // orphaning an element means taking it out of the group and adding it to the main jsplumb container.\n // we return the new calculated position from this method and the element's id.\n //\n function _orphan(_el) {\n var id = _jsPlumb.getId(_el);\n var pos = _jsPlumb.getOffset(_el);\n _el.parentNode.removeChild(_el);\n _jsPlumb.getContainer().appendChild(_el);\n _jsPlumb.setPosition(_el, pos);\n delete _el._jsPlumbGroup;\n _unbindDragHandlers(_el);\n _jsPlumb.dragManager.clearParent(_el, id);\n return [id, pos];\n }\n\n //\n // remove an element from the group, then either prune it from the jsplumb instance, or just orphan it.\n //\n function _pruneOrOrphan(p) {\n var orphanedPosition = null;\n if (!_isInsideParent(p.el, p.pos)) {\n var group = p.el._jsPlumbGroup;\n if (prune) {\n _jsPlumb.remove(p.el);\n } else {\n orphanedPosition = _orphan(p.el);\n }\n\n group.remove(p.el);\n }\n\n return orphanedPosition;\n }\n\n //\n // redraws the element\n //\n function _revalidate(_el) {\n var id = _jsPlumb.getId(_el);\n _jsPlumb.revalidate(_el);\n _jsPlumb.dragManager.revalidateParent(_el, id);\n }\n\n //\n // unbind the group specific drag/revert handlers.\n //\n function _unbindDragHandlers(_el) {\n if (!_el._katavorioDrag) {\n return;\n }\n if (prune || orphan) {\n _el._katavorioDrag.off(STOP, _pruneOrOrphan);\n }\n if (!prune && !orphan && revert) {\n _el._katavorioDrag.off(REVERT, _revalidate);\n _el._katavorioDrag.setRevert(null);\n }\n }\n\n function _bindDragHandlers(_el) {\n if (!_el._katavorioDrag) {\n return;\n }\n if (prune || orphan) {\n _el._katavorioDrag.on(STOP, _pruneOrOrphan);\n }\n\n if (constrain) {\n _el._katavorioDrag.setConstrain(true);\n }\n\n if (ghost) {\n _el._katavorioDrag.setUseGhostProxy(true);\n }\n\n if (!prune && !orphan && revert) {\n _el._katavorioDrag.on(REVERT, _revalidate);\n _el._katavorioDrag.setRevert(function(__el, pos) {\n return !_isInsideParent(__el, pos);\n });\n }\n }\n\n this.shouldProxy = function() {\n return proxied;\n };\n\n _jsPlumb.getGroupManager().addGroup(this);\n };\n\n /**\n * Adds a group to the jsPlumb instance.\n * @method addGroup\n * @param {Object} params\n * @return {Group} The newly created Group.\n */\n _jpi.prototype.addGroup = function(params) {\n var j = this;\n j._groups = j._groups || {};\n if (j._groups[params.id] != null) {\n throw new TypeError(\"cannot create Group [\" + params.id + \"]; a Group with that ID exists\");\n }\n if (params.el[GROUP] != null) {\n throw new TypeError(\"cannot create Group [\" + params.id + \"]; the given element is already a Group\");\n }\n var group = new Group(j, params);\n j._groups[group.id] = group;\n if (params.collapsed) {\n this.collapseGroup(group);\n }\n return group;\n };\n\n /**\n * Add an element to a group.\n * @method addToGroup\n * @param {String} group Group, or ID of the group, to add the element to.\n * @param {Element} el Element to add to the group.\n */\n _jpi.prototype.addToGroup = function(group, el, doNotFireEvent) {\n\n var _one = function(_el) {\n var id = this.getId(_el);\n this.manage(id, _el);\n this.getGroupManager().addToGroup(group, _el, doNotFireEvent);\n }.bind(this);\n\n if (Array.isArray(el)) {\n for (var i = 0; i < el.length; i++) {\n _one(el[i]);\n }\n } else {\n _one(el);\n }\n };\n\n /**\n * Remove an element from a group.\n * @method removeFromGroup\n * @param {String} group Group, or ID of the group, to remove the element from.\n * @param {Element} el Element to add to the group.\n */\n _jpi.prototype.removeFromGroup = function(group, el, doNotFireEvent) {\n this.getGroupManager().removeFromGroup(group, el, doNotFireEvent);\n };\n\n /**\n * Remove a group, and optionally remove its members from the jsPlumb instance.\n * @method removeGroup\n * @param {String|Group} group Group to delete, or ID of Group to delete.\n * @param {Boolean} [deleteMembers=false] If true, group members will be removed along with the group. Otherwise they will\n * just be 'orphaned' (returned to the main container).\n * @returns {Map[String, Position}} When deleteMembers is false, this method returns a map of {id->position}\n */\n _jpi.prototype.removeGroup = function(group, deleteMembers, manipulateDOM, doNotFireEvent) {\n return this.getGroupManager().removeGroup(group, deleteMembers, manipulateDOM, doNotFireEvent);\n };\n\n /**\n * Remove all groups, and optionally remove their members from the jsPlumb instance.\n * @method removeAllGroup\n * @param {Boolean} [deleteMembers=false] If true, group members will be removed along with the groups. Otherwise they will\n * just be 'orphaned' (returned to the main container).\n */\n _jpi.prototype.removeAllGroups = function(deleteMembers, manipulateDOM, doNotFireEvent) {\n this.getGroupManager().removeAllGroups(deleteMembers, manipulateDOM, doNotFireEvent);\n };\n\n /**\n * Get a Group\n * @method getGroup\n * @param {String} groupId ID of the group to get\n * @return {Group} Group with the given ID, null if not found.\n */\n _jpi.prototype.getGroup = function(groupId) {\n return this.getGroupManager().getGroup(groupId);\n };\n\n /**\n * Gets all the Groups managed by the jsPlumb instance.\n * @returns {Group[]} List of Groups. Empty if none.\n */\n _jpi.prototype.getGroups = function() {\n return this.getGroupManager().getGroups();\n };\n\n /**\n * Expands a group element. jsPlumb doesn't do \"everything\" for you here, because what it means to expand a Group\n * will vary from application to application. jsPlumb does these things:\n *\n * - Hides any connections that are internal to the group (connections between members, and connections from member of\n * the group to the group itself)\n * - Proxies all connections for which the source or target is a member of the group.\n * - Hides the proxied connections.\n * - Adds the jtk-group-expanded class to the group's element\n * - Removes the jtk-group-collapsed class from the group's element.\n *\n * @method expandGroup\n * @param {String|Group} group Group to expand, or ID of Group to expand.\n */\n _jpi.prototype.expandGroup = function(group) {\n this.getGroupManager().expandGroup(group);\n };\n\n /**\n * Collapses a group element. jsPlumb doesn't do \"everything\" for you here, because what it means to collapse a Group\n * will vary from application to application. jsPlumb does these things:\n *\n * - Shows any connections that are internal to the group (connections between members, and connections from member of\n * the group to the group itself)\n * - Removes proxies for all connections for which the source or target is a member of the group.\n * - Shows the previously proxied connections.\n * - Adds the jtk-group-collapsed class to the group's element\n * - Removes the jtk-group-expanded class from the group's element.\n *\n * @method expandGroup\n * @param {String|Group} group Group to expand, or ID of Group to expand.\n */\n _jpi.prototype.collapseGroup = function(groupId) {\n this.getGroupManager().collapseGroup(groupId);\n };\n\n\n _jpi.prototype.repaintGroup = function(group) {\n this.getGroupManager().repaintGroup(group);\n };\n\n /**\n * Collapses or expands a group element depending on its current state. See notes in the collapseGroup and expandGroup method.\n *\n * @method toggleGroup\n * @param {String|Group} group Group to expand/collapse, or ID of Group to expand/collapse.\n */\n _jpi.prototype.toggleGroup = function(group) {\n group = this.getGroupManager().getGroup(group);\n if (group != null) {\n this.getGroupManager()[group.collapsed ? \"expandGroup\" : \"collapseGroup\"](group);\n }\n };\n\n //\n // lazy init a group manager for the given jsplumb instance.\n //\n _jpi.prototype.getGroupManager = function() {\n var mgr = this[GROUP_MANAGER];\n if (mgr == null) {\n mgr = this[GROUP_MANAGER] = new GroupManager(this);\n }\n return mgr;\n };\n\n _jpi.prototype.removeGroupManager = function() {\n delete this[GROUP_MANAGER];\n };\n\n /**\n * Gets the Group that the given element belongs to, null if none.\n * @method getGroupFor\n * @param {String|Element} el Element, or element ID.\n * @returns {Group} A Group, if found, or null.\n */\n _jpi.prototype.getGroupFor = function(el) {\n el = this.getElement(el);\n if (el) {\n return el[GROUP];\n }\n };\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n\n/*\n * This file contains the 'flowchart' connectors, consisting of vertical and horizontal line segments.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n var STRAIGHT = \"Straight\";\n var ARC = \"Arc\";\n\n var Flowchart = function (params) {\n this.type = \"Flowchart\";\n params = params || {};\n params.stub = params.stub == null ? 30 : params.stub;\n var segments,\n _super = _jp.Connectors.AbstractConnector.apply(this, arguments),\n midpoint = params.midpoint == null ? 0.5 : params.midpoint,\n alwaysRespectStubs = params.alwaysRespectStubs === true,\n lastx = null, lasty = null, lastOrientation,\n cornerRadius = params.cornerRadius != null ? params.cornerRadius : 0,\n\n // TODO now common between this and AbstractBezierEditor; refactor into superclass?\n loopbackRadius = params.loopbackRadius || 25,\n isLoopbackCurrently = false,\n\n sgn = function (n) {\n return n < 0 ? -1 : n === 0 ? 0 : 1;\n },\n segmentDirections = function(segment) {\n return [\n sgn( segment[2] - segment[0] ),\n sgn( segment[3] - segment[1] )\n ];\n },\n /**\n * helper method to add a segment.\n */\n addSegment = function (segments, x, y, paintInfo) {\n if (lastx === x && lasty === y) {\n return;\n }\n var lx = lastx == null ? paintInfo.sx : lastx,\n ly = lasty == null ? paintInfo.sy : lasty,\n o = lx === x ? \"v\" : \"h\";\n\n lastx = x;\n lasty = y;\n segments.push([ lx, ly, x, y, o ]);\n },\n segLength = function (s) {\n return Math.sqrt(Math.pow(s[0] - s[2], 2) + Math.pow(s[1] - s[3], 2));\n },\n _cloneArray = function (a) {\n var _a = [];\n _a.push.apply(_a, a);\n return _a;\n },\n writeSegments = function (conn, segments, paintInfo) {\n var current = null, next, currentDirection, nextDirection;\n for (var i = 0; i < segments.length - 1; i++) {\n\n current = current || _cloneArray(segments[i]);\n next = _cloneArray(segments[i + 1]);\n\n currentDirection = segmentDirections(current);\n nextDirection = segmentDirections(next);\n\n if (cornerRadius > 0 && current[4] !== next[4]) {\n\n var minSegLength = Math.min(segLength(current), segLength(next));\n var radiusToUse = Math.min(cornerRadius, minSegLength / 2);\n\n current[2] -= currentDirection[0] * radiusToUse;\n current[3] -= currentDirection[1] * radiusToUse;\n next[0] += nextDirection[0] * radiusToUse;\n next[1] += nextDirection[1] * radiusToUse;\n\n var ac = (currentDirection[1] === nextDirection[0] && nextDirection[0] === 1) ||\n ((currentDirection[1] === nextDirection[0] && nextDirection[0] === 0) && currentDirection[0] !== nextDirection[1]) ||\n (currentDirection[1] === nextDirection[0] && nextDirection[0] === -1),\n sgny = next[1] > current[3] ? 1 : -1,\n sgnx = next[0] > current[2] ? 1 : -1,\n sgnEqual = sgny === sgnx,\n cx = (sgnEqual && ac || (!sgnEqual && !ac)) ? next[0] : current[2],\n cy = (sgnEqual && ac || (!sgnEqual && !ac)) ? current[3] : next[1];\n\n _super.addSegment(conn, STRAIGHT, {\n x1: current[0], y1: current[1], x2: current[2], y2: current[3]\n });\n\n _super.addSegment(conn, ARC, {\n r: radiusToUse,\n x1: current[2],\n y1: current[3],\n x2: next[0],\n y2: next[1],\n cx: cx,\n cy: cy,\n ac: ac\n });\n }\n else {\n // dx + dy are used to adjust for line width.\n var dx = (current[2] === current[0]) ? 0 : (current[2] > current[0]) ? (paintInfo.lw / 2) : -(paintInfo.lw / 2),\n dy = (current[3] === current[1]) ? 0 : (current[3] > current[1]) ? (paintInfo.lw / 2) : -(paintInfo.lw / 2);\n\n _super.addSegment(conn, STRAIGHT, {\n x1: current[0] - dx, y1: current[1] - dy, x2: current[2] + dx, y2: current[3] + dy\n });\n }\n current = next;\n }\n if (next != null) {\n // last segment\n _super.addSegment(conn, STRAIGHT, {\n x1: next[0], y1: next[1], x2: next[2], y2: next[3]\n });\n }\n };\n\n this._compute = function (paintInfo, params) {\n\n segments = [];\n lastx = null;\n lasty = null;\n lastOrientation = null;\n\n var commonStubCalculator = function () {\n return [paintInfo.startStubX, paintInfo.startStubY, paintInfo.endStubX, paintInfo.endStubY];\n },\n stubCalculators = {\n perpendicular: commonStubCalculator,\n orthogonal: commonStubCalculator,\n opposite: function (axis) {\n var pi = paintInfo,\n idx = axis === \"x\" ? 0 : 1,\n areInProximity = {\n \"x\": function () {\n return ( (pi.so[idx] === 1 && (\n ( (pi.startStubX > pi.endStubX) && (pi.tx > pi.startStubX) ) ||\n ( (pi.sx > pi.endStubX) && (pi.tx > pi.sx))))) ||\n\n ( (pi.so[idx] === -1 && (\n ( (pi.startStubX < pi.endStubX) && (pi.tx < pi.startStubX) ) ||\n ( (pi.sx < pi.endStubX) && (pi.tx < pi.sx)))));\n },\n \"y\": function () {\n return ( (pi.so[idx] === 1 && (\n ( (pi.startStubY > pi.endStubY) && (pi.ty > pi.startStubY) ) ||\n ( (pi.sy > pi.endStubY) && (pi.ty > pi.sy))))) ||\n\n ( (pi.so[idx] === -1 && (\n ( (pi.startStubY < pi.endStubY) && (pi.ty < pi.startStubY) ) ||\n ( (pi.sy < pi.endStubY) && (pi.ty < pi.sy)))));\n }\n };\n\n if (!alwaysRespectStubs && areInProximity[axis]()) {\n return {\n \"x\": [(paintInfo.sx + paintInfo.tx) / 2, paintInfo.startStubY, (paintInfo.sx + paintInfo.tx) / 2, paintInfo.endStubY],\n \"y\": [paintInfo.startStubX, (paintInfo.sy + paintInfo.ty) / 2, paintInfo.endStubX, (paintInfo.sy + paintInfo.ty) / 2]\n }[axis];\n }\n else {\n return [paintInfo.startStubX, paintInfo.startStubY, paintInfo.endStubX, paintInfo.endStubY];\n }\n }\n };\n\n // calculate Stubs.\n var stubs = stubCalculators[paintInfo.anchorOrientation](paintInfo.sourceAxis),\n idx = paintInfo.sourceAxis === \"x\" ? 0 : 1,\n oidx = paintInfo.sourceAxis === \"x\" ? 1 : 0,\n ss = stubs[idx],\n oss = stubs[oidx],\n es = stubs[idx + 2],\n oes = stubs[oidx + 2];\n\n // add the start stub segment. use stubs for loopback as it will look better, with the loop spaced\n // away from the element.\n addSegment(segments, stubs[0], stubs[1], paintInfo);\n\n // if its a loopback and we should treat it differently.\n // if (false && params.sourcePos[0] === params.targetPos[0] && params.sourcePos[1] === params.targetPos[1]) {\n //\n // // we use loopbackRadius here, as statemachine connectors do.\n // // so we go radius to the left from stubs[0], then upwards by 2*radius, to the right by 2*radius,\n // // down by 2*radius, left by radius.\n // addSegment(segments, stubs[0] - loopbackRadius, stubs[1], paintInfo);\n // addSegment(segments, stubs[0] - loopbackRadius, stubs[1] - (2 * loopbackRadius), paintInfo);\n // addSegment(segments, stubs[0] + loopbackRadius, stubs[1] - (2 * loopbackRadius), paintInfo);\n // addSegment(segments, stubs[0] + loopbackRadius, stubs[1], paintInfo);\n // addSegment(segments, stubs[0], stubs[1], paintInfo);\n //\n // }\n // else {\n\n\n var midx = paintInfo.startStubX + ((paintInfo.endStubX - paintInfo.startStubX) * midpoint),\n midy = paintInfo.startStubY + ((paintInfo.endStubY - paintInfo.startStubY) * midpoint);\n\n var orientations = {x: [0, 1], y: [1, 0]},\n lineCalculators = {\n perpendicular: function (axis) {\n var pi = paintInfo,\n sis = {\n x: [\n [[1, 2, 3, 4], null, [2, 1, 4, 3]],\n null,\n [[4, 3, 2, 1], null, [3, 4, 1, 2]]\n ],\n y: [\n [[3, 2, 1, 4], null, [2, 3, 4, 1]],\n null,\n [[4, 1, 2, 3], null, [1, 4, 3, 2]]\n ]\n },\n stubs = {\n x: [[pi.startStubX, pi.endStubX], null, [pi.endStubX, pi.startStubX]],\n y: [[pi.startStubY, pi.endStubY], null, [pi.endStubY, pi.startStubY]]\n },\n midLines = {\n x: [[midx, pi.startStubY], [midx, pi.endStubY]],\n y: [[pi.startStubX, midy], [pi.endStubX, midy]]\n },\n linesToEnd = {\n x: [[pi.endStubX, pi.startStubY]],\n y: [[pi.startStubX, pi.endStubY]]\n },\n startToEnd = {\n x: [[pi.startStubX, pi.endStubY], [pi.endStubX, pi.endStubY]],\n y: [[pi.endStubX, pi.startStubY], [pi.endStubX, pi.endStubY]]\n },\n startToMidToEnd = {\n x: [[pi.startStubX, midy], [pi.endStubX, midy], [pi.endStubX, pi.endStubY]],\n y: [[midx, pi.startStubY], [midx, pi.endStubY], [pi.endStubX, pi.endStubY]]\n },\n otherStubs = {\n x: [pi.startStubY, pi.endStubY],\n y: [pi.startStubX, pi.endStubX]\n },\n soIdx = orientations[axis][0], toIdx = orientations[axis][1],\n _so = pi.so[soIdx] + 1,\n _to = pi.to[toIdx] + 1,\n otherFlipped = (pi.to[toIdx] === -1 && (otherStubs[axis][1] < otherStubs[axis][0])) || (pi.to[toIdx] === 1 && (otherStubs[axis][1] > otherStubs[axis][0])),\n stub1 = stubs[axis][_so][0],\n stub2 = stubs[axis][_so][1],\n segmentIndexes = sis[axis][_so][_to];\n\n if (pi.segment === segmentIndexes[3] || (pi.segment === segmentIndexes[2] && otherFlipped)) {\n return midLines[axis];\n }\n else if (pi.segment === segmentIndexes[2] && stub2 < stub1) {\n return linesToEnd[axis];\n }\n else if ((pi.segment === segmentIndexes[2] && stub2 >= stub1) || (pi.segment === segmentIndexes[1] && !otherFlipped)) {\n return startToMidToEnd[axis];\n }\n else if (pi.segment === segmentIndexes[0] || (pi.segment === segmentIndexes[1] && otherFlipped)) {\n return startToEnd[axis];\n }\n },\n orthogonal: function (axis, startStub, otherStartStub, endStub, otherEndStub) {\n var pi = paintInfo,\n extent = {\n \"x\": pi.so[0] === -1 ? Math.min(startStub, endStub) : Math.max(startStub, endStub),\n \"y\": pi.so[1] === -1 ? Math.min(startStub, endStub) : Math.max(startStub, endStub)\n }[axis];\n\n return {\n \"x\": [\n [extent, otherStartStub],\n [extent, otherEndStub],\n [endStub, otherEndStub]\n ],\n \"y\": [\n [otherStartStub, extent],\n [otherEndStub, extent],\n [otherEndStub, endStub]\n ]\n }[axis];\n },\n opposite: function (axis, ss, oss, es) {\n var pi = paintInfo,\n otherAxis = {\"x\": \"y\", \"y\": \"x\"}[axis],\n dim = {\"x\": \"height\", \"y\": \"width\"}[axis],\n comparator = pi[\"is\" + axis.toUpperCase() + \"GreaterThanStubTimes2\"];\n\n if (params.sourceEndpoint.elementId === params.targetEndpoint.elementId) {\n var _val = oss + ((1 - params.sourceEndpoint.anchor[otherAxis]) * params.sourceInfo[dim]) + _super.maxStub;\n return {\n \"x\": [\n [ss, _val],\n [es, _val]\n ],\n \"y\": [\n [_val, ss],\n [_val, es]\n ]\n }[axis];\n\n }\n else if (!comparator || (pi.so[idx] === 1 && ss > es) || (pi.so[idx] === -1 && ss < es)) {\n return {\n \"x\": [\n [ss, midy],\n [es, midy]\n ],\n \"y\": [\n [midx, ss],\n [midx, es]\n ]\n }[axis];\n }\n else if ((pi.so[idx] === 1 && ss < es) || (pi.so[idx] === -1 && ss > es)) {\n return {\n \"x\": [\n [midx, pi.sy],\n [midx, pi.ty]\n ],\n \"y\": [\n [pi.sx, midy],\n [pi.tx, midy]\n ]\n }[axis];\n }\n }\n };\n\n // compute the rest of the line\n var p = lineCalculators[paintInfo.anchorOrientation](paintInfo.sourceAxis, ss, oss, es, oes);\n if (p) {\n for (var i = 0; i < p.length; i++) {\n addSegment(segments, p[i][0], p[i][1], paintInfo);\n }\n }\n\n // line to end stub\n addSegment(segments, stubs[2], stubs[3], paintInfo);\n\n //}\n\n // end stub to end (common)\n addSegment(segments, paintInfo.tx, paintInfo.ty, paintInfo);\n\n\n\n // write out the segments.\n writeSegments(this, segments, paintInfo);\n\n };\n };\n\n _jp.Connectors.Flowchart = Flowchart;\n _ju.extend(_jp.Connectors.Flowchart, _jp.Connectors.AbstractConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the code for the Bezier connector type.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n _jp.Connectors.AbstractBezierConnector = function(params) {\n params = params || {};\n var showLoopback = params.showLoopback !== false,\n curviness = params.curviness || 10,\n margin = params.margin || 5,\n proximityLimit = params.proximityLimit || 80,\n clockwise = params.orientation && params.orientation === \"clockwise\",\n loopbackRadius = params.loopbackRadius || 25,\n isLoopbackCurrently = false,\n _super;\n\n this._compute = function (paintInfo, p) {\n\n var sp = p.sourcePos,\n tp = p.targetPos,\n _w = Math.abs(sp[0] - tp[0]),\n _h = Math.abs(sp[1] - tp[1]);\n\n if (!showLoopback || (p.sourceEndpoint.elementId !== p.targetEndpoint.elementId)) {\n isLoopbackCurrently = false;\n this._computeBezier(paintInfo, p, sp, tp, _w, _h);\n } else {\n isLoopbackCurrently = true;\n // a loopback connector. draw an arc from one anchor to the other.\n var x1 = p.sourcePos[0], y1 = p.sourcePos[1] - margin,\n cx = x1, cy = y1 - loopbackRadius,\n // canvas sizing stuff, to ensure the whole painted area is visible.\n _x = cx - loopbackRadius,\n _y = cy - loopbackRadius;\n\n _w = 2 * loopbackRadius;\n _h = 2 * loopbackRadius;\n\n paintInfo.points[0] = _x;\n paintInfo.points[1] = _y;\n paintInfo.points[2] = _w;\n paintInfo.points[3] = _h;\n\n // ADD AN ARC SEGMENT.\n _super.addSegment(this, \"Arc\", {\n loopback: true,\n x1: (x1 - _x) + 4,\n y1: y1 - _y,\n startAngle: 0,\n endAngle: 2 * Math.PI,\n r: loopbackRadius,\n ac: !clockwise,\n x2: (x1 - _x) - 4,\n y2: y1 - _y,\n cx: cx - _x,\n cy: cy - _y\n });\n }\n };\n\n _super = _jp.Connectors.AbstractConnector.apply(this, arguments);\n return _super;\n };\n _ju.extend(_jp.Connectors.AbstractBezierConnector, _jp.Connectors.AbstractConnector);\n\n var Bezier = function (params) {\n params = params || {};\n this.type = \"Bezier\";\n\n var _super = _jp.Connectors.AbstractBezierConnector.apply(this, arguments),\n majorAnchor = params.curviness || 150,\n minorAnchor = 10;\n\n this.getCurviness = function () {\n return majorAnchor;\n };\n\n this._findControlPoint = function (point, sourceAnchorPosition, targetAnchorPosition, sourceEndpoint, targetEndpoint, soo, too) {\n // determine if the two anchors are perpendicular to each other in their orientation. we swap the control\n // points around if so (code could be tightened up)\n var perpendicular = soo[0] !== too[0] || soo[1] === too[1],\n p = [];\n\n if (!perpendicular) {\n if (soo[0] === 0) {\n p.push(sourceAnchorPosition[0] < targetAnchorPosition[0] ? point[0] + minorAnchor : point[0] - minorAnchor);\n }\n else {\n p.push(point[0] - (majorAnchor * soo[0]));\n }\n\n if (soo[1] === 0) {\n p.push(sourceAnchorPosition[1] < targetAnchorPosition[1] ? point[1] + minorAnchor : point[1] - minorAnchor);\n }\n else {\n p.push(point[1] + (majorAnchor * too[1]));\n }\n }\n else {\n if (too[0] === 0) {\n p.push(targetAnchorPosition[0] < sourceAnchorPosition[0] ? point[0] + minorAnchor : point[0] - minorAnchor);\n }\n else {\n p.push(point[0] + (majorAnchor * too[0]));\n }\n\n if (too[1] === 0) {\n p.push(targetAnchorPosition[1] < sourceAnchorPosition[1] ? point[1] + minorAnchor : point[1] - minorAnchor);\n }\n else {\n p.push(point[1] + (majorAnchor * soo[1]));\n }\n }\n\n return p;\n };\n\n this._computeBezier = function (paintInfo, p, sp, tp, _w, _h) {\n\n var _CP, _CP2,\n _sx = sp[0] < tp[0] ? _w : 0,\n _sy = sp[1] < tp[1] ? _h : 0,\n _tx = sp[0] < tp[0] ? 0 : _w,\n _ty = sp[1] < tp[1] ? 0 : _h;\n\n _CP = this._findControlPoint([_sx, _sy], sp, tp, p.sourceEndpoint, p.targetEndpoint, paintInfo.so, paintInfo.to);\n _CP2 = this._findControlPoint([_tx, _ty], tp, sp, p.targetEndpoint, p.sourceEndpoint, paintInfo.to, paintInfo.so);\n\n\n _super.addSegment(this, \"Bezier\", {\n x1: _sx, y1: _sy, x2: _tx, y2: _ty,\n cp1x: _CP[0], cp1y: _CP[1], cp2x: _CP2[0], cp2y: _CP2[1]\n });\n };\n\n\n };\n\n _jp.Connectors.Bezier = Bezier;\n _ju.extend(Bezier, _jp.Connectors.AbstractBezierConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the state machine connectors, which extend AbstractBezierConnector.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n var _segment = function (x1, y1, x2, y2) {\n if (x1 <= x2 && y2 <= y1) {\n return 1;\n }\n else if (x1 <= x2 && y1 <= y2) {\n return 2;\n }\n else if (x2 <= x1 && y2 >= y1) {\n return 3;\n }\n return 4;\n },\n\n // the control point we will use depends on the faces to which each end of the connection is assigned, specifically whether or not the\n // two faces are parallel or perpendicular. if they are parallel then the control point lies on the midpoint of the axis in which they\n // are parellel and varies only in the other axis; this variation is proportional to the distance that the anchor points lie from the\n // center of that face. if the two faces are perpendicular then the control point is at some distance from both the midpoints; the amount and\n // direction are dependent on the orientation of the two elements. 'seg', passed in to this method, tells you which segment the target element\n // lies in with respect to the source: 1 is top right, 2 is bottom right, 3 is bottom left, 4 is top left.\n //\n // sourcePos and targetPos are arrays of info about where on the source and target each anchor is located. their contents are:\n //\n // 0 - absolute x\n // 1 - absolute y\n // 2 - proportional x in element (0 is left edge, 1 is right edge)\n // 3 - proportional y in element (0 is top edge, 1 is bottom edge)\n //\n _findControlPoint = function (midx, midy, segment, sourceEdge, targetEdge, dx, dy, distance, proximityLimit) {\n // TODO (maybe)\n // - if anchor pos is 0.5, make the control point take into account the relative position of the elements.\n if (distance <= proximityLimit) {\n return [midx, midy];\n }\n\n if (segment === 1) {\n if (sourceEdge[3] <= 0 && targetEdge[3] >= 1) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] >= 1 && targetEdge[2] <= 0) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + (-1 * dx) , midy + (-1 * dy) ];\n }\n }\n else if (segment === 2) {\n if (sourceEdge[3] >= 1 && targetEdge[3] <= 0) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] >= 1 && targetEdge[2] <= 0) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + dx, midy + (-1 * dy) ];\n }\n }\n else if (segment === 3) {\n if (sourceEdge[3] >= 1 && targetEdge[3] <= 0) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] <= 0 && targetEdge[2] >= 1) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + (-1 * dx) , midy + (-1 * dy) ];\n }\n }\n else if (segment === 4) {\n if (sourceEdge[3] <= 0 && targetEdge[3] >= 1) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] <= 0 && targetEdge[2] >= 1) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + dx , midy + (-1 * dy) ];\n }\n }\n\n };\n\n var StateMachine = function (params) {\n params = params || {};\n this.type = \"StateMachine\";\n\n var _super = _jp.Connectors.AbstractBezierConnector.apply(this, arguments),\n curviness = params.curviness || 10,\n margin = params.margin || 5,\n proximityLimit = params.proximityLimit || 80,\n clockwise = params.orientation && params.orientation === \"clockwise\",\n _controlPoint;\n\n this._computeBezier = function(paintInfo, params, sp, tp, w, h) {\n var _sx = params.sourcePos[0] < params.targetPos[0] ? 0 : w,\n _sy = params.sourcePos[1] < params.targetPos[1] ? 0 : h,\n _tx = params.sourcePos[0] < params.targetPos[0] ? w : 0,\n _ty = params.sourcePos[1] < params.targetPos[1] ? h : 0;\n\n // now adjust for the margin\n if (params.sourcePos[2] === 0) {\n _sx -= margin;\n }\n if (params.sourcePos[2] === 1) {\n _sx += margin;\n }\n if (params.sourcePos[3] === 0) {\n _sy -= margin;\n }\n if (params.sourcePos[3] === 1) {\n _sy += margin;\n }\n if (params.targetPos[2] === 0) {\n _tx -= margin;\n }\n if (params.targetPos[2] === 1) {\n _tx += margin;\n }\n if (params.targetPos[3] === 0) {\n _ty -= margin;\n }\n if (params.targetPos[3] === 1) {\n _ty += margin;\n }\n\n //\n // these connectors are quadratic bezier curves, having a single control point. if both anchors\n // are located at 0.5 on their respective faces, the control point is set to the midpoint and you\n // get a straight line. this is also the case if the two anchors are within 'proximityLimit', since\n // it seems to make good aesthetic sense to do that. outside of that, the control point is positioned\n // at 'curviness' pixels away along the normal to the straight line connecting the two anchors.\n //\n // there may be two improvements to this. firstly, we might actually support the notion of avoiding nodes\n // in the UI, or at least making a good effort at doing so. if a connection would pass underneath some node,\n // for example, we might increase the distance the control point is away from the midpoint in a bid to\n // steer it around that node. this will work within limits, but i think those limits would also be the likely\n // limits for, once again, aesthetic good sense in the layout of a chart using these connectors.\n //\n // the second possible change is actually two possible changes: firstly, it is possible we should gradually\n // decrease the 'curviness' as the distance between the anchors decreases; start tailing it off to 0 at some\n // point (which should be configurable). secondly, we might slightly increase the 'curviness' for connectors\n // with respect to how far their anchor is from the center of its respective face. this could either look cool,\n // or stupid, and may indeed work only in a way that is so subtle as to have been a waste of time.\n //\n\n var _midx = (_sx + _tx) / 2,\n _midy = (_sy + _ty) / 2,\n segment = _segment(_sx, _sy, _tx, _ty),\n distance = Math.sqrt(Math.pow(_tx - _sx, 2) + Math.pow(_ty - _sy, 2)),\n cp1x, cp2x, cp1y, cp2y;\n\n\n // calculate the control point. this code will be where we'll put in a rudimentary element avoidance scheme; it\n // will work by extending the control point to force the curve to be, um, curvier.\n _controlPoint = _findControlPoint(_midx,\n _midy,\n segment,\n params.sourcePos,\n params.targetPos,\n curviness, curviness,\n distance,\n proximityLimit);\n\n cp1x = _controlPoint[0];\n cp2x = _controlPoint[0];\n cp1y = _controlPoint[1];\n cp2y = _controlPoint[1];\n\n _super.addSegment(this, \"Bezier\", {\n x1: _tx, y1: _ty, x2: _sx, y2: _sy,\n cp1x: cp1x, cp1y: cp1y,\n cp2x: cp2x, cp2y: cp2y\n });\n };\n };\n\n _jp.Connectors.StateMachine = StateMachine;\n _ju.extend(StateMachine, _jp.Connectors.AbstractBezierConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the 'flowchart' connectors, consisting of vertical and horizontal line segments.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n var STRAIGHT = \"Straight\";\n\n var Straight = function (params) {\n this.type = STRAIGHT;\n var _super = _jp.Connectors.AbstractConnector.apply(this, arguments);\n\n this._compute = function (paintInfo, _) {\n _super.addSegment(this, STRAIGHT, {x1: paintInfo.sx, y1: paintInfo.sy, x2: paintInfo.startStubX, y2: paintInfo.startStubY});\n _super.addSegment(this, STRAIGHT, {x1: paintInfo.startStubX, y1: paintInfo.startStubY, x2: paintInfo.endStubX, y2: paintInfo.endStubY});\n _super.addSegment(this, STRAIGHT, {x1: paintInfo.endStubX, y1: paintInfo.endStubY, x2: paintInfo.tx, y2: paintInfo.ty});\n };\n };\n\n _jp.Connectors.Straight = Straight;\n _ju.extend(Straight, _jp.Connectors.AbstractConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the SVG renderers.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n * \n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n// ************************** SVG utility methods ********************************************\t\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n var svgAttributeMap = {\n \"stroke-linejoin\": \"stroke-linejoin\",\n \"stroke-dashoffset\": \"stroke-dashoffset\",\n \"stroke-linecap\": \"stroke-linecap\"\n },\n STROKE_DASHARRAY = \"stroke-dasharray\",\n DASHSTYLE = \"dashstyle\",\n LINEAR_GRADIENT = \"linearGradient\",\n RADIAL_GRADIENT = \"radialGradient\",\n DEFS = \"defs\",\n FILL = \"fill\",\n STOP = \"stop\",\n STROKE = \"stroke\",\n STROKE_WIDTH = \"stroke-width\",\n STYLE = \"style\",\n NONE = \"none\",\n JSPLUMB_GRADIENT = \"jsplumb_gradient_\",\n LINE_WIDTH = \"strokeWidth\",\n ns = {\n svg: \"http://www.w3.org/2000/svg\"\n },\n _attr = function (node, attributes) {\n for (var i in attributes) {\n node.setAttribute(i, \"\" + attributes[i]);\n }\n },\n _node = function (name, attributes) {\n attributes = attributes || {};\n attributes.version = \"1.1\";\n attributes.xmlns = ns.svg;\n return _jp.createElementNS(ns.svg, name, null, null, attributes);\n },\n _pos = function (d) {\n return \"position:absolute;left:\" + d[0] + \"px;top:\" + d[1] + \"px\";\n },\n _clearGradient = function (parent) {\n var els = parent.querySelectorAll(\" defs,linearGradient,radialGradient\");\n for (var i = 0; i < els.length; i++) {\n els[i].parentNode.removeChild(els[i]);\n }\n },\n _updateGradient = function (parent, node, style, dimensions, uiComponent) {\n var id = JSPLUMB_GRADIENT + uiComponent._jsPlumb.instance.idstamp();\n // first clear out any existing gradient\n _clearGradient(parent);\n // this checks for an 'offset' property in the gradient, and in the absence of it, assumes\n // we want a linear gradient. if it's there, we create a radial gradient.\n // it is possible that a more explicit means of defining the gradient type would be\n // better. relying on 'offset' means that we can never have a radial gradient that uses\n // some default offset, for instance.\n // issue 244 suggested the 'gradientUnits' attribute; without this, straight/flowchart connectors with gradients would\n // not show gradients when the line was perfectly horizontal or vertical.\n var g;\n if (!style.gradient.offset) {\n g = _node(LINEAR_GRADIENT, {id: id, gradientUnits: \"userSpaceOnUse\"});\n }\n else {\n g = _node(RADIAL_GRADIENT, { id: id });\n }\n\n var defs = _node(DEFS);\n parent.appendChild(defs);\n defs.appendChild(g);\n\n // the svg radial gradient seems to treat stops in the reverse\n // order to how canvas does it. so we want to keep all the maths the same, but\n // iterate the actual style declarations in reverse order, if the x indexes are not in order.\n for (var i = 0; i < style.gradient.stops.length; i++) {\n var styleToUse = uiComponent.segment === 1 || uiComponent.segment === 2 ? i : style.gradient.stops.length - 1 - i,\n stopColor = style.gradient.stops[styleToUse][1],\n s = _node(STOP, {\"offset\": Math.floor(style.gradient.stops[i][0] * 100) + \"%\", \"stop-color\": stopColor});\n\n g.appendChild(s);\n }\n var applyGradientTo = style.stroke ? STROKE : FILL;\n node.setAttribute(applyGradientTo, \"url(#\" + id + \")\");\n },\n _applyStyles = function (parent, node, style, dimensions, uiComponent) {\n\n node.setAttribute(FILL, style.fill ? style.fill : NONE);\n node.setAttribute(STROKE, style.stroke ? style.stroke : NONE);\n\n if (style.gradient) {\n _updateGradient(parent, node, style, dimensions, uiComponent);\n }\n else {\n // make sure we clear any existing gradient\n _clearGradient(parent);\n node.setAttribute(STYLE, \"\");\n }\n\n if (style.strokeWidth) {\n node.setAttribute(STROKE_WIDTH, style.strokeWidth);\n }\n\n // in SVG there is a stroke-dasharray attribute we can set, and its syntax looks like\n // the syntax in VML but is actually kind of nasty: values are given in the pixel\n // coordinate space, whereas in VML they are multiples of the width of the stroked\n // line, which makes a lot more sense. for that reason, jsPlumb is supporting both\n // the native svg 'stroke-dasharray' attribute, and also the 'dashstyle' concept from\n // VML, which will be the preferred method. the code below this converts a dashstyle\n // attribute given in terms of stroke width into a pixel representation, by using the\n // stroke's lineWidth.\n if (style[DASHSTYLE] && style[LINE_WIDTH] && !style[STROKE_DASHARRAY]) {\n var sep = style[DASHSTYLE].indexOf(\",\") === -1 ? \" \" : \",\",\n parts = style[DASHSTYLE].split(sep),\n styleToUse = \"\";\n parts.forEach(function (p) {\n styleToUse += (Math.floor(p * style.strokeWidth) + sep);\n });\n node.setAttribute(STROKE_DASHARRAY, styleToUse);\n }\n else if (style[STROKE_DASHARRAY]) {\n node.setAttribute(STROKE_DASHARRAY, style[STROKE_DASHARRAY]);\n }\n\n // extra attributes such as join type, dash offset.\n for (var i in svgAttributeMap) {\n if (style[i]) {\n node.setAttribute(svgAttributeMap[i], style[i]);\n }\n }\n },\n _appendAtIndex = function (svg, path, idx) {\n if (svg.childNodes.length > idx) {\n svg.insertBefore(path, svg.childNodes[idx]);\n }\n else {\n svg.appendChild(path);\n }\n };\n\n /**\n utility methods for other objects to use.\n */\n _ju.svg = {\n node: _node,\n attr: _attr,\n pos: _pos\n };\n\n // ************************** / SVG utility methods ********************************************\n\n /*\n * Base class for SVG components.\n */\n var SvgComponent = function (params) {\n var pointerEventsSpec = params.pointerEventsSpec || \"all\", renderer = {};\n\n _jp.jsPlumbUIComponent.apply(this, params.originalArgs);\n this.canvas = null;\n this.path = null;\n this.svg = null;\n this.bgCanvas = null;\n\n var clazz = params.cssClass + \" \" + (params.originalArgs[0].cssClass || \"\"),\n svgParams = {\n \"style\": \"\",\n \"width\": 0,\n \"height\": 0,\n \"pointer-events\": pointerEventsSpec,\n \"position\": \"absolute\"\n };\n\n this.svg = _node(\"svg\", svgParams);\n\n if (params.useDivWrapper) {\n this.canvas = _jp.createElement(\"div\", { position : \"absolute\" });\n _ju.sizeElement(this.canvas, 0, 0, 1, 1);\n this.canvas.className = clazz;\n }\n else {\n _attr(this.svg, { \"class\": clazz });\n this.canvas = this.svg;\n }\n\n params._jsPlumb.appendElement(this.canvas, params.originalArgs[0].parent);\n if (params.useDivWrapper) {\n this.canvas.appendChild(this.svg);\n }\n\n var displayElements = [ this.canvas ];\n this.getDisplayElements = function () {\n return displayElements;\n };\n\n this.appendDisplayElement = function (el) {\n displayElements.push(el);\n };\n\n this.paint = function (style, anchor, extents) {\n if (style != null) {\n\n var xy = [ this.x, this.y ], wh = [ this.w, this.h ], p;\n if (extents != null) {\n if (extents.xmin < 0) {\n xy[0] += extents.xmin;\n }\n if (extents.ymin < 0) {\n xy[1] += extents.ymin;\n }\n wh[0] = extents.xmax + ((extents.xmin < 0) ? -extents.xmin : 0);\n wh[1] = extents.ymax + ((extents.ymin < 0) ? -extents.ymin : 0);\n }\n\n if (params.useDivWrapper) {\n _ju.sizeElement(this.canvas, xy[0], xy[1], wh[0], wh[1]);\n xy[0] = 0;\n xy[1] = 0;\n p = _pos([ 0, 0 ]);\n }\n else {\n p = _pos([ xy[0], xy[1] ]);\n }\n\n renderer.paint.apply(this, arguments);\n\n _attr(this.svg, {\n \"style\": p,\n \"width\": wh[0] || 0,\n \"height\": wh[1] || 0\n });\n }\n };\n\n return {\n renderer: renderer\n };\n };\n\n _ju.extend(SvgComponent, _jp.jsPlumbUIComponent, {\n cleanup: function (force) {\n if (force || this.typeId == null) {\n if (this.canvas) {\n this.canvas._jsPlumb = null;\n }\n if (this.svg) {\n this.svg._jsPlumb = null;\n }\n if (this.bgCanvas) {\n this.bgCanvas._jsPlumb = null;\n }\n\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n if (this.bgCanvas && this.bgCanvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n\n this.svg = null;\n this.canvas = null;\n this.path = null;\n this.group = null;\n }\n else {\n // if not a forced cleanup, just detach from DOM for now.\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n if (this.bgCanvas && this.bgCanvas.parentNode) {\n this.bgCanvas.parentNode.removeChild(this.bgCanvas);\n }\n }\n },\n reattach:function(instance) {\n var c = instance.getContainer();\n if (this.canvas && this.canvas.parentNode == null) {\n c.appendChild(this.canvas);\n }\n if (this.bgCanvas && this.bgCanvas.parentNode == null) {\n c.appendChild(this.bgCanvas);\n }\n },\n setVisible: function (v) {\n if (this.canvas) {\n this.canvas.style.display = v ? \"block\" : \"none\";\n }\n }\n });\n\n /*\n * Base class for SVG connectors.\n */\n _jp.ConnectorRenderers.svg = function (params) {\n var self = this,\n _super = SvgComponent.apply(this, [\n {\n cssClass: params._jsPlumb.connectorClass,\n originalArgs: arguments,\n pointerEventsSpec: \"none\",\n _jsPlumb: params._jsPlumb\n }\n ]);\n\n _super.renderer.paint = function (style, anchor, extents) {\n\n var segments = self.getSegments(), p = \"\", offset = [0, 0];\n if (extents.xmin < 0) {\n offset[0] = -extents.xmin;\n }\n if (extents.ymin < 0) {\n offset[1] = -extents.ymin;\n }\n\n if (segments.length > 0) {\n\n p = self.getPathData();\n\n var a = {\n d: p,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\",\n \"pointer-events\": params[\"pointer-events\"] || \"visibleStroke\"\n },\n outlineStyle = null,\n d = [self.x, self.y, self.w, self.h];\n\n // outline style. actually means drawing an svg object underneath the main one.\n if (style.outlineStroke) {\n var outlineWidth = style.outlineWidth || 1,\n outlineStrokeWidth = style.strokeWidth + (2 * outlineWidth);\n outlineStyle = _jp.extend({}, style);\n delete outlineStyle.gradient;\n outlineStyle.stroke = style.outlineStroke;\n outlineStyle.strokeWidth = outlineStrokeWidth;\n\n if (self.bgPath == null) {\n self.bgPath = _node(\"path\", a);\n _jp.addClass(self.bgPath, _jp.connectorOutlineClass);\n _appendAtIndex(self.svg, self.bgPath, 0);\n }\n else {\n _attr(self.bgPath, a);\n }\n\n _applyStyles(self.svg, self.bgPath, outlineStyle, d, self);\n }\n\n if (self.path == null) {\n self.path = _node(\"path\", a);\n _appendAtIndex(self.svg, self.path, style.outlineStroke ? 1 : 0);\n }\n else {\n _attr(self.path, a);\n }\n\n _applyStyles(self.svg, self.path, style, d, self);\n }\n };\n };\n _ju.extend(_jp.ConnectorRenderers.svg, SvgComponent);\n\n// ******************************* svg segment renderer *****************************************************\t\n\n\n// ******************************* /svg segments *****************************************************\n\n /*\n * Base class for SVG endpoints.\n */\n var SvgEndpoint = _jp.SvgEndpoint = function (params) {\n var _super = SvgComponent.apply(this, [\n {\n cssClass: params._jsPlumb.endpointClass,\n originalArgs: arguments,\n pointerEventsSpec: \"all\",\n useDivWrapper: true,\n _jsPlumb: params._jsPlumb\n }\n ]);\n\n _super.renderer.paint = function (style) {\n var s = _jp.extend({}, style);\n if (s.outlineStroke) {\n s.stroke = s.outlineStroke;\n }\n\n if (this.node == null) {\n this.node = this.makeNode(s);\n this.svg.appendChild(this.node);\n }\n else if (this.updateNode != null) {\n this.updateNode(this.node);\n }\n _applyStyles(this.svg, this.node, s, [ this.x, this.y, this.w, this.h ], this);\n _pos(this.node, [ this.x, this.y ]);\n }.bind(this);\n\n };\n _ju.extend(SvgEndpoint, SvgComponent);\n\n /*\n * SVG Dot Endpoint\n */\n _jp.Endpoints.svg.Dot = function () {\n _jp.Endpoints.Dot.apply(this, arguments);\n SvgEndpoint.apply(this, arguments);\n this.makeNode = function (style) {\n return _node(\"circle\", {\n \"cx\": this.w / 2,\n \"cy\": this.h / 2,\n \"r\": this.radius\n });\n };\n this.updateNode = function (node) {\n _attr(node, {\n \"cx\": this.w / 2,\n \"cy\": this.h / 2,\n \"r\": this.radius\n });\n };\n };\n _ju.extend(_jp.Endpoints.svg.Dot, [_jp.Endpoints.Dot, SvgEndpoint]);\n\n /*\n * SVG Rectangle Endpoint\n */\n _jp.Endpoints.svg.Rectangle = function () {\n _jp.Endpoints.Rectangle.apply(this, arguments);\n SvgEndpoint.apply(this, arguments);\n this.makeNode = function (style) {\n return _node(\"rect\", {\n \"width\": this.w,\n \"height\": this.h\n });\n };\n this.updateNode = function (node) {\n _attr(node, {\n \"width\": this.w,\n \"height\": this.h\n });\n };\n };\n _ju.extend(_jp.Endpoints.svg.Rectangle, [_jp.Endpoints.Rectangle, SvgEndpoint]);\n\n /*\n * SVG Image Endpoint is the default image endpoint.\n */\n _jp.Endpoints.svg.Image = _jp.Endpoints.Image;\n /*\n * Blank endpoint in svg renderer is the default Blank endpoint.\n */\n _jp.Endpoints.svg.Blank = _jp.Endpoints.Blank;\n /*\n * Label overlay in svg renderer is the default Label overlay.\n */\n _jp.Overlays.svg.Label = _jp.Overlays.Label;\n /*\n * Custom overlay in svg renderer is the default Custom overlay.\n */\n _jp.Overlays.svg.Custom = _jp.Overlays.Custom;\n\n var AbstractSvgArrowOverlay = function (superclass, originalArgs) {\n superclass.apply(this, originalArgs);\n _jp.jsPlumbUIComponent.apply(this, originalArgs);\n this.isAppendedAtTopLevel = false;\n var self = this;\n this.path = null;\n this.paint = function (params, containerExtents) {\n // only draws on connections, not endpoints.\n if (params.component.svg && containerExtents) {\n if (this.path == null) {\n this.path = _node(\"path\", {\n \"pointer-events\": \"all\"\n });\n params.component.svg.appendChild(this.path);\n if (this.elementCreated) {\n this.elementCreated(this.path, params.component);\n }\n\n this.canvas = params.component.svg; // for the sake of completeness; this behaves the same as other overlays\n }\n var clazz = originalArgs && (originalArgs.length === 1) ? (originalArgs[0].cssClass || \"\") : \"\",\n offset = [0, 0];\n\n if (containerExtents.xmin < 0) {\n offset[0] = -containerExtents.xmin;\n }\n if (containerExtents.ymin < 0) {\n offset[1] = -containerExtents.ymin;\n }\n\n _attr(this.path, {\n \"d\": makePath(params.d),\n \"class\": clazz,\n stroke: params.stroke ? params.stroke : null,\n fill: params.fill ? params.fill : null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n }\n };\n var makePath = function (d) {\n return (isNaN(d.cxy.x) || isNaN(d.cxy.y)) ? \"\" : \"M\" + d.hxy.x + \",\" + d.hxy.y +\n \" L\" + d.tail[0].x + \",\" + d.tail[0].y +\n \" L\" + d.cxy.x + \",\" + d.cxy.y +\n \" L\" + d.tail[1].x + \",\" + d.tail[1].y +\n \" L\" + d.hxy.x + \",\" + d.hxy.y;\n };\n this.transfer = function(target) {\n if (target.canvas && this.path && this.path.parentNode) {\n this.path.parentNode.removeChild(this.path);\n target.canvas.appendChild(this.path);\n }\n };\n };\n _ju.extend(AbstractSvgArrowOverlay, [_jp.jsPlumbUIComponent, _jp.Overlays.AbstractOverlay], {\n cleanup: function (force) {\n if (this.path != null) {\n if (force) {\n this._jsPlumb.instance.removeElement(this.path);\n }\n else {\n if (this.path.parentNode) {\n this.path.parentNode.removeChild(this.path);\n }\n }\n }\n },\n reattach:function(instance, component) {\n if (this.path && component.canvas) {\n component.canvas.appendChild(this.path);\n }\n },\n setVisible: function (v) {\n if (this.path != null) {\n (this.path.style.display = (v ? \"block\" : \"none\"));\n }\n }\n });\n\n _jp.Overlays.svg.Arrow = function () {\n AbstractSvgArrowOverlay.apply(this, [_jp.Overlays.Arrow, arguments]);\n };\n _ju.extend(_jp.Overlays.svg.Arrow, [ _jp.Overlays.Arrow, AbstractSvgArrowOverlay ]);\n\n _jp.Overlays.svg.PlainArrow = function () {\n AbstractSvgArrowOverlay.apply(this, [_jp.Overlays.PlainArrow, arguments]);\n };\n _ju.extend(_jp.Overlays.svg.PlainArrow, [ _jp.Overlays.PlainArrow, AbstractSvgArrowOverlay ]);\n\n _jp.Overlays.svg.Diamond = function () {\n AbstractSvgArrowOverlay.apply(this, [_jp.Overlays.Diamond, arguments]);\n };\n _ju.extend(_jp.Overlays.svg.Diamond, [ _jp.Overlays.Diamond, AbstractSvgArrowOverlay ]);\n\n // a test\n _jp.Overlays.svg.GuideLines = function () {\n var path = null, self = this, p1_1, p1_2;\n _jp.Overlays.GuideLines.apply(this, arguments);\n this.paint = function (params, containerExtents) {\n if (path == null) {\n path = _node(\"path\");\n params.connector.svg.appendChild(path);\n self.attachListeners(path, params.connector);\n self.attachListeners(path, self);\n\n p1_1 = _node(\"path\");\n params.connector.svg.appendChild(p1_1);\n self.attachListeners(p1_1, params.connector);\n self.attachListeners(p1_1, self);\n\n p1_2 = _node(\"path\");\n params.connector.svg.appendChild(p1_2);\n self.attachListeners(p1_2, params.connector);\n self.attachListeners(p1_2, self);\n }\n\n var offset = [0, 0];\n if (containerExtents.xmin < 0) {\n offset[0] = -containerExtents.xmin;\n }\n if (containerExtents.ymin < 0) {\n offset[1] = -containerExtents.ymin;\n }\n\n _attr(path, {\n \"d\": makePath(params.head, params.tail),\n stroke: \"red\",\n fill: null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n\n _attr(p1_1, {\n \"d\": makePath(params.tailLine[0], params.tailLine[1]),\n stroke: \"blue\",\n fill: null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n\n _attr(p1_2, {\n \"d\": makePath(params.headLine[0], params.headLine[1]),\n stroke: \"green\",\n fill: null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n };\n\n var makePath = function (d1, d2) {\n return \"M \" + d1.x + \",\" + d1.y +\n \" L\" + d2.x + \",\" + d2.y;\n };\n };\n _ju.extend(_jp.Overlays.svg.GuideLines, _jp.Overlays.GuideLines);\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains code used when jsPlumb is being rendered in a DOM.\n *\n * Copyright (c) 2010 - 2019 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil,\n _jk = root.Katavorio, _jg = root.Biltong;\n\n var _getEventManager = function(instance) {\n var e = instance._mottle;\n if (!e) {\n e = instance._mottle = new root.Mottle();\n }\n return e;\n };\n\n var _getDragManager = function (instance, category) {\n\n category = category || \"main\";\n var key = \"_katavorio_\" + category;\n var k = instance[key],\n e = instance.getEventManager();\n\n if (!k) {\n k = new _jk({\n bind: e.on,\n unbind: e.off,\n getSize: _jp.getSize,\n getConstrainingRectangle:function(el) {\n return [ el.parentNode.scrollWidth, el.parentNode.scrollHeight ];\n },\n getPosition: function (el, relativeToRoot) {\n // if this is a nested draggable then compute the offset against its own offsetParent, otherwise\n // compute against the Container's origin. see also the getUIPosition method below.\n var o = instance.getOffset(el, relativeToRoot, el._katavorioDrag ? el.offsetParent : null);\n return [o.left, o.top];\n },\n setPosition: function (el, xy) {\n el.style.left = xy[0] + \"px\";\n el.style.top = xy[1] + \"px\";\n },\n addClass: _jp.addClass,\n removeClass: _jp.removeClass,\n intersects: _jg.intersects,\n indexOf: function(l, i) { return l.indexOf(i); },\n scope:instance.getDefaultScope(),\n css: {\n noSelect: instance.dragSelectClass,\n droppable: \"jtk-droppable\",\n draggable: \"jtk-draggable\",\n drag: \"jtk-drag\",\n selected: \"jtk-drag-selected\",\n active: \"jtk-drag-active\",\n hover: \"jtk-drag-hover\",\n ghostProxy:\"jtk-ghost-proxy\"\n }\n });\n k.setZoom(instance.getZoom());\n instance[key] = k;\n instance.bind(\"zoom\", k.setZoom);\n }\n return k;\n };\n\n var _dragStart=function(params) {\n var options = params.el._jsPlumbDragOptions;\n var cont = true;\n if (options.canDrag) {\n cont = options.canDrag();\n }\n if (cont) {\n this.setHoverSuspended(true);\n this.select({source: params.el}).addClass(this.elementDraggingClass + \" \" + this.sourceElementDraggingClass, true);\n this.select({target: params.el}).addClass(this.elementDraggingClass + \" \" + this.targetElementDraggingClass, true);\n this.setConnectionBeingDragged(true);\n }\n return cont;\n };\n var _dragMove=function(params) {\n var ui = this.getUIPosition(arguments, this.getZoom());\n if (ui != null) {\n var o = params.el._jsPlumbDragOptions;\n this.draw(params.el, ui, null, true);\n if (o._dragging) {\n this.addClass(params.el, \"jtk-dragged\");\n }\n o._dragging = true;\n }\n };\n var _dragStop=function(params) {\n var elements = params.selection, uip;\n\n var _one = function (_e) {\n if (_e[1] != null) {\n // run the reported offset through the code that takes parent containers\n // into account, to adjust if necessary (issue 554)\n uip = this.getUIPosition([{\n el:_e[2].el,\n pos:[_e[1].left, _e[1].top]\n }]);\n this.draw(_e[2].el, uip);\n }\n\n delete _e[0]._jsPlumbDragOptions._dragging;\n\n this.removeClass(_e[0], \"jtk-dragged\");\n this.select({source: _e[2].el}).removeClass(this.elementDraggingClass + \" \" + this.sourceElementDraggingClass, true);\n this.select({target: _e[2].el}).removeClass(this.elementDraggingClass + \" \" + this.targetElementDraggingClass, true);\n this.getDragManager().dragEnded(_e[2].el);\n }.bind(this);\n\n for (var i = 0; i < elements.length; i++) {\n _one(elements[i]);\n }\n\n this.setHoverSuspended(false);\n this.setConnectionBeingDragged(false);\n };\n\n var _animProps = function (o, p) {\n var _one = function (pName) {\n if (p[pName] != null) {\n if (_ju.isString(p[pName])) {\n var m = p[pName].match(/-=/) ? -1 : 1,\n v = p[pName].substring(2);\n return o[pName] + (m * v);\n }\n else {\n return p[pName];\n }\n }\n else {\n return o[pName];\n }\n };\n return [ _one(\"left\"), _one(\"top\") ];\n };\n\n var _genLoc = function (prefix, e) {\n if (e == null) {\n return [ 0, 0 ];\n }\n var ts = _touches(e), t = _getTouch(ts, 0);\n return [t[prefix + \"X\"], t[prefix + \"Y\"]];\n },\n _pageLocation = _genLoc.bind(this, \"page\"),\n _screenLocation = _genLoc.bind(this, \"screen\"),\n _clientLocation = _genLoc.bind(this, \"client\"),\n _getTouch = function (touches, idx) {\n return touches.item ? touches.item(idx) : touches[idx];\n },\n _touches = function (e) {\n return e.touches && e.touches.length > 0 ? e.touches :\n e.changedTouches && e.changedTouches.length > 0 ? e.changedTouches :\n e.targetTouches && e.targetTouches.length > 0 ? e.targetTouches :\n [ e ];\n };\n\n /**\n Manages dragging for some instance of jsPlumb.\n\n TODO instead of this being accessed directly, it should subscribe to events on the jsPlumb instance: every method\n in here is called directly by jsPlumb. But what should happen is that we have unpublished events that this listens\n to. The only trick is getting one of these instantiated with every jsPlumb instance: it needs to have a hook somehow.\n Basically the general idea is to pull ALL the drag code out (prototype method registrations plus this) into a\n dedicated drag script), that does not necessarily need to be included.\n\n\n */\n var DragManager = function (_currentInstance) {\n var _draggables = {}, _dlist = [], _delements = {}, _elementsWithEndpoints = {},\n // elementids mapped to the draggable to which they belong.\n _draggablesForElements = {};\n\n /**\n register some element as draggable. right now the drag init stuff is done elsewhere, and it is\n possible that will continue to be the case.\n */\n this.register = function (el) {\n var id = _currentInstance.getId(el),\n parentOffset;\n\n if (!_draggables[id]) {\n _draggables[id] = el;\n _dlist.push(el);\n _delements[id] = {};\n }\n\n // look for child elements that have endpoints and register them against this draggable.\n var _oneLevel = function (p) {\n if (p) {\n for (var i = 0; i < p.childNodes.length; i++) {\n if (p.childNodes[i].nodeType !== 3 && p.childNodes[i].nodeType !== 8) {\n var cEl = jsPlumb.getElement(p.childNodes[i]),\n cid = _currentInstance.getId(p.childNodes[i], null, true);\n if (cid && _elementsWithEndpoints[cid] && _elementsWithEndpoints[cid] > 0) {\n if (!parentOffset) {\n parentOffset = _currentInstance.getOffset(el);\n }\n var cOff = _currentInstance.getOffset(cEl);\n _delements[id][cid] = {\n id: cid,\n offset: {\n left: cOff.left - parentOffset.left,\n top: cOff.top - parentOffset.top\n }\n };\n _draggablesForElements[cid] = id;\n }\n _oneLevel(p.childNodes[i]);\n }\n }\n }\n };\n\n _oneLevel(el);\n };\n\n // refresh the offsets for child elements of this element.\n this.updateOffsets = function (elId, childOffsetOverrides) {\n if (elId != null) {\n childOffsetOverrides = childOffsetOverrides || {};\n var domEl = jsPlumb.getElement(elId),\n id = _currentInstance.getId(domEl),\n children = _delements[id],\n parentOffset;\n\n if (children) {\n for (var i in children) {\n if (children.hasOwnProperty(i)) {\n var cel = jsPlumb.getElement(i),\n cOff = childOffsetOverrides[i] || _currentInstance.getOffset(cel);\n\n // do not update if we have a value already and we'd just be writing 0,0\n if (cel.offsetParent == null && _delements[id][i] != null) {\n continue;\n }\n\n if (!parentOffset) {\n parentOffset = _currentInstance.getOffset(domEl);\n }\n\n _delements[id][i] = {\n id: i,\n offset: {\n left: cOff.left - parentOffset.left,\n top: cOff.top - parentOffset.top\n }\n };\n _draggablesForElements[i] = id;\n }\n }\n }\n }\n };\n\n /**\n notification that an endpoint was added to the given el. we go up from that el's parent\n node, looking for a parent that has been registered as a draggable. if we find one, we add this\n el to that parent's list of elements to update on drag (if it is not there already)\n */\n this.endpointAdded = function (el, id) {\n\n id = id || _currentInstance.getId(el);\n\n var b = document.body,\n p = el.parentNode;\n\n _elementsWithEndpoints[id] = _elementsWithEndpoints[id] ? _elementsWithEndpoints[id] + 1 : 1;\n\n while (p != null && p !== b) {\n var pid = _currentInstance.getId(p, null, true);\n if (pid && _draggables[pid]) {\n var pLoc = _currentInstance.getOffset(p);\n\n if (_delements[pid][id] == null) {\n var cLoc = _currentInstance.getOffset(el);\n _delements[pid][id] = {\n id: id,\n offset: {\n left: cLoc.left - pLoc.left,\n top: cLoc.top - pLoc.top\n }\n };\n _draggablesForElements[id] = pid;\n }\n break;\n }\n p = p.parentNode;\n }\n };\n\n this.endpointDeleted = function (endpoint) {\n if (_elementsWithEndpoints[endpoint.elementId]) {\n _elementsWithEndpoints[endpoint.elementId]--;\n if (_elementsWithEndpoints[endpoint.elementId] <= 0) {\n for (var i in _delements) {\n if (_delements.hasOwnProperty(i) && _delements[i]) {\n delete _delements[i][endpoint.elementId];\n delete _draggablesForElements[endpoint.elementId];\n }\n }\n }\n }\n };\n\n this.changeId = function (oldId, newId) {\n _delements[newId] = _delements[oldId];\n _delements[oldId] = {};\n _draggablesForElements[newId] = _draggablesForElements[oldId];\n _draggablesForElements[oldId] = null;\n };\n\n this.getElementsForDraggable = function (id) {\n return _delements[id];\n };\n\n this.elementRemoved = function (elementId) {\n var elId = _draggablesForElements[elementId];\n if (elId) {\n delete _delements[elId][elementId];\n delete _draggablesForElements[elementId];\n }\n };\n\n this.reset = function () {\n _draggables = {};\n _dlist = [];\n _delements = {};\n _elementsWithEndpoints = {};\n };\n\n //\n // notification drag ended. We check automatically if need to update some\n // ancestor's offsets.\n //\n this.dragEnded = function (el) {\n if (el.offsetParent != null) {\n var id = _currentInstance.getId(el),\n ancestor = _draggablesForElements[id];\n\n if (ancestor) {\n this.updateOffsets(ancestor);\n }\n }\n };\n\n this.setParent = function (el, elId, p, pId, currentChildLocation) {\n var current = _draggablesForElements[elId];\n if (!_delements[pId]) {\n _delements[pId] = {};\n }\n var pLoc = _currentInstance.getOffset(p),\n cLoc = currentChildLocation || _currentInstance.getOffset(el);\n\n if (current && _delements[current]) {\n delete _delements[current][elId];\n }\n\n _delements[pId][elId] = {\n id:elId,\n offset : {\n left: cLoc.left - pLoc.left,\n top: cLoc.top - pLoc.top\n }\n };\n _draggablesForElements[elId] = pId;\n };\n\n this.clearParent = function(el, elId) {\n var current = _draggablesForElements[elId];\n if (current) {\n delete _delements[current][elId];\n delete _draggablesForElements[elId];\n }\n };\n\n this.revalidateParent = function(el, elId, childOffset) {\n var current = _draggablesForElements[elId];\n if (current) {\n var co = {};\n co[elId] = childOffset;\n this.updateOffsets(current, co);\n _currentInstance.revalidate(current);\n }\n };\n\n this.getDragAncestor = function (el) {\n var de = jsPlumb.getElement(el),\n id = _currentInstance.getId(de),\n aid = _draggablesForElements[id];\n\n if (aid) {\n return jsPlumb.getElement(aid);\n }\n else {\n return null;\n }\n };\n\n };\n\n var _setClassName = function (el, cn, classList) {\n cn = _ju.fastTrim(cn);\n if (typeof el.className.baseVal !== \"undefined\") {\n el.className.baseVal = cn;\n }\n else {\n el.className = cn;\n }\n\n // recent (i currently have 61.0.3163.100) version of chrome do not update classList when you set the base val\n // of an svg element's className. in the long run we'd like to move to just using classList anyway\n try {\n var cl = el.classList;\n if (cl != null) {\n while (cl.length > 0) {\n cl.remove(cl.item(0));\n }\n for (var i = 0; i < classList.length; i++) {\n if (classList[i]) {\n cl.add(classList[i]);\n }\n }\n }\n }\n catch(e) {\n // not fatal\n _ju.log(\"JSPLUMB: cannot set class list\", e);\n }\n },\n _getClassName = function (el) {\n return (typeof el.className.baseVal === \"undefined\") ? el.className : el.className.baseVal;\n },\n _classManip = function (el, classesToAdd, classesToRemove) {\n classesToAdd = classesToAdd == null ? [] : _ju.isArray(classesToAdd) ? classesToAdd : classesToAdd.split(/\\s+/);\n classesToRemove = classesToRemove == null ? [] : _ju.isArray(classesToRemove) ? classesToRemove : classesToRemove.split(/\\s+/);\n\n var className = _getClassName(el),\n curClasses = className.split(/\\s+/);\n\n var _oneSet = function (add, classes) {\n for (var i = 0; i < classes.length; i++) {\n if (add) {\n if (curClasses.indexOf(classes[i]) === -1) {\n curClasses.push(classes[i]);\n }\n }\n else {\n var idx = curClasses.indexOf(classes[i]);\n if (idx !== -1) {\n curClasses.splice(idx, 1);\n }\n }\n }\n };\n\n _oneSet(true, classesToAdd);\n _oneSet(false, classesToRemove);\n\n _setClassName(el, curClasses.join(\" \"), curClasses);\n };\n\n root.jsPlumb.extend(root.jsPlumbInstance.prototype, {\n\n headless: false,\n\n pageLocation: _pageLocation,\n screenLocation: _screenLocation,\n clientLocation: _clientLocation,\n\n getDragManager:function() {\n if (this.dragManager == null) {\n this.dragManager = new DragManager(this);\n }\n\n return this.dragManager;\n },\n\n recalculateOffsets:function(elId) {\n this.getDragManager().updateOffsets(elId);\n },\n\n createElement:function(tag, style, clazz, atts) {\n return this.createElementNS(null, tag, style, clazz, atts);\n },\n\n createElementNS:function(ns, tag, style, clazz, atts) {\n var e = ns == null ? document.createElement(tag) : document.createElementNS(ns, tag);\n var i;\n style = style || {};\n for (i in style) {\n e.style[i] = style[i];\n }\n\n if (clazz) {\n e.className = clazz;\n }\n\n atts = atts || {};\n for (i in atts) {\n e.setAttribute(i, \"\" + atts[i]);\n }\n\n return e;\n },\n\n getAttribute: function (el, attName) {\n return el.getAttribute != null ? el.getAttribute(attName) : null;\n },\n\n setAttribute: function (el, a, v) {\n if (el.setAttribute != null) {\n el.setAttribute(a, v);\n }\n },\n\n setAttributes: function (el, atts) {\n for (var i in atts) {\n if (atts.hasOwnProperty(i)) {\n el.setAttribute(i, atts[i]);\n }\n }\n },\n appendToRoot: function (node) {\n document.body.appendChild(node);\n },\n getRenderModes: function () {\n return [ \"svg\" ];\n },\n getClass:_getClassName,\n addClass: function (el, clazz) {\n jsPlumb.each(el, function (e) {\n _classManip(e, clazz);\n });\n },\n hasClass: function (el, clazz) {\n el = jsPlumb.getElement(el);\n if (el.classList) {\n return el.classList.contains(clazz);\n }\n else {\n return _getClassName(el).indexOf(clazz) !== -1;\n }\n },\n removeClass: function (el, clazz) {\n jsPlumb.each(el, function (e) {\n _classManip(e, null, clazz);\n });\n },\n toggleClass:function(el, clazz) {\n if (jsPlumb.hasClass(el, clazz)) {\n jsPlumb.removeClass(el, clazz);\n } else {\n jsPlumb.addClass(el, clazz);\n }\n },\n updateClasses: function (el, toAdd, toRemove) {\n jsPlumb.each(el, function (e) {\n _classManip(e, toAdd, toRemove);\n });\n },\n setClass: function (el, clazz) {\n if (clazz != null) {\n jsPlumb.each(el, function (e) {\n _setClassName(e, clazz, clazz.split(/\\s+/));\n });\n }\n },\n setPosition: function (el, p) {\n el.style.left = p.left + \"px\";\n el.style.top = p.top + \"px\";\n },\n getPosition: function (el) {\n var _one = function (prop) {\n var v = el.style[prop];\n return v ? v.substring(0, v.length - 2) : 0;\n };\n return {\n left: _one(\"left\"),\n top: _one(\"top\")\n };\n },\n getStyle:function(el, prop) {\n if (typeof window.getComputedStyle !== 'undefined') {\n return getComputedStyle(el, null).getPropertyValue(prop);\n } else {\n return el.currentStyle[prop];\n }\n },\n getSelector: function (ctx, spec) {\n var sel = null;\n if (arguments.length === 1) {\n sel = ctx.nodeType != null ? ctx : document.querySelectorAll(ctx);\n }\n else {\n sel = ctx.querySelectorAll(spec);\n }\n\n return sel;\n },\n getOffset:function(el, relativeToRoot, container) {\n el = jsPlumb.getElement(el);\n container = container || this.getContainer();\n var out = {\n left: el.offsetLeft,\n top: el.offsetTop\n },\n op = (relativeToRoot || (container != null && (el !== container && el.offsetParent !== container))) ? el.offsetParent : null,\n _maybeAdjustScroll = function(offsetParent) {\n if (offsetParent != null && offsetParent !== document.body && (offsetParent.scrollTop > 0 || offsetParent.scrollLeft > 0)) {\n out.left -= offsetParent.scrollLeft;\n out.top -= offsetParent.scrollTop;\n }\n }.bind(this);\n\n while (op != null) {\n out.left += op.offsetLeft;\n out.top += op.offsetTop;\n _maybeAdjustScroll(op);\n op = relativeToRoot ? op.offsetParent :\n op.offsetParent === container ? null : op.offsetParent;\n }\n\n // if container is scrolled and the element (or its offset parent) is not absolute or fixed, adjust accordingly.\n if (container != null && !relativeToRoot && (container.scrollTop > 0 || container.scrollLeft > 0)) {\n var pp = el.offsetParent != null ? this.getStyle(el.offsetParent, \"position\") : \"static\",\n p = this.getStyle(el, \"position\");\n if (p !== \"absolute\" && p !== \"fixed\" && pp !== \"absolute\" && pp !== \"fixed\") {\n out.left -= container.scrollLeft;\n out.top -= container.scrollTop;\n }\n }\n return out;\n },\n //\n // return x+y proportion of the given element's size corresponding to the location of the given event.\n //\n getPositionOnElement: function (evt, el, zoom) {\n var box = typeof el.getBoundingClientRect !== \"undefined\" ? el.getBoundingClientRect() : { left: 0, top: 0, width: 0, height: 0 },\n body = document.body,\n docElem = document.documentElement,\n scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop,\n scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft,\n clientTop = docElem.clientTop || body.clientTop || 0,\n clientLeft = docElem.clientLeft || body.clientLeft || 0,\n pst = 0,\n psl = 0,\n top = box.top + scrollTop - clientTop + (pst * zoom),\n left = box.left + scrollLeft - clientLeft + (psl * zoom),\n cl = jsPlumb.pageLocation(evt),\n w = box.width || (el.offsetWidth * zoom),\n h = box.height || (el.offsetHeight * zoom),\n x = (cl[0] - left) / w,\n y = (cl[1] - top) / h;\n\n return [ x, y ];\n },\n\n /**\n * Gets the absolute position of some element as read from the left/top properties in its style.\n * @method getAbsolutePosition\n * @param {Element} el The element to retrieve the absolute coordinates from. **Note** this is a DOM element, not a selector from the underlying library.\n * @return {Number[]} [left, top] pixel values.\n */\n getAbsolutePosition: function (el) {\n var _one = function (s) {\n var ss = el.style[s];\n if (ss) {\n return parseFloat(ss.substring(0, ss.length - 2));\n }\n };\n return [ _one(\"left\"), _one(\"top\") ];\n },\n\n /**\n * Sets the absolute position of some element by setting the left/top properties in its style.\n * @method setAbsolutePosition\n * @param {Element} el The element to set the absolute coordinates on. **Note** this is a DOM element, not a selector from the underlying library.\n * @param {Number[]} xy x and y coordinates\n * @param {Number[]} [animateFrom] Optional previous xy to animate from.\n * @param {Object} [animateOptions] Options for the animation.\n */\n setAbsolutePosition: function (el, xy, animateFrom, animateOptions) {\n if (animateFrom) {\n this.animate(el, {\n left: \"+=\" + (xy[0] - animateFrom[0]),\n top: \"+=\" + (xy[1] - animateFrom[1])\n }, animateOptions);\n }\n else {\n el.style.left = xy[0] + \"px\";\n el.style.top = xy[1] + \"px\";\n }\n },\n /**\n * gets the size for the element, in an array : [ width, height ].\n */\n getSize: function (el) {\n return [ el.offsetWidth, el.offsetHeight ];\n },\n getWidth: function (el) {\n return el.offsetWidth;\n },\n getHeight: function (el) {\n return el.offsetHeight;\n },\n getRenderMode : function() { return \"svg\"; },\n draggable : function (el, options) {\n var info;\n el = _ju.isArray(el) || (el.length != null && !_ju.isString(el)) ? el: [ el ];\n Array.prototype.slice.call(el).forEach(function(_el) {\n info = this.info(_el);\n if (info.el) {\n this._initDraggableIfNecessary(info.el, true, options, info.id, true);\n }\n }.bind(this));\n return this;\n },\n initDraggable: function (el, options, category) {\n _getDragManager(this, category).draggable(el, options);\n el._jsPlumbDragOptions = options;\n },\n destroyDraggable: function (el, category) {\n _getDragManager(this, category).destroyDraggable(el);\n delete el._jsPlumbDragOptions;\n },\n unbindDraggable: function (el, evt, fn, category) {\n _getDragManager(this, category).destroyDraggable(el, evt, fn);\n },\n setDraggable : function (element, draggable) {\n return jsPlumb.each(element, function (el) {\n if (this.isDragSupported(el)) {\n this._draggableStates[this.getAttribute(el, \"id\")] = draggable;\n this.setElementDraggable(el, draggable);\n }\n }.bind(this));\n },\n _draggableStates : {},\n /*\n * toggles the draggable state of the given element(s).\n * el is either an id, or an element object, or a list of ids/element objects.\n */\n toggleDraggable : function (el) {\n var state;\n jsPlumb.each(el, function (el) {\n var elId = this.getAttribute(el, \"id\");\n state = this._draggableStates[elId] == null ? false : this._draggableStates[elId];\n state = !state;\n this._draggableStates[elId] = state;\n this.setDraggable(el, state);\n return state;\n }.bind(this));\n return state;\n },\n _initDraggableIfNecessary : function (element, isDraggable, dragOptions, id, fireEvent) {\n // TODO FIRST: move to DragManager. including as much of the decision to init dragging as possible.\n if (!jsPlumb.headless) {\n var _draggable = isDraggable == null ? false : isDraggable;\n if (_draggable) {\n if (jsPlumb.isDragSupported(element, this)) {\n var options = dragOptions || this.Defaults.DragOptions;\n options = jsPlumb.extend({}, options); // make a copy.\n if (!jsPlumb.isAlreadyDraggable(element, this)) {\n var dragEvent = jsPlumb.dragEvents.drag,\n stopEvent = jsPlumb.dragEvents.stop,\n startEvent = jsPlumb.dragEvents.start;\n\n this.manage(id, element);\n\n options[startEvent] = _ju.wrap(options[startEvent], _dragStart.bind(this));\n\n options[dragEvent] = _ju.wrap(options[dragEvent], _dragMove.bind(this));\n\n options[stopEvent] = _ju.wrap(options[stopEvent], _dragStop.bind(this));\n\n var elId = this.getId(element); // need ID\n\n this._draggableStates[elId] = true;\n var draggable = this._draggableStates[elId];\n\n options.disabled = draggable == null ? false : !draggable;\n this.initDraggable(element, options);\n this.getDragManager().register(element);\n if (fireEvent) {\n this.fire(\"elementDraggable\", {el:element, options:options});\n }\n }\n else {\n // already draggable. attach any start, drag or stop listeners to the current Drag.\n if (dragOptions.force) {\n this.initDraggable(element, options);\n }\n }\n }\n }\n }\n },\n animationSupported:true,\n getElement: function (el) {\n if (el == null) {\n return null;\n }\n // here we pluck the first entry if el was a list of entries.\n // this is not my favourite thing to do, but previous versions of\n // jsplumb supported jquery selectors, and it is possible a selector\n // will be passed in here.\n el = typeof el === \"string\" ? el : el.length != null && el.enctype == null ? el[0] : el;\n return typeof el === \"string\" ? document.getElementById(el) : el;\n },\n removeElement: function (element) {\n _getDragManager(this).elementRemoved(element);\n this.getEventManager().remove(element);\n },\n //\n // this adapter supports a rudimentary animation function. no easing is supported. only\n // left/top properties are supported. property delta args are expected to be in the form\n //\n // +=x.xxxx\n //\n // or\n //\n // -=x.xxxx\n //\n doAnimate: function (el, properties, options) {\n options = options || {};\n var o = this.getOffset(el),\n ap = _animProps(o, properties),\n ldist = ap[0] - o.left,\n tdist = ap[1] - o.top,\n d = options.duration || 250,\n step = 15, steps = d / step,\n linc = (step / d) * ldist,\n tinc = (step / d) * tdist,\n idx = 0,\n _int = setInterval(function () {\n _jp.setPosition(el, {\n left: o.left + (linc * (idx + 1)),\n top: o.top + (tinc * (idx + 1))\n });\n if (options.step != null) {\n options.step(idx, Math.ceil(steps));\n }\n idx++;\n if (idx >= steps) {\n window.clearInterval(_int);\n if (options.complete != null) {\n options.complete();\n }\n }\n }, step);\n },\n // DRAG/DROP\n\n\n destroyDroppable: function (el, category) {\n _getDragManager(this, category).destroyDroppable(el);\n },\n unbindDroppable: function (el, evt, fn, category) {\n _getDragManager(this, category).destroyDroppable(el, evt, fn);\n },\n\n droppable :function(el, options) {\n el = _ju.isArray(el) || (el.length != null && !_ju.isString(el)) ? el: [ el ];\n var info;\n options = options || {};\n options.allowLoopback = false;\n Array.prototype.slice.call(el).forEach(function(_el) {\n info = this.info(_el);\n if (info.el) {\n this.initDroppable(info.el, options);\n }\n }.bind(this));\n return this;\n },\n\n initDroppable: function (el, options, category) {\n _getDragManager(this, category).droppable(el, options);\n },\n isAlreadyDraggable: function (el) {\n return el._katavorioDrag != null;\n },\n isDragSupported: function (el, options) {\n return true;\n },\n isDropSupported: function (el, options) {\n return true;\n },\n isElementDraggable: function (el) {\n el = _jp.getElement(el);\n return el._katavorioDrag && el._katavorioDrag.isEnabled();\n },\n getDragObject: function (eventArgs) {\n return eventArgs[0].drag.getDragElement();\n },\n getDragScope: function (el) {\n return el._katavorioDrag && el._katavorioDrag.scopes.join(\" \") || \"\";\n },\n getDropEvent: function (args) {\n return args[0].e;\n },\n getUIPosition: function (eventArgs, zoom) {\n // here the position reported to us by Katavorio is relative to the element's offsetParent. For top\n // level nodes that is fine, but if we have a nested draggable then its offsetParent is actually\n // not going to be the jsplumb container; it's going to be some child of that element. In that case\n // we want to adjust the UI position to account for the offsetParent's position relative to the Container\n // origin.\n var el = eventArgs[0].el;\n if (el.offsetParent == null) {\n return null;\n }\n var finalPos = eventArgs[0].finalPos || eventArgs[0].pos;\n var p = { left:finalPos[0], top:finalPos[1] };\n if (el._katavorioDrag && el.offsetParent !== this.getContainer()) {\n var oc = this.getOffset(el.offsetParent);\n p.left += oc.left;\n p.top += oc.top;\n }\n return p;\n },\n setDragFilter: function (el, filter, _exclude) {\n if (el._katavorioDrag) {\n el._katavorioDrag.setFilter(filter, _exclude);\n }\n },\n setElementDraggable: function (el, draggable) {\n el = _jp.getElement(el);\n if (el._katavorioDrag) {\n el._katavorioDrag.setEnabled(draggable);\n }\n },\n setDragScope: function (el, scope) {\n if (el._katavorioDrag) {\n el._katavorioDrag.k.setDragScope(el, scope);\n }\n },\n setDropScope:function(el, scope) {\n if (el._katavorioDrop && el._katavorioDrop.length > 0) {\n el._katavorioDrop[0].k.setDropScope(el, scope);\n }\n },\n addToPosse:function(el, spec) {\n var specs = Array.prototype.slice.call(arguments, 1);\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) {\n _el = [ _jp.getElement(_el) ];\n _el.push.apply(_el, specs );\n dm.addToPosse.apply(dm, _el);\n });\n },\n setPosse:function(el, spec) {\n var specs = Array.prototype.slice.call(arguments, 1);\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) {\n _el = [ _jp.getElement(_el) ];\n _el.push.apply(_el, specs );\n dm.setPosse.apply(dm, _el);\n });\n },\n removeFromPosse:function(el, posseId) {\n var specs = Array.prototype.slice.call(arguments, 1);\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) {\n _el = [ _jp.getElement(_el) ];\n _el.push.apply(_el, specs );\n dm.removeFromPosse.apply(dm, _el);\n });\n },\n removeFromAllPosses:function(el) {\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) { dm.removeFromAllPosses(_jp.getElement(_el)); });\n },\n setPosseState:function(el, posseId, state) {\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) { dm.setPosseState(_jp.getElement(_el), posseId, state); });\n },\n dragEvents: {\n 'start': 'start', 'stop': 'stop', 'drag': 'drag', 'step': 'step',\n 'over': 'over', 'out': 'out', 'drop': 'drop', 'complete': 'complete',\n 'beforeStart':'beforeStart'\n },\n animEvents: {\n 'step': \"step\", 'complete': 'complete'\n },\n stopDrag: function (el) {\n if (el._katavorioDrag) {\n el._katavorioDrag.abort();\n }\n },\n addToDragSelection: function (spec) {\n _getDragManager(this).select(spec);\n },\n removeFromDragSelection: function (spec) {\n _getDragManager(this).deselect(spec);\n },\n clearDragSelection: function () {\n _getDragManager(this).deselectAll();\n },\n trigger: function (el, event, originalEvent, payload) {\n this.getEventManager().trigger(el, event, originalEvent, payload);\n },\n doReset:function() {\n // look for katavorio instances and reset each one if found.\n for (var key in this) {\n if (key.indexOf(\"_katavorio_\") === 0) {\n this[key].reset();\n }\n }\n },\n getEventManager:function() {\n return _getEventManager(this);\n },\n on : function(el, event, callback) {\n // TODO: here we would like to map the tap event if we know its\n // an internal bind to a click. we have to know its internal because only\n // then can we be sure that the UP event wont be consumed (tap is a synthesized\n // event from a mousedown followed by a mouseup).\n //event = { \"click\":\"tap\", \"dblclick\":\"dbltap\"}[event] || event;\n this.getEventManager().on.apply(this, arguments);\n return this;\n },\n off : function(el, event, callback) {\n this.getEventManager().off.apply(this, arguments);\n return this;\n }\n\n });\n\n var ready = function (f) {\n var _do = function () {\n if (/complete|loaded|interactive/.test(document.readyState) && typeof(document.body) !== \"undefined\" && document.body != null) {\n f();\n }\n else {\n setTimeout(_do, 9);\n }\n };\n\n _do();\n };\n ready(_jp.init);\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/jsplumb/dist/js/jsplumb.js\n// module id = 721\n// module chunks = 3 4 5","\nimport i18n from '@/module/i18n'\n\n/**\n * cycle\n */\nconst cycleList = [\n {\n value: 'month',\n label: `${i18n.$t('月')}`\n },\n {\n value: 'week',\n label: `${i18n.$t('周')}`\n },\n {\n value: 'day',\n label: `${i18n.$t('日')}`\n },\n {\n value: 'hour',\n label: `${i18n.$t('时')}`\n }\n]\n\n/**\n * cycle value\n */\nconst dateValueList = {\n 'hour': [\n {\n value: 'last1Hour',\n label: `${i18n.$t('前1小时')}`\n },\n {\n value: 'last2Hours',\n label: `${i18n.$t('前2小时')}`\n },\n {\n value: 'last3Hours',\n label: `${i18n.$t('前3小时')}`\n }\n ],\n 'day': [\n {\n value: 'last1Days',\n label: `${i18n.$t('昨天')}`\n },\n {\n value: 'last2Days',\n label: `${i18n.$t('前两天')}`\n },\n {\n value: 'last3Days',\n label: `${i18n.$t('前三天')}`\n },\n {\n value: 'last7Days',\n label: `${i18n.$t('前七天')}`\n }\n ],\n 'week': [\n {\n value: 'lastWeek',\n label: `${i18n.$t('上周')}`\n },\n {\n value: 'lastMonday',\n label: `${i18n.$t('上周一')}`\n },\n {\n value: 'lastTuesday',\n label: `${i18n.$t('上周二')}`\n },\n {\n value: 'lastWednesday',\n label: `${i18n.$t('上周三')}`\n },\n {\n value: 'lastThursday',\n label: `${i18n.$t('上周四')}`\n },\n {\n value: 'lastFriday',\n label: `${i18n.$t('上周五')}`\n },\n {\n value: 'lastSaturday',\n label: `${i18n.$t('上周六')}`\n },\n {\n value: 'lastSunday',\n label: `${i18n.$t('上周日')}`\n }\n ],\n 'month': [\n {\n value: 'lastMonth',\n label: `${i18n.$t('上月')}`\n },\n {\n value: 'lastMonthBegin',\n label: `${i18n.$t('上月初')}`\n },\n {\n value: 'lastMonthEnd',\n label: `${i18n.$t('上月末')}`\n }\n ]\n}\n\n/**\n * direct\n */\nconst directList = [\n {\n id: 1,\n code: 'IN',\n disabled: false\n },\n {\n id: 2,\n code: 'OUT',\n disabled: false\n }\n]\n\n/**\n * type\n */\nconst typeList = [\n {\n id: 1,\n code: 'VARCHAR',\n disabled: false\n },\n {\n id: 2,\n code: 'INTEGER',\n disabled: false\n },\n {\n id: 3,\n code: 'LONG',\n disabled: false\n },\n {\n id: 4,\n code: 'FLOAT',\n disabled: false\n },\n {\n id: 5,\n code: 'DOUBLE',\n disabled: false\n },\n {\n id: 6,\n code: 'DATE',\n disabled: false\n },\n {\n id: 7,\n code: 'TIME',\n disabled: false\n },\n {\n id: 8,\n code: 'TIMESTAMP',\n disabled: false\n },\n {\n id: 9,\n code: 'BOOLEAN',\n disabled: false\n }\n]\n\n/**\n * sqlType\n */\nconst sqlTypeList = [\n {\n id: 0,\n code: `${i18n.$t('查询')}`\n },\n {\n id: 1,\n code: `${i18n.$t('非查询')}`\n }\n]\n\nexport {\n cycleList,\n dateValueList,\n typeList,\n directList,\n sqlTypeList\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/formModel/tasks/_source/commcon.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/log.vue","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var HINT_ELEMENT_CLASS = \"CodeMirror-hint\";\n var ACTIVE_HINT_ELEMENT_CLASS = \"CodeMirror-hint-active\";\n\n // This is the old interface, kept around for now to stay\n // backwards-compatible.\n CodeMirror.showHint = function(cm, getHints, options) {\n if (!getHints) return cm.showHint(options);\n if (options && options.async) getHints.async = true;\n var newOpts = {hint: getHints};\n if (options) for (var prop in options) newOpts[prop] = options[prop];\n return cm.showHint(newOpts);\n };\n\n CodeMirror.defineExtension(\"showHint\", function(options) {\n options = parseOptions(this, this.getCursor(\"start\"), options);\n var selections = this.listSelections()\n if (selections.length > 1) return;\n // By default, don't allow completion when something is selected.\n // A hint function can have a `supportsSelection` property to\n // indicate that it can handle selections.\n if (this.somethingSelected()) {\n if (!options.hint.supportsSelection) return;\n // Don't try with cross-line selections\n for (var i = 0; i < selections.length; i++)\n if (selections[i].head.line != selections[i].anchor.line) return;\n }\n\n if (this.state.completionActive) this.state.completionActive.close();\n var completion = this.state.completionActive = new Completion(this, options);\n if (!completion.options.hint) return;\n\n CodeMirror.signal(this, \"startCompletion\", this);\n completion.update(true);\n });\n\n CodeMirror.defineExtension(\"closeHint\", function() {\n if (this.state.completionActive) this.state.completionActive.close()\n })\n\n function Completion(cm, options) {\n this.cm = cm;\n this.options = options;\n this.widget = null;\n this.debounce = 0;\n this.tick = 0;\n this.startPos = this.cm.getCursor(\"start\");\n this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length;\n\n var self = this;\n cm.on(\"cursorActivity\", this.activityFunc = function() { self.cursorActivity(); });\n }\n\n var requestAnimationFrame = window.requestAnimationFrame || function(fn) {\n return setTimeout(fn, 1000/60);\n };\n var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;\n\n Completion.prototype = {\n close: function() {\n if (!this.active()) return;\n this.cm.state.completionActive = null;\n this.tick = null;\n this.cm.off(\"cursorActivity\", this.activityFunc);\n\n if (this.widget && this.data) CodeMirror.signal(this.data, \"close\");\n if (this.widget) this.widget.close();\n CodeMirror.signal(this.cm, \"endCompletion\", this.cm);\n },\n\n active: function() {\n return this.cm.state.completionActive == this;\n },\n\n pick: function(data, i) {\n var completion = data.list[i];\n if (completion.hint) completion.hint(this.cm, data, completion);\n else this.cm.replaceRange(getText(completion), completion.from || data.from,\n completion.to || data.to, \"complete\");\n CodeMirror.signal(data, \"pick\", completion);\n this.close();\n },\n\n cursorActivity: function() {\n if (this.debounce) {\n cancelAnimationFrame(this.debounce);\n this.debounce = 0;\n }\n\n var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line);\n if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch ||\n pos.ch < this.startPos.ch || this.cm.somethingSelected() ||\n (!pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {\n this.close();\n } else {\n var self = this;\n this.debounce = requestAnimationFrame(function() {self.update();});\n if (this.widget) this.widget.disable();\n }\n },\n\n update: function(first) {\n if (this.tick == null) return\n var self = this, myTick = ++this.tick\n fetchHints(this.options.hint, this.cm, this.options, function(data) {\n if (self.tick == myTick) self.finishUpdate(data, first)\n })\n },\n\n finishUpdate: function(data, first) {\n if (this.data) CodeMirror.signal(this.data, \"update\");\n\n var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);\n if (this.widget) this.widget.close();\n\n this.data = data;\n\n if (data && data.list.length) {\n if (picked && data.list.length == 1) {\n this.pick(data, 0);\n } else {\n this.widget = new Widget(this, data);\n CodeMirror.signal(data, \"shown\");\n }\n }\n }\n };\n\n function parseOptions(cm, pos, options) {\n var editor = cm.options.hintOptions;\n var out = {};\n for (var prop in defaultOptions) out[prop] = defaultOptions[prop];\n if (editor) for (var prop in editor)\n if (editor[prop] !== undefined) out[prop] = editor[prop];\n if (options) for (var prop in options)\n if (options[prop] !== undefined) out[prop] = options[prop];\n if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos)\n return out;\n }\n\n function getText(completion) {\n if (typeof completion == \"string\") return completion;\n else return completion.text;\n }\n\n function buildKeyMap(completion, handle) {\n var baseMap = {\n Up: function() {handle.moveFocus(-1);},\n Down: function() {handle.moveFocus(1);},\n PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);},\n PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);},\n Home: function() {handle.setFocus(0);},\n End: function() {handle.setFocus(handle.length - 1);},\n Enter: handle.pick,\n Tab: handle.pick,\n Esc: handle.close\n };\n\n var mac = /Mac/.test(navigator.platform);\n\n if (mac) {\n baseMap[\"Ctrl-P\"] = function() {handle.moveFocus(-1);};\n baseMap[\"Ctrl-N\"] = function() {handle.moveFocus(1);};\n }\n\n var custom = completion.options.customKeys;\n var ourMap = custom ? {} : baseMap;\n function addBinding(key, val) {\n var bound;\n if (typeof val != \"string\")\n bound = function(cm) { return val(cm, handle); };\n // This mechanism is deprecated\n else if (baseMap.hasOwnProperty(val))\n bound = baseMap[val];\n else\n bound = val;\n ourMap[key] = bound;\n }\n if (custom)\n for (var key in custom) if (custom.hasOwnProperty(key))\n addBinding(key, custom[key]);\n var extra = completion.options.extraKeys;\n if (extra)\n for (var key in extra) if (extra.hasOwnProperty(key))\n addBinding(key, extra[key]);\n return ourMap;\n }\n\n function getHintElement(hintsElement, el) {\n while (el && el != hintsElement) {\n if (el.nodeName.toUpperCase() === \"LI\" && el.parentNode == hintsElement) return el;\n el = el.parentNode;\n }\n }\n\n function Widget(completion, data) {\n this.completion = completion;\n this.data = data;\n this.picked = false;\n var widget = this, cm = completion.cm;\n var ownerDocument = cm.getInputField().ownerDocument;\n var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow;\n\n var hints = this.hints = ownerDocument.createElement(\"ul\");\n var theme = completion.cm.options.theme;\n hints.className = \"CodeMirror-hints \" + theme;\n this.selectedHint = data.selectedHint || 0;\n\n var completions = data.list;\n for (var i = 0; i < completions.length; ++i) {\n var elt = hints.appendChild(ownerDocument.createElement(\"li\")), cur = completions[i];\n var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? \"\" : \" \" + ACTIVE_HINT_ELEMENT_CLASS);\n if (cur.className != null) className = cur.className + \" \" + className;\n elt.className = className;\n if (cur.render) cur.render(elt, data, cur);\n else elt.appendChild(ownerDocument.createTextNode(cur.displayText || getText(cur)));\n elt.hintId = i;\n }\n\n var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);\n var left = pos.left, top = pos.bottom, below = true;\n hints.style.left = left + \"px\";\n hints.style.top = top + \"px\";\n // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.\n var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth);\n var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight);\n (completion.options.container || ownerDocument.body).appendChild(hints);\n var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH;\n var scrolls = hints.scrollHeight > hints.clientHeight + 1\n var startScroll = cm.getScrollInfo();\n\n if (overlapY > 0) {\n var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);\n if (curTop - height > 0) { // Fits above cursor\n hints.style.top = (top = pos.top - height) + \"px\";\n below = false;\n } else if (height > winH) {\n hints.style.height = (winH - 5) + \"px\";\n hints.style.top = (top = pos.bottom - box.top) + \"px\";\n var cursor = cm.getCursor();\n if (data.from.ch != cursor.ch) {\n pos = cm.cursorCoords(cursor);\n hints.style.left = (left = pos.left) + \"px\";\n box = hints.getBoundingClientRect();\n }\n }\n }\n var overlapX = box.right - winW;\n if (overlapX > 0) {\n if (box.right - box.left > winW) {\n hints.style.width = (winW - 5) + \"px\";\n overlapX -= (box.right - box.left) - winW;\n }\n hints.style.left = (left = pos.left - overlapX) + \"px\";\n }\n if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling)\n node.style.paddingRight = cm.display.nativeBarWidth + \"px\"\n\n cm.addKeyMap(this.keyMap = buildKeyMap(completion, {\n moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },\n setFocus: function(n) { widget.changeActive(n); },\n menuSize: function() { return widget.screenAmount(); },\n length: completions.length,\n close: function() { completion.close(); },\n pick: function() { widget.pick(); },\n data: data\n }));\n\n if (completion.options.closeOnUnfocus) {\n var closingOnBlur;\n cm.on(\"blur\", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });\n cm.on(\"focus\", this.onFocus = function() { clearTimeout(closingOnBlur); });\n }\n\n cm.on(\"scroll\", this.onScroll = function() {\n var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();\n var newTop = top + startScroll.top - curScroll.top;\n var point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop);\n if (!below) point += hints.offsetHeight;\n if (point <= editor.top || point >= editor.bottom) return completion.close();\n hints.style.top = newTop + \"px\";\n hints.style.left = (left + startScroll.left - curScroll.left) + \"px\";\n });\n\n CodeMirror.on(hints, \"dblclick\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}\n });\n\n CodeMirror.on(hints, \"click\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {\n widget.changeActive(t.hintId);\n if (completion.options.completeOnSingleClick) widget.pick();\n }\n });\n\n CodeMirror.on(hints, \"mousedown\", function() {\n setTimeout(function(){cm.focus();}, 20);\n });\n\n CodeMirror.signal(data, \"select\", completions[this.selectedHint], hints.childNodes[this.selectedHint]);\n return true;\n }\n\n Widget.prototype = {\n close: function() {\n if (this.completion.widget != this) return;\n this.completion.widget = null;\n this.hints.parentNode.removeChild(this.hints);\n this.completion.cm.removeKeyMap(this.keyMap);\n\n var cm = this.completion.cm;\n if (this.completion.options.closeOnUnfocus) {\n cm.off(\"blur\", this.onBlur);\n cm.off(\"focus\", this.onFocus);\n }\n cm.off(\"scroll\", this.onScroll);\n },\n\n disable: function() {\n this.completion.cm.removeKeyMap(this.keyMap);\n var widget = this;\n this.keyMap = {Enter: function() { widget.picked = true; }};\n this.completion.cm.addKeyMap(this.keyMap);\n },\n\n pick: function() {\n this.completion.pick(this.data, this.selectedHint);\n },\n\n changeActive: function(i, avoidWrap) {\n if (i >= this.data.list.length)\n i = avoidWrap ? this.data.list.length - 1 : 0;\n else if (i < 0)\n i = avoidWrap ? 0 : this.data.list.length - 1;\n if (this.selectedHint == i) return;\n var node = this.hints.childNodes[this.selectedHint];\n if (node) node.className = node.className.replace(\" \" + ACTIVE_HINT_ELEMENT_CLASS, \"\");\n node = this.hints.childNodes[this.selectedHint = i];\n node.className += \" \" + ACTIVE_HINT_ELEMENT_CLASS;\n if (node.offsetTop < this.hints.scrollTop)\n this.hints.scrollTop = node.offsetTop - 3;\n else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)\n this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3;\n CodeMirror.signal(this.data, \"select\", this.data.list[this.selectedHint], node);\n },\n\n screenAmount: function() {\n return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;\n }\n };\n\n function applicableHelpers(cm, helpers) {\n if (!cm.somethingSelected()) return helpers\n var result = []\n for (var i = 0; i < helpers.length; i++)\n if (helpers[i].supportsSelection) result.push(helpers[i])\n return result\n }\n\n function fetchHints(hint, cm, options, callback) {\n if (hint.async) {\n hint(cm, callback, options)\n } else {\n var result = hint(cm, options)\n if (result && result.then) result.then(callback)\n else callback(result)\n }\n }\n\n function resolveAutoHints(cm, pos) {\n var helpers = cm.getHelpers(pos, \"hint\"), words\n if (helpers.length) {\n var resolved = function(cm, callback, options) {\n var app = applicableHelpers(cm, helpers);\n function run(i) {\n if (i == app.length) return callback(null)\n fetchHints(app[i], cm, options, function(result) {\n if (result && result.list.length > 0) callback(result)\n else run(i + 1)\n })\n }\n run(0)\n }\n resolved.async = true\n resolved.supportsSelection = true\n return resolved\n } else if (words = cm.getHelper(cm.getCursor(), \"hintWords\")) {\n return function(cm) { return CodeMirror.hint.fromList(cm, {words: words}) }\n } else if (CodeMirror.hint.anyword) {\n return function(cm, options) { return CodeMirror.hint.anyword(cm, options) }\n } else {\n return function() {}\n }\n }\n\n CodeMirror.registerHelper(\"hint\", \"auto\", {\n resolve: resolveAutoHints\n });\n\n CodeMirror.registerHelper(\"hint\", \"fromList\", function(cm, options) {\n var cur = cm.getCursor(), token = cm.getTokenAt(cur)\n var term, from = CodeMirror.Pos(cur.line, token.start), to = cur\n if (token.start < cur.ch && /\\w/.test(token.string.charAt(cur.ch - token.start - 1))) {\n term = token.string.substr(0, cur.ch - token.start)\n } else {\n term = \"\"\n from = cur\n }\n var found = [];\n for (var i = 0; i < options.words.length; i++) {\n var word = options.words[i];\n if (word.slice(0, term.length) == term)\n found.push(word);\n }\n\n if (found.length) return {list: found, from: from, to: to};\n });\n\n CodeMirror.commands.autocomplete = CodeMirror.showHint;\n\n var defaultOptions = {\n hint: CodeMirror.hint.auto,\n completeSingle: true,\n alignWithWord: true,\n closeCharacters: /[\\s()\\[\\]{};:>,]/,\n closeOnUnfocus: true,\n completeOnSingleClick: true,\n container: null,\n customKeys: null,\n extraKeys: null\n };\n\n CodeMirror.defineOption(\"hintOptions\", null);\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/addon/hint/show-hint.js\n// module id = 725\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"../../mode/sql/sql\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"../../mode/sql/sql\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var tables;\n var defaultTable;\n var keywords;\n var identifierQuote;\n var CONS = {\n QUERY_DIV: \";\",\n ALIAS_KEYWORD: \"AS\"\n };\n var Pos = CodeMirror.Pos, cmpPos = CodeMirror.cmpPos;\n\n function isArray(val) { return Object.prototype.toString.call(val) == \"[object Array]\" }\n\n function getKeywords(editor) {\n var mode = editor.doc.modeOption;\n if (mode === \"sql\") mode = \"text/x-sql\";\n return CodeMirror.resolveMode(mode).keywords;\n }\n\n function getIdentifierQuote(editor) {\n var mode = editor.doc.modeOption;\n if (mode === \"sql\") mode = \"text/x-sql\";\n return CodeMirror.resolveMode(mode).identifierQuote || \"`\";\n }\n\n function getText(item) {\n return typeof item == \"string\" ? item : item.text;\n }\n\n function wrapTable(name, value) {\n if (isArray(value)) value = {columns: value}\n if (!value.text) value.text = name\n return value\n }\n\n function parseTables(input) {\n var result = {}\n if (isArray(input)) {\n for (var i = input.length - 1; i >= 0; i--) {\n var item = input[i]\n result[getText(item).toUpperCase()] = wrapTable(getText(item), item)\n }\n } else if (input) {\n for (var name in input)\n result[name.toUpperCase()] = wrapTable(name, input[name])\n }\n return result\n }\n\n function getTable(name) {\n return tables[name.toUpperCase()]\n }\n\n function shallowClone(object) {\n var result = {};\n for (var key in object) if (object.hasOwnProperty(key))\n result[key] = object[key];\n return result;\n }\n\n function match(string, word) {\n var len = string.length;\n var sub = getText(word).substr(0, len);\n return string.toUpperCase() === sub.toUpperCase();\n }\n\n function addMatches(result, search, wordlist, formatter) {\n if (isArray(wordlist)) {\n for (var i = 0; i < wordlist.length; i++)\n if (match(search, wordlist[i])) result.push(formatter(wordlist[i]))\n } else {\n for (var word in wordlist) if (wordlist.hasOwnProperty(word)) {\n var val = wordlist[word]\n if (!val || val === true)\n val = word\n else\n val = val.displayText ? {text: val.text, displayText: val.displayText} : val.text\n if (match(search, val)) result.push(formatter(val))\n }\n }\n }\n\n function cleanName(name) {\n // Get rid name from identifierQuote and preceding dot(.)\n if (name.charAt(0) == \".\") {\n name = name.substr(1);\n }\n // replace doublicated identifierQuotes with single identifierQuotes\n // and remove single identifierQuotes\n var nameParts = name.split(identifierQuote+identifierQuote);\n for (var i = 0; i < nameParts.length; i++)\n nameParts[i] = nameParts[i].replace(new RegExp(identifierQuote,\"g\"), \"\");\n return nameParts.join(identifierQuote);\n }\n\n function insertIdentifierQuotes(name) {\n var nameParts = getText(name).split(\".\");\n for (var i = 0; i < nameParts.length; i++)\n nameParts[i] = identifierQuote +\n // doublicate identifierQuotes\n nameParts[i].replace(new RegExp(identifierQuote,\"g\"), identifierQuote+identifierQuote) +\n identifierQuote;\n var escaped = nameParts.join(\".\");\n if (typeof name == \"string\") return escaped;\n name = shallowClone(name);\n name.text = escaped;\n return name;\n }\n\n function nameCompletion(cur, token, result, editor) {\n // Try to complete table, column names and return start position of completion\n var useIdentifierQuotes = false;\n var nameParts = [];\n var start = token.start;\n var cont = true;\n while (cont) {\n cont = (token.string.charAt(0) == \".\");\n useIdentifierQuotes = useIdentifierQuotes || (token.string.charAt(0) == identifierQuote);\n\n start = token.start;\n nameParts.unshift(cleanName(token.string));\n\n token = editor.getTokenAt(Pos(cur.line, token.start));\n if (token.string == \".\") {\n cont = true;\n token = editor.getTokenAt(Pos(cur.line, token.start));\n }\n }\n\n // Try to complete table names\n var string = nameParts.join(\".\");\n addMatches(result, string, tables, function(w) {\n return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;\n });\n\n // Try to complete columns from defaultTable\n addMatches(result, string, defaultTable, function(w) {\n return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;\n });\n\n // Try to complete columns\n string = nameParts.pop();\n var table = nameParts.join(\".\");\n\n var alias = false;\n var aliasTable = table;\n // Check if table is available. If not, find table by Alias\n if (!getTable(table)) {\n var oldTable = table;\n table = findTableByAlias(table, editor);\n if (table !== oldTable) alias = true;\n }\n\n var columns = getTable(table);\n if (columns && columns.columns)\n columns = columns.columns;\n\n if (columns) {\n addMatches(result, string, columns, function(w) {\n var tableInsert = table;\n if (alias == true) tableInsert = aliasTable;\n if (typeof w == \"string\") {\n w = tableInsert + \".\" + w;\n } else {\n w = shallowClone(w);\n w.text = tableInsert + \".\" + w.text;\n }\n return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;\n });\n }\n\n return start;\n }\n\n function eachWord(lineText, f) {\n var words = lineText.split(/\\s+/)\n for (var i = 0; i < words.length; i++)\n if (words[i]) f(words[i].replace(/[,;]/g, ''))\n }\n\n function findTableByAlias(alias, editor) {\n var doc = editor.doc;\n var fullQuery = doc.getValue();\n var aliasUpperCase = alias.toUpperCase();\n var previousWord = \"\";\n var table = \"\";\n var separator = [];\n var validRange = {\n start: Pos(0, 0),\n end: Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).length)\n };\n\n //add separator\n var indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV);\n while(indexOfSeparator != -1) {\n separator.push(doc.posFromIndex(indexOfSeparator));\n indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV, indexOfSeparator+1);\n }\n separator.unshift(Pos(0, 0));\n separator.push(Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).text.length));\n\n //find valid range\n var prevItem = null;\n var current = editor.getCursor()\n for (var i = 0; i < separator.length; i++) {\n if ((prevItem == null || cmpPos(current, prevItem) > 0) && cmpPos(current, separator[i]) <= 0) {\n validRange = {start: prevItem, end: separator[i]};\n break;\n }\n prevItem = separator[i];\n }\n\n if (validRange.start) {\n var query = doc.getRange(validRange.start, validRange.end, false);\n\n for (var i = 0; i < query.length; i++) {\n var lineText = query[i];\n eachWord(lineText, function(word) {\n var wordUpperCase = word.toUpperCase();\n if (wordUpperCase === aliasUpperCase && getTable(previousWord))\n table = previousWord;\n if (wordUpperCase !== CONS.ALIAS_KEYWORD)\n previousWord = word;\n });\n if (table) break;\n }\n }\n return table;\n }\n\n CodeMirror.registerHelper(\"hint\", \"sql\", function(editor, options) {\n tables = parseTables(options && options.tables)\n var defaultTableName = options && options.defaultTable;\n var disableKeywords = options && options.disableKeywords;\n defaultTable = defaultTableName && getTable(defaultTableName);\n keywords = getKeywords(editor);\n identifierQuote = getIdentifierQuote(editor);\n\n if (defaultTableName && !defaultTable)\n defaultTable = findTableByAlias(defaultTableName, editor);\n\n defaultTable = defaultTable || [];\n\n if (defaultTable.columns)\n defaultTable = defaultTable.columns;\n\n var cur = editor.getCursor();\n var result = [];\n var token = editor.getTokenAt(cur), start, end, search;\n if (token.end > cur.ch) {\n token.end = cur.ch;\n token.string = token.string.slice(0, cur.ch - token.start);\n }\n\n if (token.string.match(/^[.`\"\\w@]\\w*$/)) {\n search = token.string;\n start = token.start;\n end = token.end;\n } else {\n start = end = cur.ch;\n search = \"\";\n }\n if (search.charAt(0) == \".\" || search.charAt(0) == identifierQuote) {\n start = nameCompletion(cur, token, result, editor);\n } else {\n var objectOrClass = function(w, className) {\n if (typeof w === \"object\") {\n w.className = className;\n } else {\n w = { text: w, className: className };\n }\n return w;\n };\n addMatches(result, search, defaultTable, function(w) {\n return objectOrClass(w, \"CodeMirror-hint-table CodeMirror-hint-default-table\");\n });\n addMatches(\n result,\n search,\n tables, function(w) {\n return objectOrClass(w, \"CodeMirror-hint-table\");\n }\n );\n if (!disableKeywords)\n addMatches(result, search, keywords, function(w) {\n return objectOrClass(w.toUpperCase(), \"CodeMirror-hint-keyword\");\n });\n }\n\n return {list: result, from: Pos(cur.line, start), to: Pos(cur.line, end)};\n });\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/addon/hint/sql-hint.js\n// module id = 726\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var Pos = CodeMirror.Pos;\n\n function matches(hint, typed, matchInMiddle) {\n if (matchInMiddle) return hint.indexOf(typed) >= 0;\n else return hint.lastIndexOf(typed, 0) == 0;\n }\n\n function getHints(cm, options) {\n var tags = options && options.schemaInfo;\n var quote = (options && options.quoteChar) || '\"';\n var matchInMiddle = options && options.matchInMiddle;\n if (!tags) return;\n var cur = cm.getCursor(), token = cm.getTokenAt(cur);\n if (token.end > cur.ch) {\n token.end = cur.ch;\n token.string = token.string.slice(0, cur.ch - token.start);\n }\n var inner = CodeMirror.innerMode(cm.getMode(), token.state);\n if (inner.mode.name != \"xml\") return;\n var result = [], replaceToken = false, prefix;\n var tag = /\\btag\\b/.test(token.type) && !/>$/.test(token.string);\n var tagName = tag && /^\\w/.test(token.string), tagStart;\n\n if (tagName) {\n var before = cm.getLine(cur.line).slice(Math.max(0, token.start - 2), token.start);\n var tagType = /<\\/$/.test(before) ? \"close\" : /<$/.test(before) ? \"open\" : null;\n if (tagType) tagStart = token.start - (tagType == \"close\" ? 2 : 1);\n } else if (tag && token.string == \"<\") {\n tagType = \"open\";\n } else if (tag && token.string == \"\");\n } else {\n // Attribute completion\n var curTag = tags[inner.state.tagName], attrs = curTag && curTag.attrs;\n var globalAttrs = tags[\"!attrs\"];\n if (!attrs && !globalAttrs) return;\n if (!attrs) {\n attrs = globalAttrs;\n } else if (globalAttrs) { // Combine tag-local and global attributes\n var set = {};\n for (var nm in globalAttrs) if (globalAttrs.hasOwnProperty(nm)) set[nm] = globalAttrs[nm];\n for (var nm in attrs) if (attrs.hasOwnProperty(nm)) set[nm] = attrs[nm];\n attrs = set;\n }\n if (token.type == \"string\" || token.string == \"=\") { // A value\n var before = cm.getRange(Pos(cur.line, Math.max(0, cur.ch - 60)),\n Pos(cur.line, token.type == \"string\" ? token.start : token.end));\n var atName = before.match(/([^\\s\\u00a0=<>\\\"\\']+)=$/), atValues;\n if (!atName || !attrs.hasOwnProperty(atName[1]) || !(atValues = attrs[atName[1]])) return;\n if (typeof atValues == 'function') atValues = atValues.call(this, cm); // Functions can be used to supply values for autocomplete widget\n if (token.type == \"string\") {\n prefix = token.string;\n var n = 0;\n if (/['\"]/.test(token.string.charAt(0))) {\n quote = token.string.charAt(0);\n prefix = token.string.slice(1);\n n++;\n }\n var len = token.string.length;\n if (/['\"]/.test(token.string.charAt(len - 1))) {\n quote = token.string.charAt(len - 1);\n prefix = token.string.substr(n, len - 2);\n }\n replaceToken = true;\n }\n for (var i = 0; i < atValues.length; ++i) if (!prefix || matches(atValues[i], prefix, matchInMiddle))\n result.push(quote + atValues[i] + quote);\n } else { // An attribute name\n if (token.type == \"attribute\") {\n prefix = token.string;\n replaceToken = true;\n }\n for (var attr in attrs) if (attrs.hasOwnProperty(attr) && (!prefix || matches(attr, prefix, matchInMiddle)))\n result.push(attr);\n }\n }\n return {\n list: result,\n from: replaceToken ? Pos(cur.line, tagStart == null ? token.start : tagStart) : cur,\n to: replaceToken ? Pos(cur.line, token.end) : cur\n };\n }\n\n CodeMirror.registerHelper(\"hint\", \"xml\", getHints);\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/addon/hint/xml-hint.js\n// module id = 727\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n function wordRegexp(words) {\n return new RegExp(\"^((\" + words.join(\")|(\") + \"))\\\\b\");\n }\n\n var wordOperators = wordRegexp([\"and\", \"or\", \"not\", \"is\"]);\n var commonKeywords = [\"as\", \"assert\", \"break\", \"class\", \"continue\",\n \"def\", \"del\", \"elif\", \"else\", \"except\", \"finally\",\n \"for\", \"from\", \"global\", \"if\", \"import\",\n \"lambda\", \"pass\", \"raise\", \"return\",\n \"try\", \"while\", \"with\", \"yield\", \"in\"];\n var commonBuiltins = [\"abs\", \"all\", \"any\", \"bin\", \"bool\", \"bytearray\", \"callable\", \"chr\",\n \"classmethod\", \"compile\", \"complex\", \"delattr\", \"dict\", \"dir\", \"divmod\",\n \"enumerate\", \"eval\", \"filter\", \"float\", \"format\", \"frozenset\",\n \"getattr\", \"globals\", \"hasattr\", \"hash\", \"help\", \"hex\", \"id\",\n \"input\", \"int\", \"isinstance\", \"issubclass\", \"iter\", \"len\",\n \"list\", \"locals\", \"map\", \"max\", \"memoryview\", \"min\", \"next\",\n \"object\", \"oct\", \"open\", \"ord\", \"pow\", \"property\", \"range\",\n \"repr\", \"reversed\", \"round\", \"set\", \"setattr\", \"slice\",\n \"sorted\", \"staticmethod\", \"str\", \"sum\", \"super\", \"tuple\",\n \"type\", \"vars\", \"zip\", \"__import__\", \"NotImplemented\",\n \"Ellipsis\", \"__debug__\"];\n CodeMirror.registerHelper(\"hintWords\", \"python\", commonKeywords.concat(commonBuiltins));\n\n function top(state) {\n return state.scopes[state.scopes.length - 1];\n }\n\n CodeMirror.defineMode(\"python\", function(conf, parserConf) {\n var ERRORCLASS = \"error\";\n\n var delimiters = parserConf.delimiters || parserConf.singleDelimiters || /^[\\(\\)\\[\\]\\{\\}@,:`=;\\.\\\\]/;\n // (Backwards-compatiblity with old, cumbersome config system)\n var operators = [parserConf.singleOperators, parserConf.doubleOperators, parserConf.doubleDelimiters, parserConf.tripleDelimiters,\n parserConf.operators || /^([-+*/%\\/&|^]=?|[<>=]+|\\/\\/=?|\\*\\*=?|!=|[~!@])/]\n for (var i = 0; i < operators.length; i++) if (!operators[i]) operators.splice(i--, 1)\n\n var hangingIndent = parserConf.hangingIndent || conf.indentUnit;\n\n var myKeywords = commonKeywords, myBuiltins = commonBuiltins;\n if (parserConf.extra_keywords != undefined)\n myKeywords = myKeywords.concat(parserConf.extra_keywords);\n\n if (parserConf.extra_builtins != undefined)\n myBuiltins = myBuiltins.concat(parserConf.extra_builtins);\n\n var py3 = !(parserConf.version && Number(parserConf.version) < 3)\n if (py3) {\n // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator\n var identifiers = parserConf.identifiers|| /^[_A-Za-z\\u00A1-\\uFFFF][_A-Za-z0-9\\u00A1-\\uFFFF]*/;\n myKeywords = myKeywords.concat([\"nonlocal\", \"False\", \"True\", \"None\", \"async\", \"await\"]);\n myBuiltins = myBuiltins.concat([\"ascii\", \"bytes\", \"exec\", \"print\"]);\n var stringPrefixes = new RegExp(\"^(([rbuf]|(br)|(fr))?('{3}|\\\"{3}|['\\\"]))\", \"i\");\n } else {\n var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/;\n myKeywords = myKeywords.concat([\"exec\", \"print\"]);\n myBuiltins = myBuiltins.concat([\"apply\", \"basestring\", \"buffer\", \"cmp\", \"coerce\", \"execfile\",\n \"file\", \"intern\", \"long\", \"raw_input\", \"reduce\", \"reload\",\n \"unichr\", \"unicode\", \"xrange\", \"False\", \"True\", \"None\"]);\n var stringPrefixes = new RegExp(\"^(([rubf]|(ur)|(br))?('{3}|\\\"{3}|['\\\"]))\", \"i\");\n }\n var keywords = wordRegexp(myKeywords);\n var builtins = wordRegexp(myBuiltins);\n\n // tokenizers\n function tokenBase(stream, state) {\n var sol = stream.sol() && state.lastToken != \"\\\\\"\n if (sol) state.indent = stream.indentation()\n // Handle scope changes\n if (sol && top(state).type == \"py\") {\n var scopeOffset = top(state).offset;\n if (stream.eatSpace()) {\n var lineOffset = stream.indentation();\n if (lineOffset > scopeOffset)\n pushPyScope(state);\n else if (lineOffset < scopeOffset && dedent(stream, state) && stream.peek() != \"#\")\n state.errorToken = true;\n return null;\n } else {\n var style = tokenBaseInner(stream, state);\n if (scopeOffset > 0 && dedent(stream, state))\n style += \" \" + ERRORCLASS;\n return style;\n }\n }\n return tokenBaseInner(stream, state);\n }\n\n function tokenBaseInner(stream, state) {\n if (stream.eatSpace()) return null;\n\n // Handle Comments\n if (stream.match(/^#.*/)) return \"comment\";\n\n // Handle Number Literals\n if (stream.match(/^[0-9\\.]/, false)) {\n var floatLiteral = false;\n // Floats\n if (stream.match(/^[\\d_]*\\.\\d+(e[\\+\\-]?\\d+)?/i)) { floatLiteral = true; }\n if (stream.match(/^[\\d_]+\\.\\d*/)) { floatLiteral = true; }\n if (stream.match(/^\\.\\d+/)) { floatLiteral = true; }\n if (floatLiteral) {\n // Float literals may be \"imaginary\"\n stream.eat(/J/i);\n return \"number\";\n }\n // Integers\n var intLiteral = false;\n // Hex\n if (stream.match(/^0x[0-9a-f_]+/i)) intLiteral = true;\n // Binary\n if (stream.match(/^0b[01_]+/i)) intLiteral = true;\n // Octal\n if (stream.match(/^0o[0-7_]+/i)) intLiteral = true;\n // Decimal\n if (stream.match(/^[1-9][\\d_]*(e[\\+\\-]?[\\d_]+)?/)) {\n // Decimal literals may be \"imaginary\"\n stream.eat(/J/i);\n // TODO - Can you have imaginary longs?\n intLiteral = true;\n }\n // Zero by itself with no other piece of number.\n if (stream.match(/^0(?![\\dx])/i)) intLiteral = true;\n if (intLiteral) {\n // Integer literals may be \"long\"\n stream.eat(/L/i);\n return \"number\";\n }\n }\n\n // Handle Strings\n if (stream.match(stringPrefixes)) {\n var isFmtString = stream.current().toLowerCase().indexOf('f') !== -1;\n if (!isFmtString) {\n state.tokenize = tokenStringFactory(stream.current(), state.tokenize);\n return state.tokenize(stream, state);\n } else {\n state.tokenize = formatStringFactory(stream.current(), state.tokenize);\n return state.tokenize(stream, state);\n }\n }\n\n for (var i = 0; i < operators.length; i++)\n if (stream.match(operators[i])) return \"operator\"\n\n if (stream.match(delimiters)) return \"punctuation\";\n\n if (state.lastToken == \".\" && stream.match(identifiers))\n return \"property\";\n\n if (stream.match(keywords) || stream.match(wordOperators))\n return \"keyword\";\n\n if (stream.match(builtins))\n return \"builtin\";\n\n if (stream.match(/^(self|cls)\\b/))\n return \"variable-2\";\n\n if (stream.match(identifiers)) {\n if (state.lastToken == \"def\" || state.lastToken == \"class\")\n return \"def\";\n return \"variable\";\n }\n\n // Handle non-detected items\n stream.next();\n return ERRORCLASS;\n }\n\n function formatStringFactory(delimiter, tokenOuter) {\n while (\"rubf\".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)\n delimiter = delimiter.substr(1);\n\n var singleline = delimiter.length == 1;\n var OUTCLASS = \"string\";\n\n function tokenNestedExpr(depth) {\n return function(stream, state) {\n var inner = tokenBaseInner(stream, state)\n if (inner == \"punctuation\") {\n if (stream.current() == \"{\") {\n state.tokenize = tokenNestedExpr(depth + 1)\n } else if (stream.current() == \"}\") {\n if (depth > 1) state.tokenize = tokenNestedExpr(depth - 1)\n else state.tokenize = tokenString\n }\n }\n return inner\n }\n }\n\n function tokenString(stream, state) {\n while (!stream.eol()) {\n stream.eatWhile(/[^'\"\\{\\}\\\\]/);\n if (stream.eat(\"\\\\\")) {\n stream.next();\n if (singleline && stream.eol())\n return OUTCLASS;\n } else if (stream.match(delimiter)) {\n state.tokenize = tokenOuter;\n return OUTCLASS;\n } else if (stream.match('{{')) {\n // ignore {{ in f-str\n return OUTCLASS;\n } else if (stream.match('{', false)) {\n // switch to nested mode\n state.tokenize = tokenNestedExpr(0)\n if (stream.current()) return OUTCLASS;\n else return state.tokenize(stream, state)\n } else if (stream.match('}}')) {\n return OUTCLASS;\n } else if (stream.match('}')) {\n // single } in f-string is an error\n return ERRORCLASS;\n } else {\n stream.eat(/['\"]/);\n }\n }\n if (singleline) {\n if (parserConf.singleLineStringErrors)\n return ERRORCLASS;\n else\n state.tokenize = tokenOuter;\n }\n return OUTCLASS;\n }\n tokenString.isString = true;\n return tokenString;\n }\n\n function tokenStringFactory(delimiter, tokenOuter) {\n while (\"rubf\".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)\n delimiter = delimiter.substr(1);\n\n var singleline = delimiter.length == 1;\n var OUTCLASS = \"string\";\n\n function tokenString(stream, state) {\n while (!stream.eol()) {\n stream.eatWhile(/[^'\"\\\\]/);\n if (stream.eat(\"\\\\\")) {\n stream.next();\n if (singleline && stream.eol())\n return OUTCLASS;\n } else if (stream.match(delimiter)) {\n state.tokenize = tokenOuter;\n return OUTCLASS;\n } else {\n stream.eat(/['\"]/);\n }\n }\n if (singleline) {\n if (parserConf.singleLineStringErrors)\n return ERRORCLASS;\n else\n state.tokenize = tokenOuter;\n }\n return OUTCLASS;\n }\n tokenString.isString = true;\n return tokenString;\n }\n\n function pushPyScope(state) {\n while (top(state).type != \"py\") state.scopes.pop()\n state.scopes.push({offset: top(state).offset + conf.indentUnit,\n type: \"py\",\n align: null})\n }\n\n function pushBracketScope(stream, state, type) {\n var align = stream.match(/^([\\s\\[\\{\\(]|#.*)*$/, false) ? null : stream.column() + 1\n state.scopes.push({offset: state.indent + hangingIndent,\n type: type,\n align: align})\n }\n\n function dedent(stream, state) {\n var indented = stream.indentation();\n while (state.scopes.length > 1 && top(state).offset > indented) {\n if (top(state).type != \"py\") return true;\n state.scopes.pop();\n }\n return top(state).offset != indented;\n }\n\n function tokenLexer(stream, state) {\n if (stream.sol()) state.beginningOfLine = true;\n\n var style = state.tokenize(stream, state);\n var current = stream.current();\n\n // Handle decorators\n if (state.beginningOfLine && current == \"@\")\n return stream.match(identifiers, false) ? \"meta\" : py3 ? \"operator\" : ERRORCLASS;\n\n if (/\\S/.test(current)) state.beginningOfLine = false;\n\n if ((style == \"variable\" || style == \"builtin\")\n && state.lastToken == \"meta\")\n style = \"meta\";\n\n // Handle scope changes.\n if (current == \"pass\" || current == \"return\")\n state.dedent += 1;\n\n if (current == \"lambda\") state.lambda = true;\n if (current == \":\" && !state.lambda && top(state).type == \"py\")\n pushPyScope(state);\n\n if (current.length == 1 && !/string|comment/.test(style)) {\n var delimiter_index = \"[({\".indexOf(current);\n if (delimiter_index != -1)\n pushBracketScope(stream, state, \"])}\".slice(delimiter_index, delimiter_index+1));\n\n delimiter_index = \"])}\".indexOf(current);\n if (delimiter_index != -1) {\n if (top(state).type == current) state.indent = state.scopes.pop().offset - hangingIndent\n else return ERRORCLASS;\n }\n }\n if (state.dedent > 0 && stream.eol() && top(state).type == \"py\") {\n if (state.scopes.length > 1) state.scopes.pop();\n state.dedent -= 1;\n }\n\n return style;\n }\n\n var external = {\n startState: function(basecolumn) {\n return {\n tokenize: tokenBase,\n scopes: [{offset: basecolumn || 0, type: \"py\", align: null}],\n indent: basecolumn || 0,\n lastToken: null,\n lambda: false,\n dedent: 0\n };\n },\n\n token: function(stream, state) {\n var addErr = state.errorToken;\n if (addErr) state.errorToken = false;\n var style = tokenLexer(stream, state);\n\n if (style && style != \"comment\")\n state.lastToken = (style == \"keyword\" || style == \"punctuation\") ? stream.current() : style;\n if (style == \"punctuation\") style = null;\n\n if (stream.eol() && state.lambda)\n state.lambda = false;\n return addErr ? style + \" \" + ERRORCLASS : style;\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize != tokenBase)\n return state.tokenize.isString ? CodeMirror.Pass : 0;\n\n var scope = top(state), closing = scope.type == textAfter.charAt(0)\n if (scope.align != null)\n return scope.align - (closing ? 1 : 0)\n else\n return scope.offset - (closing ? hangingIndent : 0)\n },\n\n electricInput: /^\\s*[\\}\\]\\)]$/,\n closeBrackets: {triples: \"'\\\"\"},\n lineComment: \"#\",\n fold: \"indent\"\n };\n return external;\n });\n\n CodeMirror.defineMIME(\"text/x-python\", \"python\");\n\n var words = function(str) { return str.split(\" \"); };\n\n CodeMirror.defineMIME(\"text/x-cython\", {\n name: \"python\",\n extra_keywords: words(\"by cdef cimport cpdef ctypedef enum except \"+\n \"extern gil include nogil property public \"+\n \"readonly struct union DEF IF ELIF ELSE\")\n });\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/python/python.js\n// module id = 728\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nvar htmlConfig = {\n autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,\n 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,\n 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,\n 'track': true, 'wbr': true, 'menuitem': true},\n implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,\n 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,\n 'th': true, 'tr': true},\n contextGrabbers: {\n 'dd': {'dd': true, 'dt': true},\n 'dt': {'dd': true, 'dt': true},\n 'li': {'li': true},\n 'option': {'option': true, 'optgroup': true},\n 'optgroup': {'optgroup': true},\n 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,\n 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,\n 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,\n 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,\n 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},\n 'rp': {'rp': true, 'rt': true},\n 'rt': {'rp': true, 'rt': true},\n 'tbody': {'tbody': true, 'tfoot': true},\n 'td': {'td': true, 'th': true},\n 'tfoot': {'tbody': true},\n 'th': {'td': true, 'th': true},\n 'thead': {'tbody': true, 'tfoot': true},\n 'tr': {'tr': true}\n },\n doNotIndent: {\"pre\": true},\n allowUnquoted: true,\n allowMissing: true,\n caseFold: true\n}\n\nvar xmlConfig = {\n autoSelfClosers: {},\n implicitlyClosed: {},\n contextGrabbers: {},\n doNotIndent: {},\n allowUnquoted: false,\n allowMissing: false,\n allowMissingTagName: false,\n caseFold: false\n}\n\nCodeMirror.defineMode(\"xml\", function(editorConf, config_) {\n var indentUnit = editorConf.indentUnit\n var config = {}\n var defaults = config_.htmlMode ? htmlConfig : xmlConfig\n for (var prop in defaults) config[prop] = defaults[prop]\n for (var prop in config_) config[prop] = config_[prop]\n\n // Return variables for tokenizers\n var type, setStyle;\n\n function inText(stream, state) {\n function chain(parser) {\n state.tokenize = parser;\n return parser(stream, state);\n }\n\n var ch = stream.next();\n if (ch == \"<\") {\n if (stream.eat(\"!\")) {\n if (stream.eat(\"[\")) {\n if (stream.match(\"CDATA[\")) return chain(inBlock(\"atom\", \"]]>\"));\n else return null;\n } else if (stream.match(\"--\")) {\n return chain(inBlock(\"comment\", \"-->\"));\n } else if (stream.match(\"DOCTYPE\", true, true)) {\n stream.eatWhile(/[\\w\\._\\-]/);\n return chain(doctype(1));\n } else {\n return null;\n }\n } else if (stream.eat(\"?\")) {\n stream.eatWhile(/[\\w\\._\\-]/);\n state.tokenize = inBlock(\"meta\", \"?>\");\n return \"meta\";\n } else {\n type = stream.eat(\"/\") ? \"closeTag\" : \"openTag\";\n state.tokenize = inTag;\n return \"tag bracket\";\n }\n } else if (ch == \"&\") {\n var ok;\n if (stream.eat(\"#\")) {\n if (stream.eat(\"x\")) {\n ok = stream.eatWhile(/[a-fA-F\\d]/) && stream.eat(\";\");\n } else {\n ok = stream.eatWhile(/[\\d]/) && stream.eat(\";\");\n }\n } else {\n ok = stream.eatWhile(/[\\w\\.\\-:]/) && stream.eat(\";\");\n }\n return ok ? \"atom\" : \"error\";\n } else {\n stream.eatWhile(/[^&<]/);\n return null;\n }\n }\n inText.isInText = true;\n\n function inTag(stream, state) {\n var ch = stream.next();\n if (ch == \">\" || (ch == \"/\" && stream.eat(\">\"))) {\n state.tokenize = inText;\n type = ch == \">\" ? \"endTag\" : \"selfcloseTag\";\n return \"tag bracket\";\n } else if (ch == \"=\") {\n type = \"equals\";\n return null;\n } else if (ch == \"<\") {\n state.tokenize = inText;\n state.state = baseState;\n state.tagName = state.tagStart = null;\n var next = state.tokenize(stream, state);\n return next ? next + \" tag error\" : \"tag error\";\n } else if (/[\\'\\\"]/.test(ch)) {\n state.tokenize = inAttribute(ch);\n state.stringStartCol = stream.column();\n return state.tokenize(stream, state);\n } else {\n stream.match(/^[^\\s\\u00a0=<>\\\"\\']*[^\\s\\u00a0=<>\\\"\\'\\/]/);\n return \"word\";\n }\n }\n\n function inAttribute(quote) {\n var closure = function(stream, state) {\n while (!stream.eol()) {\n if (stream.next() == quote) {\n state.tokenize = inTag;\n break;\n }\n }\n return \"string\";\n };\n closure.isInAttribute = true;\n return closure;\n }\n\n function inBlock(style, terminator) {\n return function(stream, state) {\n while (!stream.eol()) {\n if (stream.match(terminator)) {\n state.tokenize = inText;\n break;\n }\n stream.next();\n }\n return style;\n }\n }\n\n function doctype(depth) {\n return function(stream, state) {\n var ch;\n while ((ch = stream.next()) != null) {\n if (ch == \"<\") {\n state.tokenize = doctype(depth + 1);\n return state.tokenize(stream, state);\n } else if (ch == \">\") {\n if (depth == 1) {\n state.tokenize = inText;\n break;\n } else {\n state.tokenize = doctype(depth - 1);\n return state.tokenize(stream, state);\n }\n }\n }\n return \"meta\";\n };\n }\n\n function Context(state, tagName, startOfLine) {\n this.prev = state.context;\n this.tagName = tagName;\n this.indent = state.indented;\n this.startOfLine = startOfLine;\n if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))\n this.noIndent = true;\n }\n function popContext(state) {\n if (state.context) state.context = state.context.prev;\n }\n function maybePopContext(state, nextTagName) {\n var parentTagName;\n while (true) {\n if (!state.context) {\n return;\n }\n parentTagName = state.context.tagName;\n if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||\n !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {\n return;\n }\n popContext(state);\n }\n }\n\n function baseState(type, stream, state) {\n if (type == \"openTag\") {\n state.tagStart = stream.column();\n return tagNameState;\n } else if (type == \"closeTag\") {\n return closeTagNameState;\n } else {\n return baseState;\n }\n }\n function tagNameState(type, stream, state) {\n if (type == \"word\") {\n state.tagName = stream.current();\n setStyle = \"tag\";\n return attrState;\n } else if (config.allowMissingTagName && type == \"endTag\") {\n setStyle = \"tag bracket\";\n return attrState(type, stream, state);\n } else {\n setStyle = \"error\";\n return tagNameState;\n }\n }\n function closeTagNameState(type, stream, state) {\n if (type == \"word\") {\n var tagName = stream.current();\n if (state.context && state.context.tagName != tagName &&\n config.implicitlyClosed.hasOwnProperty(state.context.tagName))\n popContext(state);\n if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {\n setStyle = \"tag\";\n return closeState;\n } else {\n setStyle = \"tag error\";\n return closeStateErr;\n }\n } else if (config.allowMissingTagName && type == \"endTag\") {\n setStyle = \"tag bracket\";\n return closeState(type, stream, state);\n } else {\n setStyle = \"error\";\n return closeStateErr;\n }\n }\n\n function closeState(type, _stream, state) {\n if (type != \"endTag\") {\n setStyle = \"error\";\n return closeState;\n }\n popContext(state);\n return baseState;\n }\n function closeStateErr(type, stream, state) {\n setStyle = \"error\";\n return closeState(type, stream, state);\n }\n\n function attrState(type, _stream, state) {\n if (type == \"word\") {\n setStyle = \"attribute\";\n return attrEqState;\n } else if (type == \"endTag\" || type == \"selfcloseTag\") {\n var tagName = state.tagName, tagStart = state.tagStart;\n state.tagName = state.tagStart = null;\n if (type == \"selfcloseTag\" ||\n config.autoSelfClosers.hasOwnProperty(tagName)) {\n maybePopContext(state, tagName);\n } else {\n maybePopContext(state, tagName);\n state.context = new Context(state, tagName, tagStart == state.indented);\n }\n return baseState;\n }\n setStyle = \"error\";\n return attrState;\n }\n function attrEqState(type, stream, state) {\n if (type == \"equals\") return attrValueState;\n if (!config.allowMissing) setStyle = \"error\";\n return attrState(type, stream, state);\n }\n function attrValueState(type, stream, state) {\n if (type == \"string\") return attrContinuedState;\n if (type == \"word\" && config.allowUnquoted) {setStyle = \"string\"; return attrState;}\n setStyle = \"error\";\n return attrState(type, stream, state);\n }\n function attrContinuedState(type, stream, state) {\n if (type == \"string\") return attrContinuedState;\n return attrState(type, stream, state);\n }\n\n return {\n startState: function(baseIndent) {\n var state = {tokenize: inText,\n state: baseState,\n indented: baseIndent || 0,\n tagName: null, tagStart: null,\n context: null}\n if (baseIndent != null) state.baseIndent = baseIndent\n return state\n },\n\n token: function(stream, state) {\n if (!state.tagName && stream.sol())\n state.indented = stream.indentation();\n\n if (stream.eatSpace()) return null;\n type = null;\n var style = state.tokenize(stream, state);\n if ((style || type) && style != \"comment\") {\n setStyle = null;\n state.state = state.state(type || style, stream, state);\n if (setStyle)\n style = setStyle == \"error\" ? style + \" error\" : setStyle;\n }\n return style;\n },\n\n indent: function(state, textAfter, fullLine) {\n var context = state.context;\n // Indent multi-line strings (e.g. css).\n if (state.tokenize.isInAttribute) {\n if (state.tagStart == state.indented)\n return state.stringStartCol + 1;\n else\n return state.indented + indentUnit;\n }\n if (context && context.noIndent) return CodeMirror.Pass;\n if (state.tokenize != inTag && state.tokenize != inText)\n return fullLine ? fullLine.match(/^(\\s*)/)[0].length : 0;\n // Indent the starts of attribute names.\n if (state.tagName) {\n if (config.multilineTagIndentPastTag !== false)\n return state.tagStart + state.tagName.length + 2;\n else\n return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);\n }\n if (config.alignCDATA && /$/,\n blockCommentStart: \"\",\n\n configuration: config.htmlMode ? \"html\" : \"xml\",\n helperType: config.htmlMode ? \"html\" : \"xml\",\n\n skipAttribute: function(state) {\n if (state.state == attrValueState)\n state.state = attrState\n }\n };\n});\n\nCodeMirror.defineMIME(\"text/xml\", \"xml\");\nCodeMirror.defineMIME(\"application/xml\", \"xml\");\nif (!CodeMirror.mimeModes.hasOwnProperty(\"text/html\"))\n CodeMirror.defineMIME(\"text/html\", {name: \"xml\", htmlMode: true});\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/xml/xml.js\n// module id = 729\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") { // CommonJS\n mod(require(\"../../lib/codemirror\"));\n } else if (typeof define == \"function\" && define.amd) { // AMD\n define([\"../../lib/codemirror\"], mod);\n } else { // Plain browser env\n mod(CodeMirror);\n }\n})(function(CodeMirror) {\n \"use strict\";\n\n var TOKEN_STYLES = {\n addition: \"positive\",\n attributes: \"attribute\",\n bold: \"strong\",\n cite: \"keyword\",\n code: \"atom\",\n definitionList: \"number\",\n deletion: \"negative\",\n div: \"punctuation\",\n em: \"em\",\n footnote: \"variable\",\n footCite: \"qualifier\",\n header: \"header\",\n html: \"comment\",\n image: \"string\",\n italic: \"em\",\n link: \"link\",\n linkDefinition: \"link\",\n list1: \"variable-2\",\n list2: \"variable-3\",\n list3: \"keyword\",\n notextile: \"string-2\",\n pre: \"operator\",\n p: \"property\",\n quote: \"bracket\",\n span: \"quote\",\n specialChar: \"tag\",\n strong: \"strong\",\n sub: \"builtin\",\n sup: \"builtin\",\n table: \"variable-3\",\n tableHeading: \"operator\"\n };\n\n function startNewLine(stream, state) {\n state.mode = Modes.newLayout;\n state.tableHeading = false;\n\n if (state.layoutType === \"definitionList\" && state.spanningLayout &&\n stream.match(RE(\"definitionListEnd\"), false))\n state.spanningLayout = false;\n }\n\n function handlePhraseModifier(stream, state, ch) {\n if (ch === \"_\") {\n if (stream.eat(\"_\"))\n return togglePhraseModifier(stream, state, \"italic\", /__/, 2);\n else\n return togglePhraseModifier(stream, state, \"em\", /_/, 1);\n }\n\n if (ch === \"*\") {\n if (stream.eat(\"*\")) {\n return togglePhraseModifier(stream, state, \"bold\", /\\*\\*/, 2);\n }\n return togglePhraseModifier(stream, state, \"strong\", /\\*/, 1);\n }\n\n if (ch === \"[\") {\n if (stream.match(/\\d+\\]/)) state.footCite = true;\n return tokenStyles(state);\n }\n\n if (ch === \"(\") {\n var spec = stream.match(/^(r|tm|c)\\)/);\n if (spec)\n return tokenStylesWith(state, TOKEN_STYLES.specialChar);\n }\n\n if (ch === \"<\" && stream.match(/(\\w+)[^>]+>[^<]+<\\/\\1>/))\n return tokenStylesWith(state, TOKEN_STYLES.html);\n\n if (ch === \"?\" && stream.eat(\"?\"))\n return togglePhraseModifier(stream, state, \"cite\", /\\?\\?/, 2);\n\n if (ch === \"=\" && stream.eat(\"=\"))\n return togglePhraseModifier(stream, state, \"notextile\", /==/, 2);\n\n if (ch === \"-\" && !stream.eat(\"-\"))\n return togglePhraseModifier(stream, state, \"deletion\", /-/, 1);\n\n if (ch === \"+\")\n return togglePhraseModifier(stream, state, \"addition\", /\\+/, 1);\n\n if (ch === \"~\")\n return togglePhraseModifier(stream, state, \"sub\", /~/, 1);\n\n if (ch === \"^\")\n return togglePhraseModifier(stream, state, \"sup\", /\\^/, 1);\n\n if (ch === \"%\")\n return togglePhraseModifier(stream, state, \"span\", /%/, 1);\n\n if (ch === \"@\")\n return togglePhraseModifier(stream, state, \"code\", /@/, 1);\n\n if (ch === \"!\") {\n var type = togglePhraseModifier(stream, state, \"image\", /(?:\\([^\\)]+\\))?!/, 1);\n stream.match(/^:\\S+/); // optional Url portion\n return type;\n }\n return tokenStyles(state);\n }\n\n function togglePhraseModifier(stream, state, phraseModifier, closeRE, openSize) {\n var charBefore = stream.pos > openSize ? stream.string.charAt(stream.pos - openSize - 1) : null;\n var charAfter = stream.peek();\n if (state[phraseModifier]) {\n if ((!charAfter || /\\W/.test(charAfter)) && charBefore && /\\S/.test(charBefore)) {\n var type = tokenStyles(state);\n state[phraseModifier] = false;\n return type;\n }\n } else if ((!charBefore || /\\W/.test(charBefore)) && charAfter && /\\S/.test(charAfter) &&\n stream.match(new RegExp(\"^.*\\\\S\" + closeRE.source + \"(?:\\\\W|$)\"), false)) {\n state[phraseModifier] = true;\n state.mode = Modes.attributes;\n }\n return tokenStyles(state);\n };\n\n function tokenStyles(state) {\n var disabled = textileDisabled(state);\n if (disabled) return disabled;\n\n var styles = [];\n if (state.layoutType) styles.push(TOKEN_STYLES[state.layoutType]);\n\n styles = styles.concat(activeStyles(\n state, \"addition\", \"bold\", \"cite\", \"code\", \"deletion\", \"em\", \"footCite\",\n \"image\", \"italic\", \"link\", \"span\", \"strong\", \"sub\", \"sup\", \"table\", \"tableHeading\"));\n\n if (state.layoutType === \"header\")\n styles.push(TOKEN_STYLES.header + \"-\" + state.header);\n\n return styles.length ? styles.join(\" \") : null;\n }\n\n function textileDisabled(state) {\n var type = state.layoutType;\n\n switch(type) {\n case \"notextile\":\n case \"code\":\n case \"pre\":\n return TOKEN_STYLES[type];\n default:\n if (state.notextile)\n return TOKEN_STYLES.notextile + (type ? (\" \" + TOKEN_STYLES[type]) : \"\");\n return null;\n }\n }\n\n function tokenStylesWith(state, extraStyles) {\n var disabled = textileDisabled(state);\n if (disabled) return disabled;\n\n var type = tokenStyles(state);\n if (extraStyles)\n return type ? (type + \" \" + extraStyles) : extraStyles;\n else\n return type;\n }\n\n function activeStyles(state) {\n var styles = [];\n for (var i = 1; i < arguments.length; ++i) {\n if (state[arguments[i]])\n styles.push(TOKEN_STYLES[arguments[i]]);\n }\n return styles;\n }\n\n function blankLine(state) {\n var spanningLayout = state.spanningLayout, type = state.layoutType;\n\n for (var key in state) if (state.hasOwnProperty(key))\n delete state[key];\n\n state.mode = Modes.newLayout;\n if (spanningLayout) {\n state.layoutType = type;\n state.spanningLayout = true;\n }\n }\n\n var REs = {\n cache: {},\n single: {\n bc: \"bc\",\n bq: \"bq\",\n definitionList: /- .*?:=+/,\n definitionListEnd: /.*=:\\s*$/,\n div: \"div\",\n drawTable: /\\|.*\\|/,\n foot: /fn\\d+/,\n header: /h[1-6]/,\n html: /\\s*<(?:\\/)?(\\w+)(?:[^>]+)?>(?:[^<]+<\\/\\1>)?/,\n link: /[^\"]+\":\\S/,\n linkDefinition: /\\[[^\\s\\]]+\\]\\S+/,\n list: /(?:#+|\\*+)/,\n notextile: \"notextile\",\n para: \"p\",\n pre: \"pre\",\n table: \"table\",\n tableCellAttributes: /[\\/\\\\]\\d+/,\n tableHeading: /\\|_\\./,\n tableText: /[^\"_\\*\\[\\(\\?\\+~\\^%@|-]+/,\n text: /[^!\"_=\\*\\[\\(<\\?\\+~\\^%@-]+/\n },\n attributes: {\n align: /(?:<>|<|>|=)/,\n selector: /\\([^\\(][^\\)]+\\)/,\n lang: /\\[[^\\[\\]]+\\]/,\n pad: /(?:\\(+|\\)+){1,2}/,\n css: /\\{[^\\}]+\\}/\n },\n createRe: function(name) {\n switch (name) {\n case \"drawTable\":\n return REs.makeRe(\"^\", REs.single.drawTable, \"$\");\n case \"html\":\n return REs.makeRe(\"^\", REs.single.html, \"(?:\", REs.single.html, \")*\", \"$\");\n case \"linkDefinition\":\n return REs.makeRe(\"^\", REs.single.linkDefinition, \"$\");\n case \"listLayout\":\n return REs.makeRe(\"^\", REs.single.list, RE(\"allAttributes\"), \"*\\\\s+\");\n case \"tableCellAttributes\":\n return REs.makeRe(\"^\", REs.choiceRe(REs.single.tableCellAttributes,\n RE(\"allAttributes\")), \"+\\\\.\");\n case \"type\":\n return REs.makeRe(\"^\", RE(\"allTypes\"));\n case \"typeLayout\":\n return REs.makeRe(\"^\", RE(\"allTypes\"), RE(\"allAttributes\"),\n \"*\\\\.\\\\.?\", \"(\\\\s+|$)\");\n case \"attributes\":\n return REs.makeRe(\"^\", RE(\"allAttributes\"), \"+\");\n\n case \"allTypes\":\n return REs.choiceRe(REs.single.div, REs.single.foot,\n REs.single.header, REs.single.bc, REs.single.bq,\n REs.single.notextile, REs.single.pre, REs.single.table,\n REs.single.para);\n\n case \"allAttributes\":\n return REs.choiceRe(REs.attributes.selector, REs.attributes.css,\n REs.attributes.lang, REs.attributes.align, REs.attributes.pad);\n\n default:\n return REs.makeRe(\"^\", REs.single[name]);\n }\n },\n makeRe: function() {\n var pattern = \"\";\n for (var i = 0; i < arguments.length; ++i) {\n var arg = arguments[i];\n pattern += (typeof arg === \"string\") ? arg : arg.source;\n }\n return new RegExp(pattern);\n },\n choiceRe: function() {\n var parts = [arguments[0]];\n for (var i = 1; i < arguments.length; ++i) {\n parts[i * 2 - 1] = \"|\";\n parts[i * 2] = arguments[i];\n }\n\n parts.unshift(\"(?:\");\n parts.push(\")\");\n return REs.makeRe.apply(null, parts);\n }\n };\n\n function RE(name) {\n return (REs.cache[name] || (REs.cache[name] = REs.createRe(name)));\n }\n\n var Modes = {\n newLayout: function(stream, state) {\n if (stream.match(RE(\"typeLayout\"), false)) {\n state.spanningLayout = false;\n return (state.mode = Modes.blockType)(stream, state);\n }\n var newMode;\n if (!textileDisabled(state)) {\n if (stream.match(RE(\"listLayout\"), false))\n newMode = Modes.list;\n else if (stream.match(RE(\"drawTable\"), false))\n newMode = Modes.table;\n else if (stream.match(RE(\"linkDefinition\"), false))\n newMode = Modes.linkDefinition;\n else if (stream.match(RE(\"definitionList\")))\n newMode = Modes.definitionList;\n else if (stream.match(RE(\"html\"), false))\n newMode = Modes.html;\n }\n return (state.mode = (newMode || Modes.text))(stream, state);\n },\n\n blockType: function(stream, state) {\n var match, type;\n state.layoutType = null;\n\n if (match = stream.match(RE(\"type\")))\n type = match[0];\n else\n return (state.mode = Modes.text)(stream, state);\n\n if (match = type.match(RE(\"header\"))) {\n state.layoutType = \"header\";\n state.header = parseInt(match[0][1]);\n } else if (type.match(RE(\"bq\"))) {\n state.layoutType = \"quote\";\n } else if (type.match(RE(\"bc\"))) {\n state.layoutType = \"code\";\n } else if (type.match(RE(\"foot\"))) {\n state.layoutType = \"footnote\";\n } else if (type.match(RE(\"notextile\"))) {\n state.layoutType = \"notextile\";\n } else if (type.match(RE(\"pre\"))) {\n state.layoutType = \"pre\";\n } else if (type.match(RE(\"div\"))) {\n state.layoutType = \"div\";\n } else if (type.match(RE(\"table\"))) {\n state.layoutType = \"table\";\n }\n\n state.mode = Modes.attributes;\n return tokenStyles(state);\n },\n\n text: function(stream, state) {\n if (stream.match(RE(\"text\"))) return tokenStyles(state);\n\n var ch = stream.next();\n if (ch === '\"')\n return (state.mode = Modes.link)(stream, state);\n return handlePhraseModifier(stream, state, ch);\n },\n\n attributes: function(stream, state) {\n state.mode = Modes.layoutLength;\n\n if (stream.match(RE(\"attributes\")))\n return tokenStylesWith(state, TOKEN_STYLES.attributes);\n else\n return tokenStyles(state);\n },\n\n layoutLength: function(stream, state) {\n if (stream.eat(\".\") && stream.eat(\".\"))\n state.spanningLayout = true;\n\n state.mode = Modes.text;\n return tokenStyles(state);\n },\n\n list: function(stream, state) {\n var match = stream.match(RE(\"list\"));\n state.listDepth = match[0].length;\n var listMod = (state.listDepth - 1) % 3;\n if (!listMod)\n state.layoutType = \"list1\";\n else if (listMod === 1)\n state.layoutType = \"list2\";\n else\n state.layoutType = \"list3\";\n\n state.mode = Modes.attributes;\n return tokenStyles(state);\n },\n\n link: function(stream, state) {\n state.mode = Modes.text;\n if (stream.match(RE(\"link\"))) {\n stream.match(/\\S+/);\n return tokenStylesWith(state, TOKEN_STYLES.link);\n }\n return tokenStyles(state);\n },\n\n linkDefinition: function(stream, state) {\n stream.skipToEnd();\n return tokenStylesWith(state, TOKEN_STYLES.linkDefinition);\n },\n\n definitionList: function(stream, state) {\n stream.match(RE(\"definitionList\"));\n\n state.layoutType = \"definitionList\";\n\n if (stream.match(/\\s*$/))\n state.spanningLayout = true;\n else\n state.mode = Modes.attributes;\n\n return tokenStyles(state);\n },\n\n html: function(stream, state) {\n stream.skipToEnd();\n return tokenStylesWith(state, TOKEN_STYLES.html);\n },\n\n table: function(stream, state) {\n state.layoutType = \"table\";\n return (state.mode = Modes.tableCell)(stream, state);\n },\n\n tableCell: function(stream, state) {\n if (stream.match(RE(\"tableHeading\")))\n state.tableHeading = true;\n else\n stream.eat(\"|\");\n\n state.mode = Modes.tableCellAttributes;\n return tokenStyles(state);\n },\n\n tableCellAttributes: function(stream, state) {\n state.mode = Modes.tableText;\n\n if (stream.match(RE(\"tableCellAttributes\")))\n return tokenStylesWith(state, TOKEN_STYLES.attributes);\n else\n return tokenStyles(state);\n },\n\n tableText: function(stream, state) {\n if (stream.match(RE(\"tableText\")))\n return tokenStyles(state);\n\n if (stream.peek() === \"|\") { // end of cell\n state.mode = Modes.tableCell;\n return tokenStyles(state);\n }\n return handlePhraseModifier(stream, state, stream.next());\n }\n };\n\n CodeMirror.defineMode(\"textile\", function() {\n return {\n startState: function() {\n return { mode: Modes.newLayout };\n },\n token: function(stream, state) {\n if (stream.sol()) startNewLine(stream, state);\n return state.mode(stream, state);\n },\n blankLine: blankLine\n };\n });\n\n CodeMirror.defineMIME(\"text/x-textile\", \"textile\");\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/textile/textile.js\n// module id = 730\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode('shell', function() {\n\n var words = {};\n function define(style, dict) {\n for(var i = 0; i < dict.length; i++) {\n words[dict[i]] = style;\n }\n };\n\n var commonAtoms = [\"true\", \"false\"];\n var commonKeywords = [\"if\", \"then\", \"do\", \"else\", \"elif\", \"while\", \"until\", \"for\", \"in\", \"esac\", \"fi\",\n \"fin\", \"fil\", \"done\", \"exit\", \"set\", \"unset\", \"export\", \"function\"];\n var commonCommands = [\"ab\", \"awk\", \"bash\", \"beep\", \"cat\", \"cc\", \"cd\", \"chown\", \"chmod\", \"chroot\", \"clear\",\n \"cp\", \"curl\", \"cut\", \"diff\", \"echo\", \"find\", \"gawk\", \"gcc\", \"get\", \"git\", \"grep\", \"hg\", \"kill\", \"killall\",\n \"ln\", \"ls\", \"make\", \"mkdir\", \"openssl\", \"mv\", \"nc\", \"nl\", \"node\", \"npm\", \"ping\", \"ps\", \"restart\", \"rm\",\n \"rmdir\", \"sed\", \"service\", \"sh\", \"shopt\", \"shred\", \"source\", \"sort\", \"sleep\", \"ssh\", \"start\", \"stop\",\n \"su\", \"sudo\", \"svn\", \"tee\", \"telnet\", \"top\", \"touch\", \"vi\", \"vim\", \"wall\", \"wc\", \"wget\", \"who\", \"write\",\n \"yes\", \"zsh\"];\n\n CodeMirror.registerHelper(\"hintWords\", \"shell\", commonAtoms.concat(commonKeywords, commonCommands));\n\n define('atom', commonAtoms);\n define('keyword', commonKeywords);\n define('builtin', commonCommands);\n\n function tokenBase(stream, state) {\n if (stream.eatSpace()) return null;\n\n var sol = stream.sol();\n var ch = stream.next();\n\n if (ch === '\\\\') {\n stream.next();\n return null;\n }\n if (ch === '\\'' || ch === '\"' || ch === '`') {\n state.tokens.unshift(tokenString(ch, ch === \"`\" ? \"quote\" : \"string\"));\n return tokenize(stream, state);\n }\n if (ch === '#') {\n if (sol && stream.eat('!')) {\n stream.skipToEnd();\n return 'meta'; // 'comment'?\n }\n stream.skipToEnd();\n return 'comment';\n }\n if (ch === '$') {\n state.tokens.unshift(tokenDollar);\n return tokenize(stream, state);\n }\n if (ch === '+' || ch === '=') {\n return 'operator';\n }\n if (ch === '-') {\n stream.eat('-');\n stream.eatWhile(/\\w/);\n return 'attribute';\n }\n if (/\\d/.test(ch)) {\n stream.eatWhile(/\\d/);\n if(stream.eol() || !/\\w/.test(stream.peek())) {\n return 'number';\n }\n }\n stream.eatWhile(/[\\w-]/);\n var cur = stream.current();\n if (stream.peek() === '=' && /\\w+/.test(cur)) return 'def';\n return words.hasOwnProperty(cur) ? words[cur] : null;\n }\n\n function tokenString(quote, style) {\n var close = quote == \"(\" ? \")\" : quote == \"{\" ? \"}\" : quote\n return function(stream, state) {\n var next, escaped = false;\n while ((next = stream.next()) != null) {\n if (next === close && !escaped) {\n state.tokens.shift();\n break;\n } else if (next === '$' && !escaped && quote !== \"'\" && stream.peek() != close) {\n escaped = true;\n stream.backUp(1);\n state.tokens.unshift(tokenDollar);\n break;\n } else if (!escaped && quote !== close && next === quote) {\n state.tokens.unshift(tokenString(quote, style))\n return tokenize(stream, state)\n } else if (!escaped && /['\"]/.test(next) && !/['\"]/.test(quote)) {\n state.tokens.unshift(tokenStringStart(next, \"string\"));\n stream.backUp(1);\n break;\n }\n escaped = !escaped && next === '\\\\';\n }\n return style;\n };\n };\n\n function tokenStringStart(quote, style) {\n return function(stream, state) {\n state.tokens[0] = tokenString(quote, style)\n stream.next()\n return tokenize(stream, state)\n }\n }\n\n var tokenDollar = function(stream, state) {\n if (state.tokens.length > 1) stream.eat('$');\n var ch = stream.next()\n if (/['\"({]/.test(ch)) {\n state.tokens[0] = tokenString(ch, ch == \"(\" ? \"quote\" : ch == \"{\" ? \"def\" : \"string\");\n return tokenize(stream, state);\n }\n if (!/\\d/.test(ch)) stream.eatWhile(/\\w/);\n state.tokens.shift();\n return 'def';\n };\n\n function tokenize(stream, state) {\n return (state.tokens[0] || tokenBase) (stream, state);\n };\n\n return {\n startState: function() {return {tokens:[]};},\n token: function(stream, state) {\n return tokenize(stream, state);\n },\n closeBrackets: \"()[]{}''\\\"\\\"``\",\n lineComment: '#',\n fold: \"brace\"\n };\n});\n\nCodeMirror.defineMIME('text/x-sh', 'shell');\n// Apache uses a slightly different Media Type for Shell scripts\n// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types\nCodeMirror.defineMIME('application/x-sh', 'shell');\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/shell/shell.js\n// module id = 731\n// module chunks = 3 4 5 7 8 14","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-17a2306c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./email.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./email.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./email.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-17a2306c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./email.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue\n// module id = 734\n// module chunks = 0 3 4 5 6","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/dag.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Vue from 'vue'\nimport $ from 'jquery'\nimport _ from 'lodash'\nimport i18n from '@/module/i18n'\nimport { jsPlumb } from 'jsplumb'\nimport DragZoom from './dragZoom'\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\nimport Permissions from '@/module/permissions'\nimport { uuid, findComponentDownward } from '@/module/util/'\nimport {\n tasksAll,\n rtTasksTpl,\n setSvgColor,\n saveTargetarr,\n rtTargetarrArr } from './util'\nimport mStart from '@/conf/home/pages/projects/pages/definition/pages/list/_source/start'\n\nlet JSP = function () {\n this.dag = {}\n this.selectedElement = {}\n\n this.config = {\n // Whether to drag\n isDrag: true,\n // Whether to allow connection\n isAttachment: false,\n // Whether to drag a new node\n isNewNodes: true,\n // Whether to support double-click node events\n isDblclick: true,\n // Whether to support right-click menu events\n isContextmenu: true,\n // Whether to allow click events\n isClick: false\n }\n}\n\n/**\n * dag init\n */\nJSP.prototype.init = function ({ dag, instance }) {\n // Get the dag component instance\n this.dag = dag\n // Get jsplumb instance\n this.JspInstance = instance\n // Register jsplumb connection type and configuration\n this.JspInstance.registerConnectionType('basic', {\n anchor: 'Continuous',\n connector: 'Straight' // Line type\n })\n\n // Initial configuration\n this.setConfig({\n isDrag: !store.state.dag.isDetails,\n isAttachment: false,\n isNewNodes: Permissions.getAuth() === false ? false : !store.state.dag.isDetails,\n isDblclick: true,\n isContextmenu: true,\n isClick: false\n })\n\n // Monitor line click\n this.JspInstance.bind('click', e => {\n if (this.config.isClick) {\n this.connectClick(e)\n }\n })\n\n // Drag and drop\n if (this.config.isNewNodes) {\n DragZoom.init()\n }\n}\n\n/**\n * set config attribute\n */\nJSP.prototype.setConfig = function (o) {\n this.config = Object.assign(this.config, {}, o)\n}\n\n/**\n * Node binding event\n */\nJSP.prototype.tasksEvent = function (selfId) {\n let tasks = $(`#${selfId}`)\n // Bind right event\n tasks.on('contextmenu', e => {\n this.tasksContextmenu(e)\n return false\n })\n\n // Binding double click event\n tasks.find('.icos').bind('dblclick', e => {\n this.tasksDblclick(e)\n })\n\n // Binding click event\n tasks.on('click', e => {\n this.tasksClick(e)\n })\n}\n\n/**\n * Dag node drag and drop processing\n */\nJSP.prototype.draggable = function () {\n if (this.config.isNewNodes) {\n let selfId\n let self = this\n $('.toolbar-btn .roundedRect').draggable({\n scope: 'plant',\n helper: 'clone',\n containment: $('.dag-model'),\n stop: function (e, ui) {\n self.tasksEvent(selfId)\n\n // Dom structure is not generated without pop-up form form\n if ($(`#${selfId}`).html()) {\n // dag event\n findComponentDownward(self.dag.$root, 'dag-chart')._createNodes({\n id: selfId\n })\n }\n },\n drag: function () {\n $('body').find('.tooltip.fade.top.in').remove()\n }\n })\n\n $('#canvas').droppable({\n scope: 'plant',\n drop: function (ev, ui) {\n let id = 'tasks-' + Math.ceil(Math.random() * 100000) // eslint-disable-line\n // Get mouse coordinates\n let left = parseInt(ui.offset.left - $(this).offset().left)\n let top = parseInt(ui.offset.top - $(this).offset().top) - 10\n if (top < 25) {\n top = 25\n }\n // Generate template node\n $('#canvas').append(rtTasksTpl({\n id: id,\n name: id,\n x: left,\n y: top,\n isAttachment: self.config.isAttachment,\n taskType: findComponentDownward(self.dag.$root, 'dag-chart').dagBarId\n }))\n\n // Get the generated node\n let thisDom = jsPlumb.getSelector('.statemachine-demo .w')\n\n // Generating a connection node\n self.JspInstance.batch(() => {\n self.initNode(thisDom[thisDom.length - 1])\n })\n selfId = id\n }\n })\n }\n}\n\n/**\n * Echo json processing and old data structure processing\n */\nJSP.prototype.jsonHandle = function ({ largeJson, locations }) {\n _.map(largeJson, v => {\n // Generate template\n $('#canvas').append(rtTasksTpl({\n id: v.id,\n name: v.name,\n x: locations[v.id]['x'],\n y: locations[v.id]['y'],\n targetarr: locations[v.id]['targetarr'],\n isAttachment: this.config.isAttachment,\n taskType: v.type,\n runFlag:v.runFlag\n }))\n\n // contextmenu event\n $(`#${v.id}`).on('contextmenu', e => {\n this.tasksContextmenu(e)\n return false\n })\n\n // dblclick event\n $(`#${v.id}`).find('.icos').bind('dblclick', e => {\n this.tasksDblclick(e)\n })\n\n // click event\n $(`#${v.id}`).bind('click', e => {\n this.tasksClick(e)\n })\n })\n}\n\n/**\n * Initialize a single node\n */\nJSP.prototype.initNode = function (el) {\n // Whether to drag\n if (this.config.isDrag) {\n this.JspInstance.draggable(el, {\n containment: 'dag-container'\n })\n }\n\n // Node attribute configuration\n this.JspInstance.makeSource(el, {\n filter: '.ep',\n anchor: 'Continuous',\n connectorStyle: {\n stroke: '#555',\n strokeWidth: 2,\n outlineStroke: 'transparent',\n outlineWidth: 4\n },\n // This place is leaking\n // connectionType: \"basic\",\n extract: {\n action: 'the-action'\n },\n maxConnections: -1\n })\n\n // Node connection property configuration\n this.JspInstance.makeTarget(el, {\n dropOptions: { hoverClass: 'dragHover' },\n anchor: 'Continuous',\n allowLoopback: false // Forbid yourself to connect yourself\n })\n this.JspInstance.fire('jsPlumbDemoNodeAdded', el)\n}\n\n/**\n * Node right click menu\n */\nJSP.prototype.tasksContextmenu = function (event) {\n if (this.config.isContextmenu) {\n let routerName = router.history.current.name\n // state\n let isOne = routerName === 'projects-definition-details' && this.dag.releaseState !== 'NOT_RELEASE'\n // hide\n let isTwo = store.state.dag.isDetails\n\n let html = [\n `${i18n.$t('开始运行')}`,\n `${i18n.$t('编辑节点')}`,\n `${i18n.$t('复制节点')}`,\n `${i18n.$t('删除节点')}`\n ]\n\n let operationHtml = () => {\n return html.splice(',')\n }\n\n let e = event\n let $id = e.currentTarget.id\n let $contextmenu = $('#contextmenu')\n let $name = $(`#${$id}`).find('.name-p').text()\n let $left = e.pageX + document.body.scrollLeft - 5\n let $top = e.pageY + document.body.scrollTop - 5\n $contextmenu.css({\n left: $left,\n top: $top,\n visibility: 'visible'\n })\n // Action bar\n $contextmenu.html('').append(operationHtml)\n\n if (isOne) {\n // start run\n $('#startRunning').on('click', () => {\n let id = router.history.current.params.id\n store.dispatch('dag/getStartCheck', { processDefinitionId: id }).then(res => {\n let modal = Vue.$modal.dialog({\n closable: false,\n showMask: true,\n escClose: true,\n className: 'v-modal-custom',\n transitionName: 'opacityp',\n render (h) {\n return h(mStart, {\n on: {\n onUpdate () {\n modal.remove()\n },\n close () {\n modal.remove()\n }\n },\n props: {\n item: {\n id: id\n },\n startNodeList: $name,\n sourceType: 'contextmenu'\n }\n })\n }\n })\n }).catch(e => {\n Vue.$message.error(e.msg || '')\n })\n })\n }\n if (!isTwo) {\n // edit node\n $(`#editNodes`).click(ev => {\n findComponentDownward(this.dag.$root, 'dag-chart')._createNodes({\n id: $id,\n type: $(`#${$id}`).attr('data-tasks-type')\n })\n })\n // delete node\n $('#removeNodes').click(ev => {\n this.removeNodes($id)\n })\n\n // copy node\n $('#copyNodes').click(res => {\n this.copyNodes($id)\n })\n }\n }\n}\n\n/**\n * Node double click event\n */\nJSP.prototype.tasksDblclick = function (e) {\n // Untie event\n if (this.config.isDblclick) {\n let id = $(e.currentTarget.offsetParent).attr('id')\n\n findComponentDownward(this.dag.$root, 'dag-chart')._createNodes({\n id: id,\n type: $(`#${id}`).attr('data-tasks-type')\n })\n }\n}\n\n/**\n * Node click event\n */\nJSP.prototype.tasksClick = function (e) {\n let $id\n let self = this\n let $body = $(`body`)\n if (this.config.isClick) {\n let $connect = this.selectedElement.connect\n $('.w').removeClass('jtk-tasks-active')\n $(e.currentTarget).addClass('jtk-tasks-active')\n if ($connect) {\n setSvgColor($connect, '#555')\n this.selectedElement.connect = null\n }\n this.selectedElement.id = $(e.currentTarget).attr('id')\n\n // Unbind copy and paste events\n $body.unbind('copy').unbind('paste')\n // Copy binding id\n $id = self.selectedElement.id\n\n $body.bind({\n copy: function () {\n $id = self.selectedElement.id\n },\n paste: function () {\n $id && self.copyNodes($id)\n }\n })\n }\n}\n\n/**\n * Remove binding events\n * paste\n */\nJSP.prototype.removePaste = function () {\n let $body = $(`body`)\n // Unbind copy and paste events\n $body.unbind('copy').unbind('paste')\n // Remove selected node parameters\n this.selectedElement.id = null\n // Remove node selection effect\n $('.w').removeClass('jtk-tasks-active')\n}\n\n/**\n * Line click event\n */\nJSP.prototype.connectClick = function (e) {\n // Set svg color\n setSvgColor(e, '#0097e0')\n let $id = this.selectedElement.id\n if ($id) {\n $(`#${$id}`).removeClass('jtk-tasks-active')\n this.selectedElement.id = null\n }\n this.selectedElement.connect = e\n}\n\n/**\n * toolbarEvent\n * @param {Pointer}\n */\nJSP.prototype.handleEventPointer = function (is) {\n let wDom = $('.w')\n this.setConfig({\n isClick: is,\n isAttachment: false\n })\n wDom.removeClass('jtk-ep')\n if (!is) {\n wDom.removeClass('jtk-tasks-active')\n this.selectedElement = {}\n _.map($('#canvas svg'), v => {\n if ($(v).attr('class')) {\n _.map($(v).find('path'), v1 => {\n $(v1).attr('fill', '#555')\n $(v1).attr('stroke', '#555')\n })\n }\n })\n }\n}\n\n/**\n * toolbarEvent\n * @param {Line}\n */\nJSP.prototype.handleEventLine = function (is) {\n let wDom = $('.w')\n this.setConfig({\n isAttachment: is\n })\n is ? wDom.addClass('jtk-ep') : wDom.removeClass('jtk-ep')\n}\n\n/**\n * toolbarEvent\n * @param {Remove}\n */\nJSP.prototype.handleEventRemove = function () {\n let $id = this.selectedElement.id || null\n let $connect = this.selectedElement.connect || null\n if ($id) {\n this.removeNodes(this.selectedElement.id)\n } else {\n this.removeConnect($connect)\n }\n\n // Monitor whether to edit DAG\n store.commit('dag/setIsEditDag', true)\n}\n\n/**\n * Delete node\n */\nJSP.prototype.removeNodes = function ($id) {\n // Delete node processing(data-targetarr)\n _.map(tasksAll(), v => {\n let targetarr = v.targetarr.split(',')\n if (targetarr.length) {\n let newArr = _.filter(targetarr, v1 => v1 !== $id)\n $(`#${v.id}`).attr('data-targetarr', newArr.toString())\n }\n })\n // delete node\n this.JspInstance.remove($id)\n}\n\n/**\n * Delete connection\n */\nJSP.prototype.removeConnect = function ($connect) {\n if (!$connect) {\n return\n }\n // Remove connections and remove node and node dependencies\n let targetId = $connect.targetId\n let sourceId = $connect.sourceId\n let targetarr = rtTargetarrArr(targetId)\n if (targetarr.length) {\n targetarr = _.filter(targetarr, v => v !== sourceId)\n $(`#${targetId}`).attr('data-targetarr', targetarr.toString())\n }\n this.JspInstance.deleteConnection($connect)\n\n this.selectedElement = {}\n}\n\n/**\n * Copy node\n */\nJSP.prototype.copyNodes = function ($id) {\n let newNodeInfo = _.cloneDeep(_.find(store.state.dag.tasks, v => v.id === $id))\n let newNodePors = store.state.dag.locations[$id]\n // Unstored nodes do not allow replication\n if (!newNodePors) {\n return\n }\n // Generate random id\n let newUuId = `${uuid() + uuid()}`\n let id = newNodeInfo.id.length > 8 ? newNodeInfo.id.substr(0, 7) : newNodeInfo.id\n let name = newNodeInfo.name.length > 8 ? newNodeInfo.name.substr(0, 7) : newNodeInfo.name\n\n // new id\n let newId = `${id || ''}-${newUuId}`\n // new name\n let newName = `${name || ''}-${newUuId}`\n // coordinate x\n let newX = newNodePors.x + 100\n // coordinate y\n let newY = newNodePors.y + 40\n\n // Generate template node\n $('#canvas').append(rtTasksTpl({\n id: newId,\n name: newName,\n x: newX,\n y: newY,\n isAttachment: this.config.isAttachment,\n taskType: newNodeInfo.type\n }))\n\n // Get the generated node\n let thisDom = jsPlumb.getSelector('.statemachine-demo .w')\n\n // Copy node information\n newNodeInfo = Object.assign(newNodeInfo, {\n id: newId,\n name: newName\n })\n\n // Add new node\n store.commit('dag/addTasks', newNodeInfo)\n // Add node location information\n store.commit('dag/setLocations', {\n [newId]: {\n name: newName,\n targetarr: '',\n x: newX,\n y: newY\n }\n })\n\n // Generating a connection node\n this.JspInstance.batch(() => {\n this.initNode(thisDom[thisDom.length - 1])\n // Add events to nodes\n this.tasksEvent(newId)\n })\n}\n/**\n * toolbarEvent\n * @param {Screen}\n */\nJSP.prototype.handleEventScreen = function ({ item, is }) {\n let screenOpen = true\n if (is) {\n item.icon = ''\n screenOpen = true\n } else {\n item.icon = ''\n screenOpen = false\n }\n let $mainLayoutModel = $('.main-layout-model')\n if (screenOpen) {\n $mainLayoutModel.addClass('dag-screen')\n } else {\n $mainLayoutModel.removeClass('dag-screen')\n }\n}\n/**\n * save task\n * @param tasks\n * @param locations\n * @param connects\n */\nJSP.prototype.saveStore = function () {\n return new Promise((resolve, reject) => {\n let connects = []\n let locations = {}\n let tasks = []\n\n let is = (id) => {\n return !!_.filter(tasksAll(), v => v.id === id).length\n }\n\n // task\n _.map(_.cloneDeep(store.state.dag.tasks), v => {\n if (is(v.id)) {\n let preTasks = []\n let id = $(`#${v.id}`)\n let tar = id.attr('data-targetarr')\n let idDep = tar ? id.attr('data-targetarr').split(',') : []\n if (idDep.length) {\n _.map(idDep, v1 => {\n preTasks.push($(`#${v1}`).find('.name-p').text())\n })\n }\n\n let tasksParam = _.assign(v, {\n preTasks: preTasks\n })\n\n // Sub-workflow has no retries and interval\n if (v.type === 'SUB_PROCESS') {\n tasksParam = _.omit(tasksParam, ['maxRetryTimes', 'retryInterval'])\n }\n\n tasks.push(tasksParam)\n }\n })\n\n _.map(this.JspInstance.getConnections(), v => {\n connects.push({\n 'endPointSourceId': v.sourceId,\n 'endPointTargetId': v.targetId\n })\n })\n\n _.map(tasksAll(), v => {\n locations[v.id] = {\n name: v.name,\n targetarr: v.targetarr,\n x: v.x,\n y: v.y\n }\n })\n\n // Storage node\n store.commit('dag/setTasks', tasks)\n // Store coordinate information\n store.commit('dag/setLocations', locations)\n // Storage line dependence\n store.commit('dag/setConnects', connects)\n\n resolve({\n connects: connects,\n tasks: tasks,\n locations: locations\n })\n })\n}\n/**\n * Event processing\n */\nJSP.prototype.handleEvent = function () {\n this.JspInstance.bind('beforeDrop', function (info) {\n let sourceId = info['sourceId']// 出\n let targetId = info['targetId']// 入\n\n /**\n * Recursive search for nodes\n */\n let recursiveVal\n const recursiveTargetarr = (arr, targetId) => {\n for (var i in arr) {\n if (arr[i] === targetId) {\n recursiveVal = targetId\n } else {\n let recTargetarrArr = rtTargetarrArr(arr[i])\n if (recTargetarrArr.length) {\n recursiveTargetarr(recTargetarrArr, targetId)\n } else {\n return recursiveTargetarr(targetId)\n }\n }\n }\n return recursiveVal\n }\n\n // Connection to connected nodes is not allowed\n if (_.findIndex(rtTargetarrArr(targetId), v => v === sourceId) !== -1) {\n return false\n }\n\n // Recursive form to find if the target Targetarr has a sourceId\n if (recursiveTargetarr(rtTargetarrArr(sourceId), targetId)) {\n // setRecursiveVal(null)\n return false\n }\n\n // Storage node dependency information\n saveTargetarr(sourceId, targetId)\n\n // Monitor whether to edit DAG\n store.commit('dag/setIsEditDag', true)\n\n return true\n })\n}\n/**\n * Backfill data processing\n */\nJSP.prototype.jspBackfill = function ({ connects, locations, largeJson }) {\n // Backfill nodes\n this.jsonHandle({\n largeJson: largeJson,\n locations: locations\n })\n\n let wNodes = jsPlumb.getSelector('.statemachine-demo .w')\n\n // Backfill line\n this.JspInstance.batch(() => {\n for (let i = 0; i < wNodes.length; i++) {\n this.initNode(wNodes[i])\n }\n _.map(connects, v => {\n let sourceId = v.endPointSourceId.split('-')\n let targetId = v.endPointTargetId.split('-')\n if (sourceId.length === 4 && targetId.length === 4) {\n sourceId = `${sourceId[0]}-${sourceId[1]}-${sourceId[2]}`\n targetId = `${targetId[0]}-${targetId[1]}-${targetId[2]}`\n } else {\n sourceId = v.endPointSourceId\n targetId = v.endPointTargetId\n }\n\n this.JspInstance.connect({\n source: sourceId,\n target: targetId,\n type: 'basic',\n paintStyle: { strokeWidth: 2, stroke: '#555' }\n })\n })\n })\n\n jsPlumb.fire('jsPlumbDemoLoaded', this.JspInstance)\n\n // Connection monitoring\n this.handleEvent()\n\n // Drag and drop new nodes\n this.draggable()\n}\n\nexport default new JSP()\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/udp/udp.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/localParams.vue","\nimport Vue from 'vue'\nimport mAffirm from './jumpAffirm'\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\nimport { uuid, findComponentDownward } from '@/module/util/'\n\nlet Affirm = {}\nlet $root = {}\nlet $routerType = ''\nlet $isPop = true\n\n/**\n * Listen for route changes\n */\nrouter.beforeEach((to, from, next) => {\n if (from.name === 'projects-definition-details' || from.name === 'projects-instance-details' || from.name === 'definition-create') {\n if (!Affirm.paramVerification(from.name)) {\n Affirm.isPop(() => {\n next()\n })\n } else {\n next()\n }\n } else {\n next()\n }\n})\n\n/**\n * Get judgment initialization data\n */\nAffirm.init = (root) => {\n $isPop = true\n $root = root\n $routerType = router.history.current.name\n}\n\n/**\n * Parameter verification\n */\nAffirm.paramVerification = (name) => {\n if (!$isPop) {\n return true\n }\n let dagStore = store.state.dag\n let flag = false\n if ($routerType === 'definition-create') {\n // No nodes jump out directly\n if (dagStore.tasks.length) {\n if (!dagStore.name) {\n store.commit('dag/setName', `${uuid('dag_')}${uuid() + uuid()}`)\n }\n flag = false\n } else {\n flag = true\n }\n } else {\n // View history direct jump\n flag = name === 'projects-instance-details' ? true : !dagStore.isEditDag\n }\n return flag\n}\n\n/**\n * Pop-up judgment\n */\nAffirm.isPop = (fn) => {\n Vue.$modal.dialog({\n closable: false,\n showMask: true,\n escClose: true,\n className: 'v-modal-custom',\n transitionName: 'opacityp',\n render (h) {\n return h(mAffirm, {\n on: {\n ok () {\n // save\n findComponentDownward($root, 'dag-chart')._save('affirm').then(() => {\n fn()\n Vue.$modal.destroy()\n }).catch(() => {\n fn()\n Vue.$modal.destroy()\n })\n },\n close () {\n fn()\n Vue.$modal.destroy()\n }\n },\n props: {\n }\n })\n }\n })\n}\n\n/**\n * Whether the external setting pops up\n */\nAffirm.setIsPop = (is) => {\n $isPop = is\n}\n\nexport default Affirm\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/jumpAffirm/index.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/jumpAffirm/jumpAffirm.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/formModel.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/listBox.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/resources.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/udfs.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/sqlType.vue","var normalizeComponent = require(\"!../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./datasource.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./datasource.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-62aa87e3\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./datasource.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/dag/_source/formModel/tasks/_source/datasource.vue\n// module id = 786\n// module chunks = 3 4 5","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/datasource.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/procedure.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/dependItemList.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/sub_process.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/_source/selectInput.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/_source/timeoutAlarm.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-2175c153\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./start.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./start.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./start.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-2175c153\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./start.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue\n// module id = 798\n// module chunks = 0 3 4 5","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\n\nexport default {\n data () {\n return {\n router,\n store,\n isDetails: false\n }\n },\n created () {\n this.isDetails = this.store.state.dag.isDetails\n },\n methods: {\n },\n computed: {\n _isDetails () {\n return this.isDetails ? 'icon-disabled' : ''\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/module/mixin/disabledState.js","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n// This is CodeMirror (https://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\//.test(userAgent);\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\\/\\w+/.test(userAgent);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt() {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var activeElement;\n try {\n activeElement = document.activeElement;\n } catch(e) {\n activeElement = document.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {this.id = null;};\n Delayed.prototype.set = function (ms, f) {\n clearTimeout(this.id);\n this.id = setTimeout(f, ms);\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 30;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\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]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n input.init(d);\n }\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n // Add a span to a line.\n function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers || (emitter._handlers = {});\n map$$1[type] = (map$$1[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers, arr = map$$1 && map$$1[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map$$1[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range$$1;\n try {range$$1 = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range$$1 || range$$1.parentElement() != te) { return false }\n return range$$1.compareEndPoints(\"StartToEnd\", range$$1) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var this$1 = this;\n\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n var this$1 = this;\n\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this$1.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\s)\" + lineClass[2] + \"(?:$|\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {\n var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (node.className == \"CodeMirror-linewidget\")\n { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\");\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map$$1, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map$$1.length; i += 3) {\n mStart = map$$1[i];\n mEnd = map$$1[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map$$1.length - 3 || ch == mEnd && map$$1[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map$$1[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map$$1[i - 2] == map$$1[i - 3] && map$$1[i - 1].insertLeft) {\n node = map$$1[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map$$1.length - 3 && map$$1[i + 3] == map$$1[i + 4] && !map$$1[i + 5].insertLeft) {\n node = map$$1[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX() {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }\n return window.pageXOffset || (document.documentElement || document.body).scrollLeft\n }\n function pageScrollY() {\n if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }\n return window.pageYOffset || (document.documentElement || document.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var height = 0;\n if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above)\n { height += widgetHeight(lineObj.widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = true; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo$$1, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight$$1 = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo$$1, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight$$1; box.bottom += widgetHeight$$1;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight$$1 <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo$$1, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top || y >= coords.bottom;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo$$1, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo$$1, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo$$1, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo$$1, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range$$1 = doc.sel.ranges[i];\n if (range$$1.from().line >= cm.display.viewTo || range$$1.to().line < cm.display.viewFrom) { continue }\n var collapsed = range$$1.empty();\n if (collapsed || cm.options.showCursorWhenSelecting)\n { drawSelectionCursor(cm, range$$1.head, curFragment); }\n if (!collapsed)\n { drawSelectionRange(cm, range$$1, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\"; },\n cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n onBlur(cm);\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range$$1) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range$$1;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val);\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.pointerEvents = this.vert.style.pointerEvents = \"none\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.pointerEvents = \"auto\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt$$1 = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt$$1 != bar) { bar.style.pointerEvents = \"none\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt();\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this$1.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt();\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = window.getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }\n snapshot.activeElt.focus();\n if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var sel = window.getSelection(), range$$1 = document.createRange();\n range$$1.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range$$1.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range$$1);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(cm) {\n var width = cm.display.gutters.offsetWidth;\n cm.display.sizer.style.marginLeft = width + \"px\";\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }\n\n // Make sure the gutters options contains the element\n // \"CodeMirror-linenumbers\" when the lineNumbers option is true.\n function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && wheelPixelsPerUnit != null) {\n var pixels = dy * wheelPixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n var this$1 = this;\n\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this$1.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var this$1 = this;\n\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this$1.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n var this$1 = this;\n\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this$1.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(startGen) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = startGen || 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm)\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n var this$1 = this;\n\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this$1;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n var this$1 = this;\n\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this$1.lines[i];\n this$1.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var e = at + n; at < e; ++at)\n { if (op(this$1.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n var this$1 = this;\n\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this$1;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n var this$1 = this;\n\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this$1.height -= oldHeight - child.height;\n if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this$1.children.splice(++i, 0, leaf);\n leaf.parent = this$1;\n }\n child.lines = child.lines.slice(0, remaining);\n this$1.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n var this$1 = this;\n\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this$1[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var this$1 = this;\n\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n var this$1 = this;\n\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null));\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n var this$1 = this;\n\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this$1; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this$1.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range$$1 = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range$$1.head; }\n else if (start == \"anchor\") { pos = range$$1.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range$$1.to(); }\n else { pos = range$$1.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n var this$1 = this;\n\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this$1, ranges[i].anchor),\n clipPos(this$1, ranges[i].head)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var this$1 = this;\n\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var this$1 = this;\n\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var this$1 = this;\n\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range$$1 = sel.ranges[i];\n changes[i] = {from: range$$1.from(), to: range$$1.to(), text: this$1.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this$1, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {this.history = new History(this.history.maxGeneration);},\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history.maxGeneration);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo$$1 = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo$$1 == from.line && from.ch >= span.to ||\n span.from == null && lineNo$$1 != from.line ||\n span.from != null && lineNo$$1 == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo$$1;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo$$1 = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo$$1;\n });\n return clipPos(this, Pos(lineNo$$1, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n var this$1 = this;\n\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this$1.linked[i];\n if (link.doc != other) { continue }\n this$1.linked.splice(i, 1);\n other.unlinkDoc(this$1);\n detachSharedMarkers(findSharedMarkers(this$1));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var loadFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1)\n { return }\n\n var reader = new FileReader;\n reader.onload = operation(cm, function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) { content = \"\"; }\n text[i] = content;\n if (++read == n) {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)));\n }\n });\n reader.readAsText(file);\n };\n for (var i = 0; i < n; ++i) { loadFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 127: \"Delete\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Alt-F\": \"goWordRight\", \"Alt-B\": \"goWordLeft\", \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\",\n \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\", \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\",\n \"Alt-D\": \"delWordAfter\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\", \"Ctrl-T\": \"transposeChars\",\n \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map$$1, handle, context) {\n map$$1 = getKeyMap(map$$1);\n var found = map$$1.call ? map$$1.call(key, context) : map$$1[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map$$1.fallthrough) {\n if (Object.prototype.toString.call(map$$1.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map$$1.fallthrough, handle, context) }\n for (var i = 0; i < map$$1.fallthrough.length; i++) {\n var result = lookupKey(key, map$$1.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Cmd\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"char\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(0, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n cm.curOp.focus = activeElt();\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if (webkit || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n delayBlurEvent(cm);\n setTimeout(function () { return display.input.focus(); }, 20);\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.options.gutters.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.options.gutters[i];\n signal(cm, type, cm, line, gutter, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b-\\u200f\\u2028\\u2029\\ufeff]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n guttersChanged(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"firstLineNumber\", 1, guttersChanged, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, guttersChanged, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function guttersChanged(cm) {\n updateGutters(cm);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n setGuttersForLineNumbers(options);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input);\n display.wrapper.CodeMirror = this;\n updateGutters(this);\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(bind(onFocus, this), 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this$1, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range$$1 = sel.ranges[i$1];\n var from = range$$1.from(), to = range$$1.to();\n if (range$$1.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == inserted)\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput)\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range$$1 = sel.ranges[i];\n if (range$$1.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range$$1.head.line)) { continue }\n var mode = cm.getModeAt(range$$1.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range$$1.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range$$1.head.line).text.slice(0, range$$1.head.ch)))\n { indented = indentLine(cm, range$$1.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range$$1.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", !!autocorrect);\n field.setAttribute(\"autocapitalize\", !!autocapitalize);\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n disableBrowserMagic(te);\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map$$1, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n },\n removeKeyMap: function(map$$1) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this$1.state.modeGen++;\n regChange(this$1);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range$$1 = ranges[i];\n if (!range$$1.empty()) {\n var from = range$$1.from(), to = range$$1.to();\n var start = Math.max(end, from.line);\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how); }\n var newRanges = this$1.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range$$1.head.line > end) {\n indentLine(this$1, range$$1.head.line, how, true);\n end = range$$1.head.line;\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range$$1 = this.doc.sel.primary();\n if (start == null) { pos = range$$1.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range$$1.from() : range$$1.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range$$1) {\n if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range$$1) {\n var other = findPosH(doc, range$$1.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this$1, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range$$1) {\n if (collapse)\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range$$1 == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range$$1, margin) {\n if (range$$1 == null) {\n range$$1 = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range$$1 == \"number\") {\n range$$1 = {from: Pos(range$$1, 0), to: null};\n } else if (range$$1.from == null) {\n range$$1 = {from: range$$1, to: null};\n }\n if (!range$$1.to) { range$$1.to = range$$1.from; }\n range$$1.margin = margin || 0;\n\n if (range$$1.from.line != null) {\n scrollToRange(this, range$$1);\n } else {\n scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo$$1 = this.display.viewFrom;\n this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n ++lineNo$$1;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"char\", \"column\" (like char, but doesn't\n // cross line boundaries), \"word\" (across next word), or \"group\" (to\n // the start of next group of word or non-word-non-whitespace\n // chars). The visually param controls whether, in right-to-left\n // text, direction 1 means to move towards the next index in the\n // string, or towards the character to the right of the current\n // position. The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n function findNextLine() {\n var l = pos.line + dir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n on(div, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = document.activeElement;\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = this.cm.state.focused;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map$$1 = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map$$1[map$$1.length - 1], offset: map$$1[map$$1.length - 2] - map$$1[map$$1.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor())\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var input = this;\n if (this.selectionInEditor())\n { this.pollSelection(); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range$$1;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range$$1 = found[0].find(0)))\n { addText(getBetween(cm.doc, range$$1.from, range$$1.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map$$1 = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map$$1.length; j += 3) {\n var curNode = map$$1[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map$$1[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map$$1[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing) { return }\n var cm = this.cm;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt() != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { window.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt();\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, …*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.45.0\";\n\n return CodeMirror;\n\n})));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/lib/codemirror.js\n// module id = 644\n// module chunks = 3 4 5 7 8 14","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-f72bdd3a\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./secondaryMenu.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./secondaryMenu.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./secondaryMenu.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-f72bdd3a\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./secondaryMenu.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/secondaryMenu/secondaryMenu.vue\n// module id = 654\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 25 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/priority/priority.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport _ from 'lodash'\nimport $ from 'jquery'\nimport i18n from '@/module/i18n'\nimport store from '@/conf/home/store'\n\n/**\n * Node, to array\n */\nconst rtTargetarrArr = (id) => {\n let a = $(`#${id}`).attr('data-targetarr')\n return a ? a.split(',') : []\n}\n\n/**\n * Store node id to targetarr\n */\nconst saveTargetarr = (valId, domId) => {\n let $target = $(`#${domId}`)\n let targetStr = $target.attr('data-targetarr') ? $target.attr('data-targetarr') + `,${valId}` : `${valId}`\n $target.attr('data-targetarr', targetStr)\n}\n\nconst rtBantpl = () => {\n return ``\n}\n\n/**\n * return node html\n */\nconst rtTasksTpl = ({ id, name, x, y, targetarr, isAttachment, taskType,runFlag }) => {\n let tpl = ``\n tpl += `
`\n tpl += `
`\n tpl += `
`\n tpl += `
`\n tpl += `${name}`\n tpl += `
`\n tpl += `
`\n tpl += `
`\n if (runFlag === 'FORBIDDEN') {\n tpl += rtBantpl()\n }\n tpl += `
`\n tpl += `
`\n\n return tpl\n}\n\n/**\n * Get all tasks nodes\n */\nconst tasksAll = () => {\n let a = []\n $('#canvas .w').each(function (idx, elem) {\n let e = $(elem)\n a.push({\n id: e.attr('id'),\n name: e.find('.name-p').text(),\n targetarr: e.attr('data-targetarr') || '',\n x: parseInt(e.css('left'), 10),\n y: parseInt(e.css('top'), 10)\n })\n })\n return a\n}\n\n/**\n * Determine if name is in the current dag map\n * rely dom / backfill\n */\nconst isNameExDag = (name, rely) => {\n if (rely === 'dom') {\n return _.findIndex(tasksAll(), v => v.name === name) !== -1\n } else {\n return _.findIndex(store.state.dag.tasks, v => v.name === name) !== -1\n }\n}\n\n/**\n * Change svg line color\n */\nconst setSvgColor = (e, color) => {\n // Traverse clear all colors\n $('.jtk-connector').each((i, o) => {\n _.map($(o)[0].childNodes, v => {\n $(v).attr('fill', '#555').attr('stroke', '#555').attr('stroke-width', 2)\n })\n })\n\n // Add color to the selection\n _.map($(e.canvas)[0].childNodes, (v, i) => {\n $(v).attr('fill', color).attr('stroke', color)\n if ($(v).attr('class')) {\n $(v).attr('stroke-width', 2)\n }\n })\n}\n\n/**\n * Get all node ids\n */\nconst allNodesId = () => {\n let idArr = []\n $('.w').each((i, o) => {\n let $obj = $(o)\n let $span = $obj.find('.name-p').text()\n if ($span) {\n idArr.push({\n id: $obj.attr('id'),\n name: $span\n })\n }\n })\n return idArr\n}\n\nexport {\n rtTargetarrArr,\n saveTargetarr,\n rtTasksTpl,\n tasksAll,\n isNameExDag,\n setSvgColor,\n allNodesId,\n rtBantpl\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/plugIn/util.js","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-5b25ea8f\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./resources.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./resources.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./resources.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-5b25ea8f\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./resources.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/dag/_source/formModel/tasks/_source/resources.vue\n// module id = 699\n// module chunks = 3 4 5","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-6a4fc01c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./priority.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./priority.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./priority.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-6a4fc01c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./priority.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/priority/priority.vue\n// module id = 700\n// module chunks = 0 3 4 5 6","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport i18n from '@/module/i18n'\n/**\n * download file\n */\nlet downloadFile = ($url, $obj) => {\n let param = {\n url: $url,\n obj: $obj\n }\n\n if (!param.url) {\n this.$message.warning(`${i18n.$t('无下载url无法下载')}`)\n return\n }\n\n let generatorInput = function (obj) {\n let result = ''\n let keyArr = Object.keys(obj)\n keyArr.forEach(function (key) {\n result += \"\"\n })\n return result\n }\n $(`
${generatorInput(param.obj)}
`).appendTo('body').submit().remove()\n}\n\nexport { downloadFile }\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/module/download/index.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue","/**\n * jsBezier\n *\n * Copyright (c) 2010 - 2017 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * licensed under the MIT license.\n *\n * a set of Bezier curve functions that deal with Beziers, used by jsPlumb, and perhaps useful for other people. These functions work with Bezier\n * curves of arbitrary degree.\n *\n * - functions are all in the 'jsBezier' namespace.\n *\n * - all input points should be in the format {x:.., y:..}. all output points are in this format too.\n *\n * - all input curves should be in the format [ {x:.., y:..}, {x:.., y:..}, {x:.., y:..}, {x:.., y:..} ]\n *\n * - 'location' as used as an input here refers to a decimal in the range 0-1 inclusive, which indicates a point some proportion along the length\n * of the curve. location as output has the same format and meaning.\n *\n *\n * Function List:\n * --------------\n *\n * distanceFromCurve(point, curve)\n *\n * \tCalculates the distance that the given point lies from the given Bezier. Note that it is computed relative to the center of the Bezier,\n * so if you have stroked the curve with a wide pen you may wish to take that into account! The distance returned is relative to the values\n * of the curve and the point - it will most likely be pixels.\n *\n * gradientAtPoint(curve, location)\n *\n * \tCalculates the gradient to the curve at the given location, as a decimal between 0 and 1 inclusive.\n *\n * gradientAtPointAlongCurveFrom (curve, location)\n *\n *\tCalculates the gradient at the point on the given curve that is 'distance' units from location.\n *\n * nearestPointOnCurve(point, curve)\n *\n *\tCalculates the nearest point to the given point on the given curve. The return value of this is a JS object literal, containing both the\n *point's coordinates and also the 'location' of the point (see above), for example: { point:{x:551,y:150}, location:0.263365 }.\n *\n * pointOnCurve(curve, location)\n *\n * \tCalculates the coordinates of the point on the given Bezier curve at the given location.\n *\n * pointAlongCurveFrom(curve, location, distance)\n *\n * \tCalculates the coordinates of the point on the given curve that is 'distance' units from location. 'distance' should be in the same coordinate\n * space as that used to construct the Bezier curve. For an HTML Canvas usage, for example, distance would be a measure of pixels.\n *\n * locationAlongCurveFrom(curve, location, distance)\n *\n * \tCalculates the location on the given curve that is 'distance' units from location. 'distance' should be in the same coordinate\n * space as that used to construct the Bezier curve. For an HTML Canvas usage, for example, distance would be a measure of pixels.\n *\n * perpendicularToCurveAt(curve, location, length, distance)\n *\n * \tCalculates the perpendicular to the given curve at the given location. length is the length of the line you wish for (it will be centered\n * on the point at 'location'). distance is optional, and allows you to specify a point along the path from the given location as the center of\n * the perpendicular returned. The return value of this is an array of two points: [ {x:...,y:...}, {x:...,y:...} ].\n *\n *\n */\n\n(function() {\n\n var root = this;\n\n if(typeof Math.sgn == \"undefined\") {\n Math.sgn = function(x) { return x == 0 ? 0 : x > 0 ? 1 :-1; };\n }\n\n var Vectors = {\n subtract \t: \tfunction(v1, v2) { return {x:v1.x - v2.x, y:v1.y - v2.y }; },\n dotProduct\t: \tfunction(v1, v2) { return (v1.x * v2.x) + (v1.y * v2.y); },\n square\t\t:\tfunction(v) { return Math.sqrt((v.x * v.x) + (v.y * v.y)); },\n scale\t\t:\tfunction(v, s) { return {x:v.x * s, y:v.y * s }; }\n },\n\n maxRecursion = 64,\n flatnessTolerance = Math.pow(2.0,-maxRecursion-1);\n\n /**\n * Calculates the distance that the point lies from the curve.\n *\n * @param point a point in the form {x:567, y:3342}\n * @param curve a Bezier curve in the form [{x:..., y:...}, {x:..., y:...}, {x:..., y:...}, {x:..., y:...}]. note that this is currently\n * hardcoded to assume cubiz beziers, but would be better off supporting any degree.\n * @return a JS object literal containing location and distance, for example: {location:0.35, distance:10}. Location is analogous to the location\n * argument you pass to the pointOnPath function: it is a ratio of distance travelled along the curve. Distance is the distance in pixels from\n * the point to the curve.\n */\n var _distanceFromCurve = function(point, curve) {\n var candidates = [],\n w = _convertToBezier(point, curve),\n degree = curve.length - 1, higherDegree = (2 * degree) - 1,\n numSolutions = _findRoots(w, higherDegree, candidates, 0),\n v = Vectors.subtract(point, curve[0]), dist = Vectors.square(v), t = 0.0;\n\n for (var i = 0; i < numSolutions; i++) {\n v = Vectors.subtract(point, _bezier(curve, degree, candidates[i], null, null));\n var newDist = Vectors.square(v);\n if (newDist < dist) {\n dist = newDist;\n t = candidates[i];\n }\n }\n v = Vectors.subtract(point, curve[degree]);\n newDist = Vectors.square(v);\n if (newDist < dist) {\n dist = newDist;\n t = 1.0;\n }\n return {location:t, distance:dist};\n };\n /**\n * finds the nearest point on the curve to the given point.\n */\n var _nearestPointOnCurve = function(point, curve) {\n var td = _distanceFromCurve(point, curve);\n return {point:_bezier(curve, curve.length - 1, td.location, null, null), location:td.location};\n };\n var _convertToBezier = function(point, curve) {\n var degree = curve.length - 1, higherDegree = (2 * degree) - 1,\n c = [], d = [], cdTable = [], w = [],\n z = [ [1.0, 0.6, 0.3, 0.1], [0.4, 0.6, 0.6, 0.4], [0.1, 0.3, 0.6, 1.0] ];\n\n for (var i = 0; i <= degree; i++) c[i] = Vectors.subtract(curve[i], point);\n for (var i = 0; i <= degree - 1; i++) {\n d[i] = Vectors.subtract(curve[i+1], curve[i]);\n d[i] = Vectors.scale(d[i], 3.0);\n }\n for (var row = 0; row <= degree - 1; row++) {\n for (var column = 0; column <= degree; column++) {\n if (!cdTable[row]) cdTable[row] = [];\n cdTable[row][column] = Vectors.dotProduct(d[row], c[column]);\n }\n }\n for (i = 0; i <= higherDegree; i++) {\n if (!w[i]) w[i] = [];\n w[i].y = 0.0;\n w[i].x = parseFloat(i) / higherDegree;\n }\n var n = degree, m = degree-1;\n for (var k = 0; k <= n + m; k++) {\n var lb = Math.max(0, k - m),\n ub = Math.min(k, n);\n for (i = lb; i <= ub; i++) {\n var j = k - i;\n w[i+j].y += cdTable[j][i] * z[j][i];\n }\n }\n return w;\n };\n /**\n * counts how many roots there are.\n */\n var _findRoots = function(w, degree, t, depth) {\n var left = [], right = [],\n left_count, right_count,\n left_t = [], right_t = [];\n\n switch (_getCrossingCount(w, degree)) {\n case 0 : {\n return 0;\n }\n case 1 : {\n if (depth >= maxRecursion) {\n t[0] = (w[0].x + w[degree].x) / 2.0;\n return 1;\n }\n if (_isFlatEnough(w, degree)) {\n t[0] = _computeXIntercept(w, degree);\n return 1;\n }\n break;\n }\n }\n _bezier(w, degree, 0.5, left, right);\n left_count = _findRoots(left, degree, left_t, depth+1);\n right_count = _findRoots(right, degree, right_t, depth+1);\n for (var i = 0; i < left_count; i++) t[i] = left_t[i];\n for (var i = 0; i < right_count; i++) t[i+left_count] = right_t[i];\n return (left_count+right_count);\n };\n var _getCrossingCount = function(curve, degree) {\n var n_crossings = 0, sign, old_sign;\n sign = old_sign = Math.sgn(curve[0].y);\n for (var i = 1; i <= degree; i++) {\n sign = Math.sgn(curve[i].y);\n if (sign != old_sign) n_crossings++;\n old_sign = sign;\n }\n return n_crossings;\n };\n var _isFlatEnough = function(curve, degree) {\n var error,\n intercept_1, intercept_2, left_intercept, right_intercept,\n a, b, c, det, dInv, a1, b1, c1, a2, b2, c2;\n a = curve[0].y - curve[degree].y;\n b = curve[degree].x - curve[0].x;\n c = curve[0].x * curve[degree].y - curve[degree].x * curve[0].y;\n\n var max_distance_above, max_distance_below;\n max_distance_above = max_distance_below = 0.0;\n\n for (var i = 1; i < degree; i++) {\n var value = a * curve[i].x + b * curve[i].y + c;\n if (value > max_distance_above)\n max_distance_above = value;\n else if (value < max_distance_below)\n max_distance_below = value;\n }\n\n a1 = 0.0; b1 = 1.0; c1 = 0.0; a2 = a; b2 = b;\n c2 = c - max_distance_above;\n det = a1 * b2 - a2 * b1;\n dInv = 1.0/det;\n intercept_1 = (b1 * c2 - b2 * c1) * dInv;\n a2 = a; b2 = b; c2 = c - max_distance_below;\n det = a1 * b2 - a2 * b1;\n dInv = 1.0/det;\n intercept_2 = (b1 * c2 - b2 * c1) * dInv;\n left_intercept = Math.min(intercept_1, intercept_2);\n right_intercept = Math.max(intercept_1, intercept_2);\n error = right_intercept - left_intercept;\n return (error < flatnessTolerance)? 1 : 0;\n };\n var _computeXIntercept = function(curve, degree) {\n var XLK = 1.0, YLK = 0.0,\n XNM = curve[degree].x - curve[0].x, YNM = curve[degree].y - curve[0].y,\n XMK = curve[0].x - 0.0, YMK = curve[0].y - 0.0,\n det = XNM*YLK - YNM*XLK, detInv = 1.0/det,\n S = (XNM*YMK - YNM*XMK) * detInv;\n return 0.0 + XLK * S;\n };\n var _bezier = function(curve, degree, t, left, right) {\n var temp = [[]];\n for (var j =0; j <= degree; j++) temp[0][j] = curve[j];\n for (var i = 1; i <= degree; i++) {\n for (var j =0 ; j <= degree - i; j++) {\n if (!temp[i]) temp[i] = [];\n if (!temp[i][j]) temp[i][j] = {};\n temp[i][j].x = (1.0 - t) * temp[i-1][j].x + t * temp[i-1][j+1].x;\n temp[i][j].y = (1.0 - t) * temp[i-1][j].y + t * temp[i-1][j+1].y;\n }\n }\n if (left != null)\n for (j = 0; j <= degree; j++) left[j] = temp[j][0];\n if (right != null)\n for (j = 0; j <= degree; j++) right[j] = temp[degree-j][j];\n\n return (temp[degree][0]);\n };\n\n var _curveFunctionCache = {};\n var _getCurveFunctions = function(order) {\n var fns = _curveFunctionCache[order];\n if (!fns) {\n fns = [];\n var f_term = function() { return function(t) { return Math.pow(t, order); }; },\n l_term = function() { return function(t) { return Math.pow((1-t), order); }; },\n c_term = function(c) { return function(t) { return c; }; },\n t_term = function() { return function(t) { return t; }; },\n one_minus_t_term = function() { return function(t) { return 1-t; }; },\n _termFunc = function(terms) {\n return function(t) {\n var p = 1;\n for (var i = 0; i < terms.length; i++) p = p * terms[i](t);\n return p;\n };\n };\n\n fns.push(new f_term()); // first is t to the power of the curve order\n for (var i = 1; i < order; i++) {\n var terms = [new c_term(order)];\n for (var j = 0 ; j < (order - i); j++) terms.push(new t_term());\n for (var j = 0 ; j < i; j++) terms.push(new one_minus_t_term());\n fns.push(new _termFunc(terms));\n }\n fns.push(new l_term()); // last is (1-t) to the power of the curve order\n\n _curveFunctionCache[order] = fns;\n }\n\n return fns;\n };\n\n\n /**\n * calculates a point on the curve, for a Bezier of arbitrary order.\n * @param curve an array of control points, eg [{x:10,y:20}, {x:50,y:50}, {x:100,y:100}, {x:120,y:100}]. For a cubic bezier this should have four points.\n * @param location a decimal indicating the distance along the curve the point should be located at. this is the distance along the curve as it travels, taking the way it bends into account. should be a number from 0 to 1, inclusive.\n */\n var _pointOnPath = function(curve, location) {\n var cc = _getCurveFunctions(curve.length - 1),\n _x = 0, _y = 0;\n for (var i = 0; i < curve.length ; i++) {\n _x = _x + (curve[i].x * cc[i](location));\n _y = _y + (curve[i].y * cc[i](location));\n }\n\n return {x:_x, y:_y};\n };\n\n var _dist = function(p1,p2) {\n return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));\n };\n\n var _isPoint = function(curve) {\n return curve[0].x === curve[1].x && curve[0].y === curve[1].y;\n };\n\n /**\n * finds the point that is 'distance' along the path from 'location'. this method returns both the x,y location of the point and also\n * its 'location' (proportion of travel along the path); the method below - _pointAlongPathFrom - calls this method and just returns the\n * point.\n */\n var _pointAlongPath = function(curve, location, distance) {\n\n if (_isPoint(curve)) {\n return {\n point:curve[0],\n location:location\n };\n }\n\n var prev = _pointOnPath(curve, location),\n tally = 0,\n curLoc = location,\n direction = distance > 0 ? 1 : -1,\n cur = null;\n\n while (tally < Math.abs(distance)) {\n curLoc += (0.005 * direction);\n cur = _pointOnPath(curve, curLoc);\n tally += _dist(cur, prev);\n prev = cur;\n }\n return {point:cur, location:curLoc};\n };\n\n var _length = function(curve) {\n if (_isPoint(curve)) return 0;\n\n var prev = _pointOnPath(curve, 0),\n tally = 0,\n curLoc = 0,\n direction = 1,\n cur = null;\n\n while (curLoc < 1) {\n curLoc += (0.005 * direction);\n cur = _pointOnPath(curve, curLoc);\n tally += _dist(cur, prev);\n prev = cur;\n }\n return tally;\n };\n\n /**\n * finds the point that is 'distance' along the path from 'location'.\n */\n var _pointAlongPathFrom = function(curve, location, distance) {\n return _pointAlongPath(curve, location, distance).point;\n };\n\n /**\n * finds the location that is 'distance' along the path from 'location'.\n */\n var _locationAlongPathFrom = function(curve, location, distance) {\n return _pointAlongPath(curve, location, distance).location;\n };\n\n /**\n * returns the gradient of the curve at the given location, which is a decimal between 0 and 1 inclusive.\n *\n * thanks // http://bimixual.org/AnimationLibrary/beziertangents.html\n */\n var _gradientAtPoint = function(curve, location) {\n var p1 = _pointOnPath(curve, location),\n p2 = _pointOnPath(curve.slice(0, curve.length - 1), location),\n dy = p2.y - p1.y, dx = p2.x - p1.x;\n return dy === 0 ? Infinity : Math.atan(dy / dx);\n };\n\n /**\n returns the gradient of the curve at the point which is 'distance' from the given location.\n if this point is greater than location 1, the gradient at location 1 is returned.\n if this point is less than location 0, the gradient at location 0 is returned.\n */\n var _gradientAtPointAlongPathFrom = function(curve, location, distance) {\n var p = _pointAlongPath(curve, location, distance);\n if (p.location > 1) p.location = 1;\n if (p.location < 0) p.location = 0;\n return _gradientAtPoint(curve, p.location);\n };\n\n /**\n * calculates a line that is 'length' pixels long, perpendicular to, and centered on, the path at 'distance' pixels from the given location.\n * if distance is not supplied, the perpendicular for the given location is computed (ie. we set distance to zero).\n */\n var _perpendicularToPathAt = function(curve, location, length, distance) {\n distance = distance == null ? 0 : distance;\n var p = _pointAlongPath(curve, location, distance),\n m = _gradientAtPoint(curve, p.location),\n _theta2 = Math.atan(-1 / m),\n y = length / 2 * Math.sin(_theta2),\n x = length / 2 * Math.cos(_theta2);\n return [{x:p.point.x + x, y:p.point.y + y}, {x:p.point.x - x, y:p.point.y - y}];\n };\n\n /**\n * Calculates all intersections of the given line with the given curve.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param curve\n * @returns {Array}\n */\n var _lineIntersection = function(x1, y1, x2, y2, curve) {\n var a = y2 - y1,\n b = x1 - x2,\n c = (x1 * (y1 - y2)) + (y1 * (x2-x1)),\n coeffs = _computeCoefficients(curve),\n p = [\n (a*coeffs[0][0]) + (b * coeffs[1][0]),\n (a*coeffs[0][1])+(b*coeffs[1][1]),\n (a*coeffs[0][2])+(b*coeffs[1][2]),\n (a*coeffs[0][3])+(b*coeffs[1][3]) + c\n ],\n r = _cubicRoots.apply(null, p),\n intersections = [];\n\n if (r != null) {\n\n for (var i = 0; i < 3; i++) {\n var t = r[i],\n t2 = Math.pow(t, 2),\n t3 = Math.pow(t, 3),\n x = [\n (coeffs[0][0] * t3) + (coeffs[0][1] * t2) + (coeffs[0][2] * t) + coeffs[0][3],\n (coeffs[1][0] * t3) + (coeffs[1][1] * t2) + (coeffs[1][2] * t) + coeffs[1][3]\n ];\n\n // check bounds of the line\n var s;\n if ((x2 - x1) !== 0) {\n s = (x[0] - x1) / (x2 - x1);\n }\n else {\n s = (x[1] - y1) / (y2 - y1);\n }\n\n if (t >= 0 && t <= 1.0 && s >= 0 && s <= 1.0) {\n intersections.push(x);\n }\n }\n }\n\n return intersections;\n };\n\n /**\n * Calculates all intersections of the given box with the given curve.\n * @param x X position of top left corner of box\n * @param y Y position of top left corner of box\n * @param w width of box\n * @param h height of box\n * @param curve\n * @returns {Array}\n */\n var _boxIntersection = function(x, y, w, h, curve) {\n var i = [];\n i.push.apply(i, _lineIntersection(x, y, x + w, y, curve));\n i.push.apply(i, _lineIntersection(x + w, y, x + w, y + h, curve));\n i.push.apply(i, _lineIntersection(x + w, y + h, x, y + h, curve));\n i.push.apply(i, _lineIntersection(x, y + h, x, y, curve));\n return i;\n };\n\n /**\n * Calculates all intersections of the given bounding box with the given curve.\n * @param boundingBox Bounding box, in { x:.., y:..., w:..., h:... } format.\n * @param curve\n * @returns {Array}\n */\n var _boundingBoxIntersection = function(boundingBox, curve) {\n var i = [];\n i.push.apply(i, _lineIntersection(boundingBox.x, boundingBox.y, boundingBox.x + boundingBox.w, boundingBox.y, curve));\n i.push.apply(i, _lineIntersection(boundingBox.x + boundingBox.w, boundingBox.y, boundingBox.x + boundingBox.w, boundingBox.y + boundingBox.h, curve));\n i.push.apply(i, _lineIntersection(boundingBox.x + boundingBox.w, boundingBox.y + boundingBox.h, boundingBox.x, boundingBox.y + boundingBox.h, curve));\n i.push.apply(i, _lineIntersection(boundingBox.x, boundingBox.y + boundingBox.h, boundingBox.x, boundingBox.y, curve));\n return i;\n };\n\n\n function _computeCoefficientsForAxis(curve, axis) {\n return [\n -(curve[0][axis]) + (3*curve[1][axis]) + (-3 * curve[2][axis]) + curve[3][axis],\n (3*(curve[0][axis])) - (6*(curve[1][axis])) + (3*(curve[2][axis])),\n -3*curve[0][axis] + 3*curve[1][axis],\n curve[0][axis]\n ];\n }\n\n function _computeCoefficients(curve)\n {\n return [\n _computeCoefficientsForAxis(curve, \"x\"),\n _computeCoefficientsForAxis(curve, \"y\")\n ];\n }\n\n function sgn(x) {\n return x < 0 ? -1 : x > 0 ? 1 : 0;\n }\n\n function _cubicRoots(a, b, c, d) {\n var A = b / a,\n B = c / a,\n C = d / a,\n Q = (3*B - Math.pow(A, 2))/9,\n R = (9*A*B - 27*C - 2*Math.pow(A, 3))/54,\n D = Math.pow(Q, 3) + Math.pow(R, 2),\n S,\n T,\n t = [];\n\n if (D >= 0) // complex or duplicate roots\n {\n S = sgn(R + Math.sqrt(D))*Math.pow(Math.abs(R + Math.sqrt(D)),(1/3));\n T = sgn(R - Math.sqrt(D))*Math.pow(Math.abs(R - Math.sqrt(D)),(1/3));\n\n t[0] = -A/3 + (S + T);\n t[1] = -A/3 - (S + T)/2;\n t[2] = -A/3 - (S + T)/2;\n\n /*discard complex roots*/\n if (Math.abs(Math.sqrt(3)*(S - T)/2) !== 0) {\n t[1] = -1;\n t[2] = -1;\n }\n }\n else // distinct real roots\n {\n var th = Math.acos(R/Math.sqrt(-Math.pow(Q, 3)));\n t[0] = 2*Math.sqrt(-Q)*Math.cos(th/3) - A/3;\n t[1] = 2*Math.sqrt(-Q)*Math.cos((th + 2*Math.PI)/3) - A/3;\n t[2] = 2*Math.sqrt(-Q)*Math.cos((th + 4*Math.PI)/3) - A/3;\n }\n\n // discard out of spec roots\n for (var i = 0; i < 3; i++) {\n if (t[i] < 0 || t[i] > 1.0) {\n t[i] = -1;\n }\n }\n\n return t;\n }\n\n var jsBezier = this.jsBezier = {\n distanceFromCurve : _distanceFromCurve,\n gradientAtPoint : _gradientAtPoint,\n gradientAtPointAlongCurveFrom : _gradientAtPointAlongPathFrom,\n nearestPointOnCurve : _nearestPointOnCurve,\n pointOnCurve : _pointOnPath,\n pointAlongCurveFrom : _pointAlongPathFrom,\n perpendicularToCurveAt : _perpendicularToPathAt,\n locationAlongCurveFrom:_locationAlongPathFrom,\n getLength:_length,\n lineIntersection:_lineIntersection,\n boxIntersection:_boxIntersection,\n boundingBoxIntersection:_boundingBoxIntersection,\n version:\"0.9.0\"\n };\n\n if (typeof exports !== \"undefined\") {\n exports.jsBezier = jsBezier;\n }\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/**\n * Biltong v0.4.0\n *\n * Various geometry functions written as part of jsPlumb and perhaps useful for others.\n *\n * Copyright (c) 2017 jsPlumb\n * https://jsplumbtoolkit.com\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n;(function() {\n\n \"use strict\";\n var root = this;\n\n var Biltong = root.Biltong = {\n version:\"0.4.0\"\n };\n\n if (typeof exports !== \"undefined\") {\n exports.Biltong = Biltong;\n }\n\n var _isa = function(a) { return Object.prototype.toString.call(a) === \"[object Array]\"; },\n _pointHelper = function(p1, p2, fn) {\n p1 = _isa(p1) ? p1 : [p1.x, p1.y];\n p2 = _isa(p2) ? p2 : [p2.x, p2.y];\n return fn(p1, p2);\n },\n /**\n * @name Biltong.gradient\n * @function\n * @desc Calculates the gradient of a line between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The gradient of a line between the two points.\n */\n _gradient = Biltong.gradient = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n if (_p2[0] == _p1[0])\n return _p2[1] > _p1[1] ? Infinity : -Infinity;\n else if (_p2[1] == _p1[1])\n return _p2[0] > _p1[0] ? 0 : -0;\n else\n return (_p2[1] - _p1[1]) / (_p2[0] - _p1[0]);\n });\n },\n /**\n * @name Biltong.normal\n * @function\n * @desc Calculates the gradient of a normal to a line between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The gradient of a normal to a line between the two points.\n */\n _normal = Biltong.normal = function(p1, p2) {\n return -1 / _gradient(p1, p2);\n },\n /**\n * @name Biltong.lineLength\n * @function\n * @desc Calculates the length of a line between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The length of a line between the two points.\n */\n _lineLength = Biltong.lineLength = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n return Math.sqrt(Math.pow(_p2[1] - _p1[1], 2) + Math.pow(_p2[0] - _p1[0], 2));\n });\n },\n /**\n * @name Biltong.quadrant\n * @function\n * @desc Calculates the quadrant in which the angle between the two points lies.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Integer} The quadrant - 1 for upper right, 2 for lower right, 3 for lower left, 4 for upper left.\n */\n _quadrant = Biltong.quadrant = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n if (_p2[0] > _p1[0]) {\n return (_p2[1] > _p1[1]) ? 2 : 1;\n }\n else if (_p2[0] == _p1[0]) {\n return _p2[1] > _p1[1] ? 2 : 1;\n }\n else {\n return (_p2[1] > _p1[1]) ? 3 : 4;\n }\n });\n },\n /**\n * @name Biltong.theta\n * @function\n * @desc Calculates the angle between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The angle between the two points.\n */\n _theta = Biltong.theta = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n var m = _gradient(_p1, _p2),\n t = Math.atan(m),\n s = _quadrant(_p1, _p2);\n if ((s == 4 || s== 3)) t += Math.PI;\n if (t < 0) t += (2 * Math.PI);\n\n return t;\n });\n },\n /**\n * @name Biltong.intersects\n * @function\n * @desc Calculates whether or not the two rectangles intersect.\n * @param {Rectangle} r1 First rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @param {Rectangle} r2 Second rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @return {Boolean} True if the rectangles intersect, false otherwise.\n */\n _intersects = Biltong.intersects = function(r1, r2) {\n var x1 = r1.x, x2 = r1.x + r1.w, y1 = r1.y, y2 = r1.y + r1.h,\n a1 = r2.x, a2 = r2.x + r2.w, b1 = r2.y, b2 = r2.y + r2.h;\n\n return ( (x1 <= a1 && a1 <= x2) && (y1 <= b1 && b1 <= y2) ) ||\n ( (x1 <= a2 && a2 <= x2) && (y1 <= b1 && b1 <= y2) ) ||\n ( (x1 <= a1 && a1 <= x2) && (y1 <= b2 && b2 <= y2) ) ||\n ( (x1 <= a2 && a1 <= x2) && (y1 <= b2 && b2 <= y2) ) ||\n ( (a1 <= x1 && x1 <= a2) && (b1 <= y1 && y1 <= b2) ) ||\n ( (a1 <= x2 && x2 <= a2) && (b1 <= y1 && y1 <= b2) ) ||\n ( (a1 <= x1 && x1 <= a2) && (b1 <= y2 && y2 <= b2) ) ||\n ( (a1 <= x2 && x1 <= a2) && (b1 <= y2 && y2 <= b2) );\n },\n /**\n * @name Biltong.encloses\n * @function\n * @desc Calculates whether or not r2 is completely enclosed by r1.\n * @param {Rectangle} r1 First rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @param {Rectangle} r2 Second rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @param {Boolean} [allowSharedEdges=false] If true, the concept of enclosure allows for one or more edges to be shared by the two rectangles.\n * @return {Boolean} True if r1 encloses r2, false otherwise.\n */\n _encloses = Biltong.encloses = function(r1, r2, allowSharedEdges) {\n var x1 = r1.x, x2 = r1.x + r1.w, y1 = r1.y, y2 = r1.y + r1.h,\n a1 = r2.x, a2 = r2.x + r2.w, b1 = r2.y, b2 = r2.y + r2.h,\n c = function(v1, v2, v3, v4) { return allowSharedEdges ? v1 <= v2 && v3>= v4 : v1 < v2 && v3 > v4; };\n\n return c(x1,a1,x2,a2) && c(y1,b1,y2,b2);\n },\n _segmentMultipliers = [null, [1, -1], [1, 1], [-1, 1], [-1, -1] ],\n _inverseSegmentMultipliers = [null, [-1, -1], [-1, 1], [1, 1], [1, -1] ],\n /**\n * @name Biltong.pointOnLine\n * @function\n * @desc Calculates a point on the line from `fromPoint` to `toPoint` that is `distance` units along the length of the line.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Point} Point on the line, in the form `{ x:..., y:... }`.\n */\n _pointOnLine = Biltong.pointOnLine = function(fromPoint, toPoint, distance) {\n var m = _gradient(fromPoint, toPoint),\n s = _quadrant(fromPoint, toPoint),\n segmentMultiplier = distance > 0 ? _segmentMultipliers[s] : _inverseSegmentMultipliers[s],\n theta = Math.atan(m),\n y = Math.abs(distance * Math.sin(theta)) * segmentMultiplier[1],\n x = Math.abs(distance * Math.cos(theta)) * segmentMultiplier[0];\n return { x:fromPoint.x + x, y:fromPoint.y + y };\n },\n /**\n * @name Biltong.perpendicularLineTo\n * @function\n * @desc Calculates a line of length `length` that is perpendicular to the line from `fromPoint` to `toPoint` and passes through `toPoint`.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Line} Perpendicular line, in the form `[ { x:..., y:... }, { x:..., y:... } ]`.\n */\n _perpendicularLineTo = Biltong.perpendicularLineTo = function(fromPoint, toPoint, length) {\n var m = _gradient(fromPoint, toPoint),\n theta2 = Math.atan(-1 / m),\n y = length / 2 * Math.sin(theta2),\n x = length / 2 * Math.cos(theta2);\n return [{x:toPoint.x + x, y:toPoint.y + y}, {x:toPoint.x - x, y:toPoint.y - y}];\n };\n}).call(typeof window !== 'undefined' ? window : this);\n;\n(function () {\n\n \"use strict\";\n\n /**\n * Creates a Touch object.\n * @param view\n * @param target\n * @param pageX\n * @param pageY\n * @param screenX\n * @param screenY\n * @param clientX\n * @param clientY\n * @returns {Touch}\n * @private\n */\n function _touch(view, target, pageX, pageY, screenX, screenY, clientX, clientY) {\n\n return new Touch({\n target:target,\n identifier:_uuid(),\n pageX: pageX,\n pageY: pageY,\n screenX: screenX,\n screenY: screenY,\n clientX: clientX || screenX,\n clientY: clientY || screenY\n });\n }\n\n /**\n * Create a synthetic touch list from the given list of Touch objects.\n * @returns {Array}\n * @private\n */\n function _touchList() {\n var list = [];\n Array.prototype.push.apply(list, arguments);\n list.item = function(index) { return this[index]; };\n return list;\n }\n\n /**\n * Create a Touch object and then insert it into a synthetic touch list, returning the list.s\n * @param view\n * @param target\n * @param pageX\n * @param pageY\n * @param screenX\n * @param screenY\n * @param clientX\n * @param clientY\n * @returns {Array}\n * @private\n */\n function _touchAndList(view, target, pageX, pageY, screenX, screenY, clientX, clientY) {\n return _touchList(_touch.apply(null, arguments));\n }\n\n var root = this,\n matchesSelector = function (el, selector, ctx) {\n ctx = ctx || el.parentNode;\n var possibles = ctx.querySelectorAll(selector);\n for (var i = 0; i < possibles.length; i++) {\n if (possibles[i] === el) {\n return true;\n }\n }\n return false;\n },\n _gel = function (el) {\n return (typeof el == \"string\" || el.constructor === String) ? document.getElementById(el) : el;\n },\n _t = function (e) {\n return e.srcElement || e.target;\n },\n //\n // gets path info for the given event - the path from target to obj, in the event's bubble chain. if doCompute\n // is false we just return target for the path.\n //\n _pi = function(e, target, obj, doCompute) {\n if (!doCompute) return { path:[target], end:1 };\n else if (typeof e.path !== \"undefined\" && e.path.indexOf) {\n return { path: e.path, end: e.path.indexOf(obj) };\n } else {\n var out = { path:[], end:-1 }, _one = function(el) {\n out.path.push(el);\n if (el === obj) {\n out.end = out.path.length - 1;\n }\n else if (el.parentNode != null) {\n _one(el.parentNode)\n }\n };\n _one(target);\n return out;\n }\n },\n _d = function (l, fn) {\n for (var i = 0, j = l.length; i < j; i++) {\n if (l[i] == fn) break;\n }\n if (i < l.length) l.splice(i, 1);\n },\n guid = 1,\n //\n // this function generates a guid for every handler, sets it on the handler, then adds\n // it to the associated object's map of handlers for the given event. this is what enables us\n // to unbind all events of some type, or all events (the second of which can be requested by the user,\n // but it also used by Mottle when an element is removed.)\n _store = function (obj, event, fn) {\n var g = guid++;\n obj.__ta = obj.__ta || {};\n obj.__ta[event] = obj.__ta[event] || {};\n // store each handler with a unique guid.\n obj.__ta[event][g] = fn;\n // set the guid on the handler.\n fn.__tauid = g;\n return g;\n },\n _unstore = function (obj, event, fn) {\n obj.__ta && obj.__ta[event] && delete obj.__ta[event][fn.__tauid];\n // a handler might have attached extra functions, so we unbind those too.\n if (fn.__taExtra) {\n for (var i = 0; i < fn.__taExtra.length; i++) {\n _unbind(obj, fn.__taExtra[i][0], fn.__taExtra[i][1]);\n }\n fn.__taExtra.length = 0;\n }\n // a handler might have attached an unstore callback\n fn.__taUnstore && fn.__taUnstore();\n },\n _curryChildFilter = function (children, obj, fn, evt) {\n if (children == null) return fn;\n else {\n var c = children.split(\",\"),\n _fn = function (e) {\n _fn.__tauid = fn.__tauid;\n var t = _t(e), target = t; // t is the target element on which the event occurred. it is the\n // element we will wish to pass to any callbacks.\n var pathInfo = _pi(e, t, obj, children != null)\n if (pathInfo.end != -1) {\n for (var p = 0; p < pathInfo.end; p++) {\n target = pathInfo.path[p];\n for (var i = 0; i < c.length; i++) {\n if (matchesSelector(target, c[i], obj)) {\n fn.apply(target, arguments);\n }\n }\n }\n }\n };\n registerExtraFunction(fn, evt, _fn);\n return _fn;\n }\n },\n //\n // registers an 'extra' function on some event listener function we were given - a function that we\n // created and bound to the element as part of our housekeeping, and which we want to unbind and remove\n // whenever the given function is unbound.\n registerExtraFunction = function (fn, evt, newFn) {\n fn.__taExtra = fn.__taExtra || [];\n fn.__taExtra.push([evt, newFn]);\n },\n DefaultHandler = function (obj, evt, fn, children) {\n if (isTouchDevice && touchMap[evt]) {\n var tfn = _curryChildFilter(children, obj, fn, touchMap[evt]);\n _bind(obj, touchMap[evt], tfn , fn);\n }\n if (evt === \"focus\" && obj.getAttribute(\"tabindex\") == null) {\n obj.setAttribute(\"tabindex\", \"1\");\n }\n _bind(obj, evt, _curryChildFilter(children, obj, fn, evt), fn);\n },\n SmartClickHandler = function (obj, evt, fn, children) {\n if (obj.__taSmartClicks == null) {\n var down = function (e) {\n obj.__tad = _pageLocation(e);\n },\n up = function (e) {\n obj.__tau = _pageLocation(e);\n },\n click = function (e) {\n if (obj.__tad && obj.__tau && obj.__tad[0] === obj.__tau[0] && obj.__tad[1] === obj.__tau[1]) {\n for (var i = 0; i < obj.__taSmartClicks.length; i++)\n obj.__taSmartClicks[i].apply(_t(e), [ e ]);\n }\n };\n DefaultHandler(obj, \"mousedown\", down, children);\n DefaultHandler(obj, \"mouseup\", up, children);\n DefaultHandler(obj, \"click\", click, children);\n obj.__taSmartClicks = [];\n }\n\n // store in the list of callbacks\n obj.__taSmartClicks.push(fn);\n // the unstore function removes this function from the object's listener list for this type.\n fn.__taUnstore = function () {\n _d(obj.__taSmartClicks, fn);\n };\n },\n _tapProfiles = {\n \"tap\": {touches: 1, taps: 1},\n \"dbltap\": {touches: 1, taps: 2},\n \"contextmenu\": {touches: 2, taps: 1}\n },\n TapHandler = function (clickThreshold, dblClickThreshold) {\n return function (obj, evt, fn, children) {\n // if event is contextmenu, for devices which are mouse only, we want to\n // use the default bind.\n if (evt == \"contextmenu\" && isMouseDevice)\n DefaultHandler(obj, evt, fn, children);\n else {\n // the issue here is that this down handler gets registered only for the\n // child nodes in the first registration. in fact it should be registered with\n // no child selector and then on down we should cycle through the registered\n // functions to see if one of them matches. on mouseup we should execute ALL of\n // the functions whose children are either null or match the element.\n if (obj.__taTapHandler == null) {\n var tt = obj.__taTapHandler = {\n tap: [],\n dbltap: [],\n contextmenu: [],\n down: false,\n taps: 0,\n downSelectors: []\n };\n var down = function (e) {\n var target = _t(e), pathInfo = _pi(e, target, obj, children != null), finished = false;\n for (var p = 0; p < pathInfo.end; p++) {\n if (finished) return;\n target = pathInfo.path[p];\n for (var i = 0; i < tt.downSelectors.length; i++) {\n if (tt.downSelectors[i] == null || matchesSelector(target, tt.downSelectors[i], obj)) {\n tt.down = true;\n setTimeout(clearSingle, clickThreshold);\n setTimeout(clearDouble, dblClickThreshold);\n finished = true;\n break; // we only need one match on mousedown\n }\n }\n }\n },\n up = function (e) {\n if (tt.down) {\n var target = _t(e), currentTarget, pathInfo;\n tt.taps++;\n var tc = _touchCount(e);\n for (var eventId in _tapProfiles) {\n if (_tapProfiles.hasOwnProperty(eventId)) {\n var p = _tapProfiles[eventId];\n if (p.touches === tc && (p.taps === 1 || p.taps === tt.taps)) {\n for (var i = 0; i < tt[eventId].length; i++) {\n pathInfo = _pi(e, target, obj, tt[eventId][i][1] != null);\n for (var pLoop = 0; pLoop < pathInfo.end; pLoop++) {\n currentTarget = pathInfo.path[pLoop];\n // this is a single event registration handler.\n if (tt[eventId][i][1] == null || matchesSelector(currentTarget, tt[eventId][i][1], obj)) {\n tt[eventId][i][0].apply(currentTarget, [ e ]);\n break;\n }\n }\n }\n }\n }\n }\n }\n },\n clearSingle = function () {\n tt.down = false;\n },\n clearDouble = function () {\n tt.taps = 0;\n };\n\n DefaultHandler(obj, \"mousedown\", down);\n DefaultHandler(obj, \"mouseup\", up);\n }\n // add this child selector (it can be null, that's fine).\n obj.__taTapHandler.downSelectors.push(children);\n\n obj.__taTapHandler[evt].push([fn, children]);\n // the unstore function removes this function from the object's listener list for this type.\n fn.__taUnstore = function () {\n _d(obj.__taTapHandler[evt], fn);\n };\n }\n };\n },\n meeHelper = function (type, evt, obj, target) {\n for (var i in obj.__tamee[type]) {\n if (obj.__tamee[type].hasOwnProperty(i)) {\n obj.__tamee[type][i].apply(target, [ evt ]);\n }\n }\n },\n MouseEnterExitHandler = function () {\n var activeElements = [];\n return function (obj, evt, fn, children) {\n if (!obj.__tamee) {\n // __tamee holds a flag saying whether the mouse is currently \"in\" the element, and a list of\n // both mouseenter and mouseexit functions.\n obj.__tamee = { over: false, mouseenter: [], mouseexit: [] };\n // register over and out functions\n var over = function (e) {\n var t = _t(e);\n if ((children == null && (t == obj && !obj.__tamee.over)) || (matchesSelector(t, children, obj) && (t.__tamee == null || !t.__tamee.over))) {\n meeHelper(\"mouseenter\", e, obj, t);\n t.__tamee = t.__tamee || {};\n t.__tamee.over = true;\n activeElements.push(t);\n }\n },\n out = function (e) {\n var t = _t(e);\n // is the current target one of the activeElements? and is the\n // related target NOT a descendant of it?\n for (var i = 0; i < activeElements.length; i++) {\n if (t == activeElements[i] && !matchesSelector((e.relatedTarget || e.toElement), \"*\", t)) {\n t.__tamee.over = false;\n activeElements.splice(i, 1);\n meeHelper(\"mouseexit\", e, obj, t);\n }\n }\n };\n\n _bind(obj, \"mouseover\", _curryChildFilter(children, obj, over, \"mouseover\"), over);\n _bind(obj, \"mouseout\", _curryChildFilter(children, obj, out, \"mouseout\"), out);\n }\n\n fn.__taUnstore = function () {\n delete obj.__tamee[evt][fn.__tauid];\n };\n\n _store(obj, evt, fn);\n obj.__tamee[evt][fn.__tauid] = fn;\n };\n },\n isTouchDevice = \"ontouchstart\" in document.documentElement,\n isMouseDevice = \"onmousedown\" in document.documentElement,\n touchMap = { \"mousedown\": \"touchstart\", \"mouseup\": \"touchend\", \"mousemove\": \"touchmove\" },\n touchstart = \"touchstart\", touchend = \"touchend\", touchmove = \"touchmove\",\n iev = (function () {\n var rv = -1;\n if (navigator.appName == 'Microsoft Internet Explorer') {\n var ua = navigator.userAgent,\n re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n return rv;\n })(),\n isIELT9 = iev > -1 && iev < 9,\n _genLoc = function (e, prefix) {\n if (e == null) return [ 0, 0 ];\n var ts = _touches(e), t = _getTouch(ts, 0);\n return [t[prefix + \"X\"], t[prefix + \"Y\"]];\n },\n _pageLocation = function (e) {\n if (e == null) return [ 0, 0 ];\n if (isIELT9) {\n return [ e.clientX + document.documentElement.scrollLeft, e.clientY + document.documentElement.scrollTop ];\n }\n else {\n return _genLoc(e, \"page\");\n }\n },\n _screenLocation = function (e) {\n return _genLoc(e, \"screen\");\n },\n _clientLocation = function (e) {\n return _genLoc(e, \"client\");\n },\n _getTouch = function (touches, idx) {\n return touches.item ? touches.item(idx) : touches[idx];\n },\n _touches = function (e) {\n return e.touches && e.touches.length > 0 ? e.touches :\n e.changedTouches && e.changedTouches.length > 0 ? e.changedTouches :\n e.targetTouches && e.targetTouches.length > 0 ? e.targetTouches :\n [ e ];\n },\n _touchCount = function (e) {\n return _touches(e).length;\n },\n //http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html\n _bind = function (obj, type, fn, originalFn) {\n _store(obj, type, fn);\n originalFn.__tauid = fn.__tauid;\n if (obj.addEventListener)\n obj.addEventListener(type, fn, false);\n else if (obj.attachEvent) {\n var key = type + fn.__tauid;\n obj[\"e\" + key] = fn;\n // TODO look at replacing with .call(..)\n obj[key] = function () {\n obj[\"e\" + key] && obj[\"e\" + key](window.event);\n };\n obj.attachEvent(\"on\" + type, obj[key]);\n }\n },\n _unbind = function (obj, type, fn) {\n if (fn == null) return;\n _each(obj, function () {\n var _el = _gel(this);\n _unstore(_el, type, fn);\n // it has been bound if there is a tauid. otherwise it was not bound and we can ignore it.\n if (fn.__tauid != null) {\n if (_el.removeEventListener) {\n _el.removeEventListener(type, fn, false);\n if (isTouchDevice && touchMap[type]) _el.removeEventListener(touchMap[type], fn, false);\n }\n else if (this.detachEvent) {\n var key = type + fn.__tauid;\n _el[key] && _el.detachEvent(\"on\" + type, _el[key]);\n _el[key] = null;\n _el[\"e\" + key] = null;\n }\n }\n\n // if a touch event was also registered, deregister now.\n if (fn.__taTouchProxy) {\n _unbind(obj, fn.__taTouchProxy[1], fn.__taTouchProxy[0]);\n }\n });\n },\n _each = function (obj, fn) {\n if (obj == null) return;\n // if a list (or list-like), use it. if a string, get a list\n // by running the string through querySelectorAll. else, assume\n // it's an Element.\n // obj.top is \"unknown\" in IE8.\n obj = (typeof Window !== \"undefined\" && (typeof obj.top !== \"unknown\" && obj == obj.top)) ? [ obj ] :\n (typeof obj !== \"string\") && (obj.tagName == null && obj.length != null) ? obj :\n typeof obj === \"string\" ? document.querySelectorAll(obj)\n : [ obj ];\n\n for (var i = 0; i < obj.length; i++)\n fn.apply(obj[i]);\n },\n _uuid = function () {\n return ('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n }));\n };\n\n /**\n * Mottle offers support for abstracting out the differences\n * between touch and mouse devices, plus \"smart click\" functionality\n * (don't fire click if the mouse has moved between mousedown and mouseup),\n * and synthesized click/tap events.\n * @class Mottle\n * @constructor\n * @param {Object} params Constructor params\n * @param {Number} [params.clickThreshold=250] Threshold, in milliseconds beyond which a touchstart followed by a touchend is not considered to be a click.\n * @param {Number} [params.dblClickThreshold=450] Threshold, in milliseconds beyond which two successive tap events are not considered to be a click.\n * @param {Boolean} [params.smartClicks=false] If true, won't fire click events if the mouse has moved between mousedown and mouseup. Note that this functionality\n * requires that Mottle consume the mousedown event, and so may not be viable in all use cases.\n */\n root.Mottle = function (params) {\n params = params || {};\n var clickThreshold = params.clickThreshold || 250,\n dblClickThreshold = params.dblClickThreshold || 450,\n mouseEnterExitHandler = new MouseEnterExitHandler(),\n tapHandler = new TapHandler(clickThreshold, dblClickThreshold),\n _smartClicks = params.smartClicks,\n _doBind = function (obj, evt, fn, children) {\n if (fn == null) return;\n _each(obj, function () {\n var _el = _gel(this);\n if (_smartClicks && evt === \"click\")\n SmartClickHandler(_el, evt, fn, children);\n else if (evt === \"tap\" || evt === \"dbltap\" || evt === \"contextmenu\") {\n tapHandler(_el, evt, fn, children);\n }\n else if (evt === \"mouseenter\" || evt == \"mouseexit\")\n mouseEnterExitHandler(_el, evt, fn, children);\n else\n DefaultHandler(_el, evt, fn, children);\n });\n };\n\n /**\n * Removes an element from the DOM, and deregisters all event handlers for it. You should use this\n * to ensure you don't leak memory.\n * @method remove\n * @param {String|Element} el Element, or id of the element, to remove.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.remove = function (el) {\n _each(el, function () {\n var _el = _gel(this);\n if (_el.__ta) {\n for (var evt in _el.__ta) {\n if (_el.__ta.hasOwnProperty(evt)) {\n for (var h in _el.__ta[evt]) {\n if (_el.__ta[evt].hasOwnProperty(h))\n _unbind(_el, evt, _el.__ta[evt][h]);\n }\n }\n }\n }\n _el.parentNode && _el.parentNode.removeChild(_el);\n });\n return this;\n };\n\n /**\n * Register an event handler, optionally as a delegate for some set of descendant elements. Note\n * that this method takes either 3 or 4 arguments - if you supply 3 arguments it is assumed you have\n * omitted the `children` parameter, and that the event handler should be bound directly to the given element.\n * @method on\n * @param {Element[]|Element|String} el Either an Element, or a CSS spec for a list of elements, or an array of Elements.\n * @param {String} [children] Comma-delimited list of selectors identifying allowed children.\n * @param {String} event Event ID.\n * @param {Function} fn Event handler function.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.on = function (el, event, children, fn) {\n var _el = arguments[0],\n _c = arguments.length == 4 ? arguments[2] : null,\n _e = arguments[1],\n _f = arguments[arguments.length - 1];\n\n _doBind(_el, _e, _f, _c);\n return this;\n };\n\n /**\n * Cancel delegate event handling for the given function. Note that unlike with 'on' you do not supply\n * a list of child selectors here: it removes event delegation from all of the child selectors for which the\n * given function was registered (if any).\n * @method off\n * @param {Element[]|Element|String} el Element - or ID of element - from which to remove event listener.\n * @param {String} event Event ID.\n * @param {Function} fn Event handler function.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.off = function (el, event, fn) {\n _unbind(el, event, fn);\n return this;\n };\n\n /**\n * Triggers some event for a given element.\n * @method trigger\n * @param {Element} el Element for which to trigger the event.\n * @param {String} event Event ID.\n * @param {Event} originalEvent The original event. Should be optional of course, but currently is not, due\n * to the jsPlumb use case that caused this method to be added.\n * @param {Object} [payload] Optional object to set as `payload` on the generated event; useful for message passing.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.trigger = function (el, event, originalEvent, payload) {\n // MouseEvent undefined in old IE; that's how we know it's a mouse event. A fine Microsoft paradox.\n var originalIsMouse = isMouseDevice && (typeof MouseEvent === \"undefined\" || originalEvent == null || originalEvent.constructor === MouseEvent);\n\n var eventToBind = (isTouchDevice && !isMouseDevice && touchMap[event]) ? touchMap[event] : event,\n bindingAMouseEvent = !(isTouchDevice && !isMouseDevice && touchMap[event]);\n\n var pl = _pageLocation(originalEvent), sl = _screenLocation(originalEvent), cl = _clientLocation(originalEvent);\n _each(el, function () {\n var _el = _gel(this), evt;\n originalEvent = originalEvent || {\n screenX: sl[0],\n screenY: sl[1],\n clientX: cl[0],\n clientY: cl[1]\n };\n\n var _decorate = function (_evt) {\n if (payload) _evt.payload = payload;\n };\n\n var eventGenerators = {\n \"TouchEvent\": function (evt) {\n\n var touchList = _touchAndList(window, _el, 0, pl[0], pl[1], sl[0], sl[1], cl[0], cl[1]),\n init = evt.initTouchEvent || evt.initEvent;\n\n init(eventToBind, true, true, window, null, sl[0], sl[1],\n cl[0], cl[1], false, false, false, false,\n touchList, touchList, touchList, 1, 0);\n },\n \"MouseEvents\": function (evt) {\n evt.initMouseEvent(eventToBind, true, true, window, 0,\n sl[0], sl[1],\n cl[0], cl[1],\n false, false, false, false, 1, _el);\n }\n };\n\n if (document.createEvent) {\n\n var ite = !bindingAMouseEvent && !originalIsMouse && (isTouchDevice && touchMap[event]),\n evtName = ite ? \"TouchEvent\" : \"MouseEvents\";\n\n evt = document.createEvent(evtName);\n eventGenerators[evtName](evt);\n _decorate(evt);\n _el.dispatchEvent(evt);\n }\n else if (document.createEventObject) {\n evt = document.createEventObject();\n evt.eventType = evt.eventName = eventToBind;\n evt.screenX = sl[0];\n evt.screenY = sl[1];\n evt.clientX = cl[0];\n evt.clientY = cl[1];\n _decorate(evt);\n _el.fireEvent('on' + eventToBind, evt);\n }\n });\n return this;\n }\n };\n\n /**\n * Static method to assist in 'consuming' an element: uses `stopPropagation` where available, or sets\n * `e.returnValue=false` where it is not.\n * @method Mottle.consume\n * @param {Event} e Event to consume\n * @param {Boolean} [doNotPreventDefault=false] If true, does not call `preventDefault()` on the event.\n */\n root.Mottle.consume = function (e, doNotPreventDefault) {\n if (e.stopPropagation)\n e.stopPropagation();\n else\n e.returnValue = false;\n\n if (!doNotPreventDefault && e.preventDefault)\n e.preventDefault();\n };\n\n /**\n * Gets the page location corresponding to the given event. For touch events this means get the page location of the first touch.\n * @method Mottle.pageLocation\n * @param {Event} e Event to get page location for.\n * @return {Number[]} [left, top] for the given event.\n */\n root.Mottle.pageLocation = _pageLocation;\n\n /**\n * Forces touch events to be turned \"on\". Useful for testing: even if you don't have a touch device, you can still\n * trigger a touch event when this is switched on and it will be captured and acted on.\n * @method setForceTouchEvents\n * @param {Boolean} value If true, force touch events to be on.\n */\n root.Mottle.setForceTouchEvents = function (value) {\n isTouchDevice = value;\n };\n\n /**\n * Forces mouse events to be turned \"on\". Useful for testing: even if you don't have a mouse, you can still\n * trigger a mouse event when this is switched on and it will be captured and acted on.\n * @method setForceMouseEvents\n * @param {Boolean} value If true, force mouse events to be on.\n */\n root.Mottle.setForceMouseEvents = function (value) {\n isMouseDevice = value;\n };\n\n root.Mottle.version = \"0.8.0\";\n\n if (typeof exports !== \"undefined\") {\n exports.Mottle = root.Mottle;\n }\n\n}).call(typeof window === \"undefined\" ? this : window);\n\n/**\n drag/drop functionality for use with jsPlumb but with\n no knowledge of jsPlumb. supports multiple scopes (separated by whitespace), dragging\n multiple elements, constrain to parent, drop filters, drag start filters, custom\n css classes.\n\n a lot of the functionality of this script is expected to be plugged in:\n\n addClass\n removeClass\n\n addEvent\n removeEvent\n\n getPosition\n setPosition\n getSize\n\n indexOf\n intersects\n\n the name came from here:\n\n http://mrsharpoblunto.github.io/foswig.js/\n\n copyright 2016 jsPlumb\n */\n\n;(function() {\n\n \"use strict\";\n var root = this;\n\n var _suggest = function(list, item, head) {\n if (list.indexOf(item) === -1) {\n head ? list.unshift(item) : list.push(item);\n return true;\n }\n return false;\n };\n\n var _vanquish = function(list, item) {\n var idx = list.indexOf(item);\n if (idx !== -1) list.splice(idx, 1);\n };\n\n var _difference = function(l1, l2) {\n var d = [];\n for (var i = 0; i < l1.length; i++) {\n if (l2.indexOf(l1[i]) === -1)\n d.push(l1[i]);\n }\n return d;\n };\n\n var _isString = function(f) {\n return f == null ? false : (typeof f === \"string\" || f.constructor === String);\n };\n\n var getOffsetRect = function (elem) {\n // (1)\n var box = elem.getBoundingClientRect(),\n body = document.body,\n docElem = document.documentElement,\n // (2)\n scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop,\n scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft,\n // (3)\n clientTop = docElem.clientTop || body.clientTop || 0,\n clientLeft = docElem.clientLeft || body.clientLeft || 0,\n // (4)\n top = box.top + scrollTop - clientTop,\n left = box.left + scrollLeft - clientLeft;\n\n return { top: Math.round(top), left: Math.round(left) };\n };\n\n var matchesSelector = function(el, selector, ctx) {\n ctx = ctx || el.parentNode;\n var possibles = ctx.querySelectorAll(selector);\n for (var i = 0; i < possibles.length; i++) {\n if (possibles[i] === el)\n return true;\n }\n return false;\n };\n\n var findDelegateElement = function(parentElement, childElement, selector) {\n if (matchesSelector(childElement, selector, parentElement)) {\n return childElement;\n } else {\n var currentParent = childElement.parentNode;\n while (currentParent != null && currentParent !== parentElement) {\n if (matchesSelector(currentParent, selector, parentElement)) {\n return currentParent;\n } else {\n currentParent = currentParent.parentNode;\n }\n }\n }\n };\n\n var iev = (function() {\n var rv = -1;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var ua = navigator.userAgent,\n re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n return rv;\n })(),\n DEFAULT_GRID_X = 10,\n DEFAULT_GRID_Y = 10,\n isIELT9 = iev > -1 && iev < 9,\n isIE9 = iev === 9,\n _pl = function(e) {\n if (isIELT9) {\n return [ e.clientX + document.documentElement.scrollLeft, e.clientY + document.documentElement.scrollTop ];\n }\n else {\n var ts = _touches(e), t = _getTouch(ts, 0);\n // for IE9 pageX might be null if the event was synthesized. We try for pageX/pageY first,\n // falling back to clientX/clientY if necessary. In every other browser we want to use pageX/pageY.\n return isIE9 ? [t.pageX || t.clientX, t.pageY || t.clientY] : [t.pageX, t.pageY];\n }\n },\n _getTouch = function(touches, idx) { return touches.item ? touches.item(idx) : touches[idx]; },\n _touches = function(e) {\n return e.touches && e.touches.length > 0 ? e.touches :\n e.changedTouches && e.changedTouches.length > 0 ? e.changedTouches :\n e.targetTouches && e.targetTouches.length > 0 ? e.targetTouches :\n [ e ];\n },\n _classes = {\n draggable:\"katavorio-draggable\", // draggable elements\n droppable:\"katavorio-droppable\", // droppable elements\n drag : \"katavorio-drag\", // elements currently being dragged\n selected:\"katavorio-drag-selected\", // elements in current drag selection\n active : \"katavorio-drag-active\", // droppables that are targets of a currently dragged element\n hover : \"katavorio-drag-hover\", // droppables over which a matching drag element is hovering\n noSelect : \"katavorio-drag-no-select\", // added to the body to provide a hook to suppress text selection\n ghostProxy:\"katavorio-ghost-proxy\", // added to a ghost proxy element in use when a drag has exited the bounds of its parent.\n clonedDrag:\"katavorio-clone-drag\" // added to a node that is a clone of an element created at the start of a drag\n },\n _defaultScope = \"katavorio-drag-scope\",\n _events = [ \"stop\", \"start\", \"drag\", \"drop\", \"over\", \"out\", \"beforeStart\" ],\n _devNull = function() {},\n _true = function() { return true; },\n _foreach = function(l, fn, from) {\n for (var i = 0; i < l.length; i++) {\n if (l[i] != from)\n fn(l[i]);\n }\n },\n _setDroppablesActive = function(dd, val, andHover, drag) {\n _foreach(dd, function(e) {\n e.setActive(val);\n if (val) e.updatePosition();\n if (andHover) e.setHover(drag, val);\n });\n },\n _each = function(obj, fn) {\n if (obj == null) return;\n obj = !_isString(obj) && (obj.tagName == null && obj.length != null) ? obj : [ obj ];\n for (var i = 0; i < obj.length; i++)\n fn.apply(obj[i], [ obj[i] ]);\n },\n _consume = function(e) {\n if (e.stopPropagation) {\n e.stopPropagation();\n e.preventDefault();\n }\n else {\n e.returnValue = false;\n }\n },\n _defaultInputFilterSelector = \"input,textarea,select,button,option\",\n //\n // filters out events on all input elements, like textarea, checkbox, input, select.\n _inputFilter = function(e, el, _katavorio) {\n var t = e.srcElement || e.target;\n return !matchesSelector(t, _katavorio.getInputFilterSelector(), el);\n };\n\n var Super = function(el, params, css, scope) {\n this.params = params || {};\n this.el = el;\n this.params.addClass(this.el, this._class);\n this.uuid = _uuid();\n var enabled = true;\n this.setEnabled = function(e) { enabled = e; };\n this.isEnabled = function() { return enabled; };\n this.toggleEnabled = function() { enabled = !enabled; };\n this.setScope = function(scopes) {\n this.scopes = scopes ? scopes.split(/\\s+/) : [ scope ];\n };\n this.addScope = function(scopes) {\n var m = {};\n _each(this.scopes, function(s) { m[s] = true;});\n _each(scopes ? scopes.split(/\\s+/) : [], function(s) { m[s] = true;});\n this.scopes = [];\n for (var i in m) this.scopes.push(i);\n };\n this.removeScope = function(scopes) {\n var m = {};\n _each(this.scopes, function(s) { m[s] = true;});\n _each(scopes ? scopes.split(/\\s+/) : [], function(s) { delete m[s];});\n this.scopes = [];\n for (var i in m) this.scopes.push(i);\n };\n this.toggleScope = function(scopes) {\n var m = {};\n _each(this.scopes, function(s) { m[s] = true;});\n _each(scopes ? scopes.split(/\\s+/) : [], function(s) {\n if (m[s]) delete m[s];\n else m[s] = true;\n });\n this.scopes = [];\n for (var i in m) this.scopes.push(i);\n };\n this.setScope(params.scope);\n this.k = params.katavorio;\n return params.katavorio;\n };\n\n var TRUE = function() { return true; };\n var FALSE = function() { return false; };\n\n var Drag = function(el, params, css, scope) {\n this._class = css.draggable;\n var k = Super.apply(this, arguments);\n this.rightButtonCanDrag = this.params.rightButtonCanDrag;\n var downAt = [0,0], posAtDown = null, pagePosAtDown = null, pageDelta = [0,0], moving = false, initialScroll = [0,0],\n consumeStartEvent = this.params.consumeStartEvent !== false,\n dragEl = this.el,\n clone = this.params.clone,\n scroll = this.params.scroll,\n _multipleDrop = params.multipleDrop !== false,\n isConstrained = false,\n useGhostProxy = params.ghostProxy === true ? TRUE : params.ghostProxy && typeof params.ghostProxy === \"function\" ? params.ghostProxy : FALSE,\n ghostProxy = function(el) { return el.cloneNode(true); },\n selector = params.selector,\n elementToDrag = null;\n\n var snapThreshold = params.snapThreshold,\n _snap = function(pos, gridX, gridY, thresholdX, thresholdY) {\n var _dx = Math.floor(pos[0] / gridX),\n _dxl = gridX * _dx,\n _dxt = _dxl + gridX,\n _x = Math.abs(pos[0] - _dxl) <= thresholdX ? _dxl : Math.abs(_dxt - pos[0]) <= thresholdX ? _dxt : pos[0];\n\n var _dy = Math.floor(pos[1] / gridY),\n _dyl = gridY * _dy,\n _dyt = _dyl + gridY,\n _y = Math.abs(pos[1] - _dyl) <= thresholdY ? _dyl : Math.abs(_dyt - pos[1]) <= thresholdY ? _dyt : pos[1];\n\n return [ _x, _y];\n };\n\n this.posses = [];\n this.posseRoles = {};\n\n this.toGrid = function(pos) {\n if (this.params.grid == null) {\n return pos;\n }\n else {\n var tx = this.params.grid ? this.params.grid[0] / 2 : snapThreshold ? snapThreshold : DEFAULT_GRID_X / 2,\n ty = this.params.grid ? this.params.grid[1] / 2 : snapThreshold ? snapThreshold : DEFAULT_GRID_Y / 2;\n\n return _snap(pos, this.params.grid[0], this.params.grid[1], tx, ty);\n }\n };\n\n this.snap = function(x, y) {\n if (dragEl == null) return;\n x = x || (this.params.grid ? this.params.grid[0] : DEFAULT_GRID_X);\n y = y || (this.params.grid ? this.params.grid[1] : DEFAULT_GRID_Y);\n var p = this.params.getPosition(dragEl),\n tx = this.params.grid ? this.params.grid[0] / 2 : snapThreshold,\n ty = this.params.grid ? this.params.grid[1] / 2 : snapThreshold;\n\n this.params.setPosition(dragEl, _snap(p, x, y, tx, ty));\n };\n\n this.setUseGhostProxy = function(val) {\n useGhostProxy = val ? TRUE : FALSE;\n };\n\n var constrain;\n var negativeFilter = function(pos) {\n return (params.allowNegative === false) ? [ Math.max (0, pos[0]), Math.max(0, pos[1]) ] : pos;\n };\n\n var _setConstrain = function(value) {\n constrain = typeof value === \"function\" ? value : value ? function(pos, dragEl, _constrainRect, _size) {\n return negativeFilter([\n Math.max(0, Math.min(_constrainRect.w - _size[0], pos[0])),\n Math.max(0, Math.min(_constrainRect.h - _size[1], pos[1]))\n ]);\n }.bind(this) : function(pos) { return negativeFilter(pos); };\n }.bind(this);\n\n _setConstrain(typeof this.params.constrain === \"function\" ? this.params.constrain : (this.params.constrain || this.params.containment));\n\n\n /**\n * Sets whether or not the Drag is constrained. A value of 'true' means constrain to parent bounds; a function\n * will be executed and returns true if the position is allowed.\n * @param value\n */\n this.setConstrain = function(value) {\n _setConstrain(value);\n };\n\n var revertFunction;\n /**\n * Sets a function to call on drag stop, which, if it returns true, indicates that the given element should\n * revert to its position before the previous drag.\n * @param fn\n */\n this.setRevert = function(fn) {\n revertFunction = fn;\n };\n\n var _assignId = function(obj) {\n if (typeof obj === \"function\") {\n obj._katavorioId = _uuid();\n return obj._katavorioId;\n } else {\n return obj;\n }\n },\n // a map of { spec -> [ fn, exclusion ] } entries.\n _filters = {},\n _testFilter = function(e) {\n for (var key in _filters) {\n var f = _filters[key];\n var rv = f[0](e);\n if (f[1]) rv = !rv;\n if (!rv) return false;\n }\n return true;\n },\n _setFilter = this.setFilter = function(f, _exclude) {\n if (f) {\n var key = _assignId(f);\n _filters[key] = [\n function(e) {\n var t = e.srcElement || e.target, m;\n if (_isString(f)) {\n m = matchesSelector(t, f, el);\n }\n else if (typeof f === \"function\") {\n m = f(e, el);\n }\n return m;\n },\n _exclude !== false\n ];\n\n }\n },\n _addFilter = this.addFilter = _setFilter,\n _removeFilter = this.removeFilter = function(f) {\n var key = typeof f === \"function\" ? f._katavorioId : f;\n delete _filters[key];\n };\n\n this.clearAllFilters = function() {\n _filters = {};\n };\n\n this.canDrag = this.params.canDrag || _true;\n\n var constrainRect,\n matchingDroppables = [],\n intersectingDroppables = [];\n\n this.downListener = function(e) {\n var isNotRightClick = this.rightButtonCanDrag || (e.which !== 3 && e.button !== 2);\n if (isNotRightClick && this.isEnabled() && this.canDrag()) {\n\n var _f = _testFilter(e) && _inputFilter(e, this.el, this.k);\n if (_f) {\n\n if (selector) {\n elementToDrag = findDelegateElement(this.el, e.target || e.srcElement, selector);\n if(elementToDrag == null) {\n return;\n }\n }\n else {\n elementToDrag = this.el;\n }\n\n if (clone) {\n dragEl = elementToDrag.cloneNode(true);\n this.params.addClass(dragEl, _classes.clonedDrag);\n\n dragEl.setAttribute(\"id\", null);\n dragEl.style.position = \"absolute\";\n\n if (this.params.parent != null) {\n var p = this.params.getPosition(this.el);\n dragEl.style.left = p[0] + \"px\";\n dragEl.style.top = p[1] + \"px\";\n this.params.parent.appendChild(dragEl);\n } else {\n // the clone node is added to the body; getOffsetRect gives us a value\n // relative to the body.\n var b = getOffsetRect(elementToDrag);\n dragEl.style.left = b.left + \"px\";\n dragEl.style.top = b.top + \"px\";\n\n document.body.appendChild(dragEl);\n }\n\n } else {\n dragEl = elementToDrag;\n }\n\n consumeStartEvent && _consume(e);\n downAt = _pl(e);\n if (dragEl && dragEl.parentNode)\n {\n initialScroll = [dragEl.parentNode.scrollLeft, dragEl.parentNode.scrollTop];\n }\n //\n this.params.bind(document, \"mousemove\", this.moveListener);\n this.params.bind(document, \"mouseup\", this.upListener);\n k.markSelection(this);\n k.markPosses(this);\n this.params.addClass(document.body, css.noSelect);\n _dispatch(\"beforeStart\", {el:this.el, pos:posAtDown, e:e, drag:this});\n }\n else if (this.params.consumeFilteredEvents) {\n _consume(e);\n }\n }\n }.bind(this);\n\n this.moveListener = function(e) {\n if (downAt) {\n if (!moving) {\n var _continue = _dispatch(\"start\", {el:this.el, pos:posAtDown, e:e, drag:this});\n if (_continue !== false) {\n if (!downAt) {\n return;\n }\n this.mark(true);\n moving = true;\n } else {\n this.abort();\n }\n }\n\n // it is possible that the start event caused the drag to be aborted. So we check\n // again that we are currently dragging.\n if (downAt) {\n intersectingDroppables.length = 0;\n var pos = _pl(e), dx = pos[0] - downAt[0], dy = pos[1] - downAt[1],\n z = this.params.ignoreZoom ? 1 : k.getZoom();\n if (dragEl && dragEl.parentNode)\n {\n dx += dragEl.parentNode.scrollLeft - initialScroll[0];\n dy += dragEl.parentNode.scrollTop - initialScroll[1];\n }\n dx /= z;\n dy /= z;\n this.moveBy(dx, dy, e);\n k.updateSelection(dx, dy, this);\n k.updatePosses(dx, dy, this);\n }\n }\n }.bind(this);\n\n this.upListener = function(e) {\n if (downAt) {\n downAt = null;\n this.params.unbind(document, \"mousemove\", this.moveListener);\n this.params.unbind(document, \"mouseup\", this.upListener);\n this.params.removeClass(document.body, css.noSelect);\n this.unmark(e);\n k.unmarkSelection(this, e);\n k.unmarkPosses(this, e);\n this.stop(e);\n\n //k.notifySelectionDragStop(this, e); removed in 1.1.0 under the \"leave it for one release in case it breaks\" rule.\n // it isnt necessary to fire this as the normal stop event now includes a `selection` member that has every dragged element.\n // firing this event causes consumers who use the `selection` array to process a lot more drag stop events than is necessary\n\n k.notifyPosseDragStop(this, e);\n moving = false;\n if (clone) {\n dragEl && dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n dragEl = null;\n }\n\n intersectingDroppables.length = 0;\n\n if (revertFunction && revertFunction(this.el, this.params.getPosition(this.el)) === true) {\n this.params.setPosition(this.el, posAtDown);\n _dispatch(\"revert\", this.el);\n }\n }\n }.bind(this);\n\n this.getFilters = function() { return _filters; };\n\n this.abort = function() {\n if (downAt != null) {\n this.upListener();\n }\n };\n\n /**\n * Returns the element that was last dragged. This may be some original element from the DOM, or if `clone` is\n * set, then its actually a copy of some original DOM element. In some client calls to this method, it is the\n * actual element that was dragged that is desired. In others, it is the original DOM element that the user\n * wishes to get - in which case, pass true for `retrieveOriginalElement`.\n *\n * @returns {*}\n */\n this.getDragElement = function(retrieveOriginalElement) {\n return retrieveOriginalElement ? elementToDrag || this.el : dragEl || this.el;\n };\n\n var listeners = {\"start\":[], \"drag\":[], \"stop\":[], \"over\":[], \"out\":[], \"beforeStart\":[], \"revert\":[] };\n if (params.events.start) listeners.start.push(params.events.start);\n if (params.events.beforeStart) listeners.beforeStart.push(params.events.beforeStart);\n if (params.events.stop) listeners.stop.push(params.events.stop);\n if (params.events.drag) listeners.drag.push(params.events.drag);\n if (params.events.revert) listeners.revert.push(params.events.revert);\n\n this.on = function(evt, fn) {\n if (listeners[evt]) listeners[evt].push(fn);\n };\n\n this.off = function(evt, fn) {\n if (listeners[evt]) {\n var l = [];\n for (var i = 0; i < listeners[evt].length; i++) {\n if (listeners[evt][i] !== fn) l.push(listeners[evt][i]);\n }\n listeners[evt] = l;\n }\n };\n\n var _dispatch = function(evt, value) {\n var result = null;\n if (listeners[evt]) {\n for (var i = 0; i < listeners[evt].length; i++) {\n try {\n var v = listeners[evt][i](value);\n if (v != null) {\n result = v;\n }\n }\n catch (e) { }\n }\n }\n return result;\n };\n\n this.notifyStart = function(e) {\n _dispatch(\"start\", {el:this.el, pos:this.params.getPosition(dragEl), e:e, drag:this});\n };\n\n this.stop = function(e, force) {\n if (force || moving) {\n var positions = [],\n sel = k.getSelection(),\n dPos = this.params.getPosition(dragEl);\n\n if (sel.length > 1) {\n for (var i = 0; i < sel.length; i++) {\n var p = this.params.getPosition(sel[i].el);\n positions.push([ sel[i].el, { left: p[0], top: p[1] }, sel[i] ]);\n }\n }\n else {\n positions.push([ dragEl, {left:dPos[0], top:dPos[1]}, this ]);\n }\n\n _dispatch(\"stop\", {\n el: dragEl,\n pos: ghostProxyOffsets || dPos,\n finalPos:dPos,\n e: e,\n drag: this,\n selection:positions\n });\n }\n };\n\n this.mark = function(andNotify) {\n posAtDown = this.params.getPosition(dragEl);\n pagePosAtDown = this.params.getPosition(dragEl, true);\n pageDelta = [pagePosAtDown[0] - posAtDown[0], pagePosAtDown[1] - posAtDown[1]];\n this.size = this.params.getSize(dragEl);\n matchingDroppables = k.getMatchingDroppables(this);\n _setDroppablesActive(matchingDroppables, true, false, this);\n this.params.addClass(dragEl, this.params.dragClass || css.drag);\n\n var cs;\n if (this.params.getConstrainingRectangle) {\n cs = this.params.getConstrainingRectangle(dragEl)\n } else {\n cs = this.params.getSize(dragEl.parentNode);\n }\n constrainRect = {w: cs[0], h: cs[1]};\n\n if (andNotify) {\n k.notifySelectionDragStart(this);\n }\n };\n var ghostProxyOffsets;\n this.unmark = function(e, doNotCheckDroppables) {\n _setDroppablesActive(matchingDroppables, false, true, this);\n\n if (isConstrained && useGhostProxy(elementToDrag)) {\n ghostProxyOffsets = [dragEl.offsetLeft, dragEl.offsetTop];\n elementToDrag.parentNode.removeChild(dragEl);\n dragEl = elementToDrag;\n }\n else {\n ghostProxyOffsets = null;\n }\n\n this.params.removeClass(dragEl, this.params.dragClass || css.drag);\n matchingDroppables.length = 0;\n isConstrained = false;\n if (!doNotCheckDroppables) {\n if (intersectingDroppables.length > 0 && ghostProxyOffsets) {\n params.setPosition(elementToDrag, ghostProxyOffsets);\n }\n intersectingDroppables.sort(_rankSort);\n for (var i = 0; i < intersectingDroppables.length; i++) {\n var retVal = intersectingDroppables[i].drop(this, e);\n if (retVal === true) break;\n }\n }\n };\n this.moveBy = function(dx, dy, e) {\n intersectingDroppables.length = 0;\n var desiredLoc = this.toGrid([posAtDown[0] + dx, posAtDown[1] + dy]),\n cPos = constrain(desiredLoc, dragEl, constrainRect, this.size);\n\n if (useGhostProxy(this.el)) {\n if (desiredLoc[0] !== cPos[0] || desiredLoc[1] !== cPos[1]) {\n if (!isConstrained) {\n var gp = ghostProxy(elementToDrag);\n params.addClass(gp, _classes.ghostProxy);\n elementToDrag.parentNode.appendChild(gp);\n dragEl = gp;\n isConstrained = true;\n }\n cPos = desiredLoc;\n }\n else {\n if (isConstrained) {\n elementToDrag.parentNode.removeChild(dragEl);\n dragEl = elementToDrag;\n isConstrained = false;\n }\n }\n }\n\n var rect = { x:cPos[0], y:cPos[1], w:this.size[0], h:this.size[1]},\n pageRect = { x:rect.x + pageDelta[0], y:rect.y + pageDelta[1], w:rect.w, h:rect.h},\n focusDropElement = null;\n\n this.params.setPosition(dragEl, cPos);\n for (var i = 0; i < matchingDroppables.length; i++) {\n var r2 = { x:matchingDroppables[i].pagePosition[0], y:matchingDroppables[i].pagePosition[1], w:matchingDroppables[i].size[0], h:matchingDroppables[i].size[1]};\n if (this.params.intersects(pageRect, r2) && (_multipleDrop || focusDropElement == null || focusDropElement === matchingDroppables[i].el) && matchingDroppables[i].canDrop(this)) {\n if (!focusDropElement) focusDropElement = matchingDroppables[i].el;\n intersectingDroppables.push(matchingDroppables[i]);\n matchingDroppables[i].setHover(this, true, e);\n }\n else if (matchingDroppables[i].isHover()) {\n matchingDroppables[i].setHover(this, false, e);\n }\n }\n\n _dispatch(\"drag\", {el:this.el, pos:cPos, e:e, drag:this});\n\n /* test to see if the parent needs to be scrolled (future)\n if (scroll) {\n var pnsl = dragEl.parentNode.scrollLeft, pnst = dragEl.parentNode.scrollTop;\n console.log(\"scroll!\", pnsl, pnst);\n }*/\n };\n this.destroy = function() {\n this.params.unbind(this.el, \"mousedown\", this.downListener);\n this.params.unbind(document, \"mousemove\", this.moveListener);\n this.params.unbind(document, \"mouseup\", this.upListener);\n this.downListener = null;\n this.upListener = null;\n this.moveListener = null;\n };\n\n // init:register mousedown, and perhaps set a filter\n this.params.bind(this.el, \"mousedown\", this.downListener);\n\n // if handle provded, use that. otherwise, try to set a filter.\n // note that a `handle` selector always results in filterExclude being set to false, ie.\n // the selector defines the handle element(s).\n if (this.params.handle)\n _setFilter(this.params.handle, false);\n else\n _setFilter(this.params.filter, this.params.filterExclude);\n };\n\n var Drop = function(el, params, css, scope) {\n this._class = css.droppable;\n this.params = params || {};\n this.rank = params.rank || 0;\n this._activeClass = this.params.activeClass || css.active;\n this._hoverClass = this.params.hoverClass || css.hover;\n Super.apply(this, arguments);\n var hover = false;\n this.allowLoopback = this.params.allowLoopback !== false;\n\n this.setActive = function(val) {\n this.params[val ? \"addClass\" : \"removeClass\"](this.el, this._activeClass);\n };\n\n this.updatePosition = function() {\n this.position = this.params.getPosition(this.el);\n this.pagePosition = this.params.getPosition(this.el, true);\n this.size = this.params.getSize(this.el);\n };\n\n this.canDrop = this.params.canDrop || function(drag) {\n return true;\n };\n\n this.isHover = function() { return hover; };\n\n this.setHover = function(drag, val, e) {\n // if turning off hover but this was not the drag that caused the hover, ignore.\n if (val || this.el._katavorioDragHover == null || this.el._katavorioDragHover === drag.el._katavorio) {\n this.params[val ? \"addClass\" : \"removeClass\"](this.el, this._hoverClass);\n this.el._katavorioDragHover = val ? drag.el._katavorio : null;\n if (hover !== val) {\n this.params.events[val ? \"over\" : \"out\"]({el: this.el, e: e, drag: drag, drop: this});\n }\n hover = val;\n }\n };\n\n /**\n * A drop event. `drag` is the corresponding Drag object, which may be a Drag for some specific element, or it\n * may be a Drag on some element acting as a delegate for elements contained within it.\n * @param drag\n * @param event\n * @returns {*}\n */\n this.drop = function(drag, event) {\n return this.params.events[\"drop\"]({ drag:drag, e:event, drop:this });\n };\n\n this.destroy = function() {\n this._class = null;\n this._activeClass = null;\n this._hoverClass = null;\n hover = null;\n };\n };\n\n var _uuid = function() {\n return ('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random()*16|0, v = c === 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n }));\n };\n\n var _rankSort = function(a,b) {\n return a.rank < b.rank ? 1 : a.rank > b.rank ? -1 : 0;\n };\n\n var _gel = function(el) {\n if (el == null) return null;\n el = (typeof el === \"string\" || el.constructor === String) ? document.getElementById(el) : el;\n if (el == null) return null;\n el._katavorio = el._katavorio || _uuid();\n return el;\n };\n\n root.Katavorio = function(katavorioParams) {\n\n var _selection = [],\n _selectionMap = {};\n\n this._dragsByScope = {};\n this._dropsByScope = {};\n var _zoom = 1,\n _reg = function(obj, map) {\n _each(obj, function(_obj) {\n for(var i = 0; i < _obj.scopes.length; i++) {\n map[_obj.scopes[i]] = map[_obj.scopes[i]] || [];\n map[_obj.scopes[i]].push(_obj);\n }\n });\n },\n _unreg = function(obj, map) {\n var c = 0;\n _each(obj, function(_obj) {\n for(var i = 0; i < _obj.scopes.length; i++) {\n if (map[_obj.scopes[i]]) {\n var idx = katavorioParams.indexOf(map[_obj.scopes[i]], _obj);\n if (idx !== -1) {\n map[_obj.scopes[i]].splice(idx, 1);\n c++;\n }\n }\n }\n });\n\n return c > 0 ;\n },\n _getMatchingDroppables = this.getMatchingDroppables = function(drag) {\n var dd = [], _m = {};\n for (var i = 0; i < drag.scopes.length; i++) {\n var _dd = this._dropsByScope[drag.scopes[i]];\n if (_dd) {\n for (var j = 0; j < _dd.length; j++) {\n if (_dd[j].canDrop(drag) && !_m[_dd[j].uuid] && (_dd[j].allowLoopback || _dd[j].el !== drag.el)) {\n _m[_dd[j].uuid] = true;\n dd.push(_dd[j]);\n }\n }\n }\n }\n dd.sort(_rankSort);\n return dd;\n },\n _prepareParams = function(p) {\n p = p || {};\n var _p = {\n events:{}\n }, i;\n for (i in katavorioParams) _p[i] = katavorioParams[i];\n for (i in p) _p[i] = p[i];\n // events\n\n for (i = 0; i < _events.length; i++) {\n _p.events[_events[i]] = p[_events[i]] || _devNull;\n }\n _p.katavorio = this;\n return _p;\n }.bind(this),\n _mistletoe = function(existingDrag, params) {\n for (var i = 0; i < _events.length; i++) {\n if (params[_events[i]]) {\n existingDrag.on(_events[i], params[_events[i]]);\n }\n }\n }.bind(this),\n _css = {},\n overrideCss = katavorioParams.css || {},\n _scope = katavorioParams.scope || _defaultScope;\n\n // prepare map of css classes based on defaults frst, then optional overrides\n for (var i in _classes) _css[i] = _classes[i];\n for (var i in overrideCss) _css[i] = overrideCss[i];\n\n var inputFilterSelector = katavorioParams.inputFilterSelector || _defaultInputFilterSelector;\n /**\n * Gets the selector identifying which input elements to filter from drag events.\n * @method getInputFilterSelector\n * @return {String} Current input filter selector.\n */\n this.getInputFilterSelector = function() { return inputFilterSelector; };\n\n /**\n * Sets the selector identifying which input elements to filter from drag events.\n * @method setInputFilterSelector\n * @param {String} selector Input filter selector to set.\n * @return {Katavorio} Current instance; method may be chained.\n */\n this.setInputFilterSelector = function(selector) {\n inputFilterSelector = selector;\n return this;\n };\n\n /**\n * Either makes the given element draggable, or identifies it as an element inside which some identified list\n * of elements may be draggable.\n * @param el\n * @param params\n * @returns {Array}\n */\n this.draggable = function(el, params) {\n var o = [];\n _each(el, function (_el) {\n _el = _gel(_el);\n if (_el != null) {\n if (_el._katavorioDrag == null) {\n var p = _prepareParams(params);\n _el._katavorioDrag = new Drag(_el, p, _css, _scope);\n _reg(_el._katavorioDrag, this._dragsByScope);\n o.push(_el._katavorioDrag);\n katavorioParams.addClass(_el, _css.draggable);\n }\n else {\n _mistletoe(_el._katavorioDrag, params);\n }\n }\n }.bind(this));\n return o;\n };\n\n this.droppable = function(el, params) {\n var o = [];\n _each(el, function(_el) {\n _el = _gel(_el);\n if (_el != null) {\n var drop = new Drop(_el, _prepareParams(params), _css, _scope);\n _el._katavorioDrop = _el._katavorioDrop || [];\n _el._katavorioDrop.push(drop);\n _reg(drop, this._dropsByScope);\n o.push(drop);\n katavorioParams.addClass(_el, _css.droppable);\n }\n }.bind(this));\n return o;\n };\n\n /**\n * @name Katavorio#select\n * @function\n * @desc Adds an element to the current selection (for multiple node drag)\n * @param {Element|String} DOM element - or id of the element - to add.\n */\n this.select = function(el) {\n _each(el, function() {\n var _el = _gel(this);\n if (_el && _el._katavorioDrag) {\n if (!_selectionMap[_el._katavorio]) {\n _selection.push(_el._katavorioDrag);\n _selectionMap[_el._katavorio] = [ _el, _selection.length - 1 ];\n katavorioParams.addClass(_el, _css.selected);\n }\n }\n });\n return this;\n };\n\n /**\n * @name Katavorio#deselect\n * @function\n * @desc Removes an element from the current selection (for multiple node drag)\n * @param {Element|String} DOM element - or id of the element - to remove.\n */\n this.deselect = function(el) {\n _each(el, function() {\n var _el = _gel(this);\n if (_el && _el._katavorio) {\n var e = _selectionMap[_el._katavorio];\n if (e) {\n var _s = [];\n for (var i = 0; i < _selection.length; i++)\n if (_selection[i].el !== _el) _s.push(_selection[i]);\n _selection = _s;\n delete _selectionMap[_el._katavorio];\n katavorioParams.removeClass(_el, _css.selected);\n }\n }\n });\n return this;\n };\n\n this.deselectAll = function() {\n for (var i in _selectionMap) {\n var d = _selectionMap[i];\n katavorioParams.removeClass(d[0], _css.selected);\n }\n\n _selection.length = 0;\n _selectionMap = {};\n };\n\n this.markSelection = function(drag) {\n _foreach(_selection, function(e) { e.mark(); }, drag);\n };\n\n this.markPosses = function(drag) {\n if (drag.posses) {\n _each(drag.posses, function(p) {\n if (drag.posseRoles[p] && _posses[p]) {\n _foreach(_posses[p].members, function (d) {\n d.mark();\n }, drag);\n }\n })\n }\n };\n\n this.unmarkSelection = function(drag, event) {\n _foreach(_selection, function(e) { e.unmark(event); }, drag);\n };\n\n this.unmarkPosses = function(drag, event) {\n if (drag.posses) {\n _each(drag.posses, function(p) {\n if (drag.posseRoles[p] && _posses[p]) {\n _foreach(_posses[p].members, function (d) {\n d.unmark(event, true);\n }, drag);\n }\n });\n }\n };\n\n this.getSelection = function() { return _selection.slice(0); };\n\n this.updateSelection = function(dx, dy, drag) {\n _foreach(_selection, function(e) { e.moveBy(dx, dy); }, drag);\n };\n\n var _posseAction = function(fn, drag) {\n if (drag.posses) {\n _each(drag.posses, function(p) {\n if (drag.posseRoles[p] && _posses[p]) {\n _foreach(_posses[p].members, function (e) {\n fn(e);\n }, drag);\n }\n });\n }\n };\n\n this.updatePosses = function(dx, dy, drag) {\n _posseAction(function(e) { e.moveBy(dx, dy); }, drag);\n };\n\n this.notifyPosseDragStop = function(drag, evt) {\n _posseAction(function(e) { e.stop(evt, true); }, drag);\n };\n\n this.notifySelectionDragStop = function(drag, evt) {\n _foreach(_selection, function(e) { e.stop(evt, true); }, drag);\n };\n\n this.notifySelectionDragStart = function(drag, evt) {\n _foreach(_selection, function(e) { e.notifyStart(evt);}, drag);\n };\n\n this.setZoom = function(z) { _zoom = z; };\n this.getZoom = function() { return _zoom; };\n\n // does the work of changing scopes\n var _scopeManip = function(kObj, scopes, map, fn) {\n _each(kObj, function(_kObj) {\n _unreg(_kObj, map); // deregister existing scopes\n _kObj[fn](scopes); // set scopes\n _reg(_kObj, map); // register new ones\n });\n };\n\n _each([ \"set\", \"add\", \"remove\", \"toggle\"], function(v) {\n this[v + \"Scope\"] = function(el, scopes) {\n _scopeManip(el._katavorioDrag, scopes, this._dragsByScope, v + \"Scope\");\n _scopeManip(el._katavorioDrop, scopes, this._dropsByScope, v + \"Scope\");\n }.bind(this);\n this[v + \"DragScope\"] = function(el, scopes) {\n _scopeManip(el.constructor === Drag ? el : el._katavorioDrag, scopes, this._dragsByScope, v + \"Scope\");\n }.bind(this);\n this[v + \"DropScope\"] = function(el, scopes) {\n _scopeManip(el.constructor === Drop ? el : el._katavorioDrop, scopes, this._dropsByScope, v + \"Scope\");\n }.bind(this);\n }.bind(this));\n\n this.snapToGrid = function(x, y) {\n for (var s in this._dragsByScope) {\n _foreach(this._dragsByScope[s], function(d) { d.snap(x, y); });\n }\n };\n\n this.getDragsForScope = function(s) { return this._dragsByScope[s]; };\n this.getDropsForScope = function(s) { return this._dropsByScope[s]; };\n\n var _destroy = function(el, type, map) {\n el = _gel(el);\n if (el[type]) {\n\n // remove from selection, if present.\n var selIdx = _selection.indexOf(el[type]);\n if (selIdx >= 0) {\n _selection.splice(selIdx, 1);\n }\n\n if (_unreg(el[type], map)) {\n _each(el[type], function(kObj) { kObj.destroy() });\n }\n\n delete el[type];\n }\n };\n\n var _removeListener = function(el, type, evt, fn) {\n el = _gel(el);\n if (el[type]) {\n el[type].off(evt, fn);\n }\n };\n\n this.elementRemoved = function(el) {\n this.destroyDraggable(el);\n this.destroyDroppable(el);\n };\n\n /**\n * Either completely remove drag functionality from the given element, or remove a specific event handler. If you\n * call this method with a single argument - the element - all drag functionality is removed from it. Otherwise, if\n * you provide an event name and listener function, this function is de-registered (if found).\n * @param el Element to update\n * @param {string} [evt] Optional event name to unsubscribe\n * @param {Function} [fn] Optional function to unsubscribe\n */\n this.destroyDraggable = function(el, evt, fn) {\n if (arguments.length === 1) {\n _destroy(el, \"_katavorioDrag\", this._dragsByScope);\n } else {\n _removeListener(el, \"_katavorioDrag\", evt, fn);\n }\n };\n\n /**\n * Either completely remove drop functionality from the given element, or remove a specific event handler. If you\n * call this method with a single argument - the element - all drop functionality is removed from it. Otherwise, if\n * you provide an event name and listener function, this function is de-registered (if found).\n * @param el Element to update\n * @param {string} [evt] Optional event name to unsubscribe\n * @param {Function} [fn] Optional function to unsubscribe\n */\n this.destroyDroppable = function(el, evt, fn) {\n if (arguments.length === 1) {\n _destroy(el, \"_katavorioDrop\", this._dropsByScope);\n } else {\n _removeListener(el, \"_katavorioDrop\", evt, fn);\n }\n };\n\n this.reset = function() {\n this._dragsByScope = {};\n this._dropsByScope = {};\n _selection = [];\n _selectionMap = {};\n _posses = {};\n };\n\n // ----- groups\n var _posses = {};\n\n var _processOneSpec = function(el, _spec, dontAddExisting) {\n var posseId = _isString(_spec) ? _spec : _spec.id;\n var active = _isString(_spec) ? true : _spec.active !== false;\n var posse = _posses[posseId] || (function() {\n var g = {name:posseId, members:[]};\n _posses[posseId] = g;\n return g;\n })();\n _each(el, function(_el) {\n if (_el._katavorioDrag) {\n\n if (dontAddExisting && _el._katavorioDrag.posseRoles[posse.name] != null) return;\n\n _suggest(posse.members, _el._katavorioDrag);\n _suggest(_el._katavorioDrag.posses, posse.name);\n _el._katavorioDrag.posseRoles[posse.name] = active;\n }\n });\n return posse;\n };\n\n /**\n * Add the given element to the posse with the given id, creating the group if it at first does not exist.\n * @method addToPosse\n * @param {Element} el Element to add.\n * @param {String...|Object...} spec Variable args parameters. Each argument can be a either a String, indicating\n * the ID of a Posse to which the element should be added as an active participant, or an Object containing\n * `{ id:\"posseId\", active:false/true}`. In the latter case, if `active` is not provided it is assumed to be\n * true.\n * @returns {Posse|Posse[]} The Posse(s) to which the element(s) was/were added.\n */\n this.addToPosse = function(el, spec) {\n\n var posses = [];\n\n for (var i = 1; i < arguments.length; i++) {\n posses.push(_processOneSpec(el, arguments[i]));\n }\n\n return posses.length === 1 ? posses[0] : posses;\n };\n\n /**\n * Sets the posse(s) for the element with the given id, creating those that do not yet exist, and removing from\n * the element any current Posses that are not specified by this method call. This method will not change the\n * active/passive state if it is given a posse in which the element is already a member.\n * @method setPosse\n * @param {Element} el Element to set posse(s) on.\n * @param {String...|Object...} spec Variable args parameters. Each argument can be a either a String, indicating\n * the ID of a Posse to which the element should be added as an active participant, or an Object containing\n * `{ id:\"posseId\", active:false/true}`. In the latter case, if `active` is not provided it is assumed to be\n * true.\n * @returns {Posse|Posse[]} The Posse(s) to which the element(s) now belongs.\n */\n this.setPosse = function(el, spec) {\n\n var posses = [];\n\n for (var i = 1; i < arguments.length; i++) {\n posses.push(_processOneSpec(el, arguments[i], true).name);\n }\n\n _each(el, function(_el) {\n if (_el._katavorioDrag) {\n var diff = _difference(_el._katavorioDrag.posses, posses);\n var p = [];\n Array.prototype.push.apply(p, _el._katavorioDrag.posses);\n for (var i = 0; i < diff.length; i++) {\n this.removeFromPosse(_el, diff[i]);\n }\n }\n }.bind(this));\n\n return posses.length === 1 ? posses[0] : posses;\n };\n\n /**\n * Remove the given element from the given posse(s).\n * @method removeFromPosse\n * @param {Element} el Element to remove.\n * @param {String...} posseId Varargs parameter: one value for each posse to remove the element from.\n */\n this.removeFromPosse = function(el, posseId) {\n if (arguments.length < 2) throw new TypeError(\"No posse id provided for remove operation\");\n for(var i = 1; i < arguments.length; i++) {\n posseId = arguments[i];\n _each(el, function (_el) {\n if (_el._katavorioDrag && _el._katavorioDrag.posses) {\n var d = _el._katavorioDrag;\n _each(posseId, function (p) {\n _vanquish(_posses[p].members, d);\n _vanquish(d.posses, p);\n delete d.posseRoles[p];\n });\n }\n });\n }\n };\n\n /**\n * Remove the given element from all Posses to which it belongs.\n * @method removeFromAllPosses\n * @param {Element|Element[]} el Element to remove from Posses.\n */\n this.removeFromAllPosses = function(el) {\n _each(el, function(_el) {\n if (_el._katavorioDrag && _el._katavorioDrag.posses) {\n var d = _el._katavorioDrag;\n _each(d.posses, function(p) {\n _vanquish(_posses[p].members, d);\n });\n d.posses.length = 0;\n d.posseRoles = {};\n }\n });\n };\n\n /**\n * Changes the participation state for the element in the Posse with the given ID.\n * @param {Element|Element[]} el Element(s) to change state for.\n * @param {String} posseId ID of the Posse to change element state for.\n * @param {Boolean} state True to make active, false to make passive.\n */\n this.setPosseState = function(el, posseId, state) {\n var posse = _posses[posseId];\n if (posse) {\n _each(el, function(_el) {\n if (_el._katavorioDrag && _el._katavorioDrag.posses) {\n _el._katavorioDrag.posseRoles[posse.name] = state;\n }\n });\n }\n };\n\n };\n\n root.Katavorio.version = \"1.0.0\";\n\n if (typeof exports !== \"undefined\") {\n exports.Katavorio = root.Katavorio;\n }\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n\n(function() {\n\n var root = this;\n root.jsPlumbUtil = root.jsPlumbUtil || {};\n var jsPlumbUtil = root.jsPlumbUtil;\n\n if (typeof exports !=='undefined') { exports.jsPlumbUtil = jsPlumbUtil;}\n\n\n function isArray(a) {\n return Object.prototype.toString.call(a) === \"[object Array]\";\n }\n jsPlumbUtil.isArray = isArray;\n function isNumber(n) {\n return Object.prototype.toString.call(n) === \"[object Number]\";\n }\n jsPlumbUtil.isNumber = isNumber;\n function isString(s) {\n return typeof s === \"string\";\n }\n jsPlumbUtil.isString = isString;\n function isBoolean(s) {\n return typeof s === \"boolean\";\n }\n jsPlumbUtil.isBoolean = isBoolean;\n function isNull(s) {\n return s == null;\n }\n jsPlumbUtil.isNull = isNull;\n function isObject(o) {\n return o == null ? false : Object.prototype.toString.call(o) === \"[object Object]\";\n }\n jsPlumbUtil.isObject = isObject;\n function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n }\n jsPlumbUtil.isDate = isDate;\n function isFunction(o) {\n return Object.prototype.toString.call(o) === \"[object Function]\";\n }\n jsPlumbUtil.isFunction = isFunction;\n function isNamedFunction(o) {\n return isFunction(o) && o.name != null && o.name.length > 0;\n }\n jsPlumbUtil.isNamedFunction = isNamedFunction;\n function isEmpty(o) {\n for (var i in o) {\n if (o.hasOwnProperty(i)) {\n return false;\n }\n }\n return true;\n }\n jsPlumbUtil.isEmpty = isEmpty;\n function clone(a) {\n if (isString(a)) {\n return \"\" + a;\n }\n else if (isBoolean(a)) {\n return !!a;\n }\n else if (isDate(a)) {\n return new Date(a.getTime());\n }\n else if (isFunction(a)) {\n return a;\n }\n else if (isArray(a)) {\n var b = [];\n for (var i = 0; i < a.length; i++) {\n b.push(clone(a[i]));\n }\n return b;\n }\n else if (isObject(a)) {\n var c = {};\n for (var j in a) {\n c[j] = clone(a[j]);\n }\n return c;\n }\n else {\n return a;\n }\n }\n jsPlumbUtil.clone = clone;\n function merge(a, b, collations, overwrites) {\n // first change the collations array - if present - into a lookup table, because its faster.\n var cMap = {}, ar, i, oMap = {};\n collations = collations || [];\n overwrites = overwrites || [];\n for (i = 0; i < collations.length; i++) {\n cMap[collations[i]] = true;\n }\n for (i = 0; i < overwrites.length; i++) {\n oMap[overwrites[i]] = true;\n }\n var c = clone(a);\n for (i in b) {\n if (c[i] == null || oMap[i]) {\n c[i] = b[i];\n }\n else if (isString(b[i]) || isBoolean(b[i])) {\n if (!cMap[i]) {\n c[i] = b[i]; // if we dont want to collate, just copy it in.\n }\n else {\n ar = [];\n // if c's object is also an array we can keep its values.\n ar.push.apply(ar, isArray(c[i]) ? c[i] : [c[i]]);\n ar.push.apply(ar, isBoolean(b[i]) ? b[i] : [b[i]]);\n c[i] = ar;\n }\n }\n else {\n if (isArray(b[i])) {\n ar = [];\n // if c's object is also an array we can keep its values.\n if (isArray(c[i])) {\n ar.push.apply(ar, c[i]);\n }\n ar.push.apply(ar, b[i]);\n c[i] = ar;\n }\n else if (isObject(b[i])) {\n // overwrite c's value with an object if it is not already one.\n if (!isObject(c[i])) {\n c[i] = {};\n }\n for (var j in b[i]) {\n c[i][j] = b[i][j];\n }\n }\n }\n }\n return c;\n }\n jsPlumbUtil.merge = merge;\n function replace(inObj, path, value) {\n if (inObj == null) {\n return;\n }\n var q = inObj, t = q;\n path.replace(/([^\\.])+/g, function (term, lc, pos, str) {\n var array = term.match(/([^\\[0-9]+){1}(\\[)([0-9+])/), last = pos + term.length >= str.length, _getArray = function () {\n return t[array[1]] || (function () {\n t[array[1]] = [];\n return t[array[1]];\n })();\n };\n if (last) {\n // set term = value on current t, creating term as array if necessary.\n if (array) {\n _getArray()[array[3]] = value;\n }\n else {\n t[term] = value;\n }\n }\n else {\n // set to current t[term], creating t[term] if necessary.\n if (array) {\n var a_1 = _getArray();\n t = a_1[array[3]] || (function () {\n a_1[array[3]] = {};\n return a_1[array[3]];\n })();\n }\n else {\n t = t[term] || (function () {\n t[term] = {};\n return t[term];\n })();\n }\n }\n return \"\";\n });\n return inObj;\n }\n jsPlumbUtil.replace = replace;\n //\n // chain a list of functions, supplied by [ object, method name, args ], and return on the first\n // one that returns the failValue. if none return the failValue, return the successValue.\n //\n function functionChain(successValue, failValue, fns) {\n for (var i = 0; i < fns.length; i++) {\n var o = fns[i][0][fns[i][1]].apply(fns[i][0], fns[i][2]);\n if (o === failValue) {\n return o;\n }\n }\n return successValue;\n }\n jsPlumbUtil.functionChain = functionChain;\n /**\n *\n * Take the given model and expand out any parameters. 'functionPrefix' is optional, and if present, helps jsplumb figure out what to do if a value is a Function.\n * if you do not provide it (and doNotExpandFunctions is null, or false), jsplumb will run the given values through any functions it finds, and use the function's\n * output as the value in the result. if you do provide the prefix, only functions that are named and have this prefix\n * will be executed; other functions will be passed as values to the output.\n *\n * @param model\n * @param values\n * @param functionPrefix\n * @param doNotExpandFunctions\n * @returns {any}\n */\n function populate(model, values, functionPrefix, doNotExpandFunctions) {\n // for a string, see if it has parameter matches, and if so, try to make the substitutions.\n var getValue = function (fromString) {\n var matches = fromString.match(/(\\${.*?})/g);\n if (matches != null) {\n for (var i = 0; i < matches.length; i++) {\n var val = values[matches[i].substring(2, matches[i].length - 1)] || \"\";\n if (val != null) {\n fromString = fromString.replace(matches[i], val);\n }\n }\n }\n return fromString;\n };\n // process one entry.\n var _one = function (d) {\n if (d != null) {\n if (isString(d)) {\n return getValue(d);\n }\n else if (isFunction(d) && !doNotExpandFunctions && (functionPrefix == null || (d.name || \"\").indexOf(functionPrefix) === 0)) {\n return d(values);\n }\n else if (isArray(d)) {\n var r = [];\n for (var i = 0; i < d.length; i++) {\n r.push(_one(d[i]));\n }\n return r;\n }\n else if (isObject(d)) {\n var s = {};\n for (var j in d) {\n s[j] = _one(d[j]);\n }\n return s;\n }\n else {\n return d;\n }\n }\n };\n return _one(model);\n }\n jsPlumbUtil.populate = populate;\n function findWithFunction(a, f) {\n if (a) {\n for (var i = 0; i < a.length; i++) {\n if (f(a[i])) {\n return i;\n }\n }\n }\n return -1;\n }\n jsPlumbUtil.findWithFunction = findWithFunction;\n function removeWithFunction(a, f) {\n var idx = findWithFunction(a, f);\n if (idx > -1) {\n a.splice(idx, 1);\n }\n return idx !== -1;\n }\n jsPlumbUtil.removeWithFunction = removeWithFunction;\n function remove(l, v) {\n var idx = l.indexOf(v);\n if (idx > -1) {\n l.splice(idx, 1);\n }\n return idx !== -1;\n }\n jsPlumbUtil.remove = remove;\n function addWithFunction(list, item, hashFunction) {\n if (findWithFunction(list, hashFunction) === -1) {\n list.push(item);\n }\n }\n jsPlumbUtil.addWithFunction = addWithFunction;\n function addToList(map, key, value, insertAtStart) {\n var l = map[key];\n if (l == null) {\n l = [];\n map[key] = l;\n }\n l[insertAtStart ? \"unshift\" : \"push\"](value);\n return l;\n }\n jsPlumbUtil.addToList = addToList;\n function suggest(list, item, insertAtHead) {\n if (list.indexOf(item) === -1) {\n if (insertAtHead) {\n list.unshift(item);\n }\n else {\n list.push(item);\n }\n return true;\n }\n return false;\n }\n jsPlumbUtil.suggest = suggest;\n //\n // extends the given obj (which can be an array) with the given constructor function, prototype functions, and\n // class members, any of which may be null.\n //\n function extend(child, parent, _protoFn) {\n var i;\n parent = isArray(parent) ? parent : [parent];\n var _copyProtoChain = function (focus) {\n var proto = focus.__proto__;\n while (proto != null) {\n if (proto.prototype != null) {\n for (var j in proto.prototype) {\n if (proto.prototype.hasOwnProperty(j) && !child.prototype.hasOwnProperty(j)) {\n child.prototype[j] = proto.prototype[j];\n }\n }\n proto = proto.prototype.__proto__;\n }\n else {\n proto = null;\n }\n }\n };\n for (i = 0; i < parent.length; i++) {\n for (var j in parent[i].prototype) {\n if (parent[i].prototype.hasOwnProperty(j) && !child.prototype.hasOwnProperty(j)) {\n child.prototype[j] = parent[i].prototype[j];\n }\n }\n _copyProtoChain(parent[i]);\n }\n var _makeFn = function (name, protoFn) {\n return function () {\n for (i = 0; i < parent.length; i++) {\n if (parent[i].prototype[name]) {\n parent[i].prototype[name].apply(this, arguments);\n }\n }\n return protoFn.apply(this, arguments);\n };\n };\n var _oneSet = function (fns) {\n for (var k in fns) {\n child.prototype[k] = _makeFn(k, fns[k]);\n }\n };\n if (arguments.length > 2) {\n for (i = 2; i < arguments.length; i++) {\n _oneSet(arguments[i]);\n }\n }\n return child;\n }\n jsPlumbUtil.extend = extend;\n function uuid() {\n return ('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n }));\n }\n jsPlumbUtil.uuid = uuid;\n function fastTrim(s) {\n if (s == null) {\n return null;\n }\n var str = s.replace(/^\\s\\s*/, ''), ws = /\\s/, i = str.length;\n while (ws.test(str.charAt(--i))) {\n }\n return str.slice(0, i + 1);\n }\n jsPlumbUtil.fastTrim = fastTrim;\n function each(obj, fn) {\n obj = obj.length == null || typeof obj === \"string\" ? [obj] : obj;\n for (var i = 0; i < obj.length; i++) {\n fn(obj[i]);\n }\n }\n jsPlumbUtil.each = each;\n function map(obj, fn) {\n var o = [];\n for (var i = 0; i < obj.length; i++) {\n o.push(fn(obj[i]));\n }\n return o;\n }\n jsPlumbUtil.map = map;\n function mergeWithParents(type, map, parentAttribute) {\n parentAttribute = parentAttribute || \"parent\";\n var _def = function (id) {\n return id ? map[id] : null;\n };\n var _parent = function (def) {\n return def ? _def(def[parentAttribute]) : null;\n };\n var _one = function (parent, def) {\n if (parent == null) {\n return def;\n }\n else {\n var d_1 = merge(parent, def);\n return _one(_parent(parent), d_1);\n }\n };\n var _getDef = function (t) {\n if (t == null) {\n return {};\n }\n if (typeof t === \"string\") {\n return _def(t);\n }\n else if (t.length) {\n var done = false, i = 0, _dd = void 0;\n while (!done && i < t.length) {\n _dd = _getDef(t[i]);\n if (_dd) {\n done = true;\n }\n else {\n i++;\n }\n }\n return _dd;\n }\n };\n var d = _getDef(type);\n if (d) {\n return _one(_parent(d), d);\n }\n else {\n return {};\n }\n }\n jsPlumbUtil.mergeWithParents = mergeWithParents;\n jsPlumbUtil.logEnabled = true;\n function log() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (jsPlumbUtil.logEnabled && typeof console !== \"undefined\") {\n try {\n var msg = arguments[arguments.length - 1];\n console.log(msg);\n }\n catch (e) {\n }\n }\n }\n jsPlumbUtil.log = log;\n /**\n * Wraps one function with another, creating a placeholder for the\n * wrapped function if it was null. this is used to wrap the various\n * drag/drop event functions - to allow jsPlumb to be notified of\n * important lifecycle events without imposing itself on the user's\n * drag/drop functionality.\n * @method jsPlumbUtil.wrap\n * @param {Function} wrappedFunction original function to wrap; may be null.\n * @param {Function} newFunction function to wrap the original with.\n * @param {Object} [returnOnThisValue] Optional. Indicates that the wrappedFunction should\n * not be executed if the newFunction returns a value matching 'returnOnThisValue'.\n * note that this is a simple comparison and only works for primitives right now.\n */\n function wrap(wrappedFunction, newFunction, returnOnThisValue) {\n return function () {\n var r = null;\n try {\n if (newFunction != null) {\n r = newFunction.apply(this, arguments);\n }\n }\n catch (e) {\n log(\"jsPlumb function failed : \" + e);\n }\n if ((wrappedFunction != null) && (returnOnThisValue == null || (r !== returnOnThisValue))) {\n try {\n r = wrappedFunction.apply(this, arguments);\n }\n catch (e) {\n log(\"wrapped function failed : \" + e);\n }\n }\n return r;\n };\n }\n jsPlumbUtil.wrap = wrap;\n var EventGenerator = /** @class */ (function () {\n function EventGenerator() {\n var _this = this;\n this._listeners = {};\n this.eventsSuspended = false;\n this.tick = false;\n // this is a list of events that should re-throw any errors that occur during their dispatch.\n this.eventsToDieOn = { \"ready\": true };\n this.queue = [];\n this.bind = function (event, listener, insertAtStart) {\n var _one = function (evt) {\n addToList(_this._listeners, evt, listener, insertAtStart);\n listener.__jsPlumb = listener.__jsPlumb || {};\n listener.__jsPlumb[uuid()] = evt;\n };\n if (typeof event === \"string\") {\n _one(event);\n }\n else if (event.length != null) {\n for (var i = 0; i < event.length; i++) {\n _one(event[i]);\n }\n }\n return _this;\n };\n this.fire = function (event, value, originalEvent) {\n if (!this.tick) {\n this.tick = true;\n if (!this.eventsSuspended && this._listeners[event]) {\n var l = this._listeners[event].length, i = 0, _gone = false, ret = null;\n if (!this.shouldFireEvent || this.shouldFireEvent(event, value, originalEvent)) {\n while (!_gone && i < l && ret !== false) {\n // doing it this way rather than catching and then possibly re-throwing means that an error propagated by this\n // method will have the whole call stack available in the debugger.\n if (this.eventsToDieOn[event]) {\n this._listeners[event][i].apply(this, [value, originalEvent]);\n }\n else {\n try {\n ret = this._listeners[event][i].apply(this, [value, originalEvent]);\n }\n catch (e) {\n log(\"jsPlumb: fire failed for event \" + event + \" : \" + e);\n }\n }\n i++;\n if (this._listeners == null || this._listeners[event] == null) {\n _gone = true;\n }\n }\n }\n }\n this.tick = false;\n this._drain();\n }\n else {\n this.queue.unshift(arguments);\n }\n return this;\n };\n this._drain = function () {\n var n = _this.queue.pop();\n if (n) {\n _this.fire.apply(_this, n);\n }\n };\n this.unbind = function (eventOrListener, listener) {\n if (arguments.length === 0) {\n this._listeners = {};\n }\n else if (arguments.length === 1) {\n if (typeof eventOrListener === \"string\") {\n delete this._listeners[eventOrListener];\n }\n else if (eventOrListener.__jsPlumb) {\n var evt = void 0;\n for (var i in eventOrListener.__jsPlumb) {\n evt = eventOrListener.__jsPlumb[i];\n remove(this._listeners[evt] || [], eventOrListener);\n }\n }\n }\n else if (arguments.length === 2) {\n remove(this._listeners[eventOrListener] || [], listener);\n }\n return this;\n };\n this.getListener = function (forEvent) {\n return _this._listeners[forEvent];\n };\n this.setSuspendEvents = function (val) {\n _this.eventsSuspended = val;\n };\n this.isSuspendEvents = function () {\n return _this.eventsSuspended;\n };\n this.silently = function (fn) {\n _this.setSuspendEvents(true);\n try {\n fn();\n }\n catch (e) {\n log(\"Cannot execute silent function \" + e);\n }\n _this.setSuspendEvents(false);\n };\n this.cleanupListeners = function () {\n for (var i in _this._listeners) {\n _this._listeners[i] = null;\n }\n };\n }\n return EventGenerator;\n }());\n jsPlumbUtil.EventGenerator = EventGenerator;\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains utility functions that run in browsers only.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n ;(function() {\n\n \"use strict\";\n\n var root = this;\n\n root.jsPlumbUtil.matchesSelector = function(el, selector, ctx) {\n ctx = ctx || el.parentNode;\n var possibles = ctx.querySelectorAll(selector);\n for (var i = 0; i < possibles.length; i++) {\n if (possibles[i] === el) {\n return true;\n }\n }\n return false;\n };\n\n root.jsPlumbUtil.consume = function(e, doNotPreventDefault) {\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n else {\n e.returnValue = false;\n }\n\n if (!doNotPreventDefault && e.preventDefault){\n e.preventDefault();\n }\n };\n\n /*\n * Function: sizeElement\n * Helper to size and position an element. You would typically use\n * this when writing your own Connector or Endpoint implementation.\n *\n * Parameters:\n * x - [int] x position for the element origin\n * y - [int] y position for the element origin\n * w - [int] width of the element\n * h - [int] height of the element\n *\n */\n root.jsPlumbUtil.sizeElement = function(el, x, y, w, h) {\n if (el) {\n el.style.height = h + \"px\";\n el.height = h;\n el.style.width = w + \"px\";\n el.width = w;\n el.style.left = x + \"px\";\n el.style.top = y + \"px\";\n }\n };\n\n }).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the core code.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function () {\n\n \"use strict\";\n\n var root = this;\n\n var _ju = root.jsPlumbUtil,\n\n /**\n * creates a timestamp, using milliseconds since 1970, but as a string.\n */\n _timestamp = function () {\n return \"\" + (new Date()).getTime();\n },\n\n // helper method to update the hover style whenever it, or paintStyle, changes.\n // we use paintStyle as the foundation and merge hoverPaintStyle over the\n // top.\n _updateHoverStyle = function (component) {\n if (component._jsPlumb.paintStyle && component._jsPlumb.hoverPaintStyle) {\n var mergedHoverStyle = {};\n jsPlumb.extend(mergedHoverStyle, component._jsPlumb.paintStyle);\n jsPlumb.extend(mergedHoverStyle, component._jsPlumb.hoverPaintStyle);\n delete component._jsPlumb.hoverPaintStyle;\n // we want the fill of paintStyle to override a gradient, if possible.\n if (mergedHoverStyle.gradient && component._jsPlumb.paintStyle.fill) {\n delete mergedHoverStyle.gradient;\n }\n component._jsPlumb.hoverPaintStyle = mergedHoverStyle;\n }\n },\n events = [\"tap\", \"dbltap\", \"click\", \"dblclick\", \"mouseover\", \"mouseout\", \"mousemove\", \"mousedown\", \"mouseup\", \"contextmenu\" ],\n eventFilters = { \"mouseout\": \"mouseleave\", \"mouseexit\": \"mouseleave\" },\n _updateAttachedElements = function (component, state, timestamp, sourceElement) {\n var affectedElements = component.getAttachedElements();\n if (affectedElements) {\n for (var i = 0, j = affectedElements.length; i < j; i++) {\n if (!sourceElement || sourceElement !== affectedElements[i]) {\n affectedElements[i].setHover(state, true, timestamp);\t\t\t// tell the attached elements not to inform their own attached elements.\n }\n }\n }\n },\n _splitType = function (t) {\n return t == null ? null : t.split(\" \");\n },\n _mapType = function(map, obj, typeId) {\n for (var i in obj) {\n map[i] = typeId;\n }\n },\n _each = function(fn, obj) {\n obj = _ju.isArray(obj) || (obj.length != null && !_ju.isString(obj)) ? obj : [ obj ];\n for (var i = 0; i < obj.length; i++) {\n try {\n fn.apply(obj[i], [ obj[i] ]);\n }\n catch (e) {\n _ju.log(\".each iteration failed : \" + e);\n }\n }\n },\n _applyTypes = function (component, params, doNotRepaint) {\n if (component.getDefaultType) {\n var td = component.getTypeDescriptor(), map = {};\n var defType = component.getDefaultType();\n var o = _ju.merge({}, defType);\n _mapType(map, defType, \"__default\");\n for (var i = 0, j = component._jsPlumb.types.length; i < j; i++) {\n var tid = component._jsPlumb.types[i];\n if (tid !== \"__default\") {\n var _t = component._jsPlumb.instance.getType(tid, td);\n if (_t != null) {\n o = _ju.merge(o, _t, [ \"cssClass\" ], [ \"connector\" ]);\n _mapType(map, _t, tid);\n }\n }\n }\n\n if (params) {\n o = _ju.populate(o, params, \"_\");\n }\n\n component.applyType(o, doNotRepaint, map);\n if (!doNotRepaint) {\n component.repaint();\n }\n }\n },\n\n// ------------------------------ BEGIN jsPlumbUIComponent --------------------------------------------\n\n jsPlumbUIComponent = root.jsPlumbUIComponent = function (params) {\n\n _ju.EventGenerator.apply(this, arguments);\n\n var self = this,\n a = arguments,\n idPrefix = self.idPrefix,\n id = idPrefix + (new Date()).getTime();\n\n this._jsPlumb = {\n instance: params._jsPlumb,\n parameters: params.parameters || {},\n paintStyle: null,\n hoverPaintStyle: null,\n paintStyleInUse: null,\n hover: false,\n beforeDetach: params.beforeDetach,\n beforeDrop: params.beforeDrop,\n overlayPlacements: [],\n hoverClass: params.hoverClass || params._jsPlumb.Defaults.HoverClass,\n types: [],\n typeCache:{}\n };\n\n this.cacheTypeItem = function(key, item, typeId) {\n this._jsPlumb.typeCache[typeId] = this._jsPlumb.typeCache[typeId] || {};\n this._jsPlumb.typeCache[typeId][key] = item;\n };\n this.getCachedTypeItem = function(key, typeId) {\n return this._jsPlumb.typeCache[typeId] ? this._jsPlumb.typeCache[typeId][key] : null;\n };\n\n this.getId = function () {\n return id;\n };\n\n// ----------------------------- default type --------------------------------------------\n\n\n var o = params.overlays || [], oo = {};\n if (this.defaultOverlayKeys) {\n for (var i = 0; i < this.defaultOverlayKeys.length; i++) {\n Array.prototype.push.apply(o, this._jsPlumb.instance.Defaults[this.defaultOverlayKeys[i]] || []);\n }\n\n for (i = 0; i < o.length; i++) {\n // if a string, convert to object representation so that we can store the typeid on it.\n // also assign an id.\n var fo = jsPlumb.convertToFullOverlaySpec(o[i]);\n oo[fo[1].id] = fo;\n }\n }\n\n var _defaultType = {\n overlays:oo,\n parameters: params.parameters || {},\n scope: params.scope || this._jsPlumb.instance.getDefaultScope()\n };\n this.getDefaultType = function() {\n return _defaultType;\n };\n this.appendToDefaultType = function(obj) {\n for (var i in obj) {\n _defaultType[i] = obj[i];\n }\n };\n\n// ----------------------------- end default type --------------------------------------------\n\n // all components can generate events\n\n if (params.events) {\n for (var evtName in params.events) {\n self.bind(evtName, params.events[evtName]);\n }\n }\n\n // all components get this clone function.\n // TODO issue 116 showed a problem with this - it seems 'a' that is in\n // the clone function's scope is shared by all invocations of it, the classic\n // JS closure problem. for now, jsPlumb does a version of this inline where\n // it used to call clone. but it would be nice to find some time to look\n // further at this.\n this.clone = function () {\n var o = Object.create(this.constructor.prototype);\n this.constructor.apply(o, a);\n return o;\n }.bind(this);\n\n // user can supply a beforeDetach callback, which will be executed before a detach\n // is performed; returning false prevents the detach.\n this.isDetachAllowed = function (connection) {\n var r = true;\n if (this._jsPlumb.beforeDetach) {\n try {\n r = this._jsPlumb.beforeDetach(connection);\n }\n catch (e) {\n _ju.log(\"jsPlumb: beforeDetach callback failed\", e);\n }\n }\n return r;\n };\n\n // user can supply a beforeDrop callback, which will be executed before a dropped\n // connection is confirmed. user can return false to reject connection.\n this.isDropAllowed = function (sourceId, targetId, scope, connection, dropEndpoint, source, target) {\n var r = this._jsPlumb.instance.checkCondition(\"beforeDrop\", {\n sourceId: sourceId,\n targetId: targetId,\n scope: scope,\n connection: connection,\n dropEndpoint: dropEndpoint,\n source: source, target: target\n });\n if (this._jsPlumb.beforeDrop) {\n try {\n r = this._jsPlumb.beforeDrop({\n sourceId: sourceId,\n targetId: targetId,\n scope: scope,\n connection: connection,\n dropEndpoint: dropEndpoint,\n source: source, target: target\n });\n }\n catch (e) {\n _ju.log(\"jsPlumb: beforeDrop callback failed\", e);\n }\n }\n return r;\n };\n\n var domListeners = [];\n\n // sets the component associated with listener events. for instance, an overlay delegates\n // its events back to a connector. but if the connector is swapped on the underlying connection,\n // then this component must be changed. This is called by setConnector in the Connection class.\n this.setListenerComponent = function (c) {\n for (var i = 0; i < domListeners.length; i++) {\n domListeners[i][3] = c;\n }\n };\n\n\n };\n\n var _removeTypeCssHelper = function (component, typeIndex) {\n var typeId = component._jsPlumb.types[typeIndex],\n type = component._jsPlumb.instance.getType(typeId, component.getTypeDescriptor());\n\n if (type != null && type.cssClass && component.canvas) {\n component._jsPlumb.instance.removeClass(component.canvas, type.cssClass);\n }\n };\n\n _ju.extend(root.jsPlumbUIComponent, _ju.EventGenerator, {\n\n getParameter: function (name) {\n return this._jsPlumb.parameters[name];\n },\n\n setParameter: function (name, value) {\n this._jsPlumb.parameters[name] = value;\n },\n\n getParameters: function () {\n return this._jsPlumb.parameters;\n },\n\n setParameters: function (p) {\n this._jsPlumb.parameters = p;\n },\n\n getClass:function() {\n return jsPlumb.getClass(this.canvas);\n },\n\n hasClass:function(clazz) {\n return jsPlumb.hasClass(this.canvas, clazz);\n },\n\n addClass: function (clazz) {\n jsPlumb.addClass(this.canvas, clazz);\n },\n\n removeClass: function (clazz) {\n jsPlumb.removeClass(this.canvas, clazz);\n },\n\n updateClasses: function (classesToAdd, classesToRemove) {\n jsPlumb.updateClasses(this.canvas, classesToAdd, classesToRemove);\n },\n\n setType: function (typeId, params, doNotRepaint) {\n this.clearTypes();\n this._jsPlumb.types = _splitType(typeId) || [];\n _applyTypes(this, params, doNotRepaint);\n },\n\n getType: function () {\n return this._jsPlumb.types;\n },\n\n reapplyTypes: function (params, doNotRepaint) {\n _applyTypes(this, params, doNotRepaint);\n },\n\n hasType: function (typeId) {\n return this._jsPlumb.types.indexOf(typeId) !== -1;\n },\n\n addType: function (typeId, params, doNotRepaint) {\n var t = _splitType(typeId), _cont = false;\n if (t != null) {\n for (var i = 0, j = t.length; i < j; i++) {\n if (!this.hasType(t[i])) {\n this._jsPlumb.types.push(t[i]);\n _cont = true;\n }\n }\n if (_cont) {\n _applyTypes(this, params, doNotRepaint);\n }\n }\n },\n\n removeType: function (typeId, params, doNotRepaint) {\n var t = _splitType(typeId), _cont = false, _one = function (tt) {\n var idx = this._jsPlumb.types.indexOf(tt);\n if (idx !== -1) {\n // remove css class if necessary\n _removeTypeCssHelper(this, idx);\n this._jsPlumb.types.splice(idx, 1);\n return true;\n }\n return false;\n }.bind(this);\n\n if (t != null) {\n for (var i = 0, j = t.length; i < j; i++) {\n _cont = _one(t[i]) || _cont;\n }\n if (_cont) {\n _applyTypes(this, params, doNotRepaint);\n }\n }\n },\n clearTypes: function (params, doNotRepaint) {\n var i = this._jsPlumb.types.length;\n for (var j = 0; j < i; j++) {\n _removeTypeCssHelper(this, 0);\n this._jsPlumb.types.splice(0, 1);\n }\n _applyTypes(this, params, doNotRepaint);\n },\n\n toggleType: function (typeId, params, doNotRepaint) {\n var t = _splitType(typeId);\n if (t != null) {\n for (var i = 0, j = t.length; i < j; i++) {\n var idx = this._jsPlumb.types.indexOf(t[i]);\n if (idx !== -1) {\n _removeTypeCssHelper(this, idx);\n this._jsPlumb.types.splice(idx, 1);\n }\n else {\n this._jsPlumb.types.push(t[i]);\n }\n }\n\n _applyTypes(this, params, doNotRepaint);\n }\n },\n applyType: function (t, doNotRepaint) {\n this.setPaintStyle(t.paintStyle, doNotRepaint);\n this.setHoverPaintStyle(t.hoverPaintStyle, doNotRepaint);\n if (t.parameters) {\n for (var i in t.parameters) {\n this.setParameter(i, t.parameters[i]);\n }\n }\n this._jsPlumb.paintStyleInUse = this.getPaintStyle();\n },\n setPaintStyle: function (style, doNotRepaint) {\n // this._jsPlumb.paintStyle = jsPlumb.extend({}, style);\n // TODO figure out if we want components to clone paintStyle so as not to share it.\n this._jsPlumb.paintStyle = style;\n this._jsPlumb.paintStyleInUse = this._jsPlumb.paintStyle;\n _updateHoverStyle(this);\n if (!doNotRepaint) {\n this.repaint();\n }\n },\n getPaintStyle: function () {\n return this._jsPlumb.paintStyle;\n },\n setHoverPaintStyle: function (style, doNotRepaint) {\n //this._jsPlumb.hoverPaintStyle = jsPlumb.extend({}, style);\n // TODO figure out if we want components to clone paintStyle so as not to share it.\n this._jsPlumb.hoverPaintStyle = style;\n _updateHoverStyle(this);\n if (!doNotRepaint) {\n this.repaint();\n }\n },\n getHoverPaintStyle: function () {\n return this._jsPlumb.hoverPaintStyle;\n },\n destroy: function (force) {\n if (force || this.typeId == null) {\n this.cleanupListeners(); // this is on EventGenerator\n this.clone = null;\n this._jsPlumb = null;\n }\n },\n\n isHover: function () {\n return this._jsPlumb.hover;\n },\n\n setHover: function (hover, ignoreAttachedElements, timestamp) {\n // while dragging, we ignore these events. this keeps the UI from flashing and\n // swishing and whatevering.\n if (this._jsPlumb && !this._jsPlumb.instance.currentlyDragging && !this._jsPlumb.instance.isHoverSuspended()) {\n\n this._jsPlumb.hover = hover;\n var method = hover ? \"addClass\" : \"removeClass\";\n\n if (this.canvas != null) {\n if (this._jsPlumb.instance.hoverClass != null) {\n this._jsPlumb.instance[method](this.canvas, this._jsPlumb.instance.hoverClass);\n }\n if (this._jsPlumb.hoverClass != null) {\n this._jsPlumb.instance[method](this.canvas, this._jsPlumb.hoverClass);\n }\n }\n if (this._jsPlumb.hoverPaintStyle != null) {\n this._jsPlumb.paintStyleInUse = hover ? this._jsPlumb.hoverPaintStyle : this._jsPlumb.paintStyle;\n if (!this._jsPlumb.instance.isSuspendDrawing()) {\n timestamp = timestamp || _timestamp();\n this.repaint({timestamp: timestamp, recalc: false});\n }\n }\n // get the list of other affected elements, if supported by this component.\n // for a connection, its the endpoints. for an endpoint, its the connections! surprise.\n if (this.getAttachedElements && !ignoreAttachedElements) {\n _updateAttachedElements(this, hover, _timestamp(), this);\n }\n }\n }\n });\n\n// ------------------------------ END jsPlumbUIComponent --------------------------------------------\n\n var _jsPlumbInstanceIndex = 0,\n getInstanceIndex = function () {\n var i = _jsPlumbInstanceIndex + 1;\n _jsPlumbInstanceIndex++;\n return i;\n };\n\n var jsPlumbInstance = root.jsPlumbInstance = function (_defaults) {\n\n this.version = \"2.9.0\";\n\n this.Defaults = {\n Anchor: \"Bottom\",\n Anchors: [ null, null ],\n ConnectionsDetachable: true,\n ConnectionOverlays: [ ],\n Connector: \"Bezier\",\n Container: null,\n DoNotThrowErrors: false,\n DragOptions: { },\n DropOptions: { },\n Endpoint: \"Dot\",\n EndpointOverlays: [ ],\n Endpoints: [ null, null ],\n EndpointStyle: { fill: \"#456\" },\n EndpointStyles: [ null, null ],\n EndpointHoverStyle: null,\n EndpointHoverStyles: [ null, null ],\n HoverPaintStyle: null,\n LabelStyle: { color: \"black\" },\n LogEnabled: false,\n Overlays: [ ],\n MaxConnections: 1,\n PaintStyle: { \"stroke-width\": 4, stroke: \"#456\" },\n ReattachConnections: false,\n RenderMode: \"svg\",\n Scope: \"jsPlumb_DefaultScope\"\n };\n\n if (_defaults) {\n jsPlumb.extend(this.Defaults, _defaults);\n }\n\n this.logEnabled = this.Defaults.LogEnabled;\n this._connectionTypes = {};\n this._endpointTypes = {};\n\n _ju.EventGenerator.apply(this);\n\n var _currentInstance = this,\n _instanceIndex = getInstanceIndex(),\n _bb = _currentInstance.bind,\n _initialDefaults = {},\n _zoom = 1,\n _info = function (el) {\n if (el == null) {\n return null;\n }\n else if (el.nodeType === 3 || el.nodeType === 8) {\n return { el:el, text:true };\n }\n else {\n var _el = _currentInstance.getElement(el);\n return { el: _el, id: (_ju.isString(el) && _el == null) ? el : _getId(_el) };\n }\n };\n\n this.getInstanceIndex = function () {\n return _instanceIndex;\n };\n\n // CONVERTED\n this.setZoom = function (z, repaintEverything) {\n _zoom = z;\n _currentInstance.fire(\"zoom\", _zoom);\n if (repaintEverything) {\n _currentInstance.repaintEverything();\n }\n return true;\n };\n // CONVERTED\n this.getZoom = function () {\n return _zoom;\n };\n\n for (var i in this.Defaults) {\n _initialDefaults[i] = this.Defaults[i];\n }\n\n var _container, _containerDelegations = [];\n this.unbindContainer = function() {\n if (_container != null && _containerDelegations.length > 0) {\n for (var i = 0; i < _containerDelegations.length; i++) {\n _currentInstance.off(_container, _containerDelegations[i][0], _containerDelegations[i][1]);\n }\n }\n };\n this.setContainer = function (c) {\n\n this.unbindContainer();\n\n // get container as dom element.\n c = this.getElement(c);\n // move existing connections and endpoints, if any.\n this.select().each(function (conn) {\n conn.moveParent(c);\n });\n this.selectEndpoints().each(function (ep) {\n ep.moveParent(c);\n });\n\n // set container.\n var previousContainer = _container;\n _container = c;\n _containerDelegations.length = 0;\n var eventAliases = {\n \"endpointclick\":\"endpointClick\",\n \"endpointdblclick\":\"endpointDblClick\"\n };\n\n var _oneDelegateHandler = function (id, e, componentType) {\n var t = e.srcElement || e.target,\n jp = (t && t.parentNode ? t.parentNode._jsPlumb : null) || (t ? t._jsPlumb : null) || (t && t.parentNode && t.parentNode.parentNode ? t.parentNode.parentNode._jsPlumb : null);\n if (jp) {\n jp.fire(id, jp, e);\n var alias = componentType ? eventAliases[componentType + id] || id : id;\n // jsplumb also fires every event coming from components/overlays. That's what the test for `jp.component` is for.\n _currentInstance.fire(alias, jp.component || jp, e);\n }\n };\n\n var _addOneDelegate = function(eventId, selector, fn) {\n _containerDelegations.push([eventId, fn]);\n _currentInstance.on(_container, eventId, selector, fn);\n };\n\n // delegate one event on the container to jsplumb elements. it might be possible to\n // abstract this out: each of endpoint, connection and overlay could register themselves with\n // jsplumb as \"component types\" or whatever, and provide a suitable selector. this would be\n // done by the renderer (although admittedly from 2.0 onwards we're not supporting vml anymore)\n var _oneDelegate = function (id) {\n // connections.\n _addOneDelegate(id, \".jtk-connector\", function (e) {\n _oneDelegateHandler(id, e);\n });\n // endpoints. note they can have an enclosing div, or not.\n _addOneDelegate(id, \".jtk-endpoint\", function (e) {\n _oneDelegateHandler(id, e, \"endpoint\");\n });\n // overlays\n _addOneDelegate(id, \".jtk-overlay\", function (e) {\n _oneDelegateHandler(id, e);\n });\n };\n\n for (var i = 0; i < events.length; i++) {\n _oneDelegate(events[i]);\n }\n\n // managed elements\n for (var elId in managedElements) {\n var el = managedElements[elId].el;\n if (el.parentNode === previousContainer) {\n previousContainer.removeChild(el);\n _container.appendChild(el);\n }\n }\n\n };\n this.getContainer = function () {\n return _container;\n };\n\n this.bind = function (event, fn) {\n if (\"ready\" === event && initialized) {\n fn();\n }\n else {\n _bb.apply(_currentInstance, [event, fn]);\n }\n };\n\n _currentInstance.importDefaults = function (d) {\n for (var i in d) {\n _currentInstance.Defaults[i] = d[i];\n }\n if (d.Container) {\n _currentInstance.setContainer(d.Container);\n }\n\n return _currentInstance;\n };\n\n _currentInstance.restoreDefaults = function () {\n _currentInstance.Defaults = jsPlumb.extend({}, _initialDefaults);\n return _currentInstance;\n };\n\n var log = null,\n initialized = false,\n // TODO remove from window scope\n connections = [],\n // map of element id -> endpoint lists. an element can have an arbitrary\n // number of endpoints on it, and not all of them have to be connected\n // to anything.\n endpointsByElement = {},\n endpointsByUUID = {},\n managedElements = {},\n offsets = {},\n offsetTimestamps = {},\n draggableStates = {},\n connectionBeingDragged = false,\n sizes = [],\n _suspendDrawing = false,\n _suspendedAt = null,\n DEFAULT_SCOPE = this.Defaults.Scope,\n _curIdStamp = 1,\n _idstamp = function () {\n return \"\" + _curIdStamp++;\n },\n\n //\n // appends an element to some other element, which is calculated as follows:\n //\n // 1. if Container exists, use that element.\n // 2. if the 'parent' parameter exists, use that.\n // 3. otherwise just use the root element.\n //\n //\n _appendElement = function (el, parent) {\n if (_container) {\n _container.appendChild(el);\n }\n else if (!parent) {\n this.appendToRoot(el);\n }\n else {\n this.getElement(parent).appendChild(el);\n }\n }.bind(this),\n\n //\n // Draws an endpoint and its connections. this is the main entry point into drawing connections as well\n // as endpoints, since jsPlumb is endpoint-centric under the hood.\n //\n // @param element element to draw (of type library specific element object)\n // @param ui UI object from current library's event system. optional.\n // @param timestamp timestamp for this paint cycle. used to speed things up a little by cutting down the amount of offset calculations we do.\n // @param clearEdits defaults to false; indicates that mouse edits for connectors should be cleared\n ///\n _draw = function (element, ui, timestamp, clearEdits) {\n\n if (!_suspendDrawing) {\n var id = _getId(element),\n repaintEls,\n dm = _currentInstance.getDragManager();\n\n if (dm) {\n repaintEls = dm.getElementsForDraggable(id);\n }\n\n if (timestamp == null) {\n timestamp = _timestamp();\n }\n\n // update the offset of everything _before_ we try to draw anything.\n var o = _updateOffset({ elId: id, offset: ui, recalc: false, timestamp: timestamp });\n\n if (repaintEls && o && o.o) {\n for (var i in repaintEls) {\n _updateOffset({\n elId: repaintEls[i].id,\n offset: {\n left: o.o.left + repaintEls[i].offset.left,\n top: o.o.top + repaintEls[i].offset.top\n },\n recalc: false,\n timestamp: timestamp\n });\n }\n }\n\n _currentInstance.anchorManager.redraw(id, ui, timestamp, null, clearEdits);\n\n if (repaintEls) {\n for (var j in repaintEls) {\n _currentInstance.anchorManager.redraw(repaintEls[j].id, ui, timestamp, repaintEls[j].offset, clearEdits, true);\n }\n }\n }\n },\n\n //\n // gets an Endpoint by uuid.\n //\n _getEndpoint = function (uuid) {\n return endpointsByUUID[uuid];\n },\n\n /**\n * inits a draggable if it's not already initialised.\n * TODO: somehow abstract this to the adapter, because the concept of \"draggable\" has no\n * place on the server.\n */\n\n\n _scopeMatch = function (e1, e2) {\n var s1 = e1.scope.split(/\\s/), s2 = e2.scope.split(/\\s/);\n for (var i = 0; i < s1.length; i++) {\n for (var j = 0; j < s2.length; j++) {\n if (s2[j] === s1[i]) {\n return true;\n }\n }\n }\n\n return false;\n },\n\n _mergeOverrides = function (def, values) {\n var m = jsPlumb.extend({}, def);\n for (var i in values) {\n if (values[i]) {\n m[i] = values[i];\n }\n }\n return m;\n },\n\n /*\n * prepares a final params object that can be passed to _newConnection, taking into account defaults, events, etc.\n */\n _prepareConnectionParams = function (params, referenceParams) {\n var _p = jsPlumb.extend({ }, params);\n if (referenceParams) {\n jsPlumb.extend(_p, referenceParams);\n }\n\n // hotwire endpoints passed as source or target to sourceEndpoint/targetEndpoint, respectively.\n if (_p.source) {\n if (_p.source.endpoint) {\n _p.sourceEndpoint = _p.source;\n }\n else {\n _p.source = _currentInstance.getElement(_p.source);\n }\n }\n if (_p.target) {\n if (_p.target.endpoint) {\n _p.targetEndpoint = _p.target;\n }\n else {\n _p.target = _currentInstance.getElement(_p.target);\n }\n }\n\n // test for endpoint uuids to connect\n if (params.uuids) {\n _p.sourceEndpoint = _getEndpoint(params.uuids[0]);\n _p.targetEndpoint = _getEndpoint(params.uuids[1]);\n }\n\n // now ensure that if we do have Endpoints already, they're not full.\n // source:\n if (_p.sourceEndpoint && _p.sourceEndpoint.isFull()) {\n _ju.log(_currentInstance, \"could not add connection; source endpoint is full\");\n return;\n }\n\n // target:\n if (_p.targetEndpoint && _p.targetEndpoint.isFull()) {\n _ju.log(_currentInstance, \"could not add connection; target endpoint is full\");\n return;\n }\n\n // if source endpoint mandates connection type and nothing specified in our params, use it.\n if (!_p.type && _p.sourceEndpoint) {\n _p.type = _p.sourceEndpoint.connectionType;\n }\n\n // copy in any connectorOverlays that were specified on the source endpoint.\n // it doesnt copy target endpoint overlays. i'm not sure if we want it to or not.\n if (_p.sourceEndpoint && _p.sourceEndpoint.connectorOverlays) {\n _p.overlays = _p.overlays || [];\n for (var i = 0, j = _p.sourceEndpoint.connectorOverlays.length; i < j; i++) {\n _p.overlays.push(_p.sourceEndpoint.connectorOverlays[i]);\n }\n }\n\n // scope\n if (_p.sourceEndpoint && _p.sourceEndpoint.scope) {\n _p.scope = _p.sourceEndpoint.scope;\n }\n\n // pointer events\n if (!_p[\"pointer-events\"] && _p.sourceEndpoint && _p.sourceEndpoint.connectorPointerEvents) {\n _p[\"pointer-events\"] = _p.sourceEndpoint.connectorPointerEvents;\n }\n\n\n var _addEndpoint = function (el, def, idx) {\n return _currentInstance.addEndpoint(el, _mergeOverrides(def, {\n anchor: _p.anchors ? _p.anchors[idx] : _p.anchor,\n endpoint: _p.endpoints ? _p.endpoints[idx] : _p.endpoint,\n paintStyle: _p.endpointStyles ? _p.endpointStyles[idx] : _p.endpointStyle,\n hoverPaintStyle: _p.endpointHoverStyles ? _p.endpointHoverStyles[idx] : _p.endpointHoverStyle\n }));\n };\n\n // check for makeSource/makeTarget specs.\n\n var _oneElementDef = function (type, idx, defs, matchType) {\n if (_p[type] && !_p[type].endpoint && !_p[type + \"Endpoint\"] && !_p.newConnection) {\n var tid = _getId(_p[type]), tep = defs[tid];\n\n tep = tep ? tep[matchType] : null;\n\n if (tep) {\n // if not enabled, return.\n if (!tep.enabled) {\n return false;\n }\n var newEndpoint = tep.endpoint != null && tep.endpoint._jsPlumb ? tep.endpoint : _addEndpoint(_p[type], tep.def, idx);\n if (newEndpoint.isFull()) {\n return false;\n }\n _p[type + \"Endpoint\"] = newEndpoint;\n if (!_p.scope && tep.def.scope) {\n _p.scope = tep.def.scope;\n } // provide scope if not already provided and endpoint def has one.\n if (tep.uniqueEndpoint) {\n if (!tep.endpoint) {\n tep.endpoint = newEndpoint;\n newEndpoint.setDeleteOnEmpty(false);\n }\n else {\n newEndpoint.finalEndpoint = tep.endpoint;\n }\n } else {\n newEndpoint.setDeleteOnEmpty(true);\n }\n\n //\n // copy in connector overlays if present on the source definition.\n //\n if (idx === 0 && tep.def.connectorOverlays) {\n _p.overlays = _p.overlays || [];\n Array.prototype.push.apply(_p.overlays, tep.def.connectorOverlays);\n }\n }\n }\n };\n\n if (_oneElementDef(\"source\", 0, this.sourceEndpointDefinitions, _p.type || \"default\") === false) {\n return;\n }\n if (_oneElementDef(\"target\", 1, this.targetEndpointDefinitions, _p.type || \"default\") === false) {\n return;\n }\n\n // last, ensure scopes match\n if (_p.sourceEndpoint && _p.targetEndpoint) {\n if (!_scopeMatch(_p.sourceEndpoint, _p.targetEndpoint)) {\n _p = null;\n }\n }\n\n return _p;\n }.bind(_currentInstance),\n\n _newConnection = function (params) {\n var connectionFunc = _currentInstance.Defaults.ConnectionType || _currentInstance.getDefaultConnectionType();\n\n params._jsPlumb = _currentInstance;\n params.newConnection = _newConnection;\n params.newEndpoint = _newEndpoint;\n params.endpointsByUUID = endpointsByUUID;\n params.endpointsByElement = endpointsByElement;\n params.finaliseConnection = _finaliseConnection;\n params.id = \"con_\" + _idstamp();\n var con = new connectionFunc(params);\n\n // if the connection is draggable, then maybe we need to tell the target endpoint to init the\n // dragging code. it won't run again if it already configured to be draggable.\n if (con.isDetachable()) {\n con.endpoints[0].initDraggable(\"_jsPlumbSource\");\n con.endpoints[1].initDraggable(\"_jsPlumbTarget\");\n }\n\n return con;\n },\n\n //\n // adds the connection to the backing model, fires an event if necessary and then redraws\n //\n _finaliseConnection = _currentInstance.finaliseConnection = function (jpc, params, originalEvent, doInformAnchorManager) {\n params = params || {};\n // add to list of connections (by scope).\n if (!jpc.suspendedEndpoint) {\n connections.push(jpc);\n }\n\n jpc.pending = null;\n\n // turn off isTemporarySource on the source endpoint (only viable on first draw)\n jpc.endpoints[0].isTemporarySource = false;\n\n // always inform the anchor manager\n // except that if jpc has a suspended endpoint it's not true to say the\n // connection is new; it has just (possibly) moved. the question is whether\n // to make that call here or in the anchor manager. i think perhaps here.\n if (doInformAnchorManager !== false) {\n _currentInstance.anchorManager.newConnection(jpc);\n }\n\n // force a paint\n _draw(jpc.source);\n\n // fire an event\n if (!params.doNotFireConnectionEvent && params.fireEvent !== false) {\n\n var eventArgs = {\n connection: jpc,\n source: jpc.source, target: jpc.target,\n sourceId: jpc.sourceId, targetId: jpc.targetId,\n sourceEndpoint: jpc.endpoints[0], targetEndpoint: jpc.endpoints[1]\n };\n\n _currentInstance.fire(\"connection\", eventArgs, originalEvent);\n }\n },\n\n /*\n factory method to prepare a new endpoint. this should always be used instead of creating Endpoints\n manually, since this method attaches event listeners and an id.\n */\n _newEndpoint = function (params, id) {\n var endpointFunc = _currentInstance.Defaults.EndpointType || jsPlumb.Endpoint;\n var _p = jsPlumb.extend({}, params);\n _p._jsPlumb = _currentInstance;\n _p.newConnection = _newConnection;\n _p.newEndpoint = _newEndpoint;\n _p.endpointsByUUID = endpointsByUUID;\n _p.endpointsByElement = endpointsByElement;\n _p.fireDetachEvent = fireDetachEvent;\n _p.elementId = id || _getId(_p.source);\n var ep = new endpointFunc(_p);\n ep.id = \"ep_\" + _idstamp();\n _manage(_p.elementId, _p.source);\n\n if (!jsPlumb.headless) {\n _currentInstance.getDragManager().endpointAdded(_p.source, id);\n }\n\n return ep;\n },\n\n /*\n * performs the given function operation on all the connections found\n * for the given element id; this means we find all the endpoints for\n * the given element, and then for each endpoint find the connectors\n * connected to it. then we pass each connection in to the given\n * function.\n */\n _operation = function (elId, func, endpointFunc) {\n var endpoints = endpointsByElement[elId];\n if (endpoints && endpoints.length) {\n for (var i = 0, ii = endpoints.length; i < ii; i++) {\n for (var j = 0, jj = endpoints[i].connections.length; j < jj; j++) {\n var retVal = func(endpoints[i].connections[j]);\n // if the function passed in returns true, we exit.\n // most functions return false.\n if (retVal) {\n return;\n }\n }\n if (endpointFunc) {\n endpointFunc(endpoints[i]);\n }\n }\n }\n },\n\n _setDraggable = function (element, draggable) {\n return jsPlumb.each(element, function (el) {\n if (_currentInstance.isDragSupported(el)) {\n draggableStates[_currentInstance.getAttribute(el, \"id\")] = draggable;\n _currentInstance.setElementDraggable(el, draggable);\n }\n });\n },\n /*\n * private method to do the business of hiding/showing.\n *\n * @param el\n * either Id of the element in question or a library specific\n * object for the element.\n * @param state\n * String specifying a value for the css 'display' property\n * ('block' or 'none').\n */\n _setVisible = function (el, state, alsoChangeEndpoints) {\n state = state === \"block\";\n var endpointFunc = null;\n if (alsoChangeEndpoints) {\n endpointFunc = function (ep) {\n ep.setVisible(state, true, true);\n };\n }\n var info = _info(el);\n _operation(info.id, function (jpc) {\n if (state && alsoChangeEndpoints) {\n // this test is necessary because this functionality is new, and i wanted to maintain backwards compatibility.\n // this block will only set a connection to be visible if the other endpoint in the connection is also visible.\n var oidx = jpc.sourceId === info.id ? 1 : 0;\n if (jpc.endpoints[oidx].isVisible()) {\n jpc.setVisible(true);\n }\n }\n else { // the default behaviour for show, and what always happens for hide, is to just set the visibility without getting clever.\n jpc.setVisible(state);\n }\n }, endpointFunc);\n },\n /**\n * private method to do the business of toggling hiding/showing.\n */\n _toggleVisible = function (elId, changeEndpoints) {\n var endpointFunc = null;\n if (changeEndpoints) {\n endpointFunc = function (ep) {\n var state = ep.isVisible();\n ep.setVisible(!state);\n };\n }\n _operation(elId, function (jpc) {\n var state = jpc.isVisible();\n jpc.setVisible(!state);\n }, endpointFunc);\n },\n\n // TODO comparison performance\n _getCachedData = function (elId) {\n var o = offsets[elId];\n if (!o) {\n return _updateOffset({elId: elId});\n }\n else {\n return {o: o, s: sizes[elId]};\n }\n },\n\n /**\n * gets an id for the given element, creating and setting one if\n * necessary. the id is of the form\n *\n * jsPlumb__\n *\n * where \"index in instance\" is a monotonically increasing integer that starts at 0,\n * for each instance. this method is used not only to assign ids to elements that do not\n * have them but also to connections and endpoints.\n */\n _getId = function (element, uuid, doNotCreateIfNotFound) {\n if (_ju.isString(element)) {\n return element;\n }\n if (element == null) {\n return null;\n }\n var id = _currentInstance.getAttribute(element, \"id\");\n if (!id || id === \"undefined\") {\n // check if fixed uuid parameter is given\n if (arguments.length === 2 && arguments[1] !== undefined) {\n id = uuid;\n }\n else if (arguments.length === 1 || (arguments.length === 3 && !arguments[2])) {\n id = \"jsPlumb_\" + _instanceIndex + \"_\" + _idstamp();\n }\n\n if (!doNotCreateIfNotFound) {\n _currentInstance.setAttribute(element, \"id\", id);\n }\n }\n return id;\n };\n\n this.setConnectionBeingDragged = function (v) {\n connectionBeingDragged = v;\n };\n this.isConnectionBeingDragged = function () {\n return connectionBeingDragged;\n };\n\n /**\n * Returns a map of all the elements this jsPlumbInstance is currently managing.\n * @returns {Object} Map of [id-> {el, endpoint[], connection, position}] information.\n */\n this.getManagedElements = function() {\n return managedElements;\n };\n\n this.connectorClass = \"jtk-connector\";\n this.connectorOutlineClass = \"jtk-connector-outline\";\n this.connectedClass = \"jtk-connected\";\n this.hoverClass = \"jtk-hover\";\n this.endpointClass = \"jtk-endpoint\";\n this.endpointConnectedClass = \"jtk-endpoint-connected\";\n this.endpointFullClass = \"jtk-endpoint-full\";\n this.endpointDropAllowedClass = \"jtk-endpoint-drop-allowed\";\n this.endpointDropForbiddenClass = \"jtk-endpoint-drop-forbidden\";\n this.overlayClass = \"jtk-overlay\";\n this.draggingClass = \"jtk-dragging\";// CONVERTED\n this.elementDraggingClass = \"jtk-element-dragging\";// CONVERTED\n this.sourceElementDraggingClass = \"jtk-source-element-dragging\"; // CONVERTED\n this.targetElementDraggingClass = \"jtk-target-element-dragging\";// CONVERTED\n this.endpointAnchorClassPrefix = \"jtk-endpoint-anchor\";\n this.hoverSourceClass = \"jtk-source-hover\";\n this.hoverTargetClass = \"jtk-target-hover\";\n this.dragSelectClass = \"jtk-drag-select\";\n\n this.Anchors = {};\n this.Connectors = { \"svg\": {} };\n this.Endpoints = { \"svg\": {} };\n this.Overlays = { \"svg\": {} } ;\n this.ConnectorRenderers = {};\n this.SVG = \"svg\";\n\n// --------------------------- jsPlumbInstance public API ---------------------------------------------------------\n\n\n this.addEndpoint = function (el, params, referenceParams) {\n referenceParams = referenceParams || {};\n var p = jsPlumb.extend({}, referenceParams);\n jsPlumb.extend(p, params);\n p.endpoint = p.endpoint || _currentInstance.Defaults.Endpoint;\n p.paintStyle = p.paintStyle || _currentInstance.Defaults.EndpointStyle;\n\n var results = [],\n inputs = (_ju.isArray(el) || (el.length != null && !_ju.isString(el))) ? el : [ el ];\n\n for (var i = 0, j = inputs.length; i < j; i++) {\n p.source = _currentInstance.getElement(inputs[i]);\n _ensureContainer(p.source);\n\n var id = _getId(p.source), e = _newEndpoint(p, id);\n\n // ensure element is managed.\n var myOffset = _manage(id, p.source).info.o;\n _ju.addToList(endpointsByElement, id, e);\n\n if (!_suspendDrawing) {\n e.paint({\n anchorLoc: e.anchor.compute({ xy: [ myOffset.left, myOffset.top ], wh: sizes[id], element: e, timestamp: _suspendedAt }),\n timestamp: _suspendedAt\n });\n }\n\n results.push(e);\n }\n\n return results.length === 1 ? results[0] : results;\n };\n\n this.addEndpoints = function (el, endpoints, referenceParams) {\n var results = [];\n for (var i = 0, j = endpoints.length; i < j; i++) {\n var e = _currentInstance.addEndpoint(el, endpoints[i], referenceParams);\n if (_ju.isArray(e)) {\n Array.prototype.push.apply(results, e);\n }\n else {\n results.push(e);\n }\n }\n return results;\n };\n\n this.animate = function (el, properties, options) {\n if (!this.animationSupported) {\n return false;\n }\n\n options = options || {};\n var del = _currentInstance.getElement(el),\n id = _getId(del),\n stepFunction = jsPlumb.animEvents.step,\n completeFunction = jsPlumb.animEvents.complete;\n\n options[stepFunction] = _ju.wrap(options[stepFunction], function () {\n _currentInstance.revalidate(id);\n });\n\n // onComplete repaints, just to make sure everything looks good at the end of the animation.\n options[completeFunction] = _ju.wrap(options[completeFunction], function () {\n _currentInstance.revalidate(id);\n });\n\n _currentInstance.doAnimate(del, properties, options);\n };\n\n /**\n * checks for a listener for the given condition, executing it if found, passing in the given value.\n * condition listeners would have been attached using \"bind\" (which is, you could argue, now overloaded, since\n * firing click events etc is a bit different to what this does). i thought about adding a \"bindCondition\"\n * or something, but decided against it, for the sake of simplicity. jsPlumb will never fire one of these\n * condition events anyway.\n */\n this.checkCondition = function (conditionName, args) {\n var l = _currentInstance.getListener(conditionName),\n r = true;\n\n if (l && l.length > 0) {\n var values = Array.prototype.slice.call(arguments, 1);\n try {\n for (var i = 0, j = l.length; i < j; i++) {\n r = r && l[i].apply(l[i], values);\n }\n }\n catch (e) {\n _ju.log(_currentInstance, \"cannot check condition [\" + conditionName + \"]\" + e);\n }\n }\n return r;\n };\n\n this.connect = function (params, referenceParams) {\n // prepare a final set of parameters to create connection with\n var _p = _prepareConnectionParams(params, referenceParams), jpc;\n // TODO probably a nicer return value if the connection was not made. _prepareConnectionParams\n // will return null (and log something) if either endpoint was full. what would be nicer is to\n // create a dedicated 'error' object.\n if (_p) {\n if (_p.source == null && _p.sourceEndpoint == null) {\n _ju.log(\"Cannot establish connection - source does not exist\");\n return;\n }\n if (_p.target == null && _p.targetEndpoint == null) {\n _ju.log(\"Cannot establish connection - target does not exist\");\n return;\n }\n _ensureContainer(_p.source);\n // create the connection. it is not yet registered\n jpc = _newConnection(_p);\n // now add it the model, fire an event, and redraw\n _finaliseConnection(jpc, _p);\n }\n return jpc;\n };\n\n var stTypes = [\n { el: \"source\", elId: \"sourceId\", epDefs: \"sourceEndpointDefinitions\" },\n { el: \"target\", elId: \"targetId\", epDefs: \"targetEndpointDefinitions\" }\n ];\n\n var _set = function (c, el, idx, doNotRepaint) {\n var ep, _st = stTypes[idx], cId = c[_st.elId], cEl = c[_st.el], sid, sep,\n oldEndpoint = c.endpoints[idx];\n\n var evtParams = {\n index: idx,\n originalSourceId: idx === 0 ? cId : c.sourceId,\n newSourceId: c.sourceId,\n originalTargetId: idx === 1 ? cId : c.targetId,\n newTargetId: c.targetId,\n connection: c\n };\n\n if (el.constructor === jsPlumb.Endpoint) {\n ep = el;\n ep.addConnection(c);\n el = ep.element;\n }\n else {\n sid = _getId(el);\n sep = this[_st.epDefs][sid];\n\n if (sid === c[_st.elId]) {\n ep = null; // dont change source/target if the element is already the one given.\n }\n else if (sep) {\n for (var t in sep) {\n if (!sep[t].enabled) {\n return;\n }\n ep = sep[t].endpoint != null && sep[t].endpoint._jsPlumb ? sep[t].endpoint : this.addEndpoint(el, sep[t].def);\n if (sep[t].uniqueEndpoint) {\n sep[t].endpoint = ep;\n }\n ep.addConnection(c);\n }\n }\n else {\n ep = c.makeEndpoint(idx === 0, el, sid);\n }\n }\n\n if (ep != null) {\n oldEndpoint.detachFromConnection(c);\n c.endpoints[idx] = ep;\n c[_st.el] = ep.element;\n c[_st.elId] = ep.elementId;\n evtParams[idx === 0 ? \"newSourceId\" : \"newTargetId\"] = ep.elementId;\n\n fireMoveEvent(evtParams);\n\n if (!doNotRepaint) {\n c.repaint();\n }\n }\n\n evtParams.element = el;\n return evtParams;\n\n }.bind(this);\n\n this.setSource = function (connection, el, doNotRepaint) {\n var p = _set(connection, el, 0, doNotRepaint);\n this.anchorManager.sourceChanged(p.originalSourceId, p.newSourceId, connection, p.el);\n };\n this.setTarget = function (connection, el, doNotRepaint) {\n var p = _set(connection, el, 1, doNotRepaint);\n this.anchorManager.updateOtherEndpoint(p.originalSourceId, p.originalTargetId, p.newTargetId, connection);\n };\n\n this.deleteEndpoint = function (object, dontUpdateHover, deleteAttachedObjects) {\n var endpoint = (typeof object === \"string\") ? endpointsByUUID[object] : object;\n if (endpoint) {\n _currentInstance.deleteObject({ endpoint: endpoint, dontUpdateHover: dontUpdateHover, deleteAttachedObjects:deleteAttachedObjects });\n }\n return _currentInstance;\n };\n\n this.deleteEveryEndpoint = function () {\n var _is = _currentInstance.setSuspendDrawing(true);\n for (var id in endpointsByElement) {\n var endpoints = endpointsByElement[id];\n if (endpoints && endpoints.length) {\n for (var i = 0, j = endpoints.length; i < j; i++) {\n _currentInstance.deleteEndpoint(endpoints[i], true);\n }\n }\n }\n endpointsByElement = {};\n managedElements = {};\n endpointsByUUID = {};\n offsets = {};\n offsetTimestamps = {};\n _currentInstance.anchorManager.reset();\n var dm = _currentInstance.getDragManager();\n if (dm) {\n dm.reset();\n }\n if (!_is) {\n _currentInstance.setSuspendDrawing(false);\n }\n return _currentInstance;\n };\n\n var fireDetachEvent = function (jpc, doFireEvent, originalEvent) {\n // may have been given a connection, or in special cases, an object\n var connType = _currentInstance.Defaults.ConnectionType || _currentInstance.getDefaultConnectionType(),\n argIsConnection = jpc.constructor === connType,\n params = argIsConnection ? {\n connection: jpc,\n source: jpc.source, target: jpc.target,\n sourceId: jpc.sourceId, targetId: jpc.targetId,\n sourceEndpoint: jpc.endpoints[0], targetEndpoint: jpc.endpoints[1]\n } : jpc;\n\n if (doFireEvent) {\n _currentInstance.fire(\"connectionDetached\", params, originalEvent);\n }\n\n // always fire this. used by internal jsplumb stuff.\n _currentInstance.fire(\"internal.connectionDetached\", params, originalEvent);\n\n _currentInstance.anchorManager.connectionDetached(params);\n };\n\n var fireMoveEvent = _currentInstance.fireMoveEvent = function (params, evt) {\n _currentInstance.fire(\"connectionMoved\", params, evt);\n };\n\n this.unregisterEndpoint = function (endpoint) {\n if (endpoint._jsPlumb.uuid) {\n endpointsByUUID[endpoint._jsPlumb.uuid] = null;\n }\n _currentInstance.anchorManager.deleteEndpoint(endpoint);\n // TODO at least replace this with a removeWithFunction call.\n for (var e in endpointsByElement) {\n var endpoints = endpointsByElement[e];\n if (endpoints) {\n var newEndpoints = [];\n for (var i = 0, j = endpoints.length; i < j; i++) {\n if (endpoints[i] !== endpoint) {\n newEndpoints.push(endpoints[i]);\n }\n }\n\n endpointsByElement[e] = newEndpoints;\n }\n if (endpointsByElement[e].length < 1) {\n delete endpointsByElement[e];\n }\n }\n };\n\n var IS_DETACH_ALLOWED = \"isDetachAllowed\";\n var BEFORE_DETACH = \"beforeDetach\";\n var CHECK_CONDITION = \"checkCondition\";\n\n /**\n * Deletes a Connection.\n * @method deleteConnection\n * @param connection Connection to delete\n * @param {Object} [params] Optional delete parameters\n * @param {Boolean} [params.doNotFireEvent=false] If true, a connection detached event will not be fired. Otherwise one will.\n * @param {Boolean} [params.force=false] If true, the connection will be deleted even if a beforeDetach interceptor tries to stop the deletion.\n * @returns {Boolean} True if the connection was deleted, false otherwise.\n */\n this.deleteConnection = function(connection, params) {\n\n if (connection != null) {\n params = params || {};\n\n if (params.force || _ju.functionChain(true, false, [\n [ connection.endpoints[0], IS_DETACH_ALLOWED, [ connection ] ],\n [ connection.endpoints[1], IS_DETACH_ALLOWED, [ connection ] ],\n [ connection, IS_DETACH_ALLOWED, [ connection ] ],\n [ _currentInstance, CHECK_CONDITION, [ BEFORE_DETACH, connection ] ]\n ])) {\n\n connection.setHover(false);\n fireDetachEvent(connection, !connection.pending && params.fireEvent !== false, params.originalEvent);\n\n connection.endpoints[0].detachFromConnection(connection);\n connection.endpoints[1].detachFromConnection(connection);\n _ju.removeWithFunction(connections, function (_c) {\n return connection.id === _c.id;\n });\n\n connection.cleanup();\n connection.destroy();\n return true;\n }\n }\n return false;\n };\n\n /**\n * Remove all Connections from all elements, but leaves Endpoints in place ((unless a connection is set to auto delete its Endpoints).\n * @method deleteEveryConnection\n * @param {Object} [params] optional params object for the call\n * @param {Boolean} [params.fireEvent=true] Whether or not to fire detach events\n * @param {Boolean} [params.forceDetach=false] If true, this call will ignore any `beforeDetach` interceptors.\n * @returns {Number} The number of connections that were deleted.\n */\n this.deleteEveryConnection = function (params) {\n params = params || {};\n var count = connections.length, deletedCount = 0;\n _currentInstance.batch(function () {\n for (var i = 0; i < count; i++) {\n deletedCount += _currentInstance.deleteConnection(connections[0], params) ? 1 : 0;\n }\n });\n return deletedCount;\n };\n\n /**\n * Removes all an element's Connections.\n * @method deleteConnectionsForElement\n * @param {Object} el Either the id of the element, or a selector for the element.\n * @param {Object} [params] Optional parameters.\n * @param {Boolean} [params.fireEvent=true] Whether or not to fire the detach event.\n * @param {Boolean} [params.forceDetach=false] If true, this call will ignore any `beforeDetach` interceptors.\n * @return {jsPlumbInstance} The current jsPlumb instance.\n */\n this.deleteConnectionsForElement = function (el, params) {\n params = params || {};\n el = _currentInstance.getElement(el);\n var id = _getId(el), endpoints = endpointsByElement[id];\n if (endpoints && endpoints.length) {\n for (var i = 0, j = endpoints.length; i < j; i++) {\n endpoints[i].deleteEveryConnection(params);\n }\n }\n return _currentInstance;\n };\n\n /// not public. but of course its exposed. how to change this.\n this.deleteObject = function (params) {\n var result = {\n endpoints: {},\n connections: {},\n endpointCount: 0,\n connectionCount: 0\n },\n deleteAttachedObjects = params.deleteAttachedObjects !== false;\n\n var unravelConnection = function (connection) {\n if (connection != null && result.connections[connection.id] == null) {\n if (!params.dontUpdateHover && connection._jsPlumb != null) {\n connection.setHover(false);\n }\n result.connections[connection.id] = connection;\n result.connectionCount++;\n }\n };\n var unravelEndpoint = function (endpoint) {\n if (endpoint != null && result.endpoints[endpoint.id] == null) {\n if (!params.dontUpdateHover && endpoint._jsPlumb != null) {\n endpoint.setHover(false);\n }\n result.endpoints[endpoint.id] = endpoint;\n result.endpointCount++;\n\n if (deleteAttachedObjects) {\n for (var i = 0; i < endpoint.connections.length; i++) {\n var c = endpoint.connections[i];\n unravelConnection(c);\n }\n }\n }\n };\n\n if (params.connection) {\n unravelConnection(params.connection);\n }\n else {\n unravelEndpoint(params.endpoint);\n }\n\n // loop through connections\n for (var i in result.connections) {\n var c = result.connections[i];\n if (c._jsPlumb) {\n _ju.removeWithFunction(connections, function (_c) {\n return c.id === _c.id;\n });\n\n fireDetachEvent(c, params.fireEvent === false ? false : !c.pending, params.originalEvent);\n var doNotCleanup = params.deleteAttachedObjects == null ? null : !params.deleteAttachedObjects;\n\n c.endpoints[0].detachFromConnection(c, null, doNotCleanup);\n c.endpoints[1].detachFromConnection(c, null, doNotCleanup);\n\n c.cleanup(true);\n c.destroy(true);\n }\n }\n\n // loop through endpoints\n for (var j in result.endpoints) {\n var e = result.endpoints[j];\n if (e._jsPlumb) {\n _currentInstance.unregisterEndpoint(e);\n // FIRE some endpoint deleted event?\n e.cleanup(true);\n e.destroy(true);\n }\n }\n\n return result;\n };\n\n\n // helpers for select/selectEndpoints\n var _setOperation = function (list, func, args, selector) {\n for (var i = 0, j = list.length; i < j; i++) {\n list[i][func].apply(list[i], args);\n }\n return selector(list);\n },\n _getOperation = function (list, func, args) {\n var out = [];\n for (var i = 0, j = list.length; i < j; i++) {\n out.push([ list[i][func].apply(list[i], args), list[i] ]);\n }\n return out;\n },\n setter = function (list, func, selector) {\n return function () {\n return _setOperation(list, func, arguments, selector);\n };\n },\n getter = function (list, func) {\n return function () {\n return _getOperation(list, func, arguments);\n };\n },\n prepareList = function (input, doNotGetIds) {\n var r = [];\n if (input) {\n if (typeof input === 'string') {\n if (input === \"*\") {\n return input;\n }\n r.push(input);\n }\n else {\n if (doNotGetIds) {\n r = input;\n }\n else {\n if (input.length) {\n for (var i = 0, j = input.length; i < j; i++) {\n r.push(_info(input[i]).id);\n }\n }\n else {\n r.push(_info(input).id);\n }\n }\n }\n }\n return r;\n },\n filterList = function (list, value, missingIsFalse) {\n if (list === \"*\") {\n return true;\n }\n return list.length > 0 ? list.indexOf(value) !== -1 : !missingIsFalse;\n };\n\n // get some connections, specifying source/target/scope\n this.getConnections = function (options, flat) {\n if (!options) {\n options = {};\n } else if (options.constructor === String) {\n options = { \"scope\": options };\n }\n var scope = options.scope || _currentInstance.getDefaultScope(),\n scopes = prepareList(scope, true),\n sources = prepareList(options.source),\n targets = prepareList(options.target),\n results = (!flat && scopes.length > 1) ? {} : [],\n _addOne = function (scope, obj) {\n if (!flat && scopes.length > 1) {\n var ss = results[scope];\n if (ss == null) {\n ss = results[scope] = [];\n }\n ss.push(obj);\n } else {\n results.push(obj);\n }\n };\n\n for (var j = 0, jj = connections.length; j < jj; j++) {\n var c = connections[j],\n sourceId = c.proxies && c.proxies[0] ? c.proxies[0].originalEp.elementId : c.sourceId,\n targetId = c.proxies && c.proxies[1] ? c.proxies[1].originalEp.elementId : c.targetId;\n\n if (filterList(scopes, c.scope) && filterList(sources, sourceId) && filterList(targets, targetId)) {\n _addOne(c.scope, c);\n }\n }\n\n return results;\n };\n\n var _curryEach = function (list, executor) {\n return function (f) {\n for (var i = 0, ii = list.length; i < ii; i++) {\n f(list[i]);\n }\n return executor(list);\n };\n },\n _curryGet = function (list) {\n return function (idx) {\n return list[idx];\n };\n };\n\n var _makeCommonSelectHandler = function (list, executor) {\n var out = {\n length: list.length,\n each: _curryEach(list, executor),\n get: _curryGet(list)\n },\n setters = [\"setHover\", \"removeAllOverlays\", \"setLabel\", \"addClass\", \"addOverlay\", \"removeOverlay\",\n \"removeOverlays\", \"showOverlay\", \"hideOverlay\", \"showOverlays\", \"hideOverlays\", \"setPaintStyle\",\n \"setHoverPaintStyle\", \"setSuspendEvents\", \"setParameter\", \"setParameters\", \"setVisible\",\n \"repaint\", \"addType\", \"toggleType\", \"removeType\", \"removeClass\", \"setType\", \"bind\", \"unbind\" ],\n\n getters = [\"getLabel\", \"getOverlay\", \"isHover\", \"getParameter\", \"getParameters\", \"getPaintStyle\",\n \"getHoverPaintStyle\", \"isVisible\", \"hasType\", \"getType\", \"isSuspendEvents\" ],\n i, ii;\n\n for (i = 0, ii = setters.length; i < ii; i++) {\n out[setters[i]] = setter(list, setters[i], executor);\n }\n\n for (i = 0, ii = getters.length; i < ii; i++) {\n out[getters[i]] = getter(list, getters[i]);\n }\n\n return out;\n };\n\n var _makeConnectionSelectHandler = function (list) {\n var common = _makeCommonSelectHandler(list, _makeConnectionSelectHandler);\n return jsPlumb.extend(common, {\n // setters\n setDetachable: setter(list, \"setDetachable\", _makeConnectionSelectHandler),\n setReattach: setter(list, \"setReattach\", _makeConnectionSelectHandler),\n setConnector: setter(list, \"setConnector\", _makeConnectionSelectHandler),\n delete: function () {\n for (var i = 0, ii = list.length; i < ii; i++) {\n _currentInstance.deleteConnection(list[i]);\n }\n },\n // getters\n isDetachable: getter(list, \"isDetachable\"),\n isReattach: getter(list, \"isReattach\")\n });\n };\n\n var _makeEndpointSelectHandler = function (list) {\n var common = _makeCommonSelectHandler(list, _makeEndpointSelectHandler);\n return jsPlumb.extend(common, {\n setEnabled: setter(list, \"setEnabled\", _makeEndpointSelectHandler),\n setAnchor: setter(list, \"setAnchor\", _makeEndpointSelectHandler),\n isEnabled: getter(list, \"isEnabled\"),\n deleteEveryConnection: function () {\n for (var i = 0, ii = list.length; i < ii; i++) {\n list[i].deleteEveryConnection();\n }\n },\n \"delete\": function () {\n for (var i = 0, ii = list.length; i < ii; i++) {\n _currentInstance.deleteEndpoint(list[i]);\n }\n }\n });\n };\n\n this.select = function (params) {\n params = params || {};\n params.scope = params.scope || \"*\";\n return _makeConnectionSelectHandler(params.connections || _currentInstance.getConnections(params, true));\n };\n\n this.selectEndpoints = function (params) {\n params = params || {};\n params.scope = params.scope || \"*\";\n var noElementFilters = !params.element && !params.source && !params.target,\n elements = noElementFilters ? \"*\" : prepareList(params.element),\n sources = noElementFilters ? \"*\" : prepareList(params.source),\n targets = noElementFilters ? \"*\" : prepareList(params.target),\n scopes = prepareList(params.scope, true);\n\n var ep = [];\n\n for (var el in endpointsByElement) {\n var either = filterList(elements, el, true),\n source = filterList(sources, el, true),\n sourceMatchExact = sources !== \"*\",\n target = filterList(targets, el, true),\n targetMatchExact = targets !== \"*\";\n\n // if they requested 'either' then just match scope. otherwise if they requested 'source' (not as a wildcard) then we have to match only endpoints that have isSource set to to true, and the same thing with isTarget.\n if (either || source || target) {\n inner:\n for (var i = 0, ii = endpointsByElement[el].length; i < ii; i++) {\n var _ep = endpointsByElement[el][i];\n if (filterList(scopes, _ep.scope, true)) {\n\n var noMatchSource = (sourceMatchExact && sources.length > 0 && !_ep.isSource),\n noMatchTarget = (targetMatchExact && targets.length > 0 && !_ep.isTarget);\n\n if (noMatchSource || noMatchTarget) {\n continue inner;\n }\n\n ep.push(_ep);\n }\n }\n }\n }\n\n return _makeEndpointSelectHandler(ep);\n };\n\n // get all connections managed by the instance of jsplumb.\n this.getAllConnections = function () {\n return connections;\n };\n this.getDefaultScope = function () {\n return DEFAULT_SCOPE;\n };\n // get an endpoint by uuid.\n this.getEndpoint = _getEndpoint;\n /**\n * Gets the list of Endpoints for a given element.\n * @method getEndpoints\n * @param {String|Element|Selector} el The element to get endpoints for.\n * @return {Endpoint[]} An array of Endpoints for the specified element.\n */\n this.getEndpoints = function (el) {\n return endpointsByElement[_info(el).id] || [];\n };\n // gets the default endpoint type. used when subclassing. see wiki.\n this.getDefaultEndpointType = function () {\n return jsPlumb.Endpoint;\n };\n // gets the default connection type. used when subclassing. see wiki.\n this.getDefaultConnectionType = function () {\n return jsPlumb.Connection;\n };\n /*\n * Gets an element's id, creating one if necessary. really only exposed\n * for the lib-specific functionality to access; would be better to pass\n * the current instance into the lib-specific code (even though this is\n * a static call. i just don't want to expose it to the public API).\n */\n this.getId = _getId;\n this.draw = _draw;\n this.info = _info;\n\n this.appendElement = _appendElement;\n\n var _hoverSuspended = false;\n this.isHoverSuspended = function () {\n return _hoverSuspended;\n };\n this.setHoverSuspended = function (s) {\n _hoverSuspended = s;\n };\n\n // set an element's connections to be hidden\n this.hide = function (el, changeEndpoints) {\n _setVisible(el, \"none\", changeEndpoints);\n return _currentInstance;\n };\n\n // exposed for other objects to use to get a unique id.\n this.idstamp = _idstamp;\n\n // ensure that, if the current container exists, it is a DOM element and not a selector.\n // if it does not exist and `candidate` is supplied, the offset parent of that element will be set as the Container.\n // this is used to do a better default behaviour for the case that the user has not set a container:\n // addEndpoint, makeSource, makeTarget and connect all call this method with the offsetParent of the\n // element in question (for connect it is the source element). So if no container is set, it is inferred\n // to be the offsetParent of the first element the user tries to connect.\n var _ensureContainer = function (candidate) {\n if (!_container && candidate) {\n var can = _currentInstance.getElement(candidate);\n if (can.offsetParent) {\n _currentInstance.setContainer(can.offsetParent);\n }\n }\n };\n\n var _getContainerFromDefaults = function () {\n if (_currentInstance.Defaults.Container) {\n _currentInstance.setContainer(_currentInstance.Defaults.Container);\n }\n };\n\n // check if a given element is managed or not. if not, add to our map. if drawing is not suspended then\n // we'll also stash its dimensions; otherwise we'll do this in a lazy way through updateOffset.\n var _manage = _currentInstance.manage = function (id, element, _transient) {\n if (!managedElements[id]) {\n managedElements[id] = {\n el: element,\n endpoints: [],\n connections: []\n };\n\n managedElements[id].info = _updateOffset({ elId: id, timestamp: _suspendedAt });\n _currentInstance.addClass(element, \"jtk-managed\");\n if (!_transient) {\n _currentInstance.fire(\"manageElement\", { id:id, info:managedElements[id].info, el:element });\n }\n }\n\n return managedElements[id];\n };\n\n var _unmanage = _currentInstance.unmanage = function(id) {\n if (managedElements[id]) {\n _currentInstance.removeClass(managedElements[id].el, \"jtk-managed\");\n delete managedElements[id];\n _currentInstance.fire(\"unmanageElement\", id);\n }\n };\n\n /**\n * updates the offset and size for a given element, and stores the\n * values. if 'offset' is not null we use that (it would have been\n * passed in from a drag call) because it's faster; but if it is null,\n * or if 'recalc' is true in order to force a recalculation, we get the current values.\n * @method updateOffset\n */\n var _updateOffset = function (params) {\n\n var timestamp = params.timestamp, recalc = params.recalc, offset = params.offset, elId = params.elId, s;\n if (_suspendDrawing && !timestamp) {\n timestamp = _suspendedAt;\n }\n if (!recalc) {\n if (timestamp && timestamp === offsetTimestamps[elId]) {\n return {o: params.offset || offsets[elId], s: sizes[elId]};\n }\n }\n if (recalc || (!offset && offsets[elId] == null)) { // if forced repaint or no offset available, we recalculate.\n\n // get the current size and offset, and store them\n s = managedElements[elId] ? managedElements[elId].el : null;\n if (s != null) {\n sizes[elId] = _currentInstance.getSize(s);\n offsets[elId] = _currentInstance.getOffset(s);\n offsetTimestamps[elId] = timestamp;\n }\n } else {\n offsets[elId] = offset || offsets[elId];\n if (sizes[elId] == null) {\n s = managedElements[elId].el;\n if (s != null) {\n sizes[elId] = _currentInstance.getSize(s);\n }\n }\n offsetTimestamps[elId] = timestamp;\n }\n\n if (offsets[elId] && !offsets[elId].right) {\n offsets[elId].right = offsets[elId].left + sizes[elId][0];\n offsets[elId].bottom = offsets[elId].top + sizes[elId][1];\n offsets[elId].width = sizes[elId][0];\n offsets[elId].height = sizes[elId][1];\n offsets[elId].centerx = offsets[elId].left + (offsets[elId].width / 2);\n offsets[elId].centery = offsets[elId].top + (offsets[elId].height / 2);\n }\n\n return {o: offsets[elId], s: sizes[elId]};\n };\n\n this.updateOffset = _updateOffset;\n\n /**\n * callback from the current library to tell us to prepare ourselves (attach\n * mouse listeners etc; can't do that until the library has provided a bind method)\n */\n this.init = function () {\n if (!initialized) {\n _getContainerFromDefaults();\n _currentInstance.anchorManager = new root.jsPlumb.AnchorManager({jsPlumbInstance: _currentInstance});\n initialized = true;\n _currentInstance.fire(\"ready\", _currentInstance);\n }\n }.bind(this);\n\n this.log = log;\n this.jsPlumbUIComponent = jsPlumbUIComponent;\n\n /*\n * Creates an anchor with the given params.\n *\n *\n * Returns: The newly created Anchor.\n * Throws: an error if a named anchor was not found.\n */\n this.makeAnchor = function () {\n var pp, _a = function (t, p) {\n if (root.jsPlumb.Anchors[t]) {\n return new root.jsPlumb.Anchors[t](p);\n }\n if (!_currentInstance.Defaults.DoNotThrowErrors) {\n throw { msg: \"jsPlumb: unknown anchor type '\" + t + \"'\" };\n }\n };\n if (arguments.length === 0) {\n return null;\n }\n var specimen = arguments[0], elementId = arguments[1], jsPlumbInstance = arguments[2], newAnchor = null;\n // if it appears to be an anchor already...\n if (specimen.compute && specimen.getOrientation) {\n return specimen;\n } //TODO hazy here about whether it should be added or is already added somehow.\n // is it the name of an anchor type?\n else if (typeof specimen === \"string\") {\n newAnchor = _a(arguments[0], {elementId: elementId, jsPlumbInstance: _currentInstance});\n }\n // is it an array? it will be one of:\n // an array of [spec, params] - this defines a single anchor, which may be dynamic, but has parameters.\n // an array of arrays - this defines some dynamic anchors\n // an array of numbers - this defines a single anchor.\n else if (_ju.isArray(specimen)) {\n if (_ju.isArray(specimen[0]) || _ju.isString(specimen[0])) {\n // if [spec, params] format\n if (specimen.length === 2 && _ju.isObject(specimen[1])) {\n // if first arg is a string, its a named anchor with params\n if (_ju.isString(specimen[0])) {\n pp = root.jsPlumb.extend({elementId: elementId, jsPlumbInstance: _currentInstance}, specimen[1]);\n newAnchor = _a(specimen[0], pp);\n }\n // otherwise first arg is array, second is params. we treat as a dynamic anchor, which is fine\n // even if the first arg has only one entry. you could argue all anchors should be implicitly dynamic in fact.\n else {\n pp = root.jsPlumb.extend({elementId: elementId, jsPlumbInstance: _currentInstance, anchors: specimen[0]}, specimen[1]);\n newAnchor = new root.jsPlumb.DynamicAnchor(pp);\n }\n }\n else {\n newAnchor = new jsPlumb.DynamicAnchor({anchors: specimen, selector: null, elementId: elementId, jsPlumbInstance: _currentInstance});\n }\n\n }\n else {\n var anchorParams = {\n x: specimen[0], y: specimen[1],\n orientation: (specimen.length >= 4) ? [ specimen[2], specimen[3] ] : [0, 0],\n offsets: (specimen.length >= 6) ? [ specimen[4], specimen[5] ] : [ 0, 0 ],\n elementId: elementId,\n jsPlumbInstance: _currentInstance,\n cssClass: specimen.length === 7 ? specimen[6] : null\n };\n newAnchor = new root.jsPlumb.Anchor(anchorParams);\n newAnchor.clone = function () {\n return new root.jsPlumb.Anchor(anchorParams);\n };\n }\n }\n\n if (!newAnchor.id) {\n newAnchor.id = \"anchor_\" + _idstamp();\n }\n return newAnchor;\n };\n\n /**\n * makes a list of anchors from the given list of types or coords, eg\n * [\"TopCenter\", \"RightMiddle\", \"BottomCenter\", [0, 1, -1, -1] ]\n */\n this.makeAnchors = function (types, elementId, jsPlumbInstance) {\n var r = [];\n for (var i = 0, ii = types.length; i < ii; i++) {\n if (typeof types[i] === \"string\") {\n r.push(root.jsPlumb.Anchors[types[i]]({elementId: elementId, jsPlumbInstance: jsPlumbInstance}));\n }\n else if (_ju.isArray(types[i])) {\n r.push(_currentInstance.makeAnchor(types[i], elementId, jsPlumbInstance));\n }\n }\n return r;\n };\n\n /**\n * Makes a dynamic anchor from the given list of anchors (which may be in shorthand notation as strings or dimension arrays, or Anchor\n * objects themselves) and the given, optional, anchorSelector function (jsPlumb uses a default if this is not provided; most people will\n * not need to provide this - i think).\n */\n this.makeDynamicAnchor = function (anchors, anchorSelector) {\n return new root.jsPlumb.DynamicAnchor({anchors: anchors, selector: anchorSelector, elementId: null, jsPlumbInstance: _currentInstance});\n };\n\n// --------------------- makeSource/makeTarget ----------------------------------------------\n\n this.targetEndpointDefinitions = {};\n this.sourceEndpointDefinitions = {};\n\n var selectorFilter = function (evt, _el, selector, _instance, negate) {\n var t = evt.target || evt.srcElement, ok = false,\n sel = _instance.getSelector(_el, selector);\n for (var j = 0; j < sel.length; j++) {\n if (sel[j] === t) {\n ok = true;\n break;\n }\n }\n return negate ? !ok : ok;\n };\n\n var _makeElementDropHandler = function (elInfo, p, dropOptions, isSource, isTarget) {\n var proxyComponent = new jsPlumbUIComponent(p);\n var _drop = p._jsPlumb.EndpointDropHandler({\n jsPlumb: _currentInstance,\n enabled: function () {\n return elInfo.def.enabled;\n },\n isFull: function () {\n var targetCount = _currentInstance.select({target: elInfo.id}).length;\n return elInfo.def.maxConnections > 0 && targetCount >= elInfo.def.maxConnections;\n },\n element: elInfo.el,\n elementId: elInfo.id,\n isSource: isSource,\n isTarget: isTarget,\n addClass: function (clazz) {\n _currentInstance.addClass(elInfo.el, clazz);\n },\n removeClass: function (clazz) {\n _currentInstance.removeClass(elInfo.el, clazz);\n },\n onDrop: function (jpc) {\n var source = jpc.endpoints[0];\n source.anchor.unlock();\n },\n isDropAllowed: function () {\n return proxyComponent.isDropAllowed.apply(proxyComponent, arguments);\n },\n isRedrop:function(jpc) {\n return (jpc.suspendedElement != null && jpc.suspendedEndpoint != null && jpc.suspendedEndpoint.element === elInfo.el);\n },\n getEndpoint: function (jpc) {\n\n // make a new Endpoint for the target, or get it from the cache if uniqueEndpoint\n // is set. if its a redrop the new endpoint will be immediately cleaned up.\n\n var newEndpoint = elInfo.def.endpoint;\n\n // if no cached endpoint, or there was one but it has been cleaned up\n // (ie. detached), create a new one\n if (newEndpoint == null || newEndpoint._jsPlumb == null) {\n var eps = _currentInstance.deriveEndpointAndAnchorSpec(jpc.getType().join(\" \"), true);\n var pp = eps.endpoints ? root.jsPlumb.extend(p, {\n endpoint:elInfo.def.def.endpoint || eps.endpoints[1]\n }) :p;\n if (eps.anchors) {\n pp = root.jsPlumb.extend(pp, {\n anchor:elInfo.def.def.anchor || eps.anchors[1]\n });\n }\n newEndpoint = _currentInstance.addEndpoint(elInfo.el, pp);\n newEndpoint._mtNew = true;\n }\n\n if (p.uniqueEndpoint) {\n elInfo.def.endpoint = newEndpoint;\n }\n\n newEndpoint.setDeleteOnEmpty(true);\n\n // if connection is detachable, init the new endpoint to be draggable, to support that happening.\n if (jpc.isDetachable()) {\n newEndpoint.initDraggable();\n }\n\n // if the anchor has a 'positionFinder' set, then delegate to that function to find\n // out where to locate the anchor.\n if (newEndpoint.anchor.positionFinder != null) {\n var dropPosition = _currentInstance.getUIPosition(arguments, _currentInstance.getZoom()),\n elPosition = _currentInstance.getOffset(elInfo.el),\n elSize = _currentInstance.getSize(elInfo.el),\n ap = dropPosition == null ? [0,0] : newEndpoint.anchor.positionFinder(dropPosition, elPosition, elSize, newEndpoint.anchor.constructorParams);\n\n newEndpoint.anchor.x = ap[0];\n newEndpoint.anchor.y = ap[1];\n // now figure an orientation for it..kind of hard to know what to do actually. probably the best thing i can do is to\n // support specifying an orientation in the anchor's spec. if one is not supplied then i will make the orientation\n // be what will cause the most natural link to the source: it will be pointing at the source, but it needs to be\n // specified in one axis only, and so how to make that choice? i think i will use whichever axis is the one in which\n // the target is furthest away from the source.\n }\n\n return newEndpoint;\n },\n maybeCleanup: function (ep) {\n if (ep._mtNew && ep.connections.length === 0) {\n _currentInstance.deleteObject({endpoint: ep});\n }\n else {\n delete ep._mtNew;\n }\n }\n });\n\n // wrap drop events as needed and initialise droppable\n var dropEvent = root.jsPlumb.dragEvents.drop;\n dropOptions.scope = dropOptions.scope || (p.scope || _currentInstance.Defaults.Scope);\n dropOptions[dropEvent] = _ju.wrap(dropOptions[dropEvent], _drop, true);\n dropOptions.rank = p.rank || 0;\n\n // if target, return true from the over event. this will cause katavorio to stop setting drops to hover\n // if multipleDrop is set to false.\n if (isTarget) {\n dropOptions[root.jsPlumb.dragEvents.over] = function () { return true; };\n }\n\n // vanilla jsplumb only\n if (p.allowLoopback === false) {\n dropOptions.canDrop = function (_drag) {\n var de = _drag.getDragElement()._jsPlumbRelatedElement;\n return de !== elInfo.el;\n };\n }\n _currentInstance.initDroppable(elInfo.el, dropOptions, \"internal\");\n\n return _drop;\n\n };\n\n // see API docs\n this.makeTarget = function (el, params, referenceParams) {\n\n // put jsplumb ref into params without altering the params passed in\n var p = root.jsPlumb.extend({_jsPlumb: this}, referenceParams);\n root.jsPlumb.extend(p, params);\n\n var maxConnections = p.maxConnections || -1,\n\n _doOne = function (el) {\n\n // get the element's id and store the endpoint definition for it. jsPlumb.connect calls will look for one of these,\n // and use the endpoint definition if found.\n // decode the info for this element (id and element)\n var elInfo = _info(el),\n elid = elInfo.id,\n dropOptions = root.jsPlumb.extend({}, p.dropOptions || {}),\n type = p.connectionType || \"default\";\n\n this.targetEndpointDefinitions[elid] = this.targetEndpointDefinitions[elid] || {};\n\n _ensureContainer(elid);\n\n // if this is a group and the user has not mandated a rank, set to -1 so that Nodes takes\n // precedence.\n if (elInfo.el._isJsPlumbGroup && dropOptions.rank == null) {\n dropOptions.rank = -1;\n }\n\n // store the definition\n var _def = {\n def: root.jsPlumb.extend({}, p),\n uniqueEndpoint: p.uniqueEndpoint,\n maxConnections: maxConnections,\n enabled: true\n };\n\n if (p.createEndpoint) {\n _def.uniqueEndpoint = true;\n _def.endpoint = _currentInstance.addEndpoint(el, _def.def);\n _def.endpoint.setDeleteOnEmpty(false);\n }\n\n elInfo.def = _def;\n this.targetEndpointDefinitions[elid][type] = _def;\n _makeElementDropHandler(elInfo, p, dropOptions, p.isSource === true, true);\n // stash the definition on the drop\n elInfo.el._katavorioDrop[elInfo.el._katavorioDrop.length - 1].targetDef = _def;\n\n }.bind(this);\n\n // make an array if only given one element\n var inputs = el.length && el.constructor !== String ? el : [ el ];\n\n // register each one in the list.\n for (var i = 0, ii = inputs.length; i < ii; i++) {\n _doOne(inputs[i]);\n }\n\n return this;\n };\n\n // see api docs\n this.unmakeTarget = function (el, doNotClearArrays) {\n var info = _info(el);\n _currentInstance.destroyDroppable(info.el, \"internal\");\n if (!doNotClearArrays) {\n delete this.targetEndpointDefinitions[info.id];\n }\n\n return this;\n };\n\n // see api docs\n this.makeSource = function (el, params, referenceParams) {\n var p = root.jsPlumb.extend({_jsPlumb: this}, referenceParams);\n root.jsPlumb.extend(p, params);\n var type = p.connectionType || \"default\";\n var aae = _currentInstance.deriveEndpointAndAnchorSpec(type);\n p.endpoint = p.endpoint || aae.endpoints[0];\n p.anchor = p.anchor || aae.anchors[0];\n var maxConnections = p.maxConnections || -1,\n onMaxConnections = p.onMaxConnections,\n _doOne = function (elInfo) {\n // get the element's id and store the endpoint definition for it. jsPlumb.connect calls will look for one of these,\n // and use the endpoint definition if found.\n var elid = elInfo.id,\n _del = this.getElement(elInfo.el);\n\n this.sourceEndpointDefinitions[elid] = this.sourceEndpointDefinitions[elid] || {};\n _ensureContainer(elid);\n\n var _def = {\n def:root.jsPlumb.extend({}, p),\n uniqueEndpoint: p.uniqueEndpoint,\n maxConnections: maxConnections,\n enabled: true\n };\n\n if (p.createEndpoint) {\n _def.uniqueEndpoint = true;\n _def.endpoint = _currentInstance.addEndpoint(el, _def.def);\n _def.endpoint.setDeleteOnEmpty(false);\n }\n\n this.sourceEndpointDefinitions[elid][type] = _def;\n elInfo.def = _def;\n\n var stopEvent = root.jsPlumb.dragEvents.stop,\n dragEvent = root.jsPlumb.dragEvents.drag,\n dragOptions = root.jsPlumb.extend({ }, p.dragOptions || {}),\n existingDrag = dragOptions.drag,\n existingStop = dragOptions.stop,\n ep = null,\n endpointAddedButNoDragYet = false;\n\n // set scope if its not set in dragOptions but was passed in in params\n dragOptions.scope = dragOptions.scope || p.scope;\n\n dragOptions[dragEvent] = _ju.wrap(dragOptions[dragEvent], function () {\n if (existingDrag) {\n existingDrag.apply(this, arguments);\n }\n endpointAddedButNoDragYet = false;\n });\n\n dragOptions[stopEvent] = _ju.wrap(dragOptions[stopEvent], function () {\n\n if (existingStop) {\n existingStop.apply(this, arguments);\n }\n this.currentlyDragging = false;\n if (ep._jsPlumb != null) { // if not cleaned up...\n\n // reset the anchor to the anchor that was initially provided. the one we were using to drag\n // the connection was just a placeholder that was located at the place the user pressed the\n // mouse button to initiate the drag.\n var anchorDef = p.anchor || this.Defaults.Anchor,\n oldAnchor = ep.anchor,\n oldConnection = ep.connections[0];\n\n var newAnchor = this.makeAnchor(anchorDef, elid, this),\n _el = ep.element;\n\n // if the anchor has a 'positionFinder' set, then delegate to that function to find\n // out where to locate the anchor. issue 117.\n if (newAnchor.positionFinder != null) {\n var elPosition = _currentInstance.getOffset(_el),\n elSize = this.getSize(_el),\n dropPosition = { left: elPosition.left + (oldAnchor.x * elSize[0]), top: elPosition.top + (oldAnchor.y * elSize[1]) },\n ap = newAnchor.positionFinder(dropPosition, elPosition, elSize, newAnchor.constructorParams);\n\n newAnchor.x = ap[0];\n newAnchor.y = ap[1];\n }\n\n ep.setAnchor(newAnchor, true);\n ep.repaint();\n this.repaint(ep.elementId);\n if (oldConnection != null) {\n this.repaint(oldConnection.targetId);\n }\n }\n }.bind(this));\n\n // when the user presses the mouse, add an Endpoint, if we are enabled.\n var mouseDownListener = function (e) {\n // on right mouse button, abort.\n if (e.which === 3 || e.button === 2) {\n return;\n }\n\n // TODO store def on element.\n var def = this.sourceEndpointDefinitions[elid][type];\n\n // if disabled, return.\n if (!def.enabled) {\n return;\n }\n\n elid = this.getId(this.getElement(elInfo.el)); // elid might have changed since this method was called to configure the element.\n\n // if a filter was given, run it, and return if it says no.\n if (p.filter) {\n var r = _ju.isString(p.filter) ? selectorFilter(e, elInfo.el, p.filter, this, p.filterExclude) : p.filter(e, elInfo.el);\n if (r === false) {\n return;\n }\n }\n\n // if maxConnections reached\n var sourceCount = this.select({source: elid}).length;\n if (def.maxConnections >= 0 && (sourceCount >= def.maxConnections)) {\n if (onMaxConnections) {\n onMaxConnections({\n element: elInfo.el,\n maxConnections: maxConnections\n }, e);\n }\n return false;\n }\n\n // find the position on the element at which the mouse was pressed; this is where the endpoint\n // will be located.\n var elxy = root.jsPlumb.getPositionOnElement(e, _del, _zoom);\n\n // we need to override the anchor in here, and force 'isSource', but we don't want to mess with\n // the params passed in, because after a connection is established we're going to reset the endpoint\n // to have the anchor we were given.\n var tempEndpointParams = {};\n root.jsPlumb.extend(tempEndpointParams, p);\n tempEndpointParams.isTemporarySource = true;\n tempEndpointParams.anchor = [ elxy[0], elxy[1] , 0, 0];\n tempEndpointParams.dragOptions = dragOptions;\n\n if (def.def.scope) {\n tempEndpointParams.scope = def.def.scope;\n }\n\n ep = this.addEndpoint(elid, tempEndpointParams);\n endpointAddedButNoDragYet = true;\n ep.setDeleteOnEmpty(true);\n\n // if unique endpoint and it's already been created, push it onto the endpoint we create. at the end\n // of a successful connection we'll switch to that endpoint.\n // TODO this is the same code as the programmatic endpoints create on line 1050 ish\n if (def.uniqueEndpoint) {\n if (!def.endpoint) {\n def.endpoint = ep;\n ep.setDeleteOnEmpty(false);\n }\n else {\n ep.finalEndpoint = def.endpoint;\n }\n }\n\n var _delTempEndpoint = function () {\n // this mouseup event is fired only if no dragging occurred, by jquery and yui, but for mootools\n // it is fired even if dragging has occurred, in which case we would blow away a perfectly\n // legitimate endpoint, were it not for this check. the flag is set after adding an\n // endpoint and cleared in a drag listener we set in the dragOptions above.\n _currentInstance.off(ep.canvas, \"mouseup\", _delTempEndpoint);\n _currentInstance.off(elInfo.el, \"mouseup\", _delTempEndpoint);\n if (endpointAddedButNoDragYet) {\n endpointAddedButNoDragYet = false;\n _currentInstance.deleteEndpoint(ep);\n }\n };\n\n _currentInstance.on(ep.canvas, \"mouseup\", _delTempEndpoint);\n _currentInstance.on(elInfo.el, \"mouseup\", _delTempEndpoint);\n\n // optionally check for attributes to extract from the source element\n var payload = {};\n if (def.def.extract) {\n for (var att in def.def.extract) {\n var v = (e.srcElement || e.target).getAttribute(att);\n if (v) {\n payload[def.def.extract[att]] = v;\n }\n }\n }\n\n // and then trigger its mousedown event, which will kick off a drag, which will start dragging\n // a new connection from this endpoint.\n _currentInstance.trigger(ep.canvas, \"mousedown\", e, payload);\n\n _ju.consume(e);\n\n }.bind(this);\n\n this.on(elInfo.el, \"mousedown\", mouseDownListener);\n _def.trigger = mouseDownListener;\n\n // if a filter was provided, set it as a dragFilter on the element,\n // to prevent the element drag function from kicking in when we want to\n // drag a new connection\n if (p.filter && (_ju.isString(p.filter) || _ju.isFunction(p.filter))) {\n _currentInstance.setDragFilter(elInfo.el, p.filter);\n }\n\n var dropOptions = root.jsPlumb.extend({}, p.dropOptions || {});\n\n _makeElementDropHandler(elInfo, p, dropOptions, true, p.isTarget === true);\n\n }.bind(this);\n\n var inputs = el.length && el.constructor !== String ? el : [ el ];\n for (var i = 0, ii = inputs.length; i < ii; i++) {\n _doOne(_info(inputs[i]));\n }\n\n return this;\n };\n\n // see api docs\n this.unmakeSource = function (el, connectionType, doNotClearArrays) {\n var info = _info(el);\n _currentInstance.destroyDroppable(info.el, \"internal\");\n var eldefs = this.sourceEndpointDefinitions[info.id];\n if (eldefs) {\n for (var def in eldefs) {\n if (connectionType == null || connectionType === def) {\n var mouseDownListener = eldefs[def].trigger;\n if (mouseDownListener) {\n _currentInstance.off(info.el, \"mousedown\", mouseDownListener);\n }\n if (!doNotClearArrays) {\n delete this.sourceEndpointDefinitions[info.id][def];\n }\n }\n }\n }\n\n return this;\n };\n\n // see api docs\n this.unmakeEverySource = function () {\n for (var i in this.sourceEndpointDefinitions) {\n _currentInstance.unmakeSource(i, null, true);\n }\n\n this.sourceEndpointDefinitions = {};\n return this;\n };\n\n var _getScope = function (el, types, connectionType) {\n types = _ju.isArray(types) ? types : [ types ];\n var id = _getId(el);\n connectionType = connectionType || \"default\";\n for (var i = 0; i < types.length; i++) {\n var eldefs = this[types[i]][id];\n if (eldefs && eldefs[connectionType]) {\n return eldefs[connectionType].def.scope || this.Defaults.Scope;\n }\n }\n }.bind(this);\n\n var _setScope = function (el, scope, types, connectionType) {\n types = _ju.isArray(types) ? types : [ types ];\n var id = _getId(el);\n connectionType = connectionType || \"default\";\n for (var i = 0; i < types.length; i++) {\n var eldefs = this[types[i]][id];\n if (eldefs && eldefs[connectionType]) {\n eldefs[connectionType].def.scope = scope;\n }\n }\n\n }.bind(this);\n\n this.getScope = function (el, scope) {\n return _getScope(el, [ \"sourceEndpointDefinitions\", \"targetEndpointDefinitions\" ]);\n };\n this.getSourceScope = function (el) {\n return _getScope(el, \"sourceEndpointDefinitions\");\n };\n this.getTargetScope = function (el) {\n return _getScope(el, \"targetEndpointDefinitions\");\n };\n this.setScope = function (el, scope, connectionType) {\n this.setSourceScope(el, scope, connectionType);\n this.setTargetScope(el, scope, connectionType);\n };\n this.setSourceScope = function (el, scope, connectionType) {\n _setScope(el, scope, \"sourceEndpointDefinitions\", connectionType);\n // we get the source scope during the mousedown event, but we also want to set this.\n this.setDragScope(el, scope);\n };\n this.setTargetScope = function (el, scope, connectionType) {\n _setScope(el, scope, \"targetEndpointDefinitions\", connectionType);\n this.setDropScope(el, scope);\n };\n\n // see api docs\n this.unmakeEveryTarget = function () {\n for (var i in this.targetEndpointDefinitions) {\n _currentInstance.unmakeTarget(i, true);\n }\n\n this.targetEndpointDefinitions = {};\n return this;\n };\n\n // does the work of setting a source enabled or disabled.\n var _setEnabled = function (type, el, state, toggle, connectionType) {\n var a = type === \"source\" ? this.sourceEndpointDefinitions : this.targetEndpointDefinitions,\n originalState, info, newState;\n\n connectionType = connectionType || \"default\";\n\n // a selector or an array\n if (el.length && !_ju.isString(el)) {\n originalState = [];\n for (var i = 0, ii = el.length; i < ii; i++) {\n info = _info(el[i]);\n if (a[info.id] && a[info.id][connectionType]) {\n originalState[i] = a[info.id][connectionType].enabled;\n newState = toggle ? !originalState[i] : state;\n a[info.id][connectionType].enabled = newState;\n _currentInstance[newState ? \"removeClass\" : \"addClass\"](info.el, \"jtk-\" + type + \"-disabled\");\n }\n }\n }\n // otherwise a DOM element or a String ID.\n else {\n info = _info(el);\n var id = info.id;\n if (a[id] && a[id][connectionType]) {\n originalState = a[id][connectionType].enabled;\n newState = toggle ? !originalState : state;\n a[id][connectionType].enabled = newState;\n _currentInstance[newState ? \"removeClass\" : \"addClass\"](info.el, \"jtk-\" + type + \"-disabled\");\n }\n }\n return originalState;\n }.bind(this);\n\n var _first = function (el, fn) {\n if (_ju.isString(el) || !el.length) {\n return fn.apply(this, [ el ]);\n }\n else if (el.length) {\n return fn.apply(this, [ el[0] ]);\n }\n\n }.bind(this);\n\n this.toggleSourceEnabled = function (el, connectionType) {\n _setEnabled(\"source\", el, null, true, connectionType);\n return this.isSourceEnabled(el, connectionType);\n };\n\n this.setSourceEnabled = function (el, state, connectionType) {\n return _setEnabled(\"source\", el, state, null, connectionType);\n };\n this.isSource = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var eldefs = this.sourceEndpointDefinitions[_info(_el).id];\n return eldefs != null && eldefs[connectionType] != null;\n }.bind(this));\n };\n this.isSourceEnabled = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var sep = this.sourceEndpointDefinitions[_info(_el).id];\n return sep && sep[connectionType] && sep[connectionType].enabled === true;\n }.bind(this));\n };\n\n this.toggleTargetEnabled = function (el, connectionType) {\n _setEnabled(\"target\", el, null, true, connectionType);\n return this.isTargetEnabled(el, connectionType);\n };\n\n this.isTarget = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var eldefs = this.targetEndpointDefinitions[_info(_el).id];\n return eldefs != null && eldefs[connectionType] != null;\n }.bind(this));\n };\n this.isTargetEnabled = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var tep = this.targetEndpointDefinitions[_info(_el).id];\n return tep && tep[connectionType] && tep[connectionType].enabled === true;\n }.bind(this));\n };\n this.setTargetEnabled = function (el, state, connectionType) {\n return _setEnabled(\"target\", el, state, null, connectionType);\n };\n\n// --------------------- end makeSource/makeTarget ----------------------------------------------\n\n this.ready = function (fn) {\n _currentInstance.bind(\"ready\", fn);\n };\n\n var _elEach = function(el, fn) {\n // support both lists...\n if (typeof el === 'object' && el.length) {\n for (var i = 0, ii = el.length; i < ii; i++) {\n fn(el[i]);\n }\n }\n else {// ...and single strings or elements.\n fn(el);\n }\n\n return _currentInstance;\n };\n\n // repaint some element's endpoints and connections\n this.repaint = function (el, ui, timestamp) {\n return _elEach(el, function(_el) {\n _draw(_el, ui, timestamp);\n });\n };\n\n this.revalidate = function (el, timestamp, isIdAlready) {\n return _elEach(el, function(_el) {\n var elId = isIdAlready ? _el : _currentInstance.getId(_el);\n _currentInstance.updateOffset({ elId: elId, recalc: true, timestamp:timestamp });\n var dm = _currentInstance.getDragManager();\n if (dm) {\n dm.updateOffsets(elId);\n }\n _currentInstance.repaint(_el);\n });\n };\n\n // repaint every endpoint and connection.\n this.repaintEverything = function () {\n // TODO this timestamp causes continuous anchors to not repaint properly.\n // fix this. do not just take out the timestamp. it runs a lot faster with\n // the timestamp included.\n var timestamp = _timestamp(), elId;\n\n for (elId in endpointsByElement) {\n _currentInstance.updateOffset({ elId: elId, recalc: true, timestamp: timestamp });\n }\n\n for (elId in endpointsByElement) {\n _draw(elId, null, timestamp);\n }\n\n return this;\n };\n\n this.removeAllEndpoints = function (el, recurse, affectedElements) {\n affectedElements = affectedElements || [];\n var _one = function (_el) {\n var info = _info(_el),\n ebe = endpointsByElement[info.id],\n i, ii;\n\n if (ebe) {\n affectedElements.push(info);\n for (i = 0, ii = ebe.length; i < ii; i++) {\n _currentInstance.deleteEndpoint(ebe[i], false);\n }\n }\n delete endpointsByElement[info.id];\n\n if (recurse) {\n if (info.el && info.el.nodeType !== 3 && info.el.nodeType !== 8) {\n for (i = 0, ii = info.el.childNodes.length; i < ii; i++) {\n _one(info.el.childNodes[i]);\n }\n }\n }\n\n };\n _one(el);\n return this;\n };\n\n var _doRemove = function(info, affectedElements) {\n _currentInstance.removeAllEndpoints(info.id, true, affectedElements);\n var dm = _currentInstance.getDragManager();\n var _one = function(_info) {\n\n if (dm) {\n dm.elementRemoved(_info.id);\n }\n _currentInstance.anchorManager.clearFor(_info.id);\n _currentInstance.anchorManager.removeFloatingConnection(_info.id);\n\n if (_currentInstance.isSource(_info.el)) {\n _currentInstance.unmakeSource(_info.el);\n }\n if (_currentInstance.isTarget(_info.el)) {\n _currentInstance.unmakeTarget(_info.el);\n }\n _currentInstance.destroyDraggable(_info.el);\n _currentInstance.destroyDroppable(_info.el);\n\n\n delete _currentInstance.floatingConnections[_info.id];\n delete managedElements[_info.id];\n delete offsets[_info.id];\n if (_info.el) {\n _currentInstance.removeElement(_info.el);\n _info.el._jsPlumb = null;\n }\n };\n\n // remove all affected child elements\n for (var ae = 1; ae < affectedElements.length; ae++) {\n _one(affectedElements[ae]);\n }\n // and always remove the requested one from the dom.\n _one(info);\n };\n\n /**\n * Remove the given element, including cleaning up all endpoints registered for it.\n * This is exposed in the public API but also used internally by jsPlumb when removing the\n * element associated with a connection drag.\n */\n this.remove = function (el, doNotRepaint) {\n var info = _info(el), affectedElements = [];\n if (info.text) {\n info.el.parentNode.removeChild(info.el);\n }\n else if (info.id) {\n _currentInstance.batch(function () {\n _doRemove(info, affectedElements);\n }, doNotRepaint === true);\n }\n return _currentInstance;\n };\n\n this.empty = function (el, doNotRepaint) {\n var affectedElements = [];\n var _one = function(el, dontRemoveFocus) {\n var info = _info(el);\n if (info.text) {\n info.el.parentNode.removeChild(info.el);\n }\n else if (info.el) {\n while(info.el.childNodes.length > 0) {\n _one(info.el.childNodes[0]);\n }\n if (!dontRemoveFocus) {\n _doRemove(info, affectedElements);\n }\n }\n };\n\n _currentInstance.batch(function() {\n _one(el, true);\n }, doNotRepaint === false);\n\n return _currentInstance;\n };\n\n this.reset = function (doNotUnbindInstanceEventListeners) {\n _currentInstance.silently(function() {\n _hoverSuspended = false;\n _currentInstance.removeAllGroups();\n _currentInstance.removeGroupManager();\n _currentInstance.deleteEveryEndpoint();\n if (!doNotUnbindInstanceEventListeners) {\n _currentInstance.unbind();\n }\n this.targetEndpointDefinitions = {};\n this.sourceEndpointDefinitions = {};\n connections.length = 0;\n if (this.doReset) {\n this.doReset();\n }\n }.bind(this));\n };\n\n var _clearObject = function (obj) {\n if (obj.canvas && obj.canvas.parentNode) {\n obj.canvas.parentNode.removeChild(obj.canvas);\n }\n obj.cleanup();\n obj.destroy();\n };\n\n this.clear = function () {\n _currentInstance.select().each(_clearObject);\n _currentInstance.selectEndpoints().each(_clearObject);\n\n endpointsByElement = {};\n endpointsByUUID = {};\n };\n\n this.setDefaultScope = function (scope) {\n DEFAULT_SCOPE = scope;\n return _currentInstance;\n };\n\n this.deriveEndpointAndAnchorSpec = function(type, dontPrependDefault) {\n var bits = ((dontPrependDefault ? \"\" : \"default \") + type).split(/[\\s]/), eps = null, ep = null, a = null, as = null;\n for (var i = 0; i < bits.length; i++) {\n var _t = _currentInstance.getType(bits[i], \"connection\");\n if (_t) {\n if (_t.endpoints) {\n eps = _t.endpoints;\n }\n if (_t.endpoint) {\n ep = _t.endpoint;\n }\n if (_t.anchors) {\n as = _t.anchors;\n }\n if (_t.anchor) {\n a = _t.anchor;\n }\n }\n }\n return { endpoints: eps ? eps : [ ep, ep ], anchors: as ? as : [a, a ]};\n };\n\n // sets the id of some element, changing whatever we need to to keep track.\n this.setId = function (el, newId, doNotSetAttribute) {\n //\n var id;\n\n if (_ju.isString(el)) {\n id = el;\n }\n else {\n el = this.getElement(el);\n id = this.getId(el);\n }\n\n var sConns = this.getConnections({source: id, scope: '*'}, true),\n tConns = this.getConnections({target: id, scope: '*'}, true);\n\n newId = \"\" + newId;\n\n if (!doNotSetAttribute) {\n el = this.getElement(id);\n this.setAttribute(el, \"id\", newId);\n }\n else {\n el = this.getElement(newId);\n }\n\n endpointsByElement[newId] = endpointsByElement[id] || [];\n for (var i = 0, ii = endpointsByElement[newId].length; i < ii; i++) {\n endpointsByElement[newId][i].setElementId(newId);\n endpointsByElement[newId][i].setReferenceElement(el);\n }\n delete endpointsByElement[id];\n\n this.sourceEndpointDefinitions[newId] = this.sourceEndpointDefinitions[id];\n delete this.sourceEndpointDefinitions[id];\n this.targetEndpointDefinitions[newId] = this.targetEndpointDefinitions[id];\n delete this.targetEndpointDefinitions[id];\n\n this.anchorManager.changeId(id, newId);\n var dm = this.getDragManager();\n if (dm) {\n dm.changeId(id, newId);\n }\n managedElements[newId] = managedElements[id];\n delete managedElements[id];\n\n var _conns = function (list, epIdx, type) {\n for (var i = 0, ii = list.length; i < ii; i++) {\n list[i].endpoints[epIdx].setElementId(newId);\n list[i].endpoints[epIdx].setReferenceElement(el);\n list[i][type + \"Id\"] = newId;\n list[i][type] = el;\n }\n };\n _conns(sConns, 0, \"source\");\n _conns(tConns, 1, \"target\");\n\n this.repaint(newId);\n };\n\n this.setDebugLog = function (debugLog) {\n log = debugLog;\n };\n\n this.setSuspendDrawing = function (val, repaintAfterwards) {\n var curVal = _suspendDrawing;\n _suspendDrawing = val;\n if (val) {\n _suspendedAt = new Date().getTime();\n } else {\n _suspendedAt = null;\n }\n if (repaintAfterwards) {\n this.repaintEverything();\n }\n return curVal;\n };\n\n // returns whether or not drawing is currently suspended.\n this.isSuspendDrawing = function () {\n return _suspendDrawing;\n };\n\n // return timestamp for when drawing was suspended.\n this.getSuspendedAt = function () {\n return _suspendedAt;\n };\n\n this.batch = function (fn, doNotRepaintAfterwards) {\n var _wasSuspended = this.isSuspendDrawing();\n if (!_wasSuspended) {\n this.setSuspendDrawing(true);\n }\n try {\n fn();\n }\n catch (e) {\n _ju.log(\"Function run while suspended failed\", e);\n }\n if (!_wasSuspended) {\n this.setSuspendDrawing(false, !doNotRepaintAfterwards);\n }\n };\n\n this.doWhileSuspended = this.batch;\n\n this.getCachedData = _getCachedData;\n this.timestamp = _timestamp;\n this.show = function (el, changeEndpoints) {\n _setVisible(el, \"block\", changeEndpoints);\n return _currentInstance;\n };\n\n // TODO: update this method to return the current state.\n this.toggleVisible = _toggleVisible;\n this.addListener = this.bind;\n\n var floatingConnections = [];\n this.registerFloatingConnection = function(info, conn, ep) {\n floatingConnections[info.id] = conn;\n // only register for the target endpoint; we will not be dragging the source at any time\n // before this connection is either discarded or made into a permanent connection.\n _ju.addToList(endpointsByElement, info.id, ep);\n };\n this.getFloatingConnectionFor = function(id) {\n return floatingConnections[id];\n };\n };\n\n _ju.extend(root.jsPlumbInstance, _ju.EventGenerator, {\n setAttribute: function (el, a, v) {\n this.setAttribute(el, a, v);\n },\n getAttribute: function (el, a) {\n return this.getAttribute(root.jsPlumb.getElement(el), a);\n },\n convertToFullOverlaySpec: function(spec) {\n if (_ju.isString(spec)) {\n spec = [ spec, { } ];\n }\n spec[1].id = spec[1].id || _ju.uuid();\n return spec;\n },\n registerConnectionType: function (id, type) {\n this._connectionTypes[id] = root.jsPlumb.extend({}, type);\n if (type.overlays) {\n var to = {};\n for (var i = 0; i < type.overlays.length; i++) {\n // if a string, convert to object representation so that we can store the typeid on it.\n // also assign an id.\n var fo = this.convertToFullOverlaySpec(type.overlays[i]);\n to[fo[1].id] = fo;\n }\n this._connectionTypes[id].overlays = to;\n }\n },\n registerConnectionTypes: function (types) {\n for (var i in types) {\n this.registerConnectionType(i, types[i]);\n }\n },\n registerEndpointType: function (id, type) {\n this._endpointTypes[id] = root.jsPlumb.extend({}, type);\n if (type.overlays) {\n var to = {};\n for (var i = 0; i < type.overlays.length; i++) {\n // if a string, convert to object representation so that we can store the typeid on it.\n // also assign an id.\n var fo = this.convertToFullOverlaySpec(type.overlays[i]);\n to[fo[1].id] = fo;\n }\n this._endpointTypes[id].overlays = to;\n }\n },\n registerEndpointTypes: function (types) {\n for (var i in types) {\n this.registerEndpointType(i, types[i]);\n }\n },\n getType: function (id, typeDescriptor) {\n return typeDescriptor === \"connection\" ? this._connectionTypes[id] : this._endpointTypes[id];\n },\n setIdChanged: function (oldId, newId) {\n this.setId(oldId, newId, true);\n },\n // set parent: change the parent for some node and update all the registrations we need to.\n setParent: function (el, newParent) {\n var _dom = this.getElement(el),\n _id = this.getId(_dom),\n _pdom = this.getElement(newParent),\n _pid = this.getId(_pdom),\n dm = this.getDragManager();\n\n _dom.parentNode.removeChild(_dom);\n _pdom.appendChild(_dom);\n if (dm) {\n dm.setParent(_dom, _id, _pdom, _pid);\n }\n },\n extend: function (o1, o2, names) {\n var i;\n if (names) {\n for (i = 0; i < names.length; i++) {\n o1[names[i]] = o2[names[i]];\n }\n }\n else {\n for (i in o2) {\n o1[i] = o2[i];\n }\n }\n\n return o1;\n },\n floatingConnections: {},\n getFloatingAnchorIndex: function (jpc) {\n return jpc.endpoints[0].isFloating() ? 0 : jpc.endpoints[1].isFloating() ? 1 : -1;\n }\n });\n\n// --------------------- static instance + module registration -------------------------------------------\n\n// create static instance and assign to window if window exists.\n var jsPlumb = new jsPlumbInstance();\n // register on 'root' (lets us run on server or browser)\n root.jsPlumb = jsPlumb;\n // add 'getInstance' method to static instance\n jsPlumb.getInstance = function (_defaults, overrideFns) {\n var j = new jsPlumbInstance(_defaults);\n if (overrideFns) {\n for (var ovf in overrideFns) {\n j[ovf] = overrideFns[ovf];\n }\n }\n j.init();\n return j;\n };\n jsPlumb.each = function (spec, fn) {\n if (spec == null) {\n return;\n }\n if (typeof spec === \"string\") {\n fn(jsPlumb.getElement(spec));\n }\n else if (spec.length != null) {\n for (var i = 0; i < spec.length; i++) {\n fn(jsPlumb.getElement(spec[i]));\n }\n }\n else {\n fn(spec);\n } // assume it's an element.\n };\n\n // CommonJS\n if (typeof exports !== 'undefined') {\n exports.jsPlumb = jsPlumb;\n }\n\n// --------------------- end static instance + AMD registration -------------------------------------------\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function() {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n // ------------------------------ BEGIN OverlayCapablejsPlumbUIComponent --------------------------------------------\n\n var _internalLabelOverlayId = \"__label\",\n // this is a shortcut helper method to let people add a label as\n // overlay.\n _makeLabelOverlay = function (component, params) {\n\n var _params = {\n cssClass: params.cssClass,\n labelStyle: component.labelStyle,\n id: _internalLabelOverlayId,\n component: component,\n _jsPlumb: component._jsPlumb.instance // TODO not necessary, since the instance can be accessed through the component.\n },\n mergedParams = _jp.extend(_params, params);\n\n return new _jp.Overlays[component._jsPlumb.instance.getRenderMode()].Label(mergedParams);\n },\n _processOverlay = function (component, o) {\n var _newOverlay = null;\n if (_ju.isArray(o)) {\t// this is for the shorthand [\"Arrow\", { width:50 }] syntax\n // there's also a three arg version:\n // [\"Arrow\", { width:50 }, {location:0.7}]\n // which merges the 3rd arg into the 2nd.\n var type = o[0],\n // make a copy of the object so as not to mess up anyone else's reference...\n p = _jp.extend({component: component, _jsPlumb: component._jsPlumb.instance}, o[1]);\n if (o.length === 3) {\n _jp.extend(p, o[2]);\n }\n _newOverlay = new _jp.Overlays[component._jsPlumb.instance.getRenderMode()][type](p);\n } else if (o.constructor === String) {\n _newOverlay = new _jp.Overlays[component._jsPlumb.instance.getRenderMode()][o]({component: component, _jsPlumb: component._jsPlumb.instance});\n } else {\n _newOverlay = o;\n }\n\n _newOverlay.id = _newOverlay.id || _ju.uuid();\n component.cacheTypeItem(\"overlay\", _newOverlay, _newOverlay.id);\n component._jsPlumb.overlays[_newOverlay.id] = _newOverlay;\n\n return _newOverlay;\n };\n\n _jp.OverlayCapableJsPlumbUIComponent = function (params) {\n\n root.jsPlumbUIComponent.apply(this, arguments);\n this._jsPlumb.overlays = {};\n this._jsPlumb.overlayPositions = {};\n\n if (params.label) {\n this.getDefaultType().overlays[_internalLabelOverlayId] = [\"Label\", {\n label: params.label,\n location: params.labelLocation || this.defaultLabelLocation || 0.5,\n labelStyle: params.labelStyle || this._jsPlumb.instance.Defaults.LabelStyle,\n id:_internalLabelOverlayId\n }];\n }\n\n this.setListenerComponent = function (c) {\n if (this._jsPlumb) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].setListenerComponent(c);\n }\n }\n };\n };\n\n _jp.OverlayCapableJsPlumbUIComponent.applyType = function (component, t) {\n if (t.overlays) {\n // loop through the ones in the type. if already present on the component,\n // dont remove or re-add.\n var keep = {}, i;\n\n for (i in t.overlays) {\n\n var existing = component._jsPlumb.overlays[t.overlays[i][1].id];\n if (existing) {\n // maybe update from data, if there were parameterised values for instance.\n existing.updateFrom(t.overlays[i][1]);\n keep[t.overlays[i][1].id] = true;\n }\n else {\n var c = component.getCachedTypeItem(\"overlay\", t.overlays[i][1].id);\n if (c != null) {\n c.reattach(component._jsPlumb.instance, component);\n c.setVisible(true);\n // maybe update from data, if there were parameterised values for instance.\n c.updateFrom(t.overlays[i][1]);\n component._jsPlumb.overlays[c.id] = c;\n }\n else {\n c = component.addOverlay(t.overlays[i], true);\n }\n keep[c.id] = true;\n }\n }\n\n // now loop through the full overlays and remove those that we dont want to keep\n for (i in component._jsPlumb.overlays) {\n if (keep[component._jsPlumb.overlays[i].id] == null) {\n component.removeOverlay(component._jsPlumb.overlays[i].id, true); // remove overlay but dont clean it up.\n // that would remove event listeners etc; overlays are never discarded by the types stuff, they are\n // just detached/reattached.\n }\n }\n }\n };\n\n _ju.extend(_jp.OverlayCapableJsPlumbUIComponent, root.jsPlumbUIComponent, {\n\n setHover: function (hover, ignoreAttachedElements) {\n if (this._jsPlumb && !this._jsPlumb.instance.isConnectionBeingDragged()) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i][hover ? \"addClass\" : \"removeClass\"](this._jsPlumb.instance.hoverClass);\n }\n }\n },\n addOverlay: function (overlay, doNotRepaint) {\n var o = _processOverlay(this, overlay);\n if (!doNotRepaint) {\n this.repaint();\n }\n return o;\n },\n getOverlay: function (id) {\n return this._jsPlumb.overlays[id];\n },\n getOverlays: function () {\n return this._jsPlumb.overlays;\n },\n hideOverlay: function (id) {\n var o = this.getOverlay(id);\n if (o) {\n o.hide();\n }\n },\n hideOverlays: function () {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].hide();\n }\n },\n showOverlay: function (id) {\n var o = this.getOverlay(id);\n if (o) {\n o.show();\n }\n },\n showOverlays: function () {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].show();\n }\n },\n removeAllOverlays: function (doNotRepaint) {\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays[i].cleanup) {\n this._jsPlumb.overlays[i].cleanup();\n }\n }\n\n this._jsPlumb.overlays = {};\n this._jsPlumb.overlayPositions = null;\n this._jsPlumb.overlayPlacements= {};\n if (!doNotRepaint) {\n this.repaint();\n }\n },\n removeOverlay: function (overlayId, dontCleanup) {\n var o = this._jsPlumb.overlays[overlayId];\n if (o) {\n o.setVisible(false);\n if (!dontCleanup && o.cleanup) {\n o.cleanup();\n }\n delete this._jsPlumb.overlays[overlayId];\n if (this._jsPlumb.overlayPositions) {\n delete this._jsPlumb.overlayPositions[overlayId];\n }\n\n if (this._jsPlumb.overlayPlacements) {\n delete this._jsPlumb.overlayPlacements[overlayId];\n }\n }\n },\n removeOverlays: function () {\n for (var i = 0, j = arguments.length; i < j; i++) {\n this.removeOverlay(arguments[i]);\n }\n },\n moveParent: function (newParent) {\n if (this.bgCanvas) {\n this.bgCanvas.parentNode.removeChild(this.bgCanvas);\n newParent.appendChild(this.bgCanvas);\n }\n\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n newParent.appendChild(this.canvas);\n\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays[i].isAppendedAtTopLevel) {\n var el = this._jsPlumb.overlays[i].getElement();\n el.parentNode.removeChild(el);\n newParent.appendChild(el);\n }\n }\n }\n },\n getLabel: function () {\n var lo = this.getOverlay(_internalLabelOverlayId);\n return lo != null ? lo.getLabel() : null;\n },\n getLabelOverlay: function () {\n return this.getOverlay(_internalLabelOverlayId);\n },\n setLabel: function (l) {\n var lo = this.getOverlay(_internalLabelOverlayId);\n if (!lo) {\n var params = l.constructor === String || l.constructor === Function ? { label: l } : l;\n lo = _makeLabelOverlay(this, params);\n this._jsPlumb.overlays[_internalLabelOverlayId] = lo;\n }\n else {\n if (l.constructor === String || l.constructor === Function) {\n lo.setLabel(l);\n }\n else {\n if (l.label) {\n lo.setLabel(l.label);\n }\n if (l.location) {\n lo.setLocation(l.location);\n }\n }\n }\n\n if (!this._jsPlumb.instance.isSuspendDrawing()) {\n this.repaint();\n }\n },\n cleanup: function (force) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].cleanup(force);\n this._jsPlumb.overlays[i].destroy(force);\n }\n if (force) {\n this._jsPlumb.overlays = {};\n this._jsPlumb.overlayPositions = null;\n }\n },\n setVisible: function (v) {\n this[v ? \"showOverlays\" : \"hideOverlays\"]();\n },\n setAbsoluteOverlayPosition: function (overlay, xy) {\n this._jsPlumb.overlayPositions[overlay.id] = xy;\n },\n getAbsoluteOverlayPosition: function (overlay) {\n return this._jsPlumb.overlayPositions ? this._jsPlumb.overlayPositions[overlay.id] : null;\n },\n _clazzManip:function(action, clazz, dontUpdateOverlays) {\n if (!dontUpdateOverlays) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i][action + \"Class\"](clazz);\n }\n }\n },\n addClass:function(clazz, dontUpdateOverlays) {\n this._clazzManip(\"add\", clazz, dontUpdateOverlays);\n },\n removeClass:function(clazz, dontUpdateOverlays) {\n this._clazzManip(\"remove\", clazz, dontUpdateOverlays);\n }\n });\n\n// ------------------------------ END OverlayCapablejsPlumbUIComponent --------------------------------------------\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the code for Endpoints.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n * \n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n // create the drag handler for a connection\n var _makeConnectionDragHandler = function (endpoint, placeholder, _jsPlumb) {\n var stopped = false;\n return {\n drag: function () {\n if (stopped) {\n stopped = false;\n return true;\n }\n\n if (placeholder.element) {\n var _ui = _jsPlumb.getUIPosition(arguments, _jsPlumb.getZoom());\n if (_ui != null) {\n _jsPlumb.setPosition(placeholder.element, _ui);\n }\n _jsPlumb.repaint(placeholder.element, _ui);\n // always repaint the source endpoint, because only continuous/dynamic anchors cause the endpoint\n // to be repainted, so static anchors need to be told (or the endpoint gets dragged around)\n endpoint.paint({anchorPoint:endpoint.anchor.getCurrentLocation({element:endpoint})});\n }\n },\n stopDrag: function () {\n stopped = true;\n }\n };\n };\n\n // creates a placeholder div for dragging purposes, adds it, and pre-computes its offset.\n var _makeDraggablePlaceholder = function (placeholder, _jsPlumb, ipco, ips) {\n var n = _jsPlumb.createElement(\"div\", { position : \"absolute\" });\n _jsPlumb.appendElement(n);\n var id = _jsPlumb.getId(n);\n _jsPlumb.setPosition(n, ipco);\n n.style.width = ips[0] + \"px\";\n n.style.height = ips[1] + \"px\";\n _jsPlumb.manage(id, n, true); // TRANSIENT MANAGE\n // create and assign an id, and initialize the offset.\n placeholder.id = id;\n placeholder.element = n;\n };\n\n // create a floating endpoint (for drag connections)\n var _makeFloatingEndpoint = function (paintStyle, referenceAnchor, endpoint, referenceCanvas, sourceElement, _jsPlumb, _newEndpoint, scope) {\n var floatingAnchor = new _jp.FloatingAnchor({ reference: referenceAnchor, referenceCanvas: referenceCanvas, jsPlumbInstance: _jsPlumb });\n //setting the scope here should not be the way to fix that mootools issue. it should be fixed by not\n // adding the floating endpoint as a droppable. that makes more sense anyway!\n // TRANSIENT MANAGE\n return _newEndpoint({\n paintStyle: paintStyle,\n endpoint: endpoint,\n anchor: floatingAnchor,\n source: sourceElement,\n scope: scope\n });\n };\n\n var typeParameters = [ \"connectorStyle\", \"connectorHoverStyle\", \"connectorOverlays\",\n \"connector\", \"connectionType\", \"connectorClass\", \"connectorHoverClass\" ];\n\n // a helper function that tries to find a connection to the given element, and returns it if so. if elementWithPrecedence is null,\n // or no connection to it is found, we return the first connection in our list.\n var findConnectionToUseForDynamicAnchor = function (ep, elementWithPrecedence) {\n var idx = 0;\n if (elementWithPrecedence != null) {\n for (var i = 0; i < ep.connections.length; i++) {\n if (ep.connections[i].sourceId === elementWithPrecedence || ep.connections[i].targetId === elementWithPrecedence) {\n idx = i;\n break;\n }\n }\n }\n\n return ep.connections[idx];\n };\n\n _jp.Endpoint = function (params) {\n var _jsPlumb = params._jsPlumb,\n _newConnection = params.newConnection,\n _newEndpoint = params.newEndpoint;\n\n this.idPrefix = \"_jsplumb_e_\";\n this.defaultLabelLocation = [ 0.5, 0.5 ];\n this.defaultOverlayKeys = [\"Overlays\", \"EndpointOverlays\"];\n _jp.OverlayCapableJsPlumbUIComponent.apply(this, arguments);\n\n// TYPE\n\n this.appendToDefaultType({\n connectionType:params.connectionType,\n maxConnections: params.maxConnections == null ? this._jsPlumb.instance.Defaults.MaxConnections : params.maxConnections, // maximum number of connections this endpoint can be the source of.,\n paintStyle: params.endpointStyle || params.paintStyle || params.style || this._jsPlumb.instance.Defaults.EndpointStyle || _jp.Defaults.EndpointStyle,\n hoverPaintStyle: params.endpointHoverStyle || params.hoverPaintStyle || this._jsPlumb.instance.Defaults.EndpointHoverStyle || _jp.Defaults.EndpointHoverStyle,\n connectorStyle: params.connectorStyle,\n connectorHoverStyle: params.connectorHoverStyle,\n connectorClass: params.connectorClass,\n connectorHoverClass: params.connectorHoverClass,\n connectorOverlays: params.connectorOverlays,\n connector: params.connector,\n connectorTooltip: params.connectorTooltip\n });\n\n// END TYPE\n\n this._jsPlumb.enabled = !(params.enabled === false);\n this._jsPlumb.visible = true;\n this.element = _jp.getElement(params.source);\n this._jsPlumb.uuid = params.uuid;\n this._jsPlumb.floatingEndpoint = null;\n var inPlaceCopy = null;\n if (this._jsPlumb.uuid) {\n params.endpointsByUUID[this._jsPlumb.uuid] = this;\n }\n this.elementId = params.elementId;\n this.dragProxy = params.dragProxy;\n\n this._jsPlumb.connectionCost = params.connectionCost;\n this._jsPlumb.connectionsDirected = params.connectionsDirected;\n this._jsPlumb.currentAnchorClass = \"\";\n this._jsPlumb.events = {};\n\n var deleteOnEmpty = params.deleteOnEmpty === true;\n this.setDeleteOnEmpty = function(d) {\n deleteOnEmpty = d;\n };\n\n var _updateAnchorClass = function () {\n // stash old, get new\n var oldAnchorClass = _jsPlumb.endpointAnchorClassPrefix + \"-\" + this._jsPlumb.currentAnchorClass;\n this._jsPlumb.currentAnchorClass = this.anchor.getCssClass();\n var anchorClass = _jsPlumb.endpointAnchorClassPrefix + (this._jsPlumb.currentAnchorClass ? \"-\" + this._jsPlumb.currentAnchorClass : \"\");\n\n this.removeClass(oldAnchorClass);\n this.addClass(anchorClass);\n // add and remove at the same time to reduce the number of reflows.\n _jp.updateClasses(this.element, anchorClass, oldAnchorClass);\n }.bind(this);\n\n this.prepareAnchor = function(anchorParams) {\n var a = this._jsPlumb.instance.makeAnchor(anchorParams, this.elementId, _jsPlumb);\n a.bind(\"anchorChanged\", function (currentAnchor) {\n this.fire(\"anchorChanged\", {endpoint: this, anchor: currentAnchor});\n _updateAnchorClass();\n }.bind(this));\n return a;\n };\n\n this.setPreparedAnchor = function(anchor, doNotRepaint) {\n this._jsPlumb.instance.continuousAnchorFactory.clear(this.elementId);\n this.anchor = anchor;\n _updateAnchorClass();\n\n if (!doNotRepaint) {\n this._jsPlumb.instance.repaint(this.elementId);\n }\n\n return this;\n };\n\n this.setAnchor = function (anchorParams, doNotRepaint) {\n var a = this.prepareAnchor(anchorParams);\n this.setPreparedAnchor(a, doNotRepaint);\n return this;\n };\n\n var internalHover = function (state) {\n if (this.connections.length > 0) {\n for (var i = 0; i < this.connections.length; i++) {\n this.connections[i].setHover(state, false);\n }\n }\n else {\n this.setHover(state);\n }\n }.bind(this);\n\n this.bind(\"mouseover\", function () {\n internalHover(true);\n });\n this.bind(\"mouseout\", function () {\n internalHover(false);\n });\n\n // ANCHOR MANAGER\n if (!params._transient) { // in place copies, for example, are transient. they will never need to be retrieved during a paint cycle, because they dont move, and then they are deleted.\n this._jsPlumb.instance.anchorManager.add(this, this.elementId);\n }\n\n this.prepareEndpoint = function(ep, typeId) {\n var _e = function (t, p) {\n var rm = _jsPlumb.getRenderMode();\n if (_jp.Endpoints[rm][t]) {\n return new _jp.Endpoints[rm][t](p);\n }\n if (!_jsPlumb.Defaults.DoNotThrowErrors) {\n throw { msg: \"jsPlumb: unknown endpoint type '\" + t + \"'\" };\n }\n };\n\n var endpointArgs = {\n _jsPlumb: this._jsPlumb.instance,\n cssClass: params.cssClass,\n container: params.container,\n tooltip: params.tooltip,\n connectorTooltip: params.connectorTooltip,\n endpoint: this\n };\n\n var endpoint;\n\n if (_ju.isString(ep)) {\n endpoint = _e(ep, endpointArgs);\n }\n else if (_ju.isArray(ep)) {\n endpointArgs = _ju.merge(ep[1], endpointArgs);\n endpoint = _e(ep[0], endpointArgs);\n }\n else {\n endpoint = ep.clone();\n }\n\n // assign a clone function using a copy of endpointArgs. this is used when a drag starts: the endpoint that was dragged is cloned,\n // and the clone is left in its place while the original one goes off on a magical journey.\n // the copy is to get around a closure problem, in which endpointArgs ends up getting shared by\n // the whole world.\n //var argsForClone = jsPlumb.extend({}, endpointArgs);\n endpoint.clone = function () {\n // TODO this, and the code above, can be refactored to be more dry.\n if (_ju.isString(ep)) {\n return _e(ep, endpointArgs);\n }\n else if (_ju.isArray(ep)) {\n endpointArgs = _ju.merge(ep[1], endpointArgs);\n return _e(ep[0], endpointArgs);\n }\n }.bind(this);\n\n endpoint.typeId = typeId;\n return endpoint;\n };\n\n this.setEndpoint = function(ep, doNotRepaint) {\n var _ep = this.prepareEndpoint(ep);\n this.setPreparedEndpoint(_ep, true);\n };\n\n this.setPreparedEndpoint = function (ep, doNotRepaint) {\n if (this.endpoint != null) {\n this.endpoint.cleanup();\n this.endpoint.destroy();\n }\n this.endpoint = ep;\n this.type = this.endpoint.type;\n this.canvas = this.endpoint.canvas;\n };\n\n _jp.extend(this, params, typeParameters);\n\n this.isSource = params.isSource || false;\n this.isTemporarySource = params.isTemporarySource || false;\n this.isTarget = params.isTarget || false;\n\n this.connections = params.connections || [];\n this.connectorPointerEvents = params[\"connector-pointer-events\"];\n\n this.scope = params.scope || _jsPlumb.getDefaultScope();\n this.timestamp = null;\n this.reattachConnections = params.reattach || _jsPlumb.Defaults.ReattachConnections;\n this.connectionsDetachable = _jsPlumb.Defaults.ConnectionsDetachable;\n if (params.connectionsDetachable === false || params.detachable === false) {\n this.connectionsDetachable = false;\n }\n this.dragAllowedWhenFull = params.dragAllowedWhenFull !== false;\n\n if (params.onMaxConnections) {\n this.bind(\"maxConnections\", params.onMaxConnections);\n }\n\n //\n // add a connection. not part of public API.\n //\n this.addConnection = function (connection) {\n this.connections.push(connection);\n this[(this.connections.length > 0 ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointConnectedClass);\n this[(this.isFull() ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointFullClass);\n };\n\n this.detachFromConnection = function (connection, idx, doNotCleanup) {\n idx = idx == null ? this.connections.indexOf(connection) : idx;\n if (idx >= 0) {\n this.connections.splice(idx, 1);\n this[(this.connections.length > 0 ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointConnectedClass);\n this[(this.isFull() ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointFullClass);\n }\n\n if (!doNotCleanup && deleteOnEmpty && this.connections.length === 0) {\n _jsPlumb.deleteObject({\n endpoint: this,\n fireEvent: false,\n deleteAttachedObjects: doNotCleanup !== true\n });\n }\n };\n\n this.deleteEveryConnection = function(params) {\n var c = this.connections.length;\n for (var i = 0; i < c; i++) {\n _jsPlumb.deleteConnection(this.connections[0], params);\n }\n };\n\n this.detachFrom = function (targetEndpoint, fireEvent, originalEvent) {\n var c = [];\n for (var i = 0; i < this.connections.length; i++) {\n if (this.connections[i].endpoints[1] === targetEndpoint || this.connections[i].endpoints[0] === targetEndpoint) {\n c.push(this.connections[i]);\n }\n }\n for (var j = 0, count = c.length; j < count; j++) {\n _jsPlumb.deleteConnection(c[0]);\n }\n return this;\n };\n\n this.getElement = function () {\n return this.element;\n };\n\n this.setElement = function (el) {\n var parentId = this._jsPlumb.instance.getId(el),\n curId = this.elementId;\n // remove the endpoint from the list for the current endpoint's element\n _ju.removeWithFunction(params.endpointsByElement[this.elementId], function (e) {\n return e.id === this.id;\n }.bind(this));\n this.element = _jp.getElement(el);\n this.elementId = _jsPlumb.getId(this.element);\n _jsPlumb.anchorManager.rehomeEndpoint(this, curId, this.element);\n _jsPlumb.dragManager.endpointAdded(this.element);\n _ju.addToList(params.endpointsByElement, parentId, this);\n return this;\n };\n\n /**\n * private but must be exposed.\n */\n this.makeInPlaceCopy = function () {\n var loc = this.anchor.getCurrentLocation({element: this}),\n o = this.anchor.getOrientation(this),\n acc = this.anchor.getCssClass(),\n inPlaceAnchor = {\n bind: function () {\n },\n compute: function () {\n return [ loc[0], loc[1] ];\n },\n getCurrentLocation: function () {\n return [ loc[0], loc[1] ];\n },\n getOrientation: function () {\n return o;\n },\n getCssClass: function () {\n return acc;\n }\n };\n\n return _newEndpoint({\n dropOptions: params.dropOptions,\n anchor: inPlaceAnchor,\n source: this.element,\n paintStyle: this.getPaintStyle(),\n endpoint: params.hideOnDrag ? \"Blank\" : this.endpoint,\n _transient: true,\n scope: this.scope,\n reference:this\n });\n };\n\n /**\n * returns a connection from the pool; used when dragging starts. just gets the head of the array if it can.\n */\n this.connectorSelector = function () {\n return this.connections[0];\n };\n\n this.setStyle = this.setPaintStyle;\n\n this.paint = function (params) {\n params = params || {};\n var timestamp = params.timestamp, recalc = !(params.recalc === false);\n if (!timestamp || this.timestamp !== timestamp) {\n\n var info = _jsPlumb.updateOffset({ elId: this.elementId, timestamp: timestamp });\n\n var xy = params.offset ? params.offset.o : info.o;\n if (xy != null) {\n var ap = params.anchorPoint, connectorPaintStyle = params.connectorPaintStyle;\n if (ap == null) {\n var wh = params.dimensions || info.s,\n anchorParams = { xy: [ xy.left, xy.top ], wh: wh, element: this, timestamp: timestamp };\n if (recalc && this.anchor.isDynamic && this.connections.length > 0) {\n var c = findConnectionToUseForDynamicAnchor(this, params.elementWithPrecedence),\n oIdx = c.endpoints[0] === this ? 1 : 0,\n oId = oIdx === 0 ? c.sourceId : c.targetId,\n oInfo = _jsPlumb.getCachedData(oId),\n oOffset = oInfo.o, oWH = oInfo.s;\n\n anchorParams.index = oIdx === 0 ? 1 : 0;\n anchorParams.connection = c;\n anchorParams.txy = [ oOffset.left, oOffset.top ];\n anchorParams.twh = oWH;\n anchorParams.tElement = c.endpoints[oIdx];\n } else if (this.connections.length > 0) {\n anchorParams.connection = this.connections[0];\n }\n ap = this.anchor.compute(anchorParams);\n }\n\n this.endpoint.compute(ap, this.anchor.getOrientation(this), this._jsPlumb.paintStyleInUse, connectorPaintStyle || this.paintStyleInUse);\n this.endpoint.paint(this._jsPlumb.paintStyleInUse, this.anchor);\n this.timestamp = timestamp;\n\n // paint overlays\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays.hasOwnProperty(i)) {\n var o = this._jsPlumb.overlays[i];\n if (o.isVisible()) {\n this._jsPlumb.overlayPlacements[i] = o.draw(this.endpoint, this._jsPlumb.paintStyleInUse);\n o.paint(this._jsPlumb.overlayPlacements[i]);\n }\n }\n }\n }\n }\n };\n\n this.getTypeDescriptor = function () {\n return \"endpoint\";\n };\n this.isVisible = function () {\n return this._jsPlumb.visible;\n };\n\n this.repaint = this.paint;\n\n var draggingInitialised = false;\n this.initDraggable = function () {\n\n // is this a connection source? we make it draggable and have the\n // drag listener maintain a connection with a floating endpoint.\n if (!draggingInitialised && _jp.isDragSupported(this.element)) {\n var placeholderInfo = { id: null, element: null },\n jpc = null,\n existingJpc = false,\n existingJpcParams = null,\n _dragHandler = _makeConnectionDragHandler(this, placeholderInfo, _jsPlumb),\n dragOptions = params.dragOptions || {},\n defaultOpts = {},\n startEvent = _jp.dragEvents.start,\n stopEvent = _jp.dragEvents.stop,\n dragEvent = _jp.dragEvents.drag,\n beforeStartEvent = _jp.dragEvents.beforeStart,\n payload;\n\n // respond to beforeStart from katavorio; this will have, optionally, a payload of attribute values\n // that were placed there by the makeSource mousedown listener.\n var beforeStart = function(beforeStartParams) {\n payload = beforeStartParams.e.payload || {};\n };\n\n var start = function (startParams) {\n\n// ------------- first, get a connection to drag. this may be null, in which case we are dragging a new one.\n\n jpc = this.connectorSelector();\n\n// -------------------------------- now a bunch of tests about whether or not to proceed -------------------------\n\n var _continue = true;\n // if not enabled, return\n if (!this.isEnabled()) {\n _continue = false;\n }\n // if no connection and we're not a source - or temporarily a source, as is the case with makeSource - return.\n if (jpc == null && !this.isSource && !this.isTemporarySource) {\n _continue = false;\n }\n // otherwise if we're full and not allowed to drag, also return false.\n if (this.isSource && this.isFull() && !(jpc != null && this.dragAllowedWhenFull)) {\n _continue = false;\n }\n // if the connection was setup as not detachable or one of its endpoints\n // was setup as connectionsDetachable = false, or Defaults.ConnectionsDetachable\n // is set to false...\n if (jpc != null && !jpc.isDetachable(this)) {\n // .. and the endpoint is full\n if (this.isFull()) {\n _continue = false;\n } else {\n // otherwise, if not full, set the connection to null, and we will now proceed\n // to drag a new connection.\n jpc = null;\n }\n }\n\n var beforeDrag = _jsPlumb.checkCondition(jpc == null ? \"beforeDrag\" : \"beforeStartDetach\", {\n endpoint:this,\n source:this.element,\n sourceId:this.elementId,\n connection:jpc\n });\n if (beforeDrag === false) {\n _continue = false;\n }\n // else we might have been given some data. we'll pass it in to a new connection as 'data'.\n // here we also merge in the optional payload we were given on mousedown.\n else if (typeof beforeDrag === \"object\") {\n _jp.extend(beforeDrag, payload || {});\n }\n else {\n // or if no beforeDrag data, maybe use the payload on its own.\n beforeDrag = payload || {};\n }\n\n if (_continue === false) {\n // this is for mootools and yui. returning false from this causes jquery to stop drag.\n // the events are wrapped in both mootools and yui anyway, but i don't think returning\n // false from the start callback would stop a drag.\n if (_jsPlumb.stopDrag) {\n _jsPlumb.stopDrag(this.canvas);\n }\n _dragHandler.stopDrag();\n return false;\n }\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n // ok to proceed.\n\n // clear hover for all connections for this endpoint before continuing.\n for (var i = 0; i < this.connections.length; i++) {\n this.connections[i].setHover(false);\n }\n\n this.addClass(\"endpointDrag\");\n _jsPlumb.setConnectionBeingDragged(true);\n\n // if we're not full but there was a connection, make it null. we'll create a new one.\n if (jpc && !this.isFull() && this.isSource) {\n jpc = null;\n }\n\n _jsPlumb.updateOffset({ elId: this.elementId });\n\n// ---------------- make the element we will drag around, and position it -----------------------------\n\n var ipco = this._jsPlumb.instance.getOffset(this.canvas),\n canvasElement = this.canvas,\n ips = this._jsPlumb.instance.getSize(this.canvas);\n\n _makeDraggablePlaceholder(placeholderInfo, _jsPlumb, ipco, ips);\n\n // store the id of the dragging div and the source element. the drop function will pick these up. \n _jsPlumb.setAttributes(this.canvas, {\n \"dragId\": placeholderInfo.id,\n \"elId\": this.elementId\n });\n\n// ------------------- create an endpoint that will be our floating endpoint ------------------------------------\n\n var endpointToFloat = this.dragProxy || this.endpoint;\n if (this.dragProxy == null && this.connectionType != null) {\n var aae = this._jsPlumb.instance.deriveEndpointAndAnchorSpec(this.connectionType);\n if (aae.endpoints[1]) {\n endpointToFloat = aae.endpoints[1];\n }\n }\n var centerAnchor = this._jsPlumb.instance.makeAnchor(\"Center\");\n centerAnchor.isFloating = true;\n this._jsPlumb.floatingEndpoint = _makeFloatingEndpoint(this.getPaintStyle(), centerAnchor, endpointToFloat, this.canvas, placeholderInfo.element, _jsPlumb, _newEndpoint, this.scope);\n var _savedAnchor = this._jsPlumb.floatingEndpoint.anchor;\n\n\n if (jpc == null) {\n\n this.setHover(false, false);\n // create a connection. one end is this endpoint, the other is a floating endpoint. \n jpc = _newConnection({\n sourceEndpoint: this,\n targetEndpoint: this._jsPlumb.floatingEndpoint,\n source: this.element, // for makeSource with parent option. ensure source element is represented correctly.\n target: placeholderInfo.element,\n anchors: [ this.anchor, this._jsPlumb.floatingEndpoint.anchor ],\n paintStyle: params.connectorStyle, // this can be null. Connection will use the default.\n hoverPaintStyle: params.connectorHoverStyle,\n connector: params.connector, // this can also be null. Connection will use the default.\n overlays: params.connectorOverlays,\n type: this.connectionType,\n cssClass: this.connectorClass,\n hoverClass: this.connectorHoverClass,\n scope:params.scope,\n data:beforeDrag\n });\n jpc.pending = true;\n jpc.addClass(_jsPlumb.draggingClass);\n this._jsPlumb.floatingEndpoint.addClass(_jsPlumb.draggingClass);\n this._jsPlumb.floatingEndpoint.anchor = _savedAnchor;\n // fire an event that informs that a connection is being dragged\n _jsPlumb.fire(\"connectionDrag\", jpc);\n\n // register the new connection on the drag manager. This connection, at this point, is 'pending',\n // and has as its target a temporary element (the 'placeholder'). If the connection subsequently\n // becomes established, the anchor manager is informed that the target of the connection has\n // changed.\n\n _jsPlumb.anchorManager.newConnection(jpc);\n\n } else {\n existingJpc = true;\n jpc.setHover(false);\n // new anchor idx\n var anchorIdx = jpc.endpoints[0].id === this.id ? 0 : 1;\n this.detachFromConnection(jpc, null, true); // detach from the connection while dragging is occurring. but dont cleanup automatically.\n\n // store the original scope (issue 57)\n var dragScope = _jsPlumb.getDragScope(canvasElement);\n _jsPlumb.setAttribute(this.canvas, \"originalScope\", dragScope);\n\n // fire an event that informs that a connection is being dragged. we do this before\n // replacing the original target with the floating element info.\n _jsPlumb.fire(\"connectionDrag\", jpc);\n\n // now we replace ourselves with the temporary div we created above:\n if (anchorIdx === 0) {\n existingJpcParams = [ jpc.source, jpc.sourceId, canvasElement, dragScope ];\n _jsPlumb.anchorManager.sourceChanged(jpc.endpoints[anchorIdx].elementId, placeholderInfo.id, jpc, placeholderInfo.element);\n\n } else {\n existingJpcParams = [ jpc.target, jpc.targetId, canvasElement, dragScope ];\n jpc.target = placeholderInfo.element;\n jpc.targetId = placeholderInfo.id;\n\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.endpoints[anchorIdx].elementId, jpc.targetId, jpc);\n }\n\n // store the original endpoint and assign the new floating endpoint for the drag.\n jpc.suspendedEndpoint = jpc.endpoints[anchorIdx];\n\n // PROVIDE THE SUSPENDED ELEMENT, BE IT A SOURCE OR TARGET (ISSUE 39)\n jpc.suspendedElement = jpc.endpoints[anchorIdx].getElement();\n jpc.suspendedElementId = jpc.endpoints[anchorIdx].elementId;\n jpc.suspendedElementType = anchorIdx === 0 ? \"source\" : \"target\";\n\n jpc.suspendedEndpoint.setHover(false);\n this._jsPlumb.floatingEndpoint.referenceEndpoint = jpc.suspendedEndpoint;\n jpc.endpoints[anchorIdx] = this._jsPlumb.floatingEndpoint;\n\n jpc.addClass(_jsPlumb.draggingClass);\n this._jsPlumb.floatingEndpoint.addClass(_jsPlumb.draggingClass);\n }\n\n _jsPlumb.registerFloatingConnection(placeholderInfo, jpc, this._jsPlumb.floatingEndpoint);\n\n // // register it and register connection on it.\n // _jsPlumb.floatingConnections[placeholderInfo.id] = jpc;\n //\n // // only register for the target endpoint; we will not be dragging the source at any time\n // // before this connection is either discarded or made into a permanent connection.\n // _ju.addToList(params.endpointsByElement, placeholderInfo.id, this._jsPlumb.floatingEndpoint);\n\n\n // tell jsplumb about it\n _jsPlumb.currentlyDragging = true;\n }.bind(this);\n\n var stop = function () {\n _jsPlumb.setConnectionBeingDragged(false);\n\n if (jpc && jpc.endpoints != null) {\n // get the actual drop event (decode from library args to stop function)\n var originalEvent = _jsPlumb.getDropEvent(arguments);\n // unlock the other endpoint (if it is dynamic, it would have been locked at drag start)\n var idx = _jsPlumb.getFloatingAnchorIndex(jpc);\n jpc.endpoints[idx === 0 ? 1 : 0].anchor.unlock();\n // TODO: Dont want to know about css classes inside jsplumb, ideally.\n jpc.removeClass(_jsPlumb.draggingClass);\n\n // if we have the floating endpoint then the connection has not been dropped\n // on another endpoint. If it is a new connection we throw it away. If it is an\n // existing connection we check to see if we should reattach it, throwing it away\n // if not.\n if (this._jsPlumb && (jpc.deleteConnectionNow || jpc.endpoints[idx] === this._jsPlumb.floatingEndpoint)) {\n // 6a. if the connection was an existing one...\n if (existingJpc && jpc.suspendedEndpoint) {\n // fix for issue35, thanks Sylvain Gizard: when firing the detach event make sure the\n // floating endpoint has been replaced.\n if (idx === 0) {\n jpc.floatingElement = jpc.source;\n jpc.floatingId = jpc.sourceId;\n jpc.floatingEndpoint = jpc.endpoints[0];\n jpc.floatingIndex = 0;\n jpc.source = existingJpcParams[0];\n jpc.sourceId = existingJpcParams[1];\n } else {\n // keep a copy of the floating element; the anchor manager will want to clean up.\n jpc.floatingElement = jpc.target;\n jpc.floatingId = jpc.targetId;\n jpc.floatingEndpoint = jpc.endpoints[1];\n jpc.floatingIndex = 1;\n jpc.target = existingJpcParams[0];\n jpc.targetId = existingJpcParams[1];\n }\n\n var fe = this._jsPlumb.floatingEndpoint; // store for later removal.\n // restore the original scope (issue 57)\n _jsPlumb.setDragScope(existingJpcParams[2], existingJpcParams[3]);\n jpc.endpoints[idx] = jpc.suspendedEndpoint;\n // if the connection should be reattached, or the other endpoint refuses detach, then\n // reset the connection to its original state\n if (jpc.isReattach() || jpc._forceReattach || jpc._forceDetach || !_jsPlumb.deleteConnection(jpc, {originalEvent: originalEvent})) {\n\n jpc.setHover(false);\n jpc._forceDetach = null;\n jpc._forceReattach = null;\n this._jsPlumb.floatingEndpoint.detachFromConnection(jpc);\n jpc.suspendedEndpoint.addConnection(jpc);\n\n // TODO this code is duplicated in lots of places...and there is nothing external\n // in the code; it all refers to the connection itself. we could add a\n // `checkSanity(connection)` method to anchorManager that did this.\n if (idx === 1) {\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.floatingId, jpc.targetId, jpc);\n }\n else {\n _jsPlumb.anchorManager.sourceChanged(jpc.floatingId, jpc.sourceId, jpc, jpc.source);\n }\n\n _jsPlumb.repaint(existingJpcParams[1]);\n }\n else {\n _jsPlumb.deleteObject({endpoint: fe});\n }\n }\n }\n\n // makeTargets sets this flag, to tell us we have been replaced and should delete this object.\n if (this.deleteAfterDragStop) {\n _jsPlumb.deleteObject({endpoint: this});\n }\n else {\n if (this._jsPlumb) {\n this.paint({recalc: false});\n }\n }\n\n // although the connection is no longer valid, there are use cases where this is useful.\n _jsPlumb.fire(\"connectionDragStop\", jpc, originalEvent);\n // fire this event to give people more fine-grained control (connectionDragStop fires a lot)\n if (jpc.pending) {\n _jsPlumb.fire(\"connectionAborted\", jpc, originalEvent);\n }\n // tell jsplumb that dragging is finished.\n _jsPlumb.currentlyDragging = false;\n jpc.suspendedElement = null;\n jpc.suspendedEndpoint = null;\n jpc = null;\n }\n\n // if no endpoints, jpc already cleaned up. but still we want to ensure we're reset properly.\n // remove the element associated with the floating endpoint\n // (and its associated floating endpoint and visual artefacts)\n if (placeholderInfo && placeholderInfo.element) {\n _jsPlumb.remove(placeholderInfo.element, false, false);\n }\n // remove the inplace copy\n if (inPlaceCopy) {\n _jsPlumb.deleteObject({endpoint: inPlaceCopy});\n }\n\n if (this._jsPlumb) {\n // make our canvas visible (TODO: hand off to library; we should not know about DOM)\n this.canvas.style.visibility = \"visible\";\n // unlock our anchor\n this.anchor.unlock();\n // clear floating anchor.\n this._jsPlumb.floatingEndpoint = null;\n }\n\n }.bind(this);\n\n dragOptions = _jp.extend(defaultOpts, dragOptions);\n dragOptions.scope = this.scope || dragOptions.scope;\n dragOptions[beforeStartEvent] = _ju.wrap(dragOptions[beforeStartEvent], beforeStart, false);\n dragOptions[startEvent] = _ju.wrap(dragOptions[startEvent], start, false);\n // extracted drag handler function so can be used by makeSource\n dragOptions[dragEvent] = _ju.wrap(dragOptions[dragEvent], _dragHandler.drag);\n dragOptions[stopEvent] = _ju.wrap(dragOptions[stopEvent], stop);\n dragOptions.multipleDrop = false;\n\n dragOptions.canDrag = function () {\n return this.isSource || this.isTemporarySource || (this.connections.length > 0 && this.connectionsDetachable !== false);\n }.bind(this);\n\n _jsPlumb.initDraggable(this.canvas, dragOptions, \"internal\");\n\n this.canvas._jsPlumbRelatedElement = this.element;\n\n draggingInitialised = true;\n }\n };\n\n var ep = params.endpoint || this._jsPlumb.instance.Defaults.Endpoint || _jp.Defaults.Endpoint;\n this.setEndpoint(ep, true);\n var anchorParamsToUse = params.anchor ? params.anchor : params.anchors ? params.anchors : (_jsPlumb.Defaults.Anchor || \"Top\");\n this.setAnchor(anchorParamsToUse, true);\n\n // finally, set type if it was provided\n var type = [ \"default\", (params.type || \"\")].join(\" \");\n this.addType(type, params.data, true);\n this.canvas = this.endpoint.canvas;\n this.canvas._jsPlumb = this;\n\n this.initDraggable();\n\n // pulled this out into a function so we can reuse it for the inPlaceCopy canvas; you can now drop detached connections\n // back onto the endpoint you detached it from.\n var _initDropTarget = function (canvas, isTransient, endpoint, referenceEndpoint) {\n\n if (_jp.isDropSupported(this.element)) {\n var dropOptions = params.dropOptions || _jsPlumb.Defaults.DropOptions || _jp.Defaults.DropOptions;\n dropOptions = _jp.extend({}, dropOptions);\n dropOptions.scope = dropOptions.scope || this.scope;\n var dropEvent = _jp.dragEvents.drop,\n overEvent = _jp.dragEvents.over,\n outEvent = _jp.dragEvents.out,\n _ep = this,\n drop = _jsPlumb.EndpointDropHandler({\n getEndpoint: function () {\n return _ep;\n },\n jsPlumb: _jsPlumb,\n enabled: function () {\n return endpoint != null ? endpoint.isEnabled() : true;\n },\n isFull: function () {\n return endpoint.isFull();\n },\n element: this.element,\n elementId: this.elementId,\n isSource: this.isSource,\n isTarget: this.isTarget,\n addClass: function (clazz) {\n _ep.addClass(clazz);\n },\n removeClass: function (clazz) {\n _ep.removeClass(clazz);\n },\n isDropAllowed: function () {\n return _ep.isDropAllowed.apply(_ep, arguments);\n },\n reference:referenceEndpoint,\n isRedrop:function(jpc, dhParams) {\n return jpc.suspendedEndpoint && dhParams.reference && (jpc.suspendedEndpoint.id === dhParams.reference.id);\n }\n });\n\n dropOptions[dropEvent] = _ju.wrap(dropOptions[dropEvent], drop, true);\n dropOptions[overEvent] = _ju.wrap(dropOptions[overEvent], function () {\n var draggable = _jp.getDragObject(arguments),\n id = _jsPlumb.getAttribute(_jp.getElement(draggable), \"dragId\"),\n _jpc = _jsPlumb.getFloatingConnectionFor(id);//_jsPlumb.floatingConnections[id];\n\n if (_jpc != null) {\n var idx = _jsPlumb.getFloatingAnchorIndex(_jpc);\n // here we should fire the 'over' event if we are a target and this is a new connection,\n // or we are the same as the floating endpoint.\n var _cont = (this.isTarget && idx !== 0) || (_jpc.suspendedEndpoint && this.referenceEndpoint && this.referenceEndpoint.id === _jpc.suspendedEndpoint.id);\n if (_cont) {\n var bb = _jsPlumb.checkCondition(\"checkDropAllowed\", {\n sourceEndpoint: _jpc.endpoints[idx],\n targetEndpoint: this,\n connection: _jpc\n });\n this[(bb ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointDropAllowedClass);\n this[(bb ? \"remove\" : \"add\") + \"Class\"](_jsPlumb.endpointDropForbiddenClass);\n _jpc.endpoints[idx].anchor.over(this.anchor, this);\n }\n }\n }.bind(this));\n\n dropOptions[outEvent] = _ju.wrap(dropOptions[outEvent], function () {\n var draggable = _jp.getDragObject(arguments),\n id = draggable == null ? null : _jsPlumb.getAttribute(_jp.getElement(draggable), \"dragId\"),\n _jpc = id ? _jsPlumb.getFloatingConnectionFor(id) : null;\n\n if (_jpc != null) {\n var idx = _jsPlumb.getFloatingAnchorIndex(_jpc);\n var _cont = (this.isTarget && idx !== 0) || (_jpc.suspendedEndpoint && this.referenceEndpoint && this.referenceEndpoint.id === _jpc.suspendedEndpoint.id);\n if (_cont) {\n this.removeClass(_jsPlumb.endpointDropAllowedClass);\n this.removeClass(_jsPlumb.endpointDropForbiddenClass);\n _jpc.endpoints[idx].anchor.out();\n }\n }\n }.bind(this));\n\n _jsPlumb.initDroppable(canvas, dropOptions, \"internal\", isTransient);\n }\n }.bind(this);\n\n // Initialise the endpoint's canvas as a drop target. The drop handler will take care of the logic of whether\n // something can actually be dropped.\n if (!this.anchor.isFloating) {\n _initDropTarget(this.canvas, !(params._transient || this.anchor.isFloating), this, params.reference);\n }\n\n return this;\n };\n\n _ju.extend(_jp.Endpoint, _jp.OverlayCapableJsPlumbUIComponent, {\n\n setVisible: function (v, doNotChangeConnections, doNotNotifyOtherEndpoint) {\n this._jsPlumb.visible = v;\n if (this.canvas) {\n this.canvas.style.display = v ? \"block\" : \"none\";\n }\n this[v ? \"showOverlays\" : \"hideOverlays\"]();\n if (!doNotChangeConnections) {\n for (var i = 0; i < this.connections.length; i++) {\n this.connections[i].setVisible(v);\n if (!doNotNotifyOtherEndpoint) {\n var oIdx = this === this.connections[i].endpoints[0] ? 1 : 0;\n // only change the other endpoint if this is its only connection.\n if (this.connections[i].endpoints[oIdx].connections.length === 1) {\n this.connections[i].endpoints[oIdx].setVisible(v, true, true);\n }\n }\n }\n }\n },\n getAttachedElements: function () {\n return this.connections;\n },\n applyType: function (t, doNotRepaint) {\n this.setPaintStyle(t.endpointStyle || t.paintStyle, doNotRepaint);\n this.setHoverPaintStyle(t.endpointHoverStyle || t.hoverPaintStyle, doNotRepaint);\n if (t.maxConnections != null) {\n this._jsPlumb.maxConnections = t.maxConnections;\n }\n if (t.scope) {\n this.scope = t.scope;\n }\n _jp.extend(this, t, typeParameters);\n if (t.cssClass != null && this.canvas) {\n this._jsPlumb.instance.addClass(this.canvas, t.cssClass);\n }\n _jp.OverlayCapableJsPlumbUIComponent.applyType(this, t);\n },\n isEnabled: function () {\n return this._jsPlumb.enabled;\n },\n setEnabled: function (e) {\n this._jsPlumb.enabled = e;\n },\n cleanup: function () {\n var anchorClass = this._jsPlumb.instance.endpointAnchorClassPrefix + (this._jsPlumb.currentAnchorClass ? \"-\" + this._jsPlumb.currentAnchorClass : \"\");\n _jp.removeClass(this.element, anchorClass);\n this.anchor = null;\n this.endpoint.cleanup(true);\n this.endpoint.destroy();\n this.endpoint = null;\n // drag/drop\n this._jsPlumb.instance.destroyDraggable(this.canvas, \"internal\");\n this._jsPlumb.instance.destroyDroppable(this.canvas, \"internal\");\n },\n setHover: function (h) {\n if (this.endpoint && this._jsPlumb && !this._jsPlumb.instance.isConnectionBeingDragged()) {\n this.endpoint.setHover(h);\n }\n },\n isFull: function () {\n return this._jsPlumb.maxConnections === 0 ? true : !(this.isFloating() || this._jsPlumb.maxConnections < 0 || this.connections.length < this._jsPlumb.maxConnections);\n },\n /**\n * private but needs to be exposed.\n */\n isFloating: function () {\n return this.anchor != null && this.anchor.isFloating;\n },\n isConnectedTo: function (endpoint) {\n var found = false;\n if (endpoint) {\n for (var i = 0; i < this.connections.length; i++) {\n if (this.connections[i].endpoints[1] === endpoint || this.connections[i].endpoints[0] === endpoint) {\n found = true;\n break;\n }\n }\n }\n return found;\n },\n getConnectionCost: function () {\n return this._jsPlumb.connectionCost;\n },\n setConnectionCost: function (c) {\n this._jsPlumb.connectionCost = c;\n },\n areConnectionsDirected: function () {\n return this._jsPlumb.connectionsDirected;\n },\n setConnectionsDirected: function (b) {\n this._jsPlumb.connectionsDirected = b;\n },\n setElementId: function (_elId) {\n this.elementId = _elId;\n this.anchor.elementId = _elId;\n },\n setReferenceElement: function (_el) {\n this.element = _jp.getElement(_el);\n },\n setDragAllowedWhenFull: function (allowed) {\n this.dragAllowedWhenFull = allowed;\n },\n equals: function (endpoint) {\n return this.anchor.equals(endpoint.anchor);\n },\n getUuid: function () {\n return this._jsPlumb.uuid;\n },\n computeAnchor: function (params) {\n return this.anchor.compute(params);\n }\n });\n\n root.jsPlumbInstance.prototype.EndpointDropHandler = function (dhParams) {\n return function (e) {\n\n var _jsPlumb = dhParams.jsPlumb;\n\n // remove the classes that are added dynamically. drop is neither forbidden nor allowed now that\n // the drop is finishing.\n dhParams.removeClass(_jsPlumb.endpointDropAllowedClass);\n dhParams.removeClass(_jsPlumb.endpointDropForbiddenClass);\n\n var originalEvent = _jsPlumb.getDropEvent(arguments),\n draggable = _jsPlumb.getDragObject(arguments),\n id = _jsPlumb.getAttribute(draggable, \"dragId\"),\n elId = _jsPlumb.getAttribute(draggable, \"elId\"),\n scope = _jsPlumb.getAttribute(draggable, \"originalScope\"),\n jpc = _jsPlumb.getFloatingConnectionFor(id);\n\n // if no active connection, bail.\n if (jpc == null) {\n return;\n }\n\n // calculate if this is an existing connection.\n var existingConnection = jpc.suspendedEndpoint != null;\n\n // if suspended endpoint exists but has been cleaned up, bail. This means it's an existing connection\n // that has been detached and will shortly be discarded.\n if (existingConnection && jpc.suspendedEndpoint._jsPlumb == null) {\n return;\n }\n\n // get the drop endpoint. for a normal connection this is just the one that would replace the currently\n // floating endpoint. for a makeTarget this is a new endpoint that is created on drop. But we leave that to\n // the handler to figure out.\n var _ep = dhParams.getEndpoint(jpc);\n\n // If we're not given an endpoint to use, bail.\n if (_ep == null) {\n return;\n }\n\n // if this is a drop back where the connection came from, mark it force reattach and\n // return; the stop handler will reattach. without firing an event.\n if (dhParams.isRedrop(jpc, dhParams)) {\n jpc._forceReattach = true;\n jpc.setHover(false);\n if (dhParams.maybeCleanup) {\n dhParams.maybeCleanup(_ep);\n }\n return;\n }\n\n // ensure we dont bother trying to drop sources on non-source eps, and same for target.\n var idx = _jsPlumb.getFloatingAnchorIndex(jpc);\n if ((idx === 0 && !dhParams.isSource)|| (idx === 1 && !dhParams.isTarget)){\n if (dhParams.maybeCleanup) {\n dhParams.maybeCleanup(_ep);\n }\n return;\n }\n\n if (dhParams.onDrop) {\n dhParams.onDrop(jpc);\n }\n\n // restore the original scope if necessary (issue 57)\n if (scope) {\n _jsPlumb.setDragScope(draggable, scope);\n }\n\n // if the target of the drop is full, fire an event (we abort below)\n // makeTarget: keep.\n var isFull = dhParams.isFull(e);\n if (isFull) {\n _ep.fire(\"maxConnections\", {\n endpoint: this,\n connection: jpc,\n maxConnections: _ep._jsPlumb.maxConnections\n }, originalEvent);\n }\n //\n // if endpoint enabled, not full, and matches the index of the floating endpoint...\n if (!isFull && dhParams.enabled()) {\n var _doContinue = true;\n\n // before testing for beforeDrop, reset the connection's source/target to be the actual DOM elements\n // involved (that is, stash any temporary stuff used for dragging. but we need to keep it around in\n // order that the anchor manager can clean things up properly).\n if (idx === 0) {\n jpc.floatingElement = jpc.source;\n jpc.floatingId = jpc.sourceId;\n jpc.floatingEndpoint = jpc.endpoints[0];\n jpc.floatingIndex = 0;\n jpc.source = dhParams.element;\n jpc.sourceId = dhParams.elementId;\n } else {\n jpc.floatingElement = jpc.target;\n jpc.floatingId = jpc.targetId;\n jpc.floatingEndpoint = jpc.endpoints[1];\n jpc.floatingIndex = 1;\n jpc.target = dhParams.element;\n jpc.targetId = dhParams.elementId;\n }\n\n // if this is an existing connection and detach is not allowed we won't continue. The connection's\n // endpoints have been reinstated; everything is back to how it was.\n if (existingConnection && jpc.suspendedEndpoint.id !== _ep.id) {\n if (!jpc.isDetachAllowed(jpc) || !jpc.endpoints[idx].isDetachAllowed(jpc) || !jpc.suspendedEndpoint.isDetachAllowed(jpc) || !_jsPlumb.checkCondition(\"beforeDetach\", jpc)) {\n _doContinue = false;\n }\n }\n\n// ------------ wrap the execution path in a function so we can support asynchronous beforeDrop\n\n var continueFunction = function (optionalData) {\n // remove this jpc from the current endpoint, which is a floating endpoint that we will\n // subsequently discard.\n jpc.endpoints[idx].detachFromConnection(jpc);\n\n // if there's a suspended endpoint, detach it from the connection.\n if (jpc.suspendedEndpoint) {\n jpc.suspendedEndpoint.detachFromConnection(jpc);\n }\n\n jpc.endpoints[idx] = _ep;\n _ep.addConnection(jpc);\n\n // copy our parameters in to the connection:\n var params = _ep.getParameters();\n for (var aParam in params) {\n jpc.setParameter(aParam, params[aParam]);\n }\n\n if (!existingConnection) {\n // if not an existing connection and\n if (params.draggable) {\n _jsPlumb.initDraggable(this.element, dhParams.dragOptions, \"internal\", _jsPlumb);\n }\n }\n else {\n var suspendedElementId = jpc.suspendedEndpoint.elementId;\n _jsPlumb.fireMoveEvent({\n index: idx,\n originalSourceId: idx === 0 ? suspendedElementId : jpc.sourceId,\n newSourceId: idx === 0 ? _ep.elementId : jpc.sourceId,\n originalTargetId: idx === 1 ? suspendedElementId : jpc.targetId,\n newTargetId: idx === 1 ? _ep.elementId : jpc.targetId,\n originalSourceEndpoint: idx === 0 ? jpc.suspendedEndpoint : jpc.endpoints[0],\n newSourceEndpoint: idx === 0 ? _ep : jpc.endpoints[0],\n originalTargetEndpoint: idx === 1 ? jpc.suspendedEndpoint : jpc.endpoints[1],\n newTargetEndpoint: idx === 1 ? _ep : jpc.endpoints[1],\n connection: jpc\n }, originalEvent);\n }\n\n if (idx === 1) {\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.floatingId, jpc.targetId, jpc);\n }\n else {\n _jsPlumb.anchorManager.sourceChanged(jpc.floatingId, jpc.sourceId, jpc, jpc.source);\n }\n\n // when makeSource has uniqueEndpoint:true, we want to create connections with new endpoints\n // that are subsequently deleted. So makeSource sets `finalEndpoint`, which is the Endpoint to\n // which the connection should be attached. The `detachFromConnection` call below results in the\n // temporary endpoint being cleaned up.\n if (jpc.endpoints[0].finalEndpoint) {\n var _toDelete = jpc.endpoints[0];\n _toDelete.detachFromConnection(jpc);\n jpc.endpoints[0] = jpc.endpoints[0].finalEndpoint;\n jpc.endpoints[0].addConnection(jpc);\n }\n\n // if optionalData was given, merge it onto the connection's data.\n if (_ju.isObject(optionalData)) {\n jpc.mergeData(optionalData);\n }\n // finalise will inform the anchor manager and also add to\n // connectionsByScope if necessary.\n _jsPlumb.finaliseConnection(jpc, null, originalEvent, false);\n jpc.setHover(false);\n\n // SP continuous anchor flush\n _jsPlumb.revalidate(jpc.endpoints[0].element);\n\n }.bind(this);\n\n var dontContinueFunction = function () {\n // otherwise just put it back on the endpoint it was on before the drag.\n if (jpc.suspendedEndpoint) {\n jpc.endpoints[idx] = jpc.suspendedEndpoint;\n jpc.setHover(false);\n jpc._forceDetach = true;\n if (idx === 0) {\n jpc.source = jpc.suspendedEndpoint.element;\n jpc.sourceId = jpc.suspendedEndpoint.elementId;\n } else {\n jpc.target = jpc.suspendedEndpoint.element;\n jpc.targetId = jpc.suspendedEndpoint.elementId;\n }\n jpc.suspendedEndpoint.addConnection(jpc);\n\n // TODO checkSanity\n if (idx === 1) {\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.floatingId, jpc.targetId, jpc);\n }\n else {\n _jsPlumb.anchorManager.sourceChanged(jpc.floatingId, jpc.sourceId, jpc, jpc.source);\n }\n\n _jsPlumb.repaint(jpc.sourceId);\n jpc._forceDetach = false;\n }\n };\n\n// --------------------------------------\n // now check beforeDrop. this will be available only on Endpoints that are setup to\n // have a beforeDrop condition (although, secretly, under the hood all Endpoints and\n // the Connection have them, because they are on jsPlumbUIComponent. shhh!), because\n // it only makes sense to have it on a target endpoint.\n _doContinue = _doContinue && dhParams.isDropAllowed(jpc.sourceId, jpc.targetId, jpc.scope, jpc, _ep);// && jpc.pending;\n\n if (_doContinue) {\n continueFunction(_doContinue);\n return true;\n }\n else {\n dontContinueFunction();\n }\n }\n\n if (dhParams.maybeCleanup) {\n dhParams.maybeCleanup(_ep);\n }\n\n _jsPlumb.currentlyDragging = false;\n };\n };\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the code for Connections.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this,\n _jp = root.jsPlumb,\n _ju = root.jsPlumbUtil;\n\n var makeConnector = function (_jsPlumb, renderMode, connectorName, connectorArgs, forComponent) {\n // first make sure we have a cache for the specified renderer\n _jp.Connectors[renderMode] = _jp.Connectors[renderMode] || {};\n\n // now see if the one we want exists; if not we will try to make it\n if (_jp.Connectors[renderMode][connectorName] == null) {\n\n if (_jp.Connectors[connectorName] == null) {\n if (!_jsPlumb.Defaults.DoNotThrowErrors) {\n throw new TypeError(\"jsPlumb: unknown connector type '\" + connectorName + \"'\");\n } else {\n return null;\n }\n }\n\n _jp.Connectors[renderMode][connectorName] = function() {\n _jp.Connectors[connectorName].apply(this, arguments);\n _jp.ConnectorRenderers[renderMode].apply(this, arguments);\n };\n\n _ju.extend(_jp.Connectors[renderMode][connectorName], [ _jp.Connectors[connectorName], _jp.ConnectorRenderers[renderMode]]);\n\n }\n\n return new _jp.Connectors[renderMode][connectorName](connectorArgs, forComponent);\n },\n _makeAnchor = function (anchorParams, elementId, _jsPlumb) {\n return (anchorParams) ? _jsPlumb.makeAnchor(anchorParams, elementId, _jsPlumb) : null;\n },\n _updateConnectedClass = function (conn, element, _jsPlumb, remove) {\n if (element != null) {\n element._jsPlumbConnections = element._jsPlumbConnections || {};\n if (remove) {\n delete element._jsPlumbConnections[conn.id];\n }\n else {\n element._jsPlumbConnections[conn.id] = true;\n }\n\n if (_ju.isEmpty(element._jsPlumbConnections)) {\n _jsPlumb.removeClass(element, _jsPlumb.connectedClass);\n }\n else {\n _jsPlumb.addClass(element, _jsPlumb.connectedClass);\n }\n }\n };\n\n _jp.Connection = function (params) {\n var _newEndpoint = params.newEndpoint;\n\n this.id = params.id;\n this.connector = null;\n this.idPrefix = \"_jsplumb_c_\";\n this.defaultLabelLocation = 0.5;\n this.defaultOverlayKeys = [\"Overlays\", \"ConnectionOverlays\"];\n // if a new connection is the result of moving some existing connection, params.previousConnection\n // will have that Connection in it. listeners for the jsPlumbConnection event can look for that\n // member and take action if they need to.\n this.previousConnection = params.previousConnection;\n this.source = _jp.getElement(params.source);\n this.target = _jp.getElement(params.target);\n\n\n _jp.OverlayCapableJsPlumbUIComponent.apply(this, arguments);\n\n // sourceEndpoint and targetEndpoint override source/target, if they are present. but \n // source is not overridden if the Endpoint has declared it is not the final target of a connection;\n // instead we use the source that the Endpoint declares will be the final source element.\n if (params.sourceEndpoint) {\n this.source = params.sourceEndpoint.getElement();\n this.sourceId = params.sourceEndpoint.elementId;\n } else {\n this.sourceId = this._jsPlumb.instance.getId(this.source);\n }\n\n if (params.targetEndpoint) {\n this.target = params.targetEndpoint.getElement();\n this.targetId = params.targetEndpoint.elementId;\n } else {\n this.targetId = this._jsPlumb.instance.getId(this.target);\n }\n\n\n this.scope = params.scope; // scope may have been passed in to the connect call. if it wasn't, we will pull it from the source endpoint, after having initialised the endpoints. \n this.endpoints = [];\n this.endpointStyles = [];\n\n var _jsPlumb = this._jsPlumb.instance;\n\n _jsPlumb.manage(this.sourceId, this.source);\n _jsPlumb.manage(this.targetId, this.target);\n\n this._jsPlumb.visible = true;\n\n this._jsPlumb.params = {\n cssClass: params.cssClass,\n container: params.container,\n \"pointer-events\": params[\"pointer-events\"],\n editorParams: params.editorParams,\n overlays: params.overlays\n };\n this._jsPlumb.lastPaintedAt = null;\n\n // listen to mouseover and mouseout events passed from the container delegate.\n this.bind(\"mouseover\", function () {\n this.setHover(true);\n }.bind(this));\n this.bind(\"mouseout\", function () {\n this.setHover(false);\n }.bind(this));\n\n\n// INITIALISATION CODE\n\n this.makeEndpoint = function (isSource, el, elId, ep) {\n elId = elId || this._jsPlumb.instance.getId(el);\n return this.prepareEndpoint(_jsPlumb, _newEndpoint, this, ep, isSource ? 0 : 1, params, el, elId);\n };\n\n // if type given, get the endpoint definitions mapping to that type from the jsplumb instance, and use those.\n // we apply types at the end of this constructor but endpoints are only honoured in a type definition at\n // create time.\n if (params.type) {\n params.endpoints = params.endpoints || this._jsPlumb.instance.deriveEndpointAndAnchorSpec(params.type).endpoints;\n }\n\n var eS = this.makeEndpoint(true, this.source, this.sourceId, params.sourceEndpoint),\n eT = this.makeEndpoint(false, this.target, this.targetId, params.targetEndpoint);\n\n if (eS) {\n _ju.addToList(params.endpointsByElement, this.sourceId, eS);\n }\n if (eT) {\n _ju.addToList(params.endpointsByElement, this.targetId, eT);\n }\n // if scope not set, set it to be the scope for the source endpoint.\n if (!this.scope) {\n this.scope = this.endpoints[0].scope;\n }\n\n // if explicitly told to (or not to) delete endpoints when empty, override endpoint's preferences\n if (params.deleteEndpointsOnEmpty != null) {\n this.endpoints[0].setDeleteOnEmpty(params.deleteEndpointsOnEmpty);\n this.endpoints[1].setDeleteOnEmpty(params.deleteEndpointsOnEmpty);\n }\n\n// -------------------------- DEFAULT TYPE ---------------------------------------------\n\n // DETACHABLE\n var _detachable = _jsPlumb.Defaults.ConnectionsDetachable;\n if (params.detachable === false) {\n _detachable = false;\n }\n if (this.endpoints[0].connectionsDetachable === false) {\n _detachable = false;\n }\n if (this.endpoints[1].connectionsDetachable === false) {\n _detachable = false;\n }\n // REATTACH\n var _reattach = params.reattach || this.endpoints[0].reattachConnections || this.endpoints[1].reattachConnections || _jsPlumb.Defaults.ReattachConnections;\n\n this.appendToDefaultType({\n detachable: _detachable,\n reattach: _reattach,\n paintStyle:this.endpoints[0].connectorStyle || this.endpoints[1].connectorStyle || params.paintStyle || _jsPlumb.Defaults.PaintStyle || _jp.Defaults.PaintStyle,\n hoverPaintStyle:this.endpoints[0].connectorHoverStyle || this.endpoints[1].connectorHoverStyle || params.hoverPaintStyle || _jsPlumb.Defaults.HoverPaintStyle || _jp.Defaults.HoverPaintStyle\n });\n\n var _suspendedAt = _jsPlumb.getSuspendedAt();\n if (!_jsPlumb.isSuspendDrawing()) {\n // paint the endpoints\n var myInfo = _jsPlumb.getCachedData(this.sourceId),\n myOffset = myInfo.o, myWH = myInfo.s,\n otherInfo = _jsPlumb.getCachedData(this.targetId),\n otherOffset = otherInfo.o,\n otherWH = otherInfo.s,\n initialTimestamp = _suspendedAt || _jsPlumb.timestamp(),\n anchorLoc = this.endpoints[0].anchor.compute({\n xy: [ myOffset.left, myOffset.top ], wh: myWH, element: this.endpoints[0],\n elementId: this.endpoints[0].elementId,\n txy: [ otherOffset.left, otherOffset.top ], twh: otherWH, tElement: this.endpoints[1],\n timestamp: initialTimestamp\n });\n\n this.endpoints[0].paint({ anchorLoc: anchorLoc, timestamp: initialTimestamp });\n\n anchorLoc = this.endpoints[1].anchor.compute({\n xy: [ otherOffset.left, otherOffset.top ], wh: otherWH, element: this.endpoints[1],\n elementId: this.endpoints[1].elementId,\n txy: [ myOffset.left, myOffset.top ], twh: myWH, tElement: this.endpoints[0],\n timestamp: initialTimestamp\n });\n this.endpoints[1].paint({ anchorLoc: anchorLoc, timestamp: initialTimestamp });\n }\n\n this.getTypeDescriptor = function () {\n return \"connection\";\n };\n this.getAttachedElements = function () {\n return this.endpoints;\n };\n\n this.isDetachable = function (ep) {\n return this._jsPlumb.detachable === false ? false : ep != null ? ep.connectionsDetachable === true : this._jsPlumb.detachable === true;\n };\n this.setDetachable = function (detachable) {\n this._jsPlumb.detachable = detachable === true;\n };\n this.isReattach = function () {\n return this._jsPlumb.reattach === true || this.endpoints[0].reattachConnections === true || this.endpoints[1].reattachConnections === true;\n };\n this.setReattach = function (reattach) {\n this._jsPlumb.reattach = reattach === true;\n };\n\n// END INITIALISATION CODE\n\n\n// COST + DIRECTIONALITY\n // if cost not supplied, try to inherit from source endpoint\n this._jsPlumb.cost = params.cost || this.endpoints[0].getConnectionCost();\n this._jsPlumb.directed = params.directed;\n // inherit directed flag if set no source endpoint\n if (params.directed == null) {\n this._jsPlumb.directed = this.endpoints[0].areConnectionsDirected();\n }\n// END COST + DIRECTIONALITY\n\n// PARAMETERS\n // merge all the parameters objects into the connection. parameters set\n // on the connection take precedence; then source endpoint params, then\n // finally target endpoint params.\n var _p = _jp.extend({}, this.endpoints[1].getParameters());\n _jp.extend(_p, this.endpoints[0].getParameters());\n _jp.extend(_p, this.getParameters());\n this.setParameters(_p);\n// END PARAMETERS\n\n// PAINTING\n\n this.setConnector(this.endpoints[0].connector || this.endpoints[1].connector || params.connector || _jsPlumb.Defaults.Connector || _jp.Defaults.Connector, true);\n var data = params.data == null || !_ju.isObject(params.data) ? {} : params.data;\n this.getData = function() { return data; };\n this.setData = function(d) { data = d || {}; };\n this.mergeData = function(d) { data = _jp.extend(data, d); };\n\n // the very last thing we do is apply types, if there are any.\n var _types = [ \"default\", this.endpoints[0].connectionType, this.endpoints[1].connectionType, params.type ].join(\" \");\n if (/[^\\s]/.test(_types)) {\n this.addType(_types, params.data, true);\n }\n\n this.updateConnectedClass();\n\n// END PAINTING \n };\n\n _ju.extend(_jp.Connection, _jp.OverlayCapableJsPlumbUIComponent, {\n applyType: function (t, doNotRepaint, typeMap) {\n\n var _connector = null;\n if (t.connector != null) {\n _connector = this.getCachedTypeItem(\"connector\", typeMap.connector);\n if (_connector == null) {\n _connector = this.prepareConnector(t.connector, typeMap.connector);\n this.cacheTypeItem(\"connector\", _connector, typeMap.connector);\n }\n this.setPreparedConnector(_connector);\n }\n\n // none of these things result in the creation of objects so can be ignored.\n if (t.detachable != null) {\n this.setDetachable(t.detachable);\n }\n if (t.reattach != null) {\n this.setReattach(t.reattach);\n }\n if (t.scope) {\n this.scope = t.scope;\n }\n\n if (t.cssClass != null && this.canvas) {\n this._jsPlumb.instance.addClass(this.canvas, t.cssClass);\n }\n\n var _anchors = null;\n // this also results in the creation of objects.\n if (t.anchor) {\n // note that even if the param was anchor, we store `anchors`.\n _anchors = this.getCachedTypeItem(\"anchors\", typeMap.anchor);\n if (_anchors == null) {\n _anchors = [ this._jsPlumb.instance.makeAnchor(t.anchor), this._jsPlumb.instance.makeAnchor(t.anchor) ];\n this.cacheTypeItem(\"anchors\", _anchors, typeMap.anchor);\n }\n }\n else if (t.anchors) {\n _anchors = this.getCachedTypeItem(\"anchors\", typeMap.anchors);\n if (_anchors == null) {\n _anchors = [\n this._jsPlumb.instance.makeAnchor(t.anchors[0]),\n this._jsPlumb.instance.makeAnchor(t.anchors[1])\n ];\n this.cacheTypeItem(\"anchors\", _anchors, typeMap.anchors);\n }\n }\n if (_anchors != null) {\n this.endpoints[0].anchor = _anchors[0];\n this.endpoints[1].anchor = _anchors[1];\n if (this.endpoints[1].anchor.isDynamic) {\n this._jsPlumb.instance.repaint(this.endpoints[1].elementId);\n }\n }\n\n _jp.OverlayCapableJsPlumbUIComponent.applyType(this, t);\n },\n addClass: function (c, informEndpoints) {\n if (informEndpoints) {\n this.endpoints[0].addClass(c);\n this.endpoints[1].addClass(c);\n if (this.suspendedEndpoint) {\n this.suspendedEndpoint.addClass(c);\n }\n }\n if (this.connector) {\n this.connector.addClass(c);\n }\n },\n removeClass: function (c, informEndpoints) {\n if (informEndpoints) {\n this.endpoints[0].removeClass(c);\n this.endpoints[1].removeClass(c);\n if (this.suspendedEndpoint) {\n this.suspendedEndpoint.removeClass(c);\n }\n }\n if (this.connector) {\n this.connector.removeClass(c);\n }\n },\n isVisible: function () {\n return this._jsPlumb.visible;\n },\n setVisible: function (v) {\n this._jsPlumb.visible = v;\n if (this.connector) {\n this.connector.setVisible(v);\n }\n this.repaint();\n },\n cleanup: function () {\n this.updateConnectedClass(true);\n this.endpoints = null;\n this.source = null;\n this.target = null;\n if (this.connector != null) {\n this.connector.cleanup(true);\n this.connector.destroy(true);\n }\n this.connector = null;\n },\n updateConnectedClass:function(remove) {\n if (this._jsPlumb) {\n _updateConnectedClass(this, this.source, this._jsPlumb.instance, remove);\n _updateConnectedClass(this, this.target, this._jsPlumb.instance, remove);\n }\n },\n setHover: function (state) {\n if (this.connector && this._jsPlumb && !this._jsPlumb.instance.isConnectionBeingDragged()) {\n this.connector.setHover(state);\n root.jsPlumb[state ? \"addClass\" : \"removeClass\"](this.source, this._jsPlumb.instance.hoverSourceClass);\n root.jsPlumb[state ? \"addClass\" : \"removeClass\"](this.target, this._jsPlumb.instance.hoverTargetClass);\n }\n },\n getUuids:function() {\n return [ this.endpoints[0].getUuid(), this.endpoints[1].getUuid() ];\n },\n getCost: function () {\n return this._jsPlumb ? this._jsPlumb.cost : -Infinity;\n },\n setCost: function (c) {\n this._jsPlumb.cost = c;\n },\n isDirected: function () {\n return this._jsPlumb.directed;\n },\n getConnector: function () {\n return this.connector;\n },\n prepareConnector:function(connectorSpec, typeId) {\n var connectorArgs = {\n _jsPlumb: this._jsPlumb.instance,\n cssClass: this._jsPlumb.params.cssClass,\n container: this._jsPlumb.params.container,\n \"pointer-events\": this._jsPlumb.params[\"pointer-events\"]\n },\n renderMode = this._jsPlumb.instance.getRenderMode(),\n connector;\n\n if (_ju.isString(connectorSpec)) {\n connector = makeConnector(this._jsPlumb.instance, renderMode, connectorSpec, connectorArgs, this);\n } // lets you use a string as shorthand.\n else if (_ju.isArray(connectorSpec)) {\n if (connectorSpec.length === 1) {\n connector = makeConnector(this._jsPlumb.instance, renderMode, connectorSpec[0], connectorArgs, this);\n }\n else {\n connector = makeConnector(this._jsPlumb.instance, renderMode, connectorSpec[0], _ju.merge(connectorSpec[1], connectorArgs), this);\n }\n }\n if (typeId != null) {\n connector.typeId = typeId;\n }\n return connector;\n },\n setPreparedConnector: function(connector, doNotRepaint, doNotChangeListenerComponent, typeId) {\n\n if (this.connector !== connector) {\n\n var previous, previousClasses = \"\";\n // the connector will not be cleaned up if it was set as part of a type, because `typeId` will be set on it\n // and we havent passed in `true` for \"force\" here.\n if (this.connector != null) {\n previous = this.connector;\n previousClasses = previous.getClass();\n this.connector.cleanup();\n this.connector.destroy();\n }\n\n this.connector = connector;\n if (typeId) {\n this.cacheTypeItem(\"connector\", connector, typeId);\n }\n\n this.canvas = this.connector.canvas;\n this.bgCanvas = this.connector.bgCanvas;\n\n // put classes from prior connector onto the canvas\n this.addClass(previousClasses);\n\n // new: instead of binding listeners per connector, we now just have one delegate on the container.\n // so for that handler we set the connection as the '_jsPlumb' member of the canvas element, and\n // bgCanvas, if it exists, which it does right now in the VML renderer, so it won't from v 2.0.0 onwards.\n if (this.canvas) {\n this.canvas._jsPlumb = this;\n }\n if (this.bgCanvas) {\n this.bgCanvas._jsPlumb = this;\n }\n\n if (previous != null) {\n var o = this.getOverlays();\n for (var i = 0; i < o.length; i++) {\n if (o[i].transfer) {\n o[i].transfer(this.connector);\n }\n }\n }\n\n if (!doNotChangeListenerComponent) {\n this.setListenerComponent(this.connector);\n }\n if (!doNotRepaint) {\n this.repaint();\n }\n }\n },\n setConnector: function (connectorSpec, doNotRepaint, doNotChangeListenerComponent, typeId) {\n var connector = this.prepareConnector(connectorSpec, typeId);\n this.setPreparedConnector(connector, doNotRepaint, doNotChangeListenerComponent, typeId);\n },\n paint: function (params) {\n\n if (!this._jsPlumb.instance.isSuspendDrawing() && this._jsPlumb.visible) {\n params = params || {};\n var timestamp = params.timestamp,\n // if the moving object is not the source we must transpose the two references.\n swap = false,\n tId = swap ? this.sourceId : this.targetId, sId = swap ? this.targetId : this.sourceId,\n tIdx = swap ? 0 : 1, sIdx = swap ? 1 : 0;\n\n if (timestamp == null || timestamp !== this._jsPlumb.lastPaintedAt) {\n var sourceInfo = this._jsPlumb.instance.updateOffset({elId:sId}).o,\n targetInfo = this._jsPlumb.instance.updateOffset({elId:tId}).o,\n sE = this.endpoints[sIdx], tE = this.endpoints[tIdx];\n\n var sAnchorP = sE.anchor.getCurrentLocation({xy: [sourceInfo.left, sourceInfo.top], wh: [sourceInfo.width, sourceInfo.height], element: sE, timestamp: timestamp}),\n tAnchorP = tE.anchor.getCurrentLocation({xy: [targetInfo.left, targetInfo.top], wh: [targetInfo.width, targetInfo.height], element: tE, timestamp: timestamp});\n\n this.connector.resetBounds();\n\n this.connector.compute({\n sourcePos: sAnchorP,\n targetPos: tAnchorP,\n sourceOrientation:sE.anchor.getOrientation(sE),\n targetOrientation:tE.anchor.getOrientation(tE),\n sourceEndpoint: this.endpoints[sIdx],\n targetEndpoint: this.endpoints[tIdx],\n \"stroke-width\": this._jsPlumb.paintStyleInUse.strokeWidth,\n sourceInfo: sourceInfo,\n targetInfo: targetInfo\n });\n\n var overlayExtents = { minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity };\n\n // compute overlays. we do this first so we can get their placements, and adjust the\n // container if needs be (if an overlay would be clipped)\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays.hasOwnProperty(i)) {\n var o = this._jsPlumb.overlays[i];\n if (o.isVisible()) {\n this._jsPlumb.overlayPlacements[i] = o.draw(this.connector, this._jsPlumb.paintStyleInUse, this.getAbsoluteOverlayPosition(o));\n overlayExtents.minX = Math.min(overlayExtents.minX, this._jsPlumb.overlayPlacements[i].minX);\n overlayExtents.maxX = Math.max(overlayExtents.maxX, this._jsPlumb.overlayPlacements[i].maxX);\n overlayExtents.minY = Math.min(overlayExtents.minY, this._jsPlumb.overlayPlacements[i].minY);\n overlayExtents.maxY = Math.max(overlayExtents.maxY, this._jsPlumb.overlayPlacements[i].maxY);\n }\n }\n }\n\n var lineWidth = parseFloat(this._jsPlumb.paintStyleInUse.strokeWidth || 1) / 2,\n outlineWidth = parseFloat(this._jsPlumb.paintStyleInUse.strokeWidth || 0),\n extents = {\n xmin: Math.min(this.connector.bounds.minX - (lineWidth + outlineWidth), overlayExtents.minX),\n ymin: Math.min(this.connector.bounds.minY - (lineWidth + outlineWidth), overlayExtents.minY),\n xmax: Math.max(this.connector.bounds.maxX + (lineWidth + outlineWidth), overlayExtents.maxX),\n ymax: Math.max(this.connector.bounds.maxY + (lineWidth + outlineWidth), overlayExtents.maxY)\n };\n // paint the connector.\n this.connector.paint(this._jsPlumb.paintStyleInUse, null, extents);\n // and then the overlays\n for (var j in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays.hasOwnProperty(j)) {\n var p = this._jsPlumb.overlays[j];\n if (p.isVisible()) {\n p.paint(this._jsPlumb.overlayPlacements[j], extents);\n }\n }\n }\n }\n this._jsPlumb.lastPaintedAt = timestamp;\n }\n },\n repaint: function (params) {\n var p = jsPlumb.extend(params || {}, {});\n p.elId = this.sourceId;\n this.paint(p);\n },\n prepareEndpoint: function (_jsPlumb, _newEndpoint, conn, existing, index, params, element, elementId) {\n var e;\n if (existing) {\n conn.endpoints[index] = existing;\n existing.addConnection(conn);\n } else {\n if (!params.endpoints) {\n params.endpoints = [ null, null ];\n }\n var ep = params.endpoints[index] || params.endpoint || _jsPlumb.Defaults.Endpoints[index] || _jp.Defaults.Endpoints[index] || _jsPlumb.Defaults.Endpoint || _jp.Defaults.Endpoint;\n if (!params.endpointStyles) {\n params.endpointStyles = [ null, null ];\n }\n if (!params.endpointHoverStyles) {\n params.endpointHoverStyles = [ null, null ];\n }\n var es = params.endpointStyles[index] || params.endpointStyle || _jsPlumb.Defaults.EndpointStyles[index] || _jp.Defaults.EndpointStyles[index] || _jsPlumb.Defaults.EndpointStyle || _jp.Defaults.EndpointStyle;\n // Endpoints derive their fill from the connector's stroke, if no fill was specified.\n if (es.fill == null && params.paintStyle != null) {\n es.fill = params.paintStyle.stroke;\n }\n\n if (es.outlineStroke == null && params.paintStyle != null) {\n es.outlineStroke = params.paintStyle.outlineStroke;\n }\n if (es.outlineWidth == null && params.paintStyle != null) {\n es.outlineWidth = params.paintStyle.outlineWidth;\n }\n\n var ehs = params.endpointHoverStyles[index] || params.endpointHoverStyle || _jsPlumb.Defaults.EndpointHoverStyles[index] || _jp.Defaults.EndpointHoverStyles[index] || _jsPlumb.Defaults.EndpointHoverStyle || _jp.Defaults.EndpointHoverStyle;\n // endpoint hover fill style is derived from connector's hover stroke style\n if (params.hoverPaintStyle != null) {\n if (ehs == null) {\n ehs = {};\n }\n if (ehs.fill == null) {\n ehs.fill = params.hoverPaintStyle.stroke;\n }\n }\n var a = params.anchors ? params.anchors[index] :\n params.anchor ? params.anchor :\n _makeAnchor(_jsPlumb.Defaults.Anchors[index], elementId, _jsPlumb) ||\n _makeAnchor(_jp.Defaults.Anchors[index], elementId, _jsPlumb) ||\n _makeAnchor(_jsPlumb.Defaults.Anchor, elementId, _jsPlumb) ||\n _makeAnchor(_jp.Defaults.Anchor, elementId, _jsPlumb),\n u = params.uuids ? params.uuids[index] : null;\n\n e = _newEndpoint({\n paintStyle: es, hoverPaintStyle: ehs, endpoint: ep, connections: [ conn ],\n uuid: u, anchor: a, source: element, scope: params.scope,\n reattach: params.reattach || _jsPlumb.Defaults.ReattachConnections,\n detachable: params.detachable || _jsPlumb.Defaults.ConnectionsDetachable\n });\n if (existing == null) {\n e.setDeleteOnEmpty(true);\n }\n conn.endpoints[index] = e;\n\n if (params.drawEndpoints === false) {\n e.setVisible(false, true, true);\n }\n\n }\n return e;\n }\n\n }); // END Connection class \n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the code for creating and manipulating anchors.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n\n var root = this,\n _ju = root.jsPlumbUtil,\n _jp = root.jsPlumb;\n\n //\n // manages anchors for all elements.\n //\n _jp.AnchorManager = function (params) {\n var _amEndpoints = {},\n continuousAnchorLocations = {},\n continuousAnchorOrientations = {},\n connectionsByElementId = {},\n self = this,\n anchorLists = {},\n jsPlumbInstance = params.jsPlumbInstance,\n floatingConnections = {},\n // used by placeAnchors function\n placeAnchorsOnLine = function (desc, elementDimensions, elementPosition, connections, horizontal, otherMultiplier, reverse) {\n var a = [], step = elementDimensions[horizontal ? 0 : 1] / (connections.length + 1);\n\n for (var i = 0; i < connections.length; i++) {\n var val = (i + 1) * step, other = otherMultiplier * elementDimensions[horizontal ? 1 : 0];\n if (reverse) {\n val = elementDimensions[horizontal ? 0 : 1] - val;\n }\n\n var dx = (horizontal ? val : other), x = elementPosition[0] + dx, xp = dx / elementDimensions[0],\n dy = (horizontal ? other : val), y = elementPosition[1] + dy, yp = dy / elementDimensions[1];\n\n a.push([ x, y, xp, yp, connections[i][1], connections[i][2] ]);\n }\n\n return a;\n },\n // used by edgeSortFunctions\n currySort = function (reverseAngles) {\n return function (a, b) {\n var r = true;\n if (reverseAngles) {\n r = a[0][0] < b[0][0];\n }\n else {\n r = a[0][0] > b[0][0];\n }\n return r === false ? -1 : 1;\n };\n },\n // used by edgeSortFunctions\n leftSort = function (a, b) {\n // first get adjusted values\n var p1 = a[0][0] < 0 ? -Math.PI - a[0][0] : Math.PI - a[0][0],\n p2 = b[0][0] < 0 ? -Math.PI - b[0][0] : Math.PI - b[0][0];\n if (p1 > p2) {\n return 1;\n }\n else {\n return -1;\n }\n },\n // used by placeAnchors\n edgeSortFunctions = {\n \"top\": function (a, b) {\n return a[0] > b[0] ? 1 : -1;\n },\n \"right\": currySort(true),\n \"bottom\": currySort(true),\n \"left\": leftSort\n },\n // used by placeAnchors\n _sortHelper = function (_array, _fn) {\n return _array.sort(_fn);\n },\n // used by AnchorManager.redraw\n placeAnchors = function (elementId, _anchorLists) {\n var cd = jsPlumbInstance.getCachedData(elementId), sS = cd.s, sO = cd.o,\n placeSomeAnchors = function (desc, elementDimensions, elementPosition, unsortedConnections, isHorizontal, otherMultiplier, orientation) {\n if (unsortedConnections.length > 0) {\n var sc = _sortHelper(unsortedConnections, edgeSortFunctions[desc]), // puts them in order based on the target element's pos on screen\n reverse = desc === \"right\" || desc === \"top\",\n anchors = placeAnchorsOnLine(desc, elementDimensions,\n elementPosition, sc,\n isHorizontal, otherMultiplier, reverse);\n\n // takes a computed anchor position and adjusts it for parent offset and scroll, then stores it.\n var _setAnchorLocation = function (endpoint, anchorPos) {\n continuousAnchorLocations[endpoint.id] = [ anchorPos[0], anchorPos[1], anchorPos[2], anchorPos[3] ];\n continuousAnchorOrientations[endpoint.id] = orientation;\n };\n\n for (var i = 0; i < anchors.length; i++) {\n var c = anchors[i][4], weAreSource = c.endpoints[0].elementId === elementId, weAreTarget = c.endpoints[1].elementId === elementId;\n if (weAreSource) {\n _setAnchorLocation(c.endpoints[0], anchors[i]);\n }\n if (weAreTarget) {\n _setAnchorLocation(c.endpoints[1], anchors[i]);\n }\n }\n }\n };\n\n placeSomeAnchors(\"bottom\", sS, [sO.left, sO.top], _anchorLists.bottom, true, 1, [0, 1]);\n placeSomeAnchors(\"top\", sS, [sO.left, sO.top], _anchorLists.top, true, 0, [0, -1]);\n placeSomeAnchors(\"left\", sS, [sO.left, sO.top], _anchorLists.left, false, 0, [-1, 0]);\n placeSomeAnchors(\"right\", sS, [sO.left, sO.top], _anchorLists.right, false, 1, [1, 0]);\n };\n\n this.reset = function () {\n _amEndpoints = {};\n connectionsByElementId = {};\n anchorLists = {};\n };\n this.addFloatingConnection = function (key, conn) {\n floatingConnections[key] = conn;\n };\n this.removeFloatingConnection = function (key) {\n delete floatingConnections[key];\n };\n this.newConnection = function (conn) {\n var sourceId = conn.sourceId, targetId = conn.targetId,\n ep = conn.endpoints,\n doRegisterTarget = true,\n registerConnection = function (otherIndex, otherEndpoint, otherAnchor, elId, c) {\n if ((sourceId === targetId) && otherAnchor.isContinuous) {\n // remove the target endpoint's canvas. we dont need it.\n conn._jsPlumb.instance.removeElement(ep[1].canvas);\n doRegisterTarget = false;\n }\n _ju.addToList(connectionsByElementId, elId, [c, otherEndpoint, otherAnchor.constructor === _jp.DynamicAnchor]);\n };\n\n registerConnection(0, ep[0], ep[0].anchor, targetId, conn);\n if (doRegisterTarget) {\n registerConnection(1, ep[1], ep[1].anchor, sourceId, conn);\n }\n };\n var removeEndpointFromAnchorLists = function (endpoint) {\n (function (list, eId) {\n if (list) { // transient anchors dont get entries in this list.\n var f = function (e) {\n return e[4] === eId;\n };\n _ju.removeWithFunction(list.top, f);\n _ju.removeWithFunction(list.left, f);\n _ju.removeWithFunction(list.bottom, f);\n _ju.removeWithFunction(list.right, f);\n }\n })(anchorLists[endpoint.elementId], endpoint.id);\n };\n this.connectionDetached = function (connInfo, doNotRedraw) {\n var connection = connInfo.connection || connInfo,\n sourceId = connInfo.sourceId,\n targetId = connInfo.targetId,\n ep = connection.endpoints,\n removeConnection = function (otherIndex, otherEndpoint, otherAnchor, elId, c) {\n _ju.removeWithFunction(connectionsByElementId[elId], function (_c) {\n return _c[0].id === c.id;\n });\n };\n\n removeConnection(1, ep[1], ep[1].anchor, sourceId, connection);\n removeConnection(0, ep[0], ep[0].anchor, targetId, connection);\n if (connection.floatingId) {\n removeConnection(connection.floatingIndex, connection.floatingEndpoint, connection.floatingEndpoint.anchor, connection.floatingId, connection);\n removeEndpointFromAnchorLists(connection.floatingEndpoint);\n }\n\n // remove from anchorLists\n removeEndpointFromAnchorLists(connection.endpoints[0]);\n removeEndpointFromAnchorLists(connection.endpoints[1]);\n\n if (!doNotRedraw) {\n self.redraw(connection.sourceId);\n if (connection.targetId !== connection.sourceId) {\n self.redraw(connection.targetId);\n }\n }\n };\n this.add = function (endpoint, elementId) {\n _ju.addToList(_amEndpoints, elementId, endpoint);\n };\n this.changeId = function (oldId, newId) {\n connectionsByElementId[newId] = connectionsByElementId[oldId];\n _amEndpoints[newId] = _amEndpoints[oldId];\n delete connectionsByElementId[oldId];\n delete _amEndpoints[oldId];\n };\n this.getConnectionsFor = function (elementId) {\n return connectionsByElementId[elementId] || [];\n };\n this.getEndpointsFor = function (elementId) {\n return _amEndpoints[elementId] || [];\n };\n this.deleteEndpoint = function (endpoint) {\n _ju.removeWithFunction(_amEndpoints[endpoint.elementId], function (e) {\n return e.id === endpoint.id;\n });\n removeEndpointFromAnchorLists(endpoint);\n };\n this.clearFor = function (elementId) {\n delete _amEndpoints[elementId];\n _amEndpoints[elementId] = [];\n };\n // updates the given anchor list by either updating an existing anchor's info, or adding it. this function\n // also removes the anchor from its previous list, if the edge it is on has changed.\n // all connections found along the way (those that are connected to one of the faces this function\n // operates on) are added to the connsToPaint list, as are their endpoints. in this way we know to repaint\n // them wthout having to calculate anything else about them.\n var _updateAnchorList = function (lists, theta, order, conn, aBoolean, otherElId, idx, reverse, edgeId, elId, connsToPaint, endpointsToPaint) {\n // first try to find the exact match, but keep track of the first index of a matching element id along the way.s\n var exactIdx = -1,\n firstMatchingElIdx = -1,\n endpoint = conn.endpoints[idx],\n endpointId = endpoint.id,\n oIdx = [1, 0][idx],\n values = [\n [ theta, order ],\n conn,\n aBoolean,\n otherElId,\n endpointId\n ],\n listToAddTo = lists[edgeId],\n listToRemoveFrom = endpoint._continuousAnchorEdge ? lists[endpoint._continuousAnchorEdge] : null,\n i,\n candidate;\n\n if (listToRemoveFrom) {\n var rIdx = _ju.findWithFunction(listToRemoveFrom, function (e) {\n return e[4] === endpointId;\n });\n if (rIdx !== -1) {\n listToRemoveFrom.splice(rIdx, 1);\n // get all connections from this list\n for (i = 0; i < listToRemoveFrom.length; i++) {\n candidate = listToRemoveFrom[i][1];\n _ju.addWithFunction(connsToPaint, candidate, function (c) {\n return c.id === candidate.id;\n });\n _ju.addWithFunction(endpointsToPaint, listToRemoveFrom[i][1].endpoints[idx], function (e) {\n return e.id === candidate.endpoints[idx].id;\n });\n _ju.addWithFunction(endpointsToPaint, listToRemoveFrom[i][1].endpoints[oIdx], function (e) {\n return e.id === candidate.endpoints[oIdx].id;\n });\n }\n }\n }\n\n for (i = 0; i < listToAddTo.length; i++) {\n candidate = listToAddTo[i][1];\n if (params.idx === 1 && listToAddTo[i][3] === otherElId && firstMatchingElIdx === -1) {\n firstMatchingElIdx = i;\n }\n _ju.addWithFunction(connsToPaint, candidate, function (c) {\n return c.id === candidate.id;\n });\n _ju.addWithFunction(endpointsToPaint, listToAddTo[i][1].endpoints[idx], function (e) {\n return e.id === candidate.endpoints[idx].id;\n });\n _ju.addWithFunction(endpointsToPaint, listToAddTo[i][1].endpoints[oIdx], function (e) {\n return e.id === candidate.endpoints[oIdx].id;\n });\n }\n if (exactIdx !== -1) {\n listToAddTo[exactIdx] = values;\n }\n else {\n var insertIdx = reverse ? firstMatchingElIdx !== -1 ? firstMatchingElIdx : 0 : listToAddTo.length; // of course we will get this from having looked through the array shortly.\n listToAddTo.splice(insertIdx, 0, values);\n }\n\n // store this for next time.\n endpoint._continuousAnchorEdge = edgeId;\n };\n\n //\n // find the entry in an endpoint's list for this connection and update its target endpoint\n // with the current target in the connection.\n // This method and sourceChanged need to be folder into one.\n //\n this.updateOtherEndpoint = function (sourceElId, oldTargetId, newTargetId, connection) {\n var sIndex = _ju.findWithFunction(connectionsByElementId[sourceElId], function (i) {\n return i[0].id === connection.id;\n }),\n tIndex = _ju.findWithFunction(connectionsByElementId[oldTargetId], function (i) {\n return i[0].id === connection.id;\n });\n\n // update or add data for source\n if (sIndex !== -1) {\n connectionsByElementId[sourceElId][sIndex][0] = connection;\n connectionsByElementId[sourceElId][sIndex][1] = connection.endpoints[1];\n connectionsByElementId[sourceElId][sIndex][2] = connection.endpoints[1].anchor.constructor === _jp.DynamicAnchor;\n }\n\n // remove entry for previous target (if there)\n if (tIndex > -1) {\n connectionsByElementId[oldTargetId].splice(tIndex, 1);\n // add entry for new target\n _ju.addToList(connectionsByElementId, newTargetId, [connection, connection.endpoints[0], connection.endpoints[0].anchor.constructor === _jp.DynamicAnchor]);\n }\n\n connection.updateConnectedClass();\n };\n\n //\n // notification that the connection given has changed source from the originalId to the newId.\n // This involves:\n // 1. removing the connection from the list of connections stored for the originalId\n // 2. updating the source information for the target of the connection\n // 3. re-registering the connection in connectionsByElementId with the newId\n //\n this.sourceChanged = function (originalId, newId, connection, newElement) {\n if (originalId !== newId) {\n\n connection.sourceId = newId;\n connection.source = newElement;\n\n // remove the entry that points from the old source to the target\n _ju.removeWithFunction(connectionsByElementId[originalId], function (info) {\n return info[0].id === connection.id;\n });\n // find entry for target and update it\n var tIdx = _ju.findWithFunction(connectionsByElementId[connection.targetId], function (i) {\n return i[0].id === connection.id;\n });\n if (tIdx > -1) {\n connectionsByElementId[connection.targetId][tIdx][0] = connection;\n connectionsByElementId[connection.targetId][tIdx][1] = connection.endpoints[0];\n connectionsByElementId[connection.targetId][tIdx][2] = connection.endpoints[0].anchor.constructor === _jp.DynamicAnchor;\n }\n // add entry for new source\n _ju.addToList(connectionsByElementId, newId, [connection, connection.endpoints[1], connection.endpoints[1].anchor.constructor === _jp.DynamicAnchor]);\n\n // TODO SP not final on this yet. when a user drags an existing connection and it turns into a self\n // loop, then this code hides the target endpoint (by removing it from the DOM) But I think this should\n // occur only if the anchor is Continuous\n if (connection.endpoints[1].anchor.isContinuous) {\n if (connection.source === connection.target) {\n connection._jsPlumb.instance.removeElement(connection.endpoints[1].canvas);\n }\n else {\n if (connection.endpoints[1].canvas.parentNode == null) {\n connection._jsPlumb.instance.appendElement(connection.endpoints[1].canvas);\n }\n }\n }\n\n connection.updateConnectedClass();\n }\n };\n\n //\n // moves the given endpoint from `currentId` to `element`.\n // This involves:\n //\n // 1. changing the key in _amEndpoints under which the endpoint is stored\n // 2. changing the source or target values in all of the endpoint's connections\n // 3. changing the array in connectionsByElementId in which the endpoint's connections\n // are stored (done by either sourceChanged or updateOtherEndpoint)\n //\n this.rehomeEndpoint = function (ep, currentId, element) {\n var eps = _amEndpoints[currentId] || [],\n elementId = jsPlumbInstance.getId(element);\n\n if (elementId !== currentId) {\n var idx = eps.indexOf(ep);\n if (idx > -1) {\n var _ep = eps.splice(idx, 1)[0];\n self.add(_ep, elementId);\n }\n }\n\n for (var i = 0; i < ep.connections.length; i++) {\n if (ep.connections[i].sourceId === currentId) {\n self.sourceChanged(currentId, ep.elementId, ep.connections[i], ep.element);\n }\n else if (ep.connections[i].targetId === currentId) {\n ep.connections[i].targetId = ep.elementId;\n ep.connections[i].target = ep.element;\n self.updateOtherEndpoint(ep.connections[i].sourceId, currentId, ep.elementId, ep.connections[i]);\n }\n }\n };\n\n this.redraw = function (elementId, ui, timestamp, offsetToUI, clearEdits, doNotRecalcEndpoint) {\n\n if (!jsPlumbInstance.isSuspendDrawing()) {\n // get all the endpoints for this element\n var ep = _amEndpoints[elementId] || [],\n endpointConnections = connectionsByElementId[elementId] || [],\n connectionsToPaint = [],\n endpointsToPaint = [],\n anchorsToUpdate = [];\n\n timestamp = timestamp || jsPlumbInstance.timestamp();\n // offsetToUI are values that would have been calculated in the dragManager when registering\n // an endpoint for an element that had a parent (somewhere in the hierarchy) that had been\n // registered as draggable.\n offsetToUI = offsetToUI || {left: 0, top: 0};\n if (ui) {\n ui = {\n left: ui.left + offsetToUI.left,\n top: ui.top + offsetToUI.top\n };\n }\n\n // valid for one paint cycle.\n var myOffset = jsPlumbInstance.updateOffset({ elId: elementId, offset: ui, recalc: false, timestamp: timestamp }),\n orientationCache = {};\n\n // actually, first we should compute the orientation of this element to all other elements to which\n // this element is connected with a continuous anchor (whether both ends of the connection have\n // a continuous anchor or just one)\n\n for (var i = 0; i < endpointConnections.length; i++) {\n var conn = endpointConnections[i][0],\n sourceId = conn.sourceId,\n targetId = conn.targetId,\n sourceContinuous = conn.endpoints[0].anchor.isContinuous,\n targetContinuous = conn.endpoints[1].anchor.isContinuous;\n\n if (sourceContinuous || targetContinuous) {\n var oKey = sourceId + \"_\" + targetId,\n o = orientationCache[oKey],\n oIdx = conn.sourceId === elementId ? 1 : 0;\n\n if (sourceContinuous && !anchorLists[sourceId]) {\n anchorLists[sourceId] = { top: [], right: [], bottom: [], left: [] };\n }\n if (targetContinuous && !anchorLists[targetId]) {\n anchorLists[targetId] = { top: [], right: [], bottom: [], left: [] };\n }\n\n if (elementId !== targetId) {\n jsPlumbInstance.updateOffset({ elId: targetId, timestamp: timestamp });\n }\n if (elementId !== sourceId) {\n jsPlumbInstance.updateOffset({ elId: sourceId, timestamp: timestamp });\n }\n\n var td = jsPlumbInstance.getCachedData(targetId),\n sd = jsPlumbInstance.getCachedData(sourceId);\n\n if (targetId === sourceId && (sourceContinuous || targetContinuous)) {\n // here we may want to improve this by somehow determining the face we'd like\n // to put the connector on. ideally, when drawing, the face should be calculated\n // by determining which face is closest to the point at which the mouse button\n // was released. for now, we're putting it on the top face.\n _updateAnchorList( anchorLists[sourceId], -Math.PI / 2, 0, conn, false, targetId, 0, false, \"top\", sourceId, connectionsToPaint, endpointsToPaint);\n _updateAnchorList( anchorLists[targetId], -Math.PI / 2, 0, conn, false, sourceId, 1, false, \"top\", targetId, connectionsToPaint, endpointsToPaint);\n }\n else {\n if (!o) {\n o = this.calculateOrientation(sourceId, targetId, sd.o, td.o, conn.endpoints[0].anchor, conn.endpoints[1].anchor, conn);\n orientationCache[oKey] = o;\n // this would be a performance enhancement, but the computed angles need to be clamped to\n //the (-PI/2 -> PI/2) range in order for the sorting to work properly.\n /* orientationCache[oKey2] = {\n orientation:o.orientation,\n a:[o.a[1], o.a[0]],\n theta:o.theta + Math.PI,\n theta2:o.theta2 + Math.PI\n };*/\n }\n if (sourceContinuous) {\n _updateAnchorList(anchorLists[sourceId], o.theta, 0, conn, false, targetId, 0, false, o.a[0], sourceId, connectionsToPaint, endpointsToPaint);\n }\n if (targetContinuous) {\n _updateAnchorList(anchorLists[targetId], o.theta2, -1, conn, true, sourceId, 1, true, o.a[1], targetId, connectionsToPaint, endpointsToPaint);\n }\n }\n\n if (sourceContinuous) {\n _ju.addWithFunction(anchorsToUpdate, sourceId, function (a) {\n return a === sourceId;\n });\n }\n if (targetContinuous) {\n _ju.addWithFunction(anchorsToUpdate, targetId, function (a) {\n return a === targetId;\n });\n }\n _ju.addWithFunction(connectionsToPaint, conn, function (c) {\n return c.id === conn.id;\n });\n if ((sourceContinuous && oIdx === 0) || (targetContinuous && oIdx === 1)) {\n _ju.addWithFunction(endpointsToPaint, conn.endpoints[oIdx], function (e) {\n return e.id === conn.endpoints[oIdx].id;\n });\n }\n }\n }\n\n // place Endpoints whose anchors are continuous but have no Connections\n for (i = 0; i < ep.length; i++) {\n if (ep[i].connections.length === 0 && ep[i].anchor.isContinuous) {\n if (!anchorLists[elementId]) {\n anchorLists[elementId] = { top: [], right: [], bottom: [], left: [] };\n }\n _updateAnchorList(anchorLists[elementId], -Math.PI / 2, 0, {endpoints: [ep[i], ep[i]], paint: function () {\n }}, false, elementId, 0, false, ep[i].anchor.getDefaultFace(), elementId, connectionsToPaint, endpointsToPaint);\n _ju.addWithFunction(anchorsToUpdate, elementId, function (a) {\n return a === elementId;\n });\n }\n }\n\n // now place all the continuous anchors we need to;\n for (i = 0; i < anchorsToUpdate.length; i++) {\n placeAnchors(anchorsToUpdate[i], anchorLists[anchorsToUpdate[i]]);\n }\n\n // now that continuous anchors have been placed, paint all the endpoints for this element\n for (i = 0; i < ep.length; i++) {\n ep[i].paint({ timestamp: timestamp, offset: myOffset, dimensions: myOffset.s, recalc: doNotRecalcEndpoint !== true });\n }\n\n // ... and any other endpoints we came across as a result of the continuous anchors.\n for (i = 0; i < endpointsToPaint.length; i++) {\n var cd = jsPlumbInstance.getCachedData(endpointsToPaint[i].elementId);\n //endpointsToPaint[i].paint({ timestamp: timestamp, offset: cd, dimensions: cd.s });\n endpointsToPaint[i].paint({ timestamp: null, offset: cd, dimensions: cd.s });\n }\n\n // paint all the standard and \"dynamic connections\", which are connections whose other anchor is\n // static and therefore does need to be recomputed; we make sure that happens only one time.\n\n // TODO we could have compiled a list of these in the first pass through connections; might save some time.\n for (i = 0; i < endpointConnections.length; i++) {\n var otherEndpoint = endpointConnections[i][1];\n if (otherEndpoint.anchor.constructor === _jp.DynamicAnchor) {\n otherEndpoint.paint({ elementWithPrecedence: elementId, timestamp: timestamp });\n _ju.addWithFunction(connectionsToPaint, endpointConnections[i][0], function (c) {\n return c.id === endpointConnections[i][0].id;\n });\n // all the connections for the other endpoint now need to be repainted\n for (var k = 0; k < otherEndpoint.connections.length; k++) {\n if (otherEndpoint.connections[k] !== endpointConnections[i][0]) {\n _ju.addWithFunction(connectionsToPaint, otherEndpoint.connections[k], function (c) {\n return c.id === otherEndpoint.connections[k].id;\n });\n }\n }\n } else {\n _ju.addWithFunction(connectionsToPaint, endpointConnections[i][0], function (c) {\n return c.id === endpointConnections[i][0].id;\n });\n }\n }\n\n // paint current floating connection for this element, if there is one.\n var fc = floatingConnections[elementId];\n if (fc) {\n fc.paint({timestamp: timestamp, recalc: false, elId: elementId});\n }\n\n // paint all the connections\n for (i = 0; i < connectionsToPaint.length; i++) {\n connectionsToPaint[i].paint({elId: elementId, timestamp: null, recalc: false, clearEdits: clearEdits});\n }\n }\n };\n\n var ContinuousAnchor = function (anchorParams) {\n _ju.EventGenerator.apply(this);\n this.type = \"Continuous\";\n this.isDynamic = true;\n this.isContinuous = true;\n var faces = anchorParams.faces || [\"top\", \"right\", \"bottom\", \"left\"],\n clockwise = !(anchorParams.clockwise === false),\n availableFaces = { },\n opposites = { \"top\": \"bottom\", \"right\": \"left\", \"left\": \"right\", \"bottom\": \"top\" },\n clockwiseOptions = { \"top\": \"right\", \"right\": \"bottom\", \"left\": \"top\", \"bottom\": \"left\" },\n antiClockwiseOptions = { \"top\": \"left\", \"right\": \"top\", \"left\": \"bottom\", \"bottom\": \"right\" },\n secondBest = clockwise ? clockwiseOptions : antiClockwiseOptions,\n lastChoice = clockwise ? antiClockwiseOptions : clockwiseOptions,\n cssClass = anchorParams.cssClass || \"\",\n _currentFace = null, _lockedFace = null, X_AXIS_FACES = [\"left\", \"right\"], Y_AXIS_FACES = [\"top\", \"bottom\"],\n _lockedAxis = null;\n\n for (var i = 0; i < faces.length; i++) {\n availableFaces[faces[i]] = true;\n }\n\n this.getDefaultFace = function () {\n return faces.length === 0 ? \"top\" : faces[0];\n };\n\n this.isRelocatable = function() { return true; };\n this.isSnapOnRelocate = function() { return true; };\n\n // if the given edge is supported, returns it. otherwise looks for a substitute that _is_\n // supported. if none supported we also return the request edge.\n this.verifyEdge = function (edge) {\n if (availableFaces[edge]) {\n return edge;\n }\n else if (availableFaces[opposites[edge]]) {\n return opposites[edge];\n }\n else if (availableFaces[secondBest[edge]]) {\n return secondBest[edge];\n }\n else if (availableFaces[lastChoice[edge]]) {\n return lastChoice[edge];\n }\n return edge; // we have to give them something.\n };\n\n this.isEdgeSupported = function (edge) {\n return _lockedAxis == null ?\n\n (_lockedFace == null ? availableFaces[edge] === true : _lockedFace === edge)\n\n : _lockedAxis.indexOf(edge) !== -1;\n };\n\n this.setCurrentFace = function(face, overrideLock) {\n _currentFace = face;\n // if currently locked, and the user wants to override, do that.\n if (overrideLock && _lockedFace != null) {\n _lockedFace = _currentFace;\n }\n };\n\n this.getCurrentFace = function() { return _currentFace; };\n this.getSupportedFaces = function() {\n var af = [];\n for (var k in availableFaces) {\n if (availableFaces[k]) {\n af.push(k);\n }\n }\n return af;\n };\n\n this.lock = function() {\n _lockedFace = _currentFace;\n };\n this.unlock = function() {\n _lockedFace = null;\n };\n this.isLocked = function() {\n return _lockedFace != null;\n };\n\n this.lockCurrentAxis = function() {\n if (_currentFace != null) {\n _lockedAxis = (_currentFace === \"left\" || _currentFace === \"right\") ? X_AXIS_FACES : Y_AXIS_FACES;\n }\n };\n\n this.unlockCurrentAxis = function() {\n _lockedAxis = null;\n };\n\n this.compute = function (params) {\n return continuousAnchorLocations[params.element.id] || [0, 0];\n };\n this.getCurrentLocation = function (params) {\n return continuousAnchorLocations[params.element.id] || [0, 0];\n };\n this.getOrientation = function (endpoint) {\n return continuousAnchorOrientations[endpoint.id] || [0, 0];\n };\n this.getCssClass = function () {\n return cssClass;\n };\n };\n\n // continuous anchors\n jsPlumbInstance.continuousAnchorFactory = {\n get: function (params) {\n return new ContinuousAnchor(params);\n },\n clear: function (elementId) {\n delete continuousAnchorLocations[elementId];\n }\n };\n };\n\n _jp.AnchorManager.prototype.calculateOrientation = function (sourceId, targetId, sd, td, sourceAnchor, targetAnchor) {\n\n var Orientation = { HORIZONTAL: \"horizontal\", VERTICAL: \"vertical\", DIAGONAL: \"diagonal\", IDENTITY: \"identity\" },\n axes = [\"left\", \"top\", \"right\", \"bottom\"];\n\n if (sourceId === targetId) {\n return {\n orientation: Orientation.IDENTITY,\n a: [\"top\", \"top\"]\n };\n }\n\n var theta = Math.atan2((td.centery - sd.centery), (td.centerx - sd.centerx)),\n theta2 = Math.atan2((sd.centery - td.centery), (sd.centerx - td.centerx));\n\n// --------------------------------------------------------------------------------------\n\n // improved face calculation. get midpoints of each face for source and target, then put in an array with all combinations of\n // source/target faces. sort this array by distance between midpoints. the entry at index 0 is our preferred option. we can\n // go through the array one by one until we find an entry in which each requested face is supported.\n var candidates = [], midpoints = { };\n (function (types, dim) {\n for (var i = 0; i < types.length; i++) {\n midpoints[types[i]] = {\n \"left\": [ dim[i].left, dim[i].centery ],\n \"right\": [ dim[i].right, dim[i].centery ],\n \"top\": [ dim[i].centerx, dim[i].top ],\n \"bottom\": [ dim[i].centerx , dim[i].bottom]\n };\n }\n })([ \"source\", \"target\" ], [ sd, td ]);\n\n for (var sf = 0; sf < axes.length; sf++) {\n for (var tf = 0; tf < axes.length; tf++) {\n candidates.push({\n source: axes[sf],\n target: axes[tf],\n dist: Biltong.lineLength(midpoints.source[axes[sf]], midpoints.target[axes[tf]])\n });\n }\n }\n\n candidates.sort(function (a, b) {\n return a.dist < b.dist ? -1 : a.dist > b.dist ? 1 : 0;\n });\n\n // now go through this list and try to get an entry that satisfies both (there will be one, unless one of the anchors\n // declares no available faces)\n var sourceEdge = candidates[0].source, targetEdge = candidates[0].target;\n for (var i = 0; i < candidates.length; i++) {\n\n if (!sourceAnchor.isContinuous || sourceAnchor.isEdgeSupported(candidates[i].source)) {\n sourceEdge = candidates[i].source;\n }\n else {\n sourceEdge = null;\n }\n\n if (!targetAnchor.isContinuous || targetAnchor.isEdgeSupported(candidates[i].target)) {\n targetEdge = candidates[i].target;\n }\n else {\n targetEdge = null;\n }\n\n if (sourceEdge != null && targetEdge != null) {\n break;\n }\n }\n\n if (sourceAnchor.isContinuous) {\n sourceAnchor.setCurrentFace(sourceEdge);\n }\n\n if (targetAnchor.isContinuous) {\n targetAnchor.setCurrentFace(targetEdge);\n }\n\n// --------------------------------------------------------------------------------------\n\n return {\n a: [ sourceEdge, targetEdge ],\n theta: theta,\n theta2: theta2\n };\n };\n\n /**\n * Anchors model a position on some element at which an Endpoint may be located. They began as a first class citizen of jsPlumb, ie. a user\n * was required to create these themselves, but over time this has been replaced by the concept of referring to them either by name (eg. \"TopMiddle\"),\n * or by an array describing their coordinates (eg. [ 0, 0.5, 0, -1 ], which is the same as \"TopMiddle\"). jsPlumb now handles all of the\n * creation of Anchors without user intervention.\n */\n _jp.Anchor = function (params) {\n this.x = params.x || 0;\n this.y = params.y || 0;\n this.elementId = params.elementId;\n this.cssClass = params.cssClass || \"\";\n this.userDefinedLocation = null;\n this.orientation = params.orientation || [ 0, 0 ];\n this.lastReturnValue = null;\n this.offsets = params.offsets || [ 0, 0 ];\n this.timestamp = null;\n\n var relocatable = params.relocatable !== false;\n this.isRelocatable = function() { return relocatable; };\n this.setRelocatable = function(_relocatable) { relocatable = _relocatable; };\n var snapOnRelocate = params.snapOnRelocate !== false;\n this.isSnapOnRelocate = function() { return snapOnRelocate; };\n\n var locked = false;\n this.lock = function() { locked = true; };\n this.unlock = function() { locked = false; };\n this.isLocked = function() { return locked; };\n\n _ju.EventGenerator.apply(this);\n\n this.compute = function (params) {\n\n var xy = params.xy, wh = params.wh, timestamp = params.timestamp;\n\n if (params.clearUserDefinedLocation) {\n this.userDefinedLocation = null;\n }\n\n if (timestamp && timestamp === this.timestamp) {\n return this.lastReturnValue;\n }\n\n if (this.userDefinedLocation != null) {\n this.lastReturnValue = this.userDefinedLocation;\n }\n else {\n this.lastReturnValue = [ xy[0] + (this.x * wh[0]) + this.offsets[0], xy[1] + (this.y * wh[1]) + this.offsets[1], this.x, this.y ];\n }\n\n this.timestamp = timestamp;\n return this.lastReturnValue;\n };\n\n this.getCurrentLocation = function (params) {\n params = params || {};\n return (this.lastReturnValue == null || (params.timestamp != null && this.timestamp !== params.timestamp)) ? this.compute(params) : this.lastReturnValue;\n };\n\n this.setPosition = function(x, y, ox, oy, overrideLock) {\n if (!locked || overrideLock) {\n this.x = x;\n this.y = y;\n this.orientation = [ ox, oy ];\n this.lastReturnValue = null;\n }\n };\n };\n _ju.extend(_jp.Anchor, _ju.EventGenerator, {\n equals: function (anchor) {\n if (!anchor) {\n return false;\n }\n var ao = anchor.getOrientation(),\n o = this.getOrientation();\n return this.x === anchor.x && this.y === anchor.y && this.offsets[0] === anchor.offsets[0] && this.offsets[1] === anchor.offsets[1] && o[0] === ao[0] && o[1] === ao[1];\n },\n getUserDefinedLocation: function () {\n return this.userDefinedLocation;\n },\n setUserDefinedLocation: function (l) {\n this.userDefinedLocation = l;\n },\n clearUserDefinedLocation: function () {\n this.userDefinedLocation = null;\n },\n getOrientation: function () {\n return this.orientation;\n },\n getCssClass: function () {\n return this.cssClass;\n }\n });\n\n /**\n * An Anchor that floats. its orientation is computed dynamically from\n * its position relative to the anchor it is floating relative to. It is used when creating\n * a connection through drag and drop.\n *\n * TODO FloatingAnchor could totally be refactored to extend Anchor just slightly.\n */\n _jp.FloatingAnchor = function (params) {\n\n _jp.Anchor.apply(this, arguments);\n\n // this is the anchor that this floating anchor is referenced to for\n // purposes of calculating the orientation.\n var ref = params.reference,\n // the canvas this refers to.\n refCanvas = params.referenceCanvas,\n size = _jp.getSize(refCanvas),\n // these are used to store the current relative position of our\n // anchor wrt the reference anchor. they only indicate\n // direction, so have a value of 1 or -1 (or, very rarely, 0). these\n // values are written by the compute method, and read\n // by the getOrientation method.\n xDir = 0, yDir = 0,\n // temporary member used to store an orientation when the floating\n // anchor is hovering over another anchor.\n orientation = null,\n _lastResult = null;\n\n // clear from parent. we want floating anchor orientation to always be computed.\n this.orientation = null;\n\n // set these to 0 each; they are used by certain types of connectors in the loopback case,\n // when the connector is trying to clear the element it is on. but for floating anchor it's not\n // very important.\n this.x = 0;\n this.y = 0;\n\n this.isFloating = true;\n\n this.compute = function (params) {\n var xy = params.xy,\n result = [ xy[0] + (size[0] / 2), xy[1] + (size[1] / 2) ]; // return origin of the element. we may wish to improve this so that any object can be the drag proxy.\n _lastResult = result;\n return result;\n };\n\n this.getOrientation = function (_endpoint) {\n if (orientation) {\n return orientation;\n }\n else {\n var o = ref.getOrientation(_endpoint);\n // here we take into account the orientation of the other\n // anchor: if it declares zero for some direction, we declare zero too. this might not be the most awesome. perhaps we can come\n // up with a better way. it's just so that the line we draw looks like it makes sense. maybe this wont make sense.\n return [ Math.abs(o[0]) * xDir * -1,\n Math.abs(o[1]) * yDir * -1 ];\n }\n };\n\n /**\n * notification the endpoint associated with this anchor is hovering\n * over another anchor; we want to assume that anchor's orientation\n * for the duration of the hover.\n */\n this.over = function (anchor, endpoint) {\n orientation = anchor.getOrientation(endpoint);\n };\n\n /**\n * notification the endpoint associated with this anchor is no\n * longer hovering over another anchor; we should resume calculating\n * orientation as we normally do.\n */\n this.out = function () {\n orientation = null;\n };\n\n this.getCurrentLocation = function (params) {\n return _lastResult == null ? this.compute(params) : _lastResult;\n };\n };\n _ju.extend(_jp.FloatingAnchor, _jp.Anchor);\n\n var _convertAnchor = function (anchor, jsPlumbInstance, elementId) {\n return anchor.constructor === _jp.Anchor ? anchor : jsPlumbInstance.makeAnchor(anchor, elementId, jsPlumbInstance);\n };\n\n /* \n * A DynamicAnchor is an Anchor that contains a list of other Anchors, which it cycles\n * through at compute time to find the one that is located closest to\n * the center of the target element, and returns that Anchor's compute\n * method result. this causes endpoints to follow each other with\n * respect to the orientation of their target elements, which is a useful\n * feature for some applications.\n * \n */\n _jp.DynamicAnchor = function (params) {\n _jp.Anchor.apply(this, arguments);\n\n this.isDynamic = true;\n this.anchors = [];\n this.elementId = params.elementId;\n this.jsPlumbInstance = params.jsPlumbInstance;\n\n for (var i = 0; i < params.anchors.length; i++) {\n this.anchors[i] = _convertAnchor(params.anchors[i], this.jsPlumbInstance, this.elementId);\n }\n\n this.getAnchors = function () {\n return this.anchors;\n };\n\n var _curAnchor = this.anchors.length > 0 ? this.anchors[0] : null,\n _lastAnchor = _curAnchor,\n self = this,\n\n // helper method to calculate the distance between the centers of the two elements.\n _distance = function (anchor, cx, cy, xy, wh) {\n var ax = xy[0] + (anchor.x * wh[0]), ay = xy[1] + (anchor.y * wh[1]),\n acx = xy[0] + (wh[0] / 2), acy = xy[1] + (wh[1] / 2);\n return (Math.sqrt(Math.pow(cx - ax, 2) + Math.pow(cy - ay, 2)) +\n Math.sqrt(Math.pow(acx - ax, 2) + Math.pow(acy - ay, 2)));\n },\n // default method uses distance between element centers. you can provide your own method in the dynamic anchor\n // constructor (and also to jsPlumb.makeDynamicAnchor). the arguments to it are four arrays:\n // xy - xy loc of the anchor's element\n // wh - anchor's element's dimensions\n // txy - xy loc of the element of the other anchor in the connection\n // twh - dimensions of the element of the other anchor in the connection.\n // anchors - the list of selectable anchors\n _anchorSelector = params.selector || function (xy, wh, txy, twh, anchors) {\n var cx = txy[0] + (twh[0] / 2), cy = txy[1] + (twh[1] / 2);\n var minIdx = -1, minDist = Infinity;\n for (var i = 0; i < anchors.length; i++) {\n var d = _distance(anchors[i], cx, cy, xy, wh);\n if (d < minDist) {\n minIdx = i + 0;\n minDist = d;\n }\n }\n return anchors[minIdx];\n };\n\n this.compute = function (params) {\n var xy = params.xy, wh = params.wh, txy = params.txy, twh = params.twh;\n\n this.timestamp = params.timestamp;\n\n var udl = self.getUserDefinedLocation();\n if (udl != null) {\n return udl;\n }\n\n // if anchor is locked or an opposite element was not given, we\n // maintain our state. anchor will be locked\n // if it is the source of a drag and drop.\n if (this.isLocked() || txy == null || twh == null) {\n return _curAnchor.compute(params);\n }\n else {\n params.timestamp = null; // otherwise clear this, i think. we want the anchor to compute.\n }\n\n _curAnchor = _anchorSelector(xy, wh, txy, twh, this.anchors);\n this.x = _curAnchor.x;\n this.y = _curAnchor.y;\n\n if (_curAnchor !== _lastAnchor) {\n this.fire(\"anchorChanged\", _curAnchor);\n }\n\n _lastAnchor = _curAnchor;\n\n return _curAnchor.compute(params);\n };\n\n this.getCurrentLocation = function (params) {\n return this.getUserDefinedLocation() || (_curAnchor != null ? _curAnchor.getCurrentLocation(params) : null);\n };\n\n this.getOrientation = function (_endpoint) {\n return _curAnchor != null ? _curAnchor.getOrientation(_endpoint) : [ 0, 0 ];\n };\n this.over = function (anchor, endpoint) {\n if (_curAnchor != null) {\n _curAnchor.over(anchor, endpoint);\n }\n };\n this.out = function () {\n if (_curAnchor != null) {\n _curAnchor.out();\n }\n };\n\n this.setAnchor = function(a) {\n _curAnchor = a;\n };\n\n this.getCssClass = function () {\n return (_curAnchor && _curAnchor.getCssClass()) || \"\";\n };\n\n /**\n * Attempt to match an anchor with the given coordinates and then set it.\n * @param coords\n * @returns true if matching anchor found, false otherwise.\n */\n this.setAnchorCoordinates = function(coords) {\n var idx = jsPlumbUtil.findWithFunction(this.anchors, function(a) {\n return a.x === coords[0] && a.y === coords[1];\n });\n if (idx !== -1) {\n this.setAnchor(this.anchors[idx]);\n return true;\n } else {\n return false;\n }\n };\n };\n _ju.extend(_jp.DynamicAnchor, _jp.Anchor);\n\n// -------- basic anchors ------------------ \n var _curryAnchor = function (x, y, ox, oy, type, fnInit) {\n _jp.Anchors[type] = function (params) {\n var a = params.jsPlumbInstance.makeAnchor([ x, y, ox, oy, 0, 0 ], params.elementId, params.jsPlumbInstance);\n a.type = type;\n if (fnInit) {\n fnInit(a, params);\n }\n return a;\n };\n };\n\n _curryAnchor(0.5, 0, 0, -1, \"TopCenter\");\n _curryAnchor(0.5, 1, 0, 1, \"BottomCenter\");\n _curryAnchor(0, 0.5, -1, 0, \"LeftMiddle\");\n _curryAnchor(1, 0.5, 1, 0, \"RightMiddle\");\n\n _curryAnchor(0.5, 0, 0, -1, \"Top\");\n _curryAnchor(0.5, 1, 0, 1, \"Bottom\");\n _curryAnchor(0, 0.5, -1, 0, \"Left\");\n _curryAnchor(1, 0.5, 1, 0, \"Right\");\n _curryAnchor(0.5, 0.5, 0, 0, \"Center\");\n _curryAnchor(1, 0, 0, -1, \"TopRight\");\n _curryAnchor(1, 1, 0, 1, \"BottomRight\");\n _curryAnchor(0, 0, 0, -1, \"TopLeft\");\n _curryAnchor(0, 1, 0, 1, \"BottomLeft\");\n\n// ------- dynamic anchors ------------------- \n\n // default dynamic anchors chooses from Top, Right, Bottom, Left\n _jp.Defaults.DynamicAnchors = function (params) {\n return params.jsPlumbInstance.makeAnchors([\"TopCenter\", \"RightMiddle\", \"BottomCenter\", \"LeftMiddle\"], params.elementId, params.jsPlumbInstance);\n };\n\n // default dynamic anchors bound to name 'AutoDefault'\n _jp.Anchors.AutoDefault = function (params) {\n var a = params.jsPlumbInstance.makeDynamicAnchor(_jp.Defaults.DynamicAnchors(params));\n a.type = \"AutoDefault\";\n return a;\n };\n\n// ------- continuous anchors ------------------- \n\n var _curryContinuousAnchor = function (type, faces) {\n _jp.Anchors[type] = function (params) {\n var a = params.jsPlumbInstance.makeAnchor([\"Continuous\", { faces: faces }], params.elementId, params.jsPlumbInstance);\n a.type = type;\n return a;\n };\n };\n\n _jp.Anchors.Continuous = function (params) {\n return params.jsPlumbInstance.continuousAnchorFactory.get(params);\n };\n\n _curryContinuousAnchor(\"ContinuousLeft\", [\"left\"]);\n _curryContinuousAnchor(\"ContinuousTop\", [\"top\"]);\n _curryContinuousAnchor(\"ContinuousBottom\", [\"bottom\"]);\n _curryContinuousAnchor(\"ContinuousRight\", [\"right\"]);\n\n// ------- position assign anchors ------------------- \n\n // this anchor type lets you assign the position at connection time.\n _curryAnchor(0, 0, 0, 0, \"Assign\", function (anchor, params) {\n // find what to use as the \"position finder\". the user may have supplied a String which represents\n // the id of a position finder in jsPlumb.AnchorPositionFinders, or the user may have supplied the\n // position finder as a function. we find out what to use and then set it on the anchor.\n var pf = params.position || \"Fixed\";\n anchor.positionFinder = pf.constructor === String ? params.jsPlumbInstance.AnchorPositionFinders[pf] : pf;\n // always set the constructor params; the position finder might need them later (the Grid one does,\n // for example)\n anchor.constructorParams = params;\n });\n\n // these are the default anchor positions finders, which are used by the makeTarget function. supplying\n // a position finder argument to that function allows you to specify where the resulting anchor will\n // be located\n root.jsPlumbInstance.prototype.AnchorPositionFinders = {\n \"Fixed\": function (dp, ep, es) {\n return [ (dp.left - ep.left) / es[0], (dp.top - ep.top) / es[1] ];\n },\n \"Grid\": function (dp, ep, es, params) {\n var dx = dp.left - ep.left, dy = dp.top - ep.top,\n gx = es[0] / (params.grid[0]), gy = es[1] / (params.grid[1]),\n mx = Math.floor(dx / gx), my = Math.floor(dy / gy);\n return [ ((mx * gx) + (gx / 2)) / es[0], ((my * gy) + (gy / 2)) / es[1] ];\n }\n };\n\n// ------- perimeter anchors ------------------- \n\n _jp.Anchors.Perimeter = function (params) {\n params = params || {};\n var anchorCount = params.anchorCount || 60,\n shape = params.shape;\n\n if (!shape) {\n throw new Error(\"no shape supplied to Perimeter Anchor type\");\n }\n\n var _circle = function () {\n var r = 0.5, step = Math.PI * 2 / anchorCount, current = 0, a = [];\n for (var i = 0; i < anchorCount; i++) {\n var x = r + (r * Math.sin(current)),\n y = r + (r * Math.cos(current));\n a.push([ x, y, 0, 0 ]);\n current += step;\n }\n return a;\n },\n _path = function (segments) {\n var anchorsPerFace = anchorCount / segments.length, a = [],\n _computeFace = function (x1, y1, x2, y2, fractionalLength) {\n anchorsPerFace = anchorCount * fractionalLength;\n var dx = (x2 - x1) / anchorsPerFace, dy = (y2 - y1) / anchorsPerFace;\n for (var i = 0; i < anchorsPerFace; i++) {\n a.push([\n x1 + (dx * i),\n y1 + (dy * i),\n 0,\n 0\n ]);\n }\n };\n\n for (var i = 0; i < segments.length; i++) {\n _computeFace.apply(null, segments[i]);\n }\n\n return a;\n },\n _shape = function (faces) {\n var s = [];\n for (var i = 0; i < faces.length; i++) {\n s.push([faces[i][0], faces[i][1], faces[i][2], faces[i][3], 1 / faces.length]);\n }\n return _path(s);\n },\n _rectangle = function () {\n return _shape([\n [ 0, 0, 1, 0 ],\n [ 1, 0, 1, 1 ],\n [ 1, 1, 0, 1 ],\n [ 0, 1, 0, 0 ]\n ]);\n };\n\n var _shapes = {\n \"Circle\": _circle,\n \"Ellipse\": _circle,\n \"Diamond\": function () {\n return _shape([\n [ 0.5, 0, 1, 0.5 ],\n [ 1, 0.5, 0.5, 1 ],\n [ 0.5, 1, 0, 0.5 ],\n [ 0, 0.5, 0.5, 0 ]\n ]);\n },\n \"Rectangle\": _rectangle,\n \"Square\": _rectangle,\n \"Triangle\": function () {\n return _shape([\n [ 0.5, 0, 1, 1 ],\n [ 1, 1, 0, 1 ],\n [ 0, 1, 0.5, 0]\n ]);\n },\n \"Path\": function (params) {\n var points = params.points, p = [], tl = 0;\n for (var i = 0; i < points.length - 1; i++) {\n var l = Math.sqrt(Math.pow(points[i][2] - points[i][0]) + Math.pow(points[i][3] - points[i][1]));\n tl += l;\n p.push([points[i][0], points[i][1], points[i + 1][0], points[i + 1][1], l]);\n }\n for (var j = 0; j < p.length; j++) {\n p[j][4] = p[j][4] / tl;\n }\n return _path(p);\n }\n },\n _rotate = function (points, amountInDegrees) {\n var o = [], theta = amountInDegrees / 180 * Math.PI;\n for (var i = 0; i < points.length; i++) {\n var _x = points[i][0] - 0.5,\n _y = points[i][1] - 0.5;\n\n o.push([\n 0.5 + ((_x * Math.cos(theta)) - (_y * Math.sin(theta))),\n 0.5 + ((_x * Math.sin(theta)) + (_y * Math.cos(theta))),\n points[i][2],\n points[i][3]\n ]);\n }\n return o;\n };\n\n if (!_shapes[shape]) {\n throw new Error(\"Shape [\" + shape + \"] is unknown by Perimeter Anchor type\");\n }\n\n var da = _shapes[shape](params);\n if (params.rotation) {\n da = _rotate(da, params.rotation);\n }\n var a = params.jsPlumbInstance.makeDynamicAnchor(da);\n a.type = \"Perimeter\";\n return a;\n };\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the default Connectors, Endpoint and Overlay definitions.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n * \n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil, _jg = root.Biltong;\n\n _jp.Segments = {\n\n /*\n * Class: AbstractSegment\n * A Connector is made up of 1..N Segments, each of which has a Type, such as 'Straight', 'Arc',\n * 'Bezier'. This is new from 1.4.2, and gives us a lot more flexibility when drawing connections: things such\n * as rounded corners for flowchart connectors, for example, or a straight line stub for Bezier connections, are\n * much easier to do now.\n *\n * A Segment is responsible for providing coordinates for painting it, and also must be able to report its length.\n * \n */\n AbstractSegment: function (params) {\n this.params = params;\n\n /**\n * Function: findClosestPointOnPath\n * Finds the closest point on this segment to the given [x, y],\n * returning both the x and y of the point plus its distance from\n * the supplied point, and its location along the length of the\n * path inscribed by the segment. This implementation returns\n * Infinity for distance and null values for everything else;\n * subclasses are expected to override.\n */\n this.findClosestPointOnPath = function (x, y) {\n return {\n d: Infinity,\n x: null,\n y: null,\n l: null\n };\n };\n\n this.getBounds = function () {\n return {\n minX: Math.min(params.x1, params.x2),\n minY: Math.min(params.y1, params.y2),\n maxX: Math.max(params.x1, params.x2),\n maxY: Math.max(params.y1, params.y2)\n };\n };\n\n /**\n * Computes the list of points on the segment that intersect the given line.\n * @method lineIntersection\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @returns {Array<[number, number]>}\n */\n this.lineIntersection = function(x1, y1, x2, y2) {\n return [];\n };\n\n /**\n * Computes the list of points on the segment that intersect the box with the given origin and size.\n * @method boxIntersection\n * @param {number} x1\n * @param {number} y1\n * @param {number} w\n * @param {number} h\n * @returns {Array<[number, number]>}\n */\n this.boxIntersection = function(x, y, w, h) {\n var a = [];\n a.push.apply(a, this.lineIntersection(x, y, x + w, y));\n a.push.apply(a, this.lineIntersection(x + w, y, x + w, y + h));\n a.push.apply(a, this.lineIntersection(x + w, y + h, x, y + h));\n a.push.apply(a, this.lineIntersection(x, y + h, x, y));\n return a;\n };\n\n /**\n * Computes the list of points on the segment that intersect the given bounding box, which is an object of the form { x:.., y:.., w:.., h:.. }.\n * @method lineIntersection\n * @param {BoundingRectangle} box\n * @returns {Array<[number, number]>}\n */\n this.boundingBoxIntersection = function(box) {\n return this.boxIntersection(box.x, box.y, box.w, box.y);\n };\n },\n Straight: function (params) {\n var _super = _jp.Segments.AbstractSegment.apply(this, arguments),\n length, m, m2, x1, x2, y1, y2,\n _recalc = function () {\n length = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n m = _jg.gradient({x: x1, y: y1}, {x: x2, y: y2});\n m2 = -1 / m;\n };\n\n this.type = \"Straight\";\n\n this.getLength = function () {\n return length;\n };\n this.getGradient = function () {\n return m;\n };\n\n this.getCoordinates = function () {\n return { x1: x1, y1: y1, x2: x2, y2: y2 };\n };\n this.setCoordinates = function (coords) {\n x1 = coords.x1;\n y1 = coords.y1;\n x2 = coords.x2;\n y2 = coords.y2;\n _recalc();\n };\n this.setCoordinates({x1: params.x1, y1: params.y1, x2: params.x2, y2: params.y2});\n\n this.getBounds = function () {\n return {\n minX: Math.min(x1, x2),\n minY: Math.min(y1, y2),\n maxX: Math.max(x1, x2),\n maxY: Math.max(y1, y2)\n };\n };\n\n /**\n * returns the point on the segment's path that is 'location' along the length of the path, where 'location' is a decimal from\n * 0 to 1 inclusive. for the straight line segment this is simple maths.\n */\n this.pointOnPath = function (location, absolute) {\n if (location === 0 && !absolute) {\n return { x: x1, y: y1 };\n }\n else if (location === 1 && !absolute) {\n return { x: x2, y: y2 };\n }\n else {\n var l = absolute ? location > 0 ? location : length + location : location * length;\n return _jg.pointOnLine({x: x1, y: y1}, {x: x2, y: y2}, l);\n }\n };\n\n /**\n * returns the gradient of the segment at the given point - which for us is constant.\n */\n this.gradientAtPoint = function (_) {\n return m;\n };\n\n /**\n * returns the point on the segment's path that is 'distance' along the length of the path from 'location', where\n * 'location' is a decimal from 0 to 1 inclusive, and 'distance' is a number of pixels.\n * this hands off to jsPlumbUtil to do the maths, supplying two points and the distance.\n */\n this.pointAlongPathFrom = function (location, distance, absolute) {\n var p = this.pointOnPath(location, absolute),\n farAwayPoint = distance <= 0 ? {x: x1, y: y1} : {x: x2, y: y2 };\n\n /*\n location == 1 ? {\n x:x1 + ((x2 - x1) * 10),\n y:y1 + ((y1 - y2) * 10)\n } :\n */\n\n if (distance <= 0 && Math.abs(distance) > 1) {\n distance *= -1;\n }\n\n return _jg.pointOnLine(p, farAwayPoint, distance);\n };\n\n // is c between a and b?\n var within = function (a, b, c) {\n return c >= Math.min(a, b) && c <= Math.max(a, b);\n };\n // find which of a and b is closest to c\n var closest = function (a, b, c) {\n return Math.abs(c - a) < Math.abs(c - b) ? a : b;\n };\n\n /**\n Function: findClosestPointOnPath\n Finds the closest point on this segment to [x,y]. See\n notes on this method in AbstractSegment.\n */\n this.findClosestPointOnPath = function (x, y) {\n var out = {\n d: Infinity,\n x: null,\n y: null,\n l: null,\n x1: x1,\n x2: x2,\n y1: y1,\n y2: y2\n };\n\n if (m === 0) {\n out.y = y1;\n out.x = within(x1, x2, x) ? x : closest(x1, x2, x);\n }\n else if (m === Infinity || m === -Infinity) {\n out.x = x1;\n out.y = within(y1, y2, y) ? y : closest(y1, y2, y);\n }\n else {\n // closest point lies on normal from given point to this line. \n var b = y1 - (m * x1),\n b2 = y - (m2 * x),\n // y1 = m.x1 + b and y1 = m2.x1 + b2\n // so m.x1 + b = m2.x1 + b2\n // x1(m - m2) = b2 - b\n // x1 = (b2 - b) / (m - m2)\n _x1 = (b2 - b) / (m - m2),\n _y1 = (m * _x1) + b;\n\n out.x = within(x1, x2, _x1) ? _x1 : closest(x1, x2, _x1);//_x1;\n out.y = within(y1, y2, _y1) ? _y1 : closest(y1, y2, _y1);//_y1;\n }\n\n var fractionInSegment = _jg.lineLength([ out.x, out.y ], [ x1, y1 ]);\n out.d = _jg.lineLength([x, y], [out.x, out.y]);\n out.l = fractionInSegment / length;\n return out;\n };\n\n var _pointLiesBetween = function(q, p1, p2) {\n return (p2 > p1) ? (p1 <= q && q <= p2) : (p1 >= q && q >= p2);\n }, _plb = _pointLiesBetween;\n\n /**\n * Calculates all intersections of the given line with this segment.\n * @param _x1\n * @param _y1\n * @param _x2\n * @param _y2\n * @returns {Array}\n */\n this.lineIntersection = function(_x1, _y1, _x2, _y2) {\n var m2 = Math.abs(_jg.gradient({x: _x1, y: _y1}, {x: _x2, y: _y2})),\n m1 = Math.abs(m),\n b = m1 === Infinity ? x1 : y1 - (m1 * x1),\n out = [],\n b2 = m2 === Infinity ? _x1 : _y1 - (m2 * _x1);\n\n // if lines parallel, no intersection\n if (m2 !== m1) {\n // perpendicular, segment horizontal\n if(m2 === Infinity && m1 === 0) {\n if (_plb(_x1, x1, x2) && _plb(y1, _y1, _y2)) {\n out = [ _x1, y1 ]; // we return X on the incident line and Y from the segment\n }\n } else if(m2 === 0 && m1 === Infinity) {\n // perpendicular, segment vertical\n if(_plb(_y1, y1, y2) && _plb(x1, _x1, _x2)) {\n out = [x1, _y1]; // we return X on the segment and Y from the incident line\n }\n } else {\n var X, Y;\n if (m2 === Infinity) {\n // test line is a vertical line. where does it cross the segment?\n X = _x1;\n if (_plb(X, x1, x2)) {\n Y = (m1 * _x1) + b;\n if (_plb(Y, _y1, _y2)) {\n out = [ X, Y ];\n }\n }\n } else if (m2 === 0) {\n Y = _y1;\n // test line is a horizontal line. where does it cross the segment?\n if (_plb(Y, y1, y2)) {\n X = (_y1 - b) / m1;\n if (_plb(X, _x1, _x2)) {\n out = [ X, Y ];\n }\n }\n } else {\n // mX + b = m2X + b2\n // mX - m2X = b2 - b\n // X(m - m2) = b2 - b\n // X = (b2 - b) / (m - m2)\n // Y = mX + b\n X = (b2 - b) / (m1 - m2);\n Y = (m1 * X) + b;\n if(_plb(X, x1, x2) && _plb(Y, y1, y2)) {\n out = [ X, Y];\n }\n }\n }\n }\n\n return out;\n };\n\n /**\n * Calculates all intersections of the given box with this segment. By default this method simply calls `lineIntersection` with each of the four\n * faces of the box; subclasses can override this if they think there's a faster way to compute the entire box at once.\n * @param x X position of top left corner of box\n * @param y Y position of top left corner of box\n * @param w width of box\n * @param h height of box\n * @returns {Array}\n */\n this.boxIntersection = function(x, y, w, h) {\n var a = [];\n a.push.apply(a, this.lineIntersection(x, y, x + w, y));\n a.push.apply(a, this.lineIntersection(x + w, y, x + w, y + h));\n a.push.apply(a, this.lineIntersection(x + w, y + h, x, y + h));\n a.push.apply(a, this.lineIntersection(x, y + h, x, y));\n return a;\n };\n\n /**\n * Calculates all intersections of the given bounding box with this segment. By default this method simply calls `lineIntersection` with each of the four\n * faces of the box; subclasses can override this if they think there's a faster way to compute the entire box at once.\n * @param box Bounding box, in { x:.., y:..., w:..., h:... } format.\n * @returns {Array}\n */\n this.boundingBoxIntersection = function(box) {\n return this.boxIntersection(box.x, box.y, box.w, box.h);\n };\n },\n\n /*\n Arc Segment. You need to supply:\n\n r - radius\n cx - center x for the arc\n cy - center y for the arc\n ac - whether the arc is anticlockwise or not. default is clockwise.\n\n and then either:\n\n startAngle - startAngle for the arc.\n endAngle - endAngle for the arc.\n\n or:\n\n x1 - x for start point\n y1 - y for start point\n x2 - x for end point\n y2 - y for end point\n\n */\n Arc: function (params) {\n var _super = _jp.Segments.AbstractSegment.apply(this, arguments),\n _calcAngle = function (_x, _y) {\n return _jg.theta([params.cx, params.cy], [_x, _y]);\n },\n _calcAngleForLocation = function (segment, location) {\n if (segment.anticlockwise) {\n var sa = segment.startAngle < segment.endAngle ? segment.startAngle + TWO_PI : segment.startAngle,\n s = Math.abs(sa - segment.endAngle);\n return sa - (s * location);\n }\n else {\n var ea = segment.endAngle < segment.startAngle ? segment.endAngle + TWO_PI : segment.endAngle,\n ss = Math.abs(ea - segment.startAngle);\n\n return segment.startAngle + (ss * location);\n }\n },\n TWO_PI = 2 * Math.PI;\n\n this.radius = params.r;\n this.anticlockwise = params.ac;\n this.type = \"Arc\";\n\n if (params.startAngle && params.endAngle) {\n this.startAngle = params.startAngle;\n this.endAngle = params.endAngle;\n this.x1 = params.cx + (this.radius * Math.cos(params.startAngle));\n this.y1 = params.cy + (this.radius * Math.sin(params.startAngle));\n this.x2 = params.cx + (this.radius * Math.cos(params.endAngle));\n this.y2 = params.cy + (this.radius * Math.sin(params.endAngle));\n }\n else {\n this.startAngle = _calcAngle(params.x1, params.y1);\n this.endAngle = _calcAngle(params.x2, params.y2);\n this.x1 = params.x1;\n this.y1 = params.y1;\n this.x2 = params.x2;\n this.y2 = params.y2;\n }\n\n if (this.endAngle < 0) {\n this.endAngle += TWO_PI;\n }\n if (this.startAngle < 0) {\n this.startAngle += TWO_PI;\n }\n\n // segment is used by vml \n //this.segment = _jg.quadrant([this.x1, this.y1], [this.x2, this.y2]);\n\n // we now have startAngle and endAngle as positive numbers, meaning the\n // absolute difference (|d|) between them is the sweep (s) of this arc, unless the\n // arc is 'anticlockwise' in which case 's' is given by 2PI - |d|.\n\n var ea = this.endAngle < this.startAngle ? this.endAngle + TWO_PI : this.endAngle;\n this.sweep = Math.abs(ea - this.startAngle);\n if (this.anticlockwise) {\n this.sweep = TWO_PI - this.sweep;\n }\n var circumference = 2 * Math.PI * this.radius,\n frac = this.sweep / TWO_PI,\n length = circumference * frac;\n\n this.getLength = function () {\n return length;\n };\n\n this.getBounds = function () {\n return {\n minX: params.cx - params.r,\n maxX: params.cx + params.r,\n minY: params.cy - params.r,\n maxY: params.cy + params.r\n };\n };\n\n var VERY_SMALL_VALUE = 0.0000000001,\n gentleRound = function (n) {\n var f = Math.floor(n), r = Math.ceil(n);\n if (n - f < VERY_SMALL_VALUE) {\n return f;\n }\n else if (r - n < VERY_SMALL_VALUE) {\n return r;\n }\n return n;\n };\n\n /**\n * returns the point on the segment's path that is 'location' along the length of the path, where 'location' is a decimal from\n * 0 to 1 inclusive.\n */\n this.pointOnPath = function (location, absolute) {\n\n if (location === 0) {\n return { x: this.x1, y: this.y1, theta: this.startAngle };\n }\n else if (location === 1) {\n return { x: this.x2, y: this.y2, theta: this.endAngle };\n }\n\n if (absolute) {\n location = location / length;\n }\n\n var angle = _calcAngleForLocation(this, location),\n _x = params.cx + (params.r * Math.cos(angle)),\n _y = params.cy + (params.r * Math.sin(angle));\n\n return { x: gentleRound(_x), y: gentleRound(_y), theta: angle };\n };\n\n /**\n * returns the gradient of the segment at the given point.\n */\n this.gradientAtPoint = function (location, absolute) {\n var p = this.pointOnPath(location, absolute);\n var m = _jg.normal([ params.cx, params.cy ], [p.x, p.y ]);\n if (!this.anticlockwise && (m === Infinity || m === -Infinity)) {\n m *= -1;\n }\n return m;\n };\n\n this.pointAlongPathFrom = function (location, distance, absolute) {\n var p = this.pointOnPath(location, absolute),\n arcSpan = distance / circumference * 2 * Math.PI,\n dir = this.anticlockwise ? -1 : 1,\n startAngle = p.theta + (dir * arcSpan),\n startX = params.cx + (this.radius * Math.cos(startAngle)),\n startY = params.cy + (this.radius * Math.sin(startAngle));\n\n return {x: startX, y: startY};\n };\n\n // TODO: lineIntersection\n },\n\n Bezier: function (params) {\n this.curve = [\n { x: params.x1, y: params.y1},\n { x: params.cp1x, y: params.cp1y },\n { x: params.cp2x, y: params.cp2y },\n { x: params.x2, y: params.y2 }\n ];\n\n var _super = _jp.Segments.AbstractSegment.apply(this, arguments);\n // although this is not a strictly rigorous determination of bounds\n // of a bezier curve, it works for the types of curves that this segment\n // type produces.\n this.bounds = {\n minX: Math.min(params.x1, params.x2, params.cp1x, params.cp2x),\n minY: Math.min(params.y1, params.y2, params.cp1y, params.cp2y),\n maxX: Math.max(params.x1, params.x2, params.cp1x, params.cp2x),\n maxY: Math.max(params.y1, params.y2, params.cp1y, params.cp2y)\n };\n\n this.type = \"Bezier\";\n\n var _translateLocation = function (_curve, location, absolute) {\n if (absolute) {\n location = root.jsBezier.locationAlongCurveFrom(_curve, location > 0 ? 0 : 1, location);\n }\n\n return location;\n };\n\n /**\n * returns the point on the segment's path that is 'location' along the length of the path, where 'location' is a decimal from\n * 0 to 1 inclusive.\n */\n this.pointOnPath = function (location, absolute) {\n location = _translateLocation(this.curve, location, absolute);\n return root.jsBezier.pointOnCurve(this.curve, location);\n };\n\n /**\n * returns the gradient of the segment at the given point.\n */\n this.gradientAtPoint = function (location, absolute) {\n location = _translateLocation(this.curve, location, absolute);\n return root.jsBezier.gradientAtPoint(this.curve, location);\n };\n\n this.pointAlongPathFrom = function (location, distance, absolute) {\n location = _translateLocation(this.curve, location, absolute);\n return root.jsBezier.pointAlongCurveFrom(this.curve, location, distance);\n };\n\n this.getLength = function () {\n return root.jsBezier.getLength(this.curve);\n };\n\n this.getBounds = function () {\n return this.bounds;\n };\n\n this.findClosestPointOnPath = function (x, y) {\n var p = root.jsBezier.nearestPointOnCurve({x:x,y:y}, this.curve);\n return {\n d:Math.sqrt(Math.pow(p.point.x - x, 2) + Math.pow(p.point.y - y, 2)),\n x:p.point.x,\n y:p.point.y,\n l:p.location,\n s:this\n };\n };\n\n this.lineIntersection = function(x1, y1, x2, y2) {\n return root.jsBezier.lineIntersection(x1, y1, x2, y2, this.curve);\n };\n }\n };\n\n _jp.SegmentRenderer = {\n getPath: function (segment, isFirstSegment) {\n return ({\n \"Straight\": function (isFirstSegment) {\n var d = segment.getCoordinates();\n return (isFirstSegment ? \"M \" + d.x1 + \" \" + d.y1 + \" \" : \"\") + \"L \" + d.x2 + \" \" + d.y2;\n },\n \"Bezier\": function (isFirstSegment) {\n var d = segment.params;\n return (isFirstSegment ? \"M \" + d.x2 + \" \" + d.y2 + \" \" : \"\") +\n \"C \" + d.cp2x + \" \" + d.cp2y + \" \" + d.cp1x + \" \" + d.cp1y + \" \" + d.x1 + \" \" + d.y1;\n },\n \"Arc\": function (isFirstSegment) {\n var d = segment.params,\n laf = segment.sweep > Math.PI ? 1 : 0,\n sf = segment.anticlockwise ? 0 : 1;\n\n return (isFirstSegment ? \"M\" + segment.x1 + \" \" + segment.y1 + \" \" : \"\") + \"A \" + segment.radius + \" \" + d.r + \" 0 \" + laf + \",\" + sf + \" \" + segment.x2 + \" \" + segment.y2;\n }\n })[segment.type](isFirstSegment);\n }\n };\n\n /*\n Class: UIComponent\n Superclass for Connector and AbstractEndpoint.\n */\n var AbstractComponent = function () {\n this.resetBounds = function () {\n this.bounds = { minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity };\n };\n this.resetBounds();\n };\n\n /*\n * Class: Connector\n * Superclass for all Connectors; here is where Segments are managed. This is exposed on jsPlumb just so it\n * can be accessed from other files. You should not try to instantiate one of these directly.\n *\n * When this class is asked for a pointOnPath, or gradient etc, it must first figure out which segment to dispatch\n * that request to. This is done by keeping track of the total connector length as segments are added, and also\n * their cumulative ratios to the total length. Then when the right segment is found it is a simple case of dispatching\n * the request to it (and adjusting 'location' so that it is relative to the beginning of that segment.)\n */\n _jp.Connectors.AbstractConnector = function (params) {\n\n AbstractComponent.apply(this, arguments);\n\n var segments = [],\n totalLength = 0,\n segmentProportions = [],\n segmentProportionalLengths = [],\n stub = params.stub || 0,\n sourceStub = _ju.isArray(stub) ? stub[0] : stub,\n targetStub = _ju.isArray(stub) ? stub[1] : stub,\n gap = params.gap || 0,\n sourceGap = _ju.isArray(gap) ? gap[0] : gap,\n targetGap = _ju.isArray(gap) ? gap[1] : gap,\n userProvidedSegments = null,\n paintInfo = null;\n\n this.getPathData = function() {\n var p = \"\";\n for (var i = 0; i < segments.length; i++) {\n p += _jp.SegmentRenderer.getPath(segments[i], i === 0);\n p += \" \";\n }\n return p;\n };\n\n /**\n * Function: findSegmentForPoint\n * Returns the segment that is closest to the given [x,y],\n * null if nothing found. This function returns a JS\n * object with:\n *\n * d - distance from segment\n * l - proportional location in segment\n * x - x point on the segment\n * y - y point on the segment\n * s - the segment itself.\n */\n this.findSegmentForPoint = function (x, y) {\n var out = { d: Infinity, s: null, x: null, y: null, l: null };\n for (var i = 0; i < segments.length; i++) {\n var _s = segments[i].findClosestPointOnPath(x, y);\n if (_s.d < out.d) {\n out.d = _s.d;\n out.l = _s.l;\n out.x = _s.x;\n out.y = _s.y;\n out.s = segments[i];\n out.x1 = _s.x1;\n out.x2 = _s.x2;\n out.y1 = _s.y1;\n out.y2 = _s.y2;\n out.index = i;\n }\n }\n\n return out;\n };\n\n this.lineIntersection = function(x1, y1, x2, y2) {\n var out = [];\n for (var i = 0; i < segments.length; i++) {\n out.push.apply(out, segments[i].lineIntersection(x1, y1, x2, y2));\n }\n return out;\n };\n\n this.boxIntersection = function(x, y, w, h) {\n var out = [];\n for (var i = 0; i < segments.length; i++) {\n out.push.apply(out, segments[i].boxIntersection(x, y, w, h));\n }\n return out;\n };\n\n this.boundingBoxIntersection = function(box) {\n var out = [];\n for (var i = 0; i < segments.length; i++) {\n out.push.apply(out, segments[i].boundingBoxIntersection(box));\n }\n return out;\n };\n\n var _updateSegmentProportions = function () {\n var curLoc = 0;\n for (var i = 0; i < segments.length; i++) {\n var sl = segments[i].getLength();\n segmentProportionalLengths[i] = sl / totalLength;\n segmentProportions[i] = [curLoc, (curLoc += (sl / totalLength)) ];\n }\n },\n\n /**\n * returns [segment, proportion of travel in segment, segment index] for the segment\n * that contains the point which is 'location' distance along the entire path, where\n * 'location' is a decimal between 0 and 1 inclusive. in this connector type, paths\n * are made up of a list of segments, each of which contributes some fraction to\n * the total length.\n * From 1.3.10 this also supports the 'absolute' property, which lets us specify a location\n * as the absolute distance in pixels, rather than a proportion of the total path.\n */\n _findSegmentForLocation = function (location, absolute) {\n if (absolute) {\n location = location > 0 ? location / totalLength : (totalLength + location) / totalLength;\n }\n var idx = segmentProportions.length - 1, inSegmentProportion = 1;\n for (var i = 0; i < segmentProportions.length; i++) {\n if (segmentProportions[i][1] >= location) {\n idx = i;\n // todo is this correct for all connector path types?\n inSegmentProportion = location === 1 ? 1 : location === 0 ? 0 : (location - segmentProportions[i][0]) / segmentProportionalLengths[i];\n break;\n }\n }\n return { segment: segments[idx], proportion: inSegmentProportion, index: idx };\n },\n _addSegment = function (conn, type, params) {\n if (params.x1 === params.x2 && params.y1 === params.y2) {\n return;\n }\n var s = new _jp.Segments[type](params);\n segments.push(s);\n totalLength += s.getLength();\n conn.updateBounds(s);\n },\n _clearSegments = function () {\n totalLength = segments.length = segmentProportions.length = segmentProportionalLengths.length = 0;\n };\n\n this.setSegments = function (_segs) {\n userProvidedSegments = [];\n totalLength = 0;\n for (var i = 0; i < _segs.length; i++) {\n userProvidedSegments.push(_segs[i]);\n totalLength += _segs[i].getLength();\n }\n };\n\n this.getLength = function() {\n return totalLength;\n };\n\n var _prepareCompute = function (params) {\n this.strokeWidth = params.strokeWidth;\n var segment = _jg.quadrant(params.sourcePos, params.targetPos),\n swapX = params.targetPos[0] < params.sourcePos[0],\n swapY = params.targetPos[1] < params.sourcePos[1],\n lw = params.strokeWidth || 1,\n so = params.sourceEndpoint.anchor.getOrientation(params.sourceEndpoint),\n to = params.targetEndpoint.anchor.getOrientation(params.targetEndpoint),\n x = swapX ? params.targetPos[0] : params.sourcePos[0],\n y = swapY ? params.targetPos[1] : params.sourcePos[1],\n w = Math.abs(params.targetPos[0] - params.sourcePos[0]),\n h = Math.abs(params.targetPos[1] - params.sourcePos[1]);\n\n // if either anchor does not have an orientation set, we derive one from their relative\n // positions. we fix the axis to be the one in which the two elements are further apart, and\n // point each anchor at the other element. this is also used when dragging a new connection.\n if (so[0] === 0 && so[1] === 0 || to[0] === 0 && to[1] === 0) {\n var index = w > h ? 0 : 1, oIndex = [1, 0][index];\n so = [];\n to = [];\n so[index] = params.sourcePos[index] > params.targetPos[index] ? -1 : 1;\n to[index] = params.sourcePos[index] > params.targetPos[index] ? 1 : -1;\n so[oIndex] = 0;\n to[oIndex] = 0;\n }\n\n var sx = swapX ? w + (sourceGap * so[0]) : sourceGap * so[0],\n sy = swapY ? h + (sourceGap * so[1]) : sourceGap * so[1],\n tx = swapX ? targetGap * to[0] : w + (targetGap * to[0]),\n ty = swapY ? targetGap * to[1] : h + (targetGap * to[1]),\n oProduct = ((so[0] * to[0]) + (so[1] * to[1]));\n\n var result = {\n sx: sx, sy: sy, tx: tx, ty: ty, lw: lw,\n xSpan: Math.abs(tx - sx),\n ySpan: Math.abs(ty - sy),\n mx: (sx + tx) / 2,\n my: (sy + ty) / 2,\n so: so, to: to, x: x, y: y, w: w, h: h,\n segment: segment,\n startStubX: sx + (so[0] * sourceStub),\n startStubY: sy + (so[1] * sourceStub),\n endStubX: tx + (to[0] * targetStub),\n endStubY: ty + (to[1] * targetStub),\n isXGreaterThanStubTimes2: Math.abs(sx - tx) > (sourceStub + targetStub),\n isYGreaterThanStubTimes2: Math.abs(sy - ty) > (sourceStub + targetStub),\n opposite: oProduct === -1,\n perpendicular: oProduct === 0,\n orthogonal: oProduct === 1,\n sourceAxis: so[0] === 0 ? \"y\" : \"x\",\n points: [x, y, w, h, sx, sy, tx, ty ],\n stubs:[sourceStub, targetStub]\n };\n result.anchorOrientation = result.opposite ? \"opposite\" : result.orthogonal ? \"orthogonal\" : \"perpendicular\";\n return result;\n };\n\n this.getSegments = function () {\n return segments;\n };\n\n this.updateBounds = function (segment) {\n var segBounds = segment.getBounds();\n this.bounds.minX = Math.min(this.bounds.minX, segBounds.minX);\n this.bounds.maxX = Math.max(this.bounds.maxX, segBounds.maxX);\n this.bounds.minY = Math.min(this.bounds.minY, segBounds.minY);\n this.bounds.maxY = Math.max(this.bounds.maxY, segBounds.maxY);\n };\n\n var dumpSegmentsToConsole = function () {\n console.log(\"SEGMENTS:\");\n for (var i = 0; i < segments.length; i++) {\n console.log(segments[i].type, segments[i].getLength(), segmentProportions[i]);\n }\n };\n\n this.pointOnPath = function (location, absolute) {\n var seg = _findSegmentForLocation(location, absolute);\n return seg.segment && seg.segment.pointOnPath(seg.proportion, false) || [0, 0];\n };\n\n this.gradientAtPoint = function (location, absolute) {\n var seg = _findSegmentForLocation(location, absolute);\n return seg.segment && seg.segment.gradientAtPoint(seg.proportion, false) || 0;\n };\n\n this.pointAlongPathFrom = function (location, distance, absolute) {\n var seg = _findSegmentForLocation(location, absolute);\n // TODO what happens if this crosses to the next segment?\n return seg.segment && seg.segment.pointAlongPathFrom(seg.proportion, distance, false) || [0, 0];\n };\n\n this.compute = function (params) {\n paintInfo = _prepareCompute.call(this, params);\n\n _clearSegments();\n this._compute(paintInfo, params);\n this.x = paintInfo.points[0];\n this.y = paintInfo.points[1];\n this.w = paintInfo.points[2];\n this.h = paintInfo.points[3];\n this.segment = paintInfo.segment;\n _updateSegmentProportions();\n };\n\n return {\n addSegment: _addSegment,\n prepareCompute: _prepareCompute,\n sourceStub: sourceStub,\n targetStub: targetStub,\n maxStub: Math.max(sourceStub, targetStub),\n sourceGap: sourceGap,\n targetGap: targetGap,\n maxGap: Math.max(sourceGap, targetGap)\n };\n };\n _ju.extend(_jp.Connectors.AbstractConnector, AbstractComponent);\n\n\n // ********************************* END OF CONNECTOR TYPES *******************************************************************\n\n // ********************************* ENDPOINT TYPES *******************************************************************\n\n _jp.Endpoints.AbstractEndpoint = function (params) {\n AbstractComponent.apply(this, arguments);\n var compute = this.compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n var out = this._compute.apply(this, arguments);\n this.x = out[0];\n this.y = out[1];\n this.w = out[2];\n this.h = out[3];\n this.bounds.minX = this.x;\n this.bounds.minY = this.y;\n this.bounds.maxX = this.x + this.w;\n this.bounds.maxY = this.y + this.h;\n return out;\n };\n return {\n compute: compute,\n cssClass: params.cssClass\n };\n };\n _ju.extend(_jp.Endpoints.AbstractEndpoint, AbstractComponent);\n\n /**\n * Class: Endpoints.Dot\n * A round endpoint, with default radius 10 pixels.\n */\n\n /**\n * Function: Constructor\n *\n * Parameters:\n *\n * radius - radius of the endpoint. defaults to 10 pixels.\n */\n _jp.Endpoints.Dot = function (params) {\n this.type = \"Dot\";\n var _super = _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n params = params || {};\n this.radius = params.radius || 10;\n this.defaultOffset = 0.5 * this.radius;\n this.defaultInnerRadius = this.radius / 3;\n\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n this.radius = endpointStyle.radius || this.radius;\n var x = anchorPoint[0] - this.radius,\n y = anchorPoint[1] - this.radius,\n w = this.radius * 2,\n h = this.radius * 2;\n\n if (endpointStyle.stroke) {\n var lw = endpointStyle.strokeWidth || 1;\n x -= lw;\n y -= lw;\n w += (lw * 2);\n h += (lw * 2);\n }\n return [ x, y, w, h, this.radius ];\n };\n };\n _ju.extend(_jp.Endpoints.Dot, _jp.Endpoints.AbstractEndpoint);\n\n _jp.Endpoints.Rectangle = function (params) {\n this.type = \"Rectangle\";\n var _super = _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n params = params || {};\n this.width = params.width || 20;\n this.height = params.height || 20;\n\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n var width = endpointStyle.width || this.width,\n height = endpointStyle.height || this.height,\n x = anchorPoint[0] - (width / 2),\n y = anchorPoint[1] - (height / 2);\n\n return [ x, y, width, height];\n };\n };\n _ju.extend(_jp.Endpoints.Rectangle, _jp.Endpoints.AbstractEndpoint);\n\n var DOMElementEndpoint = function (params) {\n _jp.jsPlumbUIComponent.apply(this, arguments);\n this._jsPlumb.displayElements = [];\n };\n _ju.extend(DOMElementEndpoint, _jp.jsPlumbUIComponent, {\n getDisplayElements: function () {\n return this._jsPlumb.displayElements;\n },\n appendDisplayElement: function (el) {\n this._jsPlumb.displayElements.push(el);\n }\n });\n\n /**\n * Class: Endpoints.Image\n * Draws an image as the Endpoint.\n */\n /**\n * Function: Constructor\n *\n * Parameters:\n *\n * src - location of the image to use.\n\n TODO: multiple references to self. not sure quite how to get rid of them entirely. perhaps self = null in the cleanup\n function will suffice\n\n TODO this class still might leak memory.\n\n */\n _jp.Endpoints.Image = function (params) {\n\n this.type = \"Image\";\n DOMElementEndpoint.apply(this, arguments);\n _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n\n var _onload = params.onload,\n src = params.src || params.url,\n clazz = params.cssClass ? \" \" + params.cssClass : \"\";\n\n this._jsPlumb.img = new Image();\n this._jsPlumb.ready = false;\n this._jsPlumb.initialized = false;\n this._jsPlumb.deleted = false;\n this._jsPlumb.widthToUse = params.width;\n this._jsPlumb.heightToUse = params.height;\n this._jsPlumb.endpoint = params.endpoint;\n\n this._jsPlumb.img.onload = function () {\n if (this._jsPlumb != null) {\n this._jsPlumb.ready = true;\n this._jsPlumb.widthToUse = this._jsPlumb.widthToUse || this._jsPlumb.img.width;\n this._jsPlumb.heightToUse = this._jsPlumb.heightToUse || this._jsPlumb.img.height;\n if (_onload) {\n _onload(this);\n }\n }\n }.bind(this);\n\n /*\n Function: setImage\n Sets the Image to use in this Endpoint.\n\n Parameters:\n img - may be a URL or an Image object\n onload - optional; a callback to execute once the image has loaded.\n */\n this._jsPlumb.endpoint.setImage = function (_img, onload) {\n var s = _img.constructor === String ? _img : _img.src;\n _onload = onload;\n this._jsPlumb.img.src = s;\n\n if (this.canvas != null) {\n this.canvas.setAttribute(\"src\", this._jsPlumb.img.src);\n }\n }.bind(this);\n\n this._jsPlumb.endpoint.setImage(src, _onload);\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n this.anchorPoint = anchorPoint;\n if (this._jsPlumb.ready) {\n return [anchorPoint[0] - this._jsPlumb.widthToUse / 2, anchorPoint[1] - this._jsPlumb.heightToUse / 2,\n this._jsPlumb.widthToUse, this._jsPlumb.heightToUse];\n }\n else {\n return [0, 0, 0, 0];\n }\n };\n\n this.canvas = _jp.createElement(\"img\", {\n position:\"absolute\",\n margin:0,\n padding:0,\n outline:0\n }, this._jsPlumb.instance.endpointClass + clazz);\n\n if (this._jsPlumb.widthToUse) {\n this.canvas.setAttribute(\"width\", this._jsPlumb.widthToUse);\n }\n if (this._jsPlumb.heightToUse) {\n this.canvas.setAttribute(\"height\", this._jsPlumb.heightToUse);\n }\n this._jsPlumb.instance.appendElement(this.canvas);\n\n this.actuallyPaint = function (d, style, anchor) {\n if (!this._jsPlumb.deleted) {\n if (!this._jsPlumb.initialized) {\n this.canvas.setAttribute(\"src\", this._jsPlumb.img.src);\n this.appendDisplayElement(this.canvas);\n this._jsPlumb.initialized = true;\n }\n var x = this.anchorPoint[0] - (this._jsPlumb.widthToUse / 2),\n y = this.anchorPoint[1] - (this._jsPlumb.heightToUse / 2);\n _ju.sizeElement(this.canvas, x, y, this._jsPlumb.widthToUse, this._jsPlumb.heightToUse);\n }\n };\n\n this.paint = function (style, anchor) {\n if (this._jsPlumb != null) { // may have been deleted\n if (this._jsPlumb.ready) {\n this.actuallyPaint(style, anchor);\n }\n else {\n root.setTimeout(function () {\n this.paint(style, anchor);\n }.bind(this), 200);\n }\n }\n };\n };\n _ju.extend(_jp.Endpoints.Image, [ DOMElementEndpoint, _jp.Endpoints.AbstractEndpoint ], {\n cleanup: function (force) {\n if (force) {\n this._jsPlumb.deleted = true;\n if (this.canvas) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n this.canvas = null;\n }\n }\n });\n\n /*\n * Class: Endpoints.Blank\n * An Endpoint that paints nothing (visible) on the screen. Supports cssClass and hoverClass parameters like all Endpoints.\n */\n _jp.Endpoints.Blank = function (params) {\n var _super = _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n this.type = \"Blank\";\n DOMElementEndpoint.apply(this, arguments);\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n return [anchorPoint[0], anchorPoint[1], 10, 0];\n };\n\n var clazz = params.cssClass ? \" \" + params.cssClass : \"\";\n\n this.canvas = _jp.createElement(\"div\", {\n display: \"block\",\n width: \"1px\",\n height: \"1px\",\n background: \"transparent\",\n position: \"absolute\"\n }, this._jsPlumb.instance.endpointClass + clazz);\n\n this._jsPlumb.instance.appendElement(this.canvas);\n\n this.paint = function (style, anchor) {\n _ju.sizeElement(this.canvas, this.x, this.y, this.w, this.h);\n };\n };\n _ju.extend(_jp.Endpoints.Blank, [_jp.Endpoints.AbstractEndpoint, DOMElementEndpoint], {\n cleanup: function () {\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n }\n });\n\n /*\n * Class: Endpoints.Triangle\n * A triangular Endpoint.\n */\n /*\n * Function: Constructor\n *\n * Parameters:\n *\n * width width of the triangle's base. defaults to 55 pixels.\n * height height of the triangle from base to apex. defaults to 55 pixels.\n */\n _jp.Endpoints.Triangle = function (params) {\n this.type = \"Triangle\";\n _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n var self = this;\n params = params || { };\n params.width = params.width || 55;\n params.height = params.height || 55;\n this.width = params.width;\n this.height = params.height;\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n var width = endpointStyle.width || self.width,\n height = endpointStyle.height || self.height,\n x = anchorPoint[0] - (width / 2),\n y = anchorPoint[1] - (height / 2);\n return [ x, y, width, height ];\n };\n };\n// ********************************* END OF ENDPOINT TYPES *******************************************************************\n\n\n// ********************************* OVERLAY DEFINITIONS *********************************************************************** \n\n var AbstractOverlay = _jp.Overlays.AbstractOverlay = function (params) {\n this.visible = true;\n this.isAppendedAtTopLevel = true;\n this.component = params.component;\n this.loc = params.location == null ? 0.5 : params.location;\n this.endpointLoc = params.endpointLocation == null ? [ 0.5, 0.5] : params.endpointLocation;\n this.visible = params.visible !== false;\n };\n AbstractOverlay.prototype = {\n cleanup: function (force) {\n if (force) {\n this.component = null;\n this.canvas = null;\n this.endpointLoc = null;\n }\n },\n reattach:function(instance, component) { },\n setVisible: function (val) {\n this.visible = val;\n this.component.repaint();\n },\n isVisible: function () {\n return this.visible;\n },\n hide: function () {\n this.setVisible(false);\n },\n show: function () {\n this.setVisible(true);\n },\n incrementLocation: function (amount) {\n this.loc += amount;\n this.component.repaint();\n },\n setLocation: function (l) {\n this.loc = l;\n this.component.repaint();\n },\n getLocation: function () {\n return this.loc;\n },\n updateFrom:function() { }\n };\n\n\n /*\n * Class: Overlays.Arrow\n *\n * An arrow overlay, defined by four points: the head, the two sides of the tail, and a 'foldback' point at some distance along the length\n * of the arrow that lines from each tail point converge into. The foldback point is defined using a decimal that indicates some fraction\n * of the length of the arrow and has a default value of 0.623. A foldback point value of 1 would mean that the arrow had a straight line\n * across the tail.\n */\n /*\n * @constructor\n *\n * @param {Object} params Constructor params.\n * @param {Number} [params.length] Distance in pixels from head to tail baseline. default 20.\n * @param {Number} [params.width] Width in pixels of the tail baseline. default 20.\n * @param {String} [params.fill] Style to use when filling the arrow. defaults to \"black\".\n * @param {String} [params.stroke] Style to use when stroking the arrow. defaults to null, which means the arrow is not stroked.\n * @param {Number} [params.stroke-width] Line width to use when stroking the arrow. defaults to 1, but only used if stroke is not null.\n * @param {Number} [params.foldback] Distance (as a decimal from 0 to 1 inclusive) along the length of the arrow marking the point the tail points should fold back to. defaults to 0.623.\n * @param {Number} [params.location] Distance (as a decimal from 0 to 1 inclusive) marking where the arrow should sit on the connector. defaults to 0.5.\n * @param {NUmber} [params.direction] Indicates the direction the arrow points in. valid values are -1 and 1; 1 is default.\n */\n _jp.Overlays.Arrow = function (params) {\n this.type = \"Arrow\";\n AbstractOverlay.apply(this, arguments);\n this.isAppendedAtTopLevel = false;\n params = params || {};\n var self = this;\n\n this.length = params.length || 20;\n this.width = params.width || 20;\n this.id = params.id;\n var direction = (params.direction || 1) < 0 ? -1 : 1,\n paintStyle = params.paintStyle || { \"stroke-width\": 1 },\n // how far along the arrow the lines folding back in come to. default is 62.3%.\n foldback = params.foldback || 0.623;\n\n this.computeMaxSize = function () {\n return self.width * 1.5;\n };\n\n this.elementCreated = function(p, component) {\n this.path = p;\n if (params.events) {\n for (var i in params.events) {\n _jp.on(p, i, params.events[i]);\n }\n }\n };\n\n this.draw = function (component, currentConnectionPaintStyle) {\n\n var hxy, mid, txy, tail, cxy;\n if (component.pointAlongPathFrom) {\n\n if (_ju.isString(this.loc) || this.loc > 1 || this.loc < 0) {\n var l = parseInt(this.loc, 10),\n fromLoc = this.loc < 0 ? 1 : 0;\n hxy = component.pointAlongPathFrom(fromLoc, l, false);\n mid = component.pointAlongPathFrom(fromLoc, l - (direction * this.length / 2), false);\n txy = _jg.pointOnLine(hxy, mid, this.length);\n }\n else if (this.loc === 1) {\n hxy = component.pointOnPath(this.loc);\n mid = component.pointAlongPathFrom(this.loc, -(this.length));\n txy = _jg.pointOnLine(hxy, mid, this.length);\n\n if (direction === -1) {\n var _ = txy;\n txy = hxy;\n hxy = _;\n }\n }\n else if (this.loc === 0) {\n txy = component.pointOnPath(this.loc);\n mid = component.pointAlongPathFrom(this.loc, this.length);\n hxy = _jg.pointOnLine(txy, mid, this.length);\n if (direction === -1) {\n var __ = txy;\n txy = hxy;\n hxy = __;\n }\n }\n else {\n hxy = component.pointAlongPathFrom(this.loc, direction * this.length / 2);\n mid = component.pointOnPath(this.loc);\n txy = _jg.pointOnLine(hxy, mid, this.length);\n }\n\n tail = _jg.perpendicularLineTo(hxy, txy, this.width);\n cxy = _jg.pointOnLine(hxy, txy, foldback * this.length);\n\n var d = { hxy: hxy, tail: tail, cxy: cxy },\n stroke = paintStyle.stroke || currentConnectionPaintStyle.stroke,\n fill = paintStyle.fill || currentConnectionPaintStyle.stroke,\n lineWidth = paintStyle.strokeWidth || currentConnectionPaintStyle.strokeWidth;\n\n return {\n component: component,\n d: d,\n \"stroke-width\": lineWidth,\n stroke: stroke,\n fill: fill,\n minX: Math.min(hxy.x, tail[0].x, tail[1].x),\n maxX: Math.max(hxy.x, tail[0].x, tail[1].x),\n minY: Math.min(hxy.y, tail[0].y, tail[1].y),\n maxY: Math.max(hxy.y, tail[0].y, tail[1].y)\n };\n }\n else {\n return {component: component, minX: 0, maxX: 0, minY: 0, maxY: 0};\n }\n };\n };\n _ju.extend(_jp.Overlays.Arrow, AbstractOverlay, {\n updateFrom:function(d) {\n this.length = d.length || this.length;\n this.width = d.width|| this.width;\n this.direction = d.direction != null ? d.direction : this.direction;\n this.foldback = d.foldback|| this.foldback;\n },\n cleanup:function() {\n if (this.path && this.canvas) {\n this.canvas.removeChild(this.path);\n }\n }\n });\n\n /*\n * Class: Overlays.PlainArrow\n *\n * A basic arrow. This is in fact just one instance of the more generic case in which the tail folds back on itself to some\n * point along the length of the arrow: in this case, that foldback point is the full length of the arrow. so it just does\n * a 'call' to Arrow with foldback set appropriately.\n */\n /*\n * Function: Constructor\n * See for allowed parameters for this overlay.\n */\n _jp.Overlays.PlainArrow = function (params) {\n params = params || {};\n var p = _jp.extend(params, {foldback: 1});\n _jp.Overlays.Arrow.call(this, p);\n this.type = \"PlainArrow\";\n };\n _ju.extend(_jp.Overlays.PlainArrow, _jp.Overlays.Arrow);\n\n /*\n * Class: Overlays.Diamond\n * \n * A diamond. Like PlainArrow, this is a concrete case of the more generic case of the tail points converging on some point...it just\n * happens that in this case, that point is greater than the length of the the arrow.\n *\n * this could probably do with some help with positioning...due to the way it reuses the Arrow paint code, what Arrow thinks is the\n * center is actually 1/4 of the way along for this guy. but we don't have any knowledge of pixels at this point, so we're kind of\n * stuck when it comes to helping out the Arrow class. possibly we could pass in a 'transpose' parameter or something. the value\n * would be -l/4 in this case - move along one quarter of the total length.\n */\n /*\n * Function: Constructor\n * See for allowed parameters for this overlay.\n */\n _jp.Overlays.Diamond = function (params) {\n params = params || {};\n var l = params.length || 40,\n p = _jp.extend(params, {length: l / 2, foldback: 2});\n _jp.Overlays.Arrow.call(this, p);\n this.type = \"Diamond\";\n };\n _ju.extend(_jp.Overlays.Diamond, _jp.Overlays.Arrow);\n\n var _getDimensions = function (component, forceRefresh) {\n if (component._jsPlumb.cachedDimensions == null || forceRefresh) {\n component._jsPlumb.cachedDimensions = component.getDimensions();\n }\n return component._jsPlumb.cachedDimensions;\n };\n\n // abstract superclass for overlays that add an element to the DOM.\n var AbstractDOMOverlay = function (params) {\n _jp.jsPlumbUIComponent.apply(this, arguments);\n AbstractOverlay.apply(this, arguments);\n\n // hand off fired events to associated component.\n var _f = this.fire;\n this.fire = function () {\n _f.apply(this, arguments);\n if (this.component) {\n this.component.fire.apply(this.component, arguments);\n }\n };\n\n this.detached=false;\n this.id = params.id;\n this._jsPlumb.div = null;\n this._jsPlumb.initialised = false;\n this._jsPlumb.component = params.component;\n this._jsPlumb.cachedDimensions = null;\n this._jsPlumb.create = params.create;\n this._jsPlumb.initiallyInvisible = params.visible === false;\n\n this.getElement = function () {\n if (this._jsPlumb.div == null) {\n var div = this._jsPlumb.div = _jp.getElement(this._jsPlumb.create(this._jsPlumb.component));\n div.style.position = \"absolute\";\n jsPlumb.addClass(div, this._jsPlumb.instance.overlayClass + \" \" +\n (this.cssClass ? this.cssClass :\n params.cssClass ? params.cssClass : \"\"));\n this._jsPlumb.instance.appendElement(div);\n this._jsPlumb.instance.getId(div);\n this.canvas = div;\n\n // in IE the top left corner is what it placed at the desired location. This will not\n // be fixed. IE8 is not going to be supported for much longer.\n var ts = \"translate(-50%, -50%)\";\n div.style.webkitTransform = ts;\n div.style.mozTransform = ts;\n div.style.msTransform = ts;\n div.style.oTransform = ts;\n div.style.transform = ts;\n\n // write the related component into the created element\n div._jsPlumb = this;\n\n if (params.visible === false) {\n div.style.display = \"none\";\n }\n }\n return this._jsPlumb.div;\n };\n\n this.draw = function (component, currentConnectionPaintStyle, absolutePosition) {\n var td = _getDimensions(this);\n if (td != null && td.length === 2) {\n var cxy = { x: 0, y: 0 };\n\n // absolutePosition would have been set by a call to connection.setAbsoluteOverlayPosition.\n if (absolutePosition) {\n cxy = { x: absolutePosition[0], y: absolutePosition[1] };\n }\n else if (component.pointOnPath) {\n var loc = this.loc, absolute = false;\n if (_ju.isString(this.loc) || this.loc < 0 || this.loc > 1) {\n loc = parseInt(this.loc, 10);\n absolute = true;\n }\n cxy = component.pointOnPath(loc, absolute); // a connection\n }\n else {\n var locToUse = this.loc.constructor === Array ? this.loc : this.endpointLoc;\n cxy = { x: locToUse[0] * component.w,\n y: locToUse[1] * component.h };\n }\n\n var minx = cxy.x - (td[0] / 2),\n miny = cxy.y - (td[1] / 2);\n\n return {\n component: component,\n d: { minx: minx, miny: miny, td: td, cxy: cxy },\n minX: minx,\n maxX: minx + td[0],\n minY: miny,\n maxY: miny + td[1]\n };\n }\n else {\n return {minX: 0, maxX: 0, minY: 0, maxY: 0};\n }\n };\n };\n _ju.extend(AbstractDOMOverlay, [_jp.jsPlumbUIComponent, AbstractOverlay], {\n getDimensions: function () {\n return [1,1];\n },\n setVisible: function (state) {\n if (this._jsPlumb.div) {\n this._jsPlumb.div.style.display = state ? \"block\" : \"none\";\n // if initially invisible, dimensions are 0,0 and never get updated\n if (state && this._jsPlumb.initiallyInvisible) {\n _getDimensions(this, true);\n this.component.repaint();\n this._jsPlumb.initiallyInvisible = false;\n }\n }\n },\n /*\n * Function: clearCachedDimensions\n * Clears the cached dimensions for the label. As a performance enhancement, label dimensions are\n * cached from 1.3.12 onwards. The cache is cleared when you change the label text, of course, but\n * there are other reasons why the text dimensions might change - if you make a change through CSS, for\n * example, you might change the font size. in that case you should explicitly call this method.\n */\n clearCachedDimensions: function () {\n this._jsPlumb.cachedDimensions = null;\n },\n cleanup: function (force) {\n if (force) {\n if (this._jsPlumb.div != null) {\n this._jsPlumb.div._jsPlumb = null;\n this._jsPlumb.instance.removeElement(this._jsPlumb.div);\n }\n }\n else {\n // if not a forced cleanup, just detach child from parent for now.\n if (this._jsPlumb && this._jsPlumb.div && this._jsPlumb.div.parentNode) {\n this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div);\n }\n this.detached = true;\n }\n\n },\n reattach:function(instance, component) {\n if (this._jsPlumb.div != null) {\n instance.getContainer().appendChild(this._jsPlumb.div);\n }\n this.detached = false;\n },\n computeMaxSize: function () {\n var td = _getDimensions(this);\n return Math.max(td[0], td[1]);\n },\n paint: function (p, containerExtents) {\n if (!this._jsPlumb.initialised) {\n this.getElement();\n p.component.appendDisplayElement(this._jsPlumb.div);\n this._jsPlumb.initialised = true;\n if (this.detached) {\n this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div);\n }\n }\n this._jsPlumb.div.style.left = (p.component.x + p.d.minx) + \"px\";\n this._jsPlumb.div.style.top = (p.component.y + p.d.miny) + \"px\";\n }\n });\n\n /*\n * Class: Overlays.Custom\n * A Custom overlay. You supply a 'create' function which returns some DOM element, and jsPlumb positions it.\n * The 'create' function is passed a Connection or Endpoint.\n */\n /*\n * Function: Constructor\n * \n * Parameters:\n * create - function for jsPlumb to call that returns a DOM element.\n * location - distance (as a decimal from 0 to 1 inclusive) marking where the label should sit on the connector. defaults to 0.5.\n * id - optional id to use for later retrieval of this overlay.\n *\n */\n _jp.Overlays.Custom = function (params) {\n this.type = \"Custom\";\n AbstractDOMOverlay.apply(this, arguments);\n };\n _ju.extend(_jp.Overlays.Custom, AbstractDOMOverlay);\n\n _jp.Overlays.GuideLines = function () {\n var self = this;\n self.length = 50;\n self.strokeWidth = 5;\n this.type = \"GuideLines\";\n AbstractOverlay.apply(this, arguments);\n _jp.jsPlumbUIComponent.apply(this, arguments);\n this.draw = function (connector, currentConnectionPaintStyle) {\n\n var head = connector.pointAlongPathFrom(self.loc, self.length / 2),\n mid = connector.pointOnPath(self.loc),\n tail = _jg.pointOnLine(head, mid, self.length),\n tailLine = _jg.perpendicularLineTo(head, tail, 40),\n headLine = _jg.perpendicularLineTo(tail, head, 20);\n\n return {\n connector: connector,\n head: head,\n tail: tail,\n headLine: headLine,\n tailLine: tailLine,\n minX: Math.min(head.x, tail.x, headLine[0].x, headLine[1].x),\n minY: Math.min(head.y, tail.y, headLine[0].y, headLine[1].y),\n maxX: Math.max(head.x, tail.x, headLine[0].x, headLine[1].x),\n maxY: Math.max(head.y, tail.y, headLine[0].y, headLine[1].y)\n };\n };\n\n // this.cleanup = function() { }; // nothing to clean up for GuideLines\n };\n\n /*\n * Class: Overlays.Label\n\n */\n /*\n * Function: Constructor\n * \n * Parameters:\n * cssClass - optional css class string to append to css class. This string is appended \"as-is\", so you can of course have multiple classes\n * defined. This parameter is preferred to using labelStyle, borderWidth and borderStyle.\n * label - the label to paint. May be a string or a function that returns a string. Nothing will be painted if your label is null or your\n * label function returns null. empty strings _will_ be painted.\n * location - distance (as a decimal from 0 to 1 inclusive) marking where the label should sit on the connector. defaults to 0.5.\n * id - optional id to use for later retrieval of this overlay.\n * \n *\n */\n _jp.Overlays.Label = function (params) {\n this.labelStyle = params.labelStyle;\n\n var labelWidth = null, labelHeight = null, labelText = null, labelPadding = null;\n this.cssClass = this.labelStyle != null ? this.labelStyle.cssClass : null;\n var p = _jp.extend({\n create: function () {\n return _jp.createElement(\"div\");\n }}, params);\n _jp.Overlays.Custom.call(this, p);\n this.type = \"Label\";\n this.label = params.label || \"\";\n this.labelText = null;\n if (this.labelStyle) {\n var el = this.getElement();\n this.labelStyle.font = this.labelStyle.font || \"12px sans-serif\";\n el.style.font = this.labelStyle.font;\n el.style.color = this.labelStyle.color || \"black\";\n if (this.labelStyle.fill) {\n el.style.background = this.labelStyle.fill;\n }\n if (this.labelStyle.borderWidth > 0) {\n var dStyle = this.labelStyle.borderStyle ? this.labelStyle.borderStyle : \"black\";\n el.style.border = this.labelStyle.borderWidth + \"px solid \" + dStyle;\n }\n if (this.labelStyle.padding) {\n el.style.padding = this.labelStyle.padding;\n }\n }\n\n };\n _ju.extend(_jp.Overlays.Label, _jp.Overlays.Custom, {\n cleanup: function (force) {\n if (force) {\n this.div = null;\n this.label = null;\n this.labelText = null;\n this.cssClass = null;\n this.labelStyle = null;\n }\n },\n getLabel: function () {\n return this.label;\n },\n /*\n * Function: setLabel\n * sets the label's, um, label. you would think i'd call this function\n * 'setText', but you can pass either a Function or a String to this, so\n * it makes more sense as 'setLabel'. This uses innerHTML on the label div, so keep\n * that in mind if you need escaped HTML.\n */\n setLabel: function (l) {\n this.label = l;\n this.labelText = null;\n this.clearCachedDimensions();\n this.update();\n this.component.repaint();\n },\n getDimensions: function () {\n this.update();\n return AbstractDOMOverlay.prototype.getDimensions.apply(this, arguments);\n },\n update: function () {\n if (typeof this.label === \"function\") {\n var lt = this.label(this);\n this.getElement().innerHTML = lt.replace(/\\r\\n/g, \"
\");\n }\n else {\n if (this.labelText == null) {\n this.labelText = this.label;\n this.getElement().innerHTML = this.labelText.replace(/\\r\\n/g, \"
\");\n }\n }\n },\n updateFrom:function(d) {\n if(d.label != null){\n this.setLabel(d.label);\n }\n }\n });\n\n // ********************************* END OF OVERLAY DEFINITIONS ***********************************************************************\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function() {\n \"use strict\";\n\n var root = this,\n _ju = root.jsPlumbUtil,\n _jpi = root.jsPlumbInstance;\n\n var GROUP_COLLAPSED_CLASS = \"jtk-group-collapsed\";\n var GROUP_EXPANDED_CLASS = \"jtk-group-expanded\";\n var GROUP_CONTAINER_SELECTOR = \"[jtk-group-content]\";\n var ELEMENT_DRAGGABLE_EVENT = \"elementDraggable\";\n var STOP = \"stop\";\n var REVERT = \"revert\";\n var GROUP_MANAGER = \"_groupManager\";\n var GROUP = \"_jsPlumbGroup\";\n var GROUP_DRAG_SCOPE = \"_jsPlumbGroupDrag\";\n var EVT_CHILD_ADDED = \"group:addMember\";\n var EVT_CHILD_REMOVED = \"group:removeMember\";\n var EVT_GROUP_ADDED = \"group:add\";\n var EVT_GROUP_REMOVED = \"group:remove\";\n var EVT_EXPAND = \"group:expand\";\n var EVT_COLLAPSE = \"group:collapse\";\n var EVT_GROUP_DRAG_STOP = \"groupDragStop\";\n var EVT_CONNECTION_MOVED = \"connectionMoved\";\n var EVT_INTERNAL_CONNECTION_DETACHED = \"internal.connectionDetached\";\n\n var CMD_REMOVE_ALL = \"removeAll\";\n var CMD_ORPHAN_ALL = \"orphanAll\";\n var CMD_SHOW = \"show\";\n var CMD_HIDE = \"hide\";\n\n var GroupManager = function(_jsPlumb) {\n var _managedGroups = {}, _connectionSourceMap = {}, _connectionTargetMap = {}, self = this;\n\n _jsPlumb.bind(\"connection\", function(p) {\n if (p.source[GROUP] != null && p.target[GROUP] != null && p.source[GROUP] === p.target[GROUP]) {\n _connectionSourceMap[p.connection.id] = p.source[GROUP];\n _connectionTargetMap[p.connection.id] = p.source[GROUP];\n }\n else {\n if (p.source[GROUP] != null) {\n _ju.suggest(p.source[GROUP].connections.source, p.connection);\n _connectionSourceMap[p.connection.id] = p.source[GROUP];\n }\n if (p.target[GROUP] != null) {\n _ju.suggest(p.target[GROUP].connections.target, p.connection);\n _connectionTargetMap[p.connection.id] = p.target[GROUP];\n }\n }\n });\n\n function _cleanupDetachedConnection(conn) {\n delete conn.proxies;\n var group = _connectionSourceMap[conn.id], f;\n if (group != null) {\n f = function(c) { return c.id === conn.id; };\n _ju.removeWithFunction(group.connections.source, f);\n _ju.removeWithFunction(group.connections.target, f);\n delete _connectionSourceMap[conn.id];\n }\n\n group = _connectionTargetMap[conn.id];\n if (group != null) {\n f = function(c) { return c.id === conn.id; };\n _ju.removeWithFunction(group.connections.source, f);\n _ju.removeWithFunction(group.connections.target, f);\n delete _connectionTargetMap[conn.id];\n }\n }\n\n _jsPlumb.bind(EVT_INTERNAL_CONNECTION_DETACHED, function(p) {\n _cleanupDetachedConnection(p.connection);\n });\n\n _jsPlumb.bind(EVT_CONNECTION_MOVED, function(p) {\n var connMap = p.index === 0 ? _connectionSourceMap : _connectionTargetMap;\n var group = connMap[p.connection.id];\n if (group) {\n var list = group.connections[p.index === 0 ? \"source\" : \"target\"];\n var idx = list.indexOf(p.connection);\n if (idx !== -1) {\n list.splice(idx, 1);\n }\n }\n });\n\n this.addGroup = function(group) {\n _jsPlumb.addClass(group.getEl(), GROUP_EXPANDED_CLASS);\n _managedGroups[group.id] = group;\n group.manager = this;\n _updateConnectionsForGroup(group);\n _jsPlumb.fire(EVT_GROUP_ADDED, { group:group });\n };\n\n this.addToGroup = function(group, el, doNotFireEvent) {\n group = this.getGroup(group);\n if (group) {\n var groupEl = group.getEl();\n\n if (el._isJsPlumbGroup) {\n return;\n }\n var currentGroup = el._jsPlumbGroup;\n // if already a member of this group, do nothing\n if (currentGroup !== group) {\n var elpos = _jsPlumb.getOffset(el, true);\n var cpos = group.collapsed ? _jsPlumb.getOffset(groupEl, true) : _jsPlumb.getOffset(group.getDragArea(), true);\n\n // otherwise, transfer to this group.\n if (currentGroup != null) {\n currentGroup.remove(el, false, doNotFireEvent, false, group);\n self.updateConnectionsForGroup(currentGroup);\n }\n group.add(el, doNotFireEvent/*, currentGroup*/);\n\n var handleDroppedConnections = function (list, index) {\n var oidx = index === 0 ? 1 : 0;\n list.each(function (c) {\n c.setVisible(false);\n if (c.endpoints[oidx].element._jsPlumbGroup === group) {\n c.endpoints[oidx].setVisible(false);\n self.expandConnection(c, oidx, group);\n }\n else {\n c.endpoints[index].setVisible(false);\n self.collapseConnection(c, index, group);\n }\n });\n };\n\n if (group.collapsed) {\n handleDroppedConnections(_jsPlumb.select({source: el}), 0);\n handleDroppedConnections(_jsPlumb.select({target: el}), 1);\n }\n\n var elId = _jsPlumb.getId(el);\n _jsPlumb.dragManager.setParent(el, elId, groupEl, _jsPlumb.getId(groupEl), elpos);\n\n var newPosition = { left: elpos.left - cpos.left, top: elpos.top - cpos.top };\n\n _jsPlumb.setPosition(el, newPosition);\n\n _jsPlumb.dragManager.revalidateParent(el, elId, elpos);\n\n self.updateConnectionsForGroup(group);\n\n _jsPlumb.revalidate(elId);\n\n if (!doNotFireEvent) {\n var p = {group: group, el: el};\n if (currentGroup) {\n p.sourceGroup = currentGroup;\n }\n _jsPlumb.fire(EVT_CHILD_ADDED, p);\n }\n }\n }\n };\n\n this.removeFromGroup = function(group, el, doNotFireEvent) {\n group = this.getGroup(group);\n if (group) {\n group.remove(el, null, doNotFireEvent);\n }\n };\n\n this.getGroup = function(groupId) {\n var group = groupId;\n if (_ju.isString(groupId)) {\n group = _managedGroups[groupId];\n if (group == null) {\n throw new TypeError(\"No such group [\" + groupId + \"]\");\n }\n }\n return group;\n };\n\n this.getGroups = function() {\n var o = [];\n for (var g in _managedGroups) {\n o.push(_managedGroups[g]);\n }\n return o;\n };\n\n this.removeGroup = function(group, deleteMembers, manipulateDOM, doNotFireEvent) {\n group = this.getGroup(group);\n this.expandGroup(group, true); // this reinstates any original connections and removes all proxies, but does not fire an event.\n var newPositions = group[deleteMembers ? CMD_REMOVE_ALL : CMD_ORPHAN_ALL](manipulateDOM, doNotFireEvent);\n _jsPlumb.remove(group.getEl());\n delete _managedGroups[group.id];\n delete _jsPlumb._groups[group.id];\n _jsPlumb.fire(EVT_GROUP_REMOVED, { group:group });\n return newPositions; // this will be null in the case or remove, but be a map of {id->[x,y]} in the case of orphan\n };\n\n this.removeAllGroups = function(deleteMembers, manipulateDOM, doNotFireEvent) {\n for (var g in _managedGroups) {\n this.removeGroup(_managedGroups[g], deleteMembers, manipulateDOM, doNotFireEvent);\n }\n };\n\n function _setVisible(group, state) {\n var m = group.getMembers();\n for (var i = 0; i < m.length; i++) {\n _jsPlumb[state ? CMD_SHOW : CMD_HIDE](m[i], true);\n }\n }\n\n var _collapseConnection = this.collapseConnection = function(c, index, group) {\n\n var proxyEp, groupEl = group.getEl(), groupElId = _jsPlumb.getId(groupEl),\n originalElementId = c.endpoints[index].elementId;\n\n var otherEl = c.endpoints[index === 0 ? 1 : 0].element;\n if (otherEl[GROUP] && (!otherEl[GROUP].shouldProxy() && otherEl[GROUP].collapsed)) {\n return;\n }\n\n c.proxies = c.proxies || [];\n if(c.proxies[index]) {\n proxyEp = c.proxies[index].ep;\n }else {\n proxyEp = _jsPlumb.addEndpoint(groupEl, {\n endpoint:group.getEndpoint(c, index),\n anchor:group.getAnchor(c, index),\n parameters:{\n isProxyEndpoint:true\n }\n });\n }\n proxyEp.setDeleteOnEmpty(true);\n\n // for this index, stash proxy info: the new EP, the original EP.\n c.proxies[index] = { ep:proxyEp, originalEp: c.endpoints[index] };\n\n // and advise the anchor manager\n if (index === 0) {\n // TODO why are there two differently named methods? Why is there not one method that says \"some end of this\n // connection changed (you give the index), and here's the new element and element id.\"\n _jsPlumb.anchorManager.sourceChanged(originalElementId, groupElId, c, groupEl);\n }\n else {\n _jsPlumb.anchorManager.updateOtherEndpoint(c.endpoints[0].elementId, originalElementId, groupElId, c);\n c.target = groupEl;\n c.targetId = groupElId;\n }\n\n\n // detach the original EP from the connection.\n c.proxies[index].originalEp.detachFromConnection(c, null, true);\n\n // set the proxy as the new ep\n proxyEp.connections = [ c ];\n c.endpoints[index] = proxyEp;\n\n c.setVisible(true);\n };\n\n this.collapseGroup = function(group) {\n group = this.getGroup(group);\n if (group == null || group.collapsed) {\n return;\n }\n var groupEl = group.getEl();\n\n // todo remove old proxy endpoints first, just in case?\n //group.proxies.length = 0;\n\n // hide all connections\n _setVisible(group, false);\n\n if (group.shouldProxy()) {\n // collapses all connections in a group.\n var _collapseSet = function (conns, index) {\n for (var i = 0; i < conns.length; i++) {\n var c = conns[i];\n _collapseConnection(c, index, group);\n }\n };\n\n // setup proxies for sources and targets\n _collapseSet(group.connections.source, 0);\n _collapseSet(group.connections.target, 1);\n }\n\n group.collapsed = true;\n _jsPlumb.removeClass(groupEl, GROUP_EXPANDED_CLASS);\n _jsPlumb.addClass(groupEl, GROUP_COLLAPSED_CLASS);\n _jsPlumb.revalidate(groupEl);\n _jsPlumb.fire(EVT_COLLAPSE, { group:group });\n };\n\n var _expandConnection = this.expandConnection = function(c, index, group) {\n\n // if no proxies or none for this end of the connection, abort.\n if (c.proxies == null || c.proxies[index] == null) {\n return;\n }\n\n var groupElId = _jsPlumb.getId(group.getEl()),\n originalElement = c.proxies[index].originalEp.element,\n originalElementId = c.proxies[index].originalEp.elementId;\n\n c.endpoints[index] = c.proxies[index].originalEp;\n // and advise the anchor manager\n if (index === 0) {\n // TODO why are there two differently named methods? Why is there not one method that says \"some end of this\n // connection changed (you give the index), and here's the new element and element id.\"\n _jsPlumb.anchorManager.sourceChanged(groupElId, originalElementId, c, originalElement);\n }\n else {\n _jsPlumb.anchorManager.updateOtherEndpoint(c.endpoints[0].elementId, groupElId, originalElementId, c);\n c.target = originalElement;\n c.targetId = originalElementId;\n }\n\n // detach the proxy EP from the connection (which will cause it to be removed as we no longer need it)\n c.proxies[index].ep.detachFromConnection(c, null);\n\n c.proxies[index].originalEp.addConnection(c);\n\n // cleanup\n delete c.proxies[index];\n };\n\n this.expandGroup = function(group, doNotFireEvent) {\n\n group = this.getGroup(group);\n\n if (group == null || !group.collapsed) {\n return;\n }\n var groupEl = group.getEl();\n\n _setVisible(group, true);\n\n if (group.shouldProxy()) {\n // collapses all connections in a group.\n var _expandSet = function (conns, index) {\n for (var i = 0; i < conns.length; i++) {\n var c = conns[i];\n _expandConnection(c, index, group);\n }\n };\n\n // setup proxies for sources and targets\n _expandSet(group.connections.source, 0);\n _expandSet(group.connections.target, 1);\n }\n\n group.collapsed = false;\n _jsPlumb.addClass(groupEl, GROUP_EXPANDED_CLASS);\n _jsPlumb.removeClass(groupEl, GROUP_COLLAPSED_CLASS);\n _jsPlumb.revalidate(groupEl);\n this.repaintGroup(group);\n if (!doNotFireEvent) {\n _jsPlumb.fire(EVT_EXPAND, { group: group});\n }\n };\n\n this.repaintGroup = function(group) {\n group = this.getGroup(group);\n var m = group.getMembers();\n for (var i = 0; i < m.length; i++) {\n _jsPlumb.revalidate(m[i]);\n }\n };\n\n // TODO refactor this with the code that responds to `connection` events.\n function _updateConnectionsForGroup(group) {\n var members = group.getMembers();\n var c1 = _jsPlumb.getConnections({source:members, scope:\"*\"}, true);\n var c2 = _jsPlumb.getConnections({target:members, scope:\"*\"}, true);\n var processed = {};\n group.connections.source.length = 0;\n group.connections.target.length = 0;\n var oneSet = function(c) {\n for (var i = 0; i < c.length; i++) {\n if (processed[c[i].id]) {\n continue;\n }\n processed[c[i].id] = true;\n if (c[i].source._jsPlumbGroup === group) {\n if (c[i].target._jsPlumbGroup !== group) {\n group.connections.source.push(c[i]);\n }\n _connectionSourceMap[c[i].id] = group;\n }\n else if (c[i].target._jsPlumbGroup === group) {\n group.connections.target.push(c[i]);\n _connectionTargetMap[c[i].id] = group;\n }\n }\n };\n oneSet(c1); oneSet(c2);\n }\n\n this.updateConnectionsForGroup = _updateConnectionsForGroup;\n this.refreshAllGroups = function() {\n for (var g in _managedGroups) {\n _updateConnectionsForGroup(_managedGroups[g]);\n _jsPlumb.dragManager.updateOffsets(_jsPlumb.getId(_managedGroups[g].getEl()));\n }\n };\n };\n\n /**\n *\n * @param {jsPlumbInstance} _jsPlumb Associated jsPlumb instance.\n * @param {Object} params\n * @param {Element} params.el The DOM element representing the Group.\n * @param {String} [params.id] Optional ID for the Group. A UUID will be assigned as the Group's ID if you do not provide one.\n * @param {Boolean} [params.constrain=false] If true, child elements will not be able to be dragged outside of the Group container.\n * @param {Boolean} [params.revert=true] By default, child elements revert to the container if dragged outside. You can change this by setting `revert:false`. This behaviour is also overridden if you set `orphan` or `prune`.\n * @param {Boolean} [params.orphan=false] If true, child elements dropped outside of the Group container will be removed from the Group (but not from the DOM).\n * @param {Boolean} [params.prune=false] If true, child elements dropped outside of the Group container will be removed from the Group and also from the DOM.\n * @param {Boolean} [params.dropOverride=false] If true, a child element that has been dropped onto some other Group will not be subject to the controls imposed by `prune`, `revert` or `orphan`.\n * @constructor\n */\n var Group = function(_jsPlumb, params) {\n var self = this;\n var el = params.el;\n this.getEl = function() { return el; };\n this.id = params.id || _ju.uuid();\n el._isJsPlumbGroup = true;\n\n var getDragArea = this.getDragArea = function() {\n var da = _jsPlumb.getSelector(el, GROUP_CONTAINER_SELECTOR);\n return da && da.length > 0 ? da[0] : el;\n };\n\n var ghost = params.ghost === true;\n var constrain = ghost || (params.constrain === true);\n var revert = params.revert !== false;\n var orphan = params.orphan === true;\n var prune = params.prune === true;\n var dropOverride = params.dropOverride === true;\n var proxied = params.proxied !== false;\n var elements = [];\n this.connections = { source:[], target:[], internal:[] };\n\n // this function, and getEndpoint below, are stubs for a future setup in which we can choose endpoint\n // and anchor based upon the connection and the index (source/target) of the endpoint to be proxied.\n this.getAnchor = function(conn, endpointIndex) {\n return params.anchor || \"Continuous\";\n };\n\n this.getEndpoint = function(conn, endpointIndex) {\n return params.endpoint || [ \"Dot\", { radius:10 }];\n };\n\n this.collapsed = false;\n if (params.draggable !== false) {\n var opts = {\n stop:function(params) {\n _jsPlumb.fire(EVT_GROUP_DRAG_STOP, jsPlumb.extend(params, {group:self}));\n },\n scope:GROUP_DRAG_SCOPE\n };\n if (params.dragOptions) {\n root.jsPlumb.extend(opts, params.dragOptions);\n }\n _jsPlumb.draggable(params.el, opts);\n }\n if (params.droppable !== false) {\n _jsPlumb.droppable(params.el, {\n drop:function(p) {\n var el = p.drag.el;\n if (el._isJsPlumbGroup) {\n return;\n }\n var currentGroup = el._jsPlumbGroup;\n if (currentGroup !== self) {\n if (currentGroup != null) {\n if (currentGroup.overrideDrop(el, self)) {\n return;\n }\n }\n _jsPlumb.getGroupManager().addToGroup(self, el, false);\n }\n\n }\n });\n }\n var _each = function(_el, fn) {\n var els = _el.nodeType == null ? _el : [ _el ];\n for (var i = 0; i < els.length; i++) {\n fn(els[i]);\n }\n };\n\n this.overrideDrop = function(_el, targetGroup) {\n return dropOverride && (revert || prune || orphan);\n };\n\n this.add = function(_el, doNotFireEvent/*, sourceGroup*/) {\n var dragArea = getDragArea();\n _each(_el, function(__el) {\n\n if (__el._jsPlumbGroup != null) {\n if (__el._jsPlumbGroup === self) {\n return;\n } else {\n __el._jsPlumbGroup.remove(__el, true, doNotFireEvent, false);\n }\n }\n\n __el._jsPlumbGroup = self;\n elements.push(__el);\n // test if draggable and add handlers if so.\n if (_jsPlumb.isAlreadyDraggable(__el)) {\n _bindDragHandlers(__el);\n }\n\n if (__el.parentNode !== dragArea) {\n dragArea.appendChild(__el);\n }\n\n // if (!doNotFireEvent) {\n // var p = {group: self, el: __el};\n // if (sourceGroup) {\n // p.sourceGroup = sourceGroup;\n // }\n // //_jsPlumb.fire(EVT_CHILD_ADDED, p);\n // }\n });\n\n _jsPlumb.getGroupManager().updateConnectionsForGroup(self);\n };\n\n this.remove = function(el, manipulateDOM, doNotFireEvent, doNotUpdateConnections, targetGroup) {\n\n _each(el, function(__el) {\n delete __el._jsPlumbGroup;\n _ju.removeWithFunction(elements, function(e) {\n return e === __el;\n });\n\n if (manipulateDOM) {\n try { self.getDragArea().removeChild(__el); }\n catch (e) {\n jsPlumbUtil.log(\"Could not remove element from Group \" + e);\n }\n }\n _unbindDragHandlers(__el);\n if (!doNotFireEvent) {\n var p = {group: self, el: __el};\n if (targetGroup) {\n p.targetGroup = targetGroup;\n }\n _jsPlumb.fire(EVT_CHILD_REMOVED, p);\n }\n });\n if (!doNotUpdateConnections) {\n _jsPlumb.getGroupManager().updateConnectionsForGroup(self);\n }\n };\n this.removeAll = function(manipulateDOM, doNotFireEvent) {\n for (var i = 0, l = elements.length; i < l; i++) {\n var el = elements[0];\n self.remove(el, manipulateDOM, doNotFireEvent, true);\n _jsPlumb.remove(el, true);\n }\n elements.length = 0;\n _jsPlumb.getGroupManager().updateConnectionsForGroup(self);\n };\n this.orphanAll = function() {\n var orphanedPositions = {};\n for (var i = 0; i < elements.length; i++) {\n var newPosition = _orphan(elements[i]);\n orphanedPositions[newPosition[0]] = newPosition[1];\n }\n elements.length = 0;\n\n return orphanedPositions;\n };\n this.getMembers = function() { return elements; };\n\n el[GROUP] = this;\n\n _jsPlumb.bind(ELEMENT_DRAGGABLE_EVENT, function(dragParams) {\n // if its for the current group,\n if (dragParams.el._jsPlumbGroup === this) {\n _bindDragHandlers(dragParams.el);\n }\n }.bind(this));\n\n function _findParent(_el) {\n return _el.offsetParent;\n }\n\n function _isInsideParent(_el, pos) {\n var p = _findParent(_el),\n s = _jsPlumb.getSize(p),\n ss = _jsPlumb.getSize(_el),\n leftEdge = pos[0],\n rightEdge = leftEdge + ss[0],\n topEdge = pos[1],\n bottomEdge = topEdge + ss[1];\n\n return rightEdge > 0 && leftEdge < s[0] && bottomEdge > 0 && topEdge < s[1];\n }\n\n //\n // orphaning an element means taking it out of the group and adding it to the main jsplumb container.\n // we return the new calculated position from this method and the element's id.\n //\n function _orphan(_el) {\n var id = _jsPlumb.getId(_el);\n var pos = _jsPlumb.getOffset(_el);\n _el.parentNode.removeChild(_el);\n _jsPlumb.getContainer().appendChild(_el);\n _jsPlumb.setPosition(_el, pos);\n delete _el._jsPlumbGroup;\n _unbindDragHandlers(_el);\n _jsPlumb.dragManager.clearParent(_el, id);\n return [id, pos];\n }\n\n //\n // remove an element from the group, then either prune it from the jsplumb instance, or just orphan it.\n //\n function _pruneOrOrphan(p) {\n var orphanedPosition = null;\n if (!_isInsideParent(p.el, p.pos)) {\n var group = p.el._jsPlumbGroup;\n if (prune) {\n _jsPlumb.remove(p.el);\n } else {\n orphanedPosition = _orphan(p.el);\n }\n\n group.remove(p.el);\n }\n\n return orphanedPosition;\n }\n\n //\n // redraws the element\n //\n function _revalidate(_el) {\n var id = _jsPlumb.getId(_el);\n _jsPlumb.revalidate(_el);\n _jsPlumb.dragManager.revalidateParent(_el, id);\n }\n\n //\n // unbind the group specific drag/revert handlers.\n //\n function _unbindDragHandlers(_el) {\n if (!_el._katavorioDrag) {\n return;\n }\n if (prune || orphan) {\n _el._katavorioDrag.off(STOP, _pruneOrOrphan);\n }\n if (!prune && !orphan && revert) {\n _el._katavorioDrag.off(REVERT, _revalidate);\n _el._katavorioDrag.setRevert(null);\n }\n }\n\n function _bindDragHandlers(_el) {\n if (!_el._katavorioDrag) {\n return;\n }\n if (prune || orphan) {\n _el._katavorioDrag.on(STOP, _pruneOrOrphan);\n }\n\n if (constrain) {\n _el._katavorioDrag.setConstrain(true);\n }\n\n if (ghost) {\n _el._katavorioDrag.setUseGhostProxy(true);\n }\n\n if (!prune && !orphan && revert) {\n _el._katavorioDrag.on(REVERT, _revalidate);\n _el._katavorioDrag.setRevert(function(__el, pos) {\n return !_isInsideParent(__el, pos);\n });\n }\n }\n\n this.shouldProxy = function() {\n return proxied;\n };\n\n _jsPlumb.getGroupManager().addGroup(this);\n };\n\n /**\n * Adds a group to the jsPlumb instance.\n * @method addGroup\n * @param {Object} params\n * @return {Group} The newly created Group.\n */\n _jpi.prototype.addGroup = function(params) {\n var j = this;\n j._groups = j._groups || {};\n if (j._groups[params.id] != null) {\n throw new TypeError(\"cannot create Group [\" + params.id + \"]; a Group with that ID exists\");\n }\n if (params.el[GROUP] != null) {\n throw new TypeError(\"cannot create Group [\" + params.id + \"]; the given element is already a Group\");\n }\n var group = new Group(j, params);\n j._groups[group.id] = group;\n if (params.collapsed) {\n this.collapseGroup(group);\n }\n return group;\n };\n\n /**\n * Add an element to a group.\n * @method addToGroup\n * @param {String} group Group, or ID of the group, to add the element to.\n * @param {Element} el Element to add to the group.\n */\n _jpi.prototype.addToGroup = function(group, el, doNotFireEvent) {\n\n var _one = function(_el) {\n var id = this.getId(_el);\n this.manage(id, _el);\n this.getGroupManager().addToGroup(group, _el, doNotFireEvent);\n }.bind(this);\n\n if (Array.isArray(el)) {\n for (var i = 0; i < el.length; i++) {\n _one(el[i]);\n }\n } else {\n _one(el);\n }\n };\n\n /**\n * Remove an element from a group.\n * @method removeFromGroup\n * @param {String} group Group, or ID of the group, to remove the element from.\n * @param {Element} el Element to add to the group.\n */\n _jpi.prototype.removeFromGroup = function(group, el, doNotFireEvent) {\n this.getGroupManager().removeFromGroup(group, el, doNotFireEvent);\n };\n\n /**\n * Remove a group, and optionally remove its members from the jsPlumb instance.\n * @method removeGroup\n * @param {String|Group} group Group to delete, or ID of Group to delete.\n * @param {Boolean} [deleteMembers=false] If true, group members will be removed along with the group. Otherwise they will\n * just be 'orphaned' (returned to the main container).\n * @returns {Map[String, Position}} When deleteMembers is false, this method returns a map of {id->position}\n */\n _jpi.prototype.removeGroup = function(group, deleteMembers, manipulateDOM, doNotFireEvent) {\n return this.getGroupManager().removeGroup(group, deleteMembers, manipulateDOM, doNotFireEvent);\n };\n\n /**\n * Remove all groups, and optionally remove their members from the jsPlumb instance.\n * @method removeAllGroup\n * @param {Boolean} [deleteMembers=false] If true, group members will be removed along with the groups. Otherwise they will\n * just be 'orphaned' (returned to the main container).\n */\n _jpi.prototype.removeAllGroups = function(deleteMembers, manipulateDOM, doNotFireEvent) {\n this.getGroupManager().removeAllGroups(deleteMembers, manipulateDOM, doNotFireEvent);\n };\n\n /**\n * Get a Group\n * @method getGroup\n * @param {String} groupId ID of the group to get\n * @return {Group} Group with the given ID, null if not found.\n */\n _jpi.prototype.getGroup = function(groupId) {\n return this.getGroupManager().getGroup(groupId);\n };\n\n /**\n * Gets all the Groups managed by the jsPlumb instance.\n * @returns {Group[]} List of Groups. Empty if none.\n */\n _jpi.prototype.getGroups = function() {\n return this.getGroupManager().getGroups();\n };\n\n /**\n * Expands a group element. jsPlumb doesn't do \"everything\" for you here, because what it means to expand a Group\n * will vary from application to application. jsPlumb does these things:\n *\n * - Hides any connections that are internal to the group (connections between members, and connections from member of\n * the group to the group itself)\n * - Proxies all connections for which the source or target is a member of the group.\n * - Hides the proxied connections.\n * - Adds the jtk-group-expanded class to the group's element\n * - Removes the jtk-group-collapsed class from the group's element.\n *\n * @method expandGroup\n * @param {String|Group} group Group to expand, or ID of Group to expand.\n */\n _jpi.prototype.expandGroup = function(group) {\n this.getGroupManager().expandGroup(group);\n };\n\n /**\n * Collapses a group element. jsPlumb doesn't do \"everything\" for you here, because what it means to collapse a Group\n * will vary from application to application. jsPlumb does these things:\n *\n * - Shows any connections that are internal to the group (connections between members, and connections from member of\n * the group to the group itself)\n * - Removes proxies for all connections for which the source or target is a member of the group.\n * - Shows the previously proxied connections.\n * - Adds the jtk-group-collapsed class to the group's element\n * - Removes the jtk-group-expanded class from the group's element.\n *\n * @method expandGroup\n * @param {String|Group} group Group to expand, or ID of Group to expand.\n */\n _jpi.prototype.collapseGroup = function(groupId) {\n this.getGroupManager().collapseGroup(groupId);\n };\n\n\n _jpi.prototype.repaintGroup = function(group) {\n this.getGroupManager().repaintGroup(group);\n };\n\n /**\n * Collapses or expands a group element depending on its current state. See notes in the collapseGroup and expandGroup method.\n *\n * @method toggleGroup\n * @param {String|Group} group Group to expand/collapse, or ID of Group to expand/collapse.\n */\n _jpi.prototype.toggleGroup = function(group) {\n group = this.getGroupManager().getGroup(group);\n if (group != null) {\n this.getGroupManager()[group.collapsed ? \"expandGroup\" : \"collapseGroup\"](group);\n }\n };\n\n //\n // lazy init a group manager for the given jsplumb instance.\n //\n _jpi.prototype.getGroupManager = function() {\n var mgr = this[GROUP_MANAGER];\n if (mgr == null) {\n mgr = this[GROUP_MANAGER] = new GroupManager(this);\n }\n return mgr;\n };\n\n _jpi.prototype.removeGroupManager = function() {\n delete this[GROUP_MANAGER];\n };\n\n /**\n * Gets the Group that the given element belongs to, null if none.\n * @method getGroupFor\n * @param {String|Element} el Element, or element ID.\n * @returns {Group} A Group, if found, or null.\n */\n _jpi.prototype.getGroupFor = function(el) {\n el = this.getElement(el);\n if (el) {\n return el[GROUP];\n }\n };\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n\n/*\n * This file contains the 'flowchart' connectors, consisting of vertical and horizontal line segments.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n var STRAIGHT = \"Straight\";\n var ARC = \"Arc\";\n\n var Flowchart = function (params) {\n this.type = \"Flowchart\";\n params = params || {};\n params.stub = params.stub == null ? 30 : params.stub;\n var segments,\n _super = _jp.Connectors.AbstractConnector.apply(this, arguments),\n midpoint = params.midpoint == null ? 0.5 : params.midpoint,\n alwaysRespectStubs = params.alwaysRespectStubs === true,\n lastx = null, lasty = null, lastOrientation,\n cornerRadius = params.cornerRadius != null ? params.cornerRadius : 0,\n\n // TODO now common between this and AbstractBezierEditor; refactor into superclass?\n loopbackRadius = params.loopbackRadius || 25,\n isLoopbackCurrently = false,\n\n sgn = function (n) {\n return n < 0 ? -1 : n === 0 ? 0 : 1;\n },\n segmentDirections = function(segment) {\n return [\n sgn( segment[2] - segment[0] ),\n sgn( segment[3] - segment[1] )\n ];\n },\n /**\n * helper method to add a segment.\n */\n addSegment = function (segments, x, y, paintInfo) {\n if (lastx === x && lasty === y) {\n return;\n }\n var lx = lastx == null ? paintInfo.sx : lastx,\n ly = lasty == null ? paintInfo.sy : lasty,\n o = lx === x ? \"v\" : \"h\";\n\n lastx = x;\n lasty = y;\n segments.push([ lx, ly, x, y, o ]);\n },\n segLength = function (s) {\n return Math.sqrt(Math.pow(s[0] - s[2], 2) + Math.pow(s[1] - s[3], 2));\n },\n _cloneArray = function (a) {\n var _a = [];\n _a.push.apply(_a, a);\n return _a;\n },\n writeSegments = function (conn, segments, paintInfo) {\n var current = null, next, currentDirection, nextDirection;\n for (var i = 0; i < segments.length - 1; i++) {\n\n current = current || _cloneArray(segments[i]);\n next = _cloneArray(segments[i + 1]);\n\n currentDirection = segmentDirections(current);\n nextDirection = segmentDirections(next);\n\n if (cornerRadius > 0 && current[4] !== next[4]) {\n\n var minSegLength = Math.min(segLength(current), segLength(next));\n var radiusToUse = Math.min(cornerRadius, minSegLength / 2);\n\n current[2] -= currentDirection[0] * radiusToUse;\n current[3] -= currentDirection[1] * radiusToUse;\n next[0] += nextDirection[0] * radiusToUse;\n next[1] += nextDirection[1] * radiusToUse;\n\n var ac = (currentDirection[1] === nextDirection[0] && nextDirection[0] === 1) ||\n ((currentDirection[1] === nextDirection[0] && nextDirection[0] === 0) && currentDirection[0] !== nextDirection[1]) ||\n (currentDirection[1] === nextDirection[0] && nextDirection[0] === -1),\n sgny = next[1] > current[3] ? 1 : -1,\n sgnx = next[0] > current[2] ? 1 : -1,\n sgnEqual = sgny === sgnx,\n cx = (sgnEqual && ac || (!sgnEqual && !ac)) ? next[0] : current[2],\n cy = (sgnEqual && ac || (!sgnEqual && !ac)) ? current[3] : next[1];\n\n _super.addSegment(conn, STRAIGHT, {\n x1: current[0], y1: current[1], x2: current[2], y2: current[3]\n });\n\n _super.addSegment(conn, ARC, {\n r: radiusToUse,\n x1: current[2],\n y1: current[3],\n x2: next[0],\n y2: next[1],\n cx: cx,\n cy: cy,\n ac: ac\n });\n }\n else {\n // dx + dy are used to adjust for line width.\n var dx = (current[2] === current[0]) ? 0 : (current[2] > current[0]) ? (paintInfo.lw / 2) : -(paintInfo.lw / 2),\n dy = (current[3] === current[1]) ? 0 : (current[3] > current[1]) ? (paintInfo.lw / 2) : -(paintInfo.lw / 2);\n\n _super.addSegment(conn, STRAIGHT, {\n x1: current[0] - dx, y1: current[1] - dy, x2: current[2] + dx, y2: current[3] + dy\n });\n }\n current = next;\n }\n if (next != null) {\n // last segment\n _super.addSegment(conn, STRAIGHT, {\n x1: next[0], y1: next[1], x2: next[2], y2: next[3]\n });\n }\n };\n\n this._compute = function (paintInfo, params) {\n\n segments = [];\n lastx = null;\n lasty = null;\n lastOrientation = null;\n\n var commonStubCalculator = function () {\n return [paintInfo.startStubX, paintInfo.startStubY, paintInfo.endStubX, paintInfo.endStubY];\n },\n stubCalculators = {\n perpendicular: commonStubCalculator,\n orthogonal: commonStubCalculator,\n opposite: function (axis) {\n var pi = paintInfo,\n idx = axis === \"x\" ? 0 : 1,\n areInProximity = {\n \"x\": function () {\n return ( (pi.so[idx] === 1 && (\n ( (pi.startStubX > pi.endStubX) && (pi.tx > pi.startStubX) ) ||\n ( (pi.sx > pi.endStubX) && (pi.tx > pi.sx))))) ||\n\n ( (pi.so[idx] === -1 && (\n ( (pi.startStubX < pi.endStubX) && (pi.tx < pi.startStubX) ) ||\n ( (pi.sx < pi.endStubX) && (pi.tx < pi.sx)))));\n },\n \"y\": function () {\n return ( (pi.so[idx] === 1 && (\n ( (pi.startStubY > pi.endStubY) && (pi.ty > pi.startStubY) ) ||\n ( (pi.sy > pi.endStubY) && (pi.ty > pi.sy))))) ||\n\n ( (pi.so[idx] === -1 && (\n ( (pi.startStubY < pi.endStubY) && (pi.ty < pi.startStubY) ) ||\n ( (pi.sy < pi.endStubY) && (pi.ty < pi.sy)))));\n }\n };\n\n if (!alwaysRespectStubs && areInProximity[axis]()) {\n return {\n \"x\": [(paintInfo.sx + paintInfo.tx) / 2, paintInfo.startStubY, (paintInfo.sx + paintInfo.tx) / 2, paintInfo.endStubY],\n \"y\": [paintInfo.startStubX, (paintInfo.sy + paintInfo.ty) / 2, paintInfo.endStubX, (paintInfo.sy + paintInfo.ty) / 2]\n }[axis];\n }\n else {\n return [paintInfo.startStubX, paintInfo.startStubY, paintInfo.endStubX, paintInfo.endStubY];\n }\n }\n };\n\n // calculate Stubs.\n var stubs = stubCalculators[paintInfo.anchorOrientation](paintInfo.sourceAxis),\n idx = paintInfo.sourceAxis === \"x\" ? 0 : 1,\n oidx = paintInfo.sourceAxis === \"x\" ? 1 : 0,\n ss = stubs[idx],\n oss = stubs[oidx],\n es = stubs[idx + 2],\n oes = stubs[oidx + 2];\n\n // add the start stub segment. use stubs for loopback as it will look better, with the loop spaced\n // away from the element.\n addSegment(segments, stubs[0], stubs[1], paintInfo);\n\n // if its a loopback and we should treat it differently.\n // if (false && params.sourcePos[0] === params.targetPos[0] && params.sourcePos[1] === params.targetPos[1]) {\n //\n // // we use loopbackRadius here, as statemachine connectors do.\n // // so we go radius to the left from stubs[0], then upwards by 2*radius, to the right by 2*radius,\n // // down by 2*radius, left by radius.\n // addSegment(segments, stubs[0] - loopbackRadius, stubs[1], paintInfo);\n // addSegment(segments, stubs[0] - loopbackRadius, stubs[1] - (2 * loopbackRadius), paintInfo);\n // addSegment(segments, stubs[0] + loopbackRadius, stubs[1] - (2 * loopbackRadius), paintInfo);\n // addSegment(segments, stubs[0] + loopbackRadius, stubs[1], paintInfo);\n // addSegment(segments, stubs[0], stubs[1], paintInfo);\n //\n // }\n // else {\n\n\n var midx = paintInfo.startStubX + ((paintInfo.endStubX - paintInfo.startStubX) * midpoint),\n midy = paintInfo.startStubY + ((paintInfo.endStubY - paintInfo.startStubY) * midpoint);\n\n var orientations = {x: [0, 1], y: [1, 0]},\n lineCalculators = {\n perpendicular: function (axis) {\n var pi = paintInfo,\n sis = {\n x: [\n [[1, 2, 3, 4], null, [2, 1, 4, 3]],\n null,\n [[4, 3, 2, 1], null, [3, 4, 1, 2]]\n ],\n y: [\n [[3, 2, 1, 4], null, [2, 3, 4, 1]],\n null,\n [[4, 1, 2, 3], null, [1, 4, 3, 2]]\n ]\n },\n stubs = {\n x: [[pi.startStubX, pi.endStubX], null, [pi.endStubX, pi.startStubX]],\n y: [[pi.startStubY, pi.endStubY], null, [pi.endStubY, pi.startStubY]]\n },\n midLines = {\n x: [[midx, pi.startStubY], [midx, pi.endStubY]],\n y: [[pi.startStubX, midy], [pi.endStubX, midy]]\n },\n linesToEnd = {\n x: [[pi.endStubX, pi.startStubY]],\n y: [[pi.startStubX, pi.endStubY]]\n },\n startToEnd = {\n x: [[pi.startStubX, pi.endStubY], [pi.endStubX, pi.endStubY]],\n y: [[pi.endStubX, pi.startStubY], [pi.endStubX, pi.endStubY]]\n },\n startToMidToEnd = {\n x: [[pi.startStubX, midy], [pi.endStubX, midy], [pi.endStubX, pi.endStubY]],\n y: [[midx, pi.startStubY], [midx, pi.endStubY], [pi.endStubX, pi.endStubY]]\n },\n otherStubs = {\n x: [pi.startStubY, pi.endStubY],\n y: [pi.startStubX, pi.endStubX]\n },\n soIdx = orientations[axis][0], toIdx = orientations[axis][1],\n _so = pi.so[soIdx] + 1,\n _to = pi.to[toIdx] + 1,\n otherFlipped = (pi.to[toIdx] === -1 && (otherStubs[axis][1] < otherStubs[axis][0])) || (pi.to[toIdx] === 1 && (otherStubs[axis][1] > otherStubs[axis][0])),\n stub1 = stubs[axis][_so][0],\n stub2 = stubs[axis][_so][1],\n segmentIndexes = sis[axis][_so][_to];\n\n if (pi.segment === segmentIndexes[3] || (pi.segment === segmentIndexes[2] && otherFlipped)) {\n return midLines[axis];\n }\n else if (pi.segment === segmentIndexes[2] && stub2 < stub1) {\n return linesToEnd[axis];\n }\n else if ((pi.segment === segmentIndexes[2] && stub2 >= stub1) || (pi.segment === segmentIndexes[1] && !otherFlipped)) {\n return startToMidToEnd[axis];\n }\n else if (pi.segment === segmentIndexes[0] || (pi.segment === segmentIndexes[1] && otherFlipped)) {\n return startToEnd[axis];\n }\n },\n orthogonal: function (axis, startStub, otherStartStub, endStub, otherEndStub) {\n var pi = paintInfo,\n extent = {\n \"x\": pi.so[0] === -1 ? Math.min(startStub, endStub) : Math.max(startStub, endStub),\n \"y\": pi.so[1] === -1 ? Math.min(startStub, endStub) : Math.max(startStub, endStub)\n }[axis];\n\n return {\n \"x\": [\n [extent, otherStartStub],\n [extent, otherEndStub],\n [endStub, otherEndStub]\n ],\n \"y\": [\n [otherStartStub, extent],\n [otherEndStub, extent],\n [otherEndStub, endStub]\n ]\n }[axis];\n },\n opposite: function (axis, ss, oss, es) {\n var pi = paintInfo,\n otherAxis = {\"x\": \"y\", \"y\": \"x\"}[axis],\n dim = {\"x\": \"height\", \"y\": \"width\"}[axis],\n comparator = pi[\"is\" + axis.toUpperCase() + \"GreaterThanStubTimes2\"];\n\n if (params.sourceEndpoint.elementId === params.targetEndpoint.elementId) {\n var _val = oss + ((1 - params.sourceEndpoint.anchor[otherAxis]) * params.sourceInfo[dim]) + _super.maxStub;\n return {\n \"x\": [\n [ss, _val],\n [es, _val]\n ],\n \"y\": [\n [_val, ss],\n [_val, es]\n ]\n }[axis];\n\n }\n else if (!comparator || (pi.so[idx] === 1 && ss > es) || (pi.so[idx] === -1 && ss < es)) {\n return {\n \"x\": [\n [ss, midy],\n [es, midy]\n ],\n \"y\": [\n [midx, ss],\n [midx, es]\n ]\n }[axis];\n }\n else if ((pi.so[idx] === 1 && ss < es) || (pi.so[idx] === -1 && ss > es)) {\n return {\n \"x\": [\n [midx, pi.sy],\n [midx, pi.ty]\n ],\n \"y\": [\n [pi.sx, midy],\n [pi.tx, midy]\n ]\n }[axis];\n }\n }\n };\n\n // compute the rest of the line\n var p = lineCalculators[paintInfo.anchorOrientation](paintInfo.sourceAxis, ss, oss, es, oes);\n if (p) {\n for (var i = 0; i < p.length; i++) {\n addSegment(segments, p[i][0], p[i][1], paintInfo);\n }\n }\n\n // line to end stub\n addSegment(segments, stubs[2], stubs[3], paintInfo);\n\n //}\n\n // end stub to end (common)\n addSegment(segments, paintInfo.tx, paintInfo.ty, paintInfo);\n\n\n\n // write out the segments.\n writeSegments(this, segments, paintInfo);\n\n };\n };\n\n _jp.Connectors.Flowchart = Flowchart;\n _ju.extend(_jp.Connectors.Flowchart, _jp.Connectors.AbstractConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the code for the Bezier connector type.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n _jp.Connectors.AbstractBezierConnector = function(params) {\n params = params || {};\n var showLoopback = params.showLoopback !== false,\n curviness = params.curviness || 10,\n margin = params.margin || 5,\n proximityLimit = params.proximityLimit || 80,\n clockwise = params.orientation && params.orientation === \"clockwise\",\n loopbackRadius = params.loopbackRadius || 25,\n isLoopbackCurrently = false,\n _super;\n\n this._compute = function (paintInfo, p) {\n\n var sp = p.sourcePos,\n tp = p.targetPos,\n _w = Math.abs(sp[0] - tp[0]),\n _h = Math.abs(sp[1] - tp[1]);\n\n if (!showLoopback || (p.sourceEndpoint.elementId !== p.targetEndpoint.elementId)) {\n isLoopbackCurrently = false;\n this._computeBezier(paintInfo, p, sp, tp, _w, _h);\n } else {\n isLoopbackCurrently = true;\n // a loopback connector. draw an arc from one anchor to the other.\n var x1 = p.sourcePos[0], y1 = p.sourcePos[1] - margin,\n cx = x1, cy = y1 - loopbackRadius,\n // canvas sizing stuff, to ensure the whole painted area is visible.\n _x = cx - loopbackRadius,\n _y = cy - loopbackRadius;\n\n _w = 2 * loopbackRadius;\n _h = 2 * loopbackRadius;\n\n paintInfo.points[0] = _x;\n paintInfo.points[1] = _y;\n paintInfo.points[2] = _w;\n paintInfo.points[3] = _h;\n\n // ADD AN ARC SEGMENT.\n _super.addSegment(this, \"Arc\", {\n loopback: true,\n x1: (x1 - _x) + 4,\n y1: y1 - _y,\n startAngle: 0,\n endAngle: 2 * Math.PI,\n r: loopbackRadius,\n ac: !clockwise,\n x2: (x1 - _x) - 4,\n y2: y1 - _y,\n cx: cx - _x,\n cy: cy - _y\n });\n }\n };\n\n _super = _jp.Connectors.AbstractConnector.apply(this, arguments);\n return _super;\n };\n _ju.extend(_jp.Connectors.AbstractBezierConnector, _jp.Connectors.AbstractConnector);\n\n var Bezier = function (params) {\n params = params || {};\n this.type = \"Bezier\";\n\n var _super = _jp.Connectors.AbstractBezierConnector.apply(this, arguments),\n majorAnchor = params.curviness || 150,\n minorAnchor = 10;\n\n this.getCurviness = function () {\n return majorAnchor;\n };\n\n this._findControlPoint = function (point, sourceAnchorPosition, targetAnchorPosition, sourceEndpoint, targetEndpoint, soo, too) {\n // determine if the two anchors are perpendicular to each other in their orientation. we swap the control\n // points around if so (code could be tightened up)\n var perpendicular = soo[0] !== too[0] || soo[1] === too[1],\n p = [];\n\n if (!perpendicular) {\n if (soo[0] === 0) {\n p.push(sourceAnchorPosition[0] < targetAnchorPosition[0] ? point[0] + minorAnchor : point[0] - minorAnchor);\n }\n else {\n p.push(point[0] - (majorAnchor * soo[0]));\n }\n\n if (soo[1] === 0) {\n p.push(sourceAnchorPosition[1] < targetAnchorPosition[1] ? point[1] + minorAnchor : point[1] - minorAnchor);\n }\n else {\n p.push(point[1] + (majorAnchor * too[1]));\n }\n }\n else {\n if (too[0] === 0) {\n p.push(targetAnchorPosition[0] < sourceAnchorPosition[0] ? point[0] + minorAnchor : point[0] - minorAnchor);\n }\n else {\n p.push(point[0] + (majorAnchor * too[0]));\n }\n\n if (too[1] === 0) {\n p.push(targetAnchorPosition[1] < sourceAnchorPosition[1] ? point[1] + minorAnchor : point[1] - minorAnchor);\n }\n else {\n p.push(point[1] + (majorAnchor * soo[1]));\n }\n }\n\n return p;\n };\n\n this._computeBezier = function (paintInfo, p, sp, tp, _w, _h) {\n\n var _CP, _CP2,\n _sx = sp[0] < tp[0] ? _w : 0,\n _sy = sp[1] < tp[1] ? _h : 0,\n _tx = sp[0] < tp[0] ? 0 : _w,\n _ty = sp[1] < tp[1] ? 0 : _h;\n\n _CP = this._findControlPoint([_sx, _sy], sp, tp, p.sourceEndpoint, p.targetEndpoint, paintInfo.so, paintInfo.to);\n _CP2 = this._findControlPoint([_tx, _ty], tp, sp, p.targetEndpoint, p.sourceEndpoint, paintInfo.to, paintInfo.so);\n\n\n _super.addSegment(this, \"Bezier\", {\n x1: _sx, y1: _sy, x2: _tx, y2: _ty,\n cp1x: _CP[0], cp1y: _CP[1], cp2x: _CP2[0], cp2y: _CP2[1]\n });\n };\n\n\n };\n\n _jp.Connectors.Bezier = Bezier;\n _ju.extend(Bezier, _jp.Connectors.AbstractBezierConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the state machine connectors, which extend AbstractBezierConnector.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n var _segment = function (x1, y1, x2, y2) {\n if (x1 <= x2 && y2 <= y1) {\n return 1;\n }\n else if (x1 <= x2 && y1 <= y2) {\n return 2;\n }\n else if (x2 <= x1 && y2 >= y1) {\n return 3;\n }\n return 4;\n },\n\n // the control point we will use depends on the faces to which each end of the connection is assigned, specifically whether or not the\n // two faces are parallel or perpendicular. if they are parallel then the control point lies on the midpoint of the axis in which they\n // are parellel and varies only in the other axis; this variation is proportional to the distance that the anchor points lie from the\n // center of that face. if the two faces are perpendicular then the control point is at some distance from both the midpoints; the amount and\n // direction are dependent on the orientation of the two elements. 'seg', passed in to this method, tells you which segment the target element\n // lies in with respect to the source: 1 is top right, 2 is bottom right, 3 is bottom left, 4 is top left.\n //\n // sourcePos and targetPos are arrays of info about where on the source and target each anchor is located. their contents are:\n //\n // 0 - absolute x\n // 1 - absolute y\n // 2 - proportional x in element (0 is left edge, 1 is right edge)\n // 3 - proportional y in element (0 is top edge, 1 is bottom edge)\n //\n _findControlPoint = function (midx, midy, segment, sourceEdge, targetEdge, dx, dy, distance, proximityLimit) {\n // TODO (maybe)\n // - if anchor pos is 0.5, make the control point take into account the relative position of the elements.\n if (distance <= proximityLimit) {\n return [midx, midy];\n }\n\n if (segment === 1) {\n if (sourceEdge[3] <= 0 && targetEdge[3] >= 1) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] >= 1 && targetEdge[2] <= 0) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + (-1 * dx) , midy + (-1 * dy) ];\n }\n }\n else if (segment === 2) {\n if (sourceEdge[3] >= 1 && targetEdge[3] <= 0) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] >= 1 && targetEdge[2] <= 0) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + dx, midy + (-1 * dy) ];\n }\n }\n else if (segment === 3) {\n if (sourceEdge[3] >= 1 && targetEdge[3] <= 0) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] <= 0 && targetEdge[2] >= 1) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + (-1 * dx) , midy + (-1 * dy) ];\n }\n }\n else if (segment === 4) {\n if (sourceEdge[3] <= 0 && targetEdge[3] >= 1) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] <= 0 && targetEdge[2] >= 1) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + dx , midy + (-1 * dy) ];\n }\n }\n\n };\n\n var StateMachine = function (params) {\n params = params || {};\n this.type = \"StateMachine\";\n\n var _super = _jp.Connectors.AbstractBezierConnector.apply(this, arguments),\n curviness = params.curviness || 10,\n margin = params.margin || 5,\n proximityLimit = params.proximityLimit || 80,\n clockwise = params.orientation && params.orientation === \"clockwise\",\n _controlPoint;\n\n this._computeBezier = function(paintInfo, params, sp, tp, w, h) {\n var _sx = params.sourcePos[0] < params.targetPos[0] ? 0 : w,\n _sy = params.sourcePos[1] < params.targetPos[1] ? 0 : h,\n _tx = params.sourcePos[0] < params.targetPos[0] ? w : 0,\n _ty = params.sourcePos[1] < params.targetPos[1] ? h : 0;\n\n // now adjust for the margin\n if (params.sourcePos[2] === 0) {\n _sx -= margin;\n }\n if (params.sourcePos[2] === 1) {\n _sx += margin;\n }\n if (params.sourcePos[3] === 0) {\n _sy -= margin;\n }\n if (params.sourcePos[3] === 1) {\n _sy += margin;\n }\n if (params.targetPos[2] === 0) {\n _tx -= margin;\n }\n if (params.targetPos[2] === 1) {\n _tx += margin;\n }\n if (params.targetPos[3] === 0) {\n _ty -= margin;\n }\n if (params.targetPos[3] === 1) {\n _ty += margin;\n }\n\n //\n // these connectors are quadratic bezier curves, having a single control point. if both anchors\n // are located at 0.5 on their respective faces, the control point is set to the midpoint and you\n // get a straight line. this is also the case if the two anchors are within 'proximityLimit', since\n // it seems to make good aesthetic sense to do that. outside of that, the control point is positioned\n // at 'curviness' pixels away along the normal to the straight line connecting the two anchors.\n //\n // there may be two improvements to this. firstly, we might actually support the notion of avoiding nodes\n // in the UI, or at least making a good effort at doing so. if a connection would pass underneath some node,\n // for example, we might increase the distance the control point is away from the midpoint in a bid to\n // steer it around that node. this will work within limits, but i think those limits would also be the likely\n // limits for, once again, aesthetic good sense in the layout of a chart using these connectors.\n //\n // the second possible change is actually two possible changes: firstly, it is possible we should gradually\n // decrease the 'curviness' as the distance between the anchors decreases; start tailing it off to 0 at some\n // point (which should be configurable). secondly, we might slightly increase the 'curviness' for connectors\n // with respect to how far their anchor is from the center of its respective face. this could either look cool,\n // or stupid, and may indeed work only in a way that is so subtle as to have been a waste of time.\n //\n\n var _midx = (_sx + _tx) / 2,\n _midy = (_sy + _ty) / 2,\n segment = _segment(_sx, _sy, _tx, _ty),\n distance = Math.sqrt(Math.pow(_tx - _sx, 2) + Math.pow(_ty - _sy, 2)),\n cp1x, cp2x, cp1y, cp2y;\n\n\n // calculate the control point. this code will be where we'll put in a rudimentary element avoidance scheme; it\n // will work by extending the control point to force the curve to be, um, curvier.\n _controlPoint = _findControlPoint(_midx,\n _midy,\n segment,\n params.sourcePos,\n params.targetPos,\n curviness, curviness,\n distance,\n proximityLimit);\n\n cp1x = _controlPoint[0];\n cp2x = _controlPoint[0];\n cp1y = _controlPoint[1];\n cp2y = _controlPoint[1];\n\n _super.addSegment(this, \"Bezier\", {\n x1: _tx, y1: _ty, x2: _sx, y2: _sy,\n cp1x: cp1x, cp1y: cp1y,\n cp2x: cp2x, cp2y: cp2y\n });\n };\n };\n\n _jp.Connectors.StateMachine = StateMachine;\n _ju.extend(StateMachine, _jp.Connectors.AbstractBezierConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the 'flowchart' connectors, consisting of vertical and horizontal line segments.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n var STRAIGHT = \"Straight\";\n\n var Straight = function (params) {\n this.type = STRAIGHT;\n var _super = _jp.Connectors.AbstractConnector.apply(this, arguments);\n\n this._compute = function (paintInfo, _) {\n _super.addSegment(this, STRAIGHT, {x1: paintInfo.sx, y1: paintInfo.sy, x2: paintInfo.startStubX, y2: paintInfo.startStubY});\n _super.addSegment(this, STRAIGHT, {x1: paintInfo.startStubX, y1: paintInfo.startStubY, x2: paintInfo.endStubX, y2: paintInfo.endStubY});\n _super.addSegment(this, STRAIGHT, {x1: paintInfo.endStubX, y1: paintInfo.endStubY, x2: paintInfo.tx, y2: paintInfo.ty});\n };\n };\n\n _jp.Connectors.Straight = Straight;\n _ju.extend(Straight, _jp.Connectors.AbstractConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the SVG renderers.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n * \n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n// ************************** SVG utility methods ********************************************\t\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n var svgAttributeMap = {\n \"stroke-linejoin\": \"stroke-linejoin\",\n \"stroke-dashoffset\": \"stroke-dashoffset\",\n \"stroke-linecap\": \"stroke-linecap\"\n },\n STROKE_DASHARRAY = \"stroke-dasharray\",\n DASHSTYLE = \"dashstyle\",\n LINEAR_GRADIENT = \"linearGradient\",\n RADIAL_GRADIENT = \"radialGradient\",\n DEFS = \"defs\",\n FILL = \"fill\",\n STOP = \"stop\",\n STROKE = \"stroke\",\n STROKE_WIDTH = \"stroke-width\",\n STYLE = \"style\",\n NONE = \"none\",\n JSPLUMB_GRADIENT = \"jsplumb_gradient_\",\n LINE_WIDTH = \"strokeWidth\",\n ns = {\n svg: \"http://www.w3.org/2000/svg\"\n },\n _attr = function (node, attributes) {\n for (var i in attributes) {\n node.setAttribute(i, \"\" + attributes[i]);\n }\n },\n _node = function (name, attributes) {\n attributes = attributes || {};\n attributes.version = \"1.1\";\n attributes.xmlns = ns.svg;\n return _jp.createElementNS(ns.svg, name, null, null, attributes);\n },\n _pos = function (d) {\n return \"position:absolute;left:\" + d[0] + \"px;top:\" + d[1] + \"px\";\n },\n _clearGradient = function (parent) {\n var els = parent.querySelectorAll(\" defs,linearGradient,radialGradient\");\n for (var i = 0; i < els.length; i++) {\n els[i].parentNode.removeChild(els[i]);\n }\n },\n _updateGradient = function (parent, node, style, dimensions, uiComponent) {\n var id = JSPLUMB_GRADIENT + uiComponent._jsPlumb.instance.idstamp();\n // first clear out any existing gradient\n _clearGradient(parent);\n // this checks for an 'offset' property in the gradient, and in the absence of it, assumes\n // we want a linear gradient. if it's there, we create a radial gradient.\n // it is possible that a more explicit means of defining the gradient type would be\n // better. relying on 'offset' means that we can never have a radial gradient that uses\n // some default offset, for instance.\n // issue 244 suggested the 'gradientUnits' attribute; without this, straight/flowchart connectors with gradients would\n // not show gradients when the line was perfectly horizontal or vertical.\n var g;\n if (!style.gradient.offset) {\n g = _node(LINEAR_GRADIENT, {id: id, gradientUnits: \"userSpaceOnUse\"});\n }\n else {\n g = _node(RADIAL_GRADIENT, { id: id });\n }\n\n var defs = _node(DEFS);\n parent.appendChild(defs);\n defs.appendChild(g);\n\n // the svg radial gradient seems to treat stops in the reverse\n // order to how canvas does it. so we want to keep all the maths the same, but\n // iterate the actual style declarations in reverse order, if the x indexes are not in order.\n for (var i = 0; i < style.gradient.stops.length; i++) {\n var styleToUse = uiComponent.segment === 1 || uiComponent.segment === 2 ? i : style.gradient.stops.length - 1 - i,\n stopColor = style.gradient.stops[styleToUse][1],\n s = _node(STOP, {\"offset\": Math.floor(style.gradient.stops[i][0] * 100) + \"%\", \"stop-color\": stopColor});\n\n g.appendChild(s);\n }\n var applyGradientTo = style.stroke ? STROKE : FILL;\n node.setAttribute(applyGradientTo, \"url(#\" + id + \")\");\n },\n _applyStyles = function (parent, node, style, dimensions, uiComponent) {\n\n node.setAttribute(FILL, style.fill ? style.fill : NONE);\n node.setAttribute(STROKE, style.stroke ? style.stroke : NONE);\n\n if (style.gradient) {\n _updateGradient(parent, node, style, dimensions, uiComponent);\n }\n else {\n // make sure we clear any existing gradient\n _clearGradient(parent);\n node.setAttribute(STYLE, \"\");\n }\n\n if (style.strokeWidth) {\n node.setAttribute(STROKE_WIDTH, style.strokeWidth);\n }\n\n // in SVG there is a stroke-dasharray attribute we can set, and its syntax looks like\n // the syntax in VML but is actually kind of nasty: values are given in the pixel\n // coordinate space, whereas in VML they are multiples of the width of the stroked\n // line, which makes a lot more sense. for that reason, jsPlumb is supporting both\n // the native svg 'stroke-dasharray' attribute, and also the 'dashstyle' concept from\n // VML, which will be the preferred method. the code below this converts a dashstyle\n // attribute given in terms of stroke width into a pixel representation, by using the\n // stroke's lineWidth.\n if (style[DASHSTYLE] && style[LINE_WIDTH] && !style[STROKE_DASHARRAY]) {\n var sep = style[DASHSTYLE].indexOf(\",\") === -1 ? \" \" : \",\",\n parts = style[DASHSTYLE].split(sep),\n styleToUse = \"\";\n parts.forEach(function (p) {\n styleToUse += (Math.floor(p * style.strokeWidth) + sep);\n });\n node.setAttribute(STROKE_DASHARRAY, styleToUse);\n }\n else if (style[STROKE_DASHARRAY]) {\n node.setAttribute(STROKE_DASHARRAY, style[STROKE_DASHARRAY]);\n }\n\n // extra attributes such as join type, dash offset.\n for (var i in svgAttributeMap) {\n if (style[i]) {\n node.setAttribute(svgAttributeMap[i], style[i]);\n }\n }\n },\n _appendAtIndex = function (svg, path, idx) {\n if (svg.childNodes.length > idx) {\n svg.insertBefore(path, svg.childNodes[idx]);\n }\n else {\n svg.appendChild(path);\n }\n };\n\n /**\n utility methods for other objects to use.\n */\n _ju.svg = {\n node: _node,\n attr: _attr,\n pos: _pos\n };\n\n // ************************** / SVG utility methods ********************************************\n\n /*\n * Base class for SVG components.\n */\n var SvgComponent = function (params) {\n var pointerEventsSpec = params.pointerEventsSpec || \"all\", renderer = {};\n\n _jp.jsPlumbUIComponent.apply(this, params.originalArgs);\n this.canvas = null;\n this.path = null;\n this.svg = null;\n this.bgCanvas = null;\n\n var clazz = params.cssClass + \" \" + (params.originalArgs[0].cssClass || \"\"),\n svgParams = {\n \"style\": \"\",\n \"width\": 0,\n \"height\": 0,\n \"pointer-events\": pointerEventsSpec,\n \"position\": \"absolute\"\n };\n\n this.svg = _node(\"svg\", svgParams);\n\n if (params.useDivWrapper) {\n this.canvas = _jp.createElement(\"div\", { position : \"absolute\" });\n _ju.sizeElement(this.canvas, 0, 0, 1, 1);\n this.canvas.className = clazz;\n }\n else {\n _attr(this.svg, { \"class\": clazz });\n this.canvas = this.svg;\n }\n\n params._jsPlumb.appendElement(this.canvas, params.originalArgs[0].parent);\n if (params.useDivWrapper) {\n this.canvas.appendChild(this.svg);\n }\n\n var displayElements = [ this.canvas ];\n this.getDisplayElements = function () {\n return displayElements;\n };\n\n this.appendDisplayElement = function (el) {\n displayElements.push(el);\n };\n\n this.paint = function (style, anchor, extents) {\n if (style != null) {\n\n var xy = [ this.x, this.y ], wh = [ this.w, this.h ], p;\n if (extents != null) {\n if (extents.xmin < 0) {\n xy[0] += extents.xmin;\n }\n if (extents.ymin < 0) {\n xy[1] += extents.ymin;\n }\n wh[0] = extents.xmax + ((extents.xmin < 0) ? -extents.xmin : 0);\n wh[1] = extents.ymax + ((extents.ymin < 0) ? -extents.ymin : 0);\n }\n\n if (params.useDivWrapper) {\n _ju.sizeElement(this.canvas, xy[0], xy[1], wh[0], wh[1]);\n xy[0] = 0;\n xy[1] = 0;\n p = _pos([ 0, 0 ]);\n }\n else {\n p = _pos([ xy[0], xy[1] ]);\n }\n\n renderer.paint.apply(this, arguments);\n\n _attr(this.svg, {\n \"style\": p,\n \"width\": wh[0] || 0,\n \"height\": wh[1] || 0\n });\n }\n };\n\n return {\n renderer: renderer\n };\n };\n\n _ju.extend(SvgComponent, _jp.jsPlumbUIComponent, {\n cleanup: function (force) {\n if (force || this.typeId == null) {\n if (this.canvas) {\n this.canvas._jsPlumb = null;\n }\n if (this.svg) {\n this.svg._jsPlumb = null;\n }\n if (this.bgCanvas) {\n this.bgCanvas._jsPlumb = null;\n }\n\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n if (this.bgCanvas && this.bgCanvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n\n this.svg = null;\n this.canvas = null;\n this.path = null;\n this.group = null;\n }\n else {\n // if not a forced cleanup, just detach from DOM for now.\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n if (this.bgCanvas && this.bgCanvas.parentNode) {\n this.bgCanvas.parentNode.removeChild(this.bgCanvas);\n }\n }\n },\n reattach:function(instance) {\n var c = instance.getContainer();\n if (this.canvas && this.canvas.parentNode == null) {\n c.appendChild(this.canvas);\n }\n if (this.bgCanvas && this.bgCanvas.parentNode == null) {\n c.appendChild(this.bgCanvas);\n }\n },\n setVisible: function (v) {\n if (this.canvas) {\n this.canvas.style.display = v ? \"block\" : \"none\";\n }\n }\n });\n\n /*\n * Base class for SVG connectors.\n */\n _jp.ConnectorRenderers.svg = function (params) {\n var self = this,\n _super = SvgComponent.apply(this, [\n {\n cssClass: params._jsPlumb.connectorClass,\n originalArgs: arguments,\n pointerEventsSpec: \"none\",\n _jsPlumb: params._jsPlumb\n }\n ]);\n\n _super.renderer.paint = function (style, anchor, extents) {\n\n var segments = self.getSegments(), p = \"\", offset = [0, 0];\n if (extents.xmin < 0) {\n offset[0] = -extents.xmin;\n }\n if (extents.ymin < 0) {\n offset[1] = -extents.ymin;\n }\n\n if (segments.length > 0) {\n\n p = self.getPathData();\n\n var a = {\n d: p,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\",\n \"pointer-events\": params[\"pointer-events\"] || \"visibleStroke\"\n },\n outlineStyle = null,\n d = [self.x, self.y, self.w, self.h];\n\n // outline style. actually means drawing an svg object underneath the main one.\n if (style.outlineStroke) {\n var outlineWidth = style.outlineWidth || 1,\n outlineStrokeWidth = style.strokeWidth + (2 * outlineWidth);\n outlineStyle = _jp.extend({}, style);\n delete outlineStyle.gradient;\n outlineStyle.stroke = style.outlineStroke;\n outlineStyle.strokeWidth = outlineStrokeWidth;\n\n if (self.bgPath == null) {\n self.bgPath = _node(\"path\", a);\n _jp.addClass(self.bgPath, _jp.connectorOutlineClass);\n _appendAtIndex(self.svg, self.bgPath, 0);\n }\n else {\n _attr(self.bgPath, a);\n }\n\n _applyStyles(self.svg, self.bgPath, outlineStyle, d, self);\n }\n\n if (self.path == null) {\n self.path = _node(\"path\", a);\n _appendAtIndex(self.svg, self.path, style.outlineStroke ? 1 : 0);\n }\n else {\n _attr(self.path, a);\n }\n\n _applyStyles(self.svg, self.path, style, d, self);\n }\n };\n };\n _ju.extend(_jp.ConnectorRenderers.svg, SvgComponent);\n\n// ******************************* svg segment renderer *****************************************************\t\n\n\n// ******************************* /svg segments *****************************************************\n\n /*\n * Base class for SVG endpoints.\n */\n var SvgEndpoint = _jp.SvgEndpoint = function (params) {\n var _super = SvgComponent.apply(this, [\n {\n cssClass: params._jsPlumb.endpointClass,\n originalArgs: arguments,\n pointerEventsSpec: \"all\",\n useDivWrapper: true,\n _jsPlumb: params._jsPlumb\n }\n ]);\n\n _super.renderer.paint = function (style) {\n var s = _jp.extend({}, style);\n if (s.outlineStroke) {\n s.stroke = s.outlineStroke;\n }\n\n if (this.node == null) {\n this.node = this.makeNode(s);\n this.svg.appendChild(this.node);\n }\n else if (this.updateNode != null) {\n this.updateNode(this.node);\n }\n _applyStyles(this.svg, this.node, s, [ this.x, this.y, this.w, this.h ], this);\n _pos(this.node, [ this.x, this.y ]);\n }.bind(this);\n\n };\n _ju.extend(SvgEndpoint, SvgComponent);\n\n /*\n * SVG Dot Endpoint\n */\n _jp.Endpoints.svg.Dot = function () {\n _jp.Endpoints.Dot.apply(this, arguments);\n SvgEndpoint.apply(this, arguments);\n this.makeNode = function (style) {\n return _node(\"circle\", {\n \"cx\": this.w / 2,\n \"cy\": this.h / 2,\n \"r\": this.radius\n });\n };\n this.updateNode = function (node) {\n _attr(node, {\n \"cx\": this.w / 2,\n \"cy\": this.h / 2,\n \"r\": this.radius\n });\n };\n };\n _ju.extend(_jp.Endpoints.svg.Dot, [_jp.Endpoints.Dot, SvgEndpoint]);\n\n /*\n * SVG Rectangle Endpoint\n */\n _jp.Endpoints.svg.Rectangle = function () {\n _jp.Endpoints.Rectangle.apply(this, arguments);\n SvgEndpoint.apply(this, arguments);\n this.makeNode = function (style) {\n return _node(\"rect\", {\n \"width\": this.w,\n \"height\": this.h\n });\n };\n this.updateNode = function (node) {\n _attr(node, {\n \"width\": this.w,\n \"height\": this.h\n });\n };\n };\n _ju.extend(_jp.Endpoints.svg.Rectangle, [_jp.Endpoints.Rectangle, SvgEndpoint]);\n\n /*\n * SVG Image Endpoint is the default image endpoint.\n */\n _jp.Endpoints.svg.Image = _jp.Endpoints.Image;\n /*\n * Blank endpoint in svg renderer is the default Blank endpoint.\n */\n _jp.Endpoints.svg.Blank = _jp.Endpoints.Blank;\n /*\n * Label overlay in svg renderer is the default Label overlay.\n */\n _jp.Overlays.svg.Label = _jp.Overlays.Label;\n /*\n * Custom overlay in svg renderer is the default Custom overlay.\n */\n _jp.Overlays.svg.Custom = _jp.Overlays.Custom;\n\n var AbstractSvgArrowOverlay = function (superclass, originalArgs) {\n superclass.apply(this, originalArgs);\n _jp.jsPlumbUIComponent.apply(this, originalArgs);\n this.isAppendedAtTopLevel = false;\n var self = this;\n this.path = null;\n this.paint = function (params, containerExtents) {\n // only draws on connections, not endpoints.\n if (params.component.svg && containerExtents) {\n if (this.path == null) {\n this.path = _node(\"path\", {\n \"pointer-events\": \"all\"\n });\n params.component.svg.appendChild(this.path);\n if (this.elementCreated) {\n this.elementCreated(this.path, params.component);\n }\n\n this.canvas = params.component.svg; // for the sake of completeness; this behaves the same as other overlays\n }\n var clazz = originalArgs && (originalArgs.length === 1) ? (originalArgs[0].cssClass || \"\") : \"\",\n offset = [0, 0];\n\n if (containerExtents.xmin < 0) {\n offset[0] = -containerExtents.xmin;\n }\n if (containerExtents.ymin < 0) {\n offset[1] = -containerExtents.ymin;\n }\n\n _attr(this.path, {\n \"d\": makePath(params.d),\n \"class\": clazz,\n stroke: params.stroke ? params.stroke : null,\n fill: params.fill ? params.fill : null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n }\n };\n var makePath = function (d) {\n return (isNaN(d.cxy.x) || isNaN(d.cxy.y)) ? \"\" : \"M\" + d.hxy.x + \",\" + d.hxy.y +\n \" L\" + d.tail[0].x + \",\" + d.tail[0].y +\n \" L\" + d.cxy.x + \",\" + d.cxy.y +\n \" L\" + d.tail[1].x + \",\" + d.tail[1].y +\n \" L\" + d.hxy.x + \",\" + d.hxy.y;\n };\n this.transfer = function(target) {\n if (target.canvas && this.path && this.path.parentNode) {\n this.path.parentNode.removeChild(this.path);\n target.canvas.appendChild(this.path);\n }\n };\n };\n _ju.extend(AbstractSvgArrowOverlay, [_jp.jsPlumbUIComponent, _jp.Overlays.AbstractOverlay], {\n cleanup: function (force) {\n if (this.path != null) {\n if (force) {\n this._jsPlumb.instance.removeElement(this.path);\n }\n else {\n if (this.path.parentNode) {\n this.path.parentNode.removeChild(this.path);\n }\n }\n }\n },\n reattach:function(instance, component) {\n if (this.path && component.canvas) {\n component.canvas.appendChild(this.path);\n }\n },\n setVisible: function (v) {\n if (this.path != null) {\n (this.path.style.display = (v ? \"block\" : \"none\"));\n }\n }\n });\n\n _jp.Overlays.svg.Arrow = function () {\n AbstractSvgArrowOverlay.apply(this, [_jp.Overlays.Arrow, arguments]);\n };\n _ju.extend(_jp.Overlays.svg.Arrow, [ _jp.Overlays.Arrow, AbstractSvgArrowOverlay ]);\n\n _jp.Overlays.svg.PlainArrow = function () {\n AbstractSvgArrowOverlay.apply(this, [_jp.Overlays.PlainArrow, arguments]);\n };\n _ju.extend(_jp.Overlays.svg.PlainArrow, [ _jp.Overlays.PlainArrow, AbstractSvgArrowOverlay ]);\n\n _jp.Overlays.svg.Diamond = function () {\n AbstractSvgArrowOverlay.apply(this, [_jp.Overlays.Diamond, arguments]);\n };\n _ju.extend(_jp.Overlays.svg.Diamond, [ _jp.Overlays.Diamond, AbstractSvgArrowOverlay ]);\n\n // a test\n _jp.Overlays.svg.GuideLines = function () {\n var path = null, self = this, p1_1, p1_2;\n _jp.Overlays.GuideLines.apply(this, arguments);\n this.paint = function (params, containerExtents) {\n if (path == null) {\n path = _node(\"path\");\n params.connector.svg.appendChild(path);\n self.attachListeners(path, params.connector);\n self.attachListeners(path, self);\n\n p1_1 = _node(\"path\");\n params.connector.svg.appendChild(p1_1);\n self.attachListeners(p1_1, params.connector);\n self.attachListeners(p1_1, self);\n\n p1_2 = _node(\"path\");\n params.connector.svg.appendChild(p1_2);\n self.attachListeners(p1_2, params.connector);\n self.attachListeners(p1_2, self);\n }\n\n var offset = [0, 0];\n if (containerExtents.xmin < 0) {\n offset[0] = -containerExtents.xmin;\n }\n if (containerExtents.ymin < 0) {\n offset[1] = -containerExtents.ymin;\n }\n\n _attr(path, {\n \"d\": makePath(params.head, params.tail),\n stroke: \"red\",\n fill: null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n\n _attr(p1_1, {\n \"d\": makePath(params.tailLine[0], params.tailLine[1]),\n stroke: \"blue\",\n fill: null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n\n _attr(p1_2, {\n \"d\": makePath(params.headLine[0], params.headLine[1]),\n stroke: \"green\",\n fill: null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n };\n\n var makePath = function (d1, d2) {\n return \"M \" + d1.x + \",\" + d1.y +\n \" L\" + d2.x + \",\" + d2.y;\n };\n };\n _ju.extend(_jp.Overlays.svg.GuideLines, _jp.Overlays.GuideLines);\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains code used when jsPlumb is being rendered in a DOM.\n *\n * Copyright (c) 2010 - 2019 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil,\n _jk = root.Katavorio, _jg = root.Biltong;\n\n var _getEventManager = function(instance) {\n var e = instance._mottle;\n if (!e) {\n e = instance._mottle = new root.Mottle();\n }\n return e;\n };\n\n var _getDragManager = function (instance, category) {\n\n category = category || \"main\";\n var key = \"_katavorio_\" + category;\n var k = instance[key],\n e = instance.getEventManager();\n\n if (!k) {\n k = new _jk({\n bind: e.on,\n unbind: e.off,\n getSize: _jp.getSize,\n getConstrainingRectangle:function(el) {\n return [ el.parentNode.scrollWidth, el.parentNode.scrollHeight ];\n },\n getPosition: function (el, relativeToRoot) {\n // if this is a nested draggable then compute the offset against its own offsetParent, otherwise\n // compute against the Container's origin. see also the getUIPosition method below.\n var o = instance.getOffset(el, relativeToRoot, el._katavorioDrag ? el.offsetParent : null);\n return [o.left, o.top];\n },\n setPosition: function (el, xy) {\n el.style.left = xy[0] + \"px\";\n el.style.top = xy[1] + \"px\";\n },\n addClass: _jp.addClass,\n removeClass: _jp.removeClass,\n intersects: _jg.intersects,\n indexOf: function(l, i) { return l.indexOf(i); },\n scope:instance.getDefaultScope(),\n css: {\n noSelect: instance.dragSelectClass,\n droppable: \"jtk-droppable\",\n draggable: \"jtk-draggable\",\n drag: \"jtk-drag\",\n selected: \"jtk-drag-selected\",\n active: \"jtk-drag-active\",\n hover: \"jtk-drag-hover\",\n ghostProxy:\"jtk-ghost-proxy\"\n }\n });\n k.setZoom(instance.getZoom());\n instance[key] = k;\n instance.bind(\"zoom\", k.setZoom);\n }\n return k;\n };\n\n var _dragStart=function(params) {\n var options = params.el._jsPlumbDragOptions;\n var cont = true;\n if (options.canDrag) {\n cont = options.canDrag();\n }\n if (cont) {\n this.setHoverSuspended(true);\n this.select({source: params.el}).addClass(this.elementDraggingClass + \" \" + this.sourceElementDraggingClass, true);\n this.select({target: params.el}).addClass(this.elementDraggingClass + \" \" + this.targetElementDraggingClass, true);\n this.setConnectionBeingDragged(true);\n }\n return cont;\n };\n var _dragMove=function(params) {\n var ui = this.getUIPosition(arguments, this.getZoom());\n if (ui != null) {\n var o = params.el._jsPlumbDragOptions;\n this.draw(params.el, ui, null, true);\n if (o._dragging) {\n this.addClass(params.el, \"jtk-dragged\");\n }\n o._dragging = true;\n }\n };\n var _dragStop=function(params) {\n var elements = params.selection, uip;\n\n var _one = function (_e) {\n if (_e[1] != null) {\n // run the reported offset through the code that takes parent containers\n // into account, to adjust if necessary (issue 554)\n uip = this.getUIPosition([{\n el:_e[2].el,\n pos:[_e[1].left, _e[1].top]\n }]);\n this.draw(_e[2].el, uip);\n }\n\n delete _e[0]._jsPlumbDragOptions._dragging;\n\n this.removeClass(_e[0], \"jtk-dragged\");\n this.select({source: _e[2].el}).removeClass(this.elementDraggingClass + \" \" + this.sourceElementDraggingClass, true);\n this.select({target: _e[2].el}).removeClass(this.elementDraggingClass + \" \" + this.targetElementDraggingClass, true);\n this.getDragManager().dragEnded(_e[2].el);\n }.bind(this);\n\n for (var i = 0; i < elements.length; i++) {\n _one(elements[i]);\n }\n\n this.setHoverSuspended(false);\n this.setConnectionBeingDragged(false);\n };\n\n var _animProps = function (o, p) {\n var _one = function (pName) {\n if (p[pName] != null) {\n if (_ju.isString(p[pName])) {\n var m = p[pName].match(/-=/) ? -1 : 1,\n v = p[pName].substring(2);\n return o[pName] + (m * v);\n }\n else {\n return p[pName];\n }\n }\n else {\n return o[pName];\n }\n };\n return [ _one(\"left\"), _one(\"top\") ];\n };\n\n var _genLoc = function (prefix, e) {\n if (e == null) {\n return [ 0, 0 ];\n }\n var ts = _touches(e), t = _getTouch(ts, 0);\n return [t[prefix + \"X\"], t[prefix + \"Y\"]];\n },\n _pageLocation = _genLoc.bind(this, \"page\"),\n _screenLocation = _genLoc.bind(this, \"screen\"),\n _clientLocation = _genLoc.bind(this, \"client\"),\n _getTouch = function (touches, idx) {\n return touches.item ? touches.item(idx) : touches[idx];\n },\n _touches = function (e) {\n return e.touches && e.touches.length > 0 ? e.touches :\n e.changedTouches && e.changedTouches.length > 0 ? e.changedTouches :\n e.targetTouches && e.targetTouches.length > 0 ? e.targetTouches :\n [ e ];\n };\n\n /**\n Manages dragging for some instance of jsPlumb.\n\n TODO instead of this being accessed directly, it should subscribe to events on the jsPlumb instance: every method\n in here is called directly by jsPlumb. But what should happen is that we have unpublished events that this listens\n to. The only trick is getting one of these instantiated with every jsPlumb instance: it needs to have a hook somehow.\n Basically the general idea is to pull ALL the drag code out (prototype method registrations plus this) into a\n dedicated drag script), that does not necessarily need to be included.\n\n\n */\n var DragManager = function (_currentInstance) {\n var _draggables = {}, _dlist = [], _delements = {}, _elementsWithEndpoints = {},\n // elementids mapped to the draggable to which they belong.\n _draggablesForElements = {};\n\n /**\n register some element as draggable. right now the drag init stuff is done elsewhere, and it is\n possible that will continue to be the case.\n */\n this.register = function (el) {\n var id = _currentInstance.getId(el),\n parentOffset;\n\n if (!_draggables[id]) {\n _draggables[id] = el;\n _dlist.push(el);\n _delements[id] = {};\n }\n\n // look for child elements that have endpoints and register them against this draggable.\n var _oneLevel = function (p) {\n if (p) {\n for (var i = 0; i < p.childNodes.length; i++) {\n if (p.childNodes[i].nodeType !== 3 && p.childNodes[i].nodeType !== 8) {\n var cEl = jsPlumb.getElement(p.childNodes[i]),\n cid = _currentInstance.getId(p.childNodes[i], null, true);\n if (cid && _elementsWithEndpoints[cid] && _elementsWithEndpoints[cid] > 0) {\n if (!parentOffset) {\n parentOffset = _currentInstance.getOffset(el);\n }\n var cOff = _currentInstance.getOffset(cEl);\n _delements[id][cid] = {\n id: cid,\n offset: {\n left: cOff.left - parentOffset.left,\n top: cOff.top - parentOffset.top\n }\n };\n _draggablesForElements[cid] = id;\n }\n _oneLevel(p.childNodes[i]);\n }\n }\n }\n };\n\n _oneLevel(el);\n };\n\n // refresh the offsets for child elements of this element.\n this.updateOffsets = function (elId, childOffsetOverrides) {\n if (elId != null) {\n childOffsetOverrides = childOffsetOverrides || {};\n var domEl = jsPlumb.getElement(elId),\n id = _currentInstance.getId(domEl),\n children = _delements[id],\n parentOffset;\n\n if (children) {\n for (var i in children) {\n if (children.hasOwnProperty(i)) {\n var cel = jsPlumb.getElement(i),\n cOff = childOffsetOverrides[i] || _currentInstance.getOffset(cel);\n\n // do not update if we have a value already and we'd just be writing 0,0\n if (cel.offsetParent == null && _delements[id][i] != null) {\n continue;\n }\n\n if (!parentOffset) {\n parentOffset = _currentInstance.getOffset(domEl);\n }\n\n _delements[id][i] = {\n id: i,\n offset: {\n left: cOff.left - parentOffset.left,\n top: cOff.top - parentOffset.top\n }\n };\n _draggablesForElements[i] = id;\n }\n }\n }\n }\n };\n\n /**\n notification that an endpoint was added to the given el. we go up from that el's parent\n node, looking for a parent that has been registered as a draggable. if we find one, we add this\n el to that parent's list of elements to update on drag (if it is not there already)\n */\n this.endpointAdded = function (el, id) {\n\n id = id || _currentInstance.getId(el);\n\n var b = document.body,\n p = el.parentNode;\n\n _elementsWithEndpoints[id] = _elementsWithEndpoints[id] ? _elementsWithEndpoints[id] + 1 : 1;\n\n while (p != null && p !== b) {\n var pid = _currentInstance.getId(p, null, true);\n if (pid && _draggables[pid]) {\n var pLoc = _currentInstance.getOffset(p);\n\n if (_delements[pid][id] == null) {\n var cLoc = _currentInstance.getOffset(el);\n _delements[pid][id] = {\n id: id,\n offset: {\n left: cLoc.left - pLoc.left,\n top: cLoc.top - pLoc.top\n }\n };\n _draggablesForElements[id] = pid;\n }\n break;\n }\n p = p.parentNode;\n }\n };\n\n this.endpointDeleted = function (endpoint) {\n if (_elementsWithEndpoints[endpoint.elementId]) {\n _elementsWithEndpoints[endpoint.elementId]--;\n if (_elementsWithEndpoints[endpoint.elementId] <= 0) {\n for (var i in _delements) {\n if (_delements.hasOwnProperty(i) && _delements[i]) {\n delete _delements[i][endpoint.elementId];\n delete _draggablesForElements[endpoint.elementId];\n }\n }\n }\n }\n };\n\n this.changeId = function (oldId, newId) {\n _delements[newId] = _delements[oldId];\n _delements[oldId] = {};\n _draggablesForElements[newId] = _draggablesForElements[oldId];\n _draggablesForElements[oldId] = null;\n };\n\n this.getElementsForDraggable = function (id) {\n return _delements[id];\n };\n\n this.elementRemoved = function (elementId) {\n var elId = _draggablesForElements[elementId];\n if (elId) {\n delete _delements[elId][elementId];\n delete _draggablesForElements[elementId];\n }\n };\n\n this.reset = function () {\n _draggables = {};\n _dlist = [];\n _delements = {};\n _elementsWithEndpoints = {};\n };\n\n //\n // notification drag ended. We check automatically if need to update some\n // ancestor's offsets.\n //\n this.dragEnded = function (el) {\n if (el.offsetParent != null) {\n var id = _currentInstance.getId(el),\n ancestor = _draggablesForElements[id];\n\n if (ancestor) {\n this.updateOffsets(ancestor);\n }\n }\n };\n\n this.setParent = function (el, elId, p, pId, currentChildLocation) {\n var current = _draggablesForElements[elId];\n if (!_delements[pId]) {\n _delements[pId] = {};\n }\n var pLoc = _currentInstance.getOffset(p),\n cLoc = currentChildLocation || _currentInstance.getOffset(el);\n\n if (current && _delements[current]) {\n delete _delements[current][elId];\n }\n\n _delements[pId][elId] = {\n id:elId,\n offset : {\n left: cLoc.left - pLoc.left,\n top: cLoc.top - pLoc.top\n }\n };\n _draggablesForElements[elId] = pId;\n };\n\n this.clearParent = function(el, elId) {\n var current = _draggablesForElements[elId];\n if (current) {\n delete _delements[current][elId];\n delete _draggablesForElements[elId];\n }\n };\n\n this.revalidateParent = function(el, elId, childOffset) {\n var current = _draggablesForElements[elId];\n if (current) {\n var co = {};\n co[elId] = childOffset;\n this.updateOffsets(current, co);\n _currentInstance.revalidate(current);\n }\n };\n\n this.getDragAncestor = function (el) {\n var de = jsPlumb.getElement(el),\n id = _currentInstance.getId(de),\n aid = _draggablesForElements[id];\n\n if (aid) {\n return jsPlumb.getElement(aid);\n }\n else {\n return null;\n }\n };\n\n };\n\n var _setClassName = function (el, cn, classList) {\n cn = _ju.fastTrim(cn);\n if (typeof el.className.baseVal !== \"undefined\") {\n el.className.baseVal = cn;\n }\n else {\n el.className = cn;\n }\n\n // recent (i currently have 61.0.3163.100) version of chrome do not update classList when you set the base val\n // of an svg element's className. in the long run we'd like to move to just using classList anyway\n try {\n var cl = el.classList;\n if (cl != null) {\n while (cl.length > 0) {\n cl.remove(cl.item(0));\n }\n for (var i = 0; i < classList.length; i++) {\n if (classList[i]) {\n cl.add(classList[i]);\n }\n }\n }\n }\n catch(e) {\n // not fatal\n _ju.log(\"JSPLUMB: cannot set class list\", e);\n }\n },\n _getClassName = function (el) {\n return (typeof el.className.baseVal === \"undefined\") ? el.className : el.className.baseVal;\n },\n _classManip = function (el, classesToAdd, classesToRemove) {\n classesToAdd = classesToAdd == null ? [] : _ju.isArray(classesToAdd) ? classesToAdd : classesToAdd.split(/\\s+/);\n classesToRemove = classesToRemove == null ? [] : _ju.isArray(classesToRemove) ? classesToRemove : classesToRemove.split(/\\s+/);\n\n var className = _getClassName(el),\n curClasses = className.split(/\\s+/);\n\n var _oneSet = function (add, classes) {\n for (var i = 0; i < classes.length; i++) {\n if (add) {\n if (curClasses.indexOf(classes[i]) === -1) {\n curClasses.push(classes[i]);\n }\n }\n else {\n var idx = curClasses.indexOf(classes[i]);\n if (idx !== -1) {\n curClasses.splice(idx, 1);\n }\n }\n }\n };\n\n _oneSet(true, classesToAdd);\n _oneSet(false, classesToRemove);\n\n _setClassName(el, curClasses.join(\" \"), curClasses);\n };\n\n root.jsPlumb.extend(root.jsPlumbInstance.prototype, {\n\n headless: false,\n\n pageLocation: _pageLocation,\n screenLocation: _screenLocation,\n clientLocation: _clientLocation,\n\n getDragManager:function() {\n if (this.dragManager == null) {\n this.dragManager = new DragManager(this);\n }\n\n return this.dragManager;\n },\n\n recalculateOffsets:function(elId) {\n this.getDragManager().updateOffsets(elId);\n },\n\n createElement:function(tag, style, clazz, atts) {\n return this.createElementNS(null, tag, style, clazz, atts);\n },\n\n createElementNS:function(ns, tag, style, clazz, atts) {\n var e = ns == null ? document.createElement(tag) : document.createElementNS(ns, tag);\n var i;\n style = style || {};\n for (i in style) {\n e.style[i] = style[i];\n }\n\n if (clazz) {\n e.className = clazz;\n }\n\n atts = atts || {};\n for (i in atts) {\n e.setAttribute(i, \"\" + atts[i]);\n }\n\n return e;\n },\n\n getAttribute: function (el, attName) {\n return el.getAttribute != null ? el.getAttribute(attName) : null;\n },\n\n setAttribute: function (el, a, v) {\n if (el.setAttribute != null) {\n el.setAttribute(a, v);\n }\n },\n\n setAttributes: function (el, atts) {\n for (var i in atts) {\n if (atts.hasOwnProperty(i)) {\n el.setAttribute(i, atts[i]);\n }\n }\n },\n appendToRoot: function (node) {\n document.body.appendChild(node);\n },\n getRenderModes: function () {\n return [ \"svg\" ];\n },\n getClass:_getClassName,\n addClass: function (el, clazz) {\n jsPlumb.each(el, function (e) {\n _classManip(e, clazz);\n });\n },\n hasClass: function (el, clazz) {\n el = jsPlumb.getElement(el);\n if (el.classList) {\n return el.classList.contains(clazz);\n }\n else {\n return _getClassName(el).indexOf(clazz) !== -1;\n }\n },\n removeClass: function (el, clazz) {\n jsPlumb.each(el, function (e) {\n _classManip(e, null, clazz);\n });\n },\n toggleClass:function(el, clazz) {\n if (jsPlumb.hasClass(el, clazz)) {\n jsPlumb.removeClass(el, clazz);\n } else {\n jsPlumb.addClass(el, clazz);\n }\n },\n updateClasses: function (el, toAdd, toRemove) {\n jsPlumb.each(el, function (e) {\n _classManip(e, toAdd, toRemove);\n });\n },\n setClass: function (el, clazz) {\n if (clazz != null) {\n jsPlumb.each(el, function (e) {\n _setClassName(e, clazz, clazz.split(/\\s+/));\n });\n }\n },\n setPosition: function (el, p) {\n el.style.left = p.left + \"px\";\n el.style.top = p.top + \"px\";\n },\n getPosition: function (el) {\n var _one = function (prop) {\n var v = el.style[prop];\n return v ? v.substring(0, v.length - 2) : 0;\n };\n return {\n left: _one(\"left\"),\n top: _one(\"top\")\n };\n },\n getStyle:function(el, prop) {\n if (typeof window.getComputedStyle !== 'undefined') {\n return getComputedStyle(el, null).getPropertyValue(prop);\n } else {\n return el.currentStyle[prop];\n }\n },\n getSelector: function (ctx, spec) {\n var sel = null;\n if (arguments.length === 1) {\n sel = ctx.nodeType != null ? ctx : document.querySelectorAll(ctx);\n }\n else {\n sel = ctx.querySelectorAll(spec);\n }\n\n return sel;\n },\n getOffset:function(el, relativeToRoot, container) {\n el = jsPlumb.getElement(el);\n container = container || this.getContainer();\n var out = {\n left: el.offsetLeft,\n top: el.offsetTop\n },\n op = (relativeToRoot || (container != null && (el !== container && el.offsetParent !== container))) ? el.offsetParent : null,\n _maybeAdjustScroll = function(offsetParent) {\n if (offsetParent != null && offsetParent !== document.body && (offsetParent.scrollTop > 0 || offsetParent.scrollLeft > 0)) {\n out.left -= offsetParent.scrollLeft;\n out.top -= offsetParent.scrollTop;\n }\n }.bind(this);\n\n while (op != null) {\n out.left += op.offsetLeft;\n out.top += op.offsetTop;\n _maybeAdjustScroll(op);\n op = relativeToRoot ? op.offsetParent :\n op.offsetParent === container ? null : op.offsetParent;\n }\n\n // if container is scrolled and the element (or its offset parent) is not absolute or fixed, adjust accordingly.\n if (container != null && !relativeToRoot && (container.scrollTop > 0 || container.scrollLeft > 0)) {\n var pp = el.offsetParent != null ? this.getStyle(el.offsetParent, \"position\") : \"static\",\n p = this.getStyle(el, \"position\");\n if (p !== \"absolute\" && p !== \"fixed\" && pp !== \"absolute\" && pp !== \"fixed\") {\n out.left -= container.scrollLeft;\n out.top -= container.scrollTop;\n }\n }\n return out;\n },\n //\n // return x+y proportion of the given element's size corresponding to the location of the given event.\n //\n getPositionOnElement: function (evt, el, zoom) {\n var box = typeof el.getBoundingClientRect !== \"undefined\" ? el.getBoundingClientRect() : { left: 0, top: 0, width: 0, height: 0 },\n body = document.body,\n docElem = document.documentElement,\n scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop,\n scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft,\n clientTop = docElem.clientTop || body.clientTop || 0,\n clientLeft = docElem.clientLeft || body.clientLeft || 0,\n pst = 0,\n psl = 0,\n top = box.top + scrollTop - clientTop + (pst * zoom),\n left = box.left + scrollLeft - clientLeft + (psl * zoom),\n cl = jsPlumb.pageLocation(evt),\n w = box.width || (el.offsetWidth * zoom),\n h = box.height || (el.offsetHeight * zoom),\n x = (cl[0] - left) / w,\n y = (cl[1] - top) / h;\n\n return [ x, y ];\n },\n\n /**\n * Gets the absolute position of some element as read from the left/top properties in its style.\n * @method getAbsolutePosition\n * @param {Element} el The element to retrieve the absolute coordinates from. **Note** this is a DOM element, not a selector from the underlying library.\n * @return {Number[]} [left, top] pixel values.\n */\n getAbsolutePosition: function (el) {\n var _one = function (s) {\n var ss = el.style[s];\n if (ss) {\n return parseFloat(ss.substring(0, ss.length - 2));\n }\n };\n return [ _one(\"left\"), _one(\"top\") ];\n },\n\n /**\n * Sets the absolute position of some element by setting the left/top properties in its style.\n * @method setAbsolutePosition\n * @param {Element} el The element to set the absolute coordinates on. **Note** this is a DOM element, not a selector from the underlying library.\n * @param {Number[]} xy x and y coordinates\n * @param {Number[]} [animateFrom] Optional previous xy to animate from.\n * @param {Object} [animateOptions] Options for the animation.\n */\n setAbsolutePosition: function (el, xy, animateFrom, animateOptions) {\n if (animateFrom) {\n this.animate(el, {\n left: \"+=\" + (xy[0] - animateFrom[0]),\n top: \"+=\" + (xy[1] - animateFrom[1])\n }, animateOptions);\n }\n else {\n el.style.left = xy[0] + \"px\";\n el.style.top = xy[1] + \"px\";\n }\n },\n /**\n * gets the size for the element, in an array : [ width, height ].\n */\n getSize: function (el) {\n return [ el.offsetWidth, el.offsetHeight ];\n },\n getWidth: function (el) {\n return el.offsetWidth;\n },\n getHeight: function (el) {\n return el.offsetHeight;\n },\n getRenderMode : function() { return \"svg\"; },\n draggable : function (el, options) {\n var info;\n el = _ju.isArray(el) || (el.length != null && !_ju.isString(el)) ? el: [ el ];\n Array.prototype.slice.call(el).forEach(function(_el) {\n info = this.info(_el);\n if (info.el) {\n this._initDraggableIfNecessary(info.el, true, options, info.id, true);\n }\n }.bind(this));\n return this;\n },\n initDraggable: function (el, options, category) {\n _getDragManager(this, category).draggable(el, options);\n el._jsPlumbDragOptions = options;\n },\n destroyDraggable: function (el, category) {\n _getDragManager(this, category).destroyDraggable(el);\n delete el._jsPlumbDragOptions;\n },\n unbindDraggable: function (el, evt, fn, category) {\n _getDragManager(this, category).destroyDraggable(el, evt, fn);\n },\n setDraggable : function (element, draggable) {\n return jsPlumb.each(element, function (el) {\n if (this.isDragSupported(el)) {\n this._draggableStates[this.getAttribute(el, \"id\")] = draggable;\n this.setElementDraggable(el, draggable);\n }\n }.bind(this));\n },\n _draggableStates : {},\n /*\n * toggles the draggable state of the given element(s).\n * el is either an id, or an element object, or a list of ids/element objects.\n */\n toggleDraggable : function (el) {\n var state;\n jsPlumb.each(el, function (el) {\n var elId = this.getAttribute(el, \"id\");\n state = this._draggableStates[elId] == null ? false : this._draggableStates[elId];\n state = !state;\n this._draggableStates[elId] = state;\n this.setDraggable(el, state);\n return state;\n }.bind(this));\n return state;\n },\n _initDraggableIfNecessary : function (element, isDraggable, dragOptions, id, fireEvent) {\n // TODO FIRST: move to DragManager. including as much of the decision to init dragging as possible.\n if (!jsPlumb.headless) {\n var _draggable = isDraggable == null ? false : isDraggable;\n if (_draggable) {\n if (jsPlumb.isDragSupported(element, this)) {\n var options = dragOptions || this.Defaults.DragOptions;\n options = jsPlumb.extend({}, options); // make a copy.\n if (!jsPlumb.isAlreadyDraggable(element, this)) {\n var dragEvent = jsPlumb.dragEvents.drag,\n stopEvent = jsPlumb.dragEvents.stop,\n startEvent = jsPlumb.dragEvents.start;\n\n this.manage(id, element);\n\n options[startEvent] = _ju.wrap(options[startEvent], _dragStart.bind(this));\n\n options[dragEvent] = _ju.wrap(options[dragEvent], _dragMove.bind(this));\n\n options[stopEvent] = _ju.wrap(options[stopEvent], _dragStop.bind(this));\n\n var elId = this.getId(element); // need ID\n\n this._draggableStates[elId] = true;\n var draggable = this._draggableStates[elId];\n\n options.disabled = draggable == null ? false : !draggable;\n this.initDraggable(element, options);\n this.getDragManager().register(element);\n if (fireEvent) {\n this.fire(\"elementDraggable\", {el:element, options:options});\n }\n }\n else {\n // already draggable. attach any start, drag or stop listeners to the current Drag.\n if (dragOptions.force) {\n this.initDraggable(element, options);\n }\n }\n }\n }\n }\n },\n animationSupported:true,\n getElement: function (el) {\n if (el == null) {\n return null;\n }\n // here we pluck the first entry if el was a list of entries.\n // this is not my favourite thing to do, but previous versions of\n // jsplumb supported jquery selectors, and it is possible a selector\n // will be passed in here.\n el = typeof el === \"string\" ? el : el.length != null && el.enctype == null ? el[0] : el;\n return typeof el === \"string\" ? document.getElementById(el) : el;\n },\n removeElement: function (element) {\n _getDragManager(this).elementRemoved(element);\n this.getEventManager().remove(element);\n },\n //\n // this adapter supports a rudimentary animation function. no easing is supported. only\n // left/top properties are supported. property delta args are expected to be in the form\n //\n // +=x.xxxx\n //\n // or\n //\n // -=x.xxxx\n //\n doAnimate: function (el, properties, options) {\n options = options || {};\n var o = this.getOffset(el),\n ap = _animProps(o, properties),\n ldist = ap[0] - o.left,\n tdist = ap[1] - o.top,\n d = options.duration || 250,\n step = 15, steps = d / step,\n linc = (step / d) * ldist,\n tinc = (step / d) * tdist,\n idx = 0,\n _int = setInterval(function () {\n _jp.setPosition(el, {\n left: o.left + (linc * (idx + 1)),\n top: o.top + (tinc * (idx + 1))\n });\n if (options.step != null) {\n options.step(idx, Math.ceil(steps));\n }\n idx++;\n if (idx >= steps) {\n window.clearInterval(_int);\n if (options.complete != null) {\n options.complete();\n }\n }\n }, step);\n },\n // DRAG/DROP\n\n\n destroyDroppable: function (el, category) {\n _getDragManager(this, category).destroyDroppable(el);\n },\n unbindDroppable: function (el, evt, fn, category) {\n _getDragManager(this, category).destroyDroppable(el, evt, fn);\n },\n\n droppable :function(el, options) {\n el = _ju.isArray(el) || (el.length != null && !_ju.isString(el)) ? el: [ el ];\n var info;\n options = options || {};\n options.allowLoopback = false;\n Array.prototype.slice.call(el).forEach(function(_el) {\n info = this.info(_el);\n if (info.el) {\n this.initDroppable(info.el, options);\n }\n }.bind(this));\n return this;\n },\n\n initDroppable: function (el, options, category) {\n _getDragManager(this, category).droppable(el, options);\n },\n isAlreadyDraggable: function (el) {\n return el._katavorioDrag != null;\n },\n isDragSupported: function (el, options) {\n return true;\n },\n isDropSupported: function (el, options) {\n return true;\n },\n isElementDraggable: function (el) {\n el = _jp.getElement(el);\n return el._katavorioDrag && el._katavorioDrag.isEnabled();\n },\n getDragObject: function (eventArgs) {\n return eventArgs[0].drag.getDragElement();\n },\n getDragScope: function (el) {\n return el._katavorioDrag && el._katavorioDrag.scopes.join(\" \") || \"\";\n },\n getDropEvent: function (args) {\n return args[0].e;\n },\n getUIPosition: function (eventArgs, zoom) {\n // here the position reported to us by Katavorio is relative to the element's offsetParent. For top\n // level nodes that is fine, but if we have a nested draggable then its offsetParent is actually\n // not going to be the jsplumb container; it's going to be some child of that element. In that case\n // we want to adjust the UI position to account for the offsetParent's position relative to the Container\n // origin.\n var el = eventArgs[0].el;\n if (el.offsetParent == null) {\n return null;\n }\n var finalPos = eventArgs[0].finalPos || eventArgs[0].pos;\n var p = { left:finalPos[0], top:finalPos[1] };\n if (el._katavorioDrag && el.offsetParent !== this.getContainer()) {\n var oc = this.getOffset(el.offsetParent);\n p.left += oc.left;\n p.top += oc.top;\n }\n return p;\n },\n setDragFilter: function (el, filter, _exclude) {\n if (el._katavorioDrag) {\n el._katavorioDrag.setFilter(filter, _exclude);\n }\n },\n setElementDraggable: function (el, draggable) {\n el = _jp.getElement(el);\n if (el._katavorioDrag) {\n el._katavorioDrag.setEnabled(draggable);\n }\n },\n setDragScope: function (el, scope) {\n if (el._katavorioDrag) {\n el._katavorioDrag.k.setDragScope(el, scope);\n }\n },\n setDropScope:function(el, scope) {\n if (el._katavorioDrop && el._katavorioDrop.length > 0) {\n el._katavorioDrop[0].k.setDropScope(el, scope);\n }\n },\n addToPosse:function(el, spec) {\n var specs = Array.prototype.slice.call(arguments, 1);\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) {\n _el = [ _jp.getElement(_el) ];\n _el.push.apply(_el, specs );\n dm.addToPosse.apply(dm, _el);\n });\n },\n setPosse:function(el, spec) {\n var specs = Array.prototype.slice.call(arguments, 1);\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) {\n _el = [ _jp.getElement(_el) ];\n _el.push.apply(_el, specs );\n dm.setPosse.apply(dm, _el);\n });\n },\n removeFromPosse:function(el, posseId) {\n var specs = Array.prototype.slice.call(arguments, 1);\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) {\n _el = [ _jp.getElement(_el) ];\n _el.push.apply(_el, specs );\n dm.removeFromPosse.apply(dm, _el);\n });\n },\n removeFromAllPosses:function(el) {\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) { dm.removeFromAllPosses(_jp.getElement(_el)); });\n },\n setPosseState:function(el, posseId, state) {\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) { dm.setPosseState(_jp.getElement(_el), posseId, state); });\n },\n dragEvents: {\n 'start': 'start', 'stop': 'stop', 'drag': 'drag', 'step': 'step',\n 'over': 'over', 'out': 'out', 'drop': 'drop', 'complete': 'complete',\n 'beforeStart':'beforeStart'\n },\n animEvents: {\n 'step': \"step\", 'complete': 'complete'\n },\n stopDrag: function (el) {\n if (el._katavorioDrag) {\n el._katavorioDrag.abort();\n }\n },\n addToDragSelection: function (spec) {\n _getDragManager(this).select(spec);\n },\n removeFromDragSelection: function (spec) {\n _getDragManager(this).deselect(spec);\n },\n clearDragSelection: function () {\n _getDragManager(this).deselectAll();\n },\n trigger: function (el, event, originalEvent, payload) {\n this.getEventManager().trigger(el, event, originalEvent, payload);\n },\n doReset:function() {\n // look for katavorio instances and reset each one if found.\n for (var key in this) {\n if (key.indexOf(\"_katavorio_\") === 0) {\n this[key].reset();\n }\n }\n },\n getEventManager:function() {\n return _getEventManager(this);\n },\n on : function(el, event, callback) {\n // TODO: here we would like to map the tap event if we know its\n // an internal bind to a click. we have to know its internal because only\n // then can we be sure that the UP event wont be consumed (tap is a synthesized\n // event from a mousedown followed by a mouseup).\n //event = { \"click\":\"tap\", \"dblclick\":\"dbltap\"}[event] || event;\n this.getEventManager().on.apply(this, arguments);\n return this;\n },\n off : function(el, event, callback) {\n this.getEventManager().off.apply(this, arguments);\n return this;\n }\n\n });\n\n var ready = function (f) {\n var _do = function () {\n if (/complete|loaded|interactive/.test(document.readyState) && typeof(document.body) !== \"undefined\" && document.body != null) {\n f();\n }\n else {\n setTimeout(_do, 9);\n }\n };\n\n _do();\n };\n ready(_jp.init);\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/jsplumb/dist/js/jsplumb.js\n// module id = 721\n// module chunks = 3 4 5","\nimport i18n from '@/module/i18n'\n\n/**\n * cycle\n */\nconst cycleList = [\n {\n value: 'month',\n label: `${i18n.$t('月')}`\n },\n {\n value: 'week',\n label: `${i18n.$t('周')}`\n },\n {\n value: 'day',\n label: `${i18n.$t('日')}`\n },\n {\n value: 'hour',\n label: `${i18n.$t('时')}`\n }\n]\n\n/**\n * cycle value\n */\nconst dateValueList = {\n 'hour': [\n {\n value: 'last1Hour',\n label: `${i18n.$t('前1小时')}`\n },\n {\n value: 'last2Hours',\n label: `${i18n.$t('前2小时')}`\n },\n {\n value: 'last3Hours',\n label: `${i18n.$t('前3小时')}`\n }\n ],\n 'day': [\n {\n value: 'last1Days',\n label: `${i18n.$t('昨天')}`\n },\n {\n value: 'last2Days',\n label: `${i18n.$t('前两天')}`\n },\n {\n value: 'last3Days',\n label: `${i18n.$t('前三天')}`\n },\n {\n value: 'last7Days',\n label: `${i18n.$t('前七天')}`\n }\n ],\n 'week': [\n {\n value: 'lastWeek',\n label: `${i18n.$t('上周')}`\n },\n {\n value: 'lastMonday',\n label: `${i18n.$t('上周一')}`\n },\n {\n value: 'lastTuesday',\n label: `${i18n.$t('上周二')}`\n },\n {\n value: 'lastWednesday',\n label: `${i18n.$t('上周三')}`\n },\n {\n value: 'lastThursday',\n label: `${i18n.$t('上周四')}`\n },\n {\n value: 'lastFriday',\n label: `${i18n.$t('上周五')}`\n },\n {\n value: 'lastSaturday',\n label: `${i18n.$t('上周六')}`\n },\n {\n value: 'lastSunday',\n label: `${i18n.$t('上周日')}`\n }\n ],\n 'month': [\n {\n value: 'lastMonth',\n label: `${i18n.$t('上月')}`\n },\n {\n value: 'lastMonthBegin',\n label: `${i18n.$t('上月初')}`\n },\n {\n value: 'lastMonthEnd',\n label: `${i18n.$t('上月末')}`\n }\n ]\n}\n\n/**\n * direct\n */\nconst directList = [\n {\n id: 1,\n code: 'IN',\n disabled: false\n },\n {\n id: 2,\n code: 'OUT',\n disabled: false\n }\n]\n\n/**\n * type\n */\nconst typeList = [\n {\n id: 1,\n code: 'VARCHAR',\n disabled: false\n },\n {\n id: 2,\n code: 'INTEGER',\n disabled: false\n },\n {\n id: 3,\n code: 'LONG',\n disabled: false\n },\n {\n id: 4,\n code: 'FLOAT',\n disabled: false\n },\n {\n id: 5,\n code: 'DOUBLE',\n disabled: false\n },\n {\n id: 6,\n code: 'DATE',\n disabled: false\n },\n {\n id: 7,\n code: 'TIME',\n disabled: false\n },\n {\n id: 8,\n code: 'TIMESTAMP',\n disabled: false\n },\n {\n id: 9,\n code: 'BOOLEAN',\n disabled: false\n }\n]\n\n/**\n * sqlType\n */\nconst sqlTypeList = [\n {\n id: 0,\n code: `${i18n.$t('查询')}`\n },\n {\n id: 1,\n code: `${i18n.$t('非查询')}`\n }\n]\n\nexport {\n cycleList,\n dateValueList,\n typeList,\n directList,\n sqlTypeList\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/formModel/tasks/_source/commcon.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/log.vue","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var HINT_ELEMENT_CLASS = \"CodeMirror-hint\";\n var ACTIVE_HINT_ELEMENT_CLASS = \"CodeMirror-hint-active\";\n\n // This is the old interface, kept around for now to stay\n // backwards-compatible.\n CodeMirror.showHint = function(cm, getHints, options) {\n if (!getHints) return cm.showHint(options);\n if (options && options.async) getHints.async = true;\n var newOpts = {hint: getHints};\n if (options) for (var prop in options) newOpts[prop] = options[prop];\n return cm.showHint(newOpts);\n };\n\n CodeMirror.defineExtension(\"showHint\", function(options) {\n options = parseOptions(this, this.getCursor(\"start\"), options);\n var selections = this.listSelections()\n if (selections.length > 1) return;\n // By default, don't allow completion when something is selected.\n // A hint function can have a `supportsSelection` property to\n // indicate that it can handle selections.\n if (this.somethingSelected()) {\n if (!options.hint.supportsSelection) return;\n // Don't try with cross-line selections\n for (var i = 0; i < selections.length; i++)\n if (selections[i].head.line != selections[i].anchor.line) return;\n }\n\n if (this.state.completionActive) this.state.completionActive.close();\n var completion = this.state.completionActive = new Completion(this, options);\n if (!completion.options.hint) return;\n\n CodeMirror.signal(this, \"startCompletion\", this);\n completion.update(true);\n });\n\n CodeMirror.defineExtension(\"closeHint\", function() {\n if (this.state.completionActive) this.state.completionActive.close()\n })\n\n function Completion(cm, options) {\n this.cm = cm;\n this.options = options;\n this.widget = null;\n this.debounce = 0;\n this.tick = 0;\n this.startPos = this.cm.getCursor(\"start\");\n this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length;\n\n var self = this;\n cm.on(\"cursorActivity\", this.activityFunc = function() { self.cursorActivity(); });\n }\n\n var requestAnimationFrame = window.requestAnimationFrame || function(fn) {\n return setTimeout(fn, 1000/60);\n };\n var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;\n\n Completion.prototype = {\n close: function() {\n if (!this.active()) return;\n this.cm.state.completionActive = null;\n this.tick = null;\n this.cm.off(\"cursorActivity\", this.activityFunc);\n\n if (this.widget && this.data) CodeMirror.signal(this.data, \"close\");\n if (this.widget) this.widget.close();\n CodeMirror.signal(this.cm, \"endCompletion\", this.cm);\n },\n\n active: function() {\n return this.cm.state.completionActive == this;\n },\n\n pick: function(data, i) {\n var completion = data.list[i];\n if (completion.hint) completion.hint(this.cm, data, completion);\n else this.cm.replaceRange(getText(completion), completion.from || data.from,\n completion.to || data.to, \"complete\");\n CodeMirror.signal(data, \"pick\", completion);\n this.close();\n },\n\n cursorActivity: function() {\n if (this.debounce) {\n cancelAnimationFrame(this.debounce);\n this.debounce = 0;\n }\n\n var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line);\n if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch ||\n pos.ch < this.startPos.ch || this.cm.somethingSelected() ||\n (!pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {\n this.close();\n } else {\n var self = this;\n this.debounce = requestAnimationFrame(function() {self.update();});\n if (this.widget) this.widget.disable();\n }\n },\n\n update: function(first) {\n if (this.tick == null) return\n var self = this, myTick = ++this.tick\n fetchHints(this.options.hint, this.cm, this.options, function(data) {\n if (self.tick == myTick) self.finishUpdate(data, first)\n })\n },\n\n finishUpdate: function(data, first) {\n if (this.data) CodeMirror.signal(this.data, \"update\");\n\n var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);\n if (this.widget) this.widget.close();\n\n this.data = data;\n\n if (data && data.list.length) {\n if (picked && data.list.length == 1) {\n this.pick(data, 0);\n } else {\n this.widget = new Widget(this, data);\n CodeMirror.signal(data, \"shown\");\n }\n }\n }\n };\n\n function parseOptions(cm, pos, options) {\n var editor = cm.options.hintOptions;\n var out = {};\n for (var prop in defaultOptions) out[prop] = defaultOptions[prop];\n if (editor) for (var prop in editor)\n if (editor[prop] !== undefined) out[prop] = editor[prop];\n if (options) for (var prop in options)\n if (options[prop] !== undefined) out[prop] = options[prop];\n if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos)\n return out;\n }\n\n function getText(completion) {\n if (typeof completion == \"string\") return completion;\n else return completion.text;\n }\n\n function buildKeyMap(completion, handle) {\n var baseMap = {\n Up: function() {handle.moveFocus(-1);},\n Down: function() {handle.moveFocus(1);},\n PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);},\n PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);},\n Home: function() {handle.setFocus(0);},\n End: function() {handle.setFocus(handle.length - 1);},\n Enter: handle.pick,\n Tab: handle.pick,\n Esc: handle.close\n };\n\n var mac = /Mac/.test(navigator.platform);\n\n if (mac) {\n baseMap[\"Ctrl-P\"] = function() {handle.moveFocus(-1);};\n baseMap[\"Ctrl-N\"] = function() {handle.moveFocus(1);};\n }\n\n var custom = completion.options.customKeys;\n var ourMap = custom ? {} : baseMap;\n function addBinding(key, val) {\n var bound;\n if (typeof val != \"string\")\n bound = function(cm) { return val(cm, handle); };\n // This mechanism is deprecated\n else if (baseMap.hasOwnProperty(val))\n bound = baseMap[val];\n else\n bound = val;\n ourMap[key] = bound;\n }\n if (custom)\n for (var key in custom) if (custom.hasOwnProperty(key))\n addBinding(key, custom[key]);\n var extra = completion.options.extraKeys;\n if (extra)\n for (var key in extra) if (extra.hasOwnProperty(key))\n addBinding(key, extra[key]);\n return ourMap;\n }\n\n function getHintElement(hintsElement, el) {\n while (el && el != hintsElement) {\n if (el.nodeName.toUpperCase() === \"LI\" && el.parentNode == hintsElement) return el;\n el = el.parentNode;\n }\n }\n\n function Widget(completion, data) {\n this.completion = completion;\n this.data = data;\n this.picked = false;\n var widget = this, cm = completion.cm;\n var ownerDocument = cm.getInputField().ownerDocument;\n var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow;\n\n var hints = this.hints = ownerDocument.createElement(\"ul\");\n var theme = completion.cm.options.theme;\n hints.className = \"CodeMirror-hints \" + theme;\n this.selectedHint = data.selectedHint || 0;\n\n var completions = data.list;\n for (var i = 0; i < completions.length; ++i) {\n var elt = hints.appendChild(ownerDocument.createElement(\"li\")), cur = completions[i];\n var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? \"\" : \" \" + ACTIVE_HINT_ELEMENT_CLASS);\n if (cur.className != null) className = cur.className + \" \" + className;\n elt.className = className;\n if (cur.render) cur.render(elt, data, cur);\n else elt.appendChild(ownerDocument.createTextNode(cur.displayText || getText(cur)));\n elt.hintId = i;\n }\n\n var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);\n var left = pos.left, top = pos.bottom, below = true;\n hints.style.left = left + \"px\";\n hints.style.top = top + \"px\";\n // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.\n var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth);\n var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight);\n (completion.options.container || ownerDocument.body).appendChild(hints);\n var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH;\n var scrolls = hints.scrollHeight > hints.clientHeight + 1\n var startScroll = cm.getScrollInfo();\n\n if (overlapY > 0) {\n var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);\n if (curTop - height > 0) { // Fits above cursor\n hints.style.top = (top = pos.top - height) + \"px\";\n below = false;\n } else if (height > winH) {\n hints.style.height = (winH - 5) + \"px\";\n hints.style.top = (top = pos.bottom - box.top) + \"px\";\n var cursor = cm.getCursor();\n if (data.from.ch != cursor.ch) {\n pos = cm.cursorCoords(cursor);\n hints.style.left = (left = pos.left) + \"px\";\n box = hints.getBoundingClientRect();\n }\n }\n }\n var overlapX = box.right - winW;\n if (overlapX > 0) {\n if (box.right - box.left > winW) {\n hints.style.width = (winW - 5) + \"px\";\n overlapX -= (box.right - box.left) - winW;\n }\n hints.style.left = (left = pos.left - overlapX) + \"px\";\n }\n if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling)\n node.style.paddingRight = cm.display.nativeBarWidth + \"px\"\n\n cm.addKeyMap(this.keyMap = buildKeyMap(completion, {\n moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },\n setFocus: function(n) { widget.changeActive(n); },\n menuSize: function() { return widget.screenAmount(); },\n length: completions.length,\n close: function() { completion.close(); },\n pick: function() { widget.pick(); },\n data: data\n }));\n\n if (completion.options.closeOnUnfocus) {\n var closingOnBlur;\n cm.on(\"blur\", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });\n cm.on(\"focus\", this.onFocus = function() { clearTimeout(closingOnBlur); });\n }\n\n cm.on(\"scroll\", this.onScroll = function() {\n var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();\n var newTop = top + startScroll.top - curScroll.top;\n var point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop);\n if (!below) point += hints.offsetHeight;\n if (point <= editor.top || point >= editor.bottom) return completion.close();\n hints.style.top = newTop + \"px\";\n hints.style.left = (left + startScroll.left - curScroll.left) + \"px\";\n });\n\n CodeMirror.on(hints, \"dblclick\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}\n });\n\n CodeMirror.on(hints, \"click\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {\n widget.changeActive(t.hintId);\n if (completion.options.completeOnSingleClick) widget.pick();\n }\n });\n\n CodeMirror.on(hints, \"mousedown\", function() {\n setTimeout(function(){cm.focus();}, 20);\n });\n\n CodeMirror.signal(data, \"select\", completions[this.selectedHint], hints.childNodes[this.selectedHint]);\n return true;\n }\n\n Widget.prototype = {\n close: function() {\n if (this.completion.widget != this) return;\n this.completion.widget = null;\n this.hints.parentNode.removeChild(this.hints);\n this.completion.cm.removeKeyMap(this.keyMap);\n\n var cm = this.completion.cm;\n if (this.completion.options.closeOnUnfocus) {\n cm.off(\"blur\", this.onBlur);\n cm.off(\"focus\", this.onFocus);\n }\n cm.off(\"scroll\", this.onScroll);\n },\n\n disable: function() {\n this.completion.cm.removeKeyMap(this.keyMap);\n var widget = this;\n this.keyMap = {Enter: function() { widget.picked = true; }};\n this.completion.cm.addKeyMap(this.keyMap);\n },\n\n pick: function() {\n this.completion.pick(this.data, this.selectedHint);\n },\n\n changeActive: function(i, avoidWrap) {\n if (i >= this.data.list.length)\n i = avoidWrap ? this.data.list.length - 1 : 0;\n else if (i < 0)\n i = avoidWrap ? 0 : this.data.list.length - 1;\n if (this.selectedHint == i) return;\n var node = this.hints.childNodes[this.selectedHint];\n if (node) node.className = node.className.replace(\" \" + ACTIVE_HINT_ELEMENT_CLASS, \"\");\n node = this.hints.childNodes[this.selectedHint = i];\n node.className += \" \" + ACTIVE_HINT_ELEMENT_CLASS;\n if (node.offsetTop < this.hints.scrollTop)\n this.hints.scrollTop = node.offsetTop - 3;\n else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)\n this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3;\n CodeMirror.signal(this.data, \"select\", this.data.list[this.selectedHint], node);\n },\n\n screenAmount: function() {\n return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;\n }\n };\n\n function applicableHelpers(cm, helpers) {\n if (!cm.somethingSelected()) return helpers\n var result = []\n for (var i = 0; i < helpers.length; i++)\n if (helpers[i].supportsSelection) result.push(helpers[i])\n return result\n }\n\n function fetchHints(hint, cm, options, callback) {\n if (hint.async) {\n hint(cm, callback, options)\n } else {\n var result = hint(cm, options)\n if (result && result.then) result.then(callback)\n else callback(result)\n }\n }\n\n function resolveAutoHints(cm, pos) {\n var helpers = cm.getHelpers(pos, \"hint\"), words\n if (helpers.length) {\n var resolved = function(cm, callback, options) {\n var app = applicableHelpers(cm, helpers);\n function run(i) {\n if (i == app.length) return callback(null)\n fetchHints(app[i], cm, options, function(result) {\n if (result && result.list.length > 0) callback(result)\n else run(i + 1)\n })\n }\n run(0)\n }\n resolved.async = true\n resolved.supportsSelection = true\n return resolved\n } else if (words = cm.getHelper(cm.getCursor(), \"hintWords\")) {\n return function(cm) { return CodeMirror.hint.fromList(cm, {words: words}) }\n } else if (CodeMirror.hint.anyword) {\n return function(cm, options) { return CodeMirror.hint.anyword(cm, options) }\n } else {\n return function() {}\n }\n }\n\n CodeMirror.registerHelper(\"hint\", \"auto\", {\n resolve: resolveAutoHints\n });\n\n CodeMirror.registerHelper(\"hint\", \"fromList\", function(cm, options) {\n var cur = cm.getCursor(), token = cm.getTokenAt(cur)\n var term, from = CodeMirror.Pos(cur.line, token.start), to = cur\n if (token.start < cur.ch && /\\w/.test(token.string.charAt(cur.ch - token.start - 1))) {\n term = token.string.substr(0, cur.ch - token.start)\n } else {\n term = \"\"\n from = cur\n }\n var found = [];\n for (var i = 0; i < options.words.length; i++) {\n var word = options.words[i];\n if (word.slice(0, term.length) == term)\n found.push(word);\n }\n\n if (found.length) return {list: found, from: from, to: to};\n });\n\n CodeMirror.commands.autocomplete = CodeMirror.showHint;\n\n var defaultOptions = {\n hint: CodeMirror.hint.auto,\n completeSingle: true,\n alignWithWord: true,\n closeCharacters: /[\\s()\\[\\]{};:>,]/,\n closeOnUnfocus: true,\n completeOnSingleClick: true,\n container: null,\n customKeys: null,\n extraKeys: null\n };\n\n CodeMirror.defineOption(\"hintOptions\", null);\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/addon/hint/show-hint.js\n// module id = 725\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"../../mode/sql/sql\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"../../mode/sql/sql\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var tables;\n var defaultTable;\n var keywords;\n var identifierQuote;\n var CONS = {\n QUERY_DIV: \";\",\n ALIAS_KEYWORD: \"AS\"\n };\n var Pos = CodeMirror.Pos, cmpPos = CodeMirror.cmpPos;\n\n function isArray(val) { return Object.prototype.toString.call(val) == \"[object Array]\" }\n\n function getKeywords(editor) {\n var mode = editor.doc.modeOption;\n if (mode === \"sql\") mode = \"text/x-sql\";\n return CodeMirror.resolveMode(mode).keywords;\n }\n\n function getIdentifierQuote(editor) {\n var mode = editor.doc.modeOption;\n if (mode === \"sql\") mode = \"text/x-sql\";\n return CodeMirror.resolveMode(mode).identifierQuote || \"`\";\n }\n\n function getText(item) {\n return typeof item == \"string\" ? item : item.text;\n }\n\n function wrapTable(name, value) {\n if (isArray(value)) value = {columns: value}\n if (!value.text) value.text = name\n return value\n }\n\n function parseTables(input) {\n var result = {}\n if (isArray(input)) {\n for (var i = input.length - 1; i >= 0; i--) {\n var item = input[i]\n result[getText(item).toUpperCase()] = wrapTable(getText(item), item)\n }\n } else if (input) {\n for (var name in input)\n result[name.toUpperCase()] = wrapTable(name, input[name])\n }\n return result\n }\n\n function getTable(name) {\n return tables[name.toUpperCase()]\n }\n\n function shallowClone(object) {\n var result = {};\n for (var key in object) if (object.hasOwnProperty(key))\n result[key] = object[key];\n return result;\n }\n\n function match(string, word) {\n var len = string.length;\n var sub = getText(word).substr(0, len);\n return string.toUpperCase() === sub.toUpperCase();\n }\n\n function addMatches(result, search, wordlist, formatter) {\n if (isArray(wordlist)) {\n for (var i = 0; i < wordlist.length; i++)\n if (match(search, wordlist[i])) result.push(formatter(wordlist[i]))\n } else {\n for (var word in wordlist) if (wordlist.hasOwnProperty(word)) {\n var val = wordlist[word]\n if (!val || val === true)\n val = word\n else\n val = val.displayText ? {text: val.text, displayText: val.displayText} : val.text\n if (match(search, val)) result.push(formatter(val))\n }\n }\n }\n\n function cleanName(name) {\n // Get rid name from identifierQuote and preceding dot(.)\n if (name.charAt(0) == \".\") {\n name = name.substr(1);\n }\n // replace doublicated identifierQuotes with single identifierQuotes\n // and remove single identifierQuotes\n var nameParts = name.split(identifierQuote+identifierQuote);\n for (var i = 0; i < nameParts.length; i++)\n nameParts[i] = nameParts[i].replace(new RegExp(identifierQuote,\"g\"), \"\");\n return nameParts.join(identifierQuote);\n }\n\n function insertIdentifierQuotes(name) {\n var nameParts = getText(name).split(\".\");\n for (var i = 0; i < nameParts.length; i++)\n nameParts[i] = identifierQuote +\n // doublicate identifierQuotes\n nameParts[i].replace(new RegExp(identifierQuote,\"g\"), identifierQuote+identifierQuote) +\n identifierQuote;\n var escaped = nameParts.join(\".\");\n if (typeof name == \"string\") return escaped;\n name = shallowClone(name);\n name.text = escaped;\n return name;\n }\n\n function nameCompletion(cur, token, result, editor) {\n // Try to complete table, column names and return start position of completion\n var useIdentifierQuotes = false;\n var nameParts = [];\n var start = token.start;\n var cont = true;\n while (cont) {\n cont = (token.string.charAt(0) == \".\");\n useIdentifierQuotes = useIdentifierQuotes || (token.string.charAt(0) == identifierQuote);\n\n start = token.start;\n nameParts.unshift(cleanName(token.string));\n\n token = editor.getTokenAt(Pos(cur.line, token.start));\n if (token.string == \".\") {\n cont = true;\n token = editor.getTokenAt(Pos(cur.line, token.start));\n }\n }\n\n // Try to complete table names\n var string = nameParts.join(\".\");\n addMatches(result, string, tables, function(w) {\n return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;\n });\n\n // Try to complete columns from defaultTable\n addMatches(result, string, defaultTable, function(w) {\n return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;\n });\n\n // Try to complete columns\n string = nameParts.pop();\n var table = nameParts.join(\".\");\n\n var alias = false;\n var aliasTable = table;\n // Check if table is available. If not, find table by Alias\n if (!getTable(table)) {\n var oldTable = table;\n table = findTableByAlias(table, editor);\n if (table !== oldTable) alias = true;\n }\n\n var columns = getTable(table);\n if (columns && columns.columns)\n columns = columns.columns;\n\n if (columns) {\n addMatches(result, string, columns, function(w) {\n var tableInsert = table;\n if (alias == true) tableInsert = aliasTable;\n if (typeof w == \"string\") {\n w = tableInsert + \".\" + w;\n } else {\n w = shallowClone(w);\n w.text = tableInsert + \".\" + w.text;\n }\n return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;\n });\n }\n\n return start;\n }\n\n function eachWord(lineText, f) {\n var words = lineText.split(/\\s+/)\n for (var i = 0; i < words.length; i++)\n if (words[i]) f(words[i].replace(/[,;]/g, ''))\n }\n\n function findTableByAlias(alias, editor) {\n var doc = editor.doc;\n var fullQuery = doc.getValue();\n var aliasUpperCase = alias.toUpperCase();\n var previousWord = \"\";\n var table = \"\";\n var separator = [];\n var validRange = {\n start: Pos(0, 0),\n end: Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).length)\n };\n\n //add separator\n var indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV);\n while(indexOfSeparator != -1) {\n separator.push(doc.posFromIndex(indexOfSeparator));\n indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV, indexOfSeparator+1);\n }\n separator.unshift(Pos(0, 0));\n separator.push(Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).text.length));\n\n //find valid range\n var prevItem = null;\n var current = editor.getCursor()\n for (var i = 0; i < separator.length; i++) {\n if ((prevItem == null || cmpPos(current, prevItem) > 0) && cmpPos(current, separator[i]) <= 0) {\n validRange = {start: prevItem, end: separator[i]};\n break;\n }\n prevItem = separator[i];\n }\n\n if (validRange.start) {\n var query = doc.getRange(validRange.start, validRange.end, false);\n\n for (var i = 0; i < query.length; i++) {\n var lineText = query[i];\n eachWord(lineText, function(word) {\n var wordUpperCase = word.toUpperCase();\n if (wordUpperCase === aliasUpperCase && getTable(previousWord))\n table = previousWord;\n if (wordUpperCase !== CONS.ALIAS_KEYWORD)\n previousWord = word;\n });\n if (table) break;\n }\n }\n return table;\n }\n\n CodeMirror.registerHelper(\"hint\", \"sql\", function(editor, options) {\n tables = parseTables(options && options.tables)\n var defaultTableName = options && options.defaultTable;\n var disableKeywords = options && options.disableKeywords;\n defaultTable = defaultTableName && getTable(defaultTableName);\n keywords = getKeywords(editor);\n identifierQuote = getIdentifierQuote(editor);\n\n if (defaultTableName && !defaultTable)\n defaultTable = findTableByAlias(defaultTableName, editor);\n\n defaultTable = defaultTable || [];\n\n if (defaultTable.columns)\n defaultTable = defaultTable.columns;\n\n var cur = editor.getCursor();\n var result = [];\n var token = editor.getTokenAt(cur), start, end, search;\n if (token.end > cur.ch) {\n token.end = cur.ch;\n token.string = token.string.slice(0, cur.ch - token.start);\n }\n\n if (token.string.match(/^[.`\"\\w@]\\w*$/)) {\n search = token.string;\n start = token.start;\n end = token.end;\n } else {\n start = end = cur.ch;\n search = \"\";\n }\n if (search.charAt(0) == \".\" || search.charAt(0) == identifierQuote) {\n start = nameCompletion(cur, token, result, editor);\n } else {\n var objectOrClass = function(w, className) {\n if (typeof w === \"object\") {\n w.className = className;\n } else {\n w = { text: w, className: className };\n }\n return w;\n };\n addMatches(result, search, defaultTable, function(w) {\n return objectOrClass(w, \"CodeMirror-hint-table CodeMirror-hint-default-table\");\n });\n addMatches(\n result,\n search,\n tables, function(w) {\n return objectOrClass(w, \"CodeMirror-hint-table\");\n }\n );\n if (!disableKeywords)\n addMatches(result, search, keywords, function(w) {\n return objectOrClass(w.toUpperCase(), \"CodeMirror-hint-keyword\");\n });\n }\n\n return {list: result, from: Pos(cur.line, start), to: Pos(cur.line, end)};\n });\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/addon/hint/sql-hint.js\n// module id = 726\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var Pos = CodeMirror.Pos;\n\n function matches(hint, typed, matchInMiddle) {\n if (matchInMiddle) return hint.indexOf(typed) >= 0;\n else return hint.lastIndexOf(typed, 0) == 0;\n }\n\n function getHints(cm, options) {\n var tags = options && options.schemaInfo;\n var quote = (options && options.quoteChar) || '\"';\n var matchInMiddle = options && options.matchInMiddle;\n if (!tags) return;\n var cur = cm.getCursor(), token = cm.getTokenAt(cur);\n if (token.end > cur.ch) {\n token.end = cur.ch;\n token.string = token.string.slice(0, cur.ch - token.start);\n }\n var inner = CodeMirror.innerMode(cm.getMode(), token.state);\n if (inner.mode.name != \"xml\") return;\n var result = [], replaceToken = false, prefix;\n var tag = /\\btag\\b/.test(token.type) && !/>$/.test(token.string);\n var tagName = tag && /^\\w/.test(token.string), tagStart;\n\n if (tagName) {\n var before = cm.getLine(cur.line).slice(Math.max(0, token.start - 2), token.start);\n var tagType = /<\\/$/.test(before) ? \"close\" : /<$/.test(before) ? \"open\" : null;\n if (tagType) tagStart = token.start - (tagType == \"close\" ? 2 : 1);\n } else if (tag && token.string == \"<\") {\n tagType = \"open\";\n } else if (tag && token.string == \"\");\n } else {\n // Attribute completion\n var curTag = tags[inner.state.tagName], attrs = curTag && curTag.attrs;\n var globalAttrs = tags[\"!attrs\"];\n if (!attrs && !globalAttrs) return;\n if (!attrs) {\n attrs = globalAttrs;\n } else if (globalAttrs) { // Combine tag-local and global attributes\n var set = {};\n for (var nm in globalAttrs) if (globalAttrs.hasOwnProperty(nm)) set[nm] = globalAttrs[nm];\n for (var nm in attrs) if (attrs.hasOwnProperty(nm)) set[nm] = attrs[nm];\n attrs = set;\n }\n if (token.type == \"string\" || token.string == \"=\") { // A value\n var before = cm.getRange(Pos(cur.line, Math.max(0, cur.ch - 60)),\n Pos(cur.line, token.type == \"string\" ? token.start : token.end));\n var atName = before.match(/([^\\s\\u00a0=<>\\\"\\']+)=$/), atValues;\n if (!atName || !attrs.hasOwnProperty(atName[1]) || !(atValues = attrs[atName[1]])) return;\n if (typeof atValues == 'function') atValues = atValues.call(this, cm); // Functions can be used to supply values for autocomplete widget\n if (token.type == \"string\") {\n prefix = token.string;\n var n = 0;\n if (/['\"]/.test(token.string.charAt(0))) {\n quote = token.string.charAt(0);\n prefix = token.string.slice(1);\n n++;\n }\n var len = token.string.length;\n if (/['\"]/.test(token.string.charAt(len - 1))) {\n quote = token.string.charAt(len - 1);\n prefix = token.string.substr(n, len - 2);\n }\n replaceToken = true;\n }\n for (var i = 0; i < atValues.length; ++i) if (!prefix || matches(atValues[i], prefix, matchInMiddle))\n result.push(quote + atValues[i] + quote);\n } else { // An attribute name\n if (token.type == \"attribute\") {\n prefix = token.string;\n replaceToken = true;\n }\n for (var attr in attrs) if (attrs.hasOwnProperty(attr) && (!prefix || matches(attr, prefix, matchInMiddle)))\n result.push(attr);\n }\n }\n return {\n list: result,\n from: replaceToken ? Pos(cur.line, tagStart == null ? token.start : tagStart) : cur,\n to: replaceToken ? Pos(cur.line, token.end) : cur\n };\n }\n\n CodeMirror.registerHelper(\"hint\", \"xml\", getHints);\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/addon/hint/xml-hint.js\n// module id = 727\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n function wordRegexp(words) {\n return new RegExp(\"^((\" + words.join(\")|(\") + \"))\\\\b\");\n }\n\n var wordOperators = wordRegexp([\"and\", \"or\", \"not\", \"is\"]);\n var commonKeywords = [\"as\", \"assert\", \"break\", \"class\", \"continue\",\n \"def\", \"del\", \"elif\", \"else\", \"except\", \"finally\",\n \"for\", \"from\", \"global\", \"if\", \"import\",\n \"lambda\", \"pass\", \"raise\", \"return\",\n \"try\", \"while\", \"with\", \"yield\", \"in\"];\n var commonBuiltins = [\"abs\", \"all\", \"any\", \"bin\", \"bool\", \"bytearray\", \"callable\", \"chr\",\n \"classmethod\", \"compile\", \"complex\", \"delattr\", \"dict\", \"dir\", \"divmod\",\n \"enumerate\", \"eval\", \"filter\", \"float\", \"format\", \"frozenset\",\n \"getattr\", \"globals\", \"hasattr\", \"hash\", \"help\", \"hex\", \"id\",\n \"input\", \"int\", \"isinstance\", \"issubclass\", \"iter\", \"len\",\n \"list\", \"locals\", \"map\", \"max\", \"memoryview\", \"min\", \"next\",\n \"object\", \"oct\", \"open\", \"ord\", \"pow\", \"property\", \"range\",\n \"repr\", \"reversed\", \"round\", \"set\", \"setattr\", \"slice\",\n \"sorted\", \"staticmethod\", \"str\", \"sum\", \"super\", \"tuple\",\n \"type\", \"vars\", \"zip\", \"__import__\", \"NotImplemented\",\n \"Ellipsis\", \"__debug__\"];\n CodeMirror.registerHelper(\"hintWords\", \"python\", commonKeywords.concat(commonBuiltins));\n\n function top(state) {\n return state.scopes[state.scopes.length - 1];\n }\n\n CodeMirror.defineMode(\"python\", function(conf, parserConf) {\n var ERRORCLASS = \"error\";\n\n var delimiters = parserConf.delimiters || parserConf.singleDelimiters || /^[\\(\\)\\[\\]\\{\\}@,:`=;\\.\\\\]/;\n // (Backwards-compatiblity with old, cumbersome config system)\n var operators = [parserConf.singleOperators, parserConf.doubleOperators, parserConf.doubleDelimiters, parserConf.tripleDelimiters,\n parserConf.operators || /^([-+*/%\\/&|^]=?|[<>=]+|\\/\\/=?|\\*\\*=?|!=|[~!@])/]\n for (var i = 0; i < operators.length; i++) if (!operators[i]) operators.splice(i--, 1)\n\n var hangingIndent = parserConf.hangingIndent || conf.indentUnit;\n\n var myKeywords = commonKeywords, myBuiltins = commonBuiltins;\n if (parserConf.extra_keywords != undefined)\n myKeywords = myKeywords.concat(parserConf.extra_keywords);\n\n if (parserConf.extra_builtins != undefined)\n myBuiltins = myBuiltins.concat(parserConf.extra_builtins);\n\n var py3 = !(parserConf.version && Number(parserConf.version) < 3)\n if (py3) {\n // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator\n var identifiers = parserConf.identifiers|| /^[_A-Za-z\\u00A1-\\uFFFF][_A-Za-z0-9\\u00A1-\\uFFFF]*/;\n myKeywords = myKeywords.concat([\"nonlocal\", \"False\", \"True\", \"None\", \"async\", \"await\"]);\n myBuiltins = myBuiltins.concat([\"ascii\", \"bytes\", \"exec\", \"print\"]);\n var stringPrefixes = new RegExp(\"^(([rbuf]|(br)|(fr))?('{3}|\\\"{3}|['\\\"]))\", \"i\");\n } else {\n var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/;\n myKeywords = myKeywords.concat([\"exec\", \"print\"]);\n myBuiltins = myBuiltins.concat([\"apply\", \"basestring\", \"buffer\", \"cmp\", \"coerce\", \"execfile\",\n \"file\", \"intern\", \"long\", \"raw_input\", \"reduce\", \"reload\",\n \"unichr\", \"unicode\", \"xrange\", \"False\", \"True\", \"None\"]);\n var stringPrefixes = new RegExp(\"^(([rubf]|(ur)|(br))?('{3}|\\\"{3}|['\\\"]))\", \"i\");\n }\n var keywords = wordRegexp(myKeywords);\n var builtins = wordRegexp(myBuiltins);\n\n // tokenizers\n function tokenBase(stream, state) {\n var sol = stream.sol() && state.lastToken != \"\\\\\"\n if (sol) state.indent = stream.indentation()\n // Handle scope changes\n if (sol && top(state).type == \"py\") {\n var scopeOffset = top(state).offset;\n if (stream.eatSpace()) {\n var lineOffset = stream.indentation();\n if (lineOffset > scopeOffset)\n pushPyScope(state);\n else if (lineOffset < scopeOffset && dedent(stream, state) && stream.peek() != \"#\")\n state.errorToken = true;\n return null;\n } else {\n var style = tokenBaseInner(stream, state);\n if (scopeOffset > 0 && dedent(stream, state))\n style += \" \" + ERRORCLASS;\n return style;\n }\n }\n return tokenBaseInner(stream, state);\n }\n\n function tokenBaseInner(stream, state) {\n if (stream.eatSpace()) return null;\n\n // Handle Comments\n if (stream.match(/^#.*/)) return \"comment\";\n\n // Handle Number Literals\n if (stream.match(/^[0-9\\.]/, false)) {\n var floatLiteral = false;\n // Floats\n if (stream.match(/^[\\d_]*\\.\\d+(e[\\+\\-]?\\d+)?/i)) { floatLiteral = true; }\n if (stream.match(/^[\\d_]+\\.\\d*/)) { floatLiteral = true; }\n if (stream.match(/^\\.\\d+/)) { floatLiteral = true; }\n if (floatLiteral) {\n // Float literals may be \"imaginary\"\n stream.eat(/J/i);\n return \"number\";\n }\n // Integers\n var intLiteral = false;\n // Hex\n if (stream.match(/^0x[0-9a-f_]+/i)) intLiteral = true;\n // Binary\n if (stream.match(/^0b[01_]+/i)) intLiteral = true;\n // Octal\n if (stream.match(/^0o[0-7_]+/i)) intLiteral = true;\n // Decimal\n if (stream.match(/^[1-9][\\d_]*(e[\\+\\-]?[\\d_]+)?/)) {\n // Decimal literals may be \"imaginary\"\n stream.eat(/J/i);\n // TODO - Can you have imaginary longs?\n intLiteral = true;\n }\n // Zero by itself with no other piece of number.\n if (stream.match(/^0(?![\\dx])/i)) intLiteral = true;\n if (intLiteral) {\n // Integer literals may be \"long\"\n stream.eat(/L/i);\n return \"number\";\n }\n }\n\n // Handle Strings\n if (stream.match(stringPrefixes)) {\n var isFmtString = stream.current().toLowerCase().indexOf('f') !== -1;\n if (!isFmtString) {\n state.tokenize = tokenStringFactory(stream.current(), state.tokenize);\n return state.tokenize(stream, state);\n } else {\n state.tokenize = formatStringFactory(stream.current(), state.tokenize);\n return state.tokenize(stream, state);\n }\n }\n\n for (var i = 0; i < operators.length; i++)\n if (stream.match(operators[i])) return \"operator\"\n\n if (stream.match(delimiters)) return \"punctuation\";\n\n if (state.lastToken == \".\" && stream.match(identifiers))\n return \"property\";\n\n if (stream.match(keywords) || stream.match(wordOperators))\n return \"keyword\";\n\n if (stream.match(builtins))\n return \"builtin\";\n\n if (stream.match(/^(self|cls)\\b/))\n return \"variable-2\";\n\n if (stream.match(identifiers)) {\n if (state.lastToken == \"def\" || state.lastToken == \"class\")\n return \"def\";\n return \"variable\";\n }\n\n // Handle non-detected items\n stream.next();\n return ERRORCLASS;\n }\n\n function formatStringFactory(delimiter, tokenOuter) {\n while (\"rubf\".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)\n delimiter = delimiter.substr(1);\n\n var singleline = delimiter.length == 1;\n var OUTCLASS = \"string\";\n\n function tokenNestedExpr(depth) {\n return function(stream, state) {\n var inner = tokenBaseInner(stream, state)\n if (inner == \"punctuation\") {\n if (stream.current() == \"{\") {\n state.tokenize = tokenNestedExpr(depth + 1)\n } else if (stream.current() == \"}\") {\n if (depth > 1) state.tokenize = tokenNestedExpr(depth - 1)\n else state.tokenize = tokenString\n }\n }\n return inner\n }\n }\n\n function tokenString(stream, state) {\n while (!stream.eol()) {\n stream.eatWhile(/[^'\"\\{\\}\\\\]/);\n if (stream.eat(\"\\\\\")) {\n stream.next();\n if (singleline && stream.eol())\n return OUTCLASS;\n } else if (stream.match(delimiter)) {\n state.tokenize = tokenOuter;\n return OUTCLASS;\n } else if (stream.match('{{')) {\n // ignore {{ in f-str\n return OUTCLASS;\n } else if (stream.match('{', false)) {\n // switch to nested mode\n state.tokenize = tokenNestedExpr(0)\n if (stream.current()) return OUTCLASS;\n else return state.tokenize(stream, state)\n } else if (stream.match('}}')) {\n return OUTCLASS;\n } else if (stream.match('}')) {\n // single } in f-string is an error\n return ERRORCLASS;\n } else {\n stream.eat(/['\"]/);\n }\n }\n if (singleline) {\n if (parserConf.singleLineStringErrors)\n return ERRORCLASS;\n else\n state.tokenize = tokenOuter;\n }\n return OUTCLASS;\n }\n tokenString.isString = true;\n return tokenString;\n }\n\n function tokenStringFactory(delimiter, tokenOuter) {\n while (\"rubf\".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)\n delimiter = delimiter.substr(1);\n\n var singleline = delimiter.length == 1;\n var OUTCLASS = \"string\";\n\n function tokenString(stream, state) {\n while (!stream.eol()) {\n stream.eatWhile(/[^'\"\\\\]/);\n if (stream.eat(\"\\\\\")) {\n stream.next();\n if (singleline && stream.eol())\n return OUTCLASS;\n } else if (stream.match(delimiter)) {\n state.tokenize = tokenOuter;\n return OUTCLASS;\n } else {\n stream.eat(/['\"]/);\n }\n }\n if (singleline) {\n if (parserConf.singleLineStringErrors)\n return ERRORCLASS;\n else\n state.tokenize = tokenOuter;\n }\n return OUTCLASS;\n }\n tokenString.isString = true;\n return tokenString;\n }\n\n function pushPyScope(state) {\n while (top(state).type != \"py\") state.scopes.pop()\n state.scopes.push({offset: top(state).offset + conf.indentUnit,\n type: \"py\",\n align: null})\n }\n\n function pushBracketScope(stream, state, type) {\n var align = stream.match(/^([\\s\\[\\{\\(]|#.*)*$/, false) ? null : stream.column() + 1\n state.scopes.push({offset: state.indent + hangingIndent,\n type: type,\n align: align})\n }\n\n function dedent(stream, state) {\n var indented = stream.indentation();\n while (state.scopes.length > 1 && top(state).offset > indented) {\n if (top(state).type != \"py\") return true;\n state.scopes.pop();\n }\n return top(state).offset != indented;\n }\n\n function tokenLexer(stream, state) {\n if (stream.sol()) state.beginningOfLine = true;\n\n var style = state.tokenize(stream, state);\n var current = stream.current();\n\n // Handle decorators\n if (state.beginningOfLine && current == \"@\")\n return stream.match(identifiers, false) ? \"meta\" : py3 ? \"operator\" : ERRORCLASS;\n\n if (/\\S/.test(current)) state.beginningOfLine = false;\n\n if ((style == \"variable\" || style == \"builtin\")\n && state.lastToken == \"meta\")\n style = \"meta\";\n\n // Handle scope changes.\n if (current == \"pass\" || current == \"return\")\n state.dedent += 1;\n\n if (current == \"lambda\") state.lambda = true;\n if (current == \":\" && !state.lambda && top(state).type == \"py\")\n pushPyScope(state);\n\n if (current.length == 1 && !/string|comment/.test(style)) {\n var delimiter_index = \"[({\".indexOf(current);\n if (delimiter_index != -1)\n pushBracketScope(stream, state, \"])}\".slice(delimiter_index, delimiter_index+1));\n\n delimiter_index = \"])}\".indexOf(current);\n if (delimiter_index != -1) {\n if (top(state).type == current) state.indent = state.scopes.pop().offset - hangingIndent\n else return ERRORCLASS;\n }\n }\n if (state.dedent > 0 && stream.eol() && top(state).type == \"py\") {\n if (state.scopes.length > 1) state.scopes.pop();\n state.dedent -= 1;\n }\n\n return style;\n }\n\n var external = {\n startState: function(basecolumn) {\n return {\n tokenize: tokenBase,\n scopes: [{offset: basecolumn || 0, type: \"py\", align: null}],\n indent: basecolumn || 0,\n lastToken: null,\n lambda: false,\n dedent: 0\n };\n },\n\n token: function(stream, state) {\n var addErr = state.errorToken;\n if (addErr) state.errorToken = false;\n var style = tokenLexer(stream, state);\n\n if (style && style != \"comment\")\n state.lastToken = (style == \"keyword\" || style == \"punctuation\") ? stream.current() : style;\n if (style == \"punctuation\") style = null;\n\n if (stream.eol() && state.lambda)\n state.lambda = false;\n return addErr ? style + \" \" + ERRORCLASS : style;\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize != tokenBase)\n return state.tokenize.isString ? CodeMirror.Pass : 0;\n\n var scope = top(state), closing = scope.type == textAfter.charAt(0)\n if (scope.align != null)\n return scope.align - (closing ? 1 : 0)\n else\n return scope.offset - (closing ? hangingIndent : 0)\n },\n\n electricInput: /^\\s*[\\}\\]\\)]$/,\n closeBrackets: {triples: \"'\\\"\"},\n lineComment: \"#\",\n fold: \"indent\"\n };\n return external;\n });\n\n CodeMirror.defineMIME(\"text/x-python\", \"python\");\n\n var words = function(str) { return str.split(\" \"); };\n\n CodeMirror.defineMIME(\"text/x-cython\", {\n name: \"python\",\n extra_keywords: words(\"by cdef cimport cpdef ctypedef enum except \"+\n \"extern gil include nogil property public \"+\n \"readonly struct union DEF IF ELIF ELSE\")\n });\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/python/python.js\n// module id = 728\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nvar htmlConfig = {\n autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,\n 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,\n 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,\n 'track': true, 'wbr': true, 'menuitem': true},\n implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,\n 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,\n 'th': true, 'tr': true},\n contextGrabbers: {\n 'dd': {'dd': true, 'dt': true},\n 'dt': {'dd': true, 'dt': true},\n 'li': {'li': true},\n 'option': {'option': true, 'optgroup': true},\n 'optgroup': {'optgroup': true},\n 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,\n 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,\n 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,\n 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,\n 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},\n 'rp': {'rp': true, 'rt': true},\n 'rt': {'rp': true, 'rt': true},\n 'tbody': {'tbody': true, 'tfoot': true},\n 'td': {'td': true, 'th': true},\n 'tfoot': {'tbody': true},\n 'th': {'td': true, 'th': true},\n 'thead': {'tbody': true, 'tfoot': true},\n 'tr': {'tr': true}\n },\n doNotIndent: {\"pre\": true},\n allowUnquoted: true,\n allowMissing: true,\n caseFold: true\n}\n\nvar xmlConfig = {\n autoSelfClosers: {},\n implicitlyClosed: {},\n contextGrabbers: {},\n doNotIndent: {},\n allowUnquoted: false,\n allowMissing: false,\n allowMissingTagName: false,\n caseFold: false\n}\n\nCodeMirror.defineMode(\"xml\", function(editorConf, config_) {\n var indentUnit = editorConf.indentUnit\n var config = {}\n var defaults = config_.htmlMode ? htmlConfig : xmlConfig\n for (var prop in defaults) config[prop] = defaults[prop]\n for (var prop in config_) config[prop] = config_[prop]\n\n // Return variables for tokenizers\n var type, setStyle;\n\n function inText(stream, state) {\n function chain(parser) {\n state.tokenize = parser;\n return parser(stream, state);\n }\n\n var ch = stream.next();\n if (ch == \"<\") {\n if (stream.eat(\"!\")) {\n if (stream.eat(\"[\")) {\n if (stream.match(\"CDATA[\")) return chain(inBlock(\"atom\", \"]]>\"));\n else return null;\n } else if (stream.match(\"--\")) {\n return chain(inBlock(\"comment\", \"-->\"));\n } else if (stream.match(\"DOCTYPE\", true, true)) {\n stream.eatWhile(/[\\w\\._\\-]/);\n return chain(doctype(1));\n } else {\n return null;\n }\n } else if (stream.eat(\"?\")) {\n stream.eatWhile(/[\\w\\._\\-]/);\n state.tokenize = inBlock(\"meta\", \"?>\");\n return \"meta\";\n } else {\n type = stream.eat(\"/\") ? \"closeTag\" : \"openTag\";\n state.tokenize = inTag;\n return \"tag bracket\";\n }\n } else if (ch == \"&\") {\n var ok;\n if (stream.eat(\"#\")) {\n if (stream.eat(\"x\")) {\n ok = stream.eatWhile(/[a-fA-F\\d]/) && stream.eat(\";\");\n } else {\n ok = stream.eatWhile(/[\\d]/) && stream.eat(\";\");\n }\n } else {\n ok = stream.eatWhile(/[\\w\\.\\-:]/) && stream.eat(\";\");\n }\n return ok ? \"atom\" : \"error\";\n } else {\n stream.eatWhile(/[^&<]/);\n return null;\n }\n }\n inText.isInText = true;\n\n function inTag(stream, state) {\n var ch = stream.next();\n if (ch == \">\" || (ch == \"/\" && stream.eat(\">\"))) {\n state.tokenize = inText;\n type = ch == \">\" ? \"endTag\" : \"selfcloseTag\";\n return \"tag bracket\";\n } else if (ch == \"=\") {\n type = \"equals\";\n return null;\n } else if (ch == \"<\") {\n state.tokenize = inText;\n state.state = baseState;\n state.tagName = state.tagStart = null;\n var next = state.tokenize(stream, state);\n return next ? next + \" tag error\" : \"tag error\";\n } else if (/[\\'\\\"]/.test(ch)) {\n state.tokenize = inAttribute(ch);\n state.stringStartCol = stream.column();\n return state.tokenize(stream, state);\n } else {\n stream.match(/^[^\\s\\u00a0=<>\\\"\\']*[^\\s\\u00a0=<>\\\"\\'\\/]/);\n return \"word\";\n }\n }\n\n function inAttribute(quote) {\n var closure = function(stream, state) {\n while (!stream.eol()) {\n if (stream.next() == quote) {\n state.tokenize = inTag;\n break;\n }\n }\n return \"string\";\n };\n closure.isInAttribute = true;\n return closure;\n }\n\n function inBlock(style, terminator) {\n return function(stream, state) {\n while (!stream.eol()) {\n if (stream.match(terminator)) {\n state.tokenize = inText;\n break;\n }\n stream.next();\n }\n return style;\n }\n }\n\n function doctype(depth) {\n return function(stream, state) {\n var ch;\n while ((ch = stream.next()) != null) {\n if (ch == \"<\") {\n state.tokenize = doctype(depth + 1);\n return state.tokenize(stream, state);\n } else if (ch == \">\") {\n if (depth == 1) {\n state.tokenize = inText;\n break;\n } else {\n state.tokenize = doctype(depth - 1);\n return state.tokenize(stream, state);\n }\n }\n }\n return \"meta\";\n };\n }\n\n function Context(state, tagName, startOfLine) {\n this.prev = state.context;\n this.tagName = tagName;\n this.indent = state.indented;\n this.startOfLine = startOfLine;\n if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))\n this.noIndent = true;\n }\n function popContext(state) {\n if (state.context) state.context = state.context.prev;\n }\n function maybePopContext(state, nextTagName) {\n var parentTagName;\n while (true) {\n if (!state.context) {\n return;\n }\n parentTagName = state.context.tagName;\n if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||\n !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {\n return;\n }\n popContext(state);\n }\n }\n\n function baseState(type, stream, state) {\n if (type == \"openTag\") {\n state.tagStart = stream.column();\n return tagNameState;\n } else if (type == \"closeTag\") {\n return closeTagNameState;\n } else {\n return baseState;\n }\n }\n function tagNameState(type, stream, state) {\n if (type == \"word\") {\n state.tagName = stream.current();\n setStyle = \"tag\";\n return attrState;\n } else if (config.allowMissingTagName && type == \"endTag\") {\n setStyle = \"tag bracket\";\n return attrState(type, stream, state);\n } else {\n setStyle = \"error\";\n return tagNameState;\n }\n }\n function closeTagNameState(type, stream, state) {\n if (type == \"word\") {\n var tagName = stream.current();\n if (state.context && state.context.tagName != tagName &&\n config.implicitlyClosed.hasOwnProperty(state.context.tagName))\n popContext(state);\n if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {\n setStyle = \"tag\";\n return closeState;\n } else {\n setStyle = \"tag error\";\n return closeStateErr;\n }\n } else if (config.allowMissingTagName && type == \"endTag\") {\n setStyle = \"tag bracket\";\n return closeState(type, stream, state);\n } else {\n setStyle = \"error\";\n return closeStateErr;\n }\n }\n\n function closeState(type, _stream, state) {\n if (type != \"endTag\") {\n setStyle = \"error\";\n return closeState;\n }\n popContext(state);\n return baseState;\n }\n function closeStateErr(type, stream, state) {\n setStyle = \"error\";\n return closeState(type, stream, state);\n }\n\n function attrState(type, _stream, state) {\n if (type == \"word\") {\n setStyle = \"attribute\";\n return attrEqState;\n } else if (type == \"endTag\" || type == \"selfcloseTag\") {\n var tagName = state.tagName, tagStart = state.tagStart;\n state.tagName = state.tagStart = null;\n if (type == \"selfcloseTag\" ||\n config.autoSelfClosers.hasOwnProperty(tagName)) {\n maybePopContext(state, tagName);\n } else {\n maybePopContext(state, tagName);\n state.context = new Context(state, tagName, tagStart == state.indented);\n }\n return baseState;\n }\n setStyle = \"error\";\n return attrState;\n }\n function attrEqState(type, stream, state) {\n if (type == \"equals\") return attrValueState;\n if (!config.allowMissing) setStyle = \"error\";\n return attrState(type, stream, state);\n }\n function attrValueState(type, stream, state) {\n if (type == \"string\") return attrContinuedState;\n if (type == \"word\" && config.allowUnquoted) {setStyle = \"string\"; return attrState;}\n setStyle = \"error\";\n return attrState(type, stream, state);\n }\n function attrContinuedState(type, stream, state) {\n if (type == \"string\") return attrContinuedState;\n return attrState(type, stream, state);\n }\n\n return {\n startState: function(baseIndent) {\n var state = {tokenize: inText,\n state: baseState,\n indented: baseIndent || 0,\n tagName: null, tagStart: null,\n context: null}\n if (baseIndent != null) state.baseIndent = baseIndent\n return state\n },\n\n token: function(stream, state) {\n if (!state.tagName && stream.sol())\n state.indented = stream.indentation();\n\n if (stream.eatSpace()) return null;\n type = null;\n var style = state.tokenize(stream, state);\n if ((style || type) && style != \"comment\") {\n setStyle = null;\n state.state = state.state(type || style, stream, state);\n if (setStyle)\n style = setStyle == \"error\" ? style + \" error\" : setStyle;\n }\n return style;\n },\n\n indent: function(state, textAfter, fullLine) {\n var context = state.context;\n // Indent multi-line strings (e.g. css).\n if (state.tokenize.isInAttribute) {\n if (state.tagStart == state.indented)\n return state.stringStartCol + 1;\n else\n return state.indented + indentUnit;\n }\n if (context && context.noIndent) return CodeMirror.Pass;\n if (state.tokenize != inTag && state.tokenize != inText)\n return fullLine ? fullLine.match(/^(\\s*)/)[0].length : 0;\n // Indent the starts of attribute names.\n if (state.tagName) {\n if (config.multilineTagIndentPastTag !== false)\n return state.tagStart + state.tagName.length + 2;\n else\n return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);\n }\n if (config.alignCDATA && /$/,\n blockCommentStart: \"\",\n\n configuration: config.htmlMode ? \"html\" : \"xml\",\n helperType: config.htmlMode ? \"html\" : \"xml\",\n\n skipAttribute: function(state) {\n if (state.state == attrValueState)\n state.state = attrState\n }\n };\n});\n\nCodeMirror.defineMIME(\"text/xml\", \"xml\");\nCodeMirror.defineMIME(\"application/xml\", \"xml\");\nif (!CodeMirror.mimeModes.hasOwnProperty(\"text/html\"))\n CodeMirror.defineMIME(\"text/html\", {name: \"xml\", htmlMode: true});\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/xml/xml.js\n// module id = 729\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") { // CommonJS\n mod(require(\"../../lib/codemirror\"));\n } else if (typeof define == \"function\" && define.amd) { // AMD\n define([\"../../lib/codemirror\"], mod);\n } else { // Plain browser env\n mod(CodeMirror);\n }\n})(function(CodeMirror) {\n \"use strict\";\n\n var TOKEN_STYLES = {\n addition: \"positive\",\n attributes: \"attribute\",\n bold: \"strong\",\n cite: \"keyword\",\n code: \"atom\",\n definitionList: \"number\",\n deletion: \"negative\",\n div: \"punctuation\",\n em: \"em\",\n footnote: \"variable\",\n footCite: \"qualifier\",\n header: \"header\",\n html: \"comment\",\n image: \"string\",\n italic: \"em\",\n link: \"link\",\n linkDefinition: \"link\",\n list1: \"variable-2\",\n list2: \"variable-3\",\n list3: \"keyword\",\n notextile: \"string-2\",\n pre: \"operator\",\n p: \"property\",\n quote: \"bracket\",\n span: \"quote\",\n specialChar: \"tag\",\n strong: \"strong\",\n sub: \"builtin\",\n sup: \"builtin\",\n table: \"variable-3\",\n tableHeading: \"operator\"\n };\n\n function startNewLine(stream, state) {\n state.mode = Modes.newLayout;\n state.tableHeading = false;\n\n if (state.layoutType === \"definitionList\" && state.spanningLayout &&\n stream.match(RE(\"definitionListEnd\"), false))\n state.spanningLayout = false;\n }\n\n function handlePhraseModifier(stream, state, ch) {\n if (ch === \"_\") {\n if (stream.eat(\"_\"))\n return togglePhraseModifier(stream, state, \"italic\", /__/, 2);\n else\n return togglePhraseModifier(stream, state, \"em\", /_/, 1);\n }\n\n if (ch === \"*\") {\n if (stream.eat(\"*\")) {\n return togglePhraseModifier(stream, state, \"bold\", /\\*\\*/, 2);\n }\n return togglePhraseModifier(stream, state, \"strong\", /\\*/, 1);\n }\n\n if (ch === \"[\") {\n if (stream.match(/\\d+\\]/)) state.footCite = true;\n return tokenStyles(state);\n }\n\n if (ch === \"(\") {\n var spec = stream.match(/^(r|tm|c)\\)/);\n if (spec)\n return tokenStylesWith(state, TOKEN_STYLES.specialChar);\n }\n\n if (ch === \"<\" && stream.match(/(\\w+)[^>]+>[^<]+<\\/\\1>/))\n return tokenStylesWith(state, TOKEN_STYLES.html);\n\n if (ch === \"?\" && stream.eat(\"?\"))\n return togglePhraseModifier(stream, state, \"cite\", /\\?\\?/, 2);\n\n if (ch === \"=\" && stream.eat(\"=\"))\n return togglePhraseModifier(stream, state, \"notextile\", /==/, 2);\n\n if (ch === \"-\" && !stream.eat(\"-\"))\n return togglePhraseModifier(stream, state, \"deletion\", /-/, 1);\n\n if (ch === \"+\")\n return togglePhraseModifier(stream, state, \"addition\", /\\+/, 1);\n\n if (ch === \"~\")\n return togglePhraseModifier(stream, state, \"sub\", /~/, 1);\n\n if (ch === \"^\")\n return togglePhraseModifier(stream, state, \"sup\", /\\^/, 1);\n\n if (ch === \"%\")\n return togglePhraseModifier(stream, state, \"span\", /%/, 1);\n\n if (ch === \"@\")\n return togglePhraseModifier(stream, state, \"code\", /@/, 1);\n\n if (ch === \"!\") {\n var type = togglePhraseModifier(stream, state, \"image\", /(?:\\([^\\)]+\\))?!/, 1);\n stream.match(/^:\\S+/); // optional Url portion\n return type;\n }\n return tokenStyles(state);\n }\n\n function togglePhraseModifier(stream, state, phraseModifier, closeRE, openSize) {\n var charBefore = stream.pos > openSize ? stream.string.charAt(stream.pos - openSize - 1) : null;\n var charAfter = stream.peek();\n if (state[phraseModifier]) {\n if ((!charAfter || /\\W/.test(charAfter)) && charBefore && /\\S/.test(charBefore)) {\n var type = tokenStyles(state);\n state[phraseModifier] = false;\n return type;\n }\n } else if ((!charBefore || /\\W/.test(charBefore)) && charAfter && /\\S/.test(charAfter) &&\n stream.match(new RegExp(\"^.*\\\\S\" + closeRE.source + \"(?:\\\\W|$)\"), false)) {\n state[phraseModifier] = true;\n state.mode = Modes.attributes;\n }\n return tokenStyles(state);\n };\n\n function tokenStyles(state) {\n var disabled = textileDisabled(state);\n if (disabled) return disabled;\n\n var styles = [];\n if (state.layoutType) styles.push(TOKEN_STYLES[state.layoutType]);\n\n styles = styles.concat(activeStyles(\n state, \"addition\", \"bold\", \"cite\", \"code\", \"deletion\", \"em\", \"footCite\",\n \"image\", \"italic\", \"link\", \"span\", \"strong\", \"sub\", \"sup\", \"table\", \"tableHeading\"));\n\n if (state.layoutType === \"header\")\n styles.push(TOKEN_STYLES.header + \"-\" + state.header);\n\n return styles.length ? styles.join(\" \") : null;\n }\n\n function textileDisabled(state) {\n var type = state.layoutType;\n\n switch(type) {\n case \"notextile\":\n case \"code\":\n case \"pre\":\n return TOKEN_STYLES[type];\n default:\n if (state.notextile)\n return TOKEN_STYLES.notextile + (type ? (\" \" + TOKEN_STYLES[type]) : \"\");\n return null;\n }\n }\n\n function tokenStylesWith(state, extraStyles) {\n var disabled = textileDisabled(state);\n if (disabled) return disabled;\n\n var type = tokenStyles(state);\n if (extraStyles)\n return type ? (type + \" \" + extraStyles) : extraStyles;\n else\n return type;\n }\n\n function activeStyles(state) {\n var styles = [];\n for (var i = 1; i < arguments.length; ++i) {\n if (state[arguments[i]])\n styles.push(TOKEN_STYLES[arguments[i]]);\n }\n return styles;\n }\n\n function blankLine(state) {\n var spanningLayout = state.spanningLayout, type = state.layoutType;\n\n for (var key in state) if (state.hasOwnProperty(key))\n delete state[key];\n\n state.mode = Modes.newLayout;\n if (spanningLayout) {\n state.layoutType = type;\n state.spanningLayout = true;\n }\n }\n\n var REs = {\n cache: {},\n single: {\n bc: \"bc\",\n bq: \"bq\",\n definitionList: /- .*?:=+/,\n definitionListEnd: /.*=:\\s*$/,\n div: \"div\",\n drawTable: /\\|.*\\|/,\n foot: /fn\\d+/,\n header: /h[1-6]/,\n html: /\\s*<(?:\\/)?(\\w+)(?:[^>]+)?>(?:[^<]+<\\/\\1>)?/,\n link: /[^\"]+\":\\S/,\n linkDefinition: /\\[[^\\s\\]]+\\]\\S+/,\n list: /(?:#+|\\*+)/,\n notextile: \"notextile\",\n para: \"p\",\n pre: \"pre\",\n table: \"table\",\n tableCellAttributes: /[\\/\\\\]\\d+/,\n tableHeading: /\\|_\\./,\n tableText: /[^\"_\\*\\[\\(\\?\\+~\\^%@|-]+/,\n text: /[^!\"_=\\*\\[\\(<\\?\\+~\\^%@-]+/\n },\n attributes: {\n align: /(?:<>|<|>|=)/,\n selector: /\\([^\\(][^\\)]+\\)/,\n lang: /\\[[^\\[\\]]+\\]/,\n pad: /(?:\\(+|\\)+){1,2}/,\n css: /\\{[^\\}]+\\}/\n },\n createRe: function(name) {\n switch (name) {\n case \"drawTable\":\n return REs.makeRe(\"^\", REs.single.drawTable, \"$\");\n case \"html\":\n return REs.makeRe(\"^\", REs.single.html, \"(?:\", REs.single.html, \")*\", \"$\");\n case \"linkDefinition\":\n return REs.makeRe(\"^\", REs.single.linkDefinition, \"$\");\n case \"listLayout\":\n return REs.makeRe(\"^\", REs.single.list, RE(\"allAttributes\"), \"*\\\\s+\");\n case \"tableCellAttributes\":\n return REs.makeRe(\"^\", REs.choiceRe(REs.single.tableCellAttributes,\n RE(\"allAttributes\")), \"+\\\\.\");\n case \"type\":\n return REs.makeRe(\"^\", RE(\"allTypes\"));\n case \"typeLayout\":\n return REs.makeRe(\"^\", RE(\"allTypes\"), RE(\"allAttributes\"),\n \"*\\\\.\\\\.?\", \"(\\\\s+|$)\");\n case \"attributes\":\n return REs.makeRe(\"^\", RE(\"allAttributes\"), \"+\");\n\n case \"allTypes\":\n return REs.choiceRe(REs.single.div, REs.single.foot,\n REs.single.header, REs.single.bc, REs.single.bq,\n REs.single.notextile, REs.single.pre, REs.single.table,\n REs.single.para);\n\n case \"allAttributes\":\n return REs.choiceRe(REs.attributes.selector, REs.attributes.css,\n REs.attributes.lang, REs.attributes.align, REs.attributes.pad);\n\n default:\n return REs.makeRe(\"^\", REs.single[name]);\n }\n },\n makeRe: function() {\n var pattern = \"\";\n for (var i = 0; i < arguments.length; ++i) {\n var arg = arguments[i];\n pattern += (typeof arg === \"string\") ? arg : arg.source;\n }\n return new RegExp(pattern);\n },\n choiceRe: function() {\n var parts = [arguments[0]];\n for (var i = 1; i < arguments.length; ++i) {\n parts[i * 2 - 1] = \"|\";\n parts[i * 2] = arguments[i];\n }\n\n parts.unshift(\"(?:\");\n parts.push(\")\");\n return REs.makeRe.apply(null, parts);\n }\n };\n\n function RE(name) {\n return (REs.cache[name] || (REs.cache[name] = REs.createRe(name)));\n }\n\n var Modes = {\n newLayout: function(stream, state) {\n if (stream.match(RE(\"typeLayout\"), false)) {\n state.spanningLayout = false;\n return (state.mode = Modes.blockType)(stream, state);\n }\n var newMode;\n if (!textileDisabled(state)) {\n if (stream.match(RE(\"listLayout\"), false))\n newMode = Modes.list;\n else if (stream.match(RE(\"drawTable\"), false))\n newMode = Modes.table;\n else if (stream.match(RE(\"linkDefinition\"), false))\n newMode = Modes.linkDefinition;\n else if (stream.match(RE(\"definitionList\")))\n newMode = Modes.definitionList;\n else if (stream.match(RE(\"html\"), false))\n newMode = Modes.html;\n }\n return (state.mode = (newMode || Modes.text))(stream, state);\n },\n\n blockType: function(stream, state) {\n var match, type;\n state.layoutType = null;\n\n if (match = stream.match(RE(\"type\")))\n type = match[0];\n else\n return (state.mode = Modes.text)(stream, state);\n\n if (match = type.match(RE(\"header\"))) {\n state.layoutType = \"header\";\n state.header = parseInt(match[0][1]);\n } else if (type.match(RE(\"bq\"))) {\n state.layoutType = \"quote\";\n } else if (type.match(RE(\"bc\"))) {\n state.layoutType = \"code\";\n } else if (type.match(RE(\"foot\"))) {\n state.layoutType = \"footnote\";\n } else if (type.match(RE(\"notextile\"))) {\n state.layoutType = \"notextile\";\n } else if (type.match(RE(\"pre\"))) {\n state.layoutType = \"pre\";\n } else if (type.match(RE(\"div\"))) {\n state.layoutType = \"div\";\n } else if (type.match(RE(\"table\"))) {\n state.layoutType = \"table\";\n }\n\n state.mode = Modes.attributes;\n return tokenStyles(state);\n },\n\n text: function(stream, state) {\n if (stream.match(RE(\"text\"))) return tokenStyles(state);\n\n var ch = stream.next();\n if (ch === '\"')\n return (state.mode = Modes.link)(stream, state);\n return handlePhraseModifier(stream, state, ch);\n },\n\n attributes: function(stream, state) {\n state.mode = Modes.layoutLength;\n\n if (stream.match(RE(\"attributes\")))\n return tokenStylesWith(state, TOKEN_STYLES.attributes);\n else\n return tokenStyles(state);\n },\n\n layoutLength: function(stream, state) {\n if (stream.eat(\".\") && stream.eat(\".\"))\n state.spanningLayout = true;\n\n state.mode = Modes.text;\n return tokenStyles(state);\n },\n\n list: function(stream, state) {\n var match = stream.match(RE(\"list\"));\n state.listDepth = match[0].length;\n var listMod = (state.listDepth - 1) % 3;\n if (!listMod)\n state.layoutType = \"list1\";\n else if (listMod === 1)\n state.layoutType = \"list2\";\n else\n state.layoutType = \"list3\";\n\n state.mode = Modes.attributes;\n return tokenStyles(state);\n },\n\n link: function(stream, state) {\n state.mode = Modes.text;\n if (stream.match(RE(\"link\"))) {\n stream.match(/\\S+/);\n return tokenStylesWith(state, TOKEN_STYLES.link);\n }\n return tokenStyles(state);\n },\n\n linkDefinition: function(stream, state) {\n stream.skipToEnd();\n return tokenStylesWith(state, TOKEN_STYLES.linkDefinition);\n },\n\n definitionList: function(stream, state) {\n stream.match(RE(\"definitionList\"));\n\n state.layoutType = \"definitionList\";\n\n if (stream.match(/\\s*$/))\n state.spanningLayout = true;\n else\n state.mode = Modes.attributes;\n\n return tokenStyles(state);\n },\n\n html: function(stream, state) {\n stream.skipToEnd();\n return tokenStylesWith(state, TOKEN_STYLES.html);\n },\n\n table: function(stream, state) {\n state.layoutType = \"table\";\n return (state.mode = Modes.tableCell)(stream, state);\n },\n\n tableCell: function(stream, state) {\n if (stream.match(RE(\"tableHeading\")))\n state.tableHeading = true;\n else\n stream.eat(\"|\");\n\n state.mode = Modes.tableCellAttributes;\n return tokenStyles(state);\n },\n\n tableCellAttributes: function(stream, state) {\n state.mode = Modes.tableText;\n\n if (stream.match(RE(\"tableCellAttributes\")))\n return tokenStylesWith(state, TOKEN_STYLES.attributes);\n else\n return tokenStyles(state);\n },\n\n tableText: function(stream, state) {\n if (stream.match(RE(\"tableText\")))\n return tokenStyles(state);\n\n if (stream.peek() === \"|\") { // end of cell\n state.mode = Modes.tableCell;\n return tokenStyles(state);\n }\n return handlePhraseModifier(stream, state, stream.next());\n }\n };\n\n CodeMirror.defineMode(\"textile\", function() {\n return {\n startState: function() {\n return { mode: Modes.newLayout };\n },\n token: function(stream, state) {\n if (stream.sol()) startNewLine(stream, state);\n return state.mode(stream, state);\n },\n blankLine: blankLine\n };\n });\n\n CodeMirror.defineMIME(\"text/x-textile\", \"textile\");\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/textile/textile.js\n// module id = 730\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode('shell', function() {\n\n var words = {};\n function define(style, dict) {\n for(var i = 0; i < dict.length; i++) {\n words[dict[i]] = style;\n }\n };\n\n var commonAtoms = [\"true\", \"false\"];\n var commonKeywords = [\"if\", \"then\", \"do\", \"else\", \"elif\", \"while\", \"until\", \"for\", \"in\", \"esac\", \"fi\",\n \"fin\", \"fil\", \"done\", \"exit\", \"set\", \"unset\", \"export\", \"function\"];\n var commonCommands = [\"ab\", \"awk\", \"bash\", \"beep\", \"cat\", \"cc\", \"cd\", \"chown\", \"chmod\", \"chroot\", \"clear\",\n \"cp\", \"curl\", \"cut\", \"diff\", \"echo\", \"find\", \"gawk\", \"gcc\", \"get\", \"git\", \"grep\", \"hg\", \"kill\", \"killall\",\n \"ln\", \"ls\", \"make\", \"mkdir\", \"openssl\", \"mv\", \"nc\", \"nl\", \"node\", \"npm\", \"ping\", \"ps\", \"restart\", \"rm\",\n \"rmdir\", \"sed\", \"service\", \"sh\", \"shopt\", \"shred\", \"source\", \"sort\", \"sleep\", \"ssh\", \"start\", \"stop\",\n \"su\", \"sudo\", \"svn\", \"tee\", \"telnet\", \"top\", \"touch\", \"vi\", \"vim\", \"wall\", \"wc\", \"wget\", \"who\", \"write\",\n \"yes\", \"zsh\"];\n\n CodeMirror.registerHelper(\"hintWords\", \"shell\", commonAtoms.concat(commonKeywords, commonCommands));\n\n define('atom', commonAtoms);\n define('keyword', commonKeywords);\n define('builtin', commonCommands);\n\n function tokenBase(stream, state) {\n if (stream.eatSpace()) return null;\n\n var sol = stream.sol();\n var ch = stream.next();\n\n if (ch === '\\\\') {\n stream.next();\n return null;\n }\n if (ch === '\\'' || ch === '\"' || ch === '`') {\n state.tokens.unshift(tokenString(ch, ch === \"`\" ? \"quote\" : \"string\"));\n return tokenize(stream, state);\n }\n if (ch === '#') {\n if (sol && stream.eat('!')) {\n stream.skipToEnd();\n return 'meta'; // 'comment'?\n }\n stream.skipToEnd();\n return 'comment';\n }\n if (ch === '$') {\n state.tokens.unshift(tokenDollar);\n return tokenize(stream, state);\n }\n if (ch === '+' || ch === '=') {\n return 'operator';\n }\n if (ch === '-') {\n stream.eat('-');\n stream.eatWhile(/\\w/);\n return 'attribute';\n }\n if (/\\d/.test(ch)) {\n stream.eatWhile(/\\d/);\n if(stream.eol() || !/\\w/.test(stream.peek())) {\n return 'number';\n }\n }\n stream.eatWhile(/[\\w-]/);\n var cur = stream.current();\n if (stream.peek() === '=' && /\\w+/.test(cur)) return 'def';\n return words.hasOwnProperty(cur) ? words[cur] : null;\n }\n\n function tokenString(quote, style) {\n var close = quote == \"(\" ? \")\" : quote == \"{\" ? \"}\" : quote\n return function(stream, state) {\n var next, escaped = false;\n while ((next = stream.next()) != null) {\n if (next === close && !escaped) {\n state.tokens.shift();\n break;\n } else if (next === '$' && !escaped && quote !== \"'\" && stream.peek() != close) {\n escaped = true;\n stream.backUp(1);\n state.tokens.unshift(tokenDollar);\n break;\n } else if (!escaped && quote !== close && next === quote) {\n state.tokens.unshift(tokenString(quote, style))\n return tokenize(stream, state)\n } else if (!escaped && /['\"]/.test(next) && !/['\"]/.test(quote)) {\n state.tokens.unshift(tokenStringStart(next, \"string\"));\n stream.backUp(1);\n break;\n }\n escaped = !escaped && next === '\\\\';\n }\n return style;\n };\n };\n\n function tokenStringStart(quote, style) {\n return function(stream, state) {\n state.tokens[0] = tokenString(quote, style)\n stream.next()\n return tokenize(stream, state)\n }\n }\n\n var tokenDollar = function(stream, state) {\n if (state.tokens.length > 1) stream.eat('$');\n var ch = stream.next()\n if (/['\"({]/.test(ch)) {\n state.tokens[0] = tokenString(ch, ch == \"(\" ? \"quote\" : ch == \"{\" ? \"def\" : \"string\");\n return tokenize(stream, state);\n }\n if (!/\\d/.test(ch)) stream.eatWhile(/\\w/);\n state.tokens.shift();\n return 'def';\n };\n\n function tokenize(stream, state) {\n return (state.tokens[0] || tokenBase) (stream, state);\n };\n\n return {\n startState: function() {return {tokens:[]};},\n token: function(stream, state) {\n return tokenize(stream, state);\n },\n closeBrackets: \"()[]{}''\\\"\\\"``\",\n lineComment: '#',\n fold: \"brace\"\n };\n});\n\nCodeMirror.defineMIME('text/x-sh', 'shell');\n// Apache uses a slightly different Media Type for Shell scripts\n// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types\nCodeMirror.defineMIME('application/x-sh', 'shell');\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/shell/shell.js\n// module id = 731\n// module chunks = 3 4 5 7 8 14","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-17a2306c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./email.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./email.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./email.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-17a2306c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./email.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue\n// module id = 734\n// module chunks = 0 3 4 5 6","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/dag.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Vue from 'vue'\nimport $ from 'jquery'\nimport _ from 'lodash'\nimport i18n from '@/module/i18n'\nimport { jsPlumb } from 'jsplumb'\nimport DragZoom from './dragZoom'\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\nimport Permissions from '@/module/permissions'\nimport { uuid, findComponentDownward } from '@/module/util/'\nimport {\n tasksAll,\n rtTasksTpl,\n setSvgColor,\n saveTargetarr,\n rtTargetarrArr } from './util'\nimport mStart from '@/conf/home/pages/projects/pages/definition/pages/list/_source/start'\n\nlet JSP = function () {\n this.dag = {}\n this.selectedElement = {}\n\n this.config = {\n // Whether to drag\n isDrag: true,\n // Whether to allow connection\n isAttachment: false,\n // Whether to drag a new node\n isNewNodes: true,\n // Whether to support double-click node events\n isDblclick: true,\n // Whether to support right-click menu events\n isContextmenu: true,\n // Whether to allow click events\n isClick: false\n }\n}\n\n/**\n * dag init\n */\nJSP.prototype.init = function ({ dag, instance }) {\n // Get the dag component instance\n this.dag = dag\n // Get jsplumb instance\n this.JspInstance = instance\n // Register jsplumb connection type and configuration\n this.JspInstance.registerConnectionType('basic', {\n anchor: 'Continuous',\n connector: 'Straight' // Line type\n })\n\n // Initial configuration\n this.setConfig({\n isDrag: !store.state.dag.isDetails,\n isAttachment: false,\n isNewNodes: Permissions.getAuth() === false ? false : !store.state.dag.isDetails,\n isDblclick: true,\n isContextmenu: true,\n isClick: false\n })\n\n // Monitor line click\n this.JspInstance.bind('click', e => {\n if (this.config.isClick) {\n this.connectClick(e)\n }\n })\n\n // Drag and drop\n if (this.config.isNewNodes) {\n DragZoom.init()\n }\n}\n\n/**\n * set config attribute\n */\nJSP.prototype.setConfig = function (o) {\n this.config = Object.assign(this.config, {}, o)\n}\n\n/**\n * Node binding event\n */\nJSP.prototype.tasksEvent = function (selfId) {\n let tasks = $(`#${selfId}`)\n // Bind right event\n tasks.on('contextmenu', e => {\n this.tasksContextmenu(e)\n return false\n })\n\n // Binding double click event\n tasks.find('.icos').bind('dblclick', e => {\n this.tasksDblclick(e)\n })\n\n // Binding click event\n tasks.on('click', e => {\n this.tasksClick(e)\n })\n}\n\n/**\n * Dag node drag and drop processing\n */\nJSP.prototype.draggable = function () {\n if (this.config.isNewNodes) {\n let selfId\n let self = this\n $('.toolbar-btn .roundedRect').draggable({\n scope: 'plant',\n helper: 'clone',\n containment: $('.dag-model'),\n stop: function (e, ui) {\n self.tasksEvent(selfId)\n\n // Dom structure is not generated without pop-up form form\n if ($(`#${selfId}`).html()) {\n // dag event\n findComponentDownward(self.dag.$root, 'dag-chart')._createNodes({\n id: selfId\n })\n }\n },\n drag: function () {\n $('body').find('.tooltip.fade.top.in').remove()\n }\n })\n\n $('#canvas').droppable({\n scope: 'plant',\n drop: function (ev, ui) {\n let id = 'tasks-' + Math.ceil(Math.random() * 100000) // eslint-disable-line\n // Get mouse coordinates\n let left = parseInt(ui.offset.left - $(this).offset().left)\n let top = parseInt(ui.offset.top - $(this).offset().top) - 10\n if (top < 25) {\n top = 25\n }\n // Generate template node\n $('#canvas').append(rtTasksTpl({\n id: id,\n name: id,\n x: left,\n y: top,\n isAttachment: self.config.isAttachment,\n taskType: findComponentDownward(self.dag.$root, 'dag-chart').dagBarId\n }))\n\n // Get the generated node\n let thisDom = jsPlumb.getSelector('.statemachine-demo .w')\n\n // Generating a connection node\n self.JspInstance.batch(() => {\n self.initNode(thisDom[thisDom.length - 1])\n })\n selfId = id\n }\n })\n }\n}\n\n/**\n * Echo json processing and old data structure processing\n */\nJSP.prototype.jsonHandle = function ({ largeJson, locations }) {\n _.map(largeJson, v => {\n // Generate template\n $('#canvas').append(rtTasksTpl({\n id: v.id,\n name: v.name,\n x: locations[v.id]['x'],\n y: locations[v.id]['y'],\n targetarr: locations[v.id]['targetarr'],\n isAttachment: this.config.isAttachment,\n taskType: v.type,\n runFlag:v.runFlag\n }))\n\n // contextmenu event\n $(`#${v.id}`).on('contextmenu', e => {\n this.tasksContextmenu(e)\n return false\n })\n\n // dblclick event\n $(`#${v.id}`).find('.icos').bind('dblclick', e => {\n this.tasksDblclick(e)\n })\n\n // click event\n $(`#${v.id}`).bind('click', e => {\n this.tasksClick(e)\n })\n })\n}\n\n/**\n * Initialize a single node\n */\nJSP.prototype.initNode = function (el) {\n // Whether to drag\n if (this.config.isDrag) {\n this.JspInstance.draggable(el, {\n containment: 'dag-container'\n })\n }\n\n // Node attribute configuration\n this.JspInstance.makeSource(el, {\n filter: '.ep',\n anchor: 'Continuous',\n connectorStyle: {\n stroke: '#555',\n strokeWidth: 2,\n outlineStroke: 'transparent',\n outlineWidth: 4\n },\n // This place is leaking\n // connectionType: \"basic\",\n extract: {\n action: 'the-action'\n },\n maxConnections: -1\n })\n\n // Node connection property configuration\n this.JspInstance.makeTarget(el, {\n dropOptions: { hoverClass: 'dragHover' },\n anchor: 'Continuous',\n allowLoopback: false // Forbid yourself to connect yourself\n })\n this.JspInstance.fire('jsPlumbDemoNodeAdded', el)\n}\n\n/**\n * Node right click menu\n */\nJSP.prototype.tasksContextmenu = function (event) {\n if (this.config.isContextmenu) {\n let routerName = router.history.current.name\n // state\n let isOne = routerName === 'projects-definition-details' && this.dag.releaseState !== 'NOT_RELEASE'\n // hide\n let isTwo = store.state.dag.isDetails\n\n let html = [\n `${i18n.$t('开始运行')}`,\n `${i18n.$t('编辑节点')}`,\n `${i18n.$t('复制节点')}`,\n `${i18n.$t('删除节点')}`\n ]\n\n let operationHtml = () => {\n return html.splice(',')\n }\n\n let e = event\n let $id = e.currentTarget.id\n let $contextmenu = $('#contextmenu')\n let $name = $(`#${$id}`).find('.name-p').text()\n let $left = e.pageX + document.body.scrollLeft - 5\n let $top = e.pageY + document.body.scrollTop - 5\n $contextmenu.css({\n left: $left,\n top: $top,\n visibility: 'visible'\n })\n // Action bar\n $contextmenu.html('').append(operationHtml)\n\n if (isOne) {\n // start run\n $('#startRunning').on('click', () => {\n let id = router.history.current.params.id\n store.dispatch('dag/getStartCheck', { processDefinitionId: id }).then(res => {\n let modal = Vue.$modal.dialog({\n closable: false,\n showMask: true,\n escClose: true,\n className: 'v-modal-custom',\n transitionName: 'opacityp',\n render (h) {\n return h(mStart, {\n on: {\n onUpdate () {\n modal.remove()\n },\n close () {\n modal.remove()\n }\n },\n props: {\n item: {\n id: id\n },\n startNodeList: $name,\n sourceType: 'contextmenu'\n }\n })\n }\n })\n }).catch(e => {\n Vue.$message.error(e.msg || '')\n })\n })\n }\n if (!isTwo) {\n // edit node\n $(`#editNodes`).click(ev => {\n findComponentDownward(this.dag.$root, 'dag-chart')._createNodes({\n id: $id,\n type: $(`#${$id}`).attr('data-tasks-type')\n })\n })\n // delete node\n $('#removeNodes').click(ev => {\n this.removeNodes($id)\n })\n\n // copy node\n $('#copyNodes').click(res => {\n this.copyNodes($id)\n })\n }\n }\n}\n\n/**\n * Node double click event\n */\nJSP.prototype.tasksDblclick = function (e) {\n // Untie event\n if (this.config.isDblclick) {\n let id = $(e.currentTarget.offsetParent).attr('id')\n\n findComponentDownward(this.dag.$root, 'dag-chart')._createNodes({\n id: id,\n type: $(`#${id}`).attr('data-tasks-type')\n })\n }\n}\n\n/**\n * Node click event\n */\nJSP.prototype.tasksClick = function (e) {\n let $id\n let self = this\n let $body = $(`body`)\n if (this.config.isClick) {\n let $connect = this.selectedElement.connect\n $('.w').removeClass('jtk-tasks-active')\n $(e.currentTarget).addClass('jtk-tasks-active')\n if ($connect) {\n setSvgColor($connect, '#555')\n this.selectedElement.connect = null\n }\n this.selectedElement.id = $(e.currentTarget).attr('id')\n\n // Unbind copy and paste events\n $body.unbind('copy').unbind('paste')\n // Copy binding id\n $id = self.selectedElement.id\n\n $body.bind({\n copy: function () {\n $id = self.selectedElement.id\n },\n paste: function () {\n $id && self.copyNodes($id)\n }\n })\n }\n}\n\n/**\n * Remove binding events\n * paste\n */\nJSP.prototype.removePaste = function () {\n let $body = $(`body`)\n // Unbind copy and paste events\n $body.unbind('copy').unbind('paste')\n // Remove selected node parameters\n this.selectedElement.id = null\n // Remove node selection effect\n $('.w').removeClass('jtk-tasks-active')\n}\n\n/**\n * Line click event\n */\nJSP.prototype.connectClick = function (e) {\n // Set svg color\n setSvgColor(e, '#0097e0')\n let $id = this.selectedElement.id\n if ($id) {\n $(`#${$id}`).removeClass('jtk-tasks-active')\n this.selectedElement.id = null\n }\n this.selectedElement.connect = e\n}\n\n/**\n * toolbarEvent\n * @param {Pointer}\n */\nJSP.prototype.handleEventPointer = function (is) {\n let wDom = $('.w')\n this.setConfig({\n isClick: is,\n isAttachment: false\n })\n wDom.removeClass('jtk-ep')\n if (!is) {\n wDom.removeClass('jtk-tasks-active')\n this.selectedElement = {}\n _.map($('#canvas svg'), v => {\n if ($(v).attr('class')) {\n _.map($(v).find('path'), v1 => {\n $(v1).attr('fill', '#555')\n $(v1).attr('stroke', '#555')\n })\n }\n })\n }\n}\n\n/**\n * toolbarEvent\n * @param {Line}\n */\nJSP.prototype.handleEventLine = function (is) {\n let wDom = $('.w')\n this.setConfig({\n isAttachment: is\n })\n is ? wDom.addClass('jtk-ep') : wDom.removeClass('jtk-ep')\n}\n\n/**\n * toolbarEvent\n * @param {Remove}\n */\nJSP.prototype.handleEventRemove = function () {\n let $id = this.selectedElement.id || null\n let $connect = this.selectedElement.connect || null\n if ($id) {\n this.removeNodes(this.selectedElement.id)\n } else {\n this.removeConnect($connect)\n }\n\n // Monitor whether to edit DAG\n store.commit('dag/setIsEditDag', true)\n}\n\n/**\n * Delete node\n */\nJSP.prototype.removeNodes = function ($id) {\n // Delete node processing(data-targetarr)\n _.map(tasksAll(), v => {\n let targetarr = v.targetarr.split(',')\n if (targetarr.length) {\n let newArr = _.filter(targetarr, v1 => v1 !== $id)\n $(`#${v.id}`).attr('data-targetarr', newArr.toString())\n }\n })\n // delete node\n this.JspInstance.remove($id)\n}\n\n/**\n * Delete connection\n */\nJSP.prototype.removeConnect = function ($connect) {\n if (!$connect) {\n return\n }\n // Remove connections and remove node and node dependencies\n let targetId = $connect.targetId\n let sourceId = $connect.sourceId\n let targetarr = rtTargetarrArr(targetId)\n if (targetarr.length) {\n targetarr = _.filter(targetarr, v => v !== sourceId)\n $(`#${targetId}`).attr('data-targetarr', targetarr.toString())\n }\n this.JspInstance.deleteConnection($connect)\n\n this.selectedElement = {}\n}\n\n/**\n * Copy node\n */\nJSP.prototype.copyNodes = function ($id) {\n let newNodeInfo = _.cloneDeep(_.find(store.state.dag.tasks, v => v.id === $id))\n let newNodePors = store.state.dag.locations[$id]\n // Unstored nodes do not allow replication\n if (!newNodePors) {\n return\n }\n // Generate random id\n let newUuId = `${uuid() + uuid()}`\n let id = newNodeInfo.id.length > 8 ? newNodeInfo.id.substr(0, 7) : newNodeInfo.id\n let name = newNodeInfo.name.length > 8 ? newNodeInfo.name.substr(0, 7) : newNodeInfo.name\n\n // new id\n let newId = `${id || ''}-${newUuId}`\n // new name\n let newName = `${name || ''}-${newUuId}`\n // coordinate x\n let newX = newNodePors.x + 100\n // coordinate y\n let newY = newNodePors.y + 40\n\n // Generate template node\n $('#canvas').append(rtTasksTpl({\n id: newId,\n name: newName,\n x: newX,\n y: newY,\n isAttachment: this.config.isAttachment,\n taskType: newNodeInfo.type\n }))\n\n // Get the generated node\n let thisDom = jsPlumb.getSelector('.statemachine-demo .w')\n\n // Copy node information\n newNodeInfo = Object.assign(newNodeInfo, {\n id: newId,\n name: newName\n })\n\n // Add new node\n store.commit('dag/addTasks', newNodeInfo)\n // Add node location information\n store.commit('dag/setLocations', {\n [newId]: {\n name: newName,\n targetarr: '',\n x: newX,\n y: newY\n }\n })\n\n // Generating a connection node\n this.JspInstance.batch(() => {\n this.initNode(thisDom[thisDom.length - 1])\n // Add events to nodes\n this.tasksEvent(newId)\n })\n}\n/**\n * toolbarEvent\n * @param {Screen}\n */\nJSP.prototype.handleEventScreen = function ({ item, is }) {\n let screenOpen = true\n if (is) {\n item.icon = ''\n screenOpen = true\n } else {\n item.icon = ''\n screenOpen = false\n }\n let $mainLayoutModel = $('.main-layout-model')\n if (screenOpen) {\n $mainLayoutModel.addClass('dag-screen')\n } else {\n $mainLayoutModel.removeClass('dag-screen')\n }\n}\n/**\n * save task\n * @param tasks\n * @param locations\n * @param connects\n */\nJSP.prototype.saveStore = function () {\n return new Promise((resolve, reject) => {\n let connects = []\n let locations = {}\n let tasks = []\n\n let is = (id) => {\n return !!_.filter(tasksAll(), v => v.id === id).length\n }\n\n // task\n _.map(_.cloneDeep(store.state.dag.tasks), v => {\n if (is(v.id)) {\n let preTasks = []\n let id = $(`#${v.id}`)\n let tar = id.attr('data-targetarr')\n let idDep = tar ? id.attr('data-targetarr').split(',') : []\n if (idDep.length) {\n _.map(idDep, v1 => {\n preTasks.push($(`#${v1}`).find('.name-p').text())\n })\n }\n\n let tasksParam = _.assign(v, {\n preTasks: preTasks\n })\n\n // Sub-workflow has no retries and interval\n if (v.type === 'SUB_PROCESS') {\n tasksParam = _.omit(tasksParam, ['maxRetryTimes', 'retryInterval'])\n }\n\n tasks.push(tasksParam)\n }\n })\n\n _.map(this.JspInstance.getConnections(), v => {\n connects.push({\n 'endPointSourceId': v.sourceId,\n 'endPointTargetId': v.targetId\n })\n })\n\n _.map(tasksAll(), v => {\n locations[v.id] = {\n name: v.name,\n targetarr: v.targetarr,\n x: v.x,\n y: v.y\n }\n })\n\n // Storage node\n store.commit('dag/setTasks', tasks)\n // Store coordinate information\n store.commit('dag/setLocations', locations)\n // Storage line dependence\n store.commit('dag/setConnects', connects)\n\n resolve({\n connects: connects,\n tasks: tasks,\n locations: locations\n })\n })\n}\n/**\n * Event processing\n */\nJSP.prototype.handleEvent = function () {\n this.JspInstance.bind('beforeDrop', function (info) {\n let sourceId = info['sourceId']// 出\n let targetId = info['targetId']// 入\n\n /**\n * Recursive search for nodes\n */\n let recursiveVal\n const recursiveTargetarr = (arr, targetId) => {\n for (var i in arr) {\n if (arr[i] === targetId) {\n recursiveVal = targetId\n } else {\n let recTargetarrArr = rtTargetarrArr(arr[i])\n if (recTargetarrArr.length) {\n recursiveTargetarr(recTargetarrArr, targetId)\n } else {\n return recursiveTargetarr(targetId)\n }\n }\n }\n return recursiveVal\n }\n\n // Connection to connected nodes is not allowed\n if (_.findIndex(rtTargetarrArr(targetId), v => v === sourceId) !== -1) {\n return false\n }\n\n // Recursive form to find if the target Targetarr has a sourceId\n if (recursiveTargetarr(rtTargetarrArr(sourceId), targetId)) {\n // setRecursiveVal(null)\n return false\n }\n\n // Storage node dependency information\n saveTargetarr(sourceId, targetId)\n\n // Monitor whether to edit DAG\n store.commit('dag/setIsEditDag', true)\n\n return true\n })\n}\n/**\n * Backfill data processing\n */\nJSP.prototype.jspBackfill = function ({ connects, locations, largeJson }) {\n // Backfill nodes\n this.jsonHandle({\n largeJson: largeJson,\n locations: locations\n })\n\n let wNodes = jsPlumb.getSelector('.statemachine-demo .w')\n\n // Backfill line\n this.JspInstance.batch(() => {\n for (let i = 0; i < wNodes.length; i++) {\n this.initNode(wNodes[i])\n }\n _.map(connects, v => {\n let sourceId = v.endPointSourceId.split('-')\n let targetId = v.endPointTargetId.split('-')\n if (sourceId.length === 4 && targetId.length === 4) {\n sourceId = `${sourceId[0]}-${sourceId[1]}-${sourceId[2]}`\n targetId = `${targetId[0]}-${targetId[1]}-${targetId[2]}`\n } else {\n sourceId = v.endPointSourceId\n targetId = v.endPointTargetId\n }\n\n this.JspInstance.connect({\n source: sourceId,\n target: targetId,\n type: 'basic',\n paintStyle: { strokeWidth: 2, stroke: '#555' }\n })\n })\n })\n\n jsPlumb.fire('jsPlumbDemoLoaded', this.JspInstance)\n\n // Connection monitoring\n this.handleEvent()\n\n // Drag and drop new nodes\n this.draggable()\n}\n\nexport default new JSP()\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/udp/udp.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/localParams.vue","\nimport Vue from 'vue'\nimport mAffirm from './jumpAffirm'\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\nimport { uuid, findComponentDownward } from '@/module/util/'\n\nlet Affirm = {}\nlet $root = {}\nlet $routerType = ''\nlet $isPop = true\n\n/**\n * Listen for route changes\n */\nrouter.beforeEach((to, from, next) => {\n if (from.name === 'projects-definition-details' || from.name === 'projects-instance-details' || from.name === 'definition-create') {\n if (!Affirm.paramVerification(from.name)) {\n Affirm.isPop(() => {\n next()\n })\n } else {\n next()\n }\n } else {\n next()\n }\n})\n\n/**\n * Get judgment initialization data\n */\nAffirm.init = (root) => {\n $isPop = true\n $root = root\n $routerType = router.history.current.name\n}\n\n/**\n * Parameter verification\n */\nAffirm.paramVerification = (name) => {\n if (!$isPop) {\n return true\n }\n let dagStore = store.state.dag\n let flag = false\n if ($routerType === 'definition-create') {\n // No nodes jump out directly\n if (dagStore.tasks.length) {\n if (!dagStore.name) {\n store.commit('dag/setName', `${uuid('dag_')}${uuid() + uuid()}`)\n }\n flag = false\n } else {\n flag = true\n }\n } else {\n // View history direct jump\n flag = name === 'projects-instance-details' ? true : !dagStore.isEditDag\n }\n return flag\n}\n\n/**\n * Pop-up judgment\n */\nAffirm.isPop = (fn) => {\n Vue.$modal.dialog({\n closable: false,\n showMask: true,\n escClose: true,\n className: 'v-modal-custom',\n transitionName: 'opacityp',\n render (h) {\n return h(mAffirm, {\n on: {\n ok () {\n // save\n findComponentDownward($root, 'dag-chart')._save('affirm').then(() => {\n fn()\n Vue.$modal.destroy()\n }).catch(() => {\n fn()\n Vue.$modal.destroy()\n })\n },\n close () {\n fn()\n Vue.$modal.destroy()\n }\n },\n props: {\n }\n })\n }\n })\n}\n\n/**\n * Whether the external setting pops up\n */\nAffirm.setIsPop = (is) => {\n $isPop = is\n}\n\nexport default Affirm\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/jumpAffirm/index.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/jumpAffirm/jumpAffirm.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/formModel.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/listBox.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/resources.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/udfs.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/sqlType.vue","var normalizeComponent = require(\"!../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./datasource.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./datasource.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-62aa87e3\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./datasource.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/dag/_source/formModel/tasks/_source/datasource.vue\n// module id = 786\n// module chunks = 3 4 5","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/datasource.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/procedure.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/dependItemList.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/sub_process.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/_source/selectInput.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/_source/timeoutAlarm.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-2175c153\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./start.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./start.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./start.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-2175c153\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./start.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue\n// module id = 798\n// module chunks = 0 3 4 5","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\n\nexport default {\n data () {\n return {\n router,\n store,\n isDetails: false\n }\n },\n created () {\n this.isDetails = this.store.state.dag.isDetails\n },\n methods: {\n },\n computed: {\n _isDetails () {\n return this.isDetails ? 'icon-disabled' : ''\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/module/mixin/disabledState.js","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n// This is CodeMirror (https://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\//.test(userAgent);\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\\/\\w+/.test(userAgent);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt() {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var activeElement;\n try {\n activeElement = document.activeElement;\n } catch(e) {\n activeElement = document.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {this.id = null;};\n Delayed.prototype.set = function (ms, f) {\n clearTimeout(this.id);\n this.id = setTimeout(f, ms);\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 30;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\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]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n input.init(d);\n }\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n // Add a span to a line.\n function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers || (emitter._handlers = {});\n map$$1[type] = (map$$1[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers, arr = map$$1 && map$$1[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map$$1[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range$$1;\n try {range$$1 = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range$$1 || range$$1.parentElement() != te) { return false }\n return range$$1.compareEndPoints(\"StartToEnd\", range$$1) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var this$1 = this;\n\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n var this$1 = this;\n\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this$1.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\s)\" + lineClass[2] + \"(?:$|\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {\n var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (node.className == \"CodeMirror-linewidget\")\n { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\");\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map$$1, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map$$1.length; i += 3) {\n mStart = map$$1[i];\n mEnd = map$$1[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map$$1.length - 3 || ch == mEnd && map$$1[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map$$1[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map$$1[i - 2] == map$$1[i - 3] && map$$1[i - 1].insertLeft) {\n node = map$$1[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map$$1.length - 3 && map$$1[i + 3] == map$$1[i + 4] && !map$$1[i + 5].insertLeft) {\n node = map$$1[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX() {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }\n return window.pageXOffset || (document.documentElement || document.body).scrollLeft\n }\n function pageScrollY() {\n if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }\n return window.pageYOffset || (document.documentElement || document.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var height = 0;\n if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above)\n { height += widgetHeight(lineObj.widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = true; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo$$1, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight$$1 = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo$$1, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight$$1; box.bottom += widgetHeight$$1;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight$$1 <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo$$1, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top || y >= coords.bottom;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo$$1, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo$$1, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo$$1, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo$$1, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range$$1 = doc.sel.ranges[i];\n if (range$$1.from().line >= cm.display.viewTo || range$$1.to().line < cm.display.viewFrom) { continue }\n var collapsed = range$$1.empty();\n if (collapsed || cm.options.showCursorWhenSelecting)\n { drawSelectionCursor(cm, range$$1.head, curFragment); }\n if (!collapsed)\n { drawSelectionRange(cm, range$$1, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\"; },\n cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n onBlur(cm);\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range$$1) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range$$1;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val);\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.pointerEvents = this.vert.style.pointerEvents = \"none\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.pointerEvents = \"auto\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt$$1 = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt$$1 != bar) { bar.style.pointerEvents = \"none\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt();\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this$1.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt();\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = window.getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }\n snapshot.activeElt.focus();\n if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var sel = window.getSelection(), range$$1 = document.createRange();\n range$$1.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range$$1.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range$$1);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(cm) {\n var width = cm.display.gutters.offsetWidth;\n cm.display.sizer.style.marginLeft = width + \"px\";\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }\n\n // Make sure the gutters options contains the element\n // \"CodeMirror-linenumbers\" when the lineNumbers option is true.\n function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && wheelPixelsPerUnit != null) {\n var pixels = dy * wheelPixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n var this$1 = this;\n\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this$1.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var this$1 = this;\n\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this$1.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n var this$1 = this;\n\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this$1.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(startGen) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = startGen || 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm)\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n var this$1 = this;\n\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this$1;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n var this$1 = this;\n\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this$1.lines[i];\n this$1.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var e = at + n; at < e; ++at)\n { if (op(this$1.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n var this$1 = this;\n\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this$1;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n var this$1 = this;\n\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this$1.height -= oldHeight - child.height;\n if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this$1.children.splice(++i, 0, leaf);\n leaf.parent = this$1;\n }\n child.lines = child.lines.slice(0, remaining);\n this$1.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n var this$1 = this;\n\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this$1[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var this$1 = this;\n\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n var this$1 = this;\n\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null));\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n var this$1 = this;\n\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this$1; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this$1.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range$$1 = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range$$1.head; }\n else if (start == \"anchor\") { pos = range$$1.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range$$1.to(); }\n else { pos = range$$1.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n var this$1 = this;\n\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this$1, ranges[i].anchor),\n clipPos(this$1, ranges[i].head)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var this$1 = this;\n\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var this$1 = this;\n\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var this$1 = this;\n\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range$$1 = sel.ranges[i];\n changes[i] = {from: range$$1.from(), to: range$$1.to(), text: this$1.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this$1, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {this.history = new History(this.history.maxGeneration);},\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history.maxGeneration);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo$$1 = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo$$1 == from.line && from.ch >= span.to ||\n span.from == null && lineNo$$1 != from.line ||\n span.from != null && lineNo$$1 == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo$$1;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo$$1 = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo$$1;\n });\n return clipPos(this, Pos(lineNo$$1, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n var this$1 = this;\n\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this$1.linked[i];\n if (link.doc != other) { continue }\n this$1.linked.splice(i, 1);\n other.unlinkDoc(this$1);\n detachSharedMarkers(findSharedMarkers(this$1));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var loadFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1)\n { return }\n\n var reader = new FileReader;\n reader.onload = operation(cm, function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) { content = \"\"; }\n text[i] = content;\n if (++read == n) {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)));\n }\n });\n reader.readAsText(file);\n };\n for (var i = 0; i < n; ++i) { loadFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 127: \"Delete\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Alt-F\": \"goWordRight\", \"Alt-B\": \"goWordLeft\", \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\",\n \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\", \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\",\n \"Alt-D\": \"delWordAfter\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\", \"Ctrl-T\": \"transposeChars\",\n \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map$$1, handle, context) {\n map$$1 = getKeyMap(map$$1);\n var found = map$$1.call ? map$$1.call(key, context) : map$$1[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map$$1.fallthrough) {\n if (Object.prototype.toString.call(map$$1.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map$$1.fallthrough, handle, context) }\n for (var i = 0; i < map$$1.fallthrough.length; i++) {\n var result = lookupKey(key, map$$1.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Cmd\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"char\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(0, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n cm.curOp.focus = activeElt();\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if (webkit || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n delayBlurEvent(cm);\n setTimeout(function () { return display.input.focus(); }, 20);\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.options.gutters.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.options.gutters[i];\n signal(cm, type, cm, line, gutter, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b-\\u200f\\u2028\\u2029\\ufeff]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n guttersChanged(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"firstLineNumber\", 1, guttersChanged, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, guttersChanged, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function guttersChanged(cm) {\n updateGutters(cm);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n setGuttersForLineNumbers(options);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input);\n display.wrapper.CodeMirror = this;\n updateGutters(this);\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(bind(onFocus, this), 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this$1, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range$$1 = sel.ranges[i$1];\n var from = range$$1.from(), to = range$$1.to();\n if (range$$1.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == inserted)\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput)\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range$$1 = sel.ranges[i];\n if (range$$1.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range$$1.head.line)) { continue }\n var mode = cm.getModeAt(range$$1.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range$$1.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range$$1.head.line).text.slice(0, range$$1.head.ch)))\n { indented = indentLine(cm, range$$1.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range$$1.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", !!autocorrect);\n field.setAttribute(\"autocapitalize\", !!autocapitalize);\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n disableBrowserMagic(te);\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map$$1, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n },\n removeKeyMap: function(map$$1) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this$1.state.modeGen++;\n regChange(this$1);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range$$1 = ranges[i];\n if (!range$$1.empty()) {\n var from = range$$1.from(), to = range$$1.to();\n var start = Math.max(end, from.line);\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how); }\n var newRanges = this$1.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range$$1.head.line > end) {\n indentLine(this$1, range$$1.head.line, how, true);\n end = range$$1.head.line;\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range$$1 = this.doc.sel.primary();\n if (start == null) { pos = range$$1.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range$$1.from() : range$$1.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range$$1) {\n if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range$$1) {\n var other = findPosH(doc, range$$1.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this$1, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range$$1) {\n if (collapse)\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range$$1 == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range$$1, margin) {\n if (range$$1 == null) {\n range$$1 = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range$$1 == \"number\") {\n range$$1 = {from: Pos(range$$1, 0), to: null};\n } else if (range$$1.from == null) {\n range$$1 = {from: range$$1, to: null};\n }\n if (!range$$1.to) { range$$1.to = range$$1.from; }\n range$$1.margin = margin || 0;\n\n if (range$$1.from.line != null) {\n scrollToRange(this, range$$1);\n } else {\n scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo$$1 = this.display.viewFrom;\n this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n ++lineNo$$1;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"char\", \"column\" (like char, but doesn't\n // cross line boundaries), \"word\" (across next word), or \"group\" (to\n // the start of next group of word or non-word-non-whitespace\n // chars). The visually param controls whether, in right-to-left\n // text, direction 1 means to move towards the next index in the\n // string, or towards the character to the right of the current\n // position. The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n function findNextLine() {\n var l = pos.line + dir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n on(div, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = document.activeElement;\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = this.cm.state.focused;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map$$1 = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map$$1[map$$1.length - 1], offset: map$$1[map$$1.length - 2] - map$$1[map$$1.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor())\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var input = this;\n if (this.selectionInEditor())\n { this.pollSelection(); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range$$1;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range$$1 = found[0].find(0)))\n { addText(getBetween(cm.doc, range$$1.from, range$$1.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map$$1 = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map$$1.length; j += 3) {\n var curNode = map$$1[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map$$1[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map$$1[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing) { return }\n var cm = this.cm;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt() != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { window.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt();\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, …*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.45.0\";\n\n return CodeMirror;\n\n})));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/lib/codemirror.js\n// module id = 644\n// module chunks = 3 4 5 7 8 14","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-f72bdd3a\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./secondaryMenu.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./secondaryMenu.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./secondaryMenu.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-f72bdd3a\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./secondaryMenu.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/secondaryMenu/secondaryMenu.vue\n// module id = 654\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 25 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/priority/priority.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport _ from 'lodash'\nimport $ from 'jquery'\nimport i18n from '@/module/i18n'\nimport store from '@/conf/home/store'\n\n/**\n * Node, to array\n */\nconst rtTargetarrArr = (id) => {\n let a = $(`#${id}`).attr('data-targetarr')\n return a ? a.split(',') : []\n}\n\n/**\n * Store node id to targetarr\n */\nconst saveTargetarr = (valId, domId) => {\n let $target = $(`#${domId}`)\n let targetStr = $target.attr('data-targetarr') ? $target.attr('data-targetarr') + `,${valId}` : `${valId}`\n $target.attr('data-targetarr', targetStr)\n}\n\nconst rtBantpl = () => {\n return ``\n}\n\n/**\n * return node html\n */\nconst rtTasksTpl = ({ id, name, x, y, targetarr, isAttachment, taskType,runFlag }) => {\n let tpl = ``\n tpl += `
`\n tpl += `
`\n tpl += `
`\n tpl += `
`\n tpl += `${name}`\n tpl += `
`\n tpl += `
`\n tpl += `
`\n if (runFlag === 'FORBIDDEN') {\n tpl += rtBantpl()\n }\n tpl += `
`\n tpl += `
`\n\n return tpl\n}\n\n/**\n * Get all tasks nodes\n */\nconst tasksAll = () => {\n let a = []\n $('#canvas .w').each(function (idx, elem) {\n let e = $(elem)\n a.push({\n id: e.attr('id'),\n name: e.find('.name-p').text(),\n targetarr: e.attr('data-targetarr') || '',\n x: parseInt(e.css('left'), 10),\n y: parseInt(e.css('top'), 10)\n })\n })\n return a\n}\n\n/**\n * Determine if name is in the current dag map\n * rely dom / backfill\n */\nconst isNameExDag = (name, rely) => {\n if (rely === 'dom') {\n return _.findIndex(tasksAll(), v => v.name === name) !== -1\n } else {\n return _.findIndex(store.state.dag.tasks, v => v.name === name) !== -1\n }\n}\n\n/**\n * Change svg line color\n */\nconst setSvgColor = (e, color) => {\n // Traverse clear all colors\n $('.jtk-connector').each((i, o) => {\n _.map($(o)[0].childNodes, v => {\n $(v).attr('fill', '#555').attr('stroke', '#555').attr('stroke-width', 2)\n })\n })\n\n // Add color to the selection\n _.map($(e.canvas)[0].childNodes, (v, i) => {\n $(v).attr('fill', color).attr('stroke', color)\n if ($(v).attr('class')) {\n $(v).attr('stroke-width', 2)\n }\n })\n}\n\n/**\n * Get all node ids\n */\nconst allNodesId = () => {\n let idArr = []\n $('.w').each((i, o) => {\n let $obj = $(o)\n let $span = $obj.find('.name-p').text()\n if ($span) {\n idArr.push({\n id: $obj.attr('id'),\n name: $span\n })\n }\n })\n return idArr\n}\n\nexport {\n rtTargetarrArr,\n saveTargetarr,\n rtTasksTpl,\n tasksAll,\n isNameExDag,\n setSvgColor,\n allNodesId,\n rtBantpl\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/plugIn/util.js","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-5b25ea8f\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./resources.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./resources.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./resources.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-5b25ea8f\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./resources.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/dag/_source/formModel/tasks/_source/resources.vue\n// module id = 699\n// module chunks = 3 4 5","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-6a4fc01c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./priority.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./priority.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./priority.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-6a4fc01c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./priority.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/priority/priority.vue\n// module id = 700\n// module chunks = 0 3 4 5 6","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport i18n from '@/module/i18n'\n/**\n * download file\n */\nlet downloadFile = ($url, $obj) => {\n let param = {\n url: $url,\n obj: $obj\n }\n\n if (!param.url) {\n this.$message.warning(`${i18n.$t('无下载url无法下载')}`)\n return\n }\n\n let generatorInput = function (obj) {\n let result = ''\n let keyArr = Object.keys(obj)\n keyArr.forEach(function (key) {\n result += \"\"\n })\n return result\n }\n $(`
${generatorInput(param.obj)}
`).appendTo('body').submit().remove()\n}\n\nexport { downloadFile }\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/module/download/index.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue","/**\n * jsBezier\n *\n * Copyright (c) 2010 - 2017 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * licensed under the MIT license.\n *\n * a set of Bezier curve functions that deal with Beziers, used by jsPlumb, and perhaps useful for other people. These functions work with Bezier\n * curves of arbitrary degree.\n *\n * - functions are all in the 'jsBezier' namespace.\n *\n * - all input points should be in the format {x:.., y:..}. all output points are in this format too.\n *\n * - all input curves should be in the format [ {x:.., y:..}, {x:.., y:..}, {x:.., y:..}, {x:.., y:..} ]\n *\n * - 'location' as used as an input here refers to a decimal in the range 0-1 inclusive, which indicates a point some proportion along the length\n * of the curve. location as output has the same format and meaning.\n *\n *\n * Function List:\n * --------------\n *\n * distanceFromCurve(point, curve)\n *\n * \tCalculates the distance that the given point lies from the given Bezier. Note that it is computed relative to the center of the Bezier,\n * so if you have stroked the curve with a wide pen you may wish to take that into account! The distance returned is relative to the values\n * of the curve and the point - it will most likely be pixels.\n *\n * gradientAtPoint(curve, location)\n *\n * \tCalculates the gradient to the curve at the given location, as a decimal between 0 and 1 inclusive.\n *\n * gradientAtPointAlongCurveFrom (curve, location)\n *\n *\tCalculates the gradient at the point on the given curve that is 'distance' units from location.\n *\n * nearestPointOnCurve(point, curve)\n *\n *\tCalculates the nearest point to the given point on the given curve. The return value of this is a JS object literal, containing both the\n *point's coordinates and also the 'location' of the point (see above), for example: { point:{x:551,y:150}, location:0.263365 }.\n *\n * pointOnCurve(curve, location)\n *\n * \tCalculates the coordinates of the point on the given Bezier curve at the given location.\n *\n * pointAlongCurveFrom(curve, location, distance)\n *\n * \tCalculates the coordinates of the point on the given curve that is 'distance' units from location. 'distance' should be in the same coordinate\n * space as that used to construct the Bezier curve. For an HTML Canvas usage, for example, distance would be a measure of pixels.\n *\n * locationAlongCurveFrom(curve, location, distance)\n *\n * \tCalculates the location on the given curve that is 'distance' units from location. 'distance' should be in the same coordinate\n * space as that used to construct the Bezier curve. For an HTML Canvas usage, for example, distance would be a measure of pixels.\n *\n * perpendicularToCurveAt(curve, location, length, distance)\n *\n * \tCalculates the perpendicular to the given curve at the given location. length is the length of the line you wish for (it will be centered\n * on the point at 'location'). distance is optional, and allows you to specify a point along the path from the given location as the center of\n * the perpendicular returned. The return value of this is an array of two points: [ {x:...,y:...}, {x:...,y:...} ].\n *\n *\n */\n\n(function() {\n\n var root = this;\n\n if(typeof Math.sgn == \"undefined\") {\n Math.sgn = function(x) { return x == 0 ? 0 : x > 0 ? 1 :-1; };\n }\n\n var Vectors = {\n subtract \t: \tfunction(v1, v2) { return {x:v1.x - v2.x, y:v1.y - v2.y }; },\n dotProduct\t: \tfunction(v1, v2) { return (v1.x * v2.x) + (v1.y * v2.y); },\n square\t\t:\tfunction(v) { return Math.sqrt((v.x * v.x) + (v.y * v.y)); },\n scale\t\t:\tfunction(v, s) { return {x:v.x * s, y:v.y * s }; }\n },\n\n maxRecursion = 64,\n flatnessTolerance = Math.pow(2.0,-maxRecursion-1);\n\n /**\n * Calculates the distance that the point lies from the curve.\n *\n * @param point a point in the form {x:567, y:3342}\n * @param curve a Bezier curve in the form [{x:..., y:...}, {x:..., y:...}, {x:..., y:...}, {x:..., y:...}]. note that this is currently\n * hardcoded to assume cubiz beziers, but would be better off supporting any degree.\n * @return a JS object literal containing location and distance, for example: {location:0.35, distance:10}. Location is analogous to the location\n * argument you pass to the pointOnPath function: it is a ratio of distance travelled along the curve. Distance is the distance in pixels from\n * the point to the curve.\n */\n var _distanceFromCurve = function(point, curve) {\n var candidates = [],\n w = _convertToBezier(point, curve),\n degree = curve.length - 1, higherDegree = (2 * degree) - 1,\n numSolutions = _findRoots(w, higherDegree, candidates, 0),\n v = Vectors.subtract(point, curve[0]), dist = Vectors.square(v), t = 0.0;\n\n for (var i = 0; i < numSolutions; i++) {\n v = Vectors.subtract(point, _bezier(curve, degree, candidates[i], null, null));\n var newDist = Vectors.square(v);\n if (newDist < dist) {\n dist = newDist;\n t = candidates[i];\n }\n }\n v = Vectors.subtract(point, curve[degree]);\n newDist = Vectors.square(v);\n if (newDist < dist) {\n dist = newDist;\n t = 1.0;\n }\n return {location:t, distance:dist};\n };\n /**\n * finds the nearest point on the curve to the given point.\n */\n var _nearestPointOnCurve = function(point, curve) {\n var td = _distanceFromCurve(point, curve);\n return {point:_bezier(curve, curve.length - 1, td.location, null, null), location:td.location};\n };\n var _convertToBezier = function(point, curve) {\n var degree = curve.length - 1, higherDegree = (2 * degree) - 1,\n c = [], d = [], cdTable = [], w = [],\n z = [ [1.0, 0.6, 0.3, 0.1], [0.4, 0.6, 0.6, 0.4], [0.1, 0.3, 0.6, 1.0] ];\n\n for (var i = 0; i <= degree; i++) c[i] = Vectors.subtract(curve[i], point);\n for (var i = 0; i <= degree - 1; i++) {\n d[i] = Vectors.subtract(curve[i+1], curve[i]);\n d[i] = Vectors.scale(d[i], 3.0);\n }\n for (var row = 0; row <= degree - 1; row++) {\n for (var column = 0; column <= degree; column++) {\n if (!cdTable[row]) cdTable[row] = [];\n cdTable[row][column] = Vectors.dotProduct(d[row], c[column]);\n }\n }\n for (i = 0; i <= higherDegree; i++) {\n if (!w[i]) w[i] = [];\n w[i].y = 0.0;\n w[i].x = parseFloat(i) / higherDegree;\n }\n var n = degree, m = degree-1;\n for (var k = 0; k <= n + m; k++) {\n var lb = Math.max(0, k - m),\n ub = Math.min(k, n);\n for (i = lb; i <= ub; i++) {\n var j = k - i;\n w[i+j].y += cdTable[j][i] * z[j][i];\n }\n }\n return w;\n };\n /**\n * counts how many roots there are.\n */\n var _findRoots = function(w, degree, t, depth) {\n var left = [], right = [],\n left_count, right_count,\n left_t = [], right_t = [];\n\n switch (_getCrossingCount(w, degree)) {\n case 0 : {\n return 0;\n }\n case 1 : {\n if (depth >= maxRecursion) {\n t[0] = (w[0].x + w[degree].x) / 2.0;\n return 1;\n }\n if (_isFlatEnough(w, degree)) {\n t[0] = _computeXIntercept(w, degree);\n return 1;\n }\n break;\n }\n }\n _bezier(w, degree, 0.5, left, right);\n left_count = _findRoots(left, degree, left_t, depth+1);\n right_count = _findRoots(right, degree, right_t, depth+1);\n for (var i = 0; i < left_count; i++) t[i] = left_t[i];\n for (var i = 0; i < right_count; i++) t[i+left_count] = right_t[i];\n return (left_count+right_count);\n };\n var _getCrossingCount = function(curve, degree) {\n var n_crossings = 0, sign, old_sign;\n sign = old_sign = Math.sgn(curve[0].y);\n for (var i = 1; i <= degree; i++) {\n sign = Math.sgn(curve[i].y);\n if (sign != old_sign) n_crossings++;\n old_sign = sign;\n }\n return n_crossings;\n };\n var _isFlatEnough = function(curve, degree) {\n var error,\n intercept_1, intercept_2, left_intercept, right_intercept,\n a, b, c, det, dInv, a1, b1, c1, a2, b2, c2;\n a = curve[0].y - curve[degree].y;\n b = curve[degree].x - curve[0].x;\n c = curve[0].x * curve[degree].y - curve[degree].x * curve[0].y;\n\n var max_distance_above, max_distance_below;\n max_distance_above = max_distance_below = 0.0;\n\n for (var i = 1; i < degree; i++) {\n var value = a * curve[i].x + b * curve[i].y + c;\n if (value > max_distance_above)\n max_distance_above = value;\n else if (value < max_distance_below)\n max_distance_below = value;\n }\n\n a1 = 0.0; b1 = 1.0; c1 = 0.0; a2 = a; b2 = b;\n c2 = c - max_distance_above;\n det = a1 * b2 - a2 * b1;\n dInv = 1.0/det;\n intercept_1 = (b1 * c2 - b2 * c1) * dInv;\n a2 = a; b2 = b; c2 = c - max_distance_below;\n det = a1 * b2 - a2 * b1;\n dInv = 1.0/det;\n intercept_2 = (b1 * c2 - b2 * c1) * dInv;\n left_intercept = Math.min(intercept_1, intercept_2);\n right_intercept = Math.max(intercept_1, intercept_2);\n error = right_intercept - left_intercept;\n return (error < flatnessTolerance)? 1 : 0;\n };\n var _computeXIntercept = function(curve, degree) {\n var XLK = 1.0, YLK = 0.0,\n XNM = curve[degree].x - curve[0].x, YNM = curve[degree].y - curve[0].y,\n XMK = curve[0].x - 0.0, YMK = curve[0].y - 0.0,\n det = XNM*YLK - YNM*XLK, detInv = 1.0/det,\n S = (XNM*YMK - YNM*XMK) * detInv;\n return 0.0 + XLK * S;\n };\n var _bezier = function(curve, degree, t, left, right) {\n var temp = [[]];\n for (var j =0; j <= degree; j++) temp[0][j] = curve[j];\n for (var i = 1; i <= degree; i++) {\n for (var j =0 ; j <= degree - i; j++) {\n if (!temp[i]) temp[i] = [];\n if (!temp[i][j]) temp[i][j] = {};\n temp[i][j].x = (1.0 - t) * temp[i-1][j].x + t * temp[i-1][j+1].x;\n temp[i][j].y = (1.0 - t) * temp[i-1][j].y + t * temp[i-1][j+1].y;\n }\n }\n if (left != null)\n for (j = 0; j <= degree; j++) left[j] = temp[j][0];\n if (right != null)\n for (j = 0; j <= degree; j++) right[j] = temp[degree-j][j];\n\n return (temp[degree][0]);\n };\n\n var _curveFunctionCache = {};\n var _getCurveFunctions = function(order) {\n var fns = _curveFunctionCache[order];\n if (!fns) {\n fns = [];\n var f_term = function() { return function(t) { return Math.pow(t, order); }; },\n l_term = function() { return function(t) { return Math.pow((1-t), order); }; },\n c_term = function(c) { return function(t) { return c; }; },\n t_term = function() { return function(t) { return t; }; },\n one_minus_t_term = function() { return function(t) { return 1-t; }; },\n _termFunc = function(terms) {\n return function(t) {\n var p = 1;\n for (var i = 0; i < terms.length; i++) p = p * terms[i](t);\n return p;\n };\n };\n\n fns.push(new f_term()); // first is t to the power of the curve order\n for (var i = 1; i < order; i++) {\n var terms = [new c_term(order)];\n for (var j = 0 ; j < (order - i); j++) terms.push(new t_term());\n for (var j = 0 ; j < i; j++) terms.push(new one_minus_t_term());\n fns.push(new _termFunc(terms));\n }\n fns.push(new l_term()); // last is (1-t) to the power of the curve order\n\n _curveFunctionCache[order] = fns;\n }\n\n return fns;\n };\n\n\n /**\n * calculates a point on the curve, for a Bezier of arbitrary order.\n * @param curve an array of control points, eg [{x:10,y:20}, {x:50,y:50}, {x:100,y:100}, {x:120,y:100}]. For a cubic bezier this should have four points.\n * @param location a decimal indicating the distance along the curve the point should be located at. this is the distance along the curve as it travels, taking the way it bends into account. should be a number from 0 to 1, inclusive.\n */\n var _pointOnPath = function(curve, location) {\n var cc = _getCurveFunctions(curve.length - 1),\n _x = 0, _y = 0;\n for (var i = 0; i < curve.length ; i++) {\n _x = _x + (curve[i].x * cc[i](location));\n _y = _y + (curve[i].y * cc[i](location));\n }\n\n return {x:_x, y:_y};\n };\n\n var _dist = function(p1,p2) {\n return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));\n };\n\n var _isPoint = function(curve) {\n return curve[0].x === curve[1].x && curve[0].y === curve[1].y;\n };\n\n /**\n * finds the point that is 'distance' along the path from 'location'. this method returns both the x,y location of the point and also\n * its 'location' (proportion of travel along the path); the method below - _pointAlongPathFrom - calls this method and just returns the\n * point.\n */\n var _pointAlongPath = function(curve, location, distance) {\n\n if (_isPoint(curve)) {\n return {\n point:curve[0],\n location:location\n };\n }\n\n var prev = _pointOnPath(curve, location),\n tally = 0,\n curLoc = location,\n direction = distance > 0 ? 1 : -1,\n cur = null;\n\n while (tally < Math.abs(distance)) {\n curLoc += (0.005 * direction);\n cur = _pointOnPath(curve, curLoc);\n tally += _dist(cur, prev);\n prev = cur;\n }\n return {point:cur, location:curLoc};\n };\n\n var _length = function(curve) {\n if (_isPoint(curve)) return 0;\n\n var prev = _pointOnPath(curve, 0),\n tally = 0,\n curLoc = 0,\n direction = 1,\n cur = null;\n\n while (curLoc < 1) {\n curLoc += (0.005 * direction);\n cur = _pointOnPath(curve, curLoc);\n tally += _dist(cur, prev);\n prev = cur;\n }\n return tally;\n };\n\n /**\n * finds the point that is 'distance' along the path from 'location'.\n */\n var _pointAlongPathFrom = function(curve, location, distance) {\n return _pointAlongPath(curve, location, distance).point;\n };\n\n /**\n * finds the location that is 'distance' along the path from 'location'.\n */\n var _locationAlongPathFrom = function(curve, location, distance) {\n return _pointAlongPath(curve, location, distance).location;\n };\n\n /**\n * returns the gradient of the curve at the given location, which is a decimal between 0 and 1 inclusive.\n *\n * thanks // http://bimixual.org/AnimationLibrary/beziertangents.html\n */\n var _gradientAtPoint = function(curve, location) {\n var p1 = _pointOnPath(curve, location),\n p2 = _pointOnPath(curve.slice(0, curve.length - 1), location),\n dy = p2.y - p1.y, dx = p2.x - p1.x;\n return dy === 0 ? Infinity : Math.atan(dy / dx);\n };\n\n /**\n returns the gradient of the curve at the point which is 'distance' from the given location.\n if this point is greater than location 1, the gradient at location 1 is returned.\n if this point is less than location 0, the gradient at location 0 is returned.\n */\n var _gradientAtPointAlongPathFrom = function(curve, location, distance) {\n var p = _pointAlongPath(curve, location, distance);\n if (p.location > 1) p.location = 1;\n if (p.location < 0) p.location = 0;\n return _gradientAtPoint(curve, p.location);\n };\n\n /**\n * calculates a line that is 'length' pixels long, perpendicular to, and centered on, the path at 'distance' pixels from the given location.\n * if distance is not supplied, the perpendicular for the given location is computed (ie. we set distance to zero).\n */\n var _perpendicularToPathAt = function(curve, location, length, distance) {\n distance = distance == null ? 0 : distance;\n var p = _pointAlongPath(curve, location, distance),\n m = _gradientAtPoint(curve, p.location),\n _theta2 = Math.atan(-1 / m),\n y = length / 2 * Math.sin(_theta2),\n x = length / 2 * Math.cos(_theta2);\n return [{x:p.point.x + x, y:p.point.y + y}, {x:p.point.x - x, y:p.point.y - y}];\n };\n\n /**\n * Calculates all intersections of the given line with the given curve.\n * @param x1\n * @param y1\n * @param x2\n * @param y2\n * @param curve\n * @returns {Array}\n */\n var _lineIntersection = function(x1, y1, x2, y2, curve) {\n var a = y2 - y1,\n b = x1 - x2,\n c = (x1 * (y1 - y2)) + (y1 * (x2-x1)),\n coeffs = _computeCoefficients(curve),\n p = [\n (a*coeffs[0][0]) + (b * coeffs[1][0]),\n (a*coeffs[0][1])+(b*coeffs[1][1]),\n (a*coeffs[0][2])+(b*coeffs[1][2]),\n (a*coeffs[0][3])+(b*coeffs[1][3]) + c\n ],\n r = _cubicRoots.apply(null, p),\n intersections = [];\n\n if (r != null) {\n\n for (var i = 0; i < 3; i++) {\n var t = r[i],\n t2 = Math.pow(t, 2),\n t3 = Math.pow(t, 3),\n x = [\n (coeffs[0][0] * t3) + (coeffs[0][1] * t2) + (coeffs[0][2] * t) + coeffs[0][3],\n (coeffs[1][0] * t3) + (coeffs[1][1] * t2) + (coeffs[1][2] * t) + coeffs[1][3]\n ];\n\n // check bounds of the line\n var s;\n if ((x2 - x1) !== 0) {\n s = (x[0] - x1) / (x2 - x1);\n }\n else {\n s = (x[1] - y1) / (y2 - y1);\n }\n\n if (t >= 0 && t <= 1.0 && s >= 0 && s <= 1.0) {\n intersections.push(x);\n }\n }\n }\n\n return intersections;\n };\n\n /**\n * Calculates all intersections of the given box with the given curve.\n * @param x X position of top left corner of box\n * @param y Y position of top left corner of box\n * @param w width of box\n * @param h height of box\n * @param curve\n * @returns {Array}\n */\n var _boxIntersection = function(x, y, w, h, curve) {\n var i = [];\n i.push.apply(i, _lineIntersection(x, y, x + w, y, curve));\n i.push.apply(i, _lineIntersection(x + w, y, x + w, y + h, curve));\n i.push.apply(i, _lineIntersection(x + w, y + h, x, y + h, curve));\n i.push.apply(i, _lineIntersection(x, y + h, x, y, curve));\n return i;\n };\n\n /**\n * Calculates all intersections of the given bounding box with the given curve.\n * @param boundingBox Bounding box, in { x:.., y:..., w:..., h:... } format.\n * @param curve\n * @returns {Array}\n */\n var _boundingBoxIntersection = function(boundingBox, curve) {\n var i = [];\n i.push.apply(i, _lineIntersection(boundingBox.x, boundingBox.y, boundingBox.x + boundingBox.w, boundingBox.y, curve));\n i.push.apply(i, _lineIntersection(boundingBox.x + boundingBox.w, boundingBox.y, boundingBox.x + boundingBox.w, boundingBox.y + boundingBox.h, curve));\n i.push.apply(i, _lineIntersection(boundingBox.x + boundingBox.w, boundingBox.y + boundingBox.h, boundingBox.x, boundingBox.y + boundingBox.h, curve));\n i.push.apply(i, _lineIntersection(boundingBox.x, boundingBox.y + boundingBox.h, boundingBox.x, boundingBox.y, curve));\n return i;\n };\n\n\n function _computeCoefficientsForAxis(curve, axis) {\n return [\n -(curve[0][axis]) + (3*curve[1][axis]) + (-3 * curve[2][axis]) + curve[3][axis],\n (3*(curve[0][axis])) - (6*(curve[1][axis])) + (3*(curve[2][axis])),\n -3*curve[0][axis] + 3*curve[1][axis],\n curve[0][axis]\n ];\n }\n\n function _computeCoefficients(curve)\n {\n return [\n _computeCoefficientsForAxis(curve, \"x\"),\n _computeCoefficientsForAxis(curve, \"y\")\n ];\n }\n\n function sgn(x) {\n return x < 0 ? -1 : x > 0 ? 1 : 0;\n }\n\n function _cubicRoots(a, b, c, d) {\n var A = b / a,\n B = c / a,\n C = d / a,\n Q = (3*B - Math.pow(A, 2))/9,\n R = (9*A*B - 27*C - 2*Math.pow(A, 3))/54,\n D = Math.pow(Q, 3) + Math.pow(R, 2),\n S,\n T,\n t = [];\n\n if (D >= 0) // complex or duplicate roots\n {\n S = sgn(R + Math.sqrt(D))*Math.pow(Math.abs(R + Math.sqrt(D)),(1/3));\n T = sgn(R - Math.sqrt(D))*Math.pow(Math.abs(R - Math.sqrt(D)),(1/3));\n\n t[0] = -A/3 + (S + T);\n t[1] = -A/3 - (S + T)/2;\n t[2] = -A/3 - (S + T)/2;\n\n /*discard complex roots*/\n if (Math.abs(Math.sqrt(3)*(S - T)/2) !== 0) {\n t[1] = -1;\n t[2] = -1;\n }\n }\n else // distinct real roots\n {\n var th = Math.acos(R/Math.sqrt(-Math.pow(Q, 3)));\n t[0] = 2*Math.sqrt(-Q)*Math.cos(th/3) - A/3;\n t[1] = 2*Math.sqrt(-Q)*Math.cos((th + 2*Math.PI)/3) - A/3;\n t[2] = 2*Math.sqrt(-Q)*Math.cos((th + 4*Math.PI)/3) - A/3;\n }\n\n // discard out of spec roots\n for (var i = 0; i < 3; i++) {\n if (t[i] < 0 || t[i] > 1.0) {\n t[i] = -1;\n }\n }\n\n return t;\n }\n\n var jsBezier = this.jsBezier = {\n distanceFromCurve : _distanceFromCurve,\n gradientAtPoint : _gradientAtPoint,\n gradientAtPointAlongCurveFrom : _gradientAtPointAlongPathFrom,\n nearestPointOnCurve : _nearestPointOnCurve,\n pointOnCurve : _pointOnPath,\n pointAlongCurveFrom : _pointAlongPathFrom,\n perpendicularToCurveAt : _perpendicularToPathAt,\n locationAlongCurveFrom:_locationAlongPathFrom,\n getLength:_length,\n lineIntersection:_lineIntersection,\n boxIntersection:_boxIntersection,\n boundingBoxIntersection:_boundingBoxIntersection,\n version:\"0.9.0\"\n };\n\n if (typeof exports !== \"undefined\") {\n exports.jsBezier = jsBezier;\n }\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/**\n * Biltong v0.4.0\n *\n * Various geometry functions written as part of jsPlumb and perhaps useful for others.\n *\n * Copyright (c) 2017 jsPlumb\n * https://jsplumbtoolkit.com\n *\n * Permission is hereby granted, free of charge, to any person\n * obtaining a copy of this software and associated documentation\n * files (the \"Software\"), to deal in the Software without\n * restriction, including without limitation the rights to use,\n * copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following\n * conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n * OTHER DEALINGS IN THE SOFTWARE.\n */\n;(function() {\n\n \"use strict\";\n var root = this;\n\n var Biltong = root.Biltong = {\n version:\"0.4.0\"\n };\n\n if (typeof exports !== \"undefined\") {\n exports.Biltong = Biltong;\n }\n\n var _isa = function(a) { return Object.prototype.toString.call(a) === \"[object Array]\"; },\n _pointHelper = function(p1, p2, fn) {\n p1 = _isa(p1) ? p1 : [p1.x, p1.y];\n p2 = _isa(p2) ? p2 : [p2.x, p2.y];\n return fn(p1, p2);\n },\n /**\n * @name Biltong.gradient\n * @function\n * @desc Calculates the gradient of a line between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The gradient of a line between the two points.\n */\n _gradient = Biltong.gradient = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n if (_p2[0] == _p1[0])\n return _p2[1] > _p1[1] ? Infinity : -Infinity;\n else if (_p2[1] == _p1[1])\n return _p2[0] > _p1[0] ? 0 : -0;\n else\n return (_p2[1] - _p1[1]) / (_p2[0] - _p1[0]);\n });\n },\n /**\n * @name Biltong.normal\n * @function\n * @desc Calculates the gradient of a normal to a line between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The gradient of a normal to a line between the two points.\n */\n _normal = Biltong.normal = function(p1, p2) {\n return -1 / _gradient(p1, p2);\n },\n /**\n * @name Biltong.lineLength\n * @function\n * @desc Calculates the length of a line between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The length of a line between the two points.\n */\n _lineLength = Biltong.lineLength = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n return Math.sqrt(Math.pow(_p2[1] - _p1[1], 2) + Math.pow(_p2[0] - _p1[0], 2));\n });\n },\n /**\n * @name Biltong.quadrant\n * @function\n * @desc Calculates the quadrant in which the angle between the two points lies.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Integer} The quadrant - 1 for upper right, 2 for lower right, 3 for lower left, 4 for upper left.\n */\n _quadrant = Biltong.quadrant = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n if (_p2[0] > _p1[0]) {\n return (_p2[1] > _p1[1]) ? 2 : 1;\n }\n else if (_p2[0] == _p1[0]) {\n return _p2[1] > _p1[1] ? 2 : 1;\n }\n else {\n return (_p2[1] > _p1[1]) ? 3 : 4;\n }\n });\n },\n /**\n * @name Biltong.theta\n * @function\n * @desc Calculates the angle between the two points.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Float} The angle between the two points.\n */\n _theta = Biltong.theta = function(p1, p2) {\n return _pointHelper(p1, p2, function(_p1, _p2) {\n var m = _gradient(_p1, _p2),\n t = Math.atan(m),\n s = _quadrant(_p1, _p2);\n if ((s == 4 || s== 3)) t += Math.PI;\n if (t < 0) t += (2 * Math.PI);\n\n return t;\n });\n },\n /**\n * @name Biltong.intersects\n * @function\n * @desc Calculates whether or not the two rectangles intersect.\n * @param {Rectangle} r1 First rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @param {Rectangle} r2 Second rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @return {Boolean} True if the rectangles intersect, false otherwise.\n */\n _intersects = Biltong.intersects = function(r1, r2) {\n var x1 = r1.x, x2 = r1.x + r1.w, y1 = r1.y, y2 = r1.y + r1.h,\n a1 = r2.x, a2 = r2.x + r2.w, b1 = r2.y, b2 = r2.y + r2.h;\n\n return ( (x1 <= a1 && a1 <= x2) && (y1 <= b1 && b1 <= y2) ) ||\n ( (x1 <= a2 && a2 <= x2) && (y1 <= b1 && b1 <= y2) ) ||\n ( (x1 <= a1 && a1 <= x2) && (y1 <= b2 && b2 <= y2) ) ||\n ( (x1 <= a2 && a1 <= x2) && (y1 <= b2 && b2 <= y2) ) ||\n ( (a1 <= x1 && x1 <= a2) && (b1 <= y1 && y1 <= b2) ) ||\n ( (a1 <= x2 && x2 <= a2) && (b1 <= y1 && y1 <= b2) ) ||\n ( (a1 <= x1 && x1 <= a2) && (b1 <= y2 && y2 <= b2) ) ||\n ( (a1 <= x2 && x1 <= a2) && (b1 <= y2 && y2 <= b2) );\n },\n /**\n * @name Biltong.encloses\n * @function\n * @desc Calculates whether or not r2 is completely enclosed by r1.\n * @param {Rectangle} r1 First rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @param {Rectangle} r2 Second rectangle, as a js object in the form `{x:.., y:.., w:.., h:..}`\n * @param {Boolean} [allowSharedEdges=false] If true, the concept of enclosure allows for one or more edges to be shared by the two rectangles.\n * @return {Boolean} True if r1 encloses r2, false otherwise.\n */\n _encloses = Biltong.encloses = function(r1, r2, allowSharedEdges) {\n var x1 = r1.x, x2 = r1.x + r1.w, y1 = r1.y, y2 = r1.y + r1.h,\n a1 = r2.x, a2 = r2.x + r2.w, b1 = r2.y, b2 = r2.y + r2.h,\n c = function(v1, v2, v3, v4) { return allowSharedEdges ? v1 <= v2 && v3>= v4 : v1 < v2 && v3 > v4; };\n\n return c(x1,a1,x2,a2) && c(y1,b1,y2,b2);\n },\n _segmentMultipliers = [null, [1, -1], [1, 1], [-1, 1], [-1, -1] ],\n _inverseSegmentMultipliers = [null, [-1, -1], [-1, 1], [1, 1], [1, -1] ],\n /**\n * @name Biltong.pointOnLine\n * @function\n * @desc Calculates a point on the line from `fromPoint` to `toPoint` that is `distance` units along the length of the line.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Point} Point on the line, in the form `{ x:..., y:... }`.\n */\n _pointOnLine = Biltong.pointOnLine = function(fromPoint, toPoint, distance) {\n var m = _gradient(fromPoint, toPoint),\n s = _quadrant(fromPoint, toPoint),\n segmentMultiplier = distance > 0 ? _segmentMultipliers[s] : _inverseSegmentMultipliers[s],\n theta = Math.atan(m),\n y = Math.abs(distance * Math.sin(theta)) * segmentMultiplier[1],\n x = Math.abs(distance * Math.cos(theta)) * segmentMultiplier[0];\n return { x:fromPoint.x + x, y:fromPoint.y + y };\n },\n /**\n * @name Biltong.perpendicularLineTo\n * @function\n * @desc Calculates a line of length `length` that is perpendicular to the line from `fromPoint` to `toPoint` and passes through `toPoint`.\n * @param {Point} p1 First point, either as a 2 entry array or object with `left` and `top` properties.\n * @param {Point} p2 Second point, either as a 2 entry array or object with `left` and `top` properties.\n * @return {Line} Perpendicular line, in the form `[ { x:..., y:... }, { x:..., y:... } ]`.\n */\n _perpendicularLineTo = Biltong.perpendicularLineTo = function(fromPoint, toPoint, length) {\n var m = _gradient(fromPoint, toPoint),\n theta2 = Math.atan(-1 / m),\n y = length / 2 * Math.sin(theta2),\n x = length / 2 * Math.cos(theta2);\n return [{x:toPoint.x + x, y:toPoint.y + y}, {x:toPoint.x - x, y:toPoint.y - y}];\n };\n}).call(typeof window !== 'undefined' ? window : this);\n;\n(function () {\n\n \"use strict\";\n\n /**\n * Creates a Touch object.\n * @param view\n * @param target\n * @param pageX\n * @param pageY\n * @param screenX\n * @param screenY\n * @param clientX\n * @param clientY\n * @returns {Touch}\n * @private\n */\n function _touch(view, target, pageX, pageY, screenX, screenY, clientX, clientY) {\n\n return new Touch({\n target:target,\n identifier:_uuid(),\n pageX: pageX,\n pageY: pageY,\n screenX: screenX,\n screenY: screenY,\n clientX: clientX || screenX,\n clientY: clientY || screenY\n });\n }\n\n /**\n * Create a synthetic touch list from the given list of Touch objects.\n * @returns {Array}\n * @private\n */\n function _touchList() {\n var list = [];\n Array.prototype.push.apply(list, arguments);\n list.item = function(index) { return this[index]; };\n return list;\n }\n\n /**\n * Create a Touch object and then insert it into a synthetic touch list, returning the list.s\n * @param view\n * @param target\n * @param pageX\n * @param pageY\n * @param screenX\n * @param screenY\n * @param clientX\n * @param clientY\n * @returns {Array}\n * @private\n */\n function _touchAndList(view, target, pageX, pageY, screenX, screenY, clientX, clientY) {\n return _touchList(_touch.apply(null, arguments));\n }\n\n var root = this,\n matchesSelector = function (el, selector, ctx) {\n ctx = ctx || el.parentNode;\n var possibles = ctx.querySelectorAll(selector);\n for (var i = 0; i < possibles.length; i++) {\n if (possibles[i] === el) {\n return true;\n }\n }\n return false;\n },\n _gel = function (el) {\n return (typeof el == \"string\" || el.constructor === String) ? document.getElementById(el) : el;\n },\n _t = function (e) {\n return e.srcElement || e.target;\n },\n //\n // gets path info for the given event - the path from target to obj, in the event's bubble chain. if doCompute\n // is false we just return target for the path.\n //\n _pi = function(e, target, obj, doCompute) {\n if (!doCompute) return { path:[target], end:1 };\n else if (typeof e.path !== \"undefined\" && e.path.indexOf) {\n return { path: e.path, end: e.path.indexOf(obj) };\n } else {\n var out = { path:[], end:-1 }, _one = function(el) {\n out.path.push(el);\n if (el === obj) {\n out.end = out.path.length - 1;\n }\n else if (el.parentNode != null) {\n _one(el.parentNode)\n }\n };\n _one(target);\n return out;\n }\n },\n _d = function (l, fn) {\n for (var i = 0, j = l.length; i < j; i++) {\n if (l[i] == fn) break;\n }\n if (i < l.length) l.splice(i, 1);\n },\n guid = 1,\n //\n // this function generates a guid for every handler, sets it on the handler, then adds\n // it to the associated object's map of handlers for the given event. this is what enables us\n // to unbind all events of some type, or all events (the second of which can be requested by the user,\n // but it also used by Mottle when an element is removed.)\n _store = function (obj, event, fn) {\n var g = guid++;\n obj.__ta = obj.__ta || {};\n obj.__ta[event] = obj.__ta[event] || {};\n // store each handler with a unique guid.\n obj.__ta[event][g] = fn;\n // set the guid on the handler.\n fn.__tauid = g;\n return g;\n },\n _unstore = function (obj, event, fn) {\n obj.__ta && obj.__ta[event] && delete obj.__ta[event][fn.__tauid];\n // a handler might have attached extra functions, so we unbind those too.\n if (fn.__taExtra) {\n for (var i = 0; i < fn.__taExtra.length; i++) {\n _unbind(obj, fn.__taExtra[i][0], fn.__taExtra[i][1]);\n }\n fn.__taExtra.length = 0;\n }\n // a handler might have attached an unstore callback\n fn.__taUnstore && fn.__taUnstore();\n },\n _curryChildFilter = function (children, obj, fn, evt) {\n if (children == null) return fn;\n else {\n var c = children.split(\",\"),\n _fn = function (e) {\n _fn.__tauid = fn.__tauid;\n var t = _t(e), target = t; // t is the target element on which the event occurred. it is the\n // element we will wish to pass to any callbacks.\n var pathInfo = _pi(e, t, obj, children != null)\n if (pathInfo.end != -1) {\n for (var p = 0; p < pathInfo.end; p++) {\n target = pathInfo.path[p];\n for (var i = 0; i < c.length; i++) {\n if (matchesSelector(target, c[i], obj)) {\n fn.apply(target, arguments);\n }\n }\n }\n }\n };\n registerExtraFunction(fn, evt, _fn);\n return _fn;\n }\n },\n //\n // registers an 'extra' function on some event listener function we were given - a function that we\n // created and bound to the element as part of our housekeeping, and which we want to unbind and remove\n // whenever the given function is unbound.\n registerExtraFunction = function (fn, evt, newFn) {\n fn.__taExtra = fn.__taExtra || [];\n fn.__taExtra.push([evt, newFn]);\n },\n DefaultHandler = function (obj, evt, fn, children) {\n if (isTouchDevice && touchMap[evt]) {\n var tfn = _curryChildFilter(children, obj, fn, touchMap[evt]);\n _bind(obj, touchMap[evt], tfn , fn);\n }\n if (evt === \"focus\" && obj.getAttribute(\"tabindex\") == null) {\n obj.setAttribute(\"tabindex\", \"1\");\n }\n _bind(obj, evt, _curryChildFilter(children, obj, fn, evt), fn);\n },\n SmartClickHandler = function (obj, evt, fn, children) {\n if (obj.__taSmartClicks == null) {\n var down = function (e) {\n obj.__tad = _pageLocation(e);\n },\n up = function (e) {\n obj.__tau = _pageLocation(e);\n },\n click = function (e) {\n if (obj.__tad && obj.__tau && obj.__tad[0] === obj.__tau[0] && obj.__tad[1] === obj.__tau[1]) {\n for (var i = 0; i < obj.__taSmartClicks.length; i++)\n obj.__taSmartClicks[i].apply(_t(e), [ e ]);\n }\n };\n DefaultHandler(obj, \"mousedown\", down, children);\n DefaultHandler(obj, \"mouseup\", up, children);\n DefaultHandler(obj, \"click\", click, children);\n obj.__taSmartClicks = [];\n }\n\n // store in the list of callbacks\n obj.__taSmartClicks.push(fn);\n // the unstore function removes this function from the object's listener list for this type.\n fn.__taUnstore = function () {\n _d(obj.__taSmartClicks, fn);\n };\n },\n _tapProfiles = {\n \"tap\": {touches: 1, taps: 1},\n \"dbltap\": {touches: 1, taps: 2},\n \"contextmenu\": {touches: 2, taps: 1}\n },\n TapHandler = function (clickThreshold, dblClickThreshold) {\n return function (obj, evt, fn, children) {\n // if event is contextmenu, for devices which are mouse only, we want to\n // use the default bind.\n if (evt == \"contextmenu\" && isMouseDevice)\n DefaultHandler(obj, evt, fn, children);\n else {\n // the issue here is that this down handler gets registered only for the\n // child nodes in the first registration. in fact it should be registered with\n // no child selector and then on down we should cycle through the registered\n // functions to see if one of them matches. on mouseup we should execute ALL of\n // the functions whose children are either null or match the element.\n if (obj.__taTapHandler == null) {\n var tt = obj.__taTapHandler = {\n tap: [],\n dbltap: [],\n contextmenu: [],\n down: false,\n taps: 0,\n downSelectors: []\n };\n var down = function (e) {\n var target = _t(e), pathInfo = _pi(e, target, obj, children != null), finished = false;\n for (var p = 0; p < pathInfo.end; p++) {\n if (finished) return;\n target = pathInfo.path[p];\n for (var i = 0; i < tt.downSelectors.length; i++) {\n if (tt.downSelectors[i] == null || matchesSelector(target, tt.downSelectors[i], obj)) {\n tt.down = true;\n setTimeout(clearSingle, clickThreshold);\n setTimeout(clearDouble, dblClickThreshold);\n finished = true;\n break; // we only need one match on mousedown\n }\n }\n }\n },\n up = function (e) {\n if (tt.down) {\n var target = _t(e), currentTarget, pathInfo;\n tt.taps++;\n var tc = _touchCount(e);\n for (var eventId in _tapProfiles) {\n if (_tapProfiles.hasOwnProperty(eventId)) {\n var p = _tapProfiles[eventId];\n if (p.touches === tc && (p.taps === 1 || p.taps === tt.taps)) {\n for (var i = 0; i < tt[eventId].length; i++) {\n pathInfo = _pi(e, target, obj, tt[eventId][i][1] != null);\n for (var pLoop = 0; pLoop < pathInfo.end; pLoop++) {\n currentTarget = pathInfo.path[pLoop];\n // this is a single event registration handler.\n if (tt[eventId][i][1] == null || matchesSelector(currentTarget, tt[eventId][i][1], obj)) {\n tt[eventId][i][0].apply(currentTarget, [ e ]);\n break;\n }\n }\n }\n }\n }\n }\n }\n },\n clearSingle = function () {\n tt.down = false;\n },\n clearDouble = function () {\n tt.taps = 0;\n };\n\n DefaultHandler(obj, \"mousedown\", down);\n DefaultHandler(obj, \"mouseup\", up);\n }\n // add this child selector (it can be null, that's fine).\n obj.__taTapHandler.downSelectors.push(children);\n\n obj.__taTapHandler[evt].push([fn, children]);\n // the unstore function removes this function from the object's listener list for this type.\n fn.__taUnstore = function () {\n _d(obj.__taTapHandler[evt], fn);\n };\n }\n };\n },\n meeHelper = function (type, evt, obj, target) {\n for (var i in obj.__tamee[type]) {\n if (obj.__tamee[type].hasOwnProperty(i)) {\n obj.__tamee[type][i].apply(target, [ evt ]);\n }\n }\n },\n MouseEnterExitHandler = function () {\n var activeElements = [];\n return function (obj, evt, fn, children) {\n if (!obj.__tamee) {\n // __tamee holds a flag saying whether the mouse is currently \"in\" the element, and a list of\n // both mouseenter and mouseexit functions.\n obj.__tamee = { over: false, mouseenter: [], mouseexit: [] };\n // register over and out functions\n var over = function (e) {\n var t = _t(e);\n if ((children == null && (t == obj && !obj.__tamee.over)) || (matchesSelector(t, children, obj) && (t.__tamee == null || !t.__tamee.over))) {\n meeHelper(\"mouseenter\", e, obj, t);\n t.__tamee = t.__tamee || {};\n t.__tamee.over = true;\n activeElements.push(t);\n }\n },\n out = function (e) {\n var t = _t(e);\n // is the current target one of the activeElements? and is the\n // related target NOT a descendant of it?\n for (var i = 0; i < activeElements.length; i++) {\n if (t == activeElements[i] && !matchesSelector((e.relatedTarget || e.toElement), \"*\", t)) {\n t.__tamee.over = false;\n activeElements.splice(i, 1);\n meeHelper(\"mouseexit\", e, obj, t);\n }\n }\n };\n\n _bind(obj, \"mouseover\", _curryChildFilter(children, obj, over, \"mouseover\"), over);\n _bind(obj, \"mouseout\", _curryChildFilter(children, obj, out, \"mouseout\"), out);\n }\n\n fn.__taUnstore = function () {\n delete obj.__tamee[evt][fn.__tauid];\n };\n\n _store(obj, evt, fn);\n obj.__tamee[evt][fn.__tauid] = fn;\n };\n },\n isTouchDevice = \"ontouchstart\" in document.documentElement,\n isMouseDevice = \"onmousedown\" in document.documentElement,\n touchMap = { \"mousedown\": \"touchstart\", \"mouseup\": \"touchend\", \"mousemove\": \"touchmove\" },\n touchstart = \"touchstart\", touchend = \"touchend\", touchmove = \"touchmove\",\n iev = (function () {\n var rv = -1;\n if (navigator.appName == 'Microsoft Internet Explorer') {\n var ua = navigator.userAgent,\n re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n return rv;\n })(),\n isIELT9 = iev > -1 && iev < 9,\n _genLoc = function (e, prefix) {\n if (e == null) return [ 0, 0 ];\n var ts = _touches(e), t = _getTouch(ts, 0);\n return [t[prefix + \"X\"], t[prefix + \"Y\"]];\n },\n _pageLocation = function (e) {\n if (e == null) return [ 0, 0 ];\n if (isIELT9) {\n return [ e.clientX + document.documentElement.scrollLeft, e.clientY + document.documentElement.scrollTop ];\n }\n else {\n return _genLoc(e, \"page\");\n }\n },\n _screenLocation = function (e) {\n return _genLoc(e, \"screen\");\n },\n _clientLocation = function (e) {\n return _genLoc(e, \"client\");\n },\n _getTouch = function (touches, idx) {\n return touches.item ? touches.item(idx) : touches[idx];\n },\n _touches = function (e) {\n return e.touches && e.touches.length > 0 ? e.touches :\n e.changedTouches && e.changedTouches.length > 0 ? e.changedTouches :\n e.targetTouches && e.targetTouches.length > 0 ? e.targetTouches :\n [ e ];\n },\n _touchCount = function (e) {\n return _touches(e).length;\n },\n //http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html\n _bind = function (obj, type, fn, originalFn) {\n _store(obj, type, fn);\n originalFn.__tauid = fn.__tauid;\n if (obj.addEventListener)\n obj.addEventListener(type, fn, false);\n else if (obj.attachEvent) {\n var key = type + fn.__tauid;\n obj[\"e\" + key] = fn;\n // TODO look at replacing with .call(..)\n obj[key] = function () {\n obj[\"e\" + key] && obj[\"e\" + key](window.event);\n };\n obj.attachEvent(\"on\" + type, obj[key]);\n }\n },\n _unbind = function (obj, type, fn) {\n if (fn == null) return;\n _each(obj, function () {\n var _el = _gel(this);\n _unstore(_el, type, fn);\n // it has been bound if there is a tauid. otherwise it was not bound and we can ignore it.\n if (fn.__tauid != null) {\n if (_el.removeEventListener) {\n _el.removeEventListener(type, fn, false);\n if (isTouchDevice && touchMap[type]) _el.removeEventListener(touchMap[type], fn, false);\n }\n else if (this.detachEvent) {\n var key = type + fn.__tauid;\n _el[key] && _el.detachEvent(\"on\" + type, _el[key]);\n _el[key] = null;\n _el[\"e\" + key] = null;\n }\n }\n\n // if a touch event was also registered, deregister now.\n if (fn.__taTouchProxy) {\n _unbind(obj, fn.__taTouchProxy[1], fn.__taTouchProxy[0]);\n }\n });\n },\n _each = function (obj, fn) {\n if (obj == null) return;\n // if a list (or list-like), use it. if a string, get a list\n // by running the string through querySelectorAll. else, assume\n // it's an Element.\n // obj.top is \"unknown\" in IE8.\n obj = (typeof Window !== \"undefined\" && (typeof obj.top !== \"unknown\" && obj == obj.top)) ? [ obj ] :\n (typeof obj !== \"string\") && (obj.tagName == null && obj.length != null) ? obj :\n typeof obj === \"string\" ? document.querySelectorAll(obj)\n : [ obj ];\n\n for (var i = 0; i < obj.length; i++)\n fn.apply(obj[i]);\n },\n _uuid = function () {\n return ('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n }));\n };\n\n /**\n * Mottle offers support for abstracting out the differences\n * between touch and mouse devices, plus \"smart click\" functionality\n * (don't fire click if the mouse has moved between mousedown and mouseup),\n * and synthesized click/tap events.\n * @class Mottle\n * @constructor\n * @param {Object} params Constructor params\n * @param {Number} [params.clickThreshold=250] Threshold, in milliseconds beyond which a touchstart followed by a touchend is not considered to be a click.\n * @param {Number} [params.dblClickThreshold=450] Threshold, in milliseconds beyond which two successive tap events are not considered to be a click.\n * @param {Boolean} [params.smartClicks=false] If true, won't fire click events if the mouse has moved between mousedown and mouseup. Note that this functionality\n * requires that Mottle consume the mousedown event, and so may not be viable in all use cases.\n */\n root.Mottle = function (params) {\n params = params || {};\n var clickThreshold = params.clickThreshold || 250,\n dblClickThreshold = params.dblClickThreshold || 450,\n mouseEnterExitHandler = new MouseEnterExitHandler(),\n tapHandler = new TapHandler(clickThreshold, dblClickThreshold),\n _smartClicks = params.smartClicks,\n _doBind = function (obj, evt, fn, children) {\n if (fn == null) return;\n _each(obj, function () {\n var _el = _gel(this);\n if (_smartClicks && evt === \"click\")\n SmartClickHandler(_el, evt, fn, children);\n else if (evt === \"tap\" || evt === \"dbltap\" || evt === \"contextmenu\") {\n tapHandler(_el, evt, fn, children);\n }\n else if (evt === \"mouseenter\" || evt == \"mouseexit\")\n mouseEnterExitHandler(_el, evt, fn, children);\n else\n DefaultHandler(_el, evt, fn, children);\n });\n };\n\n /**\n * Removes an element from the DOM, and deregisters all event handlers for it. You should use this\n * to ensure you don't leak memory.\n * @method remove\n * @param {String|Element} el Element, or id of the element, to remove.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.remove = function (el) {\n _each(el, function () {\n var _el = _gel(this);\n if (_el.__ta) {\n for (var evt in _el.__ta) {\n if (_el.__ta.hasOwnProperty(evt)) {\n for (var h in _el.__ta[evt]) {\n if (_el.__ta[evt].hasOwnProperty(h))\n _unbind(_el, evt, _el.__ta[evt][h]);\n }\n }\n }\n }\n _el.parentNode && _el.parentNode.removeChild(_el);\n });\n return this;\n };\n\n /**\n * Register an event handler, optionally as a delegate for some set of descendant elements. Note\n * that this method takes either 3 or 4 arguments - if you supply 3 arguments it is assumed you have\n * omitted the `children` parameter, and that the event handler should be bound directly to the given element.\n * @method on\n * @param {Element[]|Element|String} el Either an Element, or a CSS spec for a list of elements, or an array of Elements.\n * @param {String} [children] Comma-delimited list of selectors identifying allowed children.\n * @param {String} event Event ID.\n * @param {Function} fn Event handler function.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.on = function (el, event, children, fn) {\n var _el = arguments[0],\n _c = arguments.length == 4 ? arguments[2] : null,\n _e = arguments[1],\n _f = arguments[arguments.length - 1];\n\n _doBind(_el, _e, _f, _c);\n return this;\n };\n\n /**\n * Cancel delegate event handling for the given function. Note that unlike with 'on' you do not supply\n * a list of child selectors here: it removes event delegation from all of the child selectors for which the\n * given function was registered (if any).\n * @method off\n * @param {Element[]|Element|String} el Element - or ID of element - from which to remove event listener.\n * @param {String} event Event ID.\n * @param {Function} fn Event handler function.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.off = function (el, event, fn) {\n _unbind(el, event, fn);\n return this;\n };\n\n /**\n * Triggers some event for a given element.\n * @method trigger\n * @param {Element} el Element for which to trigger the event.\n * @param {String} event Event ID.\n * @param {Event} originalEvent The original event. Should be optional of course, but currently is not, due\n * to the jsPlumb use case that caused this method to be added.\n * @param {Object} [payload] Optional object to set as `payload` on the generated event; useful for message passing.\n * @return {Mottle} The current Mottle instance; you can chain this method.\n */\n this.trigger = function (el, event, originalEvent, payload) {\n // MouseEvent undefined in old IE; that's how we know it's a mouse event. A fine Microsoft paradox.\n var originalIsMouse = isMouseDevice && (typeof MouseEvent === \"undefined\" || originalEvent == null || originalEvent.constructor === MouseEvent);\n\n var eventToBind = (isTouchDevice && !isMouseDevice && touchMap[event]) ? touchMap[event] : event,\n bindingAMouseEvent = !(isTouchDevice && !isMouseDevice && touchMap[event]);\n\n var pl = _pageLocation(originalEvent), sl = _screenLocation(originalEvent), cl = _clientLocation(originalEvent);\n _each(el, function () {\n var _el = _gel(this), evt;\n originalEvent = originalEvent || {\n screenX: sl[0],\n screenY: sl[1],\n clientX: cl[0],\n clientY: cl[1]\n };\n\n var _decorate = function (_evt) {\n if (payload) _evt.payload = payload;\n };\n\n var eventGenerators = {\n \"TouchEvent\": function (evt) {\n\n var touchList = _touchAndList(window, _el, 0, pl[0], pl[1], sl[0], sl[1], cl[0], cl[1]),\n init = evt.initTouchEvent || evt.initEvent;\n\n init(eventToBind, true, true, window, null, sl[0], sl[1],\n cl[0], cl[1], false, false, false, false,\n touchList, touchList, touchList, 1, 0);\n },\n \"MouseEvents\": function (evt) {\n evt.initMouseEvent(eventToBind, true, true, window, 0,\n sl[0], sl[1],\n cl[0], cl[1],\n false, false, false, false, 1, _el);\n }\n };\n\n if (document.createEvent) {\n\n var ite = !bindingAMouseEvent && !originalIsMouse && (isTouchDevice && touchMap[event]),\n evtName = ite ? \"TouchEvent\" : \"MouseEvents\";\n\n evt = document.createEvent(evtName);\n eventGenerators[evtName](evt);\n _decorate(evt);\n _el.dispatchEvent(evt);\n }\n else if (document.createEventObject) {\n evt = document.createEventObject();\n evt.eventType = evt.eventName = eventToBind;\n evt.screenX = sl[0];\n evt.screenY = sl[1];\n evt.clientX = cl[0];\n evt.clientY = cl[1];\n _decorate(evt);\n _el.fireEvent('on' + eventToBind, evt);\n }\n });\n return this;\n }\n };\n\n /**\n * Static method to assist in 'consuming' an element: uses `stopPropagation` where available, or sets\n * `e.returnValue=false` where it is not.\n * @method Mottle.consume\n * @param {Event} e Event to consume\n * @param {Boolean} [doNotPreventDefault=false] If true, does not call `preventDefault()` on the event.\n */\n root.Mottle.consume = function (e, doNotPreventDefault) {\n if (e.stopPropagation)\n e.stopPropagation();\n else\n e.returnValue = false;\n\n if (!doNotPreventDefault && e.preventDefault)\n e.preventDefault();\n };\n\n /**\n * Gets the page location corresponding to the given event. For touch events this means get the page location of the first touch.\n * @method Mottle.pageLocation\n * @param {Event} e Event to get page location for.\n * @return {Number[]} [left, top] for the given event.\n */\n root.Mottle.pageLocation = _pageLocation;\n\n /**\n * Forces touch events to be turned \"on\". Useful for testing: even if you don't have a touch device, you can still\n * trigger a touch event when this is switched on and it will be captured and acted on.\n * @method setForceTouchEvents\n * @param {Boolean} value If true, force touch events to be on.\n */\n root.Mottle.setForceTouchEvents = function (value) {\n isTouchDevice = value;\n };\n\n /**\n * Forces mouse events to be turned \"on\". Useful for testing: even if you don't have a mouse, you can still\n * trigger a mouse event when this is switched on and it will be captured and acted on.\n * @method setForceMouseEvents\n * @param {Boolean} value If true, force mouse events to be on.\n */\n root.Mottle.setForceMouseEvents = function (value) {\n isMouseDevice = value;\n };\n\n root.Mottle.version = \"0.8.0\";\n\n if (typeof exports !== \"undefined\") {\n exports.Mottle = root.Mottle;\n }\n\n}).call(typeof window === \"undefined\" ? this : window);\n\n/**\n drag/drop functionality for use with jsPlumb but with\n no knowledge of jsPlumb. supports multiple scopes (separated by whitespace), dragging\n multiple elements, constrain to parent, drop filters, drag start filters, custom\n css classes.\n\n a lot of the functionality of this script is expected to be plugged in:\n\n addClass\n removeClass\n\n addEvent\n removeEvent\n\n getPosition\n setPosition\n getSize\n\n indexOf\n intersects\n\n the name came from here:\n\n http://mrsharpoblunto.github.io/foswig.js/\n\n copyright 2016 jsPlumb\n */\n\n;(function() {\n\n \"use strict\";\n var root = this;\n\n var _suggest = function(list, item, head) {\n if (list.indexOf(item) === -1) {\n head ? list.unshift(item) : list.push(item);\n return true;\n }\n return false;\n };\n\n var _vanquish = function(list, item) {\n var idx = list.indexOf(item);\n if (idx !== -1) list.splice(idx, 1);\n };\n\n var _difference = function(l1, l2) {\n var d = [];\n for (var i = 0; i < l1.length; i++) {\n if (l2.indexOf(l1[i]) === -1)\n d.push(l1[i]);\n }\n return d;\n };\n\n var _isString = function(f) {\n return f == null ? false : (typeof f === \"string\" || f.constructor === String);\n };\n\n var getOffsetRect = function (elem) {\n // (1)\n var box = elem.getBoundingClientRect(),\n body = document.body,\n docElem = document.documentElement,\n // (2)\n scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop,\n scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft,\n // (3)\n clientTop = docElem.clientTop || body.clientTop || 0,\n clientLeft = docElem.clientLeft || body.clientLeft || 0,\n // (4)\n top = box.top + scrollTop - clientTop,\n left = box.left + scrollLeft - clientLeft;\n\n return { top: Math.round(top), left: Math.round(left) };\n };\n\n var matchesSelector = function(el, selector, ctx) {\n ctx = ctx || el.parentNode;\n var possibles = ctx.querySelectorAll(selector);\n for (var i = 0; i < possibles.length; i++) {\n if (possibles[i] === el)\n return true;\n }\n return false;\n };\n\n var findDelegateElement = function(parentElement, childElement, selector) {\n if (matchesSelector(childElement, selector, parentElement)) {\n return childElement;\n } else {\n var currentParent = childElement.parentNode;\n while (currentParent != null && currentParent !== parentElement) {\n if (matchesSelector(currentParent, selector, parentElement)) {\n return currentParent;\n } else {\n currentParent = currentParent.parentNode;\n }\n }\n }\n };\n\n var iev = (function() {\n var rv = -1;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n var ua = navigator.userAgent,\n re = new RegExp(\"MSIE ([0-9]{1,}[\\.0-9]{0,})\");\n if (re.exec(ua) != null)\n rv = parseFloat(RegExp.$1);\n }\n return rv;\n })(),\n DEFAULT_GRID_X = 10,\n DEFAULT_GRID_Y = 10,\n isIELT9 = iev > -1 && iev < 9,\n isIE9 = iev === 9,\n _pl = function(e) {\n if (isIELT9) {\n return [ e.clientX + document.documentElement.scrollLeft, e.clientY + document.documentElement.scrollTop ];\n }\n else {\n var ts = _touches(e), t = _getTouch(ts, 0);\n // for IE9 pageX might be null if the event was synthesized. We try for pageX/pageY first,\n // falling back to clientX/clientY if necessary. In every other browser we want to use pageX/pageY.\n return isIE9 ? [t.pageX || t.clientX, t.pageY || t.clientY] : [t.pageX, t.pageY];\n }\n },\n _getTouch = function(touches, idx) { return touches.item ? touches.item(idx) : touches[idx]; },\n _touches = function(e) {\n return e.touches && e.touches.length > 0 ? e.touches :\n e.changedTouches && e.changedTouches.length > 0 ? e.changedTouches :\n e.targetTouches && e.targetTouches.length > 0 ? e.targetTouches :\n [ e ];\n },\n _classes = {\n draggable:\"katavorio-draggable\", // draggable elements\n droppable:\"katavorio-droppable\", // droppable elements\n drag : \"katavorio-drag\", // elements currently being dragged\n selected:\"katavorio-drag-selected\", // elements in current drag selection\n active : \"katavorio-drag-active\", // droppables that are targets of a currently dragged element\n hover : \"katavorio-drag-hover\", // droppables over which a matching drag element is hovering\n noSelect : \"katavorio-drag-no-select\", // added to the body to provide a hook to suppress text selection\n ghostProxy:\"katavorio-ghost-proxy\", // added to a ghost proxy element in use when a drag has exited the bounds of its parent.\n clonedDrag:\"katavorio-clone-drag\" // added to a node that is a clone of an element created at the start of a drag\n },\n _defaultScope = \"katavorio-drag-scope\",\n _events = [ \"stop\", \"start\", \"drag\", \"drop\", \"over\", \"out\", \"beforeStart\" ],\n _devNull = function() {},\n _true = function() { return true; },\n _foreach = function(l, fn, from) {\n for (var i = 0; i < l.length; i++) {\n if (l[i] != from)\n fn(l[i]);\n }\n },\n _setDroppablesActive = function(dd, val, andHover, drag) {\n _foreach(dd, function(e) {\n e.setActive(val);\n if (val) e.updatePosition();\n if (andHover) e.setHover(drag, val);\n });\n },\n _each = function(obj, fn) {\n if (obj == null) return;\n obj = !_isString(obj) && (obj.tagName == null && obj.length != null) ? obj : [ obj ];\n for (var i = 0; i < obj.length; i++)\n fn.apply(obj[i], [ obj[i] ]);\n },\n _consume = function(e) {\n if (e.stopPropagation) {\n e.stopPropagation();\n e.preventDefault();\n }\n else {\n e.returnValue = false;\n }\n },\n _defaultInputFilterSelector = \"input,textarea,select,button,option\",\n //\n // filters out events on all input elements, like textarea, checkbox, input, select.\n _inputFilter = function(e, el, _katavorio) {\n var t = e.srcElement || e.target;\n return !matchesSelector(t, _katavorio.getInputFilterSelector(), el);\n };\n\n var Super = function(el, params, css, scope) {\n this.params = params || {};\n this.el = el;\n this.params.addClass(this.el, this._class);\n this.uuid = _uuid();\n var enabled = true;\n this.setEnabled = function(e) { enabled = e; };\n this.isEnabled = function() { return enabled; };\n this.toggleEnabled = function() { enabled = !enabled; };\n this.setScope = function(scopes) {\n this.scopes = scopes ? scopes.split(/\\s+/) : [ scope ];\n };\n this.addScope = function(scopes) {\n var m = {};\n _each(this.scopes, function(s) { m[s] = true;});\n _each(scopes ? scopes.split(/\\s+/) : [], function(s) { m[s] = true;});\n this.scopes = [];\n for (var i in m) this.scopes.push(i);\n };\n this.removeScope = function(scopes) {\n var m = {};\n _each(this.scopes, function(s) { m[s] = true;});\n _each(scopes ? scopes.split(/\\s+/) : [], function(s) { delete m[s];});\n this.scopes = [];\n for (var i in m) this.scopes.push(i);\n };\n this.toggleScope = function(scopes) {\n var m = {};\n _each(this.scopes, function(s) { m[s] = true;});\n _each(scopes ? scopes.split(/\\s+/) : [], function(s) {\n if (m[s]) delete m[s];\n else m[s] = true;\n });\n this.scopes = [];\n for (var i in m) this.scopes.push(i);\n };\n this.setScope(params.scope);\n this.k = params.katavorio;\n return params.katavorio;\n };\n\n var TRUE = function() { return true; };\n var FALSE = function() { return false; };\n\n var Drag = function(el, params, css, scope) {\n this._class = css.draggable;\n var k = Super.apply(this, arguments);\n this.rightButtonCanDrag = this.params.rightButtonCanDrag;\n var downAt = [0,0], posAtDown = null, pagePosAtDown = null, pageDelta = [0,0], moving = false, initialScroll = [0,0],\n consumeStartEvent = this.params.consumeStartEvent !== false,\n dragEl = this.el,\n clone = this.params.clone,\n scroll = this.params.scroll,\n _multipleDrop = params.multipleDrop !== false,\n isConstrained = false,\n useGhostProxy = params.ghostProxy === true ? TRUE : params.ghostProxy && typeof params.ghostProxy === \"function\" ? params.ghostProxy : FALSE,\n ghostProxy = function(el) { return el.cloneNode(true); },\n selector = params.selector,\n elementToDrag = null;\n\n var snapThreshold = params.snapThreshold,\n _snap = function(pos, gridX, gridY, thresholdX, thresholdY) {\n var _dx = Math.floor(pos[0] / gridX),\n _dxl = gridX * _dx,\n _dxt = _dxl + gridX,\n _x = Math.abs(pos[0] - _dxl) <= thresholdX ? _dxl : Math.abs(_dxt - pos[0]) <= thresholdX ? _dxt : pos[0];\n\n var _dy = Math.floor(pos[1] / gridY),\n _dyl = gridY * _dy,\n _dyt = _dyl + gridY,\n _y = Math.abs(pos[1] - _dyl) <= thresholdY ? _dyl : Math.abs(_dyt - pos[1]) <= thresholdY ? _dyt : pos[1];\n\n return [ _x, _y];\n };\n\n this.posses = [];\n this.posseRoles = {};\n\n this.toGrid = function(pos) {\n if (this.params.grid == null) {\n return pos;\n }\n else {\n var tx = this.params.grid ? this.params.grid[0] / 2 : snapThreshold ? snapThreshold : DEFAULT_GRID_X / 2,\n ty = this.params.grid ? this.params.grid[1] / 2 : snapThreshold ? snapThreshold : DEFAULT_GRID_Y / 2;\n\n return _snap(pos, this.params.grid[0], this.params.grid[1], tx, ty);\n }\n };\n\n this.snap = function(x, y) {\n if (dragEl == null) return;\n x = x || (this.params.grid ? this.params.grid[0] : DEFAULT_GRID_X);\n y = y || (this.params.grid ? this.params.grid[1] : DEFAULT_GRID_Y);\n var p = this.params.getPosition(dragEl),\n tx = this.params.grid ? this.params.grid[0] / 2 : snapThreshold,\n ty = this.params.grid ? this.params.grid[1] / 2 : snapThreshold;\n\n this.params.setPosition(dragEl, _snap(p, x, y, tx, ty));\n };\n\n this.setUseGhostProxy = function(val) {\n useGhostProxy = val ? TRUE : FALSE;\n };\n\n var constrain;\n var negativeFilter = function(pos) {\n return (params.allowNegative === false) ? [ Math.max (0, pos[0]), Math.max(0, pos[1]) ] : pos;\n };\n\n var _setConstrain = function(value) {\n constrain = typeof value === \"function\" ? value : value ? function(pos, dragEl, _constrainRect, _size) {\n return negativeFilter([\n Math.max(0, Math.min(_constrainRect.w - _size[0], pos[0])),\n Math.max(0, Math.min(_constrainRect.h - _size[1], pos[1]))\n ]);\n }.bind(this) : function(pos) { return negativeFilter(pos); };\n }.bind(this);\n\n _setConstrain(typeof this.params.constrain === \"function\" ? this.params.constrain : (this.params.constrain || this.params.containment));\n\n\n /**\n * Sets whether or not the Drag is constrained. A value of 'true' means constrain to parent bounds; a function\n * will be executed and returns true if the position is allowed.\n * @param value\n */\n this.setConstrain = function(value) {\n _setConstrain(value);\n };\n\n var revertFunction;\n /**\n * Sets a function to call on drag stop, which, if it returns true, indicates that the given element should\n * revert to its position before the previous drag.\n * @param fn\n */\n this.setRevert = function(fn) {\n revertFunction = fn;\n };\n\n var _assignId = function(obj) {\n if (typeof obj === \"function\") {\n obj._katavorioId = _uuid();\n return obj._katavorioId;\n } else {\n return obj;\n }\n },\n // a map of { spec -> [ fn, exclusion ] } entries.\n _filters = {},\n _testFilter = function(e) {\n for (var key in _filters) {\n var f = _filters[key];\n var rv = f[0](e);\n if (f[1]) rv = !rv;\n if (!rv) return false;\n }\n return true;\n },\n _setFilter = this.setFilter = function(f, _exclude) {\n if (f) {\n var key = _assignId(f);\n _filters[key] = [\n function(e) {\n var t = e.srcElement || e.target, m;\n if (_isString(f)) {\n m = matchesSelector(t, f, el);\n }\n else if (typeof f === \"function\") {\n m = f(e, el);\n }\n return m;\n },\n _exclude !== false\n ];\n\n }\n },\n _addFilter = this.addFilter = _setFilter,\n _removeFilter = this.removeFilter = function(f) {\n var key = typeof f === \"function\" ? f._katavorioId : f;\n delete _filters[key];\n };\n\n this.clearAllFilters = function() {\n _filters = {};\n };\n\n this.canDrag = this.params.canDrag || _true;\n\n var constrainRect,\n matchingDroppables = [],\n intersectingDroppables = [];\n\n this.downListener = function(e) {\n var isNotRightClick = this.rightButtonCanDrag || (e.which !== 3 && e.button !== 2);\n if (isNotRightClick && this.isEnabled() && this.canDrag()) {\n\n var _f = _testFilter(e) && _inputFilter(e, this.el, this.k);\n if (_f) {\n\n if (selector) {\n elementToDrag = findDelegateElement(this.el, e.target || e.srcElement, selector);\n if(elementToDrag == null) {\n return;\n }\n }\n else {\n elementToDrag = this.el;\n }\n\n if (clone) {\n dragEl = elementToDrag.cloneNode(true);\n this.params.addClass(dragEl, _classes.clonedDrag);\n\n dragEl.setAttribute(\"id\", null);\n dragEl.style.position = \"absolute\";\n\n if (this.params.parent != null) {\n var p = this.params.getPosition(this.el);\n dragEl.style.left = p[0] + \"px\";\n dragEl.style.top = p[1] + \"px\";\n this.params.parent.appendChild(dragEl);\n } else {\n // the clone node is added to the body; getOffsetRect gives us a value\n // relative to the body.\n var b = getOffsetRect(elementToDrag);\n dragEl.style.left = b.left + \"px\";\n dragEl.style.top = b.top + \"px\";\n\n document.body.appendChild(dragEl);\n }\n\n } else {\n dragEl = elementToDrag;\n }\n\n consumeStartEvent && _consume(e);\n downAt = _pl(e);\n if (dragEl && dragEl.parentNode)\n {\n initialScroll = [dragEl.parentNode.scrollLeft, dragEl.parentNode.scrollTop];\n }\n //\n this.params.bind(document, \"mousemove\", this.moveListener);\n this.params.bind(document, \"mouseup\", this.upListener);\n k.markSelection(this);\n k.markPosses(this);\n this.params.addClass(document.body, css.noSelect);\n _dispatch(\"beforeStart\", {el:this.el, pos:posAtDown, e:e, drag:this});\n }\n else if (this.params.consumeFilteredEvents) {\n _consume(e);\n }\n }\n }.bind(this);\n\n this.moveListener = function(e) {\n if (downAt) {\n if (!moving) {\n var _continue = _dispatch(\"start\", {el:this.el, pos:posAtDown, e:e, drag:this});\n if (_continue !== false) {\n if (!downAt) {\n return;\n }\n this.mark(true);\n moving = true;\n } else {\n this.abort();\n }\n }\n\n // it is possible that the start event caused the drag to be aborted. So we check\n // again that we are currently dragging.\n if (downAt) {\n intersectingDroppables.length = 0;\n var pos = _pl(e), dx = pos[0] - downAt[0], dy = pos[1] - downAt[1],\n z = this.params.ignoreZoom ? 1 : k.getZoom();\n if (dragEl && dragEl.parentNode)\n {\n dx += dragEl.parentNode.scrollLeft - initialScroll[0];\n dy += dragEl.parentNode.scrollTop - initialScroll[1];\n }\n dx /= z;\n dy /= z;\n this.moveBy(dx, dy, e);\n k.updateSelection(dx, dy, this);\n k.updatePosses(dx, dy, this);\n }\n }\n }.bind(this);\n\n this.upListener = function(e) {\n if (downAt) {\n downAt = null;\n this.params.unbind(document, \"mousemove\", this.moveListener);\n this.params.unbind(document, \"mouseup\", this.upListener);\n this.params.removeClass(document.body, css.noSelect);\n this.unmark(e);\n k.unmarkSelection(this, e);\n k.unmarkPosses(this, e);\n this.stop(e);\n\n //k.notifySelectionDragStop(this, e); removed in 1.1.0 under the \"leave it for one release in case it breaks\" rule.\n // it isnt necessary to fire this as the normal stop event now includes a `selection` member that has every dragged element.\n // firing this event causes consumers who use the `selection` array to process a lot more drag stop events than is necessary\n\n k.notifyPosseDragStop(this, e);\n moving = false;\n if (clone) {\n dragEl && dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n dragEl = null;\n }\n\n intersectingDroppables.length = 0;\n\n if (revertFunction && revertFunction(this.el, this.params.getPosition(this.el)) === true) {\n this.params.setPosition(this.el, posAtDown);\n _dispatch(\"revert\", this.el);\n }\n }\n }.bind(this);\n\n this.getFilters = function() { return _filters; };\n\n this.abort = function() {\n if (downAt != null) {\n this.upListener();\n }\n };\n\n /**\n * Returns the element that was last dragged. This may be some original element from the DOM, or if `clone` is\n * set, then its actually a copy of some original DOM element. In some client calls to this method, it is the\n * actual element that was dragged that is desired. In others, it is the original DOM element that the user\n * wishes to get - in which case, pass true for `retrieveOriginalElement`.\n *\n * @returns {*}\n */\n this.getDragElement = function(retrieveOriginalElement) {\n return retrieveOriginalElement ? elementToDrag || this.el : dragEl || this.el;\n };\n\n var listeners = {\"start\":[], \"drag\":[], \"stop\":[], \"over\":[], \"out\":[], \"beforeStart\":[], \"revert\":[] };\n if (params.events.start) listeners.start.push(params.events.start);\n if (params.events.beforeStart) listeners.beforeStart.push(params.events.beforeStart);\n if (params.events.stop) listeners.stop.push(params.events.stop);\n if (params.events.drag) listeners.drag.push(params.events.drag);\n if (params.events.revert) listeners.revert.push(params.events.revert);\n\n this.on = function(evt, fn) {\n if (listeners[evt]) listeners[evt].push(fn);\n };\n\n this.off = function(evt, fn) {\n if (listeners[evt]) {\n var l = [];\n for (var i = 0; i < listeners[evt].length; i++) {\n if (listeners[evt][i] !== fn) l.push(listeners[evt][i]);\n }\n listeners[evt] = l;\n }\n };\n\n var _dispatch = function(evt, value) {\n var result = null;\n if (listeners[evt]) {\n for (var i = 0; i < listeners[evt].length; i++) {\n try {\n var v = listeners[evt][i](value);\n if (v != null) {\n result = v;\n }\n }\n catch (e) { }\n }\n }\n return result;\n };\n\n this.notifyStart = function(e) {\n _dispatch(\"start\", {el:this.el, pos:this.params.getPosition(dragEl), e:e, drag:this});\n };\n\n this.stop = function(e, force) {\n if (force || moving) {\n var positions = [],\n sel = k.getSelection(),\n dPos = this.params.getPosition(dragEl);\n\n if (sel.length > 1) {\n for (var i = 0; i < sel.length; i++) {\n var p = this.params.getPosition(sel[i].el);\n positions.push([ sel[i].el, { left: p[0], top: p[1] }, sel[i] ]);\n }\n }\n else {\n positions.push([ dragEl, {left:dPos[0], top:dPos[1]}, this ]);\n }\n\n _dispatch(\"stop\", {\n el: dragEl,\n pos: ghostProxyOffsets || dPos,\n finalPos:dPos,\n e: e,\n drag: this,\n selection:positions\n });\n }\n };\n\n this.mark = function(andNotify) {\n posAtDown = this.params.getPosition(dragEl);\n pagePosAtDown = this.params.getPosition(dragEl, true);\n pageDelta = [pagePosAtDown[0] - posAtDown[0], pagePosAtDown[1] - posAtDown[1]];\n this.size = this.params.getSize(dragEl);\n matchingDroppables = k.getMatchingDroppables(this);\n _setDroppablesActive(matchingDroppables, true, false, this);\n this.params.addClass(dragEl, this.params.dragClass || css.drag);\n\n var cs;\n if (this.params.getConstrainingRectangle) {\n cs = this.params.getConstrainingRectangle(dragEl)\n } else {\n cs = this.params.getSize(dragEl.parentNode);\n }\n constrainRect = {w: cs[0], h: cs[1]};\n\n if (andNotify) {\n k.notifySelectionDragStart(this);\n }\n };\n var ghostProxyOffsets;\n this.unmark = function(e, doNotCheckDroppables) {\n _setDroppablesActive(matchingDroppables, false, true, this);\n\n if (isConstrained && useGhostProxy(elementToDrag)) {\n ghostProxyOffsets = [dragEl.offsetLeft, dragEl.offsetTop];\n elementToDrag.parentNode.removeChild(dragEl);\n dragEl = elementToDrag;\n }\n else {\n ghostProxyOffsets = null;\n }\n\n this.params.removeClass(dragEl, this.params.dragClass || css.drag);\n matchingDroppables.length = 0;\n isConstrained = false;\n if (!doNotCheckDroppables) {\n if (intersectingDroppables.length > 0 && ghostProxyOffsets) {\n params.setPosition(elementToDrag, ghostProxyOffsets);\n }\n intersectingDroppables.sort(_rankSort);\n for (var i = 0; i < intersectingDroppables.length; i++) {\n var retVal = intersectingDroppables[i].drop(this, e);\n if (retVal === true) break;\n }\n }\n };\n this.moveBy = function(dx, dy, e) {\n intersectingDroppables.length = 0;\n var desiredLoc = this.toGrid([posAtDown[0] + dx, posAtDown[1] + dy]),\n cPos = constrain(desiredLoc, dragEl, constrainRect, this.size);\n\n if (useGhostProxy(this.el)) {\n if (desiredLoc[0] !== cPos[0] || desiredLoc[1] !== cPos[1]) {\n if (!isConstrained) {\n var gp = ghostProxy(elementToDrag);\n params.addClass(gp, _classes.ghostProxy);\n elementToDrag.parentNode.appendChild(gp);\n dragEl = gp;\n isConstrained = true;\n }\n cPos = desiredLoc;\n }\n else {\n if (isConstrained) {\n elementToDrag.parentNode.removeChild(dragEl);\n dragEl = elementToDrag;\n isConstrained = false;\n }\n }\n }\n\n var rect = { x:cPos[0], y:cPos[1], w:this.size[0], h:this.size[1]},\n pageRect = { x:rect.x + pageDelta[0], y:rect.y + pageDelta[1], w:rect.w, h:rect.h},\n focusDropElement = null;\n\n this.params.setPosition(dragEl, cPos);\n for (var i = 0; i < matchingDroppables.length; i++) {\n var r2 = { x:matchingDroppables[i].pagePosition[0], y:matchingDroppables[i].pagePosition[1], w:matchingDroppables[i].size[0], h:matchingDroppables[i].size[1]};\n if (this.params.intersects(pageRect, r2) && (_multipleDrop || focusDropElement == null || focusDropElement === matchingDroppables[i].el) && matchingDroppables[i].canDrop(this)) {\n if (!focusDropElement) focusDropElement = matchingDroppables[i].el;\n intersectingDroppables.push(matchingDroppables[i]);\n matchingDroppables[i].setHover(this, true, e);\n }\n else if (matchingDroppables[i].isHover()) {\n matchingDroppables[i].setHover(this, false, e);\n }\n }\n\n _dispatch(\"drag\", {el:this.el, pos:cPos, e:e, drag:this});\n\n /* test to see if the parent needs to be scrolled (future)\n if (scroll) {\n var pnsl = dragEl.parentNode.scrollLeft, pnst = dragEl.parentNode.scrollTop;\n console.log(\"scroll!\", pnsl, pnst);\n }*/\n };\n this.destroy = function() {\n this.params.unbind(this.el, \"mousedown\", this.downListener);\n this.params.unbind(document, \"mousemove\", this.moveListener);\n this.params.unbind(document, \"mouseup\", this.upListener);\n this.downListener = null;\n this.upListener = null;\n this.moveListener = null;\n };\n\n // init:register mousedown, and perhaps set a filter\n this.params.bind(this.el, \"mousedown\", this.downListener);\n\n // if handle provded, use that. otherwise, try to set a filter.\n // note that a `handle` selector always results in filterExclude being set to false, ie.\n // the selector defines the handle element(s).\n if (this.params.handle)\n _setFilter(this.params.handle, false);\n else\n _setFilter(this.params.filter, this.params.filterExclude);\n };\n\n var Drop = function(el, params, css, scope) {\n this._class = css.droppable;\n this.params = params || {};\n this.rank = params.rank || 0;\n this._activeClass = this.params.activeClass || css.active;\n this._hoverClass = this.params.hoverClass || css.hover;\n Super.apply(this, arguments);\n var hover = false;\n this.allowLoopback = this.params.allowLoopback !== false;\n\n this.setActive = function(val) {\n this.params[val ? \"addClass\" : \"removeClass\"](this.el, this._activeClass);\n };\n\n this.updatePosition = function() {\n this.position = this.params.getPosition(this.el);\n this.pagePosition = this.params.getPosition(this.el, true);\n this.size = this.params.getSize(this.el);\n };\n\n this.canDrop = this.params.canDrop || function(drag) {\n return true;\n };\n\n this.isHover = function() { return hover; };\n\n this.setHover = function(drag, val, e) {\n // if turning off hover but this was not the drag that caused the hover, ignore.\n if (val || this.el._katavorioDragHover == null || this.el._katavorioDragHover === drag.el._katavorio) {\n this.params[val ? \"addClass\" : \"removeClass\"](this.el, this._hoverClass);\n this.el._katavorioDragHover = val ? drag.el._katavorio : null;\n if (hover !== val) {\n this.params.events[val ? \"over\" : \"out\"]({el: this.el, e: e, drag: drag, drop: this});\n }\n hover = val;\n }\n };\n\n /**\n * A drop event. `drag` is the corresponding Drag object, which may be a Drag for some specific element, or it\n * may be a Drag on some element acting as a delegate for elements contained within it.\n * @param drag\n * @param event\n * @returns {*}\n */\n this.drop = function(drag, event) {\n return this.params.events[\"drop\"]({ drag:drag, e:event, drop:this });\n };\n\n this.destroy = function() {\n this._class = null;\n this._activeClass = null;\n this._hoverClass = null;\n hover = null;\n };\n };\n\n var _uuid = function() {\n return ('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random()*16|0, v = c === 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n }));\n };\n\n var _rankSort = function(a,b) {\n return a.rank < b.rank ? 1 : a.rank > b.rank ? -1 : 0;\n };\n\n var _gel = function(el) {\n if (el == null) return null;\n el = (typeof el === \"string\" || el.constructor === String) ? document.getElementById(el) : el;\n if (el == null) return null;\n el._katavorio = el._katavorio || _uuid();\n return el;\n };\n\n root.Katavorio = function(katavorioParams) {\n\n var _selection = [],\n _selectionMap = {};\n\n this._dragsByScope = {};\n this._dropsByScope = {};\n var _zoom = 1,\n _reg = function(obj, map) {\n _each(obj, function(_obj) {\n for(var i = 0; i < _obj.scopes.length; i++) {\n map[_obj.scopes[i]] = map[_obj.scopes[i]] || [];\n map[_obj.scopes[i]].push(_obj);\n }\n });\n },\n _unreg = function(obj, map) {\n var c = 0;\n _each(obj, function(_obj) {\n for(var i = 0; i < _obj.scopes.length; i++) {\n if (map[_obj.scopes[i]]) {\n var idx = katavorioParams.indexOf(map[_obj.scopes[i]], _obj);\n if (idx !== -1) {\n map[_obj.scopes[i]].splice(idx, 1);\n c++;\n }\n }\n }\n });\n\n return c > 0 ;\n },\n _getMatchingDroppables = this.getMatchingDroppables = function(drag) {\n var dd = [], _m = {};\n for (var i = 0; i < drag.scopes.length; i++) {\n var _dd = this._dropsByScope[drag.scopes[i]];\n if (_dd) {\n for (var j = 0; j < _dd.length; j++) {\n if (_dd[j].canDrop(drag) && !_m[_dd[j].uuid] && (_dd[j].allowLoopback || _dd[j].el !== drag.el)) {\n _m[_dd[j].uuid] = true;\n dd.push(_dd[j]);\n }\n }\n }\n }\n dd.sort(_rankSort);\n return dd;\n },\n _prepareParams = function(p) {\n p = p || {};\n var _p = {\n events:{}\n }, i;\n for (i in katavorioParams) _p[i] = katavorioParams[i];\n for (i in p) _p[i] = p[i];\n // events\n\n for (i = 0; i < _events.length; i++) {\n _p.events[_events[i]] = p[_events[i]] || _devNull;\n }\n _p.katavorio = this;\n return _p;\n }.bind(this),\n _mistletoe = function(existingDrag, params) {\n for (var i = 0; i < _events.length; i++) {\n if (params[_events[i]]) {\n existingDrag.on(_events[i], params[_events[i]]);\n }\n }\n }.bind(this),\n _css = {},\n overrideCss = katavorioParams.css || {},\n _scope = katavorioParams.scope || _defaultScope;\n\n // prepare map of css classes based on defaults frst, then optional overrides\n for (var i in _classes) _css[i] = _classes[i];\n for (var i in overrideCss) _css[i] = overrideCss[i];\n\n var inputFilterSelector = katavorioParams.inputFilterSelector || _defaultInputFilterSelector;\n /**\n * Gets the selector identifying which input elements to filter from drag events.\n * @method getInputFilterSelector\n * @return {String} Current input filter selector.\n */\n this.getInputFilterSelector = function() { return inputFilterSelector; };\n\n /**\n * Sets the selector identifying which input elements to filter from drag events.\n * @method setInputFilterSelector\n * @param {String} selector Input filter selector to set.\n * @return {Katavorio} Current instance; method may be chained.\n */\n this.setInputFilterSelector = function(selector) {\n inputFilterSelector = selector;\n return this;\n };\n\n /**\n * Either makes the given element draggable, or identifies it as an element inside which some identified list\n * of elements may be draggable.\n * @param el\n * @param params\n * @returns {Array}\n */\n this.draggable = function(el, params) {\n var o = [];\n _each(el, function (_el) {\n _el = _gel(_el);\n if (_el != null) {\n if (_el._katavorioDrag == null) {\n var p = _prepareParams(params);\n _el._katavorioDrag = new Drag(_el, p, _css, _scope);\n _reg(_el._katavorioDrag, this._dragsByScope);\n o.push(_el._katavorioDrag);\n katavorioParams.addClass(_el, _css.draggable);\n }\n else {\n _mistletoe(_el._katavorioDrag, params);\n }\n }\n }.bind(this));\n return o;\n };\n\n this.droppable = function(el, params) {\n var o = [];\n _each(el, function(_el) {\n _el = _gel(_el);\n if (_el != null) {\n var drop = new Drop(_el, _prepareParams(params), _css, _scope);\n _el._katavorioDrop = _el._katavorioDrop || [];\n _el._katavorioDrop.push(drop);\n _reg(drop, this._dropsByScope);\n o.push(drop);\n katavorioParams.addClass(_el, _css.droppable);\n }\n }.bind(this));\n return o;\n };\n\n /**\n * @name Katavorio#select\n * @function\n * @desc Adds an element to the current selection (for multiple node drag)\n * @param {Element|String} DOM element - or id of the element - to add.\n */\n this.select = function(el) {\n _each(el, function() {\n var _el = _gel(this);\n if (_el && _el._katavorioDrag) {\n if (!_selectionMap[_el._katavorio]) {\n _selection.push(_el._katavorioDrag);\n _selectionMap[_el._katavorio] = [ _el, _selection.length - 1 ];\n katavorioParams.addClass(_el, _css.selected);\n }\n }\n });\n return this;\n };\n\n /**\n * @name Katavorio#deselect\n * @function\n * @desc Removes an element from the current selection (for multiple node drag)\n * @param {Element|String} DOM element - or id of the element - to remove.\n */\n this.deselect = function(el) {\n _each(el, function() {\n var _el = _gel(this);\n if (_el && _el._katavorio) {\n var e = _selectionMap[_el._katavorio];\n if (e) {\n var _s = [];\n for (var i = 0; i < _selection.length; i++)\n if (_selection[i].el !== _el) _s.push(_selection[i]);\n _selection = _s;\n delete _selectionMap[_el._katavorio];\n katavorioParams.removeClass(_el, _css.selected);\n }\n }\n });\n return this;\n };\n\n this.deselectAll = function() {\n for (var i in _selectionMap) {\n var d = _selectionMap[i];\n katavorioParams.removeClass(d[0], _css.selected);\n }\n\n _selection.length = 0;\n _selectionMap = {};\n };\n\n this.markSelection = function(drag) {\n _foreach(_selection, function(e) { e.mark(); }, drag);\n };\n\n this.markPosses = function(drag) {\n if (drag.posses) {\n _each(drag.posses, function(p) {\n if (drag.posseRoles[p] && _posses[p]) {\n _foreach(_posses[p].members, function (d) {\n d.mark();\n }, drag);\n }\n })\n }\n };\n\n this.unmarkSelection = function(drag, event) {\n _foreach(_selection, function(e) { e.unmark(event); }, drag);\n };\n\n this.unmarkPosses = function(drag, event) {\n if (drag.posses) {\n _each(drag.posses, function(p) {\n if (drag.posseRoles[p] && _posses[p]) {\n _foreach(_posses[p].members, function (d) {\n d.unmark(event, true);\n }, drag);\n }\n });\n }\n };\n\n this.getSelection = function() { return _selection.slice(0); };\n\n this.updateSelection = function(dx, dy, drag) {\n _foreach(_selection, function(e) { e.moveBy(dx, dy); }, drag);\n };\n\n var _posseAction = function(fn, drag) {\n if (drag.posses) {\n _each(drag.posses, function(p) {\n if (drag.posseRoles[p] && _posses[p]) {\n _foreach(_posses[p].members, function (e) {\n fn(e);\n }, drag);\n }\n });\n }\n };\n\n this.updatePosses = function(dx, dy, drag) {\n _posseAction(function(e) { e.moveBy(dx, dy); }, drag);\n };\n\n this.notifyPosseDragStop = function(drag, evt) {\n _posseAction(function(e) { e.stop(evt, true); }, drag);\n };\n\n this.notifySelectionDragStop = function(drag, evt) {\n _foreach(_selection, function(e) { e.stop(evt, true); }, drag);\n };\n\n this.notifySelectionDragStart = function(drag, evt) {\n _foreach(_selection, function(e) { e.notifyStart(evt);}, drag);\n };\n\n this.setZoom = function(z) { _zoom = z; };\n this.getZoom = function() { return _zoom; };\n\n // does the work of changing scopes\n var _scopeManip = function(kObj, scopes, map, fn) {\n _each(kObj, function(_kObj) {\n _unreg(_kObj, map); // deregister existing scopes\n _kObj[fn](scopes); // set scopes\n _reg(_kObj, map); // register new ones\n });\n };\n\n _each([ \"set\", \"add\", \"remove\", \"toggle\"], function(v) {\n this[v + \"Scope\"] = function(el, scopes) {\n _scopeManip(el._katavorioDrag, scopes, this._dragsByScope, v + \"Scope\");\n _scopeManip(el._katavorioDrop, scopes, this._dropsByScope, v + \"Scope\");\n }.bind(this);\n this[v + \"DragScope\"] = function(el, scopes) {\n _scopeManip(el.constructor === Drag ? el : el._katavorioDrag, scopes, this._dragsByScope, v + \"Scope\");\n }.bind(this);\n this[v + \"DropScope\"] = function(el, scopes) {\n _scopeManip(el.constructor === Drop ? el : el._katavorioDrop, scopes, this._dropsByScope, v + \"Scope\");\n }.bind(this);\n }.bind(this));\n\n this.snapToGrid = function(x, y) {\n for (var s in this._dragsByScope) {\n _foreach(this._dragsByScope[s], function(d) { d.snap(x, y); });\n }\n };\n\n this.getDragsForScope = function(s) { return this._dragsByScope[s]; };\n this.getDropsForScope = function(s) { return this._dropsByScope[s]; };\n\n var _destroy = function(el, type, map) {\n el = _gel(el);\n if (el[type]) {\n\n // remove from selection, if present.\n var selIdx = _selection.indexOf(el[type]);\n if (selIdx >= 0) {\n _selection.splice(selIdx, 1);\n }\n\n if (_unreg(el[type], map)) {\n _each(el[type], function(kObj) { kObj.destroy() });\n }\n\n delete el[type];\n }\n };\n\n var _removeListener = function(el, type, evt, fn) {\n el = _gel(el);\n if (el[type]) {\n el[type].off(evt, fn);\n }\n };\n\n this.elementRemoved = function(el) {\n this.destroyDraggable(el);\n this.destroyDroppable(el);\n };\n\n /**\n * Either completely remove drag functionality from the given element, or remove a specific event handler. If you\n * call this method with a single argument - the element - all drag functionality is removed from it. Otherwise, if\n * you provide an event name and listener function, this function is de-registered (if found).\n * @param el Element to update\n * @param {string} [evt] Optional event name to unsubscribe\n * @param {Function} [fn] Optional function to unsubscribe\n */\n this.destroyDraggable = function(el, evt, fn) {\n if (arguments.length === 1) {\n _destroy(el, \"_katavorioDrag\", this._dragsByScope);\n } else {\n _removeListener(el, \"_katavorioDrag\", evt, fn);\n }\n };\n\n /**\n * Either completely remove drop functionality from the given element, or remove a specific event handler. If you\n * call this method with a single argument - the element - all drop functionality is removed from it. Otherwise, if\n * you provide an event name and listener function, this function is de-registered (if found).\n * @param el Element to update\n * @param {string} [evt] Optional event name to unsubscribe\n * @param {Function} [fn] Optional function to unsubscribe\n */\n this.destroyDroppable = function(el, evt, fn) {\n if (arguments.length === 1) {\n _destroy(el, \"_katavorioDrop\", this._dropsByScope);\n } else {\n _removeListener(el, \"_katavorioDrop\", evt, fn);\n }\n };\n\n this.reset = function() {\n this._dragsByScope = {};\n this._dropsByScope = {};\n _selection = [];\n _selectionMap = {};\n _posses = {};\n };\n\n // ----- groups\n var _posses = {};\n\n var _processOneSpec = function(el, _spec, dontAddExisting) {\n var posseId = _isString(_spec) ? _spec : _spec.id;\n var active = _isString(_spec) ? true : _spec.active !== false;\n var posse = _posses[posseId] || (function() {\n var g = {name:posseId, members:[]};\n _posses[posseId] = g;\n return g;\n })();\n _each(el, function(_el) {\n if (_el._katavorioDrag) {\n\n if (dontAddExisting && _el._katavorioDrag.posseRoles[posse.name] != null) return;\n\n _suggest(posse.members, _el._katavorioDrag);\n _suggest(_el._katavorioDrag.posses, posse.name);\n _el._katavorioDrag.posseRoles[posse.name] = active;\n }\n });\n return posse;\n };\n\n /**\n * Add the given element to the posse with the given id, creating the group if it at first does not exist.\n * @method addToPosse\n * @param {Element} el Element to add.\n * @param {String...|Object...} spec Variable args parameters. Each argument can be a either a String, indicating\n * the ID of a Posse to which the element should be added as an active participant, or an Object containing\n * `{ id:\"posseId\", active:false/true}`. In the latter case, if `active` is not provided it is assumed to be\n * true.\n * @returns {Posse|Posse[]} The Posse(s) to which the element(s) was/were added.\n */\n this.addToPosse = function(el, spec) {\n\n var posses = [];\n\n for (var i = 1; i < arguments.length; i++) {\n posses.push(_processOneSpec(el, arguments[i]));\n }\n\n return posses.length === 1 ? posses[0] : posses;\n };\n\n /**\n * Sets the posse(s) for the element with the given id, creating those that do not yet exist, and removing from\n * the element any current Posses that are not specified by this method call. This method will not change the\n * active/passive state if it is given a posse in which the element is already a member.\n * @method setPosse\n * @param {Element} el Element to set posse(s) on.\n * @param {String...|Object...} spec Variable args parameters. Each argument can be a either a String, indicating\n * the ID of a Posse to which the element should be added as an active participant, or an Object containing\n * `{ id:\"posseId\", active:false/true}`. In the latter case, if `active` is not provided it is assumed to be\n * true.\n * @returns {Posse|Posse[]} The Posse(s) to which the element(s) now belongs.\n */\n this.setPosse = function(el, spec) {\n\n var posses = [];\n\n for (var i = 1; i < arguments.length; i++) {\n posses.push(_processOneSpec(el, arguments[i], true).name);\n }\n\n _each(el, function(_el) {\n if (_el._katavorioDrag) {\n var diff = _difference(_el._katavorioDrag.posses, posses);\n var p = [];\n Array.prototype.push.apply(p, _el._katavorioDrag.posses);\n for (var i = 0; i < diff.length; i++) {\n this.removeFromPosse(_el, diff[i]);\n }\n }\n }.bind(this));\n\n return posses.length === 1 ? posses[0] : posses;\n };\n\n /**\n * Remove the given element from the given posse(s).\n * @method removeFromPosse\n * @param {Element} el Element to remove.\n * @param {String...} posseId Varargs parameter: one value for each posse to remove the element from.\n */\n this.removeFromPosse = function(el, posseId) {\n if (arguments.length < 2) throw new TypeError(\"No posse id provided for remove operation\");\n for(var i = 1; i < arguments.length; i++) {\n posseId = arguments[i];\n _each(el, function (_el) {\n if (_el._katavorioDrag && _el._katavorioDrag.posses) {\n var d = _el._katavorioDrag;\n _each(posseId, function (p) {\n _vanquish(_posses[p].members, d);\n _vanquish(d.posses, p);\n delete d.posseRoles[p];\n });\n }\n });\n }\n };\n\n /**\n * Remove the given element from all Posses to which it belongs.\n * @method removeFromAllPosses\n * @param {Element|Element[]} el Element to remove from Posses.\n */\n this.removeFromAllPosses = function(el) {\n _each(el, function(_el) {\n if (_el._katavorioDrag && _el._katavorioDrag.posses) {\n var d = _el._katavorioDrag;\n _each(d.posses, function(p) {\n _vanquish(_posses[p].members, d);\n });\n d.posses.length = 0;\n d.posseRoles = {};\n }\n });\n };\n\n /**\n * Changes the participation state for the element in the Posse with the given ID.\n * @param {Element|Element[]} el Element(s) to change state for.\n * @param {String} posseId ID of the Posse to change element state for.\n * @param {Boolean} state True to make active, false to make passive.\n */\n this.setPosseState = function(el, posseId, state) {\n var posse = _posses[posseId];\n if (posse) {\n _each(el, function(_el) {\n if (_el._katavorioDrag && _el._katavorioDrag.posses) {\n _el._katavorioDrag.posseRoles[posse.name] = state;\n }\n });\n }\n };\n\n };\n\n root.Katavorio.version = \"1.0.0\";\n\n if (typeof exports !== \"undefined\") {\n exports.Katavorio = root.Katavorio;\n }\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n\n(function() {\n\n var root = this;\n root.jsPlumbUtil = root.jsPlumbUtil || {};\n var jsPlumbUtil = root.jsPlumbUtil;\n\n if (typeof exports !=='undefined') { exports.jsPlumbUtil = jsPlumbUtil;}\n\n\n function isArray(a) {\n return Object.prototype.toString.call(a) === \"[object Array]\";\n }\n jsPlumbUtil.isArray = isArray;\n function isNumber(n) {\n return Object.prototype.toString.call(n) === \"[object Number]\";\n }\n jsPlumbUtil.isNumber = isNumber;\n function isString(s) {\n return typeof s === \"string\";\n }\n jsPlumbUtil.isString = isString;\n function isBoolean(s) {\n return typeof s === \"boolean\";\n }\n jsPlumbUtil.isBoolean = isBoolean;\n function isNull(s) {\n return s == null;\n }\n jsPlumbUtil.isNull = isNull;\n function isObject(o) {\n return o == null ? false : Object.prototype.toString.call(o) === \"[object Object]\";\n }\n jsPlumbUtil.isObject = isObject;\n function isDate(o) {\n return Object.prototype.toString.call(o) === \"[object Date]\";\n }\n jsPlumbUtil.isDate = isDate;\n function isFunction(o) {\n return Object.prototype.toString.call(o) === \"[object Function]\";\n }\n jsPlumbUtil.isFunction = isFunction;\n function isNamedFunction(o) {\n return isFunction(o) && o.name != null && o.name.length > 0;\n }\n jsPlumbUtil.isNamedFunction = isNamedFunction;\n function isEmpty(o) {\n for (var i in o) {\n if (o.hasOwnProperty(i)) {\n return false;\n }\n }\n return true;\n }\n jsPlumbUtil.isEmpty = isEmpty;\n function clone(a) {\n if (isString(a)) {\n return \"\" + a;\n }\n else if (isBoolean(a)) {\n return !!a;\n }\n else if (isDate(a)) {\n return new Date(a.getTime());\n }\n else if (isFunction(a)) {\n return a;\n }\n else if (isArray(a)) {\n var b = [];\n for (var i = 0; i < a.length; i++) {\n b.push(clone(a[i]));\n }\n return b;\n }\n else if (isObject(a)) {\n var c = {};\n for (var j in a) {\n c[j] = clone(a[j]);\n }\n return c;\n }\n else {\n return a;\n }\n }\n jsPlumbUtil.clone = clone;\n function merge(a, b, collations, overwrites) {\n // first change the collations array - if present - into a lookup table, because its faster.\n var cMap = {}, ar, i, oMap = {};\n collations = collations || [];\n overwrites = overwrites || [];\n for (i = 0; i < collations.length; i++) {\n cMap[collations[i]] = true;\n }\n for (i = 0; i < overwrites.length; i++) {\n oMap[overwrites[i]] = true;\n }\n var c = clone(a);\n for (i in b) {\n if (c[i] == null || oMap[i]) {\n c[i] = b[i];\n }\n else if (isString(b[i]) || isBoolean(b[i])) {\n if (!cMap[i]) {\n c[i] = b[i]; // if we dont want to collate, just copy it in.\n }\n else {\n ar = [];\n // if c's object is also an array we can keep its values.\n ar.push.apply(ar, isArray(c[i]) ? c[i] : [c[i]]);\n ar.push.apply(ar, isBoolean(b[i]) ? b[i] : [b[i]]);\n c[i] = ar;\n }\n }\n else {\n if (isArray(b[i])) {\n ar = [];\n // if c's object is also an array we can keep its values.\n if (isArray(c[i])) {\n ar.push.apply(ar, c[i]);\n }\n ar.push.apply(ar, b[i]);\n c[i] = ar;\n }\n else if (isObject(b[i])) {\n // overwrite c's value with an object if it is not already one.\n if (!isObject(c[i])) {\n c[i] = {};\n }\n for (var j in b[i]) {\n c[i][j] = b[i][j];\n }\n }\n }\n }\n return c;\n }\n jsPlumbUtil.merge = merge;\n function replace(inObj, path, value) {\n if (inObj == null) {\n return;\n }\n var q = inObj, t = q;\n path.replace(/([^\\.])+/g, function (term, lc, pos, str) {\n var array = term.match(/([^\\[0-9]+){1}(\\[)([0-9+])/), last = pos + term.length >= str.length, _getArray = function () {\n return t[array[1]] || (function () {\n t[array[1]] = [];\n return t[array[1]];\n })();\n };\n if (last) {\n // set term = value on current t, creating term as array if necessary.\n if (array) {\n _getArray()[array[3]] = value;\n }\n else {\n t[term] = value;\n }\n }\n else {\n // set to current t[term], creating t[term] if necessary.\n if (array) {\n var a_1 = _getArray();\n t = a_1[array[3]] || (function () {\n a_1[array[3]] = {};\n return a_1[array[3]];\n })();\n }\n else {\n t = t[term] || (function () {\n t[term] = {};\n return t[term];\n })();\n }\n }\n return \"\";\n });\n return inObj;\n }\n jsPlumbUtil.replace = replace;\n //\n // chain a list of functions, supplied by [ object, method name, args ], and return on the first\n // one that returns the failValue. if none return the failValue, return the successValue.\n //\n function functionChain(successValue, failValue, fns) {\n for (var i = 0; i < fns.length; i++) {\n var o = fns[i][0][fns[i][1]].apply(fns[i][0], fns[i][2]);\n if (o === failValue) {\n return o;\n }\n }\n return successValue;\n }\n jsPlumbUtil.functionChain = functionChain;\n /**\n *\n * Take the given model and expand out any parameters. 'functionPrefix' is optional, and if present, helps jsplumb figure out what to do if a value is a Function.\n * if you do not provide it (and doNotExpandFunctions is null, or false), jsplumb will run the given values through any functions it finds, and use the function's\n * output as the value in the result. if you do provide the prefix, only functions that are named and have this prefix\n * will be executed; other functions will be passed as values to the output.\n *\n * @param model\n * @param values\n * @param functionPrefix\n * @param doNotExpandFunctions\n * @returns {any}\n */\n function populate(model, values, functionPrefix, doNotExpandFunctions) {\n // for a string, see if it has parameter matches, and if so, try to make the substitutions.\n var getValue = function (fromString) {\n var matches = fromString.match(/(\\${.*?})/g);\n if (matches != null) {\n for (var i = 0; i < matches.length; i++) {\n var val = values[matches[i].substring(2, matches[i].length - 1)] || \"\";\n if (val != null) {\n fromString = fromString.replace(matches[i], val);\n }\n }\n }\n return fromString;\n };\n // process one entry.\n var _one = function (d) {\n if (d != null) {\n if (isString(d)) {\n return getValue(d);\n }\n else if (isFunction(d) && !doNotExpandFunctions && (functionPrefix == null || (d.name || \"\").indexOf(functionPrefix) === 0)) {\n return d(values);\n }\n else if (isArray(d)) {\n var r = [];\n for (var i = 0; i < d.length; i++) {\n r.push(_one(d[i]));\n }\n return r;\n }\n else if (isObject(d)) {\n var s = {};\n for (var j in d) {\n s[j] = _one(d[j]);\n }\n return s;\n }\n else {\n return d;\n }\n }\n };\n return _one(model);\n }\n jsPlumbUtil.populate = populate;\n function findWithFunction(a, f) {\n if (a) {\n for (var i = 0; i < a.length; i++) {\n if (f(a[i])) {\n return i;\n }\n }\n }\n return -1;\n }\n jsPlumbUtil.findWithFunction = findWithFunction;\n function removeWithFunction(a, f) {\n var idx = findWithFunction(a, f);\n if (idx > -1) {\n a.splice(idx, 1);\n }\n return idx !== -1;\n }\n jsPlumbUtil.removeWithFunction = removeWithFunction;\n function remove(l, v) {\n var idx = l.indexOf(v);\n if (idx > -1) {\n l.splice(idx, 1);\n }\n return idx !== -1;\n }\n jsPlumbUtil.remove = remove;\n function addWithFunction(list, item, hashFunction) {\n if (findWithFunction(list, hashFunction) === -1) {\n list.push(item);\n }\n }\n jsPlumbUtil.addWithFunction = addWithFunction;\n function addToList(map, key, value, insertAtStart) {\n var l = map[key];\n if (l == null) {\n l = [];\n map[key] = l;\n }\n l[insertAtStart ? \"unshift\" : \"push\"](value);\n return l;\n }\n jsPlumbUtil.addToList = addToList;\n function suggest(list, item, insertAtHead) {\n if (list.indexOf(item) === -1) {\n if (insertAtHead) {\n list.unshift(item);\n }\n else {\n list.push(item);\n }\n return true;\n }\n return false;\n }\n jsPlumbUtil.suggest = suggest;\n //\n // extends the given obj (which can be an array) with the given constructor function, prototype functions, and\n // class members, any of which may be null.\n //\n function extend(child, parent, _protoFn) {\n var i;\n parent = isArray(parent) ? parent : [parent];\n var _copyProtoChain = function (focus) {\n var proto = focus.__proto__;\n while (proto != null) {\n if (proto.prototype != null) {\n for (var j in proto.prototype) {\n if (proto.prototype.hasOwnProperty(j) && !child.prototype.hasOwnProperty(j)) {\n child.prototype[j] = proto.prototype[j];\n }\n }\n proto = proto.prototype.__proto__;\n }\n else {\n proto = null;\n }\n }\n };\n for (i = 0; i < parent.length; i++) {\n for (var j in parent[i].prototype) {\n if (parent[i].prototype.hasOwnProperty(j) && !child.prototype.hasOwnProperty(j)) {\n child.prototype[j] = parent[i].prototype[j];\n }\n }\n _copyProtoChain(parent[i]);\n }\n var _makeFn = function (name, protoFn) {\n return function () {\n for (i = 0; i < parent.length; i++) {\n if (parent[i].prototype[name]) {\n parent[i].prototype[name].apply(this, arguments);\n }\n }\n return protoFn.apply(this, arguments);\n };\n };\n var _oneSet = function (fns) {\n for (var k in fns) {\n child.prototype[k] = _makeFn(k, fns[k]);\n }\n };\n if (arguments.length > 2) {\n for (i = 2; i < arguments.length; i++) {\n _oneSet(arguments[i]);\n }\n }\n return child;\n }\n jsPlumbUtil.extend = extend;\n function uuid() {\n return ('xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n }));\n }\n jsPlumbUtil.uuid = uuid;\n function fastTrim(s) {\n if (s == null) {\n return null;\n }\n var str = s.replace(/^\\s\\s*/, ''), ws = /\\s/, i = str.length;\n while (ws.test(str.charAt(--i))) {\n }\n return str.slice(0, i + 1);\n }\n jsPlumbUtil.fastTrim = fastTrim;\n function each(obj, fn) {\n obj = obj.length == null || typeof obj === \"string\" ? [obj] : obj;\n for (var i = 0; i < obj.length; i++) {\n fn(obj[i]);\n }\n }\n jsPlumbUtil.each = each;\n function map(obj, fn) {\n var o = [];\n for (var i = 0; i < obj.length; i++) {\n o.push(fn(obj[i]));\n }\n return o;\n }\n jsPlumbUtil.map = map;\n function mergeWithParents(type, map, parentAttribute) {\n parentAttribute = parentAttribute || \"parent\";\n var _def = function (id) {\n return id ? map[id] : null;\n };\n var _parent = function (def) {\n return def ? _def(def[parentAttribute]) : null;\n };\n var _one = function (parent, def) {\n if (parent == null) {\n return def;\n }\n else {\n var d_1 = merge(parent, def);\n return _one(_parent(parent), d_1);\n }\n };\n var _getDef = function (t) {\n if (t == null) {\n return {};\n }\n if (typeof t === \"string\") {\n return _def(t);\n }\n else if (t.length) {\n var done = false, i = 0, _dd = void 0;\n while (!done && i < t.length) {\n _dd = _getDef(t[i]);\n if (_dd) {\n done = true;\n }\n else {\n i++;\n }\n }\n return _dd;\n }\n };\n var d = _getDef(type);\n if (d) {\n return _one(_parent(d), d);\n }\n else {\n return {};\n }\n }\n jsPlumbUtil.mergeWithParents = mergeWithParents;\n jsPlumbUtil.logEnabled = true;\n function log() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (jsPlumbUtil.logEnabled && typeof console !== \"undefined\") {\n try {\n var msg = arguments[arguments.length - 1];\n console.log(msg);\n }\n catch (e) {\n }\n }\n }\n jsPlumbUtil.log = log;\n /**\n * Wraps one function with another, creating a placeholder for the\n * wrapped function if it was null. this is used to wrap the various\n * drag/drop event functions - to allow jsPlumb to be notified of\n * important lifecycle events without imposing itself on the user's\n * drag/drop functionality.\n * @method jsPlumbUtil.wrap\n * @param {Function} wrappedFunction original function to wrap; may be null.\n * @param {Function} newFunction function to wrap the original with.\n * @param {Object} [returnOnThisValue] Optional. Indicates that the wrappedFunction should\n * not be executed if the newFunction returns a value matching 'returnOnThisValue'.\n * note that this is a simple comparison and only works for primitives right now.\n */\n function wrap(wrappedFunction, newFunction, returnOnThisValue) {\n return function () {\n var r = null;\n try {\n if (newFunction != null) {\n r = newFunction.apply(this, arguments);\n }\n }\n catch (e) {\n log(\"jsPlumb function failed : \" + e);\n }\n if ((wrappedFunction != null) && (returnOnThisValue == null || (r !== returnOnThisValue))) {\n try {\n r = wrappedFunction.apply(this, arguments);\n }\n catch (e) {\n log(\"wrapped function failed : \" + e);\n }\n }\n return r;\n };\n }\n jsPlumbUtil.wrap = wrap;\n var EventGenerator = /** @class */ (function () {\n function EventGenerator() {\n var _this = this;\n this._listeners = {};\n this.eventsSuspended = false;\n this.tick = false;\n // this is a list of events that should re-throw any errors that occur during their dispatch.\n this.eventsToDieOn = { \"ready\": true };\n this.queue = [];\n this.bind = function (event, listener, insertAtStart) {\n var _one = function (evt) {\n addToList(_this._listeners, evt, listener, insertAtStart);\n listener.__jsPlumb = listener.__jsPlumb || {};\n listener.__jsPlumb[uuid()] = evt;\n };\n if (typeof event === \"string\") {\n _one(event);\n }\n else if (event.length != null) {\n for (var i = 0; i < event.length; i++) {\n _one(event[i]);\n }\n }\n return _this;\n };\n this.fire = function (event, value, originalEvent) {\n if (!this.tick) {\n this.tick = true;\n if (!this.eventsSuspended && this._listeners[event]) {\n var l = this._listeners[event].length, i = 0, _gone = false, ret = null;\n if (!this.shouldFireEvent || this.shouldFireEvent(event, value, originalEvent)) {\n while (!_gone && i < l && ret !== false) {\n // doing it this way rather than catching and then possibly re-throwing means that an error propagated by this\n // method will have the whole call stack available in the debugger.\n if (this.eventsToDieOn[event]) {\n this._listeners[event][i].apply(this, [value, originalEvent]);\n }\n else {\n try {\n ret = this._listeners[event][i].apply(this, [value, originalEvent]);\n }\n catch (e) {\n log(\"jsPlumb: fire failed for event \" + event + \" : \" + e);\n }\n }\n i++;\n if (this._listeners == null || this._listeners[event] == null) {\n _gone = true;\n }\n }\n }\n }\n this.tick = false;\n this._drain();\n }\n else {\n this.queue.unshift(arguments);\n }\n return this;\n };\n this._drain = function () {\n var n = _this.queue.pop();\n if (n) {\n _this.fire.apply(_this, n);\n }\n };\n this.unbind = function (eventOrListener, listener) {\n if (arguments.length === 0) {\n this._listeners = {};\n }\n else if (arguments.length === 1) {\n if (typeof eventOrListener === \"string\") {\n delete this._listeners[eventOrListener];\n }\n else if (eventOrListener.__jsPlumb) {\n var evt = void 0;\n for (var i in eventOrListener.__jsPlumb) {\n evt = eventOrListener.__jsPlumb[i];\n remove(this._listeners[evt] || [], eventOrListener);\n }\n }\n }\n else if (arguments.length === 2) {\n remove(this._listeners[eventOrListener] || [], listener);\n }\n return this;\n };\n this.getListener = function (forEvent) {\n return _this._listeners[forEvent];\n };\n this.setSuspendEvents = function (val) {\n _this.eventsSuspended = val;\n };\n this.isSuspendEvents = function () {\n return _this.eventsSuspended;\n };\n this.silently = function (fn) {\n _this.setSuspendEvents(true);\n try {\n fn();\n }\n catch (e) {\n log(\"Cannot execute silent function \" + e);\n }\n _this.setSuspendEvents(false);\n };\n this.cleanupListeners = function () {\n for (var i in _this._listeners) {\n _this._listeners[i] = null;\n }\n };\n }\n return EventGenerator;\n }());\n jsPlumbUtil.EventGenerator = EventGenerator;\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains utility functions that run in browsers only.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n ;(function() {\n\n \"use strict\";\n\n var root = this;\n\n root.jsPlumbUtil.matchesSelector = function(el, selector, ctx) {\n ctx = ctx || el.parentNode;\n var possibles = ctx.querySelectorAll(selector);\n for (var i = 0; i < possibles.length; i++) {\n if (possibles[i] === el) {\n return true;\n }\n }\n return false;\n };\n\n root.jsPlumbUtil.consume = function(e, doNotPreventDefault) {\n if (e.stopPropagation) {\n e.stopPropagation();\n }\n else {\n e.returnValue = false;\n }\n\n if (!doNotPreventDefault && e.preventDefault){\n e.preventDefault();\n }\n };\n\n /*\n * Function: sizeElement\n * Helper to size and position an element. You would typically use\n * this when writing your own Connector or Endpoint implementation.\n *\n * Parameters:\n * x - [int] x position for the element origin\n * y - [int] y position for the element origin\n * w - [int] width of the element\n * h - [int] height of the element\n *\n */\n root.jsPlumbUtil.sizeElement = function(el, x, y, w, h) {\n if (el) {\n el.style.height = h + \"px\";\n el.height = h;\n el.style.width = w + \"px\";\n el.width = w;\n el.style.left = x + \"px\";\n el.style.top = y + \"px\";\n }\n };\n\n }).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the core code.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function () {\n\n \"use strict\";\n\n var root = this;\n\n var _ju = root.jsPlumbUtil,\n\n /**\n * creates a timestamp, using milliseconds since 1970, but as a string.\n */\n _timestamp = function () {\n return \"\" + (new Date()).getTime();\n },\n\n // helper method to update the hover style whenever it, or paintStyle, changes.\n // we use paintStyle as the foundation and merge hoverPaintStyle over the\n // top.\n _updateHoverStyle = function (component) {\n if (component._jsPlumb.paintStyle && component._jsPlumb.hoverPaintStyle) {\n var mergedHoverStyle = {};\n jsPlumb.extend(mergedHoverStyle, component._jsPlumb.paintStyle);\n jsPlumb.extend(mergedHoverStyle, component._jsPlumb.hoverPaintStyle);\n delete component._jsPlumb.hoverPaintStyle;\n // we want the fill of paintStyle to override a gradient, if possible.\n if (mergedHoverStyle.gradient && component._jsPlumb.paintStyle.fill) {\n delete mergedHoverStyle.gradient;\n }\n component._jsPlumb.hoverPaintStyle = mergedHoverStyle;\n }\n },\n events = [\"tap\", \"dbltap\", \"click\", \"dblclick\", \"mouseover\", \"mouseout\", \"mousemove\", \"mousedown\", \"mouseup\", \"contextmenu\" ],\n eventFilters = { \"mouseout\": \"mouseleave\", \"mouseexit\": \"mouseleave\" },\n _updateAttachedElements = function (component, state, timestamp, sourceElement) {\n var affectedElements = component.getAttachedElements();\n if (affectedElements) {\n for (var i = 0, j = affectedElements.length; i < j; i++) {\n if (!sourceElement || sourceElement !== affectedElements[i]) {\n affectedElements[i].setHover(state, true, timestamp);\t\t\t// tell the attached elements not to inform their own attached elements.\n }\n }\n }\n },\n _splitType = function (t) {\n return t == null ? null : t.split(\" \");\n },\n _mapType = function(map, obj, typeId) {\n for (var i in obj) {\n map[i] = typeId;\n }\n },\n _each = function(fn, obj) {\n obj = _ju.isArray(obj) || (obj.length != null && !_ju.isString(obj)) ? obj : [ obj ];\n for (var i = 0; i < obj.length; i++) {\n try {\n fn.apply(obj[i], [ obj[i] ]);\n }\n catch (e) {\n _ju.log(\".each iteration failed : \" + e);\n }\n }\n },\n _applyTypes = function (component, params, doNotRepaint) {\n if (component.getDefaultType) {\n var td = component.getTypeDescriptor(), map = {};\n var defType = component.getDefaultType();\n var o = _ju.merge({}, defType);\n _mapType(map, defType, \"__default\");\n for (var i = 0, j = component._jsPlumb.types.length; i < j; i++) {\n var tid = component._jsPlumb.types[i];\n if (tid !== \"__default\") {\n var _t = component._jsPlumb.instance.getType(tid, td);\n if (_t != null) {\n o = _ju.merge(o, _t, [ \"cssClass\" ], [ \"connector\" ]);\n _mapType(map, _t, tid);\n }\n }\n }\n\n if (params) {\n o = _ju.populate(o, params, \"_\");\n }\n\n component.applyType(o, doNotRepaint, map);\n if (!doNotRepaint) {\n component.repaint();\n }\n }\n },\n\n// ------------------------------ BEGIN jsPlumbUIComponent --------------------------------------------\n\n jsPlumbUIComponent = root.jsPlumbUIComponent = function (params) {\n\n _ju.EventGenerator.apply(this, arguments);\n\n var self = this,\n a = arguments,\n idPrefix = self.idPrefix,\n id = idPrefix + (new Date()).getTime();\n\n this._jsPlumb = {\n instance: params._jsPlumb,\n parameters: params.parameters || {},\n paintStyle: null,\n hoverPaintStyle: null,\n paintStyleInUse: null,\n hover: false,\n beforeDetach: params.beforeDetach,\n beforeDrop: params.beforeDrop,\n overlayPlacements: [],\n hoverClass: params.hoverClass || params._jsPlumb.Defaults.HoverClass,\n types: [],\n typeCache:{}\n };\n\n this.cacheTypeItem = function(key, item, typeId) {\n this._jsPlumb.typeCache[typeId] = this._jsPlumb.typeCache[typeId] || {};\n this._jsPlumb.typeCache[typeId][key] = item;\n };\n this.getCachedTypeItem = function(key, typeId) {\n return this._jsPlumb.typeCache[typeId] ? this._jsPlumb.typeCache[typeId][key] : null;\n };\n\n this.getId = function () {\n return id;\n };\n\n// ----------------------------- default type --------------------------------------------\n\n\n var o = params.overlays || [], oo = {};\n if (this.defaultOverlayKeys) {\n for (var i = 0; i < this.defaultOverlayKeys.length; i++) {\n Array.prototype.push.apply(o, this._jsPlumb.instance.Defaults[this.defaultOverlayKeys[i]] || []);\n }\n\n for (i = 0; i < o.length; i++) {\n // if a string, convert to object representation so that we can store the typeid on it.\n // also assign an id.\n var fo = jsPlumb.convertToFullOverlaySpec(o[i]);\n oo[fo[1].id] = fo;\n }\n }\n\n var _defaultType = {\n overlays:oo,\n parameters: params.parameters || {},\n scope: params.scope || this._jsPlumb.instance.getDefaultScope()\n };\n this.getDefaultType = function() {\n return _defaultType;\n };\n this.appendToDefaultType = function(obj) {\n for (var i in obj) {\n _defaultType[i] = obj[i];\n }\n };\n\n// ----------------------------- end default type --------------------------------------------\n\n // all components can generate events\n\n if (params.events) {\n for (var evtName in params.events) {\n self.bind(evtName, params.events[evtName]);\n }\n }\n\n // all components get this clone function.\n // TODO issue 116 showed a problem with this - it seems 'a' that is in\n // the clone function's scope is shared by all invocations of it, the classic\n // JS closure problem. for now, jsPlumb does a version of this inline where\n // it used to call clone. but it would be nice to find some time to look\n // further at this.\n this.clone = function () {\n var o = Object.create(this.constructor.prototype);\n this.constructor.apply(o, a);\n return o;\n }.bind(this);\n\n // user can supply a beforeDetach callback, which will be executed before a detach\n // is performed; returning false prevents the detach.\n this.isDetachAllowed = function (connection) {\n var r = true;\n if (this._jsPlumb.beforeDetach) {\n try {\n r = this._jsPlumb.beforeDetach(connection);\n }\n catch (e) {\n _ju.log(\"jsPlumb: beforeDetach callback failed\", e);\n }\n }\n return r;\n };\n\n // user can supply a beforeDrop callback, which will be executed before a dropped\n // connection is confirmed. user can return false to reject connection.\n this.isDropAllowed = function (sourceId, targetId, scope, connection, dropEndpoint, source, target) {\n var r = this._jsPlumb.instance.checkCondition(\"beforeDrop\", {\n sourceId: sourceId,\n targetId: targetId,\n scope: scope,\n connection: connection,\n dropEndpoint: dropEndpoint,\n source: source, target: target\n });\n if (this._jsPlumb.beforeDrop) {\n try {\n r = this._jsPlumb.beforeDrop({\n sourceId: sourceId,\n targetId: targetId,\n scope: scope,\n connection: connection,\n dropEndpoint: dropEndpoint,\n source: source, target: target\n });\n }\n catch (e) {\n _ju.log(\"jsPlumb: beforeDrop callback failed\", e);\n }\n }\n return r;\n };\n\n var domListeners = [];\n\n // sets the component associated with listener events. for instance, an overlay delegates\n // its events back to a connector. but if the connector is swapped on the underlying connection,\n // then this component must be changed. This is called by setConnector in the Connection class.\n this.setListenerComponent = function (c) {\n for (var i = 0; i < domListeners.length; i++) {\n domListeners[i][3] = c;\n }\n };\n\n\n };\n\n var _removeTypeCssHelper = function (component, typeIndex) {\n var typeId = component._jsPlumb.types[typeIndex],\n type = component._jsPlumb.instance.getType(typeId, component.getTypeDescriptor());\n\n if (type != null && type.cssClass && component.canvas) {\n component._jsPlumb.instance.removeClass(component.canvas, type.cssClass);\n }\n };\n\n _ju.extend(root.jsPlumbUIComponent, _ju.EventGenerator, {\n\n getParameter: function (name) {\n return this._jsPlumb.parameters[name];\n },\n\n setParameter: function (name, value) {\n this._jsPlumb.parameters[name] = value;\n },\n\n getParameters: function () {\n return this._jsPlumb.parameters;\n },\n\n setParameters: function (p) {\n this._jsPlumb.parameters = p;\n },\n\n getClass:function() {\n return jsPlumb.getClass(this.canvas);\n },\n\n hasClass:function(clazz) {\n return jsPlumb.hasClass(this.canvas, clazz);\n },\n\n addClass: function (clazz) {\n jsPlumb.addClass(this.canvas, clazz);\n },\n\n removeClass: function (clazz) {\n jsPlumb.removeClass(this.canvas, clazz);\n },\n\n updateClasses: function (classesToAdd, classesToRemove) {\n jsPlumb.updateClasses(this.canvas, classesToAdd, classesToRemove);\n },\n\n setType: function (typeId, params, doNotRepaint) {\n this.clearTypes();\n this._jsPlumb.types = _splitType(typeId) || [];\n _applyTypes(this, params, doNotRepaint);\n },\n\n getType: function () {\n return this._jsPlumb.types;\n },\n\n reapplyTypes: function (params, doNotRepaint) {\n _applyTypes(this, params, doNotRepaint);\n },\n\n hasType: function (typeId) {\n return this._jsPlumb.types.indexOf(typeId) !== -1;\n },\n\n addType: function (typeId, params, doNotRepaint) {\n var t = _splitType(typeId), _cont = false;\n if (t != null) {\n for (var i = 0, j = t.length; i < j; i++) {\n if (!this.hasType(t[i])) {\n this._jsPlumb.types.push(t[i]);\n _cont = true;\n }\n }\n if (_cont) {\n _applyTypes(this, params, doNotRepaint);\n }\n }\n },\n\n removeType: function (typeId, params, doNotRepaint) {\n var t = _splitType(typeId), _cont = false, _one = function (tt) {\n var idx = this._jsPlumb.types.indexOf(tt);\n if (idx !== -1) {\n // remove css class if necessary\n _removeTypeCssHelper(this, idx);\n this._jsPlumb.types.splice(idx, 1);\n return true;\n }\n return false;\n }.bind(this);\n\n if (t != null) {\n for (var i = 0, j = t.length; i < j; i++) {\n _cont = _one(t[i]) || _cont;\n }\n if (_cont) {\n _applyTypes(this, params, doNotRepaint);\n }\n }\n },\n clearTypes: function (params, doNotRepaint) {\n var i = this._jsPlumb.types.length;\n for (var j = 0; j < i; j++) {\n _removeTypeCssHelper(this, 0);\n this._jsPlumb.types.splice(0, 1);\n }\n _applyTypes(this, params, doNotRepaint);\n },\n\n toggleType: function (typeId, params, doNotRepaint) {\n var t = _splitType(typeId);\n if (t != null) {\n for (var i = 0, j = t.length; i < j; i++) {\n var idx = this._jsPlumb.types.indexOf(t[i]);\n if (idx !== -1) {\n _removeTypeCssHelper(this, idx);\n this._jsPlumb.types.splice(idx, 1);\n }\n else {\n this._jsPlumb.types.push(t[i]);\n }\n }\n\n _applyTypes(this, params, doNotRepaint);\n }\n },\n applyType: function (t, doNotRepaint) {\n this.setPaintStyle(t.paintStyle, doNotRepaint);\n this.setHoverPaintStyle(t.hoverPaintStyle, doNotRepaint);\n if (t.parameters) {\n for (var i in t.parameters) {\n this.setParameter(i, t.parameters[i]);\n }\n }\n this._jsPlumb.paintStyleInUse = this.getPaintStyle();\n },\n setPaintStyle: function (style, doNotRepaint) {\n // this._jsPlumb.paintStyle = jsPlumb.extend({}, style);\n // TODO figure out if we want components to clone paintStyle so as not to share it.\n this._jsPlumb.paintStyle = style;\n this._jsPlumb.paintStyleInUse = this._jsPlumb.paintStyle;\n _updateHoverStyle(this);\n if (!doNotRepaint) {\n this.repaint();\n }\n },\n getPaintStyle: function () {\n return this._jsPlumb.paintStyle;\n },\n setHoverPaintStyle: function (style, doNotRepaint) {\n //this._jsPlumb.hoverPaintStyle = jsPlumb.extend({}, style);\n // TODO figure out if we want components to clone paintStyle so as not to share it.\n this._jsPlumb.hoverPaintStyle = style;\n _updateHoverStyle(this);\n if (!doNotRepaint) {\n this.repaint();\n }\n },\n getHoverPaintStyle: function () {\n return this._jsPlumb.hoverPaintStyle;\n },\n destroy: function (force) {\n if (force || this.typeId == null) {\n this.cleanupListeners(); // this is on EventGenerator\n this.clone = null;\n this._jsPlumb = null;\n }\n },\n\n isHover: function () {\n return this._jsPlumb.hover;\n },\n\n setHover: function (hover, ignoreAttachedElements, timestamp) {\n // while dragging, we ignore these events. this keeps the UI from flashing and\n // swishing and whatevering.\n if (this._jsPlumb && !this._jsPlumb.instance.currentlyDragging && !this._jsPlumb.instance.isHoverSuspended()) {\n\n this._jsPlumb.hover = hover;\n var method = hover ? \"addClass\" : \"removeClass\";\n\n if (this.canvas != null) {\n if (this._jsPlumb.instance.hoverClass != null) {\n this._jsPlumb.instance[method](this.canvas, this._jsPlumb.instance.hoverClass);\n }\n if (this._jsPlumb.hoverClass != null) {\n this._jsPlumb.instance[method](this.canvas, this._jsPlumb.hoverClass);\n }\n }\n if (this._jsPlumb.hoverPaintStyle != null) {\n this._jsPlumb.paintStyleInUse = hover ? this._jsPlumb.hoverPaintStyle : this._jsPlumb.paintStyle;\n if (!this._jsPlumb.instance.isSuspendDrawing()) {\n timestamp = timestamp || _timestamp();\n this.repaint({timestamp: timestamp, recalc: false});\n }\n }\n // get the list of other affected elements, if supported by this component.\n // for a connection, its the endpoints. for an endpoint, its the connections! surprise.\n if (this.getAttachedElements && !ignoreAttachedElements) {\n _updateAttachedElements(this, hover, _timestamp(), this);\n }\n }\n }\n });\n\n// ------------------------------ END jsPlumbUIComponent --------------------------------------------\n\n var _jsPlumbInstanceIndex = 0,\n getInstanceIndex = function () {\n var i = _jsPlumbInstanceIndex + 1;\n _jsPlumbInstanceIndex++;\n return i;\n };\n\n var jsPlumbInstance = root.jsPlumbInstance = function (_defaults) {\n\n this.version = \"2.9.0\";\n\n this.Defaults = {\n Anchor: \"Bottom\",\n Anchors: [ null, null ],\n ConnectionsDetachable: true,\n ConnectionOverlays: [ ],\n Connector: \"Bezier\",\n Container: null,\n DoNotThrowErrors: false,\n DragOptions: { },\n DropOptions: { },\n Endpoint: \"Dot\",\n EndpointOverlays: [ ],\n Endpoints: [ null, null ],\n EndpointStyle: { fill: \"#456\" },\n EndpointStyles: [ null, null ],\n EndpointHoverStyle: null,\n EndpointHoverStyles: [ null, null ],\n HoverPaintStyle: null,\n LabelStyle: { color: \"black\" },\n LogEnabled: false,\n Overlays: [ ],\n MaxConnections: 1,\n PaintStyle: { \"stroke-width\": 4, stroke: \"#456\" },\n ReattachConnections: false,\n RenderMode: \"svg\",\n Scope: \"jsPlumb_DefaultScope\"\n };\n\n if (_defaults) {\n jsPlumb.extend(this.Defaults, _defaults);\n }\n\n this.logEnabled = this.Defaults.LogEnabled;\n this._connectionTypes = {};\n this._endpointTypes = {};\n\n _ju.EventGenerator.apply(this);\n\n var _currentInstance = this,\n _instanceIndex = getInstanceIndex(),\n _bb = _currentInstance.bind,\n _initialDefaults = {},\n _zoom = 1,\n _info = function (el) {\n if (el == null) {\n return null;\n }\n else if (el.nodeType === 3 || el.nodeType === 8) {\n return { el:el, text:true };\n }\n else {\n var _el = _currentInstance.getElement(el);\n return { el: _el, id: (_ju.isString(el) && _el == null) ? el : _getId(_el) };\n }\n };\n\n this.getInstanceIndex = function () {\n return _instanceIndex;\n };\n\n // CONVERTED\n this.setZoom = function (z, repaintEverything) {\n _zoom = z;\n _currentInstance.fire(\"zoom\", _zoom);\n if (repaintEverything) {\n _currentInstance.repaintEverything();\n }\n return true;\n };\n // CONVERTED\n this.getZoom = function () {\n return _zoom;\n };\n\n for (var i in this.Defaults) {\n _initialDefaults[i] = this.Defaults[i];\n }\n\n var _container, _containerDelegations = [];\n this.unbindContainer = function() {\n if (_container != null && _containerDelegations.length > 0) {\n for (var i = 0; i < _containerDelegations.length; i++) {\n _currentInstance.off(_container, _containerDelegations[i][0], _containerDelegations[i][1]);\n }\n }\n };\n this.setContainer = function (c) {\n\n this.unbindContainer();\n\n // get container as dom element.\n c = this.getElement(c);\n // move existing connections and endpoints, if any.\n this.select().each(function (conn) {\n conn.moveParent(c);\n });\n this.selectEndpoints().each(function (ep) {\n ep.moveParent(c);\n });\n\n // set container.\n var previousContainer = _container;\n _container = c;\n _containerDelegations.length = 0;\n var eventAliases = {\n \"endpointclick\":\"endpointClick\",\n \"endpointdblclick\":\"endpointDblClick\"\n };\n\n var _oneDelegateHandler = function (id, e, componentType) {\n var t = e.srcElement || e.target,\n jp = (t && t.parentNode ? t.parentNode._jsPlumb : null) || (t ? t._jsPlumb : null) || (t && t.parentNode && t.parentNode.parentNode ? t.parentNode.parentNode._jsPlumb : null);\n if (jp) {\n jp.fire(id, jp, e);\n var alias = componentType ? eventAliases[componentType + id] || id : id;\n // jsplumb also fires every event coming from components/overlays. That's what the test for `jp.component` is for.\n _currentInstance.fire(alias, jp.component || jp, e);\n }\n };\n\n var _addOneDelegate = function(eventId, selector, fn) {\n _containerDelegations.push([eventId, fn]);\n _currentInstance.on(_container, eventId, selector, fn);\n };\n\n // delegate one event on the container to jsplumb elements. it might be possible to\n // abstract this out: each of endpoint, connection and overlay could register themselves with\n // jsplumb as \"component types\" or whatever, and provide a suitable selector. this would be\n // done by the renderer (although admittedly from 2.0 onwards we're not supporting vml anymore)\n var _oneDelegate = function (id) {\n // connections.\n _addOneDelegate(id, \".jtk-connector\", function (e) {\n _oneDelegateHandler(id, e);\n });\n // endpoints. note they can have an enclosing div, or not.\n _addOneDelegate(id, \".jtk-endpoint\", function (e) {\n _oneDelegateHandler(id, e, \"endpoint\");\n });\n // overlays\n _addOneDelegate(id, \".jtk-overlay\", function (e) {\n _oneDelegateHandler(id, e);\n });\n };\n\n for (var i = 0; i < events.length; i++) {\n _oneDelegate(events[i]);\n }\n\n // managed elements\n for (var elId in managedElements) {\n var el = managedElements[elId].el;\n if (el.parentNode === previousContainer) {\n previousContainer.removeChild(el);\n _container.appendChild(el);\n }\n }\n\n };\n this.getContainer = function () {\n return _container;\n };\n\n this.bind = function (event, fn) {\n if (\"ready\" === event && initialized) {\n fn();\n }\n else {\n _bb.apply(_currentInstance, [event, fn]);\n }\n };\n\n _currentInstance.importDefaults = function (d) {\n for (var i in d) {\n _currentInstance.Defaults[i] = d[i];\n }\n if (d.Container) {\n _currentInstance.setContainer(d.Container);\n }\n\n return _currentInstance;\n };\n\n _currentInstance.restoreDefaults = function () {\n _currentInstance.Defaults = jsPlumb.extend({}, _initialDefaults);\n return _currentInstance;\n };\n\n var log = null,\n initialized = false,\n // TODO remove from window scope\n connections = [],\n // map of element id -> endpoint lists. an element can have an arbitrary\n // number of endpoints on it, and not all of them have to be connected\n // to anything.\n endpointsByElement = {},\n endpointsByUUID = {},\n managedElements = {},\n offsets = {},\n offsetTimestamps = {},\n draggableStates = {},\n connectionBeingDragged = false,\n sizes = [],\n _suspendDrawing = false,\n _suspendedAt = null,\n DEFAULT_SCOPE = this.Defaults.Scope,\n _curIdStamp = 1,\n _idstamp = function () {\n return \"\" + _curIdStamp++;\n },\n\n //\n // appends an element to some other element, which is calculated as follows:\n //\n // 1. if Container exists, use that element.\n // 2. if the 'parent' parameter exists, use that.\n // 3. otherwise just use the root element.\n //\n //\n _appendElement = function (el, parent) {\n if (_container) {\n _container.appendChild(el);\n }\n else if (!parent) {\n this.appendToRoot(el);\n }\n else {\n this.getElement(parent).appendChild(el);\n }\n }.bind(this),\n\n //\n // Draws an endpoint and its connections. this is the main entry point into drawing connections as well\n // as endpoints, since jsPlumb is endpoint-centric under the hood.\n //\n // @param element element to draw (of type library specific element object)\n // @param ui UI object from current library's event system. optional.\n // @param timestamp timestamp for this paint cycle. used to speed things up a little by cutting down the amount of offset calculations we do.\n // @param clearEdits defaults to false; indicates that mouse edits for connectors should be cleared\n ///\n _draw = function (element, ui, timestamp, clearEdits) {\n\n if (!_suspendDrawing) {\n var id = _getId(element),\n repaintEls,\n dm = _currentInstance.getDragManager();\n\n if (dm) {\n repaintEls = dm.getElementsForDraggable(id);\n }\n\n if (timestamp == null) {\n timestamp = _timestamp();\n }\n\n // update the offset of everything _before_ we try to draw anything.\n var o = _updateOffset({ elId: id, offset: ui, recalc: false, timestamp: timestamp });\n\n if (repaintEls && o && o.o) {\n for (var i in repaintEls) {\n _updateOffset({\n elId: repaintEls[i].id,\n offset: {\n left: o.o.left + repaintEls[i].offset.left,\n top: o.o.top + repaintEls[i].offset.top\n },\n recalc: false,\n timestamp: timestamp\n });\n }\n }\n\n _currentInstance.anchorManager.redraw(id, ui, timestamp, null, clearEdits);\n\n if (repaintEls) {\n for (var j in repaintEls) {\n _currentInstance.anchorManager.redraw(repaintEls[j].id, ui, timestamp, repaintEls[j].offset, clearEdits, true);\n }\n }\n }\n },\n\n //\n // gets an Endpoint by uuid.\n //\n _getEndpoint = function (uuid) {\n return endpointsByUUID[uuid];\n },\n\n /**\n * inits a draggable if it's not already initialised.\n * TODO: somehow abstract this to the adapter, because the concept of \"draggable\" has no\n * place on the server.\n */\n\n\n _scopeMatch = function (e1, e2) {\n var s1 = e1.scope.split(/\\s/), s2 = e2.scope.split(/\\s/);\n for (var i = 0; i < s1.length; i++) {\n for (var j = 0; j < s2.length; j++) {\n if (s2[j] === s1[i]) {\n return true;\n }\n }\n }\n\n return false;\n },\n\n _mergeOverrides = function (def, values) {\n var m = jsPlumb.extend({}, def);\n for (var i in values) {\n if (values[i]) {\n m[i] = values[i];\n }\n }\n return m;\n },\n\n /*\n * prepares a final params object that can be passed to _newConnection, taking into account defaults, events, etc.\n */\n _prepareConnectionParams = function (params, referenceParams) {\n var _p = jsPlumb.extend({ }, params);\n if (referenceParams) {\n jsPlumb.extend(_p, referenceParams);\n }\n\n // hotwire endpoints passed as source or target to sourceEndpoint/targetEndpoint, respectively.\n if (_p.source) {\n if (_p.source.endpoint) {\n _p.sourceEndpoint = _p.source;\n }\n else {\n _p.source = _currentInstance.getElement(_p.source);\n }\n }\n if (_p.target) {\n if (_p.target.endpoint) {\n _p.targetEndpoint = _p.target;\n }\n else {\n _p.target = _currentInstance.getElement(_p.target);\n }\n }\n\n // test for endpoint uuids to connect\n if (params.uuids) {\n _p.sourceEndpoint = _getEndpoint(params.uuids[0]);\n _p.targetEndpoint = _getEndpoint(params.uuids[1]);\n }\n\n // now ensure that if we do have Endpoints already, they're not full.\n // source:\n if (_p.sourceEndpoint && _p.sourceEndpoint.isFull()) {\n _ju.log(_currentInstance, \"could not add connection; source endpoint is full\");\n return;\n }\n\n // target:\n if (_p.targetEndpoint && _p.targetEndpoint.isFull()) {\n _ju.log(_currentInstance, \"could not add connection; target endpoint is full\");\n return;\n }\n\n // if source endpoint mandates connection type and nothing specified in our params, use it.\n if (!_p.type && _p.sourceEndpoint) {\n _p.type = _p.sourceEndpoint.connectionType;\n }\n\n // copy in any connectorOverlays that were specified on the source endpoint.\n // it doesnt copy target endpoint overlays. i'm not sure if we want it to or not.\n if (_p.sourceEndpoint && _p.sourceEndpoint.connectorOverlays) {\n _p.overlays = _p.overlays || [];\n for (var i = 0, j = _p.sourceEndpoint.connectorOverlays.length; i < j; i++) {\n _p.overlays.push(_p.sourceEndpoint.connectorOverlays[i]);\n }\n }\n\n // scope\n if (_p.sourceEndpoint && _p.sourceEndpoint.scope) {\n _p.scope = _p.sourceEndpoint.scope;\n }\n\n // pointer events\n if (!_p[\"pointer-events\"] && _p.sourceEndpoint && _p.sourceEndpoint.connectorPointerEvents) {\n _p[\"pointer-events\"] = _p.sourceEndpoint.connectorPointerEvents;\n }\n\n\n var _addEndpoint = function (el, def, idx) {\n return _currentInstance.addEndpoint(el, _mergeOverrides(def, {\n anchor: _p.anchors ? _p.anchors[idx] : _p.anchor,\n endpoint: _p.endpoints ? _p.endpoints[idx] : _p.endpoint,\n paintStyle: _p.endpointStyles ? _p.endpointStyles[idx] : _p.endpointStyle,\n hoverPaintStyle: _p.endpointHoverStyles ? _p.endpointHoverStyles[idx] : _p.endpointHoverStyle\n }));\n };\n\n // check for makeSource/makeTarget specs.\n\n var _oneElementDef = function (type, idx, defs, matchType) {\n if (_p[type] && !_p[type].endpoint && !_p[type + \"Endpoint\"] && !_p.newConnection) {\n var tid = _getId(_p[type]), tep = defs[tid];\n\n tep = tep ? tep[matchType] : null;\n\n if (tep) {\n // if not enabled, return.\n if (!tep.enabled) {\n return false;\n }\n var newEndpoint = tep.endpoint != null && tep.endpoint._jsPlumb ? tep.endpoint : _addEndpoint(_p[type], tep.def, idx);\n if (newEndpoint.isFull()) {\n return false;\n }\n _p[type + \"Endpoint\"] = newEndpoint;\n if (!_p.scope && tep.def.scope) {\n _p.scope = tep.def.scope;\n } // provide scope if not already provided and endpoint def has one.\n if (tep.uniqueEndpoint) {\n if (!tep.endpoint) {\n tep.endpoint = newEndpoint;\n newEndpoint.setDeleteOnEmpty(false);\n }\n else {\n newEndpoint.finalEndpoint = tep.endpoint;\n }\n } else {\n newEndpoint.setDeleteOnEmpty(true);\n }\n\n //\n // copy in connector overlays if present on the source definition.\n //\n if (idx === 0 && tep.def.connectorOverlays) {\n _p.overlays = _p.overlays || [];\n Array.prototype.push.apply(_p.overlays, tep.def.connectorOverlays);\n }\n }\n }\n };\n\n if (_oneElementDef(\"source\", 0, this.sourceEndpointDefinitions, _p.type || \"default\") === false) {\n return;\n }\n if (_oneElementDef(\"target\", 1, this.targetEndpointDefinitions, _p.type || \"default\") === false) {\n return;\n }\n\n // last, ensure scopes match\n if (_p.sourceEndpoint && _p.targetEndpoint) {\n if (!_scopeMatch(_p.sourceEndpoint, _p.targetEndpoint)) {\n _p = null;\n }\n }\n\n return _p;\n }.bind(_currentInstance),\n\n _newConnection = function (params) {\n var connectionFunc = _currentInstance.Defaults.ConnectionType || _currentInstance.getDefaultConnectionType();\n\n params._jsPlumb = _currentInstance;\n params.newConnection = _newConnection;\n params.newEndpoint = _newEndpoint;\n params.endpointsByUUID = endpointsByUUID;\n params.endpointsByElement = endpointsByElement;\n params.finaliseConnection = _finaliseConnection;\n params.id = \"con_\" + _idstamp();\n var con = new connectionFunc(params);\n\n // if the connection is draggable, then maybe we need to tell the target endpoint to init the\n // dragging code. it won't run again if it already configured to be draggable.\n if (con.isDetachable()) {\n con.endpoints[0].initDraggable(\"_jsPlumbSource\");\n con.endpoints[1].initDraggable(\"_jsPlumbTarget\");\n }\n\n return con;\n },\n\n //\n // adds the connection to the backing model, fires an event if necessary and then redraws\n //\n _finaliseConnection = _currentInstance.finaliseConnection = function (jpc, params, originalEvent, doInformAnchorManager) {\n params = params || {};\n // add to list of connections (by scope).\n if (!jpc.suspendedEndpoint) {\n connections.push(jpc);\n }\n\n jpc.pending = null;\n\n // turn off isTemporarySource on the source endpoint (only viable on first draw)\n jpc.endpoints[0].isTemporarySource = false;\n\n // always inform the anchor manager\n // except that if jpc has a suspended endpoint it's not true to say the\n // connection is new; it has just (possibly) moved. the question is whether\n // to make that call here or in the anchor manager. i think perhaps here.\n if (doInformAnchorManager !== false) {\n _currentInstance.anchorManager.newConnection(jpc);\n }\n\n // force a paint\n _draw(jpc.source);\n\n // fire an event\n if (!params.doNotFireConnectionEvent && params.fireEvent !== false) {\n\n var eventArgs = {\n connection: jpc,\n source: jpc.source, target: jpc.target,\n sourceId: jpc.sourceId, targetId: jpc.targetId,\n sourceEndpoint: jpc.endpoints[0], targetEndpoint: jpc.endpoints[1]\n };\n\n _currentInstance.fire(\"connection\", eventArgs, originalEvent);\n }\n },\n\n /*\n factory method to prepare a new endpoint. this should always be used instead of creating Endpoints\n manually, since this method attaches event listeners and an id.\n */\n _newEndpoint = function (params, id) {\n var endpointFunc = _currentInstance.Defaults.EndpointType || jsPlumb.Endpoint;\n var _p = jsPlumb.extend({}, params);\n _p._jsPlumb = _currentInstance;\n _p.newConnection = _newConnection;\n _p.newEndpoint = _newEndpoint;\n _p.endpointsByUUID = endpointsByUUID;\n _p.endpointsByElement = endpointsByElement;\n _p.fireDetachEvent = fireDetachEvent;\n _p.elementId = id || _getId(_p.source);\n var ep = new endpointFunc(_p);\n ep.id = \"ep_\" + _idstamp();\n _manage(_p.elementId, _p.source);\n\n if (!jsPlumb.headless) {\n _currentInstance.getDragManager().endpointAdded(_p.source, id);\n }\n\n return ep;\n },\n\n /*\n * performs the given function operation on all the connections found\n * for the given element id; this means we find all the endpoints for\n * the given element, and then for each endpoint find the connectors\n * connected to it. then we pass each connection in to the given\n * function.\n */\n _operation = function (elId, func, endpointFunc) {\n var endpoints = endpointsByElement[elId];\n if (endpoints && endpoints.length) {\n for (var i = 0, ii = endpoints.length; i < ii; i++) {\n for (var j = 0, jj = endpoints[i].connections.length; j < jj; j++) {\n var retVal = func(endpoints[i].connections[j]);\n // if the function passed in returns true, we exit.\n // most functions return false.\n if (retVal) {\n return;\n }\n }\n if (endpointFunc) {\n endpointFunc(endpoints[i]);\n }\n }\n }\n },\n\n _setDraggable = function (element, draggable) {\n return jsPlumb.each(element, function (el) {\n if (_currentInstance.isDragSupported(el)) {\n draggableStates[_currentInstance.getAttribute(el, \"id\")] = draggable;\n _currentInstance.setElementDraggable(el, draggable);\n }\n });\n },\n /*\n * private method to do the business of hiding/showing.\n *\n * @param el\n * either Id of the element in question or a library specific\n * object for the element.\n * @param state\n * String specifying a value for the css 'display' property\n * ('block' or 'none').\n */\n _setVisible = function (el, state, alsoChangeEndpoints) {\n state = state === \"block\";\n var endpointFunc = null;\n if (alsoChangeEndpoints) {\n endpointFunc = function (ep) {\n ep.setVisible(state, true, true);\n };\n }\n var info = _info(el);\n _operation(info.id, function (jpc) {\n if (state && alsoChangeEndpoints) {\n // this test is necessary because this functionality is new, and i wanted to maintain backwards compatibility.\n // this block will only set a connection to be visible if the other endpoint in the connection is also visible.\n var oidx = jpc.sourceId === info.id ? 1 : 0;\n if (jpc.endpoints[oidx].isVisible()) {\n jpc.setVisible(true);\n }\n }\n else { // the default behaviour for show, and what always happens for hide, is to just set the visibility without getting clever.\n jpc.setVisible(state);\n }\n }, endpointFunc);\n },\n /**\n * private method to do the business of toggling hiding/showing.\n */\n _toggleVisible = function (elId, changeEndpoints) {\n var endpointFunc = null;\n if (changeEndpoints) {\n endpointFunc = function (ep) {\n var state = ep.isVisible();\n ep.setVisible(!state);\n };\n }\n _operation(elId, function (jpc) {\n var state = jpc.isVisible();\n jpc.setVisible(!state);\n }, endpointFunc);\n },\n\n // TODO comparison performance\n _getCachedData = function (elId) {\n var o = offsets[elId];\n if (!o) {\n return _updateOffset({elId: elId});\n }\n else {\n return {o: o, s: sizes[elId]};\n }\n },\n\n /**\n * gets an id for the given element, creating and setting one if\n * necessary. the id is of the form\n *\n * jsPlumb__\n *\n * where \"index in instance\" is a monotonically increasing integer that starts at 0,\n * for each instance. this method is used not only to assign ids to elements that do not\n * have them but also to connections and endpoints.\n */\n _getId = function (element, uuid, doNotCreateIfNotFound) {\n if (_ju.isString(element)) {\n return element;\n }\n if (element == null) {\n return null;\n }\n var id = _currentInstance.getAttribute(element, \"id\");\n if (!id || id === \"undefined\") {\n // check if fixed uuid parameter is given\n if (arguments.length === 2 && arguments[1] !== undefined) {\n id = uuid;\n }\n else if (arguments.length === 1 || (arguments.length === 3 && !arguments[2])) {\n id = \"jsPlumb_\" + _instanceIndex + \"_\" + _idstamp();\n }\n\n if (!doNotCreateIfNotFound) {\n _currentInstance.setAttribute(element, \"id\", id);\n }\n }\n return id;\n };\n\n this.setConnectionBeingDragged = function (v) {\n connectionBeingDragged = v;\n };\n this.isConnectionBeingDragged = function () {\n return connectionBeingDragged;\n };\n\n /**\n * Returns a map of all the elements this jsPlumbInstance is currently managing.\n * @returns {Object} Map of [id-> {el, endpoint[], connection, position}] information.\n */\n this.getManagedElements = function() {\n return managedElements;\n };\n\n this.connectorClass = \"jtk-connector\";\n this.connectorOutlineClass = \"jtk-connector-outline\";\n this.connectedClass = \"jtk-connected\";\n this.hoverClass = \"jtk-hover\";\n this.endpointClass = \"jtk-endpoint\";\n this.endpointConnectedClass = \"jtk-endpoint-connected\";\n this.endpointFullClass = \"jtk-endpoint-full\";\n this.endpointDropAllowedClass = \"jtk-endpoint-drop-allowed\";\n this.endpointDropForbiddenClass = \"jtk-endpoint-drop-forbidden\";\n this.overlayClass = \"jtk-overlay\";\n this.draggingClass = \"jtk-dragging\";// CONVERTED\n this.elementDraggingClass = \"jtk-element-dragging\";// CONVERTED\n this.sourceElementDraggingClass = \"jtk-source-element-dragging\"; // CONVERTED\n this.targetElementDraggingClass = \"jtk-target-element-dragging\";// CONVERTED\n this.endpointAnchorClassPrefix = \"jtk-endpoint-anchor\";\n this.hoverSourceClass = \"jtk-source-hover\";\n this.hoverTargetClass = \"jtk-target-hover\";\n this.dragSelectClass = \"jtk-drag-select\";\n\n this.Anchors = {};\n this.Connectors = { \"svg\": {} };\n this.Endpoints = { \"svg\": {} };\n this.Overlays = { \"svg\": {} } ;\n this.ConnectorRenderers = {};\n this.SVG = \"svg\";\n\n// --------------------------- jsPlumbInstance public API ---------------------------------------------------------\n\n\n this.addEndpoint = function (el, params, referenceParams) {\n referenceParams = referenceParams || {};\n var p = jsPlumb.extend({}, referenceParams);\n jsPlumb.extend(p, params);\n p.endpoint = p.endpoint || _currentInstance.Defaults.Endpoint;\n p.paintStyle = p.paintStyle || _currentInstance.Defaults.EndpointStyle;\n\n var results = [],\n inputs = (_ju.isArray(el) || (el.length != null && !_ju.isString(el))) ? el : [ el ];\n\n for (var i = 0, j = inputs.length; i < j; i++) {\n p.source = _currentInstance.getElement(inputs[i]);\n _ensureContainer(p.source);\n\n var id = _getId(p.source), e = _newEndpoint(p, id);\n\n // ensure element is managed.\n var myOffset = _manage(id, p.source).info.o;\n _ju.addToList(endpointsByElement, id, e);\n\n if (!_suspendDrawing) {\n e.paint({\n anchorLoc: e.anchor.compute({ xy: [ myOffset.left, myOffset.top ], wh: sizes[id], element: e, timestamp: _suspendedAt }),\n timestamp: _suspendedAt\n });\n }\n\n results.push(e);\n }\n\n return results.length === 1 ? results[0] : results;\n };\n\n this.addEndpoints = function (el, endpoints, referenceParams) {\n var results = [];\n for (var i = 0, j = endpoints.length; i < j; i++) {\n var e = _currentInstance.addEndpoint(el, endpoints[i], referenceParams);\n if (_ju.isArray(e)) {\n Array.prototype.push.apply(results, e);\n }\n else {\n results.push(e);\n }\n }\n return results;\n };\n\n this.animate = function (el, properties, options) {\n if (!this.animationSupported) {\n return false;\n }\n\n options = options || {};\n var del = _currentInstance.getElement(el),\n id = _getId(del),\n stepFunction = jsPlumb.animEvents.step,\n completeFunction = jsPlumb.animEvents.complete;\n\n options[stepFunction] = _ju.wrap(options[stepFunction], function () {\n _currentInstance.revalidate(id);\n });\n\n // onComplete repaints, just to make sure everything looks good at the end of the animation.\n options[completeFunction] = _ju.wrap(options[completeFunction], function () {\n _currentInstance.revalidate(id);\n });\n\n _currentInstance.doAnimate(del, properties, options);\n };\n\n /**\n * checks for a listener for the given condition, executing it if found, passing in the given value.\n * condition listeners would have been attached using \"bind\" (which is, you could argue, now overloaded, since\n * firing click events etc is a bit different to what this does). i thought about adding a \"bindCondition\"\n * or something, but decided against it, for the sake of simplicity. jsPlumb will never fire one of these\n * condition events anyway.\n */\n this.checkCondition = function (conditionName, args) {\n var l = _currentInstance.getListener(conditionName),\n r = true;\n\n if (l && l.length > 0) {\n var values = Array.prototype.slice.call(arguments, 1);\n try {\n for (var i = 0, j = l.length; i < j; i++) {\n r = r && l[i].apply(l[i], values);\n }\n }\n catch (e) {\n _ju.log(_currentInstance, \"cannot check condition [\" + conditionName + \"]\" + e);\n }\n }\n return r;\n };\n\n this.connect = function (params, referenceParams) {\n // prepare a final set of parameters to create connection with\n var _p = _prepareConnectionParams(params, referenceParams), jpc;\n // TODO probably a nicer return value if the connection was not made. _prepareConnectionParams\n // will return null (and log something) if either endpoint was full. what would be nicer is to\n // create a dedicated 'error' object.\n if (_p) {\n if (_p.source == null && _p.sourceEndpoint == null) {\n _ju.log(\"Cannot establish connection - source does not exist\");\n return;\n }\n if (_p.target == null && _p.targetEndpoint == null) {\n _ju.log(\"Cannot establish connection - target does not exist\");\n return;\n }\n _ensureContainer(_p.source);\n // create the connection. it is not yet registered\n jpc = _newConnection(_p);\n // now add it the model, fire an event, and redraw\n _finaliseConnection(jpc, _p);\n }\n return jpc;\n };\n\n var stTypes = [\n { el: \"source\", elId: \"sourceId\", epDefs: \"sourceEndpointDefinitions\" },\n { el: \"target\", elId: \"targetId\", epDefs: \"targetEndpointDefinitions\" }\n ];\n\n var _set = function (c, el, idx, doNotRepaint) {\n var ep, _st = stTypes[idx], cId = c[_st.elId], cEl = c[_st.el], sid, sep,\n oldEndpoint = c.endpoints[idx];\n\n var evtParams = {\n index: idx,\n originalSourceId: idx === 0 ? cId : c.sourceId,\n newSourceId: c.sourceId,\n originalTargetId: idx === 1 ? cId : c.targetId,\n newTargetId: c.targetId,\n connection: c\n };\n\n if (el.constructor === jsPlumb.Endpoint) {\n ep = el;\n ep.addConnection(c);\n el = ep.element;\n }\n else {\n sid = _getId(el);\n sep = this[_st.epDefs][sid];\n\n if (sid === c[_st.elId]) {\n ep = null; // dont change source/target if the element is already the one given.\n }\n else if (sep) {\n for (var t in sep) {\n if (!sep[t].enabled) {\n return;\n }\n ep = sep[t].endpoint != null && sep[t].endpoint._jsPlumb ? sep[t].endpoint : this.addEndpoint(el, sep[t].def);\n if (sep[t].uniqueEndpoint) {\n sep[t].endpoint = ep;\n }\n ep.addConnection(c);\n }\n }\n else {\n ep = c.makeEndpoint(idx === 0, el, sid);\n }\n }\n\n if (ep != null) {\n oldEndpoint.detachFromConnection(c);\n c.endpoints[idx] = ep;\n c[_st.el] = ep.element;\n c[_st.elId] = ep.elementId;\n evtParams[idx === 0 ? \"newSourceId\" : \"newTargetId\"] = ep.elementId;\n\n fireMoveEvent(evtParams);\n\n if (!doNotRepaint) {\n c.repaint();\n }\n }\n\n evtParams.element = el;\n return evtParams;\n\n }.bind(this);\n\n this.setSource = function (connection, el, doNotRepaint) {\n var p = _set(connection, el, 0, doNotRepaint);\n this.anchorManager.sourceChanged(p.originalSourceId, p.newSourceId, connection, p.el);\n };\n this.setTarget = function (connection, el, doNotRepaint) {\n var p = _set(connection, el, 1, doNotRepaint);\n this.anchorManager.updateOtherEndpoint(p.originalSourceId, p.originalTargetId, p.newTargetId, connection);\n };\n\n this.deleteEndpoint = function (object, dontUpdateHover, deleteAttachedObjects) {\n var endpoint = (typeof object === \"string\") ? endpointsByUUID[object] : object;\n if (endpoint) {\n _currentInstance.deleteObject({ endpoint: endpoint, dontUpdateHover: dontUpdateHover, deleteAttachedObjects:deleteAttachedObjects });\n }\n return _currentInstance;\n };\n\n this.deleteEveryEndpoint = function () {\n var _is = _currentInstance.setSuspendDrawing(true);\n for (var id in endpointsByElement) {\n var endpoints = endpointsByElement[id];\n if (endpoints && endpoints.length) {\n for (var i = 0, j = endpoints.length; i < j; i++) {\n _currentInstance.deleteEndpoint(endpoints[i], true);\n }\n }\n }\n endpointsByElement = {};\n managedElements = {};\n endpointsByUUID = {};\n offsets = {};\n offsetTimestamps = {};\n _currentInstance.anchorManager.reset();\n var dm = _currentInstance.getDragManager();\n if (dm) {\n dm.reset();\n }\n if (!_is) {\n _currentInstance.setSuspendDrawing(false);\n }\n return _currentInstance;\n };\n\n var fireDetachEvent = function (jpc, doFireEvent, originalEvent) {\n // may have been given a connection, or in special cases, an object\n var connType = _currentInstance.Defaults.ConnectionType || _currentInstance.getDefaultConnectionType(),\n argIsConnection = jpc.constructor === connType,\n params = argIsConnection ? {\n connection: jpc,\n source: jpc.source, target: jpc.target,\n sourceId: jpc.sourceId, targetId: jpc.targetId,\n sourceEndpoint: jpc.endpoints[0], targetEndpoint: jpc.endpoints[1]\n } : jpc;\n\n if (doFireEvent) {\n _currentInstance.fire(\"connectionDetached\", params, originalEvent);\n }\n\n // always fire this. used by internal jsplumb stuff.\n _currentInstance.fire(\"internal.connectionDetached\", params, originalEvent);\n\n _currentInstance.anchorManager.connectionDetached(params);\n };\n\n var fireMoveEvent = _currentInstance.fireMoveEvent = function (params, evt) {\n _currentInstance.fire(\"connectionMoved\", params, evt);\n };\n\n this.unregisterEndpoint = function (endpoint) {\n if (endpoint._jsPlumb.uuid) {\n endpointsByUUID[endpoint._jsPlumb.uuid] = null;\n }\n _currentInstance.anchorManager.deleteEndpoint(endpoint);\n // TODO at least replace this with a removeWithFunction call.\n for (var e in endpointsByElement) {\n var endpoints = endpointsByElement[e];\n if (endpoints) {\n var newEndpoints = [];\n for (var i = 0, j = endpoints.length; i < j; i++) {\n if (endpoints[i] !== endpoint) {\n newEndpoints.push(endpoints[i]);\n }\n }\n\n endpointsByElement[e] = newEndpoints;\n }\n if (endpointsByElement[e].length < 1) {\n delete endpointsByElement[e];\n }\n }\n };\n\n var IS_DETACH_ALLOWED = \"isDetachAllowed\";\n var BEFORE_DETACH = \"beforeDetach\";\n var CHECK_CONDITION = \"checkCondition\";\n\n /**\n * Deletes a Connection.\n * @method deleteConnection\n * @param connection Connection to delete\n * @param {Object} [params] Optional delete parameters\n * @param {Boolean} [params.doNotFireEvent=false] If true, a connection detached event will not be fired. Otherwise one will.\n * @param {Boolean} [params.force=false] If true, the connection will be deleted even if a beforeDetach interceptor tries to stop the deletion.\n * @returns {Boolean} True if the connection was deleted, false otherwise.\n */\n this.deleteConnection = function(connection, params) {\n\n if (connection != null) {\n params = params || {};\n\n if (params.force || _ju.functionChain(true, false, [\n [ connection.endpoints[0], IS_DETACH_ALLOWED, [ connection ] ],\n [ connection.endpoints[1], IS_DETACH_ALLOWED, [ connection ] ],\n [ connection, IS_DETACH_ALLOWED, [ connection ] ],\n [ _currentInstance, CHECK_CONDITION, [ BEFORE_DETACH, connection ] ]\n ])) {\n\n connection.setHover(false);\n fireDetachEvent(connection, !connection.pending && params.fireEvent !== false, params.originalEvent);\n\n connection.endpoints[0].detachFromConnection(connection);\n connection.endpoints[1].detachFromConnection(connection);\n _ju.removeWithFunction(connections, function (_c) {\n return connection.id === _c.id;\n });\n\n connection.cleanup();\n connection.destroy();\n return true;\n }\n }\n return false;\n };\n\n /**\n * Remove all Connections from all elements, but leaves Endpoints in place ((unless a connection is set to auto delete its Endpoints).\n * @method deleteEveryConnection\n * @param {Object} [params] optional params object for the call\n * @param {Boolean} [params.fireEvent=true] Whether or not to fire detach events\n * @param {Boolean} [params.forceDetach=false] If true, this call will ignore any `beforeDetach` interceptors.\n * @returns {Number} The number of connections that were deleted.\n */\n this.deleteEveryConnection = function (params) {\n params = params || {};\n var count = connections.length, deletedCount = 0;\n _currentInstance.batch(function () {\n for (var i = 0; i < count; i++) {\n deletedCount += _currentInstance.deleteConnection(connections[0], params) ? 1 : 0;\n }\n });\n return deletedCount;\n };\n\n /**\n * Removes all an element's Connections.\n * @method deleteConnectionsForElement\n * @param {Object} el Either the id of the element, or a selector for the element.\n * @param {Object} [params] Optional parameters.\n * @param {Boolean} [params.fireEvent=true] Whether or not to fire the detach event.\n * @param {Boolean} [params.forceDetach=false] If true, this call will ignore any `beforeDetach` interceptors.\n * @return {jsPlumbInstance} The current jsPlumb instance.\n */\n this.deleteConnectionsForElement = function (el, params) {\n params = params || {};\n el = _currentInstance.getElement(el);\n var id = _getId(el), endpoints = endpointsByElement[id];\n if (endpoints && endpoints.length) {\n for (var i = 0, j = endpoints.length; i < j; i++) {\n endpoints[i].deleteEveryConnection(params);\n }\n }\n return _currentInstance;\n };\n\n /// not public. but of course its exposed. how to change this.\n this.deleteObject = function (params) {\n var result = {\n endpoints: {},\n connections: {},\n endpointCount: 0,\n connectionCount: 0\n },\n deleteAttachedObjects = params.deleteAttachedObjects !== false;\n\n var unravelConnection = function (connection) {\n if (connection != null && result.connections[connection.id] == null) {\n if (!params.dontUpdateHover && connection._jsPlumb != null) {\n connection.setHover(false);\n }\n result.connections[connection.id] = connection;\n result.connectionCount++;\n }\n };\n var unravelEndpoint = function (endpoint) {\n if (endpoint != null && result.endpoints[endpoint.id] == null) {\n if (!params.dontUpdateHover && endpoint._jsPlumb != null) {\n endpoint.setHover(false);\n }\n result.endpoints[endpoint.id] = endpoint;\n result.endpointCount++;\n\n if (deleteAttachedObjects) {\n for (var i = 0; i < endpoint.connections.length; i++) {\n var c = endpoint.connections[i];\n unravelConnection(c);\n }\n }\n }\n };\n\n if (params.connection) {\n unravelConnection(params.connection);\n }\n else {\n unravelEndpoint(params.endpoint);\n }\n\n // loop through connections\n for (var i in result.connections) {\n var c = result.connections[i];\n if (c._jsPlumb) {\n _ju.removeWithFunction(connections, function (_c) {\n return c.id === _c.id;\n });\n\n fireDetachEvent(c, params.fireEvent === false ? false : !c.pending, params.originalEvent);\n var doNotCleanup = params.deleteAttachedObjects == null ? null : !params.deleteAttachedObjects;\n\n c.endpoints[0].detachFromConnection(c, null, doNotCleanup);\n c.endpoints[1].detachFromConnection(c, null, doNotCleanup);\n\n c.cleanup(true);\n c.destroy(true);\n }\n }\n\n // loop through endpoints\n for (var j in result.endpoints) {\n var e = result.endpoints[j];\n if (e._jsPlumb) {\n _currentInstance.unregisterEndpoint(e);\n // FIRE some endpoint deleted event?\n e.cleanup(true);\n e.destroy(true);\n }\n }\n\n return result;\n };\n\n\n // helpers for select/selectEndpoints\n var _setOperation = function (list, func, args, selector) {\n for (var i = 0, j = list.length; i < j; i++) {\n list[i][func].apply(list[i], args);\n }\n return selector(list);\n },\n _getOperation = function (list, func, args) {\n var out = [];\n for (var i = 0, j = list.length; i < j; i++) {\n out.push([ list[i][func].apply(list[i], args), list[i] ]);\n }\n return out;\n },\n setter = function (list, func, selector) {\n return function () {\n return _setOperation(list, func, arguments, selector);\n };\n },\n getter = function (list, func) {\n return function () {\n return _getOperation(list, func, arguments);\n };\n },\n prepareList = function (input, doNotGetIds) {\n var r = [];\n if (input) {\n if (typeof input === 'string') {\n if (input === \"*\") {\n return input;\n }\n r.push(input);\n }\n else {\n if (doNotGetIds) {\n r = input;\n }\n else {\n if (input.length) {\n for (var i = 0, j = input.length; i < j; i++) {\n r.push(_info(input[i]).id);\n }\n }\n else {\n r.push(_info(input).id);\n }\n }\n }\n }\n return r;\n },\n filterList = function (list, value, missingIsFalse) {\n if (list === \"*\") {\n return true;\n }\n return list.length > 0 ? list.indexOf(value) !== -1 : !missingIsFalse;\n };\n\n // get some connections, specifying source/target/scope\n this.getConnections = function (options, flat) {\n if (!options) {\n options = {};\n } else if (options.constructor === String) {\n options = { \"scope\": options };\n }\n var scope = options.scope || _currentInstance.getDefaultScope(),\n scopes = prepareList(scope, true),\n sources = prepareList(options.source),\n targets = prepareList(options.target),\n results = (!flat && scopes.length > 1) ? {} : [],\n _addOne = function (scope, obj) {\n if (!flat && scopes.length > 1) {\n var ss = results[scope];\n if (ss == null) {\n ss = results[scope] = [];\n }\n ss.push(obj);\n } else {\n results.push(obj);\n }\n };\n\n for (var j = 0, jj = connections.length; j < jj; j++) {\n var c = connections[j],\n sourceId = c.proxies && c.proxies[0] ? c.proxies[0].originalEp.elementId : c.sourceId,\n targetId = c.proxies && c.proxies[1] ? c.proxies[1].originalEp.elementId : c.targetId;\n\n if (filterList(scopes, c.scope) && filterList(sources, sourceId) && filterList(targets, targetId)) {\n _addOne(c.scope, c);\n }\n }\n\n return results;\n };\n\n var _curryEach = function (list, executor) {\n return function (f) {\n for (var i = 0, ii = list.length; i < ii; i++) {\n f(list[i]);\n }\n return executor(list);\n };\n },\n _curryGet = function (list) {\n return function (idx) {\n return list[idx];\n };\n };\n\n var _makeCommonSelectHandler = function (list, executor) {\n var out = {\n length: list.length,\n each: _curryEach(list, executor),\n get: _curryGet(list)\n },\n setters = [\"setHover\", \"removeAllOverlays\", \"setLabel\", \"addClass\", \"addOverlay\", \"removeOverlay\",\n \"removeOverlays\", \"showOverlay\", \"hideOverlay\", \"showOverlays\", \"hideOverlays\", \"setPaintStyle\",\n \"setHoverPaintStyle\", \"setSuspendEvents\", \"setParameter\", \"setParameters\", \"setVisible\",\n \"repaint\", \"addType\", \"toggleType\", \"removeType\", \"removeClass\", \"setType\", \"bind\", \"unbind\" ],\n\n getters = [\"getLabel\", \"getOverlay\", \"isHover\", \"getParameter\", \"getParameters\", \"getPaintStyle\",\n \"getHoverPaintStyle\", \"isVisible\", \"hasType\", \"getType\", \"isSuspendEvents\" ],\n i, ii;\n\n for (i = 0, ii = setters.length; i < ii; i++) {\n out[setters[i]] = setter(list, setters[i], executor);\n }\n\n for (i = 0, ii = getters.length; i < ii; i++) {\n out[getters[i]] = getter(list, getters[i]);\n }\n\n return out;\n };\n\n var _makeConnectionSelectHandler = function (list) {\n var common = _makeCommonSelectHandler(list, _makeConnectionSelectHandler);\n return jsPlumb.extend(common, {\n // setters\n setDetachable: setter(list, \"setDetachable\", _makeConnectionSelectHandler),\n setReattach: setter(list, \"setReattach\", _makeConnectionSelectHandler),\n setConnector: setter(list, \"setConnector\", _makeConnectionSelectHandler),\n delete: function () {\n for (var i = 0, ii = list.length; i < ii; i++) {\n _currentInstance.deleteConnection(list[i]);\n }\n },\n // getters\n isDetachable: getter(list, \"isDetachable\"),\n isReattach: getter(list, \"isReattach\")\n });\n };\n\n var _makeEndpointSelectHandler = function (list) {\n var common = _makeCommonSelectHandler(list, _makeEndpointSelectHandler);\n return jsPlumb.extend(common, {\n setEnabled: setter(list, \"setEnabled\", _makeEndpointSelectHandler),\n setAnchor: setter(list, \"setAnchor\", _makeEndpointSelectHandler),\n isEnabled: getter(list, \"isEnabled\"),\n deleteEveryConnection: function () {\n for (var i = 0, ii = list.length; i < ii; i++) {\n list[i].deleteEveryConnection();\n }\n },\n \"delete\": function () {\n for (var i = 0, ii = list.length; i < ii; i++) {\n _currentInstance.deleteEndpoint(list[i]);\n }\n }\n });\n };\n\n this.select = function (params) {\n params = params || {};\n params.scope = params.scope || \"*\";\n return _makeConnectionSelectHandler(params.connections || _currentInstance.getConnections(params, true));\n };\n\n this.selectEndpoints = function (params) {\n params = params || {};\n params.scope = params.scope || \"*\";\n var noElementFilters = !params.element && !params.source && !params.target,\n elements = noElementFilters ? \"*\" : prepareList(params.element),\n sources = noElementFilters ? \"*\" : prepareList(params.source),\n targets = noElementFilters ? \"*\" : prepareList(params.target),\n scopes = prepareList(params.scope, true);\n\n var ep = [];\n\n for (var el in endpointsByElement) {\n var either = filterList(elements, el, true),\n source = filterList(sources, el, true),\n sourceMatchExact = sources !== \"*\",\n target = filterList(targets, el, true),\n targetMatchExact = targets !== \"*\";\n\n // if they requested 'either' then just match scope. otherwise if they requested 'source' (not as a wildcard) then we have to match only endpoints that have isSource set to to true, and the same thing with isTarget.\n if (either || source || target) {\n inner:\n for (var i = 0, ii = endpointsByElement[el].length; i < ii; i++) {\n var _ep = endpointsByElement[el][i];\n if (filterList(scopes, _ep.scope, true)) {\n\n var noMatchSource = (sourceMatchExact && sources.length > 0 && !_ep.isSource),\n noMatchTarget = (targetMatchExact && targets.length > 0 && !_ep.isTarget);\n\n if (noMatchSource || noMatchTarget) {\n continue inner;\n }\n\n ep.push(_ep);\n }\n }\n }\n }\n\n return _makeEndpointSelectHandler(ep);\n };\n\n // get all connections managed by the instance of jsplumb.\n this.getAllConnections = function () {\n return connections;\n };\n this.getDefaultScope = function () {\n return DEFAULT_SCOPE;\n };\n // get an endpoint by uuid.\n this.getEndpoint = _getEndpoint;\n /**\n * Gets the list of Endpoints for a given element.\n * @method getEndpoints\n * @param {String|Element|Selector} el The element to get endpoints for.\n * @return {Endpoint[]} An array of Endpoints for the specified element.\n */\n this.getEndpoints = function (el) {\n return endpointsByElement[_info(el).id] || [];\n };\n // gets the default endpoint type. used when subclassing. see wiki.\n this.getDefaultEndpointType = function () {\n return jsPlumb.Endpoint;\n };\n // gets the default connection type. used when subclassing. see wiki.\n this.getDefaultConnectionType = function () {\n return jsPlumb.Connection;\n };\n /*\n * Gets an element's id, creating one if necessary. really only exposed\n * for the lib-specific functionality to access; would be better to pass\n * the current instance into the lib-specific code (even though this is\n * a static call. i just don't want to expose it to the public API).\n */\n this.getId = _getId;\n this.draw = _draw;\n this.info = _info;\n\n this.appendElement = _appendElement;\n\n var _hoverSuspended = false;\n this.isHoverSuspended = function () {\n return _hoverSuspended;\n };\n this.setHoverSuspended = function (s) {\n _hoverSuspended = s;\n };\n\n // set an element's connections to be hidden\n this.hide = function (el, changeEndpoints) {\n _setVisible(el, \"none\", changeEndpoints);\n return _currentInstance;\n };\n\n // exposed for other objects to use to get a unique id.\n this.idstamp = _idstamp;\n\n // ensure that, if the current container exists, it is a DOM element and not a selector.\n // if it does not exist and `candidate` is supplied, the offset parent of that element will be set as the Container.\n // this is used to do a better default behaviour for the case that the user has not set a container:\n // addEndpoint, makeSource, makeTarget and connect all call this method with the offsetParent of the\n // element in question (for connect it is the source element). So if no container is set, it is inferred\n // to be the offsetParent of the first element the user tries to connect.\n var _ensureContainer = function (candidate) {\n if (!_container && candidate) {\n var can = _currentInstance.getElement(candidate);\n if (can.offsetParent) {\n _currentInstance.setContainer(can.offsetParent);\n }\n }\n };\n\n var _getContainerFromDefaults = function () {\n if (_currentInstance.Defaults.Container) {\n _currentInstance.setContainer(_currentInstance.Defaults.Container);\n }\n };\n\n // check if a given element is managed or not. if not, add to our map. if drawing is not suspended then\n // we'll also stash its dimensions; otherwise we'll do this in a lazy way through updateOffset.\n var _manage = _currentInstance.manage = function (id, element, _transient) {\n if (!managedElements[id]) {\n managedElements[id] = {\n el: element,\n endpoints: [],\n connections: []\n };\n\n managedElements[id].info = _updateOffset({ elId: id, timestamp: _suspendedAt });\n _currentInstance.addClass(element, \"jtk-managed\");\n if (!_transient) {\n _currentInstance.fire(\"manageElement\", { id:id, info:managedElements[id].info, el:element });\n }\n }\n\n return managedElements[id];\n };\n\n var _unmanage = _currentInstance.unmanage = function(id) {\n if (managedElements[id]) {\n _currentInstance.removeClass(managedElements[id].el, \"jtk-managed\");\n delete managedElements[id];\n _currentInstance.fire(\"unmanageElement\", id);\n }\n };\n\n /**\n * updates the offset and size for a given element, and stores the\n * values. if 'offset' is not null we use that (it would have been\n * passed in from a drag call) because it's faster; but if it is null,\n * or if 'recalc' is true in order to force a recalculation, we get the current values.\n * @method updateOffset\n */\n var _updateOffset = function (params) {\n\n var timestamp = params.timestamp, recalc = params.recalc, offset = params.offset, elId = params.elId, s;\n if (_suspendDrawing && !timestamp) {\n timestamp = _suspendedAt;\n }\n if (!recalc) {\n if (timestamp && timestamp === offsetTimestamps[elId]) {\n return {o: params.offset || offsets[elId], s: sizes[elId]};\n }\n }\n if (recalc || (!offset && offsets[elId] == null)) { // if forced repaint or no offset available, we recalculate.\n\n // get the current size and offset, and store them\n s = managedElements[elId] ? managedElements[elId].el : null;\n if (s != null) {\n sizes[elId] = _currentInstance.getSize(s);\n offsets[elId] = _currentInstance.getOffset(s);\n offsetTimestamps[elId] = timestamp;\n }\n } else {\n offsets[elId] = offset || offsets[elId];\n if (sizes[elId] == null) {\n s = managedElements[elId].el;\n if (s != null) {\n sizes[elId] = _currentInstance.getSize(s);\n }\n }\n offsetTimestamps[elId] = timestamp;\n }\n\n if (offsets[elId] && !offsets[elId].right) {\n offsets[elId].right = offsets[elId].left + sizes[elId][0];\n offsets[elId].bottom = offsets[elId].top + sizes[elId][1];\n offsets[elId].width = sizes[elId][0];\n offsets[elId].height = sizes[elId][1];\n offsets[elId].centerx = offsets[elId].left + (offsets[elId].width / 2);\n offsets[elId].centery = offsets[elId].top + (offsets[elId].height / 2);\n }\n\n return {o: offsets[elId], s: sizes[elId]};\n };\n\n this.updateOffset = _updateOffset;\n\n /**\n * callback from the current library to tell us to prepare ourselves (attach\n * mouse listeners etc; can't do that until the library has provided a bind method)\n */\n this.init = function () {\n if (!initialized) {\n _getContainerFromDefaults();\n _currentInstance.anchorManager = new root.jsPlumb.AnchorManager({jsPlumbInstance: _currentInstance});\n initialized = true;\n _currentInstance.fire(\"ready\", _currentInstance);\n }\n }.bind(this);\n\n this.log = log;\n this.jsPlumbUIComponent = jsPlumbUIComponent;\n\n /*\n * Creates an anchor with the given params.\n *\n *\n * Returns: The newly created Anchor.\n * Throws: an error if a named anchor was not found.\n */\n this.makeAnchor = function () {\n var pp, _a = function (t, p) {\n if (root.jsPlumb.Anchors[t]) {\n return new root.jsPlumb.Anchors[t](p);\n }\n if (!_currentInstance.Defaults.DoNotThrowErrors) {\n throw { msg: \"jsPlumb: unknown anchor type '\" + t + \"'\" };\n }\n };\n if (arguments.length === 0) {\n return null;\n }\n var specimen = arguments[0], elementId = arguments[1], jsPlumbInstance = arguments[2], newAnchor = null;\n // if it appears to be an anchor already...\n if (specimen.compute && specimen.getOrientation) {\n return specimen;\n } //TODO hazy here about whether it should be added or is already added somehow.\n // is it the name of an anchor type?\n else if (typeof specimen === \"string\") {\n newAnchor = _a(arguments[0], {elementId: elementId, jsPlumbInstance: _currentInstance});\n }\n // is it an array? it will be one of:\n // an array of [spec, params] - this defines a single anchor, which may be dynamic, but has parameters.\n // an array of arrays - this defines some dynamic anchors\n // an array of numbers - this defines a single anchor.\n else if (_ju.isArray(specimen)) {\n if (_ju.isArray(specimen[0]) || _ju.isString(specimen[0])) {\n // if [spec, params] format\n if (specimen.length === 2 && _ju.isObject(specimen[1])) {\n // if first arg is a string, its a named anchor with params\n if (_ju.isString(specimen[0])) {\n pp = root.jsPlumb.extend({elementId: elementId, jsPlumbInstance: _currentInstance}, specimen[1]);\n newAnchor = _a(specimen[0], pp);\n }\n // otherwise first arg is array, second is params. we treat as a dynamic anchor, which is fine\n // even if the first arg has only one entry. you could argue all anchors should be implicitly dynamic in fact.\n else {\n pp = root.jsPlumb.extend({elementId: elementId, jsPlumbInstance: _currentInstance, anchors: specimen[0]}, specimen[1]);\n newAnchor = new root.jsPlumb.DynamicAnchor(pp);\n }\n }\n else {\n newAnchor = new jsPlumb.DynamicAnchor({anchors: specimen, selector: null, elementId: elementId, jsPlumbInstance: _currentInstance});\n }\n\n }\n else {\n var anchorParams = {\n x: specimen[0], y: specimen[1],\n orientation: (specimen.length >= 4) ? [ specimen[2], specimen[3] ] : [0, 0],\n offsets: (specimen.length >= 6) ? [ specimen[4], specimen[5] ] : [ 0, 0 ],\n elementId: elementId,\n jsPlumbInstance: _currentInstance,\n cssClass: specimen.length === 7 ? specimen[6] : null\n };\n newAnchor = new root.jsPlumb.Anchor(anchorParams);\n newAnchor.clone = function () {\n return new root.jsPlumb.Anchor(anchorParams);\n };\n }\n }\n\n if (!newAnchor.id) {\n newAnchor.id = \"anchor_\" + _idstamp();\n }\n return newAnchor;\n };\n\n /**\n * makes a list of anchors from the given list of types or coords, eg\n * [\"TopCenter\", \"RightMiddle\", \"BottomCenter\", [0, 1, -1, -1] ]\n */\n this.makeAnchors = function (types, elementId, jsPlumbInstance) {\n var r = [];\n for (var i = 0, ii = types.length; i < ii; i++) {\n if (typeof types[i] === \"string\") {\n r.push(root.jsPlumb.Anchors[types[i]]({elementId: elementId, jsPlumbInstance: jsPlumbInstance}));\n }\n else if (_ju.isArray(types[i])) {\n r.push(_currentInstance.makeAnchor(types[i], elementId, jsPlumbInstance));\n }\n }\n return r;\n };\n\n /**\n * Makes a dynamic anchor from the given list of anchors (which may be in shorthand notation as strings or dimension arrays, or Anchor\n * objects themselves) and the given, optional, anchorSelector function (jsPlumb uses a default if this is not provided; most people will\n * not need to provide this - i think).\n */\n this.makeDynamicAnchor = function (anchors, anchorSelector) {\n return new root.jsPlumb.DynamicAnchor({anchors: anchors, selector: anchorSelector, elementId: null, jsPlumbInstance: _currentInstance});\n };\n\n// --------------------- makeSource/makeTarget ----------------------------------------------\n\n this.targetEndpointDefinitions = {};\n this.sourceEndpointDefinitions = {};\n\n var selectorFilter = function (evt, _el, selector, _instance, negate) {\n var t = evt.target || evt.srcElement, ok = false,\n sel = _instance.getSelector(_el, selector);\n for (var j = 0; j < sel.length; j++) {\n if (sel[j] === t) {\n ok = true;\n break;\n }\n }\n return negate ? !ok : ok;\n };\n\n var _makeElementDropHandler = function (elInfo, p, dropOptions, isSource, isTarget) {\n var proxyComponent = new jsPlumbUIComponent(p);\n var _drop = p._jsPlumb.EndpointDropHandler({\n jsPlumb: _currentInstance,\n enabled: function () {\n return elInfo.def.enabled;\n },\n isFull: function () {\n var targetCount = _currentInstance.select({target: elInfo.id}).length;\n return elInfo.def.maxConnections > 0 && targetCount >= elInfo.def.maxConnections;\n },\n element: elInfo.el,\n elementId: elInfo.id,\n isSource: isSource,\n isTarget: isTarget,\n addClass: function (clazz) {\n _currentInstance.addClass(elInfo.el, clazz);\n },\n removeClass: function (clazz) {\n _currentInstance.removeClass(elInfo.el, clazz);\n },\n onDrop: function (jpc) {\n var source = jpc.endpoints[0];\n source.anchor.unlock();\n },\n isDropAllowed: function () {\n return proxyComponent.isDropAllowed.apply(proxyComponent, arguments);\n },\n isRedrop:function(jpc) {\n return (jpc.suspendedElement != null && jpc.suspendedEndpoint != null && jpc.suspendedEndpoint.element === elInfo.el);\n },\n getEndpoint: function (jpc) {\n\n // make a new Endpoint for the target, or get it from the cache if uniqueEndpoint\n // is set. if its a redrop the new endpoint will be immediately cleaned up.\n\n var newEndpoint = elInfo.def.endpoint;\n\n // if no cached endpoint, or there was one but it has been cleaned up\n // (ie. detached), create a new one\n if (newEndpoint == null || newEndpoint._jsPlumb == null) {\n var eps = _currentInstance.deriveEndpointAndAnchorSpec(jpc.getType().join(\" \"), true);\n var pp = eps.endpoints ? root.jsPlumb.extend(p, {\n endpoint:elInfo.def.def.endpoint || eps.endpoints[1]\n }) :p;\n if (eps.anchors) {\n pp = root.jsPlumb.extend(pp, {\n anchor:elInfo.def.def.anchor || eps.anchors[1]\n });\n }\n newEndpoint = _currentInstance.addEndpoint(elInfo.el, pp);\n newEndpoint._mtNew = true;\n }\n\n if (p.uniqueEndpoint) {\n elInfo.def.endpoint = newEndpoint;\n }\n\n newEndpoint.setDeleteOnEmpty(true);\n\n // if connection is detachable, init the new endpoint to be draggable, to support that happening.\n if (jpc.isDetachable()) {\n newEndpoint.initDraggable();\n }\n\n // if the anchor has a 'positionFinder' set, then delegate to that function to find\n // out where to locate the anchor.\n if (newEndpoint.anchor.positionFinder != null) {\n var dropPosition = _currentInstance.getUIPosition(arguments, _currentInstance.getZoom()),\n elPosition = _currentInstance.getOffset(elInfo.el),\n elSize = _currentInstance.getSize(elInfo.el),\n ap = dropPosition == null ? [0,0] : newEndpoint.anchor.positionFinder(dropPosition, elPosition, elSize, newEndpoint.anchor.constructorParams);\n\n newEndpoint.anchor.x = ap[0];\n newEndpoint.anchor.y = ap[1];\n // now figure an orientation for it..kind of hard to know what to do actually. probably the best thing i can do is to\n // support specifying an orientation in the anchor's spec. if one is not supplied then i will make the orientation\n // be what will cause the most natural link to the source: it will be pointing at the source, but it needs to be\n // specified in one axis only, and so how to make that choice? i think i will use whichever axis is the one in which\n // the target is furthest away from the source.\n }\n\n return newEndpoint;\n },\n maybeCleanup: function (ep) {\n if (ep._mtNew && ep.connections.length === 0) {\n _currentInstance.deleteObject({endpoint: ep});\n }\n else {\n delete ep._mtNew;\n }\n }\n });\n\n // wrap drop events as needed and initialise droppable\n var dropEvent = root.jsPlumb.dragEvents.drop;\n dropOptions.scope = dropOptions.scope || (p.scope || _currentInstance.Defaults.Scope);\n dropOptions[dropEvent] = _ju.wrap(dropOptions[dropEvent], _drop, true);\n dropOptions.rank = p.rank || 0;\n\n // if target, return true from the over event. this will cause katavorio to stop setting drops to hover\n // if multipleDrop is set to false.\n if (isTarget) {\n dropOptions[root.jsPlumb.dragEvents.over] = function () { return true; };\n }\n\n // vanilla jsplumb only\n if (p.allowLoopback === false) {\n dropOptions.canDrop = function (_drag) {\n var de = _drag.getDragElement()._jsPlumbRelatedElement;\n return de !== elInfo.el;\n };\n }\n _currentInstance.initDroppable(elInfo.el, dropOptions, \"internal\");\n\n return _drop;\n\n };\n\n // see API docs\n this.makeTarget = function (el, params, referenceParams) {\n\n // put jsplumb ref into params without altering the params passed in\n var p = root.jsPlumb.extend({_jsPlumb: this}, referenceParams);\n root.jsPlumb.extend(p, params);\n\n var maxConnections = p.maxConnections || -1,\n\n _doOne = function (el) {\n\n // get the element's id and store the endpoint definition for it. jsPlumb.connect calls will look for one of these,\n // and use the endpoint definition if found.\n // decode the info for this element (id and element)\n var elInfo = _info(el),\n elid = elInfo.id,\n dropOptions = root.jsPlumb.extend({}, p.dropOptions || {}),\n type = p.connectionType || \"default\";\n\n this.targetEndpointDefinitions[elid] = this.targetEndpointDefinitions[elid] || {};\n\n _ensureContainer(elid);\n\n // if this is a group and the user has not mandated a rank, set to -1 so that Nodes takes\n // precedence.\n if (elInfo.el._isJsPlumbGroup && dropOptions.rank == null) {\n dropOptions.rank = -1;\n }\n\n // store the definition\n var _def = {\n def: root.jsPlumb.extend({}, p),\n uniqueEndpoint: p.uniqueEndpoint,\n maxConnections: maxConnections,\n enabled: true\n };\n\n if (p.createEndpoint) {\n _def.uniqueEndpoint = true;\n _def.endpoint = _currentInstance.addEndpoint(el, _def.def);\n _def.endpoint.setDeleteOnEmpty(false);\n }\n\n elInfo.def = _def;\n this.targetEndpointDefinitions[elid][type] = _def;\n _makeElementDropHandler(elInfo, p, dropOptions, p.isSource === true, true);\n // stash the definition on the drop\n elInfo.el._katavorioDrop[elInfo.el._katavorioDrop.length - 1].targetDef = _def;\n\n }.bind(this);\n\n // make an array if only given one element\n var inputs = el.length && el.constructor !== String ? el : [ el ];\n\n // register each one in the list.\n for (var i = 0, ii = inputs.length; i < ii; i++) {\n _doOne(inputs[i]);\n }\n\n return this;\n };\n\n // see api docs\n this.unmakeTarget = function (el, doNotClearArrays) {\n var info = _info(el);\n _currentInstance.destroyDroppable(info.el, \"internal\");\n if (!doNotClearArrays) {\n delete this.targetEndpointDefinitions[info.id];\n }\n\n return this;\n };\n\n // see api docs\n this.makeSource = function (el, params, referenceParams) {\n var p = root.jsPlumb.extend({_jsPlumb: this}, referenceParams);\n root.jsPlumb.extend(p, params);\n var type = p.connectionType || \"default\";\n var aae = _currentInstance.deriveEndpointAndAnchorSpec(type);\n p.endpoint = p.endpoint || aae.endpoints[0];\n p.anchor = p.anchor || aae.anchors[0];\n var maxConnections = p.maxConnections || -1,\n onMaxConnections = p.onMaxConnections,\n _doOne = function (elInfo) {\n // get the element's id and store the endpoint definition for it. jsPlumb.connect calls will look for one of these,\n // and use the endpoint definition if found.\n var elid = elInfo.id,\n _del = this.getElement(elInfo.el);\n\n this.sourceEndpointDefinitions[elid] = this.sourceEndpointDefinitions[elid] || {};\n _ensureContainer(elid);\n\n var _def = {\n def:root.jsPlumb.extend({}, p),\n uniqueEndpoint: p.uniqueEndpoint,\n maxConnections: maxConnections,\n enabled: true\n };\n\n if (p.createEndpoint) {\n _def.uniqueEndpoint = true;\n _def.endpoint = _currentInstance.addEndpoint(el, _def.def);\n _def.endpoint.setDeleteOnEmpty(false);\n }\n\n this.sourceEndpointDefinitions[elid][type] = _def;\n elInfo.def = _def;\n\n var stopEvent = root.jsPlumb.dragEvents.stop,\n dragEvent = root.jsPlumb.dragEvents.drag,\n dragOptions = root.jsPlumb.extend({ }, p.dragOptions || {}),\n existingDrag = dragOptions.drag,\n existingStop = dragOptions.stop,\n ep = null,\n endpointAddedButNoDragYet = false;\n\n // set scope if its not set in dragOptions but was passed in in params\n dragOptions.scope = dragOptions.scope || p.scope;\n\n dragOptions[dragEvent] = _ju.wrap(dragOptions[dragEvent], function () {\n if (existingDrag) {\n existingDrag.apply(this, arguments);\n }\n endpointAddedButNoDragYet = false;\n });\n\n dragOptions[stopEvent] = _ju.wrap(dragOptions[stopEvent], function () {\n\n if (existingStop) {\n existingStop.apply(this, arguments);\n }\n this.currentlyDragging = false;\n if (ep._jsPlumb != null) { // if not cleaned up...\n\n // reset the anchor to the anchor that was initially provided. the one we were using to drag\n // the connection was just a placeholder that was located at the place the user pressed the\n // mouse button to initiate the drag.\n var anchorDef = p.anchor || this.Defaults.Anchor,\n oldAnchor = ep.anchor,\n oldConnection = ep.connections[0];\n\n var newAnchor = this.makeAnchor(anchorDef, elid, this),\n _el = ep.element;\n\n // if the anchor has a 'positionFinder' set, then delegate to that function to find\n // out where to locate the anchor. issue 117.\n if (newAnchor.positionFinder != null) {\n var elPosition = _currentInstance.getOffset(_el),\n elSize = this.getSize(_el),\n dropPosition = { left: elPosition.left + (oldAnchor.x * elSize[0]), top: elPosition.top + (oldAnchor.y * elSize[1]) },\n ap = newAnchor.positionFinder(dropPosition, elPosition, elSize, newAnchor.constructorParams);\n\n newAnchor.x = ap[0];\n newAnchor.y = ap[1];\n }\n\n ep.setAnchor(newAnchor, true);\n ep.repaint();\n this.repaint(ep.elementId);\n if (oldConnection != null) {\n this.repaint(oldConnection.targetId);\n }\n }\n }.bind(this));\n\n // when the user presses the mouse, add an Endpoint, if we are enabled.\n var mouseDownListener = function (e) {\n // on right mouse button, abort.\n if (e.which === 3 || e.button === 2) {\n return;\n }\n\n // TODO store def on element.\n var def = this.sourceEndpointDefinitions[elid][type];\n\n // if disabled, return.\n if (!def.enabled) {\n return;\n }\n\n elid = this.getId(this.getElement(elInfo.el)); // elid might have changed since this method was called to configure the element.\n\n // if a filter was given, run it, and return if it says no.\n if (p.filter) {\n var r = _ju.isString(p.filter) ? selectorFilter(e, elInfo.el, p.filter, this, p.filterExclude) : p.filter(e, elInfo.el);\n if (r === false) {\n return;\n }\n }\n\n // if maxConnections reached\n var sourceCount = this.select({source: elid}).length;\n if (def.maxConnections >= 0 && (sourceCount >= def.maxConnections)) {\n if (onMaxConnections) {\n onMaxConnections({\n element: elInfo.el,\n maxConnections: maxConnections\n }, e);\n }\n return false;\n }\n\n // find the position on the element at which the mouse was pressed; this is where the endpoint\n // will be located.\n var elxy = root.jsPlumb.getPositionOnElement(e, _del, _zoom);\n\n // we need to override the anchor in here, and force 'isSource', but we don't want to mess with\n // the params passed in, because after a connection is established we're going to reset the endpoint\n // to have the anchor we were given.\n var tempEndpointParams = {};\n root.jsPlumb.extend(tempEndpointParams, p);\n tempEndpointParams.isTemporarySource = true;\n tempEndpointParams.anchor = [ elxy[0], elxy[1] , 0, 0];\n tempEndpointParams.dragOptions = dragOptions;\n\n if (def.def.scope) {\n tempEndpointParams.scope = def.def.scope;\n }\n\n ep = this.addEndpoint(elid, tempEndpointParams);\n endpointAddedButNoDragYet = true;\n ep.setDeleteOnEmpty(true);\n\n // if unique endpoint and it's already been created, push it onto the endpoint we create. at the end\n // of a successful connection we'll switch to that endpoint.\n // TODO this is the same code as the programmatic endpoints create on line 1050 ish\n if (def.uniqueEndpoint) {\n if (!def.endpoint) {\n def.endpoint = ep;\n ep.setDeleteOnEmpty(false);\n }\n else {\n ep.finalEndpoint = def.endpoint;\n }\n }\n\n var _delTempEndpoint = function () {\n // this mouseup event is fired only if no dragging occurred, by jquery and yui, but for mootools\n // it is fired even if dragging has occurred, in which case we would blow away a perfectly\n // legitimate endpoint, were it not for this check. the flag is set after adding an\n // endpoint and cleared in a drag listener we set in the dragOptions above.\n _currentInstance.off(ep.canvas, \"mouseup\", _delTempEndpoint);\n _currentInstance.off(elInfo.el, \"mouseup\", _delTempEndpoint);\n if (endpointAddedButNoDragYet) {\n endpointAddedButNoDragYet = false;\n _currentInstance.deleteEndpoint(ep);\n }\n };\n\n _currentInstance.on(ep.canvas, \"mouseup\", _delTempEndpoint);\n _currentInstance.on(elInfo.el, \"mouseup\", _delTempEndpoint);\n\n // optionally check for attributes to extract from the source element\n var payload = {};\n if (def.def.extract) {\n for (var att in def.def.extract) {\n var v = (e.srcElement || e.target).getAttribute(att);\n if (v) {\n payload[def.def.extract[att]] = v;\n }\n }\n }\n\n // and then trigger its mousedown event, which will kick off a drag, which will start dragging\n // a new connection from this endpoint.\n _currentInstance.trigger(ep.canvas, \"mousedown\", e, payload);\n\n _ju.consume(e);\n\n }.bind(this);\n\n this.on(elInfo.el, \"mousedown\", mouseDownListener);\n _def.trigger = mouseDownListener;\n\n // if a filter was provided, set it as a dragFilter on the element,\n // to prevent the element drag function from kicking in when we want to\n // drag a new connection\n if (p.filter && (_ju.isString(p.filter) || _ju.isFunction(p.filter))) {\n _currentInstance.setDragFilter(elInfo.el, p.filter);\n }\n\n var dropOptions = root.jsPlumb.extend({}, p.dropOptions || {});\n\n _makeElementDropHandler(elInfo, p, dropOptions, true, p.isTarget === true);\n\n }.bind(this);\n\n var inputs = el.length && el.constructor !== String ? el : [ el ];\n for (var i = 0, ii = inputs.length; i < ii; i++) {\n _doOne(_info(inputs[i]));\n }\n\n return this;\n };\n\n // see api docs\n this.unmakeSource = function (el, connectionType, doNotClearArrays) {\n var info = _info(el);\n _currentInstance.destroyDroppable(info.el, \"internal\");\n var eldefs = this.sourceEndpointDefinitions[info.id];\n if (eldefs) {\n for (var def in eldefs) {\n if (connectionType == null || connectionType === def) {\n var mouseDownListener = eldefs[def].trigger;\n if (mouseDownListener) {\n _currentInstance.off(info.el, \"mousedown\", mouseDownListener);\n }\n if (!doNotClearArrays) {\n delete this.sourceEndpointDefinitions[info.id][def];\n }\n }\n }\n }\n\n return this;\n };\n\n // see api docs\n this.unmakeEverySource = function () {\n for (var i in this.sourceEndpointDefinitions) {\n _currentInstance.unmakeSource(i, null, true);\n }\n\n this.sourceEndpointDefinitions = {};\n return this;\n };\n\n var _getScope = function (el, types, connectionType) {\n types = _ju.isArray(types) ? types : [ types ];\n var id = _getId(el);\n connectionType = connectionType || \"default\";\n for (var i = 0; i < types.length; i++) {\n var eldefs = this[types[i]][id];\n if (eldefs && eldefs[connectionType]) {\n return eldefs[connectionType].def.scope || this.Defaults.Scope;\n }\n }\n }.bind(this);\n\n var _setScope = function (el, scope, types, connectionType) {\n types = _ju.isArray(types) ? types : [ types ];\n var id = _getId(el);\n connectionType = connectionType || \"default\";\n for (var i = 0; i < types.length; i++) {\n var eldefs = this[types[i]][id];\n if (eldefs && eldefs[connectionType]) {\n eldefs[connectionType].def.scope = scope;\n }\n }\n\n }.bind(this);\n\n this.getScope = function (el, scope) {\n return _getScope(el, [ \"sourceEndpointDefinitions\", \"targetEndpointDefinitions\" ]);\n };\n this.getSourceScope = function (el) {\n return _getScope(el, \"sourceEndpointDefinitions\");\n };\n this.getTargetScope = function (el) {\n return _getScope(el, \"targetEndpointDefinitions\");\n };\n this.setScope = function (el, scope, connectionType) {\n this.setSourceScope(el, scope, connectionType);\n this.setTargetScope(el, scope, connectionType);\n };\n this.setSourceScope = function (el, scope, connectionType) {\n _setScope(el, scope, \"sourceEndpointDefinitions\", connectionType);\n // we get the source scope during the mousedown event, but we also want to set this.\n this.setDragScope(el, scope);\n };\n this.setTargetScope = function (el, scope, connectionType) {\n _setScope(el, scope, \"targetEndpointDefinitions\", connectionType);\n this.setDropScope(el, scope);\n };\n\n // see api docs\n this.unmakeEveryTarget = function () {\n for (var i in this.targetEndpointDefinitions) {\n _currentInstance.unmakeTarget(i, true);\n }\n\n this.targetEndpointDefinitions = {};\n return this;\n };\n\n // does the work of setting a source enabled or disabled.\n var _setEnabled = function (type, el, state, toggle, connectionType) {\n var a = type === \"source\" ? this.sourceEndpointDefinitions : this.targetEndpointDefinitions,\n originalState, info, newState;\n\n connectionType = connectionType || \"default\";\n\n // a selector or an array\n if (el.length && !_ju.isString(el)) {\n originalState = [];\n for (var i = 0, ii = el.length; i < ii; i++) {\n info = _info(el[i]);\n if (a[info.id] && a[info.id][connectionType]) {\n originalState[i] = a[info.id][connectionType].enabled;\n newState = toggle ? !originalState[i] : state;\n a[info.id][connectionType].enabled = newState;\n _currentInstance[newState ? \"removeClass\" : \"addClass\"](info.el, \"jtk-\" + type + \"-disabled\");\n }\n }\n }\n // otherwise a DOM element or a String ID.\n else {\n info = _info(el);\n var id = info.id;\n if (a[id] && a[id][connectionType]) {\n originalState = a[id][connectionType].enabled;\n newState = toggle ? !originalState : state;\n a[id][connectionType].enabled = newState;\n _currentInstance[newState ? \"removeClass\" : \"addClass\"](info.el, \"jtk-\" + type + \"-disabled\");\n }\n }\n return originalState;\n }.bind(this);\n\n var _first = function (el, fn) {\n if (_ju.isString(el) || !el.length) {\n return fn.apply(this, [ el ]);\n }\n else if (el.length) {\n return fn.apply(this, [ el[0] ]);\n }\n\n }.bind(this);\n\n this.toggleSourceEnabled = function (el, connectionType) {\n _setEnabled(\"source\", el, null, true, connectionType);\n return this.isSourceEnabled(el, connectionType);\n };\n\n this.setSourceEnabled = function (el, state, connectionType) {\n return _setEnabled(\"source\", el, state, null, connectionType);\n };\n this.isSource = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var eldefs = this.sourceEndpointDefinitions[_info(_el).id];\n return eldefs != null && eldefs[connectionType] != null;\n }.bind(this));\n };\n this.isSourceEnabled = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var sep = this.sourceEndpointDefinitions[_info(_el).id];\n return sep && sep[connectionType] && sep[connectionType].enabled === true;\n }.bind(this));\n };\n\n this.toggleTargetEnabled = function (el, connectionType) {\n _setEnabled(\"target\", el, null, true, connectionType);\n return this.isTargetEnabled(el, connectionType);\n };\n\n this.isTarget = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var eldefs = this.targetEndpointDefinitions[_info(_el).id];\n return eldefs != null && eldefs[connectionType] != null;\n }.bind(this));\n };\n this.isTargetEnabled = function (el, connectionType) {\n connectionType = connectionType || \"default\";\n return _first(el, function (_el) {\n var tep = this.targetEndpointDefinitions[_info(_el).id];\n return tep && tep[connectionType] && tep[connectionType].enabled === true;\n }.bind(this));\n };\n this.setTargetEnabled = function (el, state, connectionType) {\n return _setEnabled(\"target\", el, state, null, connectionType);\n };\n\n// --------------------- end makeSource/makeTarget ----------------------------------------------\n\n this.ready = function (fn) {\n _currentInstance.bind(\"ready\", fn);\n };\n\n var _elEach = function(el, fn) {\n // support both lists...\n if (typeof el === 'object' && el.length) {\n for (var i = 0, ii = el.length; i < ii; i++) {\n fn(el[i]);\n }\n }\n else {// ...and single strings or elements.\n fn(el);\n }\n\n return _currentInstance;\n };\n\n // repaint some element's endpoints and connections\n this.repaint = function (el, ui, timestamp) {\n return _elEach(el, function(_el) {\n _draw(_el, ui, timestamp);\n });\n };\n\n this.revalidate = function (el, timestamp, isIdAlready) {\n return _elEach(el, function(_el) {\n var elId = isIdAlready ? _el : _currentInstance.getId(_el);\n _currentInstance.updateOffset({ elId: elId, recalc: true, timestamp:timestamp });\n var dm = _currentInstance.getDragManager();\n if (dm) {\n dm.updateOffsets(elId);\n }\n _currentInstance.repaint(_el);\n });\n };\n\n // repaint every endpoint and connection.\n this.repaintEverything = function () {\n // TODO this timestamp causes continuous anchors to not repaint properly.\n // fix this. do not just take out the timestamp. it runs a lot faster with\n // the timestamp included.\n var timestamp = _timestamp(), elId;\n\n for (elId in endpointsByElement) {\n _currentInstance.updateOffset({ elId: elId, recalc: true, timestamp: timestamp });\n }\n\n for (elId in endpointsByElement) {\n _draw(elId, null, timestamp);\n }\n\n return this;\n };\n\n this.removeAllEndpoints = function (el, recurse, affectedElements) {\n affectedElements = affectedElements || [];\n var _one = function (_el) {\n var info = _info(_el),\n ebe = endpointsByElement[info.id],\n i, ii;\n\n if (ebe) {\n affectedElements.push(info);\n for (i = 0, ii = ebe.length; i < ii; i++) {\n _currentInstance.deleteEndpoint(ebe[i], false);\n }\n }\n delete endpointsByElement[info.id];\n\n if (recurse) {\n if (info.el && info.el.nodeType !== 3 && info.el.nodeType !== 8) {\n for (i = 0, ii = info.el.childNodes.length; i < ii; i++) {\n _one(info.el.childNodes[i]);\n }\n }\n }\n\n };\n _one(el);\n return this;\n };\n\n var _doRemove = function(info, affectedElements) {\n _currentInstance.removeAllEndpoints(info.id, true, affectedElements);\n var dm = _currentInstance.getDragManager();\n var _one = function(_info) {\n\n if (dm) {\n dm.elementRemoved(_info.id);\n }\n _currentInstance.anchorManager.clearFor(_info.id);\n _currentInstance.anchorManager.removeFloatingConnection(_info.id);\n\n if (_currentInstance.isSource(_info.el)) {\n _currentInstance.unmakeSource(_info.el);\n }\n if (_currentInstance.isTarget(_info.el)) {\n _currentInstance.unmakeTarget(_info.el);\n }\n _currentInstance.destroyDraggable(_info.el);\n _currentInstance.destroyDroppable(_info.el);\n\n\n delete _currentInstance.floatingConnections[_info.id];\n delete managedElements[_info.id];\n delete offsets[_info.id];\n if (_info.el) {\n _currentInstance.removeElement(_info.el);\n _info.el._jsPlumb = null;\n }\n };\n\n // remove all affected child elements\n for (var ae = 1; ae < affectedElements.length; ae++) {\n _one(affectedElements[ae]);\n }\n // and always remove the requested one from the dom.\n _one(info);\n };\n\n /**\n * Remove the given element, including cleaning up all endpoints registered for it.\n * This is exposed in the public API but also used internally by jsPlumb when removing the\n * element associated with a connection drag.\n */\n this.remove = function (el, doNotRepaint) {\n var info = _info(el), affectedElements = [];\n if (info.text) {\n info.el.parentNode.removeChild(info.el);\n }\n else if (info.id) {\n _currentInstance.batch(function () {\n _doRemove(info, affectedElements);\n }, doNotRepaint === true);\n }\n return _currentInstance;\n };\n\n this.empty = function (el, doNotRepaint) {\n var affectedElements = [];\n var _one = function(el, dontRemoveFocus) {\n var info = _info(el);\n if (info.text) {\n info.el.parentNode.removeChild(info.el);\n }\n else if (info.el) {\n while(info.el.childNodes.length > 0) {\n _one(info.el.childNodes[0]);\n }\n if (!dontRemoveFocus) {\n _doRemove(info, affectedElements);\n }\n }\n };\n\n _currentInstance.batch(function() {\n _one(el, true);\n }, doNotRepaint === false);\n\n return _currentInstance;\n };\n\n this.reset = function (doNotUnbindInstanceEventListeners) {\n _currentInstance.silently(function() {\n _hoverSuspended = false;\n _currentInstance.removeAllGroups();\n _currentInstance.removeGroupManager();\n _currentInstance.deleteEveryEndpoint();\n if (!doNotUnbindInstanceEventListeners) {\n _currentInstance.unbind();\n }\n this.targetEndpointDefinitions = {};\n this.sourceEndpointDefinitions = {};\n connections.length = 0;\n if (this.doReset) {\n this.doReset();\n }\n }.bind(this));\n };\n\n var _clearObject = function (obj) {\n if (obj.canvas && obj.canvas.parentNode) {\n obj.canvas.parentNode.removeChild(obj.canvas);\n }\n obj.cleanup();\n obj.destroy();\n };\n\n this.clear = function () {\n _currentInstance.select().each(_clearObject);\n _currentInstance.selectEndpoints().each(_clearObject);\n\n endpointsByElement = {};\n endpointsByUUID = {};\n };\n\n this.setDefaultScope = function (scope) {\n DEFAULT_SCOPE = scope;\n return _currentInstance;\n };\n\n this.deriveEndpointAndAnchorSpec = function(type, dontPrependDefault) {\n var bits = ((dontPrependDefault ? \"\" : \"default \") + type).split(/[\\s]/), eps = null, ep = null, a = null, as = null;\n for (var i = 0; i < bits.length; i++) {\n var _t = _currentInstance.getType(bits[i], \"connection\");\n if (_t) {\n if (_t.endpoints) {\n eps = _t.endpoints;\n }\n if (_t.endpoint) {\n ep = _t.endpoint;\n }\n if (_t.anchors) {\n as = _t.anchors;\n }\n if (_t.anchor) {\n a = _t.anchor;\n }\n }\n }\n return { endpoints: eps ? eps : [ ep, ep ], anchors: as ? as : [a, a ]};\n };\n\n // sets the id of some element, changing whatever we need to to keep track.\n this.setId = function (el, newId, doNotSetAttribute) {\n //\n var id;\n\n if (_ju.isString(el)) {\n id = el;\n }\n else {\n el = this.getElement(el);\n id = this.getId(el);\n }\n\n var sConns = this.getConnections({source: id, scope: '*'}, true),\n tConns = this.getConnections({target: id, scope: '*'}, true);\n\n newId = \"\" + newId;\n\n if (!doNotSetAttribute) {\n el = this.getElement(id);\n this.setAttribute(el, \"id\", newId);\n }\n else {\n el = this.getElement(newId);\n }\n\n endpointsByElement[newId] = endpointsByElement[id] || [];\n for (var i = 0, ii = endpointsByElement[newId].length; i < ii; i++) {\n endpointsByElement[newId][i].setElementId(newId);\n endpointsByElement[newId][i].setReferenceElement(el);\n }\n delete endpointsByElement[id];\n\n this.sourceEndpointDefinitions[newId] = this.sourceEndpointDefinitions[id];\n delete this.sourceEndpointDefinitions[id];\n this.targetEndpointDefinitions[newId] = this.targetEndpointDefinitions[id];\n delete this.targetEndpointDefinitions[id];\n\n this.anchorManager.changeId(id, newId);\n var dm = this.getDragManager();\n if (dm) {\n dm.changeId(id, newId);\n }\n managedElements[newId] = managedElements[id];\n delete managedElements[id];\n\n var _conns = function (list, epIdx, type) {\n for (var i = 0, ii = list.length; i < ii; i++) {\n list[i].endpoints[epIdx].setElementId(newId);\n list[i].endpoints[epIdx].setReferenceElement(el);\n list[i][type + \"Id\"] = newId;\n list[i][type] = el;\n }\n };\n _conns(sConns, 0, \"source\");\n _conns(tConns, 1, \"target\");\n\n this.repaint(newId);\n };\n\n this.setDebugLog = function (debugLog) {\n log = debugLog;\n };\n\n this.setSuspendDrawing = function (val, repaintAfterwards) {\n var curVal = _suspendDrawing;\n _suspendDrawing = val;\n if (val) {\n _suspendedAt = new Date().getTime();\n } else {\n _suspendedAt = null;\n }\n if (repaintAfterwards) {\n this.repaintEverything();\n }\n return curVal;\n };\n\n // returns whether or not drawing is currently suspended.\n this.isSuspendDrawing = function () {\n return _suspendDrawing;\n };\n\n // return timestamp for when drawing was suspended.\n this.getSuspendedAt = function () {\n return _suspendedAt;\n };\n\n this.batch = function (fn, doNotRepaintAfterwards) {\n var _wasSuspended = this.isSuspendDrawing();\n if (!_wasSuspended) {\n this.setSuspendDrawing(true);\n }\n try {\n fn();\n }\n catch (e) {\n _ju.log(\"Function run while suspended failed\", e);\n }\n if (!_wasSuspended) {\n this.setSuspendDrawing(false, !doNotRepaintAfterwards);\n }\n };\n\n this.doWhileSuspended = this.batch;\n\n this.getCachedData = _getCachedData;\n this.timestamp = _timestamp;\n this.show = function (el, changeEndpoints) {\n _setVisible(el, \"block\", changeEndpoints);\n return _currentInstance;\n };\n\n // TODO: update this method to return the current state.\n this.toggleVisible = _toggleVisible;\n this.addListener = this.bind;\n\n var floatingConnections = [];\n this.registerFloatingConnection = function(info, conn, ep) {\n floatingConnections[info.id] = conn;\n // only register for the target endpoint; we will not be dragging the source at any time\n // before this connection is either discarded or made into a permanent connection.\n _ju.addToList(endpointsByElement, info.id, ep);\n };\n this.getFloatingConnectionFor = function(id) {\n return floatingConnections[id];\n };\n };\n\n _ju.extend(root.jsPlumbInstance, _ju.EventGenerator, {\n setAttribute: function (el, a, v) {\n this.setAttribute(el, a, v);\n },\n getAttribute: function (el, a) {\n return this.getAttribute(root.jsPlumb.getElement(el), a);\n },\n convertToFullOverlaySpec: function(spec) {\n if (_ju.isString(spec)) {\n spec = [ spec, { } ];\n }\n spec[1].id = spec[1].id || _ju.uuid();\n return spec;\n },\n registerConnectionType: function (id, type) {\n this._connectionTypes[id] = root.jsPlumb.extend({}, type);\n if (type.overlays) {\n var to = {};\n for (var i = 0; i < type.overlays.length; i++) {\n // if a string, convert to object representation so that we can store the typeid on it.\n // also assign an id.\n var fo = this.convertToFullOverlaySpec(type.overlays[i]);\n to[fo[1].id] = fo;\n }\n this._connectionTypes[id].overlays = to;\n }\n },\n registerConnectionTypes: function (types) {\n for (var i in types) {\n this.registerConnectionType(i, types[i]);\n }\n },\n registerEndpointType: function (id, type) {\n this._endpointTypes[id] = root.jsPlumb.extend({}, type);\n if (type.overlays) {\n var to = {};\n for (var i = 0; i < type.overlays.length; i++) {\n // if a string, convert to object representation so that we can store the typeid on it.\n // also assign an id.\n var fo = this.convertToFullOverlaySpec(type.overlays[i]);\n to[fo[1].id] = fo;\n }\n this._endpointTypes[id].overlays = to;\n }\n },\n registerEndpointTypes: function (types) {\n for (var i in types) {\n this.registerEndpointType(i, types[i]);\n }\n },\n getType: function (id, typeDescriptor) {\n return typeDescriptor === \"connection\" ? this._connectionTypes[id] : this._endpointTypes[id];\n },\n setIdChanged: function (oldId, newId) {\n this.setId(oldId, newId, true);\n },\n // set parent: change the parent for some node and update all the registrations we need to.\n setParent: function (el, newParent) {\n var _dom = this.getElement(el),\n _id = this.getId(_dom),\n _pdom = this.getElement(newParent),\n _pid = this.getId(_pdom),\n dm = this.getDragManager();\n\n _dom.parentNode.removeChild(_dom);\n _pdom.appendChild(_dom);\n if (dm) {\n dm.setParent(_dom, _id, _pdom, _pid);\n }\n },\n extend: function (o1, o2, names) {\n var i;\n if (names) {\n for (i = 0; i < names.length; i++) {\n o1[names[i]] = o2[names[i]];\n }\n }\n else {\n for (i in o2) {\n o1[i] = o2[i];\n }\n }\n\n return o1;\n },\n floatingConnections: {},\n getFloatingAnchorIndex: function (jpc) {\n return jpc.endpoints[0].isFloating() ? 0 : jpc.endpoints[1].isFloating() ? 1 : -1;\n }\n });\n\n// --------------------- static instance + module registration -------------------------------------------\n\n// create static instance and assign to window if window exists.\n var jsPlumb = new jsPlumbInstance();\n // register on 'root' (lets us run on server or browser)\n root.jsPlumb = jsPlumb;\n // add 'getInstance' method to static instance\n jsPlumb.getInstance = function (_defaults, overrideFns) {\n var j = new jsPlumbInstance(_defaults);\n if (overrideFns) {\n for (var ovf in overrideFns) {\n j[ovf] = overrideFns[ovf];\n }\n }\n j.init();\n return j;\n };\n jsPlumb.each = function (spec, fn) {\n if (spec == null) {\n return;\n }\n if (typeof spec === \"string\") {\n fn(jsPlumb.getElement(spec));\n }\n else if (spec.length != null) {\n for (var i = 0; i < spec.length; i++) {\n fn(jsPlumb.getElement(spec[i]));\n }\n }\n else {\n fn(spec);\n } // assume it's an element.\n };\n\n // CommonJS\n if (typeof exports !== 'undefined') {\n exports.jsPlumb = jsPlumb;\n }\n\n// --------------------- end static instance + AMD registration -------------------------------------------\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function() {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n // ------------------------------ BEGIN OverlayCapablejsPlumbUIComponent --------------------------------------------\n\n var _internalLabelOverlayId = \"__label\",\n // this is a shortcut helper method to let people add a label as\n // overlay.\n _makeLabelOverlay = function (component, params) {\n\n var _params = {\n cssClass: params.cssClass,\n labelStyle: component.labelStyle,\n id: _internalLabelOverlayId,\n component: component,\n _jsPlumb: component._jsPlumb.instance // TODO not necessary, since the instance can be accessed through the component.\n },\n mergedParams = _jp.extend(_params, params);\n\n return new _jp.Overlays[component._jsPlumb.instance.getRenderMode()].Label(mergedParams);\n },\n _processOverlay = function (component, o) {\n var _newOverlay = null;\n if (_ju.isArray(o)) {\t// this is for the shorthand [\"Arrow\", { width:50 }] syntax\n // there's also a three arg version:\n // [\"Arrow\", { width:50 }, {location:0.7}]\n // which merges the 3rd arg into the 2nd.\n var type = o[0],\n // make a copy of the object so as not to mess up anyone else's reference...\n p = _jp.extend({component: component, _jsPlumb: component._jsPlumb.instance}, o[1]);\n if (o.length === 3) {\n _jp.extend(p, o[2]);\n }\n _newOverlay = new _jp.Overlays[component._jsPlumb.instance.getRenderMode()][type](p);\n } else if (o.constructor === String) {\n _newOverlay = new _jp.Overlays[component._jsPlumb.instance.getRenderMode()][o]({component: component, _jsPlumb: component._jsPlumb.instance});\n } else {\n _newOverlay = o;\n }\n\n _newOverlay.id = _newOverlay.id || _ju.uuid();\n component.cacheTypeItem(\"overlay\", _newOverlay, _newOverlay.id);\n component._jsPlumb.overlays[_newOverlay.id] = _newOverlay;\n\n return _newOverlay;\n };\n\n _jp.OverlayCapableJsPlumbUIComponent = function (params) {\n\n root.jsPlumbUIComponent.apply(this, arguments);\n this._jsPlumb.overlays = {};\n this._jsPlumb.overlayPositions = {};\n\n if (params.label) {\n this.getDefaultType().overlays[_internalLabelOverlayId] = [\"Label\", {\n label: params.label,\n location: params.labelLocation || this.defaultLabelLocation || 0.5,\n labelStyle: params.labelStyle || this._jsPlumb.instance.Defaults.LabelStyle,\n id:_internalLabelOverlayId\n }];\n }\n\n this.setListenerComponent = function (c) {\n if (this._jsPlumb) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].setListenerComponent(c);\n }\n }\n };\n };\n\n _jp.OverlayCapableJsPlumbUIComponent.applyType = function (component, t) {\n if (t.overlays) {\n // loop through the ones in the type. if already present on the component,\n // dont remove or re-add.\n var keep = {}, i;\n\n for (i in t.overlays) {\n\n var existing = component._jsPlumb.overlays[t.overlays[i][1].id];\n if (existing) {\n // maybe update from data, if there were parameterised values for instance.\n existing.updateFrom(t.overlays[i][1]);\n keep[t.overlays[i][1].id] = true;\n }\n else {\n var c = component.getCachedTypeItem(\"overlay\", t.overlays[i][1].id);\n if (c != null) {\n c.reattach(component._jsPlumb.instance, component);\n c.setVisible(true);\n // maybe update from data, if there were parameterised values for instance.\n c.updateFrom(t.overlays[i][1]);\n component._jsPlumb.overlays[c.id] = c;\n }\n else {\n c = component.addOverlay(t.overlays[i], true);\n }\n keep[c.id] = true;\n }\n }\n\n // now loop through the full overlays and remove those that we dont want to keep\n for (i in component._jsPlumb.overlays) {\n if (keep[component._jsPlumb.overlays[i].id] == null) {\n component.removeOverlay(component._jsPlumb.overlays[i].id, true); // remove overlay but dont clean it up.\n // that would remove event listeners etc; overlays are never discarded by the types stuff, they are\n // just detached/reattached.\n }\n }\n }\n };\n\n _ju.extend(_jp.OverlayCapableJsPlumbUIComponent, root.jsPlumbUIComponent, {\n\n setHover: function (hover, ignoreAttachedElements) {\n if (this._jsPlumb && !this._jsPlumb.instance.isConnectionBeingDragged()) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i][hover ? \"addClass\" : \"removeClass\"](this._jsPlumb.instance.hoverClass);\n }\n }\n },\n addOverlay: function (overlay, doNotRepaint) {\n var o = _processOverlay(this, overlay);\n if (!doNotRepaint) {\n this.repaint();\n }\n return o;\n },\n getOverlay: function (id) {\n return this._jsPlumb.overlays[id];\n },\n getOverlays: function () {\n return this._jsPlumb.overlays;\n },\n hideOverlay: function (id) {\n var o = this.getOverlay(id);\n if (o) {\n o.hide();\n }\n },\n hideOverlays: function () {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].hide();\n }\n },\n showOverlay: function (id) {\n var o = this.getOverlay(id);\n if (o) {\n o.show();\n }\n },\n showOverlays: function () {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].show();\n }\n },\n removeAllOverlays: function (doNotRepaint) {\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays[i].cleanup) {\n this._jsPlumb.overlays[i].cleanup();\n }\n }\n\n this._jsPlumb.overlays = {};\n this._jsPlumb.overlayPositions = null;\n this._jsPlumb.overlayPlacements= {};\n if (!doNotRepaint) {\n this.repaint();\n }\n },\n removeOverlay: function (overlayId, dontCleanup) {\n var o = this._jsPlumb.overlays[overlayId];\n if (o) {\n o.setVisible(false);\n if (!dontCleanup && o.cleanup) {\n o.cleanup();\n }\n delete this._jsPlumb.overlays[overlayId];\n if (this._jsPlumb.overlayPositions) {\n delete this._jsPlumb.overlayPositions[overlayId];\n }\n\n if (this._jsPlumb.overlayPlacements) {\n delete this._jsPlumb.overlayPlacements[overlayId];\n }\n }\n },\n removeOverlays: function () {\n for (var i = 0, j = arguments.length; i < j; i++) {\n this.removeOverlay(arguments[i]);\n }\n },\n moveParent: function (newParent) {\n if (this.bgCanvas) {\n this.bgCanvas.parentNode.removeChild(this.bgCanvas);\n newParent.appendChild(this.bgCanvas);\n }\n\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n newParent.appendChild(this.canvas);\n\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays[i].isAppendedAtTopLevel) {\n var el = this._jsPlumb.overlays[i].getElement();\n el.parentNode.removeChild(el);\n newParent.appendChild(el);\n }\n }\n }\n },\n getLabel: function () {\n var lo = this.getOverlay(_internalLabelOverlayId);\n return lo != null ? lo.getLabel() : null;\n },\n getLabelOverlay: function () {\n return this.getOverlay(_internalLabelOverlayId);\n },\n setLabel: function (l) {\n var lo = this.getOverlay(_internalLabelOverlayId);\n if (!lo) {\n var params = l.constructor === String || l.constructor === Function ? { label: l } : l;\n lo = _makeLabelOverlay(this, params);\n this._jsPlumb.overlays[_internalLabelOverlayId] = lo;\n }\n else {\n if (l.constructor === String || l.constructor === Function) {\n lo.setLabel(l);\n }\n else {\n if (l.label) {\n lo.setLabel(l.label);\n }\n if (l.location) {\n lo.setLocation(l.location);\n }\n }\n }\n\n if (!this._jsPlumb.instance.isSuspendDrawing()) {\n this.repaint();\n }\n },\n cleanup: function (force) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i].cleanup(force);\n this._jsPlumb.overlays[i].destroy(force);\n }\n if (force) {\n this._jsPlumb.overlays = {};\n this._jsPlumb.overlayPositions = null;\n }\n },\n setVisible: function (v) {\n this[v ? \"showOverlays\" : \"hideOverlays\"]();\n },\n setAbsoluteOverlayPosition: function (overlay, xy) {\n this._jsPlumb.overlayPositions[overlay.id] = xy;\n },\n getAbsoluteOverlayPosition: function (overlay) {\n return this._jsPlumb.overlayPositions ? this._jsPlumb.overlayPositions[overlay.id] : null;\n },\n _clazzManip:function(action, clazz, dontUpdateOverlays) {\n if (!dontUpdateOverlays) {\n for (var i in this._jsPlumb.overlays) {\n this._jsPlumb.overlays[i][action + \"Class\"](clazz);\n }\n }\n },\n addClass:function(clazz, dontUpdateOverlays) {\n this._clazzManip(\"add\", clazz, dontUpdateOverlays);\n },\n removeClass:function(clazz, dontUpdateOverlays) {\n this._clazzManip(\"remove\", clazz, dontUpdateOverlays);\n }\n });\n\n// ------------------------------ END OverlayCapablejsPlumbUIComponent --------------------------------------------\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the code for Endpoints.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n * \n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n // create the drag handler for a connection\n var _makeConnectionDragHandler = function (endpoint, placeholder, _jsPlumb) {\n var stopped = false;\n return {\n drag: function () {\n if (stopped) {\n stopped = false;\n return true;\n }\n\n if (placeholder.element) {\n var _ui = _jsPlumb.getUIPosition(arguments, _jsPlumb.getZoom());\n if (_ui != null) {\n _jsPlumb.setPosition(placeholder.element, _ui);\n }\n _jsPlumb.repaint(placeholder.element, _ui);\n // always repaint the source endpoint, because only continuous/dynamic anchors cause the endpoint\n // to be repainted, so static anchors need to be told (or the endpoint gets dragged around)\n endpoint.paint({anchorPoint:endpoint.anchor.getCurrentLocation({element:endpoint})});\n }\n },\n stopDrag: function () {\n stopped = true;\n }\n };\n };\n\n // creates a placeholder div for dragging purposes, adds it, and pre-computes its offset.\n var _makeDraggablePlaceholder = function (placeholder, _jsPlumb, ipco, ips) {\n var n = _jsPlumb.createElement(\"div\", { position : \"absolute\" });\n _jsPlumb.appendElement(n);\n var id = _jsPlumb.getId(n);\n _jsPlumb.setPosition(n, ipco);\n n.style.width = ips[0] + \"px\";\n n.style.height = ips[1] + \"px\";\n _jsPlumb.manage(id, n, true); // TRANSIENT MANAGE\n // create and assign an id, and initialize the offset.\n placeholder.id = id;\n placeholder.element = n;\n };\n\n // create a floating endpoint (for drag connections)\n var _makeFloatingEndpoint = function (paintStyle, referenceAnchor, endpoint, referenceCanvas, sourceElement, _jsPlumb, _newEndpoint, scope) {\n var floatingAnchor = new _jp.FloatingAnchor({ reference: referenceAnchor, referenceCanvas: referenceCanvas, jsPlumbInstance: _jsPlumb });\n //setting the scope here should not be the way to fix that mootools issue. it should be fixed by not\n // adding the floating endpoint as a droppable. that makes more sense anyway!\n // TRANSIENT MANAGE\n return _newEndpoint({\n paintStyle: paintStyle,\n endpoint: endpoint,\n anchor: floatingAnchor,\n source: sourceElement,\n scope: scope\n });\n };\n\n var typeParameters = [ \"connectorStyle\", \"connectorHoverStyle\", \"connectorOverlays\",\n \"connector\", \"connectionType\", \"connectorClass\", \"connectorHoverClass\" ];\n\n // a helper function that tries to find a connection to the given element, and returns it if so. if elementWithPrecedence is null,\n // or no connection to it is found, we return the first connection in our list.\n var findConnectionToUseForDynamicAnchor = function (ep, elementWithPrecedence) {\n var idx = 0;\n if (elementWithPrecedence != null) {\n for (var i = 0; i < ep.connections.length; i++) {\n if (ep.connections[i].sourceId === elementWithPrecedence || ep.connections[i].targetId === elementWithPrecedence) {\n idx = i;\n break;\n }\n }\n }\n\n return ep.connections[idx];\n };\n\n _jp.Endpoint = function (params) {\n var _jsPlumb = params._jsPlumb,\n _newConnection = params.newConnection,\n _newEndpoint = params.newEndpoint;\n\n this.idPrefix = \"_jsplumb_e_\";\n this.defaultLabelLocation = [ 0.5, 0.5 ];\n this.defaultOverlayKeys = [\"Overlays\", \"EndpointOverlays\"];\n _jp.OverlayCapableJsPlumbUIComponent.apply(this, arguments);\n\n// TYPE\n\n this.appendToDefaultType({\n connectionType:params.connectionType,\n maxConnections: params.maxConnections == null ? this._jsPlumb.instance.Defaults.MaxConnections : params.maxConnections, // maximum number of connections this endpoint can be the source of.,\n paintStyle: params.endpointStyle || params.paintStyle || params.style || this._jsPlumb.instance.Defaults.EndpointStyle || _jp.Defaults.EndpointStyle,\n hoverPaintStyle: params.endpointHoverStyle || params.hoverPaintStyle || this._jsPlumb.instance.Defaults.EndpointHoverStyle || _jp.Defaults.EndpointHoverStyle,\n connectorStyle: params.connectorStyle,\n connectorHoverStyle: params.connectorHoverStyle,\n connectorClass: params.connectorClass,\n connectorHoverClass: params.connectorHoverClass,\n connectorOverlays: params.connectorOverlays,\n connector: params.connector,\n connectorTooltip: params.connectorTooltip\n });\n\n// END TYPE\n\n this._jsPlumb.enabled = !(params.enabled === false);\n this._jsPlumb.visible = true;\n this.element = _jp.getElement(params.source);\n this._jsPlumb.uuid = params.uuid;\n this._jsPlumb.floatingEndpoint = null;\n var inPlaceCopy = null;\n if (this._jsPlumb.uuid) {\n params.endpointsByUUID[this._jsPlumb.uuid] = this;\n }\n this.elementId = params.elementId;\n this.dragProxy = params.dragProxy;\n\n this._jsPlumb.connectionCost = params.connectionCost;\n this._jsPlumb.connectionsDirected = params.connectionsDirected;\n this._jsPlumb.currentAnchorClass = \"\";\n this._jsPlumb.events = {};\n\n var deleteOnEmpty = params.deleteOnEmpty === true;\n this.setDeleteOnEmpty = function(d) {\n deleteOnEmpty = d;\n };\n\n var _updateAnchorClass = function () {\n // stash old, get new\n var oldAnchorClass = _jsPlumb.endpointAnchorClassPrefix + \"-\" + this._jsPlumb.currentAnchorClass;\n this._jsPlumb.currentAnchorClass = this.anchor.getCssClass();\n var anchorClass = _jsPlumb.endpointAnchorClassPrefix + (this._jsPlumb.currentAnchorClass ? \"-\" + this._jsPlumb.currentAnchorClass : \"\");\n\n this.removeClass(oldAnchorClass);\n this.addClass(anchorClass);\n // add and remove at the same time to reduce the number of reflows.\n _jp.updateClasses(this.element, anchorClass, oldAnchorClass);\n }.bind(this);\n\n this.prepareAnchor = function(anchorParams) {\n var a = this._jsPlumb.instance.makeAnchor(anchorParams, this.elementId, _jsPlumb);\n a.bind(\"anchorChanged\", function (currentAnchor) {\n this.fire(\"anchorChanged\", {endpoint: this, anchor: currentAnchor});\n _updateAnchorClass();\n }.bind(this));\n return a;\n };\n\n this.setPreparedAnchor = function(anchor, doNotRepaint) {\n this._jsPlumb.instance.continuousAnchorFactory.clear(this.elementId);\n this.anchor = anchor;\n _updateAnchorClass();\n\n if (!doNotRepaint) {\n this._jsPlumb.instance.repaint(this.elementId);\n }\n\n return this;\n };\n\n this.setAnchor = function (anchorParams, doNotRepaint) {\n var a = this.prepareAnchor(anchorParams);\n this.setPreparedAnchor(a, doNotRepaint);\n return this;\n };\n\n var internalHover = function (state) {\n if (this.connections.length > 0) {\n for (var i = 0; i < this.connections.length; i++) {\n this.connections[i].setHover(state, false);\n }\n }\n else {\n this.setHover(state);\n }\n }.bind(this);\n\n this.bind(\"mouseover\", function () {\n internalHover(true);\n });\n this.bind(\"mouseout\", function () {\n internalHover(false);\n });\n\n // ANCHOR MANAGER\n if (!params._transient) { // in place copies, for example, are transient. they will never need to be retrieved during a paint cycle, because they dont move, and then they are deleted.\n this._jsPlumb.instance.anchorManager.add(this, this.elementId);\n }\n\n this.prepareEndpoint = function(ep, typeId) {\n var _e = function (t, p) {\n var rm = _jsPlumb.getRenderMode();\n if (_jp.Endpoints[rm][t]) {\n return new _jp.Endpoints[rm][t](p);\n }\n if (!_jsPlumb.Defaults.DoNotThrowErrors) {\n throw { msg: \"jsPlumb: unknown endpoint type '\" + t + \"'\" };\n }\n };\n\n var endpointArgs = {\n _jsPlumb: this._jsPlumb.instance,\n cssClass: params.cssClass,\n container: params.container,\n tooltip: params.tooltip,\n connectorTooltip: params.connectorTooltip,\n endpoint: this\n };\n\n var endpoint;\n\n if (_ju.isString(ep)) {\n endpoint = _e(ep, endpointArgs);\n }\n else if (_ju.isArray(ep)) {\n endpointArgs = _ju.merge(ep[1], endpointArgs);\n endpoint = _e(ep[0], endpointArgs);\n }\n else {\n endpoint = ep.clone();\n }\n\n // assign a clone function using a copy of endpointArgs. this is used when a drag starts: the endpoint that was dragged is cloned,\n // and the clone is left in its place while the original one goes off on a magical journey.\n // the copy is to get around a closure problem, in which endpointArgs ends up getting shared by\n // the whole world.\n //var argsForClone = jsPlumb.extend({}, endpointArgs);\n endpoint.clone = function () {\n // TODO this, and the code above, can be refactored to be more dry.\n if (_ju.isString(ep)) {\n return _e(ep, endpointArgs);\n }\n else if (_ju.isArray(ep)) {\n endpointArgs = _ju.merge(ep[1], endpointArgs);\n return _e(ep[0], endpointArgs);\n }\n }.bind(this);\n\n endpoint.typeId = typeId;\n return endpoint;\n };\n\n this.setEndpoint = function(ep, doNotRepaint) {\n var _ep = this.prepareEndpoint(ep);\n this.setPreparedEndpoint(_ep, true);\n };\n\n this.setPreparedEndpoint = function (ep, doNotRepaint) {\n if (this.endpoint != null) {\n this.endpoint.cleanup();\n this.endpoint.destroy();\n }\n this.endpoint = ep;\n this.type = this.endpoint.type;\n this.canvas = this.endpoint.canvas;\n };\n\n _jp.extend(this, params, typeParameters);\n\n this.isSource = params.isSource || false;\n this.isTemporarySource = params.isTemporarySource || false;\n this.isTarget = params.isTarget || false;\n\n this.connections = params.connections || [];\n this.connectorPointerEvents = params[\"connector-pointer-events\"];\n\n this.scope = params.scope || _jsPlumb.getDefaultScope();\n this.timestamp = null;\n this.reattachConnections = params.reattach || _jsPlumb.Defaults.ReattachConnections;\n this.connectionsDetachable = _jsPlumb.Defaults.ConnectionsDetachable;\n if (params.connectionsDetachable === false || params.detachable === false) {\n this.connectionsDetachable = false;\n }\n this.dragAllowedWhenFull = params.dragAllowedWhenFull !== false;\n\n if (params.onMaxConnections) {\n this.bind(\"maxConnections\", params.onMaxConnections);\n }\n\n //\n // add a connection. not part of public API.\n //\n this.addConnection = function (connection) {\n this.connections.push(connection);\n this[(this.connections.length > 0 ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointConnectedClass);\n this[(this.isFull() ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointFullClass);\n };\n\n this.detachFromConnection = function (connection, idx, doNotCleanup) {\n idx = idx == null ? this.connections.indexOf(connection) : idx;\n if (idx >= 0) {\n this.connections.splice(idx, 1);\n this[(this.connections.length > 0 ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointConnectedClass);\n this[(this.isFull() ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointFullClass);\n }\n\n if (!doNotCleanup && deleteOnEmpty && this.connections.length === 0) {\n _jsPlumb.deleteObject({\n endpoint: this,\n fireEvent: false,\n deleteAttachedObjects: doNotCleanup !== true\n });\n }\n };\n\n this.deleteEveryConnection = function(params) {\n var c = this.connections.length;\n for (var i = 0; i < c; i++) {\n _jsPlumb.deleteConnection(this.connections[0], params);\n }\n };\n\n this.detachFrom = function (targetEndpoint, fireEvent, originalEvent) {\n var c = [];\n for (var i = 0; i < this.connections.length; i++) {\n if (this.connections[i].endpoints[1] === targetEndpoint || this.connections[i].endpoints[0] === targetEndpoint) {\n c.push(this.connections[i]);\n }\n }\n for (var j = 0, count = c.length; j < count; j++) {\n _jsPlumb.deleteConnection(c[0]);\n }\n return this;\n };\n\n this.getElement = function () {\n return this.element;\n };\n\n this.setElement = function (el) {\n var parentId = this._jsPlumb.instance.getId(el),\n curId = this.elementId;\n // remove the endpoint from the list for the current endpoint's element\n _ju.removeWithFunction(params.endpointsByElement[this.elementId], function (e) {\n return e.id === this.id;\n }.bind(this));\n this.element = _jp.getElement(el);\n this.elementId = _jsPlumb.getId(this.element);\n _jsPlumb.anchorManager.rehomeEndpoint(this, curId, this.element);\n _jsPlumb.dragManager.endpointAdded(this.element);\n _ju.addToList(params.endpointsByElement, parentId, this);\n return this;\n };\n\n /**\n * private but must be exposed.\n */\n this.makeInPlaceCopy = function () {\n var loc = this.anchor.getCurrentLocation({element: this}),\n o = this.anchor.getOrientation(this),\n acc = this.anchor.getCssClass(),\n inPlaceAnchor = {\n bind: function () {\n },\n compute: function () {\n return [ loc[0], loc[1] ];\n },\n getCurrentLocation: function () {\n return [ loc[0], loc[1] ];\n },\n getOrientation: function () {\n return o;\n },\n getCssClass: function () {\n return acc;\n }\n };\n\n return _newEndpoint({\n dropOptions: params.dropOptions,\n anchor: inPlaceAnchor,\n source: this.element,\n paintStyle: this.getPaintStyle(),\n endpoint: params.hideOnDrag ? \"Blank\" : this.endpoint,\n _transient: true,\n scope: this.scope,\n reference:this\n });\n };\n\n /**\n * returns a connection from the pool; used when dragging starts. just gets the head of the array if it can.\n */\n this.connectorSelector = function () {\n return this.connections[0];\n };\n\n this.setStyle = this.setPaintStyle;\n\n this.paint = function (params) {\n params = params || {};\n var timestamp = params.timestamp, recalc = !(params.recalc === false);\n if (!timestamp || this.timestamp !== timestamp) {\n\n var info = _jsPlumb.updateOffset({ elId: this.elementId, timestamp: timestamp });\n\n var xy = params.offset ? params.offset.o : info.o;\n if (xy != null) {\n var ap = params.anchorPoint, connectorPaintStyle = params.connectorPaintStyle;\n if (ap == null) {\n var wh = params.dimensions || info.s,\n anchorParams = { xy: [ xy.left, xy.top ], wh: wh, element: this, timestamp: timestamp };\n if (recalc && this.anchor.isDynamic && this.connections.length > 0) {\n var c = findConnectionToUseForDynamicAnchor(this, params.elementWithPrecedence),\n oIdx = c.endpoints[0] === this ? 1 : 0,\n oId = oIdx === 0 ? c.sourceId : c.targetId,\n oInfo = _jsPlumb.getCachedData(oId),\n oOffset = oInfo.o, oWH = oInfo.s;\n\n anchorParams.index = oIdx === 0 ? 1 : 0;\n anchorParams.connection = c;\n anchorParams.txy = [ oOffset.left, oOffset.top ];\n anchorParams.twh = oWH;\n anchorParams.tElement = c.endpoints[oIdx];\n } else if (this.connections.length > 0) {\n anchorParams.connection = this.connections[0];\n }\n ap = this.anchor.compute(anchorParams);\n }\n\n this.endpoint.compute(ap, this.anchor.getOrientation(this), this._jsPlumb.paintStyleInUse, connectorPaintStyle || this.paintStyleInUse);\n this.endpoint.paint(this._jsPlumb.paintStyleInUse, this.anchor);\n this.timestamp = timestamp;\n\n // paint overlays\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays.hasOwnProperty(i)) {\n var o = this._jsPlumb.overlays[i];\n if (o.isVisible()) {\n this._jsPlumb.overlayPlacements[i] = o.draw(this.endpoint, this._jsPlumb.paintStyleInUse);\n o.paint(this._jsPlumb.overlayPlacements[i]);\n }\n }\n }\n }\n }\n };\n\n this.getTypeDescriptor = function () {\n return \"endpoint\";\n };\n this.isVisible = function () {\n return this._jsPlumb.visible;\n };\n\n this.repaint = this.paint;\n\n var draggingInitialised = false;\n this.initDraggable = function () {\n\n // is this a connection source? we make it draggable and have the\n // drag listener maintain a connection with a floating endpoint.\n if (!draggingInitialised && _jp.isDragSupported(this.element)) {\n var placeholderInfo = { id: null, element: null },\n jpc = null,\n existingJpc = false,\n existingJpcParams = null,\n _dragHandler = _makeConnectionDragHandler(this, placeholderInfo, _jsPlumb),\n dragOptions = params.dragOptions || {},\n defaultOpts = {},\n startEvent = _jp.dragEvents.start,\n stopEvent = _jp.dragEvents.stop,\n dragEvent = _jp.dragEvents.drag,\n beforeStartEvent = _jp.dragEvents.beforeStart,\n payload;\n\n // respond to beforeStart from katavorio; this will have, optionally, a payload of attribute values\n // that were placed there by the makeSource mousedown listener.\n var beforeStart = function(beforeStartParams) {\n payload = beforeStartParams.e.payload || {};\n };\n\n var start = function (startParams) {\n\n// ------------- first, get a connection to drag. this may be null, in which case we are dragging a new one.\n\n jpc = this.connectorSelector();\n\n// -------------------------------- now a bunch of tests about whether or not to proceed -------------------------\n\n var _continue = true;\n // if not enabled, return\n if (!this.isEnabled()) {\n _continue = false;\n }\n // if no connection and we're not a source - or temporarily a source, as is the case with makeSource - return.\n if (jpc == null && !this.isSource && !this.isTemporarySource) {\n _continue = false;\n }\n // otherwise if we're full and not allowed to drag, also return false.\n if (this.isSource && this.isFull() && !(jpc != null && this.dragAllowedWhenFull)) {\n _continue = false;\n }\n // if the connection was setup as not detachable or one of its endpoints\n // was setup as connectionsDetachable = false, or Defaults.ConnectionsDetachable\n // is set to false...\n if (jpc != null && !jpc.isDetachable(this)) {\n // .. and the endpoint is full\n if (this.isFull()) {\n _continue = false;\n } else {\n // otherwise, if not full, set the connection to null, and we will now proceed\n // to drag a new connection.\n jpc = null;\n }\n }\n\n var beforeDrag = _jsPlumb.checkCondition(jpc == null ? \"beforeDrag\" : \"beforeStartDetach\", {\n endpoint:this,\n source:this.element,\n sourceId:this.elementId,\n connection:jpc\n });\n if (beforeDrag === false) {\n _continue = false;\n }\n // else we might have been given some data. we'll pass it in to a new connection as 'data'.\n // here we also merge in the optional payload we were given on mousedown.\n else if (typeof beforeDrag === \"object\") {\n _jp.extend(beforeDrag, payload || {});\n }\n else {\n // or if no beforeDrag data, maybe use the payload on its own.\n beforeDrag = payload || {};\n }\n\n if (_continue === false) {\n // this is for mootools and yui. returning false from this causes jquery to stop drag.\n // the events are wrapped in both mootools and yui anyway, but i don't think returning\n // false from the start callback would stop a drag.\n if (_jsPlumb.stopDrag) {\n _jsPlumb.stopDrag(this.canvas);\n }\n _dragHandler.stopDrag();\n return false;\n }\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n // ok to proceed.\n\n // clear hover for all connections for this endpoint before continuing.\n for (var i = 0; i < this.connections.length; i++) {\n this.connections[i].setHover(false);\n }\n\n this.addClass(\"endpointDrag\");\n _jsPlumb.setConnectionBeingDragged(true);\n\n // if we're not full but there was a connection, make it null. we'll create a new one.\n if (jpc && !this.isFull() && this.isSource) {\n jpc = null;\n }\n\n _jsPlumb.updateOffset({ elId: this.elementId });\n\n// ---------------- make the element we will drag around, and position it -----------------------------\n\n var ipco = this._jsPlumb.instance.getOffset(this.canvas),\n canvasElement = this.canvas,\n ips = this._jsPlumb.instance.getSize(this.canvas);\n\n _makeDraggablePlaceholder(placeholderInfo, _jsPlumb, ipco, ips);\n\n // store the id of the dragging div and the source element. the drop function will pick these up. \n _jsPlumb.setAttributes(this.canvas, {\n \"dragId\": placeholderInfo.id,\n \"elId\": this.elementId\n });\n\n// ------------------- create an endpoint that will be our floating endpoint ------------------------------------\n\n var endpointToFloat = this.dragProxy || this.endpoint;\n if (this.dragProxy == null && this.connectionType != null) {\n var aae = this._jsPlumb.instance.deriveEndpointAndAnchorSpec(this.connectionType);\n if (aae.endpoints[1]) {\n endpointToFloat = aae.endpoints[1];\n }\n }\n var centerAnchor = this._jsPlumb.instance.makeAnchor(\"Center\");\n centerAnchor.isFloating = true;\n this._jsPlumb.floatingEndpoint = _makeFloatingEndpoint(this.getPaintStyle(), centerAnchor, endpointToFloat, this.canvas, placeholderInfo.element, _jsPlumb, _newEndpoint, this.scope);\n var _savedAnchor = this._jsPlumb.floatingEndpoint.anchor;\n\n\n if (jpc == null) {\n\n this.setHover(false, false);\n // create a connection. one end is this endpoint, the other is a floating endpoint. \n jpc = _newConnection({\n sourceEndpoint: this,\n targetEndpoint: this._jsPlumb.floatingEndpoint,\n source: this.element, // for makeSource with parent option. ensure source element is represented correctly.\n target: placeholderInfo.element,\n anchors: [ this.anchor, this._jsPlumb.floatingEndpoint.anchor ],\n paintStyle: params.connectorStyle, // this can be null. Connection will use the default.\n hoverPaintStyle: params.connectorHoverStyle,\n connector: params.connector, // this can also be null. Connection will use the default.\n overlays: params.connectorOverlays,\n type: this.connectionType,\n cssClass: this.connectorClass,\n hoverClass: this.connectorHoverClass,\n scope:params.scope,\n data:beforeDrag\n });\n jpc.pending = true;\n jpc.addClass(_jsPlumb.draggingClass);\n this._jsPlumb.floatingEndpoint.addClass(_jsPlumb.draggingClass);\n this._jsPlumb.floatingEndpoint.anchor = _savedAnchor;\n // fire an event that informs that a connection is being dragged\n _jsPlumb.fire(\"connectionDrag\", jpc);\n\n // register the new connection on the drag manager. This connection, at this point, is 'pending',\n // and has as its target a temporary element (the 'placeholder'). If the connection subsequently\n // becomes established, the anchor manager is informed that the target of the connection has\n // changed.\n\n _jsPlumb.anchorManager.newConnection(jpc);\n\n } else {\n existingJpc = true;\n jpc.setHover(false);\n // new anchor idx\n var anchorIdx = jpc.endpoints[0].id === this.id ? 0 : 1;\n this.detachFromConnection(jpc, null, true); // detach from the connection while dragging is occurring. but dont cleanup automatically.\n\n // store the original scope (issue 57)\n var dragScope = _jsPlumb.getDragScope(canvasElement);\n _jsPlumb.setAttribute(this.canvas, \"originalScope\", dragScope);\n\n // fire an event that informs that a connection is being dragged. we do this before\n // replacing the original target with the floating element info.\n _jsPlumb.fire(\"connectionDrag\", jpc);\n\n // now we replace ourselves with the temporary div we created above:\n if (anchorIdx === 0) {\n existingJpcParams = [ jpc.source, jpc.sourceId, canvasElement, dragScope ];\n _jsPlumb.anchorManager.sourceChanged(jpc.endpoints[anchorIdx].elementId, placeholderInfo.id, jpc, placeholderInfo.element);\n\n } else {\n existingJpcParams = [ jpc.target, jpc.targetId, canvasElement, dragScope ];\n jpc.target = placeholderInfo.element;\n jpc.targetId = placeholderInfo.id;\n\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.endpoints[anchorIdx].elementId, jpc.targetId, jpc);\n }\n\n // store the original endpoint and assign the new floating endpoint for the drag.\n jpc.suspendedEndpoint = jpc.endpoints[anchorIdx];\n\n // PROVIDE THE SUSPENDED ELEMENT, BE IT A SOURCE OR TARGET (ISSUE 39)\n jpc.suspendedElement = jpc.endpoints[anchorIdx].getElement();\n jpc.suspendedElementId = jpc.endpoints[anchorIdx].elementId;\n jpc.suspendedElementType = anchorIdx === 0 ? \"source\" : \"target\";\n\n jpc.suspendedEndpoint.setHover(false);\n this._jsPlumb.floatingEndpoint.referenceEndpoint = jpc.suspendedEndpoint;\n jpc.endpoints[anchorIdx] = this._jsPlumb.floatingEndpoint;\n\n jpc.addClass(_jsPlumb.draggingClass);\n this._jsPlumb.floatingEndpoint.addClass(_jsPlumb.draggingClass);\n }\n\n _jsPlumb.registerFloatingConnection(placeholderInfo, jpc, this._jsPlumb.floatingEndpoint);\n\n // // register it and register connection on it.\n // _jsPlumb.floatingConnections[placeholderInfo.id] = jpc;\n //\n // // only register for the target endpoint; we will not be dragging the source at any time\n // // before this connection is either discarded or made into a permanent connection.\n // _ju.addToList(params.endpointsByElement, placeholderInfo.id, this._jsPlumb.floatingEndpoint);\n\n\n // tell jsplumb about it\n _jsPlumb.currentlyDragging = true;\n }.bind(this);\n\n var stop = function () {\n _jsPlumb.setConnectionBeingDragged(false);\n\n if (jpc && jpc.endpoints != null) {\n // get the actual drop event (decode from library args to stop function)\n var originalEvent = _jsPlumb.getDropEvent(arguments);\n // unlock the other endpoint (if it is dynamic, it would have been locked at drag start)\n var idx = _jsPlumb.getFloatingAnchorIndex(jpc);\n jpc.endpoints[idx === 0 ? 1 : 0].anchor.unlock();\n // TODO: Dont want to know about css classes inside jsplumb, ideally.\n jpc.removeClass(_jsPlumb.draggingClass);\n\n // if we have the floating endpoint then the connection has not been dropped\n // on another endpoint. If it is a new connection we throw it away. If it is an\n // existing connection we check to see if we should reattach it, throwing it away\n // if not.\n if (this._jsPlumb && (jpc.deleteConnectionNow || jpc.endpoints[idx] === this._jsPlumb.floatingEndpoint)) {\n // 6a. if the connection was an existing one...\n if (existingJpc && jpc.suspendedEndpoint) {\n // fix for issue35, thanks Sylvain Gizard: when firing the detach event make sure the\n // floating endpoint has been replaced.\n if (idx === 0) {\n jpc.floatingElement = jpc.source;\n jpc.floatingId = jpc.sourceId;\n jpc.floatingEndpoint = jpc.endpoints[0];\n jpc.floatingIndex = 0;\n jpc.source = existingJpcParams[0];\n jpc.sourceId = existingJpcParams[1];\n } else {\n // keep a copy of the floating element; the anchor manager will want to clean up.\n jpc.floatingElement = jpc.target;\n jpc.floatingId = jpc.targetId;\n jpc.floatingEndpoint = jpc.endpoints[1];\n jpc.floatingIndex = 1;\n jpc.target = existingJpcParams[0];\n jpc.targetId = existingJpcParams[1];\n }\n\n var fe = this._jsPlumb.floatingEndpoint; // store for later removal.\n // restore the original scope (issue 57)\n _jsPlumb.setDragScope(existingJpcParams[2], existingJpcParams[3]);\n jpc.endpoints[idx] = jpc.suspendedEndpoint;\n // if the connection should be reattached, or the other endpoint refuses detach, then\n // reset the connection to its original state\n if (jpc.isReattach() || jpc._forceReattach || jpc._forceDetach || !_jsPlumb.deleteConnection(jpc, {originalEvent: originalEvent})) {\n\n jpc.setHover(false);\n jpc._forceDetach = null;\n jpc._forceReattach = null;\n this._jsPlumb.floatingEndpoint.detachFromConnection(jpc);\n jpc.suspendedEndpoint.addConnection(jpc);\n\n // TODO this code is duplicated in lots of places...and there is nothing external\n // in the code; it all refers to the connection itself. we could add a\n // `checkSanity(connection)` method to anchorManager that did this.\n if (idx === 1) {\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.floatingId, jpc.targetId, jpc);\n }\n else {\n _jsPlumb.anchorManager.sourceChanged(jpc.floatingId, jpc.sourceId, jpc, jpc.source);\n }\n\n _jsPlumb.repaint(existingJpcParams[1]);\n }\n else {\n _jsPlumb.deleteObject({endpoint: fe});\n }\n }\n }\n\n // makeTargets sets this flag, to tell us we have been replaced and should delete this object.\n if (this.deleteAfterDragStop) {\n _jsPlumb.deleteObject({endpoint: this});\n }\n else {\n if (this._jsPlumb) {\n this.paint({recalc: false});\n }\n }\n\n // although the connection is no longer valid, there are use cases where this is useful.\n _jsPlumb.fire(\"connectionDragStop\", jpc, originalEvent);\n // fire this event to give people more fine-grained control (connectionDragStop fires a lot)\n if (jpc.pending) {\n _jsPlumb.fire(\"connectionAborted\", jpc, originalEvent);\n }\n // tell jsplumb that dragging is finished.\n _jsPlumb.currentlyDragging = false;\n jpc.suspendedElement = null;\n jpc.suspendedEndpoint = null;\n jpc = null;\n }\n\n // if no endpoints, jpc already cleaned up. but still we want to ensure we're reset properly.\n // remove the element associated with the floating endpoint\n // (and its associated floating endpoint and visual artefacts)\n if (placeholderInfo && placeholderInfo.element) {\n _jsPlumb.remove(placeholderInfo.element, false, false);\n }\n // remove the inplace copy\n if (inPlaceCopy) {\n _jsPlumb.deleteObject({endpoint: inPlaceCopy});\n }\n\n if (this._jsPlumb) {\n // make our canvas visible (TODO: hand off to library; we should not know about DOM)\n this.canvas.style.visibility = \"visible\";\n // unlock our anchor\n this.anchor.unlock();\n // clear floating anchor.\n this._jsPlumb.floatingEndpoint = null;\n }\n\n }.bind(this);\n\n dragOptions = _jp.extend(defaultOpts, dragOptions);\n dragOptions.scope = this.scope || dragOptions.scope;\n dragOptions[beforeStartEvent] = _ju.wrap(dragOptions[beforeStartEvent], beforeStart, false);\n dragOptions[startEvent] = _ju.wrap(dragOptions[startEvent], start, false);\n // extracted drag handler function so can be used by makeSource\n dragOptions[dragEvent] = _ju.wrap(dragOptions[dragEvent], _dragHandler.drag);\n dragOptions[stopEvent] = _ju.wrap(dragOptions[stopEvent], stop);\n dragOptions.multipleDrop = false;\n\n dragOptions.canDrag = function () {\n return this.isSource || this.isTemporarySource || (this.connections.length > 0 && this.connectionsDetachable !== false);\n }.bind(this);\n\n _jsPlumb.initDraggable(this.canvas, dragOptions, \"internal\");\n\n this.canvas._jsPlumbRelatedElement = this.element;\n\n draggingInitialised = true;\n }\n };\n\n var ep = params.endpoint || this._jsPlumb.instance.Defaults.Endpoint || _jp.Defaults.Endpoint;\n this.setEndpoint(ep, true);\n var anchorParamsToUse = params.anchor ? params.anchor : params.anchors ? params.anchors : (_jsPlumb.Defaults.Anchor || \"Top\");\n this.setAnchor(anchorParamsToUse, true);\n\n // finally, set type if it was provided\n var type = [ \"default\", (params.type || \"\")].join(\" \");\n this.addType(type, params.data, true);\n this.canvas = this.endpoint.canvas;\n this.canvas._jsPlumb = this;\n\n this.initDraggable();\n\n // pulled this out into a function so we can reuse it for the inPlaceCopy canvas; you can now drop detached connections\n // back onto the endpoint you detached it from.\n var _initDropTarget = function (canvas, isTransient, endpoint, referenceEndpoint) {\n\n if (_jp.isDropSupported(this.element)) {\n var dropOptions = params.dropOptions || _jsPlumb.Defaults.DropOptions || _jp.Defaults.DropOptions;\n dropOptions = _jp.extend({}, dropOptions);\n dropOptions.scope = dropOptions.scope || this.scope;\n var dropEvent = _jp.dragEvents.drop,\n overEvent = _jp.dragEvents.over,\n outEvent = _jp.dragEvents.out,\n _ep = this,\n drop = _jsPlumb.EndpointDropHandler({\n getEndpoint: function () {\n return _ep;\n },\n jsPlumb: _jsPlumb,\n enabled: function () {\n return endpoint != null ? endpoint.isEnabled() : true;\n },\n isFull: function () {\n return endpoint.isFull();\n },\n element: this.element,\n elementId: this.elementId,\n isSource: this.isSource,\n isTarget: this.isTarget,\n addClass: function (clazz) {\n _ep.addClass(clazz);\n },\n removeClass: function (clazz) {\n _ep.removeClass(clazz);\n },\n isDropAllowed: function () {\n return _ep.isDropAllowed.apply(_ep, arguments);\n },\n reference:referenceEndpoint,\n isRedrop:function(jpc, dhParams) {\n return jpc.suspendedEndpoint && dhParams.reference && (jpc.suspendedEndpoint.id === dhParams.reference.id);\n }\n });\n\n dropOptions[dropEvent] = _ju.wrap(dropOptions[dropEvent], drop, true);\n dropOptions[overEvent] = _ju.wrap(dropOptions[overEvent], function () {\n var draggable = _jp.getDragObject(arguments),\n id = _jsPlumb.getAttribute(_jp.getElement(draggable), \"dragId\"),\n _jpc = _jsPlumb.getFloatingConnectionFor(id);//_jsPlumb.floatingConnections[id];\n\n if (_jpc != null) {\n var idx = _jsPlumb.getFloatingAnchorIndex(_jpc);\n // here we should fire the 'over' event if we are a target and this is a new connection,\n // or we are the same as the floating endpoint.\n var _cont = (this.isTarget && idx !== 0) || (_jpc.suspendedEndpoint && this.referenceEndpoint && this.referenceEndpoint.id === _jpc.suspendedEndpoint.id);\n if (_cont) {\n var bb = _jsPlumb.checkCondition(\"checkDropAllowed\", {\n sourceEndpoint: _jpc.endpoints[idx],\n targetEndpoint: this,\n connection: _jpc\n });\n this[(bb ? \"add\" : \"remove\") + \"Class\"](_jsPlumb.endpointDropAllowedClass);\n this[(bb ? \"remove\" : \"add\") + \"Class\"](_jsPlumb.endpointDropForbiddenClass);\n _jpc.endpoints[idx].anchor.over(this.anchor, this);\n }\n }\n }.bind(this));\n\n dropOptions[outEvent] = _ju.wrap(dropOptions[outEvent], function () {\n var draggable = _jp.getDragObject(arguments),\n id = draggable == null ? null : _jsPlumb.getAttribute(_jp.getElement(draggable), \"dragId\"),\n _jpc = id ? _jsPlumb.getFloatingConnectionFor(id) : null;\n\n if (_jpc != null) {\n var idx = _jsPlumb.getFloatingAnchorIndex(_jpc);\n var _cont = (this.isTarget && idx !== 0) || (_jpc.suspendedEndpoint && this.referenceEndpoint && this.referenceEndpoint.id === _jpc.suspendedEndpoint.id);\n if (_cont) {\n this.removeClass(_jsPlumb.endpointDropAllowedClass);\n this.removeClass(_jsPlumb.endpointDropForbiddenClass);\n _jpc.endpoints[idx].anchor.out();\n }\n }\n }.bind(this));\n\n _jsPlumb.initDroppable(canvas, dropOptions, \"internal\", isTransient);\n }\n }.bind(this);\n\n // Initialise the endpoint's canvas as a drop target. The drop handler will take care of the logic of whether\n // something can actually be dropped.\n if (!this.anchor.isFloating) {\n _initDropTarget(this.canvas, !(params._transient || this.anchor.isFloating), this, params.reference);\n }\n\n return this;\n };\n\n _ju.extend(_jp.Endpoint, _jp.OverlayCapableJsPlumbUIComponent, {\n\n setVisible: function (v, doNotChangeConnections, doNotNotifyOtherEndpoint) {\n this._jsPlumb.visible = v;\n if (this.canvas) {\n this.canvas.style.display = v ? \"block\" : \"none\";\n }\n this[v ? \"showOverlays\" : \"hideOverlays\"]();\n if (!doNotChangeConnections) {\n for (var i = 0; i < this.connections.length; i++) {\n this.connections[i].setVisible(v);\n if (!doNotNotifyOtherEndpoint) {\n var oIdx = this === this.connections[i].endpoints[0] ? 1 : 0;\n // only change the other endpoint if this is its only connection.\n if (this.connections[i].endpoints[oIdx].connections.length === 1) {\n this.connections[i].endpoints[oIdx].setVisible(v, true, true);\n }\n }\n }\n }\n },\n getAttachedElements: function () {\n return this.connections;\n },\n applyType: function (t, doNotRepaint) {\n this.setPaintStyle(t.endpointStyle || t.paintStyle, doNotRepaint);\n this.setHoverPaintStyle(t.endpointHoverStyle || t.hoverPaintStyle, doNotRepaint);\n if (t.maxConnections != null) {\n this._jsPlumb.maxConnections = t.maxConnections;\n }\n if (t.scope) {\n this.scope = t.scope;\n }\n _jp.extend(this, t, typeParameters);\n if (t.cssClass != null && this.canvas) {\n this._jsPlumb.instance.addClass(this.canvas, t.cssClass);\n }\n _jp.OverlayCapableJsPlumbUIComponent.applyType(this, t);\n },\n isEnabled: function () {\n return this._jsPlumb.enabled;\n },\n setEnabled: function (e) {\n this._jsPlumb.enabled = e;\n },\n cleanup: function () {\n var anchorClass = this._jsPlumb.instance.endpointAnchorClassPrefix + (this._jsPlumb.currentAnchorClass ? \"-\" + this._jsPlumb.currentAnchorClass : \"\");\n _jp.removeClass(this.element, anchorClass);\n this.anchor = null;\n this.endpoint.cleanup(true);\n this.endpoint.destroy();\n this.endpoint = null;\n // drag/drop\n this._jsPlumb.instance.destroyDraggable(this.canvas, \"internal\");\n this._jsPlumb.instance.destroyDroppable(this.canvas, \"internal\");\n },\n setHover: function (h) {\n if (this.endpoint && this._jsPlumb && !this._jsPlumb.instance.isConnectionBeingDragged()) {\n this.endpoint.setHover(h);\n }\n },\n isFull: function () {\n return this._jsPlumb.maxConnections === 0 ? true : !(this.isFloating() || this._jsPlumb.maxConnections < 0 || this.connections.length < this._jsPlumb.maxConnections);\n },\n /**\n * private but needs to be exposed.\n */\n isFloating: function () {\n return this.anchor != null && this.anchor.isFloating;\n },\n isConnectedTo: function (endpoint) {\n var found = false;\n if (endpoint) {\n for (var i = 0; i < this.connections.length; i++) {\n if (this.connections[i].endpoints[1] === endpoint || this.connections[i].endpoints[0] === endpoint) {\n found = true;\n break;\n }\n }\n }\n return found;\n },\n getConnectionCost: function () {\n return this._jsPlumb.connectionCost;\n },\n setConnectionCost: function (c) {\n this._jsPlumb.connectionCost = c;\n },\n areConnectionsDirected: function () {\n return this._jsPlumb.connectionsDirected;\n },\n setConnectionsDirected: function (b) {\n this._jsPlumb.connectionsDirected = b;\n },\n setElementId: function (_elId) {\n this.elementId = _elId;\n this.anchor.elementId = _elId;\n },\n setReferenceElement: function (_el) {\n this.element = _jp.getElement(_el);\n },\n setDragAllowedWhenFull: function (allowed) {\n this.dragAllowedWhenFull = allowed;\n },\n equals: function (endpoint) {\n return this.anchor.equals(endpoint.anchor);\n },\n getUuid: function () {\n return this._jsPlumb.uuid;\n },\n computeAnchor: function (params) {\n return this.anchor.compute(params);\n }\n });\n\n root.jsPlumbInstance.prototype.EndpointDropHandler = function (dhParams) {\n return function (e) {\n\n var _jsPlumb = dhParams.jsPlumb;\n\n // remove the classes that are added dynamically. drop is neither forbidden nor allowed now that\n // the drop is finishing.\n dhParams.removeClass(_jsPlumb.endpointDropAllowedClass);\n dhParams.removeClass(_jsPlumb.endpointDropForbiddenClass);\n\n var originalEvent = _jsPlumb.getDropEvent(arguments),\n draggable = _jsPlumb.getDragObject(arguments),\n id = _jsPlumb.getAttribute(draggable, \"dragId\"),\n elId = _jsPlumb.getAttribute(draggable, \"elId\"),\n scope = _jsPlumb.getAttribute(draggable, \"originalScope\"),\n jpc = _jsPlumb.getFloatingConnectionFor(id);\n\n // if no active connection, bail.\n if (jpc == null) {\n return;\n }\n\n // calculate if this is an existing connection.\n var existingConnection = jpc.suspendedEndpoint != null;\n\n // if suspended endpoint exists but has been cleaned up, bail. This means it's an existing connection\n // that has been detached and will shortly be discarded.\n if (existingConnection && jpc.suspendedEndpoint._jsPlumb == null) {\n return;\n }\n\n // get the drop endpoint. for a normal connection this is just the one that would replace the currently\n // floating endpoint. for a makeTarget this is a new endpoint that is created on drop. But we leave that to\n // the handler to figure out.\n var _ep = dhParams.getEndpoint(jpc);\n\n // If we're not given an endpoint to use, bail.\n if (_ep == null) {\n return;\n }\n\n // if this is a drop back where the connection came from, mark it force reattach and\n // return; the stop handler will reattach. without firing an event.\n if (dhParams.isRedrop(jpc, dhParams)) {\n jpc._forceReattach = true;\n jpc.setHover(false);\n if (dhParams.maybeCleanup) {\n dhParams.maybeCleanup(_ep);\n }\n return;\n }\n\n // ensure we dont bother trying to drop sources on non-source eps, and same for target.\n var idx = _jsPlumb.getFloatingAnchorIndex(jpc);\n if ((idx === 0 && !dhParams.isSource)|| (idx === 1 && !dhParams.isTarget)){\n if (dhParams.maybeCleanup) {\n dhParams.maybeCleanup(_ep);\n }\n return;\n }\n\n if (dhParams.onDrop) {\n dhParams.onDrop(jpc);\n }\n\n // restore the original scope if necessary (issue 57)\n if (scope) {\n _jsPlumb.setDragScope(draggable, scope);\n }\n\n // if the target of the drop is full, fire an event (we abort below)\n // makeTarget: keep.\n var isFull = dhParams.isFull(e);\n if (isFull) {\n _ep.fire(\"maxConnections\", {\n endpoint: this,\n connection: jpc,\n maxConnections: _ep._jsPlumb.maxConnections\n }, originalEvent);\n }\n //\n // if endpoint enabled, not full, and matches the index of the floating endpoint...\n if (!isFull && dhParams.enabled()) {\n var _doContinue = true;\n\n // before testing for beforeDrop, reset the connection's source/target to be the actual DOM elements\n // involved (that is, stash any temporary stuff used for dragging. but we need to keep it around in\n // order that the anchor manager can clean things up properly).\n if (idx === 0) {\n jpc.floatingElement = jpc.source;\n jpc.floatingId = jpc.sourceId;\n jpc.floatingEndpoint = jpc.endpoints[0];\n jpc.floatingIndex = 0;\n jpc.source = dhParams.element;\n jpc.sourceId = dhParams.elementId;\n } else {\n jpc.floatingElement = jpc.target;\n jpc.floatingId = jpc.targetId;\n jpc.floatingEndpoint = jpc.endpoints[1];\n jpc.floatingIndex = 1;\n jpc.target = dhParams.element;\n jpc.targetId = dhParams.elementId;\n }\n\n // if this is an existing connection and detach is not allowed we won't continue. The connection's\n // endpoints have been reinstated; everything is back to how it was.\n if (existingConnection && jpc.suspendedEndpoint.id !== _ep.id) {\n if (!jpc.isDetachAllowed(jpc) || !jpc.endpoints[idx].isDetachAllowed(jpc) || !jpc.suspendedEndpoint.isDetachAllowed(jpc) || !_jsPlumb.checkCondition(\"beforeDetach\", jpc)) {\n _doContinue = false;\n }\n }\n\n// ------------ wrap the execution path in a function so we can support asynchronous beforeDrop\n\n var continueFunction = function (optionalData) {\n // remove this jpc from the current endpoint, which is a floating endpoint that we will\n // subsequently discard.\n jpc.endpoints[idx].detachFromConnection(jpc);\n\n // if there's a suspended endpoint, detach it from the connection.\n if (jpc.suspendedEndpoint) {\n jpc.suspendedEndpoint.detachFromConnection(jpc);\n }\n\n jpc.endpoints[idx] = _ep;\n _ep.addConnection(jpc);\n\n // copy our parameters in to the connection:\n var params = _ep.getParameters();\n for (var aParam in params) {\n jpc.setParameter(aParam, params[aParam]);\n }\n\n if (!existingConnection) {\n // if not an existing connection and\n if (params.draggable) {\n _jsPlumb.initDraggable(this.element, dhParams.dragOptions, \"internal\", _jsPlumb);\n }\n }\n else {\n var suspendedElementId = jpc.suspendedEndpoint.elementId;\n _jsPlumb.fireMoveEvent({\n index: idx,\n originalSourceId: idx === 0 ? suspendedElementId : jpc.sourceId,\n newSourceId: idx === 0 ? _ep.elementId : jpc.sourceId,\n originalTargetId: idx === 1 ? suspendedElementId : jpc.targetId,\n newTargetId: idx === 1 ? _ep.elementId : jpc.targetId,\n originalSourceEndpoint: idx === 0 ? jpc.suspendedEndpoint : jpc.endpoints[0],\n newSourceEndpoint: idx === 0 ? _ep : jpc.endpoints[0],\n originalTargetEndpoint: idx === 1 ? jpc.suspendedEndpoint : jpc.endpoints[1],\n newTargetEndpoint: idx === 1 ? _ep : jpc.endpoints[1],\n connection: jpc\n }, originalEvent);\n }\n\n if (idx === 1) {\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.floatingId, jpc.targetId, jpc);\n }\n else {\n _jsPlumb.anchorManager.sourceChanged(jpc.floatingId, jpc.sourceId, jpc, jpc.source);\n }\n\n // when makeSource has uniqueEndpoint:true, we want to create connections with new endpoints\n // that are subsequently deleted. So makeSource sets `finalEndpoint`, which is the Endpoint to\n // which the connection should be attached. The `detachFromConnection` call below results in the\n // temporary endpoint being cleaned up.\n if (jpc.endpoints[0].finalEndpoint) {\n var _toDelete = jpc.endpoints[0];\n _toDelete.detachFromConnection(jpc);\n jpc.endpoints[0] = jpc.endpoints[0].finalEndpoint;\n jpc.endpoints[0].addConnection(jpc);\n }\n\n // if optionalData was given, merge it onto the connection's data.\n if (_ju.isObject(optionalData)) {\n jpc.mergeData(optionalData);\n }\n // finalise will inform the anchor manager and also add to\n // connectionsByScope if necessary.\n _jsPlumb.finaliseConnection(jpc, null, originalEvent, false);\n jpc.setHover(false);\n\n // SP continuous anchor flush\n _jsPlumb.revalidate(jpc.endpoints[0].element);\n\n }.bind(this);\n\n var dontContinueFunction = function () {\n // otherwise just put it back on the endpoint it was on before the drag.\n if (jpc.suspendedEndpoint) {\n jpc.endpoints[idx] = jpc.suspendedEndpoint;\n jpc.setHover(false);\n jpc._forceDetach = true;\n if (idx === 0) {\n jpc.source = jpc.suspendedEndpoint.element;\n jpc.sourceId = jpc.suspendedEndpoint.elementId;\n } else {\n jpc.target = jpc.suspendedEndpoint.element;\n jpc.targetId = jpc.suspendedEndpoint.elementId;\n }\n jpc.suspendedEndpoint.addConnection(jpc);\n\n // TODO checkSanity\n if (idx === 1) {\n _jsPlumb.anchorManager.updateOtherEndpoint(jpc.sourceId, jpc.floatingId, jpc.targetId, jpc);\n }\n else {\n _jsPlumb.anchorManager.sourceChanged(jpc.floatingId, jpc.sourceId, jpc, jpc.source);\n }\n\n _jsPlumb.repaint(jpc.sourceId);\n jpc._forceDetach = false;\n }\n };\n\n// --------------------------------------\n // now check beforeDrop. this will be available only on Endpoints that are setup to\n // have a beforeDrop condition (although, secretly, under the hood all Endpoints and\n // the Connection have them, because they are on jsPlumbUIComponent. shhh!), because\n // it only makes sense to have it on a target endpoint.\n _doContinue = _doContinue && dhParams.isDropAllowed(jpc.sourceId, jpc.targetId, jpc.scope, jpc, _ep);// && jpc.pending;\n\n if (_doContinue) {\n continueFunction(_doContinue);\n return true;\n }\n else {\n dontContinueFunction();\n }\n }\n\n if (dhParams.maybeCleanup) {\n dhParams.maybeCleanup(_ep);\n }\n\n _jsPlumb.currentlyDragging = false;\n };\n };\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the code for Connections.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this,\n _jp = root.jsPlumb,\n _ju = root.jsPlumbUtil;\n\n var makeConnector = function (_jsPlumb, renderMode, connectorName, connectorArgs, forComponent) {\n // first make sure we have a cache for the specified renderer\n _jp.Connectors[renderMode] = _jp.Connectors[renderMode] || {};\n\n // now see if the one we want exists; if not we will try to make it\n if (_jp.Connectors[renderMode][connectorName] == null) {\n\n if (_jp.Connectors[connectorName] == null) {\n if (!_jsPlumb.Defaults.DoNotThrowErrors) {\n throw new TypeError(\"jsPlumb: unknown connector type '\" + connectorName + \"'\");\n } else {\n return null;\n }\n }\n\n _jp.Connectors[renderMode][connectorName] = function() {\n _jp.Connectors[connectorName].apply(this, arguments);\n _jp.ConnectorRenderers[renderMode].apply(this, arguments);\n };\n\n _ju.extend(_jp.Connectors[renderMode][connectorName], [ _jp.Connectors[connectorName], _jp.ConnectorRenderers[renderMode]]);\n\n }\n\n return new _jp.Connectors[renderMode][connectorName](connectorArgs, forComponent);\n },\n _makeAnchor = function (anchorParams, elementId, _jsPlumb) {\n return (anchorParams) ? _jsPlumb.makeAnchor(anchorParams, elementId, _jsPlumb) : null;\n },\n _updateConnectedClass = function (conn, element, _jsPlumb, remove) {\n if (element != null) {\n element._jsPlumbConnections = element._jsPlumbConnections || {};\n if (remove) {\n delete element._jsPlumbConnections[conn.id];\n }\n else {\n element._jsPlumbConnections[conn.id] = true;\n }\n\n if (_ju.isEmpty(element._jsPlumbConnections)) {\n _jsPlumb.removeClass(element, _jsPlumb.connectedClass);\n }\n else {\n _jsPlumb.addClass(element, _jsPlumb.connectedClass);\n }\n }\n };\n\n _jp.Connection = function (params) {\n var _newEndpoint = params.newEndpoint;\n\n this.id = params.id;\n this.connector = null;\n this.idPrefix = \"_jsplumb_c_\";\n this.defaultLabelLocation = 0.5;\n this.defaultOverlayKeys = [\"Overlays\", \"ConnectionOverlays\"];\n // if a new connection is the result of moving some existing connection, params.previousConnection\n // will have that Connection in it. listeners for the jsPlumbConnection event can look for that\n // member and take action if they need to.\n this.previousConnection = params.previousConnection;\n this.source = _jp.getElement(params.source);\n this.target = _jp.getElement(params.target);\n\n\n _jp.OverlayCapableJsPlumbUIComponent.apply(this, arguments);\n\n // sourceEndpoint and targetEndpoint override source/target, if they are present. but \n // source is not overridden if the Endpoint has declared it is not the final target of a connection;\n // instead we use the source that the Endpoint declares will be the final source element.\n if (params.sourceEndpoint) {\n this.source = params.sourceEndpoint.getElement();\n this.sourceId = params.sourceEndpoint.elementId;\n } else {\n this.sourceId = this._jsPlumb.instance.getId(this.source);\n }\n\n if (params.targetEndpoint) {\n this.target = params.targetEndpoint.getElement();\n this.targetId = params.targetEndpoint.elementId;\n } else {\n this.targetId = this._jsPlumb.instance.getId(this.target);\n }\n\n\n this.scope = params.scope; // scope may have been passed in to the connect call. if it wasn't, we will pull it from the source endpoint, after having initialised the endpoints. \n this.endpoints = [];\n this.endpointStyles = [];\n\n var _jsPlumb = this._jsPlumb.instance;\n\n _jsPlumb.manage(this.sourceId, this.source);\n _jsPlumb.manage(this.targetId, this.target);\n\n this._jsPlumb.visible = true;\n\n this._jsPlumb.params = {\n cssClass: params.cssClass,\n container: params.container,\n \"pointer-events\": params[\"pointer-events\"],\n editorParams: params.editorParams,\n overlays: params.overlays\n };\n this._jsPlumb.lastPaintedAt = null;\n\n // listen to mouseover and mouseout events passed from the container delegate.\n this.bind(\"mouseover\", function () {\n this.setHover(true);\n }.bind(this));\n this.bind(\"mouseout\", function () {\n this.setHover(false);\n }.bind(this));\n\n\n// INITIALISATION CODE\n\n this.makeEndpoint = function (isSource, el, elId, ep) {\n elId = elId || this._jsPlumb.instance.getId(el);\n return this.prepareEndpoint(_jsPlumb, _newEndpoint, this, ep, isSource ? 0 : 1, params, el, elId);\n };\n\n // if type given, get the endpoint definitions mapping to that type from the jsplumb instance, and use those.\n // we apply types at the end of this constructor but endpoints are only honoured in a type definition at\n // create time.\n if (params.type) {\n params.endpoints = params.endpoints || this._jsPlumb.instance.deriveEndpointAndAnchorSpec(params.type).endpoints;\n }\n\n var eS = this.makeEndpoint(true, this.source, this.sourceId, params.sourceEndpoint),\n eT = this.makeEndpoint(false, this.target, this.targetId, params.targetEndpoint);\n\n if (eS) {\n _ju.addToList(params.endpointsByElement, this.sourceId, eS);\n }\n if (eT) {\n _ju.addToList(params.endpointsByElement, this.targetId, eT);\n }\n // if scope not set, set it to be the scope for the source endpoint.\n if (!this.scope) {\n this.scope = this.endpoints[0].scope;\n }\n\n // if explicitly told to (or not to) delete endpoints when empty, override endpoint's preferences\n if (params.deleteEndpointsOnEmpty != null) {\n this.endpoints[0].setDeleteOnEmpty(params.deleteEndpointsOnEmpty);\n this.endpoints[1].setDeleteOnEmpty(params.deleteEndpointsOnEmpty);\n }\n\n// -------------------------- DEFAULT TYPE ---------------------------------------------\n\n // DETACHABLE\n var _detachable = _jsPlumb.Defaults.ConnectionsDetachable;\n if (params.detachable === false) {\n _detachable = false;\n }\n if (this.endpoints[0].connectionsDetachable === false) {\n _detachable = false;\n }\n if (this.endpoints[1].connectionsDetachable === false) {\n _detachable = false;\n }\n // REATTACH\n var _reattach = params.reattach || this.endpoints[0].reattachConnections || this.endpoints[1].reattachConnections || _jsPlumb.Defaults.ReattachConnections;\n\n this.appendToDefaultType({\n detachable: _detachable,\n reattach: _reattach,\n paintStyle:this.endpoints[0].connectorStyle || this.endpoints[1].connectorStyle || params.paintStyle || _jsPlumb.Defaults.PaintStyle || _jp.Defaults.PaintStyle,\n hoverPaintStyle:this.endpoints[0].connectorHoverStyle || this.endpoints[1].connectorHoverStyle || params.hoverPaintStyle || _jsPlumb.Defaults.HoverPaintStyle || _jp.Defaults.HoverPaintStyle\n });\n\n var _suspendedAt = _jsPlumb.getSuspendedAt();\n if (!_jsPlumb.isSuspendDrawing()) {\n // paint the endpoints\n var myInfo = _jsPlumb.getCachedData(this.sourceId),\n myOffset = myInfo.o, myWH = myInfo.s,\n otherInfo = _jsPlumb.getCachedData(this.targetId),\n otherOffset = otherInfo.o,\n otherWH = otherInfo.s,\n initialTimestamp = _suspendedAt || _jsPlumb.timestamp(),\n anchorLoc = this.endpoints[0].anchor.compute({\n xy: [ myOffset.left, myOffset.top ], wh: myWH, element: this.endpoints[0],\n elementId: this.endpoints[0].elementId,\n txy: [ otherOffset.left, otherOffset.top ], twh: otherWH, tElement: this.endpoints[1],\n timestamp: initialTimestamp\n });\n\n this.endpoints[0].paint({ anchorLoc: anchorLoc, timestamp: initialTimestamp });\n\n anchorLoc = this.endpoints[1].anchor.compute({\n xy: [ otherOffset.left, otherOffset.top ], wh: otherWH, element: this.endpoints[1],\n elementId: this.endpoints[1].elementId,\n txy: [ myOffset.left, myOffset.top ], twh: myWH, tElement: this.endpoints[0],\n timestamp: initialTimestamp\n });\n this.endpoints[1].paint({ anchorLoc: anchorLoc, timestamp: initialTimestamp });\n }\n\n this.getTypeDescriptor = function () {\n return \"connection\";\n };\n this.getAttachedElements = function () {\n return this.endpoints;\n };\n\n this.isDetachable = function (ep) {\n return this._jsPlumb.detachable === false ? false : ep != null ? ep.connectionsDetachable === true : this._jsPlumb.detachable === true;\n };\n this.setDetachable = function (detachable) {\n this._jsPlumb.detachable = detachable === true;\n };\n this.isReattach = function () {\n return this._jsPlumb.reattach === true || this.endpoints[0].reattachConnections === true || this.endpoints[1].reattachConnections === true;\n };\n this.setReattach = function (reattach) {\n this._jsPlumb.reattach = reattach === true;\n };\n\n// END INITIALISATION CODE\n\n\n// COST + DIRECTIONALITY\n // if cost not supplied, try to inherit from source endpoint\n this._jsPlumb.cost = params.cost || this.endpoints[0].getConnectionCost();\n this._jsPlumb.directed = params.directed;\n // inherit directed flag if set no source endpoint\n if (params.directed == null) {\n this._jsPlumb.directed = this.endpoints[0].areConnectionsDirected();\n }\n// END COST + DIRECTIONALITY\n\n// PARAMETERS\n // merge all the parameters objects into the connection. parameters set\n // on the connection take precedence; then source endpoint params, then\n // finally target endpoint params.\n var _p = _jp.extend({}, this.endpoints[1].getParameters());\n _jp.extend(_p, this.endpoints[0].getParameters());\n _jp.extend(_p, this.getParameters());\n this.setParameters(_p);\n// END PARAMETERS\n\n// PAINTING\n\n this.setConnector(this.endpoints[0].connector || this.endpoints[1].connector || params.connector || _jsPlumb.Defaults.Connector || _jp.Defaults.Connector, true);\n var data = params.data == null || !_ju.isObject(params.data) ? {} : params.data;\n this.getData = function() { return data; };\n this.setData = function(d) { data = d || {}; };\n this.mergeData = function(d) { data = _jp.extend(data, d); };\n\n // the very last thing we do is apply types, if there are any.\n var _types = [ \"default\", this.endpoints[0].connectionType, this.endpoints[1].connectionType, params.type ].join(\" \");\n if (/[^\\s]/.test(_types)) {\n this.addType(_types, params.data, true);\n }\n\n this.updateConnectedClass();\n\n// END PAINTING \n };\n\n _ju.extend(_jp.Connection, _jp.OverlayCapableJsPlumbUIComponent, {\n applyType: function (t, doNotRepaint, typeMap) {\n\n var _connector = null;\n if (t.connector != null) {\n _connector = this.getCachedTypeItem(\"connector\", typeMap.connector);\n if (_connector == null) {\n _connector = this.prepareConnector(t.connector, typeMap.connector);\n this.cacheTypeItem(\"connector\", _connector, typeMap.connector);\n }\n this.setPreparedConnector(_connector);\n }\n\n // none of these things result in the creation of objects so can be ignored.\n if (t.detachable != null) {\n this.setDetachable(t.detachable);\n }\n if (t.reattach != null) {\n this.setReattach(t.reattach);\n }\n if (t.scope) {\n this.scope = t.scope;\n }\n\n if (t.cssClass != null && this.canvas) {\n this._jsPlumb.instance.addClass(this.canvas, t.cssClass);\n }\n\n var _anchors = null;\n // this also results in the creation of objects.\n if (t.anchor) {\n // note that even if the param was anchor, we store `anchors`.\n _anchors = this.getCachedTypeItem(\"anchors\", typeMap.anchor);\n if (_anchors == null) {\n _anchors = [ this._jsPlumb.instance.makeAnchor(t.anchor), this._jsPlumb.instance.makeAnchor(t.anchor) ];\n this.cacheTypeItem(\"anchors\", _anchors, typeMap.anchor);\n }\n }\n else if (t.anchors) {\n _anchors = this.getCachedTypeItem(\"anchors\", typeMap.anchors);\n if (_anchors == null) {\n _anchors = [\n this._jsPlumb.instance.makeAnchor(t.anchors[0]),\n this._jsPlumb.instance.makeAnchor(t.anchors[1])\n ];\n this.cacheTypeItem(\"anchors\", _anchors, typeMap.anchors);\n }\n }\n if (_anchors != null) {\n this.endpoints[0].anchor = _anchors[0];\n this.endpoints[1].anchor = _anchors[1];\n if (this.endpoints[1].anchor.isDynamic) {\n this._jsPlumb.instance.repaint(this.endpoints[1].elementId);\n }\n }\n\n _jp.OverlayCapableJsPlumbUIComponent.applyType(this, t);\n },\n addClass: function (c, informEndpoints) {\n if (informEndpoints) {\n this.endpoints[0].addClass(c);\n this.endpoints[1].addClass(c);\n if (this.suspendedEndpoint) {\n this.suspendedEndpoint.addClass(c);\n }\n }\n if (this.connector) {\n this.connector.addClass(c);\n }\n },\n removeClass: function (c, informEndpoints) {\n if (informEndpoints) {\n this.endpoints[0].removeClass(c);\n this.endpoints[1].removeClass(c);\n if (this.suspendedEndpoint) {\n this.suspendedEndpoint.removeClass(c);\n }\n }\n if (this.connector) {\n this.connector.removeClass(c);\n }\n },\n isVisible: function () {\n return this._jsPlumb.visible;\n },\n setVisible: function (v) {\n this._jsPlumb.visible = v;\n if (this.connector) {\n this.connector.setVisible(v);\n }\n this.repaint();\n },\n cleanup: function () {\n this.updateConnectedClass(true);\n this.endpoints = null;\n this.source = null;\n this.target = null;\n if (this.connector != null) {\n this.connector.cleanup(true);\n this.connector.destroy(true);\n }\n this.connector = null;\n },\n updateConnectedClass:function(remove) {\n if (this._jsPlumb) {\n _updateConnectedClass(this, this.source, this._jsPlumb.instance, remove);\n _updateConnectedClass(this, this.target, this._jsPlumb.instance, remove);\n }\n },\n setHover: function (state) {\n if (this.connector && this._jsPlumb && !this._jsPlumb.instance.isConnectionBeingDragged()) {\n this.connector.setHover(state);\n root.jsPlumb[state ? \"addClass\" : \"removeClass\"](this.source, this._jsPlumb.instance.hoverSourceClass);\n root.jsPlumb[state ? \"addClass\" : \"removeClass\"](this.target, this._jsPlumb.instance.hoverTargetClass);\n }\n },\n getUuids:function() {\n return [ this.endpoints[0].getUuid(), this.endpoints[1].getUuid() ];\n },\n getCost: function () {\n return this._jsPlumb ? this._jsPlumb.cost : -Infinity;\n },\n setCost: function (c) {\n this._jsPlumb.cost = c;\n },\n isDirected: function () {\n return this._jsPlumb.directed;\n },\n getConnector: function () {\n return this.connector;\n },\n prepareConnector:function(connectorSpec, typeId) {\n var connectorArgs = {\n _jsPlumb: this._jsPlumb.instance,\n cssClass: this._jsPlumb.params.cssClass,\n container: this._jsPlumb.params.container,\n \"pointer-events\": this._jsPlumb.params[\"pointer-events\"]\n },\n renderMode = this._jsPlumb.instance.getRenderMode(),\n connector;\n\n if (_ju.isString(connectorSpec)) {\n connector = makeConnector(this._jsPlumb.instance, renderMode, connectorSpec, connectorArgs, this);\n } // lets you use a string as shorthand.\n else if (_ju.isArray(connectorSpec)) {\n if (connectorSpec.length === 1) {\n connector = makeConnector(this._jsPlumb.instance, renderMode, connectorSpec[0], connectorArgs, this);\n }\n else {\n connector = makeConnector(this._jsPlumb.instance, renderMode, connectorSpec[0], _ju.merge(connectorSpec[1], connectorArgs), this);\n }\n }\n if (typeId != null) {\n connector.typeId = typeId;\n }\n return connector;\n },\n setPreparedConnector: function(connector, doNotRepaint, doNotChangeListenerComponent, typeId) {\n\n if (this.connector !== connector) {\n\n var previous, previousClasses = \"\";\n // the connector will not be cleaned up if it was set as part of a type, because `typeId` will be set on it\n // and we havent passed in `true` for \"force\" here.\n if (this.connector != null) {\n previous = this.connector;\n previousClasses = previous.getClass();\n this.connector.cleanup();\n this.connector.destroy();\n }\n\n this.connector = connector;\n if (typeId) {\n this.cacheTypeItem(\"connector\", connector, typeId);\n }\n\n this.canvas = this.connector.canvas;\n this.bgCanvas = this.connector.bgCanvas;\n\n // put classes from prior connector onto the canvas\n this.addClass(previousClasses);\n\n // new: instead of binding listeners per connector, we now just have one delegate on the container.\n // so for that handler we set the connection as the '_jsPlumb' member of the canvas element, and\n // bgCanvas, if it exists, which it does right now in the VML renderer, so it won't from v 2.0.0 onwards.\n if (this.canvas) {\n this.canvas._jsPlumb = this;\n }\n if (this.bgCanvas) {\n this.bgCanvas._jsPlumb = this;\n }\n\n if (previous != null) {\n var o = this.getOverlays();\n for (var i = 0; i < o.length; i++) {\n if (o[i].transfer) {\n o[i].transfer(this.connector);\n }\n }\n }\n\n if (!doNotChangeListenerComponent) {\n this.setListenerComponent(this.connector);\n }\n if (!doNotRepaint) {\n this.repaint();\n }\n }\n },\n setConnector: function (connectorSpec, doNotRepaint, doNotChangeListenerComponent, typeId) {\n var connector = this.prepareConnector(connectorSpec, typeId);\n this.setPreparedConnector(connector, doNotRepaint, doNotChangeListenerComponent, typeId);\n },\n paint: function (params) {\n\n if (!this._jsPlumb.instance.isSuspendDrawing() && this._jsPlumb.visible) {\n params = params || {};\n var timestamp = params.timestamp,\n // if the moving object is not the source we must transpose the two references.\n swap = false,\n tId = swap ? this.sourceId : this.targetId, sId = swap ? this.targetId : this.sourceId,\n tIdx = swap ? 0 : 1, sIdx = swap ? 1 : 0;\n\n if (timestamp == null || timestamp !== this._jsPlumb.lastPaintedAt) {\n var sourceInfo = this._jsPlumb.instance.updateOffset({elId:sId}).o,\n targetInfo = this._jsPlumb.instance.updateOffset({elId:tId}).o,\n sE = this.endpoints[sIdx], tE = this.endpoints[tIdx];\n\n var sAnchorP = sE.anchor.getCurrentLocation({xy: [sourceInfo.left, sourceInfo.top], wh: [sourceInfo.width, sourceInfo.height], element: sE, timestamp: timestamp}),\n tAnchorP = tE.anchor.getCurrentLocation({xy: [targetInfo.left, targetInfo.top], wh: [targetInfo.width, targetInfo.height], element: tE, timestamp: timestamp});\n\n this.connector.resetBounds();\n\n this.connector.compute({\n sourcePos: sAnchorP,\n targetPos: tAnchorP,\n sourceOrientation:sE.anchor.getOrientation(sE),\n targetOrientation:tE.anchor.getOrientation(tE),\n sourceEndpoint: this.endpoints[sIdx],\n targetEndpoint: this.endpoints[tIdx],\n \"stroke-width\": this._jsPlumb.paintStyleInUse.strokeWidth,\n sourceInfo: sourceInfo,\n targetInfo: targetInfo\n });\n\n var overlayExtents = { minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity };\n\n // compute overlays. we do this first so we can get their placements, and adjust the\n // container if needs be (if an overlay would be clipped)\n for (var i in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays.hasOwnProperty(i)) {\n var o = this._jsPlumb.overlays[i];\n if (o.isVisible()) {\n this._jsPlumb.overlayPlacements[i] = o.draw(this.connector, this._jsPlumb.paintStyleInUse, this.getAbsoluteOverlayPosition(o));\n overlayExtents.minX = Math.min(overlayExtents.minX, this._jsPlumb.overlayPlacements[i].minX);\n overlayExtents.maxX = Math.max(overlayExtents.maxX, this._jsPlumb.overlayPlacements[i].maxX);\n overlayExtents.minY = Math.min(overlayExtents.minY, this._jsPlumb.overlayPlacements[i].minY);\n overlayExtents.maxY = Math.max(overlayExtents.maxY, this._jsPlumb.overlayPlacements[i].maxY);\n }\n }\n }\n\n var lineWidth = parseFloat(this._jsPlumb.paintStyleInUse.strokeWidth || 1) / 2,\n outlineWidth = parseFloat(this._jsPlumb.paintStyleInUse.strokeWidth || 0),\n extents = {\n xmin: Math.min(this.connector.bounds.minX - (lineWidth + outlineWidth), overlayExtents.minX),\n ymin: Math.min(this.connector.bounds.minY - (lineWidth + outlineWidth), overlayExtents.minY),\n xmax: Math.max(this.connector.bounds.maxX + (lineWidth + outlineWidth), overlayExtents.maxX),\n ymax: Math.max(this.connector.bounds.maxY + (lineWidth + outlineWidth), overlayExtents.maxY)\n };\n // paint the connector.\n this.connector.paint(this._jsPlumb.paintStyleInUse, null, extents);\n // and then the overlays\n for (var j in this._jsPlumb.overlays) {\n if (this._jsPlumb.overlays.hasOwnProperty(j)) {\n var p = this._jsPlumb.overlays[j];\n if (p.isVisible()) {\n p.paint(this._jsPlumb.overlayPlacements[j], extents);\n }\n }\n }\n }\n this._jsPlumb.lastPaintedAt = timestamp;\n }\n },\n repaint: function (params) {\n var p = jsPlumb.extend(params || {}, {});\n p.elId = this.sourceId;\n this.paint(p);\n },\n prepareEndpoint: function (_jsPlumb, _newEndpoint, conn, existing, index, params, element, elementId) {\n var e;\n if (existing) {\n conn.endpoints[index] = existing;\n existing.addConnection(conn);\n } else {\n if (!params.endpoints) {\n params.endpoints = [ null, null ];\n }\n var ep = params.endpoints[index] || params.endpoint || _jsPlumb.Defaults.Endpoints[index] || _jp.Defaults.Endpoints[index] || _jsPlumb.Defaults.Endpoint || _jp.Defaults.Endpoint;\n if (!params.endpointStyles) {\n params.endpointStyles = [ null, null ];\n }\n if (!params.endpointHoverStyles) {\n params.endpointHoverStyles = [ null, null ];\n }\n var es = params.endpointStyles[index] || params.endpointStyle || _jsPlumb.Defaults.EndpointStyles[index] || _jp.Defaults.EndpointStyles[index] || _jsPlumb.Defaults.EndpointStyle || _jp.Defaults.EndpointStyle;\n // Endpoints derive their fill from the connector's stroke, if no fill was specified.\n if (es.fill == null && params.paintStyle != null) {\n es.fill = params.paintStyle.stroke;\n }\n\n if (es.outlineStroke == null && params.paintStyle != null) {\n es.outlineStroke = params.paintStyle.outlineStroke;\n }\n if (es.outlineWidth == null && params.paintStyle != null) {\n es.outlineWidth = params.paintStyle.outlineWidth;\n }\n\n var ehs = params.endpointHoverStyles[index] || params.endpointHoverStyle || _jsPlumb.Defaults.EndpointHoverStyles[index] || _jp.Defaults.EndpointHoverStyles[index] || _jsPlumb.Defaults.EndpointHoverStyle || _jp.Defaults.EndpointHoverStyle;\n // endpoint hover fill style is derived from connector's hover stroke style\n if (params.hoverPaintStyle != null) {\n if (ehs == null) {\n ehs = {};\n }\n if (ehs.fill == null) {\n ehs.fill = params.hoverPaintStyle.stroke;\n }\n }\n var a = params.anchors ? params.anchors[index] :\n params.anchor ? params.anchor :\n _makeAnchor(_jsPlumb.Defaults.Anchors[index], elementId, _jsPlumb) ||\n _makeAnchor(_jp.Defaults.Anchors[index], elementId, _jsPlumb) ||\n _makeAnchor(_jsPlumb.Defaults.Anchor, elementId, _jsPlumb) ||\n _makeAnchor(_jp.Defaults.Anchor, elementId, _jsPlumb),\n u = params.uuids ? params.uuids[index] : null;\n\n e = _newEndpoint({\n paintStyle: es, hoverPaintStyle: ehs, endpoint: ep, connections: [ conn ],\n uuid: u, anchor: a, source: element, scope: params.scope,\n reattach: params.reattach || _jsPlumb.Defaults.ReattachConnections,\n detachable: params.detachable || _jsPlumb.Defaults.ConnectionsDetachable\n });\n if (existing == null) {\n e.setDeleteOnEmpty(true);\n }\n conn.endpoints[index] = e;\n\n if (params.drawEndpoints === false) {\n e.setVisible(false, true, true);\n }\n\n }\n return e;\n }\n\n }); // END Connection class \n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains the code for creating and manipulating anchors.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n\n var root = this,\n _ju = root.jsPlumbUtil,\n _jp = root.jsPlumb;\n\n //\n // manages anchors for all elements.\n //\n _jp.AnchorManager = function (params) {\n var _amEndpoints = {},\n continuousAnchorLocations = {},\n continuousAnchorOrientations = {},\n connectionsByElementId = {},\n self = this,\n anchorLists = {},\n jsPlumbInstance = params.jsPlumbInstance,\n floatingConnections = {},\n // used by placeAnchors function\n placeAnchorsOnLine = function (desc, elementDimensions, elementPosition, connections, horizontal, otherMultiplier, reverse) {\n var a = [], step = elementDimensions[horizontal ? 0 : 1] / (connections.length + 1);\n\n for (var i = 0; i < connections.length; i++) {\n var val = (i + 1) * step, other = otherMultiplier * elementDimensions[horizontal ? 1 : 0];\n if (reverse) {\n val = elementDimensions[horizontal ? 0 : 1] - val;\n }\n\n var dx = (horizontal ? val : other), x = elementPosition[0] + dx, xp = dx / elementDimensions[0],\n dy = (horizontal ? other : val), y = elementPosition[1] + dy, yp = dy / elementDimensions[1];\n\n a.push([ x, y, xp, yp, connections[i][1], connections[i][2] ]);\n }\n\n return a;\n },\n // used by edgeSortFunctions\n currySort = function (reverseAngles) {\n return function (a, b) {\n var r = true;\n if (reverseAngles) {\n r = a[0][0] < b[0][0];\n }\n else {\n r = a[0][0] > b[0][0];\n }\n return r === false ? -1 : 1;\n };\n },\n // used by edgeSortFunctions\n leftSort = function (a, b) {\n // first get adjusted values\n var p1 = a[0][0] < 0 ? -Math.PI - a[0][0] : Math.PI - a[0][0],\n p2 = b[0][0] < 0 ? -Math.PI - b[0][0] : Math.PI - b[0][0];\n if (p1 > p2) {\n return 1;\n }\n else {\n return -1;\n }\n },\n // used by placeAnchors\n edgeSortFunctions = {\n \"top\": function (a, b) {\n return a[0] > b[0] ? 1 : -1;\n },\n \"right\": currySort(true),\n \"bottom\": currySort(true),\n \"left\": leftSort\n },\n // used by placeAnchors\n _sortHelper = function (_array, _fn) {\n return _array.sort(_fn);\n },\n // used by AnchorManager.redraw\n placeAnchors = function (elementId, _anchorLists) {\n var cd = jsPlumbInstance.getCachedData(elementId), sS = cd.s, sO = cd.o,\n placeSomeAnchors = function (desc, elementDimensions, elementPosition, unsortedConnections, isHorizontal, otherMultiplier, orientation) {\n if (unsortedConnections.length > 0) {\n var sc = _sortHelper(unsortedConnections, edgeSortFunctions[desc]), // puts them in order based on the target element's pos on screen\n reverse = desc === \"right\" || desc === \"top\",\n anchors = placeAnchorsOnLine(desc, elementDimensions,\n elementPosition, sc,\n isHorizontal, otherMultiplier, reverse);\n\n // takes a computed anchor position and adjusts it for parent offset and scroll, then stores it.\n var _setAnchorLocation = function (endpoint, anchorPos) {\n continuousAnchorLocations[endpoint.id] = [ anchorPos[0], anchorPos[1], anchorPos[2], anchorPos[3] ];\n continuousAnchorOrientations[endpoint.id] = orientation;\n };\n\n for (var i = 0; i < anchors.length; i++) {\n var c = anchors[i][4], weAreSource = c.endpoints[0].elementId === elementId, weAreTarget = c.endpoints[1].elementId === elementId;\n if (weAreSource) {\n _setAnchorLocation(c.endpoints[0], anchors[i]);\n }\n if (weAreTarget) {\n _setAnchorLocation(c.endpoints[1], anchors[i]);\n }\n }\n }\n };\n\n placeSomeAnchors(\"bottom\", sS, [sO.left, sO.top], _anchorLists.bottom, true, 1, [0, 1]);\n placeSomeAnchors(\"top\", sS, [sO.left, sO.top], _anchorLists.top, true, 0, [0, -1]);\n placeSomeAnchors(\"left\", sS, [sO.left, sO.top], _anchorLists.left, false, 0, [-1, 0]);\n placeSomeAnchors(\"right\", sS, [sO.left, sO.top], _anchorLists.right, false, 1, [1, 0]);\n };\n\n this.reset = function () {\n _amEndpoints = {};\n connectionsByElementId = {};\n anchorLists = {};\n };\n this.addFloatingConnection = function (key, conn) {\n floatingConnections[key] = conn;\n };\n this.removeFloatingConnection = function (key) {\n delete floatingConnections[key];\n };\n this.newConnection = function (conn) {\n var sourceId = conn.sourceId, targetId = conn.targetId,\n ep = conn.endpoints,\n doRegisterTarget = true,\n registerConnection = function (otherIndex, otherEndpoint, otherAnchor, elId, c) {\n if ((sourceId === targetId) && otherAnchor.isContinuous) {\n // remove the target endpoint's canvas. we dont need it.\n conn._jsPlumb.instance.removeElement(ep[1].canvas);\n doRegisterTarget = false;\n }\n _ju.addToList(connectionsByElementId, elId, [c, otherEndpoint, otherAnchor.constructor === _jp.DynamicAnchor]);\n };\n\n registerConnection(0, ep[0], ep[0].anchor, targetId, conn);\n if (doRegisterTarget) {\n registerConnection(1, ep[1], ep[1].anchor, sourceId, conn);\n }\n };\n var removeEndpointFromAnchorLists = function (endpoint) {\n (function (list, eId) {\n if (list) { // transient anchors dont get entries in this list.\n var f = function (e) {\n return e[4] === eId;\n };\n _ju.removeWithFunction(list.top, f);\n _ju.removeWithFunction(list.left, f);\n _ju.removeWithFunction(list.bottom, f);\n _ju.removeWithFunction(list.right, f);\n }\n })(anchorLists[endpoint.elementId], endpoint.id);\n };\n this.connectionDetached = function (connInfo, doNotRedraw) {\n var connection = connInfo.connection || connInfo,\n sourceId = connInfo.sourceId,\n targetId = connInfo.targetId,\n ep = connection.endpoints,\n removeConnection = function (otherIndex, otherEndpoint, otherAnchor, elId, c) {\n _ju.removeWithFunction(connectionsByElementId[elId], function (_c) {\n return _c[0].id === c.id;\n });\n };\n\n removeConnection(1, ep[1], ep[1].anchor, sourceId, connection);\n removeConnection(0, ep[0], ep[0].anchor, targetId, connection);\n if (connection.floatingId) {\n removeConnection(connection.floatingIndex, connection.floatingEndpoint, connection.floatingEndpoint.anchor, connection.floatingId, connection);\n removeEndpointFromAnchorLists(connection.floatingEndpoint);\n }\n\n // remove from anchorLists\n removeEndpointFromAnchorLists(connection.endpoints[0]);\n removeEndpointFromAnchorLists(connection.endpoints[1]);\n\n if (!doNotRedraw) {\n self.redraw(connection.sourceId);\n if (connection.targetId !== connection.sourceId) {\n self.redraw(connection.targetId);\n }\n }\n };\n this.add = function (endpoint, elementId) {\n _ju.addToList(_amEndpoints, elementId, endpoint);\n };\n this.changeId = function (oldId, newId) {\n connectionsByElementId[newId] = connectionsByElementId[oldId];\n _amEndpoints[newId] = _amEndpoints[oldId];\n delete connectionsByElementId[oldId];\n delete _amEndpoints[oldId];\n };\n this.getConnectionsFor = function (elementId) {\n return connectionsByElementId[elementId] || [];\n };\n this.getEndpointsFor = function (elementId) {\n return _amEndpoints[elementId] || [];\n };\n this.deleteEndpoint = function (endpoint) {\n _ju.removeWithFunction(_amEndpoints[endpoint.elementId], function (e) {\n return e.id === endpoint.id;\n });\n removeEndpointFromAnchorLists(endpoint);\n };\n this.clearFor = function (elementId) {\n delete _amEndpoints[elementId];\n _amEndpoints[elementId] = [];\n };\n // updates the given anchor list by either updating an existing anchor's info, or adding it. this function\n // also removes the anchor from its previous list, if the edge it is on has changed.\n // all connections found along the way (those that are connected to one of the faces this function\n // operates on) are added to the connsToPaint list, as are their endpoints. in this way we know to repaint\n // them wthout having to calculate anything else about them.\n var _updateAnchorList = function (lists, theta, order, conn, aBoolean, otherElId, idx, reverse, edgeId, elId, connsToPaint, endpointsToPaint) {\n // first try to find the exact match, but keep track of the first index of a matching element id along the way.s\n var exactIdx = -1,\n firstMatchingElIdx = -1,\n endpoint = conn.endpoints[idx],\n endpointId = endpoint.id,\n oIdx = [1, 0][idx],\n values = [\n [ theta, order ],\n conn,\n aBoolean,\n otherElId,\n endpointId\n ],\n listToAddTo = lists[edgeId],\n listToRemoveFrom = endpoint._continuousAnchorEdge ? lists[endpoint._continuousAnchorEdge] : null,\n i,\n candidate;\n\n if (listToRemoveFrom) {\n var rIdx = _ju.findWithFunction(listToRemoveFrom, function (e) {\n return e[4] === endpointId;\n });\n if (rIdx !== -1) {\n listToRemoveFrom.splice(rIdx, 1);\n // get all connections from this list\n for (i = 0; i < listToRemoveFrom.length; i++) {\n candidate = listToRemoveFrom[i][1];\n _ju.addWithFunction(connsToPaint, candidate, function (c) {\n return c.id === candidate.id;\n });\n _ju.addWithFunction(endpointsToPaint, listToRemoveFrom[i][1].endpoints[idx], function (e) {\n return e.id === candidate.endpoints[idx].id;\n });\n _ju.addWithFunction(endpointsToPaint, listToRemoveFrom[i][1].endpoints[oIdx], function (e) {\n return e.id === candidate.endpoints[oIdx].id;\n });\n }\n }\n }\n\n for (i = 0; i < listToAddTo.length; i++) {\n candidate = listToAddTo[i][1];\n if (params.idx === 1 && listToAddTo[i][3] === otherElId && firstMatchingElIdx === -1) {\n firstMatchingElIdx = i;\n }\n _ju.addWithFunction(connsToPaint, candidate, function (c) {\n return c.id === candidate.id;\n });\n _ju.addWithFunction(endpointsToPaint, listToAddTo[i][1].endpoints[idx], function (e) {\n return e.id === candidate.endpoints[idx].id;\n });\n _ju.addWithFunction(endpointsToPaint, listToAddTo[i][1].endpoints[oIdx], function (e) {\n return e.id === candidate.endpoints[oIdx].id;\n });\n }\n if (exactIdx !== -1) {\n listToAddTo[exactIdx] = values;\n }\n else {\n var insertIdx = reverse ? firstMatchingElIdx !== -1 ? firstMatchingElIdx : 0 : listToAddTo.length; // of course we will get this from having looked through the array shortly.\n listToAddTo.splice(insertIdx, 0, values);\n }\n\n // store this for next time.\n endpoint._continuousAnchorEdge = edgeId;\n };\n\n //\n // find the entry in an endpoint's list for this connection and update its target endpoint\n // with the current target in the connection.\n // This method and sourceChanged need to be folder into one.\n //\n this.updateOtherEndpoint = function (sourceElId, oldTargetId, newTargetId, connection) {\n var sIndex = _ju.findWithFunction(connectionsByElementId[sourceElId], function (i) {\n return i[0].id === connection.id;\n }),\n tIndex = _ju.findWithFunction(connectionsByElementId[oldTargetId], function (i) {\n return i[0].id === connection.id;\n });\n\n // update or add data for source\n if (sIndex !== -1) {\n connectionsByElementId[sourceElId][sIndex][0] = connection;\n connectionsByElementId[sourceElId][sIndex][1] = connection.endpoints[1];\n connectionsByElementId[sourceElId][sIndex][2] = connection.endpoints[1].anchor.constructor === _jp.DynamicAnchor;\n }\n\n // remove entry for previous target (if there)\n if (tIndex > -1) {\n connectionsByElementId[oldTargetId].splice(tIndex, 1);\n // add entry for new target\n _ju.addToList(connectionsByElementId, newTargetId, [connection, connection.endpoints[0], connection.endpoints[0].anchor.constructor === _jp.DynamicAnchor]);\n }\n\n connection.updateConnectedClass();\n };\n\n //\n // notification that the connection given has changed source from the originalId to the newId.\n // This involves:\n // 1. removing the connection from the list of connections stored for the originalId\n // 2. updating the source information for the target of the connection\n // 3. re-registering the connection in connectionsByElementId with the newId\n //\n this.sourceChanged = function (originalId, newId, connection, newElement) {\n if (originalId !== newId) {\n\n connection.sourceId = newId;\n connection.source = newElement;\n\n // remove the entry that points from the old source to the target\n _ju.removeWithFunction(connectionsByElementId[originalId], function (info) {\n return info[0].id === connection.id;\n });\n // find entry for target and update it\n var tIdx = _ju.findWithFunction(connectionsByElementId[connection.targetId], function (i) {\n return i[0].id === connection.id;\n });\n if (tIdx > -1) {\n connectionsByElementId[connection.targetId][tIdx][0] = connection;\n connectionsByElementId[connection.targetId][tIdx][1] = connection.endpoints[0];\n connectionsByElementId[connection.targetId][tIdx][2] = connection.endpoints[0].anchor.constructor === _jp.DynamicAnchor;\n }\n // add entry for new source\n _ju.addToList(connectionsByElementId, newId, [connection, connection.endpoints[1], connection.endpoints[1].anchor.constructor === _jp.DynamicAnchor]);\n\n // TODO SP not final on this yet. when a user drags an existing connection and it turns into a self\n // loop, then this code hides the target endpoint (by removing it from the DOM) But I think this should\n // occur only if the anchor is Continuous\n if (connection.endpoints[1].anchor.isContinuous) {\n if (connection.source === connection.target) {\n connection._jsPlumb.instance.removeElement(connection.endpoints[1].canvas);\n }\n else {\n if (connection.endpoints[1].canvas.parentNode == null) {\n connection._jsPlumb.instance.appendElement(connection.endpoints[1].canvas);\n }\n }\n }\n\n connection.updateConnectedClass();\n }\n };\n\n //\n // moves the given endpoint from `currentId` to `element`.\n // This involves:\n //\n // 1. changing the key in _amEndpoints under which the endpoint is stored\n // 2. changing the source or target values in all of the endpoint's connections\n // 3. changing the array in connectionsByElementId in which the endpoint's connections\n // are stored (done by either sourceChanged or updateOtherEndpoint)\n //\n this.rehomeEndpoint = function (ep, currentId, element) {\n var eps = _amEndpoints[currentId] || [],\n elementId = jsPlumbInstance.getId(element);\n\n if (elementId !== currentId) {\n var idx = eps.indexOf(ep);\n if (idx > -1) {\n var _ep = eps.splice(idx, 1)[0];\n self.add(_ep, elementId);\n }\n }\n\n for (var i = 0; i < ep.connections.length; i++) {\n if (ep.connections[i].sourceId === currentId) {\n self.sourceChanged(currentId, ep.elementId, ep.connections[i], ep.element);\n }\n else if (ep.connections[i].targetId === currentId) {\n ep.connections[i].targetId = ep.elementId;\n ep.connections[i].target = ep.element;\n self.updateOtherEndpoint(ep.connections[i].sourceId, currentId, ep.elementId, ep.connections[i]);\n }\n }\n };\n\n this.redraw = function (elementId, ui, timestamp, offsetToUI, clearEdits, doNotRecalcEndpoint) {\n\n if (!jsPlumbInstance.isSuspendDrawing()) {\n // get all the endpoints for this element\n var ep = _amEndpoints[elementId] || [],\n endpointConnections = connectionsByElementId[elementId] || [],\n connectionsToPaint = [],\n endpointsToPaint = [],\n anchorsToUpdate = [];\n\n timestamp = timestamp || jsPlumbInstance.timestamp();\n // offsetToUI are values that would have been calculated in the dragManager when registering\n // an endpoint for an element that had a parent (somewhere in the hierarchy) that had been\n // registered as draggable.\n offsetToUI = offsetToUI || {left: 0, top: 0};\n if (ui) {\n ui = {\n left: ui.left + offsetToUI.left,\n top: ui.top + offsetToUI.top\n };\n }\n\n // valid for one paint cycle.\n var myOffset = jsPlumbInstance.updateOffset({ elId: elementId, offset: ui, recalc: false, timestamp: timestamp }),\n orientationCache = {};\n\n // actually, first we should compute the orientation of this element to all other elements to which\n // this element is connected with a continuous anchor (whether both ends of the connection have\n // a continuous anchor or just one)\n\n for (var i = 0; i < endpointConnections.length; i++) {\n var conn = endpointConnections[i][0],\n sourceId = conn.sourceId,\n targetId = conn.targetId,\n sourceContinuous = conn.endpoints[0].anchor.isContinuous,\n targetContinuous = conn.endpoints[1].anchor.isContinuous;\n\n if (sourceContinuous || targetContinuous) {\n var oKey = sourceId + \"_\" + targetId,\n o = orientationCache[oKey],\n oIdx = conn.sourceId === elementId ? 1 : 0;\n\n if (sourceContinuous && !anchorLists[sourceId]) {\n anchorLists[sourceId] = { top: [], right: [], bottom: [], left: [] };\n }\n if (targetContinuous && !anchorLists[targetId]) {\n anchorLists[targetId] = { top: [], right: [], bottom: [], left: [] };\n }\n\n if (elementId !== targetId) {\n jsPlumbInstance.updateOffset({ elId: targetId, timestamp: timestamp });\n }\n if (elementId !== sourceId) {\n jsPlumbInstance.updateOffset({ elId: sourceId, timestamp: timestamp });\n }\n\n var td = jsPlumbInstance.getCachedData(targetId),\n sd = jsPlumbInstance.getCachedData(sourceId);\n\n if (targetId === sourceId && (sourceContinuous || targetContinuous)) {\n // here we may want to improve this by somehow determining the face we'd like\n // to put the connector on. ideally, when drawing, the face should be calculated\n // by determining which face is closest to the point at which the mouse button\n // was released. for now, we're putting it on the top face.\n _updateAnchorList( anchorLists[sourceId], -Math.PI / 2, 0, conn, false, targetId, 0, false, \"top\", sourceId, connectionsToPaint, endpointsToPaint);\n _updateAnchorList( anchorLists[targetId], -Math.PI / 2, 0, conn, false, sourceId, 1, false, \"top\", targetId, connectionsToPaint, endpointsToPaint);\n }\n else {\n if (!o) {\n o = this.calculateOrientation(sourceId, targetId, sd.o, td.o, conn.endpoints[0].anchor, conn.endpoints[1].anchor, conn);\n orientationCache[oKey] = o;\n // this would be a performance enhancement, but the computed angles need to be clamped to\n //the (-PI/2 -> PI/2) range in order for the sorting to work properly.\n /* orientationCache[oKey2] = {\n orientation:o.orientation,\n a:[o.a[1], o.a[0]],\n theta:o.theta + Math.PI,\n theta2:o.theta2 + Math.PI\n };*/\n }\n if (sourceContinuous) {\n _updateAnchorList(anchorLists[sourceId], o.theta, 0, conn, false, targetId, 0, false, o.a[0], sourceId, connectionsToPaint, endpointsToPaint);\n }\n if (targetContinuous) {\n _updateAnchorList(anchorLists[targetId], o.theta2, -1, conn, true, sourceId, 1, true, o.a[1], targetId, connectionsToPaint, endpointsToPaint);\n }\n }\n\n if (sourceContinuous) {\n _ju.addWithFunction(anchorsToUpdate, sourceId, function (a) {\n return a === sourceId;\n });\n }\n if (targetContinuous) {\n _ju.addWithFunction(anchorsToUpdate, targetId, function (a) {\n return a === targetId;\n });\n }\n _ju.addWithFunction(connectionsToPaint, conn, function (c) {\n return c.id === conn.id;\n });\n if ((sourceContinuous && oIdx === 0) || (targetContinuous && oIdx === 1)) {\n _ju.addWithFunction(endpointsToPaint, conn.endpoints[oIdx], function (e) {\n return e.id === conn.endpoints[oIdx].id;\n });\n }\n }\n }\n\n // place Endpoints whose anchors are continuous but have no Connections\n for (i = 0; i < ep.length; i++) {\n if (ep[i].connections.length === 0 && ep[i].anchor.isContinuous) {\n if (!anchorLists[elementId]) {\n anchorLists[elementId] = { top: [], right: [], bottom: [], left: [] };\n }\n _updateAnchorList(anchorLists[elementId], -Math.PI / 2, 0, {endpoints: [ep[i], ep[i]], paint: function () {\n }}, false, elementId, 0, false, ep[i].anchor.getDefaultFace(), elementId, connectionsToPaint, endpointsToPaint);\n _ju.addWithFunction(anchorsToUpdate, elementId, function (a) {\n return a === elementId;\n });\n }\n }\n\n // now place all the continuous anchors we need to;\n for (i = 0; i < anchorsToUpdate.length; i++) {\n placeAnchors(anchorsToUpdate[i], anchorLists[anchorsToUpdate[i]]);\n }\n\n // now that continuous anchors have been placed, paint all the endpoints for this element\n for (i = 0; i < ep.length; i++) {\n ep[i].paint({ timestamp: timestamp, offset: myOffset, dimensions: myOffset.s, recalc: doNotRecalcEndpoint !== true });\n }\n\n // ... and any other endpoints we came across as a result of the continuous anchors.\n for (i = 0; i < endpointsToPaint.length; i++) {\n var cd = jsPlumbInstance.getCachedData(endpointsToPaint[i].elementId);\n //endpointsToPaint[i].paint({ timestamp: timestamp, offset: cd, dimensions: cd.s });\n endpointsToPaint[i].paint({ timestamp: null, offset: cd, dimensions: cd.s });\n }\n\n // paint all the standard and \"dynamic connections\", which are connections whose other anchor is\n // static and therefore does need to be recomputed; we make sure that happens only one time.\n\n // TODO we could have compiled a list of these in the first pass through connections; might save some time.\n for (i = 0; i < endpointConnections.length; i++) {\n var otherEndpoint = endpointConnections[i][1];\n if (otherEndpoint.anchor.constructor === _jp.DynamicAnchor) {\n otherEndpoint.paint({ elementWithPrecedence: elementId, timestamp: timestamp });\n _ju.addWithFunction(connectionsToPaint, endpointConnections[i][0], function (c) {\n return c.id === endpointConnections[i][0].id;\n });\n // all the connections for the other endpoint now need to be repainted\n for (var k = 0; k < otherEndpoint.connections.length; k++) {\n if (otherEndpoint.connections[k] !== endpointConnections[i][0]) {\n _ju.addWithFunction(connectionsToPaint, otherEndpoint.connections[k], function (c) {\n return c.id === otherEndpoint.connections[k].id;\n });\n }\n }\n } else {\n _ju.addWithFunction(connectionsToPaint, endpointConnections[i][0], function (c) {\n return c.id === endpointConnections[i][0].id;\n });\n }\n }\n\n // paint current floating connection for this element, if there is one.\n var fc = floatingConnections[elementId];\n if (fc) {\n fc.paint({timestamp: timestamp, recalc: false, elId: elementId});\n }\n\n // paint all the connections\n for (i = 0; i < connectionsToPaint.length; i++) {\n connectionsToPaint[i].paint({elId: elementId, timestamp: null, recalc: false, clearEdits: clearEdits});\n }\n }\n };\n\n var ContinuousAnchor = function (anchorParams) {\n _ju.EventGenerator.apply(this);\n this.type = \"Continuous\";\n this.isDynamic = true;\n this.isContinuous = true;\n var faces = anchorParams.faces || [\"top\", \"right\", \"bottom\", \"left\"],\n clockwise = !(anchorParams.clockwise === false),\n availableFaces = { },\n opposites = { \"top\": \"bottom\", \"right\": \"left\", \"left\": \"right\", \"bottom\": \"top\" },\n clockwiseOptions = { \"top\": \"right\", \"right\": \"bottom\", \"left\": \"top\", \"bottom\": \"left\" },\n antiClockwiseOptions = { \"top\": \"left\", \"right\": \"top\", \"left\": \"bottom\", \"bottom\": \"right\" },\n secondBest = clockwise ? clockwiseOptions : antiClockwiseOptions,\n lastChoice = clockwise ? antiClockwiseOptions : clockwiseOptions,\n cssClass = anchorParams.cssClass || \"\",\n _currentFace = null, _lockedFace = null, X_AXIS_FACES = [\"left\", \"right\"], Y_AXIS_FACES = [\"top\", \"bottom\"],\n _lockedAxis = null;\n\n for (var i = 0; i < faces.length; i++) {\n availableFaces[faces[i]] = true;\n }\n\n this.getDefaultFace = function () {\n return faces.length === 0 ? \"top\" : faces[0];\n };\n\n this.isRelocatable = function() { return true; };\n this.isSnapOnRelocate = function() { return true; };\n\n // if the given edge is supported, returns it. otherwise looks for a substitute that _is_\n // supported. if none supported we also return the request edge.\n this.verifyEdge = function (edge) {\n if (availableFaces[edge]) {\n return edge;\n }\n else if (availableFaces[opposites[edge]]) {\n return opposites[edge];\n }\n else if (availableFaces[secondBest[edge]]) {\n return secondBest[edge];\n }\n else if (availableFaces[lastChoice[edge]]) {\n return lastChoice[edge];\n }\n return edge; // we have to give them something.\n };\n\n this.isEdgeSupported = function (edge) {\n return _lockedAxis == null ?\n\n (_lockedFace == null ? availableFaces[edge] === true : _lockedFace === edge)\n\n : _lockedAxis.indexOf(edge) !== -1;\n };\n\n this.setCurrentFace = function(face, overrideLock) {\n _currentFace = face;\n // if currently locked, and the user wants to override, do that.\n if (overrideLock && _lockedFace != null) {\n _lockedFace = _currentFace;\n }\n };\n\n this.getCurrentFace = function() { return _currentFace; };\n this.getSupportedFaces = function() {\n var af = [];\n for (var k in availableFaces) {\n if (availableFaces[k]) {\n af.push(k);\n }\n }\n return af;\n };\n\n this.lock = function() {\n _lockedFace = _currentFace;\n };\n this.unlock = function() {\n _lockedFace = null;\n };\n this.isLocked = function() {\n return _lockedFace != null;\n };\n\n this.lockCurrentAxis = function() {\n if (_currentFace != null) {\n _lockedAxis = (_currentFace === \"left\" || _currentFace === \"right\") ? X_AXIS_FACES : Y_AXIS_FACES;\n }\n };\n\n this.unlockCurrentAxis = function() {\n _lockedAxis = null;\n };\n\n this.compute = function (params) {\n return continuousAnchorLocations[params.element.id] || [0, 0];\n };\n this.getCurrentLocation = function (params) {\n return continuousAnchorLocations[params.element.id] || [0, 0];\n };\n this.getOrientation = function (endpoint) {\n return continuousAnchorOrientations[endpoint.id] || [0, 0];\n };\n this.getCssClass = function () {\n return cssClass;\n };\n };\n\n // continuous anchors\n jsPlumbInstance.continuousAnchorFactory = {\n get: function (params) {\n return new ContinuousAnchor(params);\n },\n clear: function (elementId) {\n delete continuousAnchorLocations[elementId];\n }\n };\n };\n\n _jp.AnchorManager.prototype.calculateOrientation = function (sourceId, targetId, sd, td, sourceAnchor, targetAnchor) {\n\n var Orientation = { HORIZONTAL: \"horizontal\", VERTICAL: \"vertical\", DIAGONAL: \"diagonal\", IDENTITY: \"identity\" },\n axes = [\"left\", \"top\", \"right\", \"bottom\"];\n\n if (sourceId === targetId) {\n return {\n orientation: Orientation.IDENTITY,\n a: [\"top\", \"top\"]\n };\n }\n\n var theta = Math.atan2((td.centery - sd.centery), (td.centerx - sd.centerx)),\n theta2 = Math.atan2((sd.centery - td.centery), (sd.centerx - td.centerx));\n\n// --------------------------------------------------------------------------------------\n\n // improved face calculation. get midpoints of each face for source and target, then put in an array with all combinations of\n // source/target faces. sort this array by distance between midpoints. the entry at index 0 is our preferred option. we can\n // go through the array one by one until we find an entry in which each requested face is supported.\n var candidates = [], midpoints = { };\n (function (types, dim) {\n for (var i = 0; i < types.length; i++) {\n midpoints[types[i]] = {\n \"left\": [ dim[i].left, dim[i].centery ],\n \"right\": [ dim[i].right, dim[i].centery ],\n \"top\": [ dim[i].centerx, dim[i].top ],\n \"bottom\": [ dim[i].centerx , dim[i].bottom]\n };\n }\n })([ \"source\", \"target\" ], [ sd, td ]);\n\n for (var sf = 0; sf < axes.length; sf++) {\n for (var tf = 0; tf < axes.length; tf++) {\n candidates.push({\n source: axes[sf],\n target: axes[tf],\n dist: Biltong.lineLength(midpoints.source[axes[sf]], midpoints.target[axes[tf]])\n });\n }\n }\n\n candidates.sort(function (a, b) {\n return a.dist < b.dist ? -1 : a.dist > b.dist ? 1 : 0;\n });\n\n // now go through this list and try to get an entry that satisfies both (there will be one, unless one of the anchors\n // declares no available faces)\n var sourceEdge = candidates[0].source, targetEdge = candidates[0].target;\n for (var i = 0; i < candidates.length; i++) {\n\n if (!sourceAnchor.isContinuous || sourceAnchor.isEdgeSupported(candidates[i].source)) {\n sourceEdge = candidates[i].source;\n }\n else {\n sourceEdge = null;\n }\n\n if (!targetAnchor.isContinuous || targetAnchor.isEdgeSupported(candidates[i].target)) {\n targetEdge = candidates[i].target;\n }\n else {\n targetEdge = null;\n }\n\n if (sourceEdge != null && targetEdge != null) {\n break;\n }\n }\n\n if (sourceAnchor.isContinuous) {\n sourceAnchor.setCurrentFace(sourceEdge);\n }\n\n if (targetAnchor.isContinuous) {\n targetAnchor.setCurrentFace(targetEdge);\n }\n\n// --------------------------------------------------------------------------------------\n\n return {\n a: [ sourceEdge, targetEdge ],\n theta: theta,\n theta2: theta2\n };\n };\n\n /**\n * Anchors model a position on some element at which an Endpoint may be located. They began as a first class citizen of jsPlumb, ie. a user\n * was required to create these themselves, but over time this has been replaced by the concept of referring to them either by name (eg. \"TopMiddle\"),\n * or by an array describing their coordinates (eg. [ 0, 0.5, 0, -1 ], which is the same as \"TopMiddle\"). jsPlumb now handles all of the\n * creation of Anchors without user intervention.\n */\n _jp.Anchor = function (params) {\n this.x = params.x || 0;\n this.y = params.y || 0;\n this.elementId = params.elementId;\n this.cssClass = params.cssClass || \"\";\n this.userDefinedLocation = null;\n this.orientation = params.orientation || [ 0, 0 ];\n this.lastReturnValue = null;\n this.offsets = params.offsets || [ 0, 0 ];\n this.timestamp = null;\n\n var relocatable = params.relocatable !== false;\n this.isRelocatable = function() { return relocatable; };\n this.setRelocatable = function(_relocatable) { relocatable = _relocatable; };\n var snapOnRelocate = params.snapOnRelocate !== false;\n this.isSnapOnRelocate = function() { return snapOnRelocate; };\n\n var locked = false;\n this.lock = function() { locked = true; };\n this.unlock = function() { locked = false; };\n this.isLocked = function() { return locked; };\n\n _ju.EventGenerator.apply(this);\n\n this.compute = function (params) {\n\n var xy = params.xy, wh = params.wh, timestamp = params.timestamp;\n\n if (params.clearUserDefinedLocation) {\n this.userDefinedLocation = null;\n }\n\n if (timestamp && timestamp === this.timestamp) {\n return this.lastReturnValue;\n }\n\n if (this.userDefinedLocation != null) {\n this.lastReturnValue = this.userDefinedLocation;\n }\n else {\n this.lastReturnValue = [ xy[0] + (this.x * wh[0]) + this.offsets[0], xy[1] + (this.y * wh[1]) + this.offsets[1], this.x, this.y ];\n }\n\n this.timestamp = timestamp;\n return this.lastReturnValue;\n };\n\n this.getCurrentLocation = function (params) {\n params = params || {};\n return (this.lastReturnValue == null || (params.timestamp != null && this.timestamp !== params.timestamp)) ? this.compute(params) : this.lastReturnValue;\n };\n\n this.setPosition = function(x, y, ox, oy, overrideLock) {\n if (!locked || overrideLock) {\n this.x = x;\n this.y = y;\n this.orientation = [ ox, oy ];\n this.lastReturnValue = null;\n }\n };\n };\n _ju.extend(_jp.Anchor, _ju.EventGenerator, {\n equals: function (anchor) {\n if (!anchor) {\n return false;\n }\n var ao = anchor.getOrientation(),\n o = this.getOrientation();\n return this.x === anchor.x && this.y === anchor.y && this.offsets[0] === anchor.offsets[0] && this.offsets[1] === anchor.offsets[1] && o[0] === ao[0] && o[1] === ao[1];\n },\n getUserDefinedLocation: function () {\n return this.userDefinedLocation;\n },\n setUserDefinedLocation: function (l) {\n this.userDefinedLocation = l;\n },\n clearUserDefinedLocation: function () {\n this.userDefinedLocation = null;\n },\n getOrientation: function () {\n return this.orientation;\n },\n getCssClass: function () {\n return this.cssClass;\n }\n });\n\n /**\n * An Anchor that floats. its orientation is computed dynamically from\n * its position relative to the anchor it is floating relative to. It is used when creating\n * a connection through drag and drop.\n *\n * TODO FloatingAnchor could totally be refactored to extend Anchor just slightly.\n */\n _jp.FloatingAnchor = function (params) {\n\n _jp.Anchor.apply(this, arguments);\n\n // this is the anchor that this floating anchor is referenced to for\n // purposes of calculating the orientation.\n var ref = params.reference,\n // the canvas this refers to.\n refCanvas = params.referenceCanvas,\n size = _jp.getSize(refCanvas),\n // these are used to store the current relative position of our\n // anchor wrt the reference anchor. they only indicate\n // direction, so have a value of 1 or -1 (or, very rarely, 0). these\n // values are written by the compute method, and read\n // by the getOrientation method.\n xDir = 0, yDir = 0,\n // temporary member used to store an orientation when the floating\n // anchor is hovering over another anchor.\n orientation = null,\n _lastResult = null;\n\n // clear from parent. we want floating anchor orientation to always be computed.\n this.orientation = null;\n\n // set these to 0 each; they are used by certain types of connectors in the loopback case,\n // when the connector is trying to clear the element it is on. but for floating anchor it's not\n // very important.\n this.x = 0;\n this.y = 0;\n\n this.isFloating = true;\n\n this.compute = function (params) {\n var xy = params.xy,\n result = [ xy[0] + (size[0] / 2), xy[1] + (size[1] / 2) ]; // return origin of the element. we may wish to improve this so that any object can be the drag proxy.\n _lastResult = result;\n return result;\n };\n\n this.getOrientation = function (_endpoint) {\n if (orientation) {\n return orientation;\n }\n else {\n var o = ref.getOrientation(_endpoint);\n // here we take into account the orientation of the other\n // anchor: if it declares zero for some direction, we declare zero too. this might not be the most awesome. perhaps we can come\n // up with a better way. it's just so that the line we draw looks like it makes sense. maybe this wont make sense.\n return [ Math.abs(o[0]) * xDir * -1,\n Math.abs(o[1]) * yDir * -1 ];\n }\n };\n\n /**\n * notification the endpoint associated with this anchor is hovering\n * over another anchor; we want to assume that anchor's orientation\n * for the duration of the hover.\n */\n this.over = function (anchor, endpoint) {\n orientation = anchor.getOrientation(endpoint);\n };\n\n /**\n * notification the endpoint associated with this anchor is no\n * longer hovering over another anchor; we should resume calculating\n * orientation as we normally do.\n */\n this.out = function () {\n orientation = null;\n };\n\n this.getCurrentLocation = function (params) {\n return _lastResult == null ? this.compute(params) : _lastResult;\n };\n };\n _ju.extend(_jp.FloatingAnchor, _jp.Anchor);\n\n var _convertAnchor = function (anchor, jsPlumbInstance, elementId) {\n return anchor.constructor === _jp.Anchor ? anchor : jsPlumbInstance.makeAnchor(anchor, elementId, jsPlumbInstance);\n };\n\n /* \n * A DynamicAnchor is an Anchor that contains a list of other Anchors, which it cycles\n * through at compute time to find the one that is located closest to\n * the center of the target element, and returns that Anchor's compute\n * method result. this causes endpoints to follow each other with\n * respect to the orientation of their target elements, which is a useful\n * feature for some applications.\n * \n */\n _jp.DynamicAnchor = function (params) {\n _jp.Anchor.apply(this, arguments);\n\n this.isDynamic = true;\n this.anchors = [];\n this.elementId = params.elementId;\n this.jsPlumbInstance = params.jsPlumbInstance;\n\n for (var i = 0; i < params.anchors.length; i++) {\n this.anchors[i] = _convertAnchor(params.anchors[i], this.jsPlumbInstance, this.elementId);\n }\n\n this.getAnchors = function () {\n return this.anchors;\n };\n\n var _curAnchor = this.anchors.length > 0 ? this.anchors[0] : null,\n _lastAnchor = _curAnchor,\n self = this,\n\n // helper method to calculate the distance between the centers of the two elements.\n _distance = function (anchor, cx, cy, xy, wh) {\n var ax = xy[0] + (anchor.x * wh[0]), ay = xy[1] + (anchor.y * wh[1]),\n acx = xy[0] + (wh[0] / 2), acy = xy[1] + (wh[1] / 2);\n return (Math.sqrt(Math.pow(cx - ax, 2) + Math.pow(cy - ay, 2)) +\n Math.sqrt(Math.pow(acx - ax, 2) + Math.pow(acy - ay, 2)));\n },\n // default method uses distance between element centers. you can provide your own method in the dynamic anchor\n // constructor (and also to jsPlumb.makeDynamicAnchor). the arguments to it are four arrays:\n // xy - xy loc of the anchor's element\n // wh - anchor's element's dimensions\n // txy - xy loc of the element of the other anchor in the connection\n // twh - dimensions of the element of the other anchor in the connection.\n // anchors - the list of selectable anchors\n _anchorSelector = params.selector || function (xy, wh, txy, twh, anchors) {\n var cx = txy[0] + (twh[0] / 2), cy = txy[1] + (twh[1] / 2);\n var minIdx = -1, minDist = Infinity;\n for (var i = 0; i < anchors.length; i++) {\n var d = _distance(anchors[i], cx, cy, xy, wh);\n if (d < minDist) {\n minIdx = i + 0;\n minDist = d;\n }\n }\n return anchors[minIdx];\n };\n\n this.compute = function (params) {\n var xy = params.xy, wh = params.wh, txy = params.txy, twh = params.twh;\n\n this.timestamp = params.timestamp;\n\n var udl = self.getUserDefinedLocation();\n if (udl != null) {\n return udl;\n }\n\n // if anchor is locked or an opposite element was not given, we\n // maintain our state. anchor will be locked\n // if it is the source of a drag and drop.\n if (this.isLocked() || txy == null || twh == null) {\n return _curAnchor.compute(params);\n }\n else {\n params.timestamp = null; // otherwise clear this, i think. we want the anchor to compute.\n }\n\n _curAnchor = _anchorSelector(xy, wh, txy, twh, this.anchors);\n this.x = _curAnchor.x;\n this.y = _curAnchor.y;\n\n if (_curAnchor !== _lastAnchor) {\n this.fire(\"anchorChanged\", _curAnchor);\n }\n\n _lastAnchor = _curAnchor;\n\n return _curAnchor.compute(params);\n };\n\n this.getCurrentLocation = function (params) {\n return this.getUserDefinedLocation() || (_curAnchor != null ? _curAnchor.getCurrentLocation(params) : null);\n };\n\n this.getOrientation = function (_endpoint) {\n return _curAnchor != null ? _curAnchor.getOrientation(_endpoint) : [ 0, 0 ];\n };\n this.over = function (anchor, endpoint) {\n if (_curAnchor != null) {\n _curAnchor.over(anchor, endpoint);\n }\n };\n this.out = function () {\n if (_curAnchor != null) {\n _curAnchor.out();\n }\n };\n\n this.setAnchor = function(a) {\n _curAnchor = a;\n };\n\n this.getCssClass = function () {\n return (_curAnchor && _curAnchor.getCssClass()) || \"\";\n };\n\n /**\n * Attempt to match an anchor with the given coordinates and then set it.\n * @param coords\n * @returns true if matching anchor found, false otherwise.\n */\n this.setAnchorCoordinates = function(coords) {\n var idx = jsPlumbUtil.findWithFunction(this.anchors, function(a) {\n return a.x === coords[0] && a.y === coords[1];\n });\n if (idx !== -1) {\n this.setAnchor(this.anchors[idx]);\n return true;\n } else {\n return false;\n }\n };\n };\n _ju.extend(_jp.DynamicAnchor, _jp.Anchor);\n\n// -------- basic anchors ------------------ \n var _curryAnchor = function (x, y, ox, oy, type, fnInit) {\n _jp.Anchors[type] = function (params) {\n var a = params.jsPlumbInstance.makeAnchor([ x, y, ox, oy, 0, 0 ], params.elementId, params.jsPlumbInstance);\n a.type = type;\n if (fnInit) {\n fnInit(a, params);\n }\n return a;\n };\n };\n\n _curryAnchor(0.5, 0, 0, -1, \"TopCenter\");\n _curryAnchor(0.5, 1, 0, 1, \"BottomCenter\");\n _curryAnchor(0, 0.5, -1, 0, \"LeftMiddle\");\n _curryAnchor(1, 0.5, 1, 0, \"RightMiddle\");\n\n _curryAnchor(0.5, 0, 0, -1, \"Top\");\n _curryAnchor(0.5, 1, 0, 1, \"Bottom\");\n _curryAnchor(0, 0.5, -1, 0, \"Left\");\n _curryAnchor(1, 0.5, 1, 0, \"Right\");\n _curryAnchor(0.5, 0.5, 0, 0, \"Center\");\n _curryAnchor(1, 0, 0, -1, \"TopRight\");\n _curryAnchor(1, 1, 0, 1, \"BottomRight\");\n _curryAnchor(0, 0, 0, -1, \"TopLeft\");\n _curryAnchor(0, 1, 0, 1, \"BottomLeft\");\n\n// ------- dynamic anchors ------------------- \n\n // default dynamic anchors chooses from Top, Right, Bottom, Left\n _jp.Defaults.DynamicAnchors = function (params) {\n return params.jsPlumbInstance.makeAnchors([\"TopCenter\", \"RightMiddle\", \"BottomCenter\", \"LeftMiddle\"], params.elementId, params.jsPlumbInstance);\n };\n\n // default dynamic anchors bound to name 'AutoDefault'\n _jp.Anchors.AutoDefault = function (params) {\n var a = params.jsPlumbInstance.makeDynamicAnchor(_jp.Defaults.DynamicAnchors(params));\n a.type = \"AutoDefault\";\n return a;\n };\n\n// ------- continuous anchors ------------------- \n\n var _curryContinuousAnchor = function (type, faces) {\n _jp.Anchors[type] = function (params) {\n var a = params.jsPlumbInstance.makeAnchor([\"Continuous\", { faces: faces }], params.elementId, params.jsPlumbInstance);\n a.type = type;\n return a;\n };\n };\n\n _jp.Anchors.Continuous = function (params) {\n return params.jsPlumbInstance.continuousAnchorFactory.get(params);\n };\n\n _curryContinuousAnchor(\"ContinuousLeft\", [\"left\"]);\n _curryContinuousAnchor(\"ContinuousTop\", [\"top\"]);\n _curryContinuousAnchor(\"ContinuousBottom\", [\"bottom\"]);\n _curryContinuousAnchor(\"ContinuousRight\", [\"right\"]);\n\n// ------- position assign anchors ------------------- \n\n // this anchor type lets you assign the position at connection time.\n _curryAnchor(0, 0, 0, 0, \"Assign\", function (anchor, params) {\n // find what to use as the \"position finder\". the user may have supplied a String which represents\n // the id of a position finder in jsPlumb.AnchorPositionFinders, or the user may have supplied the\n // position finder as a function. we find out what to use and then set it on the anchor.\n var pf = params.position || \"Fixed\";\n anchor.positionFinder = pf.constructor === String ? params.jsPlumbInstance.AnchorPositionFinders[pf] : pf;\n // always set the constructor params; the position finder might need them later (the Grid one does,\n // for example)\n anchor.constructorParams = params;\n });\n\n // these are the default anchor positions finders, which are used by the makeTarget function. supplying\n // a position finder argument to that function allows you to specify where the resulting anchor will\n // be located\n root.jsPlumbInstance.prototype.AnchorPositionFinders = {\n \"Fixed\": function (dp, ep, es) {\n return [ (dp.left - ep.left) / es[0], (dp.top - ep.top) / es[1] ];\n },\n \"Grid\": function (dp, ep, es, params) {\n var dx = dp.left - ep.left, dy = dp.top - ep.top,\n gx = es[0] / (params.grid[0]), gy = es[1] / (params.grid[1]),\n mx = Math.floor(dx / gx), my = Math.floor(dy / gy);\n return [ ((mx * gx) + (gx / 2)) / es[0], ((my * gy) + (gy / 2)) / es[1] ];\n }\n };\n\n// ------- perimeter anchors ------------------- \n\n _jp.Anchors.Perimeter = function (params) {\n params = params || {};\n var anchorCount = params.anchorCount || 60,\n shape = params.shape;\n\n if (!shape) {\n throw new Error(\"no shape supplied to Perimeter Anchor type\");\n }\n\n var _circle = function () {\n var r = 0.5, step = Math.PI * 2 / anchorCount, current = 0, a = [];\n for (var i = 0; i < anchorCount; i++) {\n var x = r + (r * Math.sin(current)),\n y = r + (r * Math.cos(current));\n a.push([ x, y, 0, 0 ]);\n current += step;\n }\n return a;\n },\n _path = function (segments) {\n var anchorsPerFace = anchorCount / segments.length, a = [],\n _computeFace = function (x1, y1, x2, y2, fractionalLength) {\n anchorsPerFace = anchorCount * fractionalLength;\n var dx = (x2 - x1) / anchorsPerFace, dy = (y2 - y1) / anchorsPerFace;\n for (var i = 0; i < anchorsPerFace; i++) {\n a.push([\n x1 + (dx * i),\n y1 + (dy * i),\n 0,\n 0\n ]);\n }\n };\n\n for (var i = 0; i < segments.length; i++) {\n _computeFace.apply(null, segments[i]);\n }\n\n return a;\n },\n _shape = function (faces) {\n var s = [];\n for (var i = 0; i < faces.length; i++) {\n s.push([faces[i][0], faces[i][1], faces[i][2], faces[i][3], 1 / faces.length]);\n }\n return _path(s);\n },\n _rectangle = function () {\n return _shape([\n [ 0, 0, 1, 0 ],\n [ 1, 0, 1, 1 ],\n [ 1, 1, 0, 1 ],\n [ 0, 1, 0, 0 ]\n ]);\n };\n\n var _shapes = {\n \"Circle\": _circle,\n \"Ellipse\": _circle,\n \"Diamond\": function () {\n return _shape([\n [ 0.5, 0, 1, 0.5 ],\n [ 1, 0.5, 0.5, 1 ],\n [ 0.5, 1, 0, 0.5 ],\n [ 0, 0.5, 0.5, 0 ]\n ]);\n },\n \"Rectangle\": _rectangle,\n \"Square\": _rectangle,\n \"Triangle\": function () {\n return _shape([\n [ 0.5, 0, 1, 1 ],\n [ 1, 1, 0, 1 ],\n [ 0, 1, 0.5, 0]\n ]);\n },\n \"Path\": function (params) {\n var points = params.points, p = [], tl = 0;\n for (var i = 0; i < points.length - 1; i++) {\n var l = Math.sqrt(Math.pow(points[i][2] - points[i][0]) + Math.pow(points[i][3] - points[i][1]));\n tl += l;\n p.push([points[i][0], points[i][1], points[i + 1][0], points[i + 1][1], l]);\n }\n for (var j = 0; j < p.length; j++) {\n p[j][4] = p[j][4] / tl;\n }\n return _path(p);\n }\n },\n _rotate = function (points, amountInDegrees) {\n var o = [], theta = amountInDegrees / 180 * Math.PI;\n for (var i = 0; i < points.length; i++) {\n var _x = points[i][0] - 0.5,\n _y = points[i][1] - 0.5;\n\n o.push([\n 0.5 + ((_x * Math.cos(theta)) - (_y * Math.sin(theta))),\n 0.5 + ((_x * Math.sin(theta)) + (_y * Math.cos(theta))),\n points[i][2],\n points[i][3]\n ]);\n }\n return o;\n };\n\n if (!_shapes[shape]) {\n throw new Error(\"Shape [\" + shape + \"] is unknown by Perimeter Anchor type\");\n }\n\n var da = _shapes[shape](params);\n if (params.rotation) {\n da = _rotate(da, params.rotation);\n }\n var a = params.jsPlumbInstance.makeDynamicAnchor(da);\n a.type = \"Perimeter\";\n return a;\n };\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the default Connectors, Endpoint and Overlay definitions.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n * \n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil, _jg = root.Biltong;\n\n _jp.Segments = {\n\n /*\n * Class: AbstractSegment\n * A Connector is made up of 1..N Segments, each of which has a Type, such as 'Straight', 'Arc',\n * 'Bezier'. This is new from 1.4.2, and gives us a lot more flexibility when drawing connections: things such\n * as rounded corners for flowchart connectors, for example, or a straight line stub for Bezier connections, are\n * much easier to do now.\n *\n * A Segment is responsible for providing coordinates for painting it, and also must be able to report its length.\n * \n */\n AbstractSegment: function (params) {\n this.params = params;\n\n /**\n * Function: findClosestPointOnPath\n * Finds the closest point on this segment to the given [x, y],\n * returning both the x and y of the point plus its distance from\n * the supplied point, and its location along the length of the\n * path inscribed by the segment. This implementation returns\n * Infinity for distance and null values for everything else;\n * subclasses are expected to override.\n */\n this.findClosestPointOnPath = function (x, y) {\n return {\n d: Infinity,\n x: null,\n y: null,\n l: null\n };\n };\n\n this.getBounds = function () {\n return {\n minX: Math.min(params.x1, params.x2),\n minY: Math.min(params.y1, params.y2),\n maxX: Math.max(params.x1, params.x2),\n maxY: Math.max(params.y1, params.y2)\n };\n };\n\n /**\n * Computes the list of points on the segment that intersect the given line.\n * @method lineIntersection\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @returns {Array<[number, number]>}\n */\n this.lineIntersection = function(x1, y1, x2, y2) {\n return [];\n };\n\n /**\n * Computes the list of points on the segment that intersect the box with the given origin and size.\n * @method boxIntersection\n * @param {number} x1\n * @param {number} y1\n * @param {number} w\n * @param {number} h\n * @returns {Array<[number, number]>}\n */\n this.boxIntersection = function(x, y, w, h) {\n var a = [];\n a.push.apply(a, this.lineIntersection(x, y, x + w, y));\n a.push.apply(a, this.lineIntersection(x + w, y, x + w, y + h));\n a.push.apply(a, this.lineIntersection(x + w, y + h, x, y + h));\n a.push.apply(a, this.lineIntersection(x, y + h, x, y));\n return a;\n };\n\n /**\n * Computes the list of points on the segment that intersect the given bounding box, which is an object of the form { x:.., y:.., w:.., h:.. }.\n * @method lineIntersection\n * @param {BoundingRectangle} box\n * @returns {Array<[number, number]>}\n */\n this.boundingBoxIntersection = function(box) {\n return this.boxIntersection(box.x, box.y, box.w, box.y);\n };\n },\n Straight: function (params) {\n var _super = _jp.Segments.AbstractSegment.apply(this, arguments),\n length, m, m2, x1, x2, y1, y2,\n _recalc = function () {\n length = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n m = _jg.gradient({x: x1, y: y1}, {x: x2, y: y2});\n m2 = -1 / m;\n };\n\n this.type = \"Straight\";\n\n this.getLength = function () {\n return length;\n };\n this.getGradient = function () {\n return m;\n };\n\n this.getCoordinates = function () {\n return { x1: x1, y1: y1, x2: x2, y2: y2 };\n };\n this.setCoordinates = function (coords) {\n x1 = coords.x1;\n y1 = coords.y1;\n x2 = coords.x2;\n y2 = coords.y2;\n _recalc();\n };\n this.setCoordinates({x1: params.x1, y1: params.y1, x2: params.x2, y2: params.y2});\n\n this.getBounds = function () {\n return {\n minX: Math.min(x1, x2),\n minY: Math.min(y1, y2),\n maxX: Math.max(x1, x2),\n maxY: Math.max(y1, y2)\n };\n };\n\n /**\n * returns the point on the segment's path that is 'location' along the length of the path, where 'location' is a decimal from\n * 0 to 1 inclusive. for the straight line segment this is simple maths.\n */\n this.pointOnPath = function (location, absolute) {\n if (location === 0 && !absolute) {\n return { x: x1, y: y1 };\n }\n else if (location === 1 && !absolute) {\n return { x: x2, y: y2 };\n }\n else {\n var l = absolute ? location > 0 ? location : length + location : location * length;\n return _jg.pointOnLine({x: x1, y: y1}, {x: x2, y: y2}, l);\n }\n };\n\n /**\n * returns the gradient of the segment at the given point - which for us is constant.\n */\n this.gradientAtPoint = function (_) {\n return m;\n };\n\n /**\n * returns the point on the segment's path that is 'distance' along the length of the path from 'location', where\n * 'location' is a decimal from 0 to 1 inclusive, and 'distance' is a number of pixels.\n * this hands off to jsPlumbUtil to do the maths, supplying two points and the distance.\n */\n this.pointAlongPathFrom = function (location, distance, absolute) {\n var p = this.pointOnPath(location, absolute),\n farAwayPoint = distance <= 0 ? {x: x1, y: y1} : {x: x2, y: y2 };\n\n /*\n location == 1 ? {\n x:x1 + ((x2 - x1) * 10),\n y:y1 + ((y1 - y2) * 10)\n } :\n */\n\n if (distance <= 0 && Math.abs(distance) > 1) {\n distance *= -1;\n }\n\n return _jg.pointOnLine(p, farAwayPoint, distance);\n };\n\n // is c between a and b?\n var within = function (a, b, c) {\n return c >= Math.min(a, b) && c <= Math.max(a, b);\n };\n // find which of a and b is closest to c\n var closest = function (a, b, c) {\n return Math.abs(c - a) < Math.abs(c - b) ? a : b;\n };\n\n /**\n Function: findClosestPointOnPath\n Finds the closest point on this segment to [x,y]. See\n notes on this method in AbstractSegment.\n */\n this.findClosestPointOnPath = function (x, y) {\n var out = {\n d: Infinity,\n x: null,\n y: null,\n l: null,\n x1: x1,\n x2: x2,\n y1: y1,\n y2: y2\n };\n\n if (m === 0) {\n out.y = y1;\n out.x = within(x1, x2, x) ? x : closest(x1, x2, x);\n }\n else if (m === Infinity || m === -Infinity) {\n out.x = x1;\n out.y = within(y1, y2, y) ? y : closest(y1, y2, y);\n }\n else {\n // closest point lies on normal from given point to this line. \n var b = y1 - (m * x1),\n b2 = y - (m2 * x),\n // y1 = m.x1 + b and y1 = m2.x1 + b2\n // so m.x1 + b = m2.x1 + b2\n // x1(m - m2) = b2 - b\n // x1 = (b2 - b) / (m - m2)\n _x1 = (b2 - b) / (m - m2),\n _y1 = (m * _x1) + b;\n\n out.x = within(x1, x2, _x1) ? _x1 : closest(x1, x2, _x1);//_x1;\n out.y = within(y1, y2, _y1) ? _y1 : closest(y1, y2, _y1);//_y1;\n }\n\n var fractionInSegment = _jg.lineLength([ out.x, out.y ], [ x1, y1 ]);\n out.d = _jg.lineLength([x, y], [out.x, out.y]);\n out.l = fractionInSegment / length;\n return out;\n };\n\n var _pointLiesBetween = function(q, p1, p2) {\n return (p2 > p1) ? (p1 <= q && q <= p2) : (p1 >= q && q >= p2);\n }, _plb = _pointLiesBetween;\n\n /**\n * Calculates all intersections of the given line with this segment.\n * @param _x1\n * @param _y1\n * @param _x2\n * @param _y2\n * @returns {Array}\n */\n this.lineIntersection = function(_x1, _y1, _x2, _y2) {\n var m2 = Math.abs(_jg.gradient({x: _x1, y: _y1}, {x: _x2, y: _y2})),\n m1 = Math.abs(m),\n b = m1 === Infinity ? x1 : y1 - (m1 * x1),\n out = [],\n b2 = m2 === Infinity ? _x1 : _y1 - (m2 * _x1);\n\n // if lines parallel, no intersection\n if (m2 !== m1) {\n // perpendicular, segment horizontal\n if(m2 === Infinity && m1 === 0) {\n if (_plb(_x1, x1, x2) && _plb(y1, _y1, _y2)) {\n out = [ _x1, y1 ]; // we return X on the incident line and Y from the segment\n }\n } else if(m2 === 0 && m1 === Infinity) {\n // perpendicular, segment vertical\n if(_plb(_y1, y1, y2) && _plb(x1, _x1, _x2)) {\n out = [x1, _y1]; // we return X on the segment and Y from the incident line\n }\n } else {\n var X, Y;\n if (m2 === Infinity) {\n // test line is a vertical line. where does it cross the segment?\n X = _x1;\n if (_plb(X, x1, x2)) {\n Y = (m1 * _x1) + b;\n if (_plb(Y, _y1, _y2)) {\n out = [ X, Y ];\n }\n }\n } else if (m2 === 0) {\n Y = _y1;\n // test line is a horizontal line. where does it cross the segment?\n if (_plb(Y, y1, y2)) {\n X = (_y1 - b) / m1;\n if (_plb(X, _x1, _x2)) {\n out = [ X, Y ];\n }\n }\n } else {\n // mX + b = m2X + b2\n // mX - m2X = b2 - b\n // X(m - m2) = b2 - b\n // X = (b2 - b) / (m - m2)\n // Y = mX + b\n X = (b2 - b) / (m1 - m2);\n Y = (m1 * X) + b;\n if(_plb(X, x1, x2) && _plb(Y, y1, y2)) {\n out = [ X, Y];\n }\n }\n }\n }\n\n return out;\n };\n\n /**\n * Calculates all intersections of the given box with this segment. By default this method simply calls `lineIntersection` with each of the four\n * faces of the box; subclasses can override this if they think there's a faster way to compute the entire box at once.\n * @param x X position of top left corner of box\n * @param y Y position of top left corner of box\n * @param w width of box\n * @param h height of box\n * @returns {Array}\n */\n this.boxIntersection = function(x, y, w, h) {\n var a = [];\n a.push.apply(a, this.lineIntersection(x, y, x + w, y));\n a.push.apply(a, this.lineIntersection(x + w, y, x + w, y + h));\n a.push.apply(a, this.lineIntersection(x + w, y + h, x, y + h));\n a.push.apply(a, this.lineIntersection(x, y + h, x, y));\n return a;\n };\n\n /**\n * Calculates all intersections of the given bounding box with this segment. By default this method simply calls `lineIntersection` with each of the four\n * faces of the box; subclasses can override this if they think there's a faster way to compute the entire box at once.\n * @param box Bounding box, in { x:.., y:..., w:..., h:... } format.\n * @returns {Array}\n */\n this.boundingBoxIntersection = function(box) {\n return this.boxIntersection(box.x, box.y, box.w, box.h);\n };\n },\n\n /*\n Arc Segment. You need to supply:\n\n r - radius\n cx - center x for the arc\n cy - center y for the arc\n ac - whether the arc is anticlockwise or not. default is clockwise.\n\n and then either:\n\n startAngle - startAngle for the arc.\n endAngle - endAngle for the arc.\n\n or:\n\n x1 - x for start point\n y1 - y for start point\n x2 - x for end point\n y2 - y for end point\n\n */\n Arc: function (params) {\n var _super = _jp.Segments.AbstractSegment.apply(this, arguments),\n _calcAngle = function (_x, _y) {\n return _jg.theta([params.cx, params.cy], [_x, _y]);\n },\n _calcAngleForLocation = function (segment, location) {\n if (segment.anticlockwise) {\n var sa = segment.startAngle < segment.endAngle ? segment.startAngle + TWO_PI : segment.startAngle,\n s = Math.abs(sa - segment.endAngle);\n return sa - (s * location);\n }\n else {\n var ea = segment.endAngle < segment.startAngle ? segment.endAngle + TWO_PI : segment.endAngle,\n ss = Math.abs(ea - segment.startAngle);\n\n return segment.startAngle + (ss * location);\n }\n },\n TWO_PI = 2 * Math.PI;\n\n this.radius = params.r;\n this.anticlockwise = params.ac;\n this.type = \"Arc\";\n\n if (params.startAngle && params.endAngle) {\n this.startAngle = params.startAngle;\n this.endAngle = params.endAngle;\n this.x1 = params.cx + (this.radius * Math.cos(params.startAngle));\n this.y1 = params.cy + (this.radius * Math.sin(params.startAngle));\n this.x2 = params.cx + (this.radius * Math.cos(params.endAngle));\n this.y2 = params.cy + (this.radius * Math.sin(params.endAngle));\n }\n else {\n this.startAngle = _calcAngle(params.x1, params.y1);\n this.endAngle = _calcAngle(params.x2, params.y2);\n this.x1 = params.x1;\n this.y1 = params.y1;\n this.x2 = params.x2;\n this.y2 = params.y2;\n }\n\n if (this.endAngle < 0) {\n this.endAngle += TWO_PI;\n }\n if (this.startAngle < 0) {\n this.startAngle += TWO_PI;\n }\n\n // segment is used by vml \n //this.segment = _jg.quadrant([this.x1, this.y1], [this.x2, this.y2]);\n\n // we now have startAngle and endAngle as positive numbers, meaning the\n // absolute difference (|d|) between them is the sweep (s) of this arc, unless the\n // arc is 'anticlockwise' in which case 's' is given by 2PI - |d|.\n\n var ea = this.endAngle < this.startAngle ? this.endAngle + TWO_PI : this.endAngle;\n this.sweep = Math.abs(ea - this.startAngle);\n if (this.anticlockwise) {\n this.sweep = TWO_PI - this.sweep;\n }\n var circumference = 2 * Math.PI * this.radius,\n frac = this.sweep / TWO_PI,\n length = circumference * frac;\n\n this.getLength = function () {\n return length;\n };\n\n this.getBounds = function () {\n return {\n minX: params.cx - params.r,\n maxX: params.cx + params.r,\n minY: params.cy - params.r,\n maxY: params.cy + params.r\n };\n };\n\n var VERY_SMALL_VALUE = 0.0000000001,\n gentleRound = function (n) {\n var f = Math.floor(n), r = Math.ceil(n);\n if (n - f < VERY_SMALL_VALUE) {\n return f;\n }\n else if (r - n < VERY_SMALL_VALUE) {\n return r;\n }\n return n;\n };\n\n /**\n * returns the point on the segment's path that is 'location' along the length of the path, where 'location' is a decimal from\n * 0 to 1 inclusive.\n */\n this.pointOnPath = function (location, absolute) {\n\n if (location === 0) {\n return { x: this.x1, y: this.y1, theta: this.startAngle };\n }\n else if (location === 1) {\n return { x: this.x2, y: this.y2, theta: this.endAngle };\n }\n\n if (absolute) {\n location = location / length;\n }\n\n var angle = _calcAngleForLocation(this, location),\n _x = params.cx + (params.r * Math.cos(angle)),\n _y = params.cy + (params.r * Math.sin(angle));\n\n return { x: gentleRound(_x), y: gentleRound(_y), theta: angle };\n };\n\n /**\n * returns the gradient of the segment at the given point.\n */\n this.gradientAtPoint = function (location, absolute) {\n var p = this.pointOnPath(location, absolute);\n var m = _jg.normal([ params.cx, params.cy ], [p.x, p.y ]);\n if (!this.anticlockwise && (m === Infinity || m === -Infinity)) {\n m *= -1;\n }\n return m;\n };\n\n this.pointAlongPathFrom = function (location, distance, absolute) {\n var p = this.pointOnPath(location, absolute),\n arcSpan = distance / circumference * 2 * Math.PI,\n dir = this.anticlockwise ? -1 : 1,\n startAngle = p.theta + (dir * arcSpan),\n startX = params.cx + (this.radius * Math.cos(startAngle)),\n startY = params.cy + (this.radius * Math.sin(startAngle));\n\n return {x: startX, y: startY};\n };\n\n // TODO: lineIntersection\n },\n\n Bezier: function (params) {\n this.curve = [\n { x: params.x1, y: params.y1},\n { x: params.cp1x, y: params.cp1y },\n { x: params.cp2x, y: params.cp2y },\n { x: params.x2, y: params.y2 }\n ];\n\n var _super = _jp.Segments.AbstractSegment.apply(this, arguments);\n // although this is not a strictly rigorous determination of bounds\n // of a bezier curve, it works for the types of curves that this segment\n // type produces.\n this.bounds = {\n minX: Math.min(params.x1, params.x2, params.cp1x, params.cp2x),\n minY: Math.min(params.y1, params.y2, params.cp1y, params.cp2y),\n maxX: Math.max(params.x1, params.x2, params.cp1x, params.cp2x),\n maxY: Math.max(params.y1, params.y2, params.cp1y, params.cp2y)\n };\n\n this.type = \"Bezier\";\n\n var _translateLocation = function (_curve, location, absolute) {\n if (absolute) {\n location = root.jsBezier.locationAlongCurveFrom(_curve, location > 0 ? 0 : 1, location);\n }\n\n return location;\n };\n\n /**\n * returns the point on the segment's path that is 'location' along the length of the path, where 'location' is a decimal from\n * 0 to 1 inclusive.\n */\n this.pointOnPath = function (location, absolute) {\n location = _translateLocation(this.curve, location, absolute);\n return root.jsBezier.pointOnCurve(this.curve, location);\n };\n\n /**\n * returns the gradient of the segment at the given point.\n */\n this.gradientAtPoint = function (location, absolute) {\n location = _translateLocation(this.curve, location, absolute);\n return root.jsBezier.gradientAtPoint(this.curve, location);\n };\n\n this.pointAlongPathFrom = function (location, distance, absolute) {\n location = _translateLocation(this.curve, location, absolute);\n return root.jsBezier.pointAlongCurveFrom(this.curve, location, distance);\n };\n\n this.getLength = function () {\n return root.jsBezier.getLength(this.curve);\n };\n\n this.getBounds = function () {\n return this.bounds;\n };\n\n this.findClosestPointOnPath = function (x, y) {\n var p = root.jsBezier.nearestPointOnCurve({x:x,y:y}, this.curve);\n return {\n d:Math.sqrt(Math.pow(p.point.x - x, 2) + Math.pow(p.point.y - y, 2)),\n x:p.point.x,\n y:p.point.y,\n l:p.location,\n s:this\n };\n };\n\n this.lineIntersection = function(x1, y1, x2, y2) {\n return root.jsBezier.lineIntersection(x1, y1, x2, y2, this.curve);\n };\n }\n };\n\n _jp.SegmentRenderer = {\n getPath: function (segment, isFirstSegment) {\n return ({\n \"Straight\": function (isFirstSegment) {\n var d = segment.getCoordinates();\n return (isFirstSegment ? \"M \" + d.x1 + \" \" + d.y1 + \" \" : \"\") + \"L \" + d.x2 + \" \" + d.y2;\n },\n \"Bezier\": function (isFirstSegment) {\n var d = segment.params;\n return (isFirstSegment ? \"M \" + d.x2 + \" \" + d.y2 + \" \" : \"\") +\n \"C \" + d.cp2x + \" \" + d.cp2y + \" \" + d.cp1x + \" \" + d.cp1y + \" \" + d.x1 + \" \" + d.y1;\n },\n \"Arc\": function (isFirstSegment) {\n var d = segment.params,\n laf = segment.sweep > Math.PI ? 1 : 0,\n sf = segment.anticlockwise ? 0 : 1;\n\n return (isFirstSegment ? \"M\" + segment.x1 + \" \" + segment.y1 + \" \" : \"\") + \"A \" + segment.radius + \" \" + d.r + \" 0 \" + laf + \",\" + sf + \" \" + segment.x2 + \" \" + segment.y2;\n }\n })[segment.type](isFirstSegment);\n }\n };\n\n /*\n Class: UIComponent\n Superclass for Connector and AbstractEndpoint.\n */\n var AbstractComponent = function () {\n this.resetBounds = function () {\n this.bounds = { minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity };\n };\n this.resetBounds();\n };\n\n /*\n * Class: Connector\n * Superclass for all Connectors; here is where Segments are managed. This is exposed on jsPlumb just so it\n * can be accessed from other files. You should not try to instantiate one of these directly.\n *\n * When this class is asked for a pointOnPath, or gradient etc, it must first figure out which segment to dispatch\n * that request to. This is done by keeping track of the total connector length as segments are added, and also\n * their cumulative ratios to the total length. Then when the right segment is found it is a simple case of dispatching\n * the request to it (and adjusting 'location' so that it is relative to the beginning of that segment.)\n */\n _jp.Connectors.AbstractConnector = function (params) {\n\n AbstractComponent.apply(this, arguments);\n\n var segments = [],\n totalLength = 0,\n segmentProportions = [],\n segmentProportionalLengths = [],\n stub = params.stub || 0,\n sourceStub = _ju.isArray(stub) ? stub[0] : stub,\n targetStub = _ju.isArray(stub) ? stub[1] : stub,\n gap = params.gap || 0,\n sourceGap = _ju.isArray(gap) ? gap[0] : gap,\n targetGap = _ju.isArray(gap) ? gap[1] : gap,\n userProvidedSegments = null,\n paintInfo = null;\n\n this.getPathData = function() {\n var p = \"\";\n for (var i = 0; i < segments.length; i++) {\n p += _jp.SegmentRenderer.getPath(segments[i], i === 0);\n p += \" \";\n }\n return p;\n };\n\n /**\n * Function: findSegmentForPoint\n * Returns the segment that is closest to the given [x,y],\n * null if nothing found. This function returns a JS\n * object with:\n *\n * d - distance from segment\n * l - proportional location in segment\n * x - x point on the segment\n * y - y point on the segment\n * s - the segment itself.\n */\n this.findSegmentForPoint = function (x, y) {\n var out = { d: Infinity, s: null, x: null, y: null, l: null };\n for (var i = 0; i < segments.length; i++) {\n var _s = segments[i].findClosestPointOnPath(x, y);\n if (_s.d < out.d) {\n out.d = _s.d;\n out.l = _s.l;\n out.x = _s.x;\n out.y = _s.y;\n out.s = segments[i];\n out.x1 = _s.x1;\n out.x2 = _s.x2;\n out.y1 = _s.y1;\n out.y2 = _s.y2;\n out.index = i;\n }\n }\n\n return out;\n };\n\n this.lineIntersection = function(x1, y1, x2, y2) {\n var out = [];\n for (var i = 0; i < segments.length; i++) {\n out.push.apply(out, segments[i].lineIntersection(x1, y1, x2, y2));\n }\n return out;\n };\n\n this.boxIntersection = function(x, y, w, h) {\n var out = [];\n for (var i = 0; i < segments.length; i++) {\n out.push.apply(out, segments[i].boxIntersection(x, y, w, h));\n }\n return out;\n };\n\n this.boundingBoxIntersection = function(box) {\n var out = [];\n for (var i = 0; i < segments.length; i++) {\n out.push.apply(out, segments[i].boundingBoxIntersection(box));\n }\n return out;\n };\n\n var _updateSegmentProportions = function () {\n var curLoc = 0;\n for (var i = 0; i < segments.length; i++) {\n var sl = segments[i].getLength();\n segmentProportionalLengths[i] = sl / totalLength;\n segmentProportions[i] = [curLoc, (curLoc += (sl / totalLength)) ];\n }\n },\n\n /**\n * returns [segment, proportion of travel in segment, segment index] for the segment\n * that contains the point which is 'location' distance along the entire path, where\n * 'location' is a decimal between 0 and 1 inclusive. in this connector type, paths\n * are made up of a list of segments, each of which contributes some fraction to\n * the total length.\n * From 1.3.10 this also supports the 'absolute' property, which lets us specify a location\n * as the absolute distance in pixels, rather than a proportion of the total path.\n */\n _findSegmentForLocation = function (location, absolute) {\n if (absolute) {\n location = location > 0 ? location / totalLength : (totalLength + location) / totalLength;\n }\n var idx = segmentProportions.length - 1, inSegmentProportion = 1;\n for (var i = 0; i < segmentProportions.length; i++) {\n if (segmentProportions[i][1] >= location) {\n idx = i;\n // todo is this correct for all connector path types?\n inSegmentProportion = location === 1 ? 1 : location === 0 ? 0 : (location - segmentProportions[i][0]) / segmentProportionalLengths[i];\n break;\n }\n }\n return { segment: segments[idx], proportion: inSegmentProportion, index: idx };\n },\n _addSegment = function (conn, type, params) {\n if (params.x1 === params.x2 && params.y1 === params.y2) {\n return;\n }\n var s = new _jp.Segments[type](params);\n segments.push(s);\n totalLength += s.getLength();\n conn.updateBounds(s);\n },\n _clearSegments = function () {\n totalLength = segments.length = segmentProportions.length = segmentProportionalLengths.length = 0;\n };\n\n this.setSegments = function (_segs) {\n userProvidedSegments = [];\n totalLength = 0;\n for (var i = 0; i < _segs.length; i++) {\n userProvidedSegments.push(_segs[i]);\n totalLength += _segs[i].getLength();\n }\n };\n\n this.getLength = function() {\n return totalLength;\n };\n\n var _prepareCompute = function (params) {\n this.strokeWidth = params.strokeWidth;\n var segment = _jg.quadrant(params.sourcePos, params.targetPos),\n swapX = params.targetPos[0] < params.sourcePos[0],\n swapY = params.targetPos[1] < params.sourcePos[1],\n lw = params.strokeWidth || 1,\n so = params.sourceEndpoint.anchor.getOrientation(params.sourceEndpoint),\n to = params.targetEndpoint.anchor.getOrientation(params.targetEndpoint),\n x = swapX ? params.targetPos[0] : params.sourcePos[0],\n y = swapY ? params.targetPos[1] : params.sourcePos[1],\n w = Math.abs(params.targetPos[0] - params.sourcePos[0]),\n h = Math.abs(params.targetPos[1] - params.sourcePos[1]);\n\n // if either anchor does not have an orientation set, we derive one from their relative\n // positions. we fix the axis to be the one in which the two elements are further apart, and\n // point each anchor at the other element. this is also used when dragging a new connection.\n if (so[0] === 0 && so[1] === 0 || to[0] === 0 && to[1] === 0) {\n var index = w > h ? 0 : 1, oIndex = [1, 0][index];\n so = [];\n to = [];\n so[index] = params.sourcePos[index] > params.targetPos[index] ? -1 : 1;\n to[index] = params.sourcePos[index] > params.targetPos[index] ? 1 : -1;\n so[oIndex] = 0;\n to[oIndex] = 0;\n }\n\n var sx = swapX ? w + (sourceGap * so[0]) : sourceGap * so[0],\n sy = swapY ? h + (sourceGap * so[1]) : sourceGap * so[1],\n tx = swapX ? targetGap * to[0] : w + (targetGap * to[0]),\n ty = swapY ? targetGap * to[1] : h + (targetGap * to[1]),\n oProduct = ((so[0] * to[0]) + (so[1] * to[1]));\n\n var result = {\n sx: sx, sy: sy, tx: tx, ty: ty, lw: lw,\n xSpan: Math.abs(tx - sx),\n ySpan: Math.abs(ty - sy),\n mx: (sx + tx) / 2,\n my: (sy + ty) / 2,\n so: so, to: to, x: x, y: y, w: w, h: h,\n segment: segment,\n startStubX: sx + (so[0] * sourceStub),\n startStubY: sy + (so[1] * sourceStub),\n endStubX: tx + (to[0] * targetStub),\n endStubY: ty + (to[1] * targetStub),\n isXGreaterThanStubTimes2: Math.abs(sx - tx) > (sourceStub + targetStub),\n isYGreaterThanStubTimes2: Math.abs(sy - ty) > (sourceStub + targetStub),\n opposite: oProduct === -1,\n perpendicular: oProduct === 0,\n orthogonal: oProduct === 1,\n sourceAxis: so[0] === 0 ? \"y\" : \"x\",\n points: [x, y, w, h, sx, sy, tx, ty ],\n stubs:[sourceStub, targetStub]\n };\n result.anchorOrientation = result.opposite ? \"opposite\" : result.orthogonal ? \"orthogonal\" : \"perpendicular\";\n return result;\n };\n\n this.getSegments = function () {\n return segments;\n };\n\n this.updateBounds = function (segment) {\n var segBounds = segment.getBounds();\n this.bounds.minX = Math.min(this.bounds.minX, segBounds.minX);\n this.bounds.maxX = Math.max(this.bounds.maxX, segBounds.maxX);\n this.bounds.minY = Math.min(this.bounds.minY, segBounds.minY);\n this.bounds.maxY = Math.max(this.bounds.maxY, segBounds.maxY);\n };\n\n var dumpSegmentsToConsole = function () {\n console.log(\"SEGMENTS:\");\n for (var i = 0; i < segments.length; i++) {\n console.log(segments[i].type, segments[i].getLength(), segmentProportions[i]);\n }\n };\n\n this.pointOnPath = function (location, absolute) {\n var seg = _findSegmentForLocation(location, absolute);\n return seg.segment && seg.segment.pointOnPath(seg.proportion, false) || [0, 0];\n };\n\n this.gradientAtPoint = function (location, absolute) {\n var seg = _findSegmentForLocation(location, absolute);\n return seg.segment && seg.segment.gradientAtPoint(seg.proportion, false) || 0;\n };\n\n this.pointAlongPathFrom = function (location, distance, absolute) {\n var seg = _findSegmentForLocation(location, absolute);\n // TODO what happens if this crosses to the next segment?\n return seg.segment && seg.segment.pointAlongPathFrom(seg.proportion, distance, false) || [0, 0];\n };\n\n this.compute = function (params) {\n paintInfo = _prepareCompute.call(this, params);\n\n _clearSegments();\n this._compute(paintInfo, params);\n this.x = paintInfo.points[0];\n this.y = paintInfo.points[1];\n this.w = paintInfo.points[2];\n this.h = paintInfo.points[3];\n this.segment = paintInfo.segment;\n _updateSegmentProportions();\n };\n\n return {\n addSegment: _addSegment,\n prepareCompute: _prepareCompute,\n sourceStub: sourceStub,\n targetStub: targetStub,\n maxStub: Math.max(sourceStub, targetStub),\n sourceGap: sourceGap,\n targetGap: targetGap,\n maxGap: Math.max(sourceGap, targetGap)\n };\n };\n _ju.extend(_jp.Connectors.AbstractConnector, AbstractComponent);\n\n\n // ********************************* END OF CONNECTOR TYPES *******************************************************************\n\n // ********************************* ENDPOINT TYPES *******************************************************************\n\n _jp.Endpoints.AbstractEndpoint = function (params) {\n AbstractComponent.apply(this, arguments);\n var compute = this.compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n var out = this._compute.apply(this, arguments);\n this.x = out[0];\n this.y = out[1];\n this.w = out[2];\n this.h = out[3];\n this.bounds.minX = this.x;\n this.bounds.minY = this.y;\n this.bounds.maxX = this.x + this.w;\n this.bounds.maxY = this.y + this.h;\n return out;\n };\n return {\n compute: compute,\n cssClass: params.cssClass\n };\n };\n _ju.extend(_jp.Endpoints.AbstractEndpoint, AbstractComponent);\n\n /**\n * Class: Endpoints.Dot\n * A round endpoint, with default radius 10 pixels.\n */\n\n /**\n * Function: Constructor\n *\n * Parameters:\n *\n * radius - radius of the endpoint. defaults to 10 pixels.\n */\n _jp.Endpoints.Dot = function (params) {\n this.type = \"Dot\";\n var _super = _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n params = params || {};\n this.radius = params.radius || 10;\n this.defaultOffset = 0.5 * this.radius;\n this.defaultInnerRadius = this.radius / 3;\n\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n this.radius = endpointStyle.radius || this.radius;\n var x = anchorPoint[0] - this.radius,\n y = anchorPoint[1] - this.radius,\n w = this.radius * 2,\n h = this.radius * 2;\n\n if (endpointStyle.stroke) {\n var lw = endpointStyle.strokeWidth || 1;\n x -= lw;\n y -= lw;\n w += (lw * 2);\n h += (lw * 2);\n }\n return [ x, y, w, h, this.radius ];\n };\n };\n _ju.extend(_jp.Endpoints.Dot, _jp.Endpoints.AbstractEndpoint);\n\n _jp.Endpoints.Rectangle = function (params) {\n this.type = \"Rectangle\";\n var _super = _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n params = params || {};\n this.width = params.width || 20;\n this.height = params.height || 20;\n\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n var width = endpointStyle.width || this.width,\n height = endpointStyle.height || this.height,\n x = anchorPoint[0] - (width / 2),\n y = anchorPoint[1] - (height / 2);\n\n return [ x, y, width, height];\n };\n };\n _ju.extend(_jp.Endpoints.Rectangle, _jp.Endpoints.AbstractEndpoint);\n\n var DOMElementEndpoint = function (params) {\n _jp.jsPlumbUIComponent.apply(this, arguments);\n this._jsPlumb.displayElements = [];\n };\n _ju.extend(DOMElementEndpoint, _jp.jsPlumbUIComponent, {\n getDisplayElements: function () {\n return this._jsPlumb.displayElements;\n },\n appendDisplayElement: function (el) {\n this._jsPlumb.displayElements.push(el);\n }\n });\n\n /**\n * Class: Endpoints.Image\n * Draws an image as the Endpoint.\n */\n /**\n * Function: Constructor\n *\n * Parameters:\n *\n * src - location of the image to use.\n\n TODO: multiple references to self. not sure quite how to get rid of them entirely. perhaps self = null in the cleanup\n function will suffice\n\n TODO this class still might leak memory.\n\n */\n _jp.Endpoints.Image = function (params) {\n\n this.type = \"Image\";\n DOMElementEndpoint.apply(this, arguments);\n _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n\n var _onload = params.onload,\n src = params.src || params.url,\n clazz = params.cssClass ? \" \" + params.cssClass : \"\";\n\n this._jsPlumb.img = new Image();\n this._jsPlumb.ready = false;\n this._jsPlumb.initialized = false;\n this._jsPlumb.deleted = false;\n this._jsPlumb.widthToUse = params.width;\n this._jsPlumb.heightToUse = params.height;\n this._jsPlumb.endpoint = params.endpoint;\n\n this._jsPlumb.img.onload = function () {\n if (this._jsPlumb != null) {\n this._jsPlumb.ready = true;\n this._jsPlumb.widthToUse = this._jsPlumb.widthToUse || this._jsPlumb.img.width;\n this._jsPlumb.heightToUse = this._jsPlumb.heightToUse || this._jsPlumb.img.height;\n if (_onload) {\n _onload(this);\n }\n }\n }.bind(this);\n\n /*\n Function: setImage\n Sets the Image to use in this Endpoint.\n\n Parameters:\n img - may be a URL or an Image object\n onload - optional; a callback to execute once the image has loaded.\n */\n this._jsPlumb.endpoint.setImage = function (_img, onload) {\n var s = _img.constructor === String ? _img : _img.src;\n _onload = onload;\n this._jsPlumb.img.src = s;\n\n if (this.canvas != null) {\n this.canvas.setAttribute(\"src\", this._jsPlumb.img.src);\n }\n }.bind(this);\n\n this._jsPlumb.endpoint.setImage(src, _onload);\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n this.anchorPoint = anchorPoint;\n if (this._jsPlumb.ready) {\n return [anchorPoint[0] - this._jsPlumb.widthToUse / 2, anchorPoint[1] - this._jsPlumb.heightToUse / 2,\n this._jsPlumb.widthToUse, this._jsPlumb.heightToUse];\n }\n else {\n return [0, 0, 0, 0];\n }\n };\n\n this.canvas = _jp.createElement(\"img\", {\n position:\"absolute\",\n margin:0,\n padding:0,\n outline:0\n }, this._jsPlumb.instance.endpointClass + clazz);\n\n if (this._jsPlumb.widthToUse) {\n this.canvas.setAttribute(\"width\", this._jsPlumb.widthToUse);\n }\n if (this._jsPlumb.heightToUse) {\n this.canvas.setAttribute(\"height\", this._jsPlumb.heightToUse);\n }\n this._jsPlumb.instance.appendElement(this.canvas);\n\n this.actuallyPaint = function (d, style, anchor) {\n if (!this._jsPlumb.deleted) {\n if (!this._jsPlumb.initialized) {\n this.canvas.setAttribute(\"src\", this._jsPlumb.img.src);\n this.appendDisplayElement(this.canvas);\n this._jsPlumb.initialized = true;\n }\n var x = this.anchorPoint[0] - (this._jsPlumb.widthToUse / 2),\n y = this.anchorPoint[1] - (this._jsPlumb.heightToUse / 2);\n _ju.sizeElement(this.canvas, x, y, this._jsPlumb.widthToUse, this._jsPlumb.heightToUse);\n }\n };\n\n this.paint = function (style, anchor) {\n if (this._jsPlumb != null) { // may have been deleted\n if (this._jsPlumb.ready) {\n this.actuallyPaint(style, anchor);\n }\n else {\n root.setTimeout(function () {\n this.paint(style, anchor);\n }.bind(this), 200);\n }\n }\n };\n };\n _ju.extend(_jp.Endpoints.Image, [ DOMElementEndpoint, _jp.Endpoints.AbstractEndpoint ], {\n cleanup: function (force) {\n if (force) {\n this._jsPlumb.deleted = true;\n if (this.canvas) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n this.canvas = null;\n }\n }\n });\n\n /*\n * Class: Endpoints.Blank\n * An Endpoint that paints nothing (visible) on the screen. Supports cssClass and hoverClass parameters like all Endpoints.\n */\n _jp.Endpoints.Blank = function (params) {\n var _super = _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n this.type = \"Blank\";\n DOMElementEndpoint.apply(this, arguments);\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n return [anchorPoint[0], anchorPoint[1], 10, 0];\n };\n\n var clazz = params.cssClass ? \" \" + params.cssClass : \"\";\n\n this.canvas = _jp.createElement(\"div\", {\n display: \"block\",\n width: \"1px\",\n height: \"1px\",\n background: \"transparent\",\n position: \"absolute\"\n }, this._jsPlumb.instance.endpointClass + clazz);\n\n this._jsPlumb.instance.appendElement(this.canvas);\n\n this.paint = function (style, anchor) {\n _ju.sizeElement(this.canvas, this.x, this.y, this.w, this.h);\n };\n };\n _ju.extend(_jp.Endpoints.Blank, [_jp.Endpoints.AbstractEndpoint, DOMElementEndpoint], {\n cleanup: function () {\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n }\n });\n\n /*\n * Class: Endpoints.Triangle\n * A triangular Endpoint.\n */\n /*\n * Function: Constructor\n *\n * Parameters:\n *\n * width width of the triangle's base. defaults to 55 pixels.\n * height height of the triangle from base to apex. defaults to 55 pixels.\n */\n _jp.Endpoints.Triangle = function (params) {\n this.type = \"Triangle\";\n _jp.Endpoints.AbstractEndpoint.apply(this, arguments);\n var self = this;\n params = params || { };\n params.width = params.width || 55;\n params.height = params.height || 55;\n this.width = params.width;\n this.height = params.height;\n this._compute = function (anchorPoint, orientation, endpointStyle, connectorPaintStyle) {\n var width = endpointStyle.width || self.width,\n height = endpointStyle.height || self.height,\n x = anchorPoint[0] - (width / 2),\n y = anchorPoint[1] - (height / 2);\n return [ x, y, width, height ];\n };\n };\n// ********************************* END OF ENDPOINT TYPES *******************************************************************\n\n\n// ********************************* OVERLAY DEFINITIONS *********************************************************************** \n\n var AbstractOverlay = _jp.Overlays.AbstractOverlay = function (params) {\n this.visible = true;\n this.isAppendedAtTopLevel = true;\n this.component = params.component;\n this.loc = params.location == null ? 0.5 : params.location;\n this.endpointLoc = params.endpointLocation == null ? [ 0.5, 0.5] : params.endpointLocation;\n this.visible = params.visible !== false;\n };\n AbstractOverlay.prototype = {\n cleanup: function (force) {\n if (force) {\n this.component = null;\n this.canvas = null;\n this.endpointLoc = null;\n }\n },\n reattach:function(instance, component) { },\n setVisible: function (val) {\n this.visible = val;\n this.component.repaint();\n },\n isVisible: function () {\n return this.visible;\n },\n hide: function () {\n this.setVisible(false);\n },\n show: function () {\n this.setVisible(true);\n },\n incrementLocation: function (amount) {\n this.loc += amount;\n this.component.repaint();\n },\n setLocation: function (l) {\n this.loc = l;\n this.component.repaint();\n },\n getLocation: function () {\n return this.loc;\n },\n updateFrom:function() { }\n };\n\n\n /*\n * Class: Overlays.Arrow\n *\n * An arrow overlay, defined by four points: the head, the two sides of the tail, and a 'foldback' point at some distance along the length\n * of the arrow that lines from each tail point converge into. The foldback point is defined using a decimal that indicates some fraction\n * of the length of the arrow and has a default value of 0.623. A foldback point value of 1 would mean that the arrow had a straight line\n * across the tail.\n */\n /*\n * @constructor\n *\n * @param {Object} params Constructor params.\n * @param {Number} [params.length] Distance in pixels from head to tail baseline. default 20.\n * @param {Number} [params.width] Width in pixels of the tail baseline. default 20.\n * @param {String} [params.fill] Style to use when filling the arrow. defaults to \"black\".\n * @param {String} [params.stroke] Style to use when stroking the arrow. defaults to null, which means the arrow is not stroked.\n * @param {Number} [params.stroke-width] Line width to use when stroking the arrow. defaults to 1, but only used if stroke is not null.\n * @param {Number} [params.foldback] Distance (as a decimal from 0 to 1 inclusive) along the length of the arrow marking the point the tail points should fold back to. defaults to 0.623.\n * @param {Number} [params.location] Distance (as a decimal from 0 to 1 inclusive) marking where the arrow should sit on the connector. defaults to 0.5.\n * @param {NUmber} [params.direction] Indicates the direction the arrow points in. valid values are -1 and 1; 1 is default.\n */\n _jp.Overlays.Arrow = function (params) {\n this.type = \"Arrow\";\n AbstractOverlay.apply(this, arguments);\n this.isAppendedAtTopLevel = false;\n params = params || {};\n var self = this;\n\n this.length = params.length || 20;\n this.width = params.width || 20;\n this.id = params.id;\n var direction = (params.direction || 1) < 0 ? -1 : 1,\n paintStyle = params.paintStyle || { \"stroke-width\": 1 },\n // how far along the arrow the lines folding back in come to. default is 62.3%.\n foldback = params.foldback || 0.623;\n\n this.computeMaxSize = function () {\n return self.width * 1.5;\n };\n\n this.elementCreated = function(p, component) {\n this.path = p;\n if (params.events) {\n for (var i in params.events) {\n _jp.on(p, i, params.events[i]);\n }\n }\n };\n\n this.draw = function (component, currentConnectionPaintStyle) {\n\n var hxy, mid, txy, tail, cxy;\n if (component.pointAlongPathFrom) {\n\n if (_ju.isString(this.loc) || this.loc > 1 || this.loc < 0) {\n var l = parseInt(this.loc, 10),\n fromLoc = this.loc < 0 ? 1 : 0;\n hxy = component.pointAlongPathFrom(fromLoc, l, false);\n mid = component.pointAlongPathFrom(fromLoc, l - (direction * this.length / 2), false);\n txy = _jg.pointOnLine(hxy, mid, this.length);\n }\n else if (this.loc === 1) {\n hxy = component.pointOnPath(this.loc);\n mid = component.pointAlongPathFrom(this.loc, -(this.length));\n txy = _jg.pointOnLine(hxy, mid, this.length);\n\n if (direction === -1) {\n var _ = txy;\n txy = hxy;\n hxy = _;\n }\n }\n else if (this.loc === 0) {\n txy = component.pointOnPath(this.loc);\n mid = component.pointAlongPathFrom(this.loc, this.length);\n hxy = _jg.pointOnLine(txy, mid, this.length);\n if (direction === -1) {\n var __ = txy;\n txy = hxy;\n hxy = __;\n }\n }\n else {\n hxy = component.pointAlongPathFrom(this.loc, direction * this.length / 2);\n mid = component.pointOnPath(this.loc);\n txy = _jg.pointOnLine(hxy, mid, this.length);\n }\n\n tail = _jg.perpendicularLineTo(hxy, txy, this.width);\n cxy = _jg.pointOnLine(hxy, txy, foldback * this.length);\n\n var d = { hxy: hxy, tail: tail, cxy: cxy },\n stroke = paintStyle.stroke || currentConnectionPaintStyle.stroke,\n fill = paintStyle.fill || currentConnectionPaintStyle.stroke,\n lineWidth = paintStyle.strokeWidth || currentConnectionPaintStyle.strokeWidth;\n\n return {\n component: component,\n d: d,\n \"stroke-width\": lineWidth,\n stroke: stroke,\n fill: fill,\n minX: Math.min(hxy.x, tail[0].x, tail[1].x),\n maxX: Math.max(hxy.x, tail[0].x, tail[1].x),\n minY: Math.min(hxy.y, tail[0].y, tail[1].y),\n maxY: Math.max(hxy.y, tail[0].y, tail[1].y)\n };\n }\n else {\n return {component: component, minX: 0, maxX: 0, minY: 0, maxY: 0};\n }\n };\n };\n _ju.extend(_jp.Overlays.Arrow, AbstractOverlay, {\n updateFrom:function(d) {\n this.length = d.length || this.length;\n this.width = d.width|| this.width;\n this.direction = d.direction != null ? d.direction : this.direction;\n this.foldback = d.foldback|| this.foldback;\n },\n cleanup:function() {\n if (this.path && this.canvas) {\n this.canvas.removeChild(this.path);\n }\n }\n });\n\n /*\n * Class: Overlays.PlainArrow\n *\n * A basic arrow. This is in fact just one instance of the more generic case in which the tail folds back on itself to some\n * point along the length of the arrow: in this case, that foldback point is the full length of the arrow. so it just does\n * a 'call' to Arrow with foldback set appropriately.\n */\n /*\n * Function: Constructor\n * See for allowed parameters for this overlay.\n */\n _jp.Overlays.PlainArrow = function (params) {\n params = params || {};\n var p = _jp.extend(params, {foldback: 1});\n _jp.Overlays.Arrow.call(this, p);\n this.type = \"PlainArrow\";\n };\n _ju.extend(_jp.Overlays.PlainArrow, _jp.Overlays.Arrow);\n\n /*\n * Class: Overlays.Diamond\n * \n * A diamond. Like PlainArrow, this is a concrete case of the more generic case of the tail points converging on some point...it just\n * happens that in this case, that point is greater than the length of the the arrow.\n *\n * this could probably do with some help with positioning...due to the way it reuses the Arrow paint code, what Arrow thinks is the\n * center is actually 1/4 of the way along for this guy. but we don't have any knowledge of pixels at this point, so we're kind of\n * stuck when it comes to helping out the Arrow class. possibly we could pass in a 'transpose' parameter or something. the value\n * would be -l/4 in this case - move along one quarter of the total length.\n */\n /*\n * Function: Constructor\n * See for allowed parameters for this overlay.\n */\n _jp.Overlays.Diamond = function (params) {\n params = params || {};\n var l = params.length || 40,\n p = _jp.extend(params, {length: l / 2, foldback: 2});\n _jp.Overlays.Arrow.call(this, p);\n this.type = \"Diamond\";\n };\n _ju.extend(_jp.Overlays.Diamond, _jp.Overlays.Arrow);\n\n var _getDimensions = function (component, forceRefresh) {\n if (component._jsPlumb.cachedDimensions == null || forceRefresh) {\n component._jsPlumb.cachedDimensions = component.getDimensions();\n }\n return component._jsPlumb.cachedDimensions;\n };\n\n // abstract superclass for overlays that add an element to the DOM.\n var AbstractDOMOverlay = function (params) {\n _jp.jsPlumbUIComponent.apply(this, arguments);\n AbstractOverlay.apply(this, arguments);\n\n // hand off fired events to associated component.\n var _f = this.fire;\n this.fire = function () {\n _f.apply(this, arguments);\n if (this.component) {\n this.component.fire.apply(this.component, arguments);\n }\n };\n\n this.detached=false;\n this.id = params.id;\n this._jsPlumb.div = null;\n this._jsPlumb.initialised = false;\n this._jsPlumb.component = params.component;\n this._jsPlumb.cachedDimensions = null;\n this._jsPlumb.create = params.create;\n this._jsPlumb.initiallyInvisible = params.visible === false;\n\n this.getElement = function () {\n if (this._jsPlumb.div == null) {\n var div = this._jsPlumb.div = _jp.getElement(this._jsPlumb.create(this._jsPlumb.component));\n div.style.position = \"absolute\";\n jsPlumb.addClass(div, this._jsPlumb.instance.overlayClass + \" \" +\n (this.cssClass ? this.cssClass :\n params.cssClass ? params.cssClass : \"\"));\n this._jsPlumb.instance.appendElement(div);\n this._jsPlumb.instance.getId(div);\n this.canvas = div;\n\n // in IE the top left corner is what it placed at the desired location. This will not\n // be fixed. IE8 is not going to be supported for much longer.\n var ts = \"translate(-50%, -50%)\";\n div.style.webkitTransform = ts;\n div.style.mozTransform = ts;\n div.style.msTransform = ts;\n div.style.oTransform = ts;\n div.style.transform = ts;\n\n // write the related component into the created element\n div._jsPlumb = this;\n\n if (params.visible === false) {\n div.style.display = \"none\";\n }\n }\n return this._jsPlumb.div;\n };\n\n this.draw = function (component, currentConnectionPaintStyle, absolutePosition) {\n var td = _getDimensions(this);\n if (td != null && td.length === 2) {\n var cxy = { x: 0, y: 0 };\n\n // absolutePosition would have been set by a call to connection.setAbsoluteOverlayPosition.\n if (absolutePosition) {\n cxy = { x: absolutePosition[0], y: absolutePosition[1] };\n }\n else if (component.pointOnPath) {\n var loc = this.loc, absolute = false;\n if (_ju.isString(this.loc) || this.loc < 0 || this.loc > 1) {\n loc = parseInt(this.loc, 10);\n absolute = true;\n }\n cxy = component.pointOnPath(loc, absolute); // a connection\n }\n else {\n var locToUse = this.loc.constructor === Array ? this.loc : this.endpointLoc;\n cxy = { x: locToUse[0] * component.w,\n y: locToUse[1] * component.h };\n }\n\n var minx = cxy.x - (td[0] / 2),\n miny = cxy.y - (td[1] / 2);\n\n return {\n component: component,\n d: { minx: minx, miny: miny, td: td, cxy: cxy },\n minX: minx,\n maxX: minx + td[0],\n minY: miny,\n maxY: miny + td[1]\n };\n }\n else {\n return {minX: 0, maxX: 0, minY: 0, maxY: 0};\n }\n };\n };\n _ju.extend(AbstractDOMOverlay, [_jp.jsPlumbUIComponent, AbstractOverlay], {\n getDimensions: function () {\n return [1,1];\n },\n setVisible: function (state) {\n if (this._jsPlumb.div) {\n this._jsPlumb.div.style.display = state ? \"block\" : \"none\";\n // if initially invisible, dimensions are 0,0 and never get updated\n if (state && this._jsPlumb.initiallyInvisible) {\n _getDimensions(this, true);\n this.component.repaint();\n this._jsPlumb.initiallyInvisible = false;\n }\n }\n },\n /*\n * Function: clearCachedDimensions\n * Clears the cached dimensions for the label. As a performance enhancement, label dimensions are\n * cached from 1.3.12 onwards. The cache is cleared when you change the label text, of course, but\n * there are other reasons why the text dimensions might change - if you make a change through CSS, for\n * example, you might change the font size. in that case you should explicitly call this method.\n */\n clearCachedDimensions: function () {\n this._jsPlumb.cachedDimensions = null;\n },\n cleanup: function (force) {\n if (force) {\n if (this._jsPlumb.div != null) {\n this._jsPlumb.div._jsPlumb = null;\n this._jsPlumb.instance.removeElement(this._jsPlumb.div);\n }\n }\n else {\n // if not a forced cleanup, just detach child from parent for now.\n if (this._jsPlumb && this._jsPlumb.div && this._jsPlumb.div.parentNode) {\n this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div);\n }\n this.detached = true;\n }\n\n },\n reattach:function(instance, component) {\n if (this._jsPlumb.div != null) {\n instance.getContainer().appendChild(this._jsPlumb.div);\n }\n this.detached = false;\n },\n computeMaxSize: function () {\n var td = _getDimensions(this);\n return Math.max(td[0], td[1]);\n },\n paint: function (p, containerExtents) {\n if (!this._jsPlumb.initialised) {\n this.getElement();\n p.component.appendDisplayElement(this._jsPlumb.div);\n this._jsPlumb.initialised = true;\n if (this.detached) {\n this._jsPlumb.div.parentNode.removeChild(this._jsPlumb.div);\n }\n }\n this._jsPlumb.div.style.left = (p.component.x + p.d.minx) + \"px\";\n this._jsPlumb.div.style.top = (p.component.y + p.d.miny) + \"px\";\n }\n });\n\n /*\n * Class: Overlays.Custom\n * A Custom overlay. You supply a 'create' function which returns some DOM element, and jsPlumb positions it.\n * The 'create' function is passed a Connection or Endpoint.\n */\n /*\n * Function: Constructor\n * \n * Parameters:\n * create - function for jsPlumb to call that returns a DOM element.\n * location - distance (as a decimal from 0 to 1 inclusive) marking where the label should sit on the connector. defaults to 0.5.\n * id - optional id to use for later retrieval of this overlay.\n *\n */\n _jp.Overlays.Custom = function (params) {\n this.type = \"Custom\";\n AbstractDOMOverlay.apply(this, arguments);\n };\n _ju.extend(_jp.Overlays.Custom, AbstractDOMOverlay);\n\n _jp.Overlays.GuideLines = function () {\n var self = this;\n self.length = 50;\n self.strokeWidth = 5;\n this.type = \"GuideLines\";\n AbstractOverlay.apply(this, arguments);\n _jp.jsPlumbUIComponent.apply(this, arguments);\n this.draw = function (connector, currentConnectionPaintStyle) {\n\n var head = connector.pointAlongPathFrom(self.loc, self.length / 2),\n mid = connector.pointOnPath(self.loc),\n tail = _jg.pointOnLine(head, mid, self.length),\n tailLine = _jg.perpendicularLineTo(head, tail, 40),\n headLine = _jg.perpendicularLineTo(tail, head, 20);\n\n return {\n connector: connector,\n head: head,\n tail: tail,\n headLine: headLine,\n tailLine: tailLine,\n minX: Math.min(head.x, tail.x, headLine[0].x, headLine[1].x),\n minY: Math.min(head.y, tail.y, headLine[0].y, headLine[1].y),\n maxX: Math.max(head.x, tail.x, headLine[0].x, headLine[1].x),\n maxY: Math.max(head.y, tail.y, headLine[0].y, headLine[1].y)\n };\n };\n\n // this.cleanup = function() { }; // nothing to clean up for GuideLines\n };\n\n /*\n * Class: Overlays.Label\n\n */\n /*\n * Function: Constructor\n * \n * Parameters:\n * cssClass - optional css class string to append to css class. This string is appended \"as-is\", so you can of course have multiple classes\n * defined. This parameter is preferred to using labelStyle, borderWidth and borderStyle.\n * label - the label to paint. May be a string or a function that returns a string. Nothing will be painted if your label is null or your\n * label function returns null. empty strings _will_ be painted.\n * location - distance (as a decimal from 0 to 1 inclusive) marking where the label should sit on the connector. defaults to 0.5.\n * id - optional id to use for later retrieval of this overlay.\n * \n *\n */\n _jp.Overlays.Label = function (params) {\n this.labelStyle = params.labelStyle;\n\n var labelWidth = null, labelHeight = null, labelText = null, labelPadding = null;\n this.cssClass = this.labelStyle != null ? this.labelStyle.cssClass : null;\n var p = _jp.extend({\n create: function () {\n return _jp.createElement(\"div\");\n }}, params);\n _jp.Overlays.Custom.call(this, p);\n this.type = \"Label\";\n this.label = params.label || \"\";\n this.labelText = null;\n if (this.labelStyle) {\n var el = this.getElement();\n this.labelStyle.font = this.labelStyle.font || \"12px sans-serif\";\n el.style.font = this.labelStyle.font;\n el.style.color = this.labelStyle.color || \"black\";\n if (this.labelStyle.fill) {\n el.style.background = this.labelStyle.fill;\n }\n if (this.labelStyle.borderWidth > 0) {\n var dStyle = this.labelStyle.borderStyle ? this.labelStyle.borderStyle : \"black\";\n el.style.border = this.labelStyle.borderWidth + \"px solid \" + dStyle;\n }\n if (this.labelStyle.padding) {\n el.style.padding = this.labelStyle.padding;\n }\n }\n\n };\n _ju.extend(_jp.Overlays.Label, _jp.Overlays.Custom, {\n cleanup: function (force) {\n if (force) {\n this.div = null;\n this.label = null;\n this.labelText = null;\n this.cssClass = null;\n this.labelStyle = null;\n }\n },\n getLabel: function () {\n return this.label;\n },\n /*\n * Function: setLabel\n * sets the label's, um, label. you would think i'd call this function\n * 'setText', but you can pass either a Function or a String to this, so\n * it makes more sense as 'setLabel'. This uses innerHTML on the label div, so keep\n * that in mind if you need escaped HTML.\n */\n setLabel: function (l) {\n this.label = l;\n this.labelText = null;\n this.clearCachedDimensions();\n this.update();\n this.component.repaint();\n },\n getDimensions: function () {\n this.update();\n return AbstractDOMOverlay.prototype.getDimensions.apply(this, arguments);\n },\n update: function () {\n if (typeof this.label === \"function\") {\n var lt = this.label(this);\n this.getElement().innerHTML = lt.replace(/\\r\\n/g, \"
\");\n }\n else {\n if (this.labelText == null) {\n this.labelText = this.label;\n this.getElement().innerHTML = this.labelText.replace(/\\r\\n/g, \"
\");\n }\n }\n },\n updateFrom:function(d) {\n if(d.label != null){\n this.setLabel(d.label);\n }\n }\n });\n\n // ********************************* END OF OVERLAY DEFINITIONS ***********************************************************************\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;(function() {\n \"use strict\";\n\n var root = this,\n _ju = root.jsPlumbUtil,\n _jpi = root.jsPlumbInstance;\n\n var GROUP_COLLAPSED_CLASS = \"jtk-group-collapsed\";\n var GROUP_EXPANDED_CLASS = \"jtk-group-expanded\";\n var GROUP_CONTAINER_SELECTOR = \"[jtk-group-content]\";\n var ELEMENT_DRAGGABLE_EVENT = \"elementDraggable\";\n var STOP = \"stop\";\n var REVERT = \"revert\";\n var GROUP_MANAGER = \"_groupManager\";\n var GROUP = \"_jsPlumbGroup\";\n var GROUP_DRAG_SCOPE = \"_jsPlumbGroupDrag\";\n var EVT_CHILD_ADDED = \"group:addMember\";\n var EVT_CHILD_REMOVED = \"group:removeMember\";\n var EVT_GROUP_ADDED = \"group:add\";\n var EVT_GROUP_REMOVED = \"group:remove\";\n var EVT_EXPAND = \"group:expand\";\n var EVT_COLLAPSE = \"group:collapse\";\n var EVT_GROUP_DRAG_STOP = \"groupDragStop\";\n var EVT_CONNECTION_MOVED = \"connectionMoved\";\n var EVT_INTERNAL_CONNECTION_DETACHED = \"internal.connectionDetached\";\n\n var CMD_REMOVE_ALL = \"removeAll\";\n var CMD_ORPHAN_ALL = \"orphanAll\";\n var CMD_SHOW = \"show\";\n var CMD_HIDE = \"hide\";\n\n var GroupManager = function(_jsPlumb) {\n var _managedGroups = {}, _connectionSourceMap = {}, _connectionTargetMap = {}, self = this;\n\n _jsPlumb.bind(\"connection\", function(p) {\n if (p.source[GROUP] != null && p.target[GROUP] != null && p.source[GROUP] === p.target[GROUP]) {\n _connectionSourceMap[p.connection.id] = p.source[GROUP];\n _connectionTargetMap[p.connection.id] = p.source[GROUP];\n }\n else {\n if (p.source[GROUP] != null) {\n _ju.suggest(p.source[GROUP].connections.source, p.connection);\n _connectionSourceMap[p.connection.id] = p.source[GROUP];\n }\n if (p.target[GROUP] != null) {\n _ju.suggest(p.target[GROUP].connections.target, p.connection);\n _connectionTargetMap[p.connection.id] = p.target[GROUP];\n }\n }\n });\n\n function _cleanupDetachedConnection(conn) {\n delete conn.proxies;\n var group = _connectionSourceMap[conn.id], f;\n if (group != null) {\n f = function(c) { return c.id === conn.id; };\n _ju.removeWithFunction(group.connections.source, f);\n _ju.removeWithFunction(group.connections.target, f);\n delete _connectionSourceMap[conn.id];\n }\n\n group = _connectionTargetMap[conn.id];\n if (group != null) {\n f = function(c) { return c.id === conn.id; };\n _ju.removeWithFunction(group.connections.source, f);\n _ju.removeWithFunction(group.connections.target, f);\n delete _connectionTargetMap[conn.id];\n }\n }\n\n _jsPlumb.bind(EVT_INTERNAL_CONNECTION_DETACHED, function(p) {\n _cleanupDetachedConnection(p.connection);\n });\n\n _jsPlumb.bind(EVT_CONNECTION_MOVED, function(p) {\n var connMap = p.index === 0 ? _connectionSourceMap : _connectionTargetMap;\n var group = connMap[p.connection.id];\n if (group) {\n var list = group.connections[p.index === 0 ? \"source\" : \"target\"];\n var idx = list.indexOf(p.connection);\n if (idx !== -1) {\n list.splice(idx, 1);\n }\n }\n });\n\n this.addGroup = function(group) {\n _jsPlumb.addClass(group.getEl(), GROUP_EXPANDED_CLASS);\n _managedGroups[group.id] = group;\n group.manager = this;\n _updateConnectionsForGroup(group);\n _jsPlumb.fire(EVT_GROUP_ADDED, { group:group });\n };\n\n this.addToGroup = function(group, el, doNotFireEvent) {\n group = this.getGroup(group);\n if (group) {\n var groupEl = group.getEl();\n\n if (el._isJsPlumbGroup) {\n return;\n }\n var currentGroup = el._jsPlumbGroup;\n // if already a member of this group, do nothing\n if (currentGroup !== group) {\n var elpos = _jsPlumb.getOffset(el, true);\n var cpos = group.collapsed ? _jsPlumb.getOffset(groupEl, true) : _jsPlumb.getOffset(group.getDragArea(), true);\n\n // otherwise, transfer to this group.\n if (currentGroup != null) {\n currentGroup.remove(el, false, doNotFireEvent, false, group);\n self.updateConnectionsForGroup(currentGroup);\n }\n group.add(el, doNotFireEvent/*, currentGroup*/);\n\n var handleDroppedConnections = function (list, index) {\n var oidx = index === 0 ? 1 : 0;\n list.each(function (c) {\n c.setVisible(false);\n if (c.endpoints[oidx].element._jsPlumbGroup === group) {\n c.endpoints[oidx].setVisible(false);\n self.expandConnection(c, oidx, group);\n }\n else {\n c.endpoints[index].setVisible(false);\n self.collapseConnection(c, index, group);\n }\n });\n };\n\n if (group.collapsed) {\n handleDroppedConnections(_jsPlumb.select({source: el}), 0);\n handleDroppedConnections(_jsPlumb.select({target: el}), 1);\n }\n\n var elId = _jsPlumb.getId(el);\n _jsPlumb.dragManager.setParent(el, elId, groupEl, _jsPlumb.getId(groupEl), elpos);\n\n var newPosition = { left: elpos.left - cpos.left, top: elpos.top - cpos.top };\n\n _jsPlumb.setPosition(el, newPosition);\n\n _jsPlumb.dragManager.revalidateParent(el, elId, elpos);\n\n self.updateConnectionsForGroup(group);\n\n _jsPlumb.revalidate(elId);\n\n if (!doNotFireEvent) {\n var p = {group: group, el: el};\n if (currentGroup) {\n p.sourceGroup = currentGroup;\n }\n _jsPlumb.fire(EVT_CHILD_ADDED, p);\n }\n }\n }\n };\n\n this.removeFromGroup = function(group, el, doNotFireEvent) {\n group = this.getGroup(group);\n if (group) {\n group.remove(el, null, doNotFireEvent);\n }\n };\n\n this.getGroup = function(groupId) {\n var group = groupId;\n if (_ju.isString(groupId)) {\n group = _managedGroups[groupId];\n if (group == null) {\n throw new TypeError(\"No such group [\" + groupId + \"]\");\n }\n }\n return group;\n };\n\n this.getGroups = function() {\n var o = [];\n for (var g in _managedGroups) {\n o.push(_managedGroups[g]);\n }\n return o;\n };\n\n this.removeGroup = function(group, deleteMembers, manipulateDOM, doNotFireEvent) {\n group = this.getGroup(group);\n this.expandGroup(group, true); // this reinstates any original connections and removes all proxies, but does not fire an event.\n var newPositions = group[deleteMembers ? CMD_REMOVE_ALL : CMD_ORPHAN_ALL](manipulateDOM, doNotFireEvent);\n _jsPlumb.remove(group.getEl());\n delete _managedGroups[group.id];\n delete _jsPlumb._groups[group.id];\n _jsPlumb.fire(EVT_GROUP_REMOVED, { group:group });\n return newPositions; // this will be null in the case or remove, but be a map of {id->[x,y]} in the case of orphan\n };\n\n this.removeAllGroups = function(deleteMembers, manipulateDOM, doNotFireEvent) {\n for (var g in _managedGroups) {\n this.removeGroup(_managedGroups[g], deleteMembers, manipulateDOM, doNotFireEvent);\n }\n };\n\n function _setVisible(group, state) {\n var m = group.getMembers();\n for (var i = 0; i < m.length; i++) {\n _jsPlumb[state ? CMD_SHOW : CMD_HIDE](m[i], true);\n }\n }\n\n var _collapseConnection = this.collapseConnection = function(c, index, group) {\n\n var proxyEp, groupEl = group.getEl(), groupElId = _jsPlumb.getId(groupEl),\n originalElementId = c.endpoints[index].elementId;\n\n var otherEl = c.endpoints[index === 0 ? 1 : 0].element;\n if (otherEl[GROUP] && (!otherEl[GROUP].shouldProxy() && otherEl[GROUP].collapsed)) {\n return;\n }\n\n c.proxies = c.proxies || [];\n if(c.proxies[index]) {\n proxyEp = c.proxies[index].ep;\n }else {\n proxyEp = _jsPlumb.addEndpoint(groupEl, {\n endpoint:group.getEndpoint(c, index),\n anchor:group.getAnchor(c, index),\n parameters:{\n isProxyEndpoint:true\n }\n });\n }\n proxyEp.setDeleteOnEmpty(true);\n\n // for this index, stash proxy info: the new EP, the original EP.\n c.proxies[index] = { ep:proxyEp, originalEp: c.endpoints[index] };\n\n // and advise the anchor manager\n if (index === 0) {\n // TODO why are there two differently named methods? Why is there not one method that says \"some end of this\n // connection changed (you give the index), and here's the new element and element id.\"\n _jsPlumb.anchorManager.sourceChanged(originalElementId, groupElId, c, groupEl);\n }\n else {\n _jsPlumb.anchorManager.updateOtherEndpoint(c.endpoints[0].elementId, originalElementId, groupElId, c);\n c.target = groupEl;\n c.targetId = groupElId;\n }\n\n\n // detach the original EP from the connection.\n c.proxies[index].originalEp.detachFromConnection(c, null, true);\n\n // set the proxy as the new ep\n proxyEp.connections = [ c ];\n c.endpoints[index] = proxyEp;\n\n c.setVisible(true);\n };\n\n this.collapseGroup = function(group) {\n group = this.getGroup(group);\n if (group == null || group.collapsed) {\n return;\n }\n var groupEl = group.getEl();\n\n // todo remove old proxy endpoints first, just in case?\n //group.proxies.length = 0;\n\n // hide all connections\n _setVisible(group, false);\n\n if (group.shouldProxy()) {\n // collapses all connections in a group.\n var _collapseSet = function (conns, index) {\n for (var i = 0; i < conns.length; i++) {\n var c = conns[i];\n _collapseConnection(c, index, group);\n }\n };\n\n // setup proxies for sources and targets\n _collapseSet(group.connections.source, 0);\n _collapseSet(group.connections.target, 1);\n }\n\n group.collapsed = true;\n _jsPlumb.removeClass(groupEl, GROUP_EXPANDED_CLASS);\n _jsPlumb.addClass(groupEl, GROUP_COLLAPSED_CLASS);\n _jsPlumb.revalidate(groupEl);\n _jsPlumb.fire(EVT_COLLAPSE, { group:group });\n };\n\n var _expandConnection = this.expandConnection = function(c, index, group) {\n\n // if no proxies or none for this end of the connection, abort.\n if (c.proxies == null || c.proxies[index] == null) {\n return;\n }\n\n var groupElId = _jsPlumb.getId(group.getEl()),\n originalElement = c.proxies[index].originalEp.element,\n originalElementId = c.proxies[index].originalEp.elementId;\n\n c.endpoints[index] = c.proxies[index].originalEp;\n // and advise the anchor manager\n if (index === 0) {\n // TODO why are there two differently named methods? Why is there not one method that says \"some end of this\n // connection changed (you give the index), and here's the new element and element id.\"\n _jsPlumb.anchorManager.sourceChanged(groupElId, originalElementId, c, originalElement);\n }\n else {\n _jsPlumb.anchorManager.updateOtherEndpoint(c.endpoints[0].elementId, groupElId, originalElementId, c);\n c.target = originalElement;\n c.targetId = originalElementId;\n }\n\n // detach the proxy EP from the connection (which will cause it to be removed as we no longer need it)\n c.proxies[index].ep.detachFromConnection(c, null);\n\n c.proxies[index].originalEp.addConnection(c);\n\n // cleanup\n delete c.proxies[index];\n };\n\n this.expandGroup = function(group, doNotFireEvent) {\n\n group = this.getGroup(group);\n\n if (group == null || !group.collapsed) {\n return;\n }\n var groupEl = group.getEl();\n\n _setVisible(group, true);\n\n if (group.shouldProxy()) {\n // collapses all connections in a group.\n var _expandSet = function (conns, index) {\n for (var i = 0; i < conns.length; i++) {\n var c = conns[i];\n _expandConnection(c, index, group);\n }\n };\n\n // setup proxies for sources and targets\n _expandSet(group.connections.source, 0);\n _expandSet(group.connections.target, 1);\n }\n\n group.collapsed = false;\n _jsPlumb.addClass(groupEl, GROUP_EXPANDED_CLASS);\n _jsPlumb.removeClass(groupEl, GROUP_COLLAPSED_CLASS);\n _jsPlumb.revalidate(groupEl);\n this.repaintGroup(group);\n if (!doNotFireEvent) {\n _jsPlumb.fire(EVT_EXPAND, { group: group});\n }\n };\n\n this.repaintGroup = function(group) {\n group = this.getGroup(group);\n var m = group.getMembers();\n for (var i = 0; i < m.length; i++) {\n _jsPlumb.revalidate(m[i]);\n }\n };\n\n // TODO refactor this with the code that responds to `connection` events.\n function _updateConnectionsForGroup(group) {\n var members = group.getMembers();\n var c1 = _jsPlumb.getConnections({source:members, scope:\"*\"}, true);\n var c2 = _jsPlumb.getConnections({target:members, scope:\"*\"}, true);\n var processed = {};\n group.connections.source.length = 0;\n group.connections.target.length = 0;\n var oneSet = function(c) {\n for (var i = 0; i < c.length; i++) {\n if (processed[c[i].id]) {\n continue;\n }\n processed[c[i].id] = true;\n if (c[i].source._jsPlumbGroup === group) {\n if (c[i].target._jsPlumbGroup !== group) {\n group.connections.source.push(c[i]);\n }\n _connectionSourceMap[c[i].id] = group;\n }\n else if (c[i].target._jsPlumbGroup === group) {\n group.connections.target.push(c[i]);\n _connectionTargetMap[c[i].id] = group;\n }\n }\n };\n oneSet(c1); oneSet(c2);\n }\n\n this.updateConnectionsForGroup = _updateConnectionsForGroup;\n this.refreshAllGroups = function() {\n for (var g in _managedGroups) {\n _updateConnectionsForGroup(_managedGroups[g]);\n _jsPlumb.dragManager.updateOffsets(_jsPlumb.getId(_managedGroups[g].getEl()));\n }\n };\n };\n\n /**\n *\n * @param {jsPlumbInstance} _jsPlumb Associated jsPlumb instance.\n * @param {Object} params\n * @param {Element} params.el The DOM element representing the Group.\n * @param {String} [params.id] Optional ID for the Group. A UUID will be assigned as the Group's ID if you do not provide one.\n * @param {Boolean} [params.constrain=false] If true, child elements will not be able to be dragged outside of the Group container.\n * @param {Boolean} [params.revert=true] By default, child elements revert to the container if dragged outside. You can change this by setting `revert:false`. This behaviour is also overridden if you set `orphan` or `prune`.\n * @param {Boolean} [params.orphan=false] If true, child elements dropped outside of the Group container will be removed from the Group (but not from the DOM).\n * @param {Boolean} [params.prune=false] If true, child elements dropped outside of the Group container will be removed from the Group and also from the DOM.\n * @param {Boolean} [params.dropOverride=false] If true, a child element that has been dropped onto some other Group will not be subject to the controls imposed by `prune`, `revert` or `orphan`.\n * @constructor\n */\n var Group = function(_jsPlumb, params) {\n var self = this;\n var el = params.el;\n this.getEl = function() { return el; };\n this.id = params.id || _ju.uuid();\n el._isJsPlumbGroup = true;\n\n var getDragArea = this.getDragArea = function() {\n var da = _jsPlumb.getSelector(el, GROUP_CONTAINER_SELECTOR);\n return da && da.length > 0 ? da[0] : el;\n };\n\n var ghost = params.ghost === true;\n var constrain = ghost || (params.constrain === true);\n var revert = params.revert !== false;\n var orphan = params.orphan === true;\n var prune = params.prune === true;\n var dropOverride = params.dropOverride === true;\n var proxied = params.proxied !== false;\n var elements = [];\n this.connections = { source:[], target:[], internal:[] };\n\n // this function, and getEndpoint below, are stubs for a future setup in which we can choose endpoint\n // and anchor based upon the connection and the index (source/target) of the endpoint to be proxied.\n this.getAnchor = function(conn, endpointIndex) {\n return params.anchor || \"Continuous\";\n };\n\n this.getEndpoint = function(conn, endpointIndex) {\n return params.endpoint || [ \"Dot\", { radius:10 }];\n };\n\n this.collapsed = false;\n if (params.draggable !== false) {\n var opts = {\n stop:function(params) {\n _jsPlumb.fire(EVT_GROUP_DRAG_STOP, jsPlumb.extend(params, {group:self}));\n },\n scope:GROUP_DRAG_SCOPE\n };\n if (params.dragOptions) {\n root.jsPlumb.extend(opts, params.dragOptions);\n }\n _jsPlumb.draggable(params.el, opts);\n }\n if (params.droppable !== false) {\n _jsPlumb.droppable(params.el, {\n drop:function(p) {\n var el = p.drag.el;\n if (el._isJsPlumbGroup) {\n return;\n }\n var currentGroup = el._jsPlumbGroup;\n if (currentGroup !== self) {\n if (currentGroup != null) {\n if (currentGroup.overrideDrop(el, self)) {\n return;\n }\n }\n _jsPlumb.getGroupManager().addToGroup(self, el, false);\n }\n\n }\n });\n }\n var _each = function(_el, fn) {\n var els = _el.nodeType == null ? _el : [ _el ];\n for (var i = 0; i < els.length; i++) {\n fn(els[i]);\n }\n };\n\n this.overrideDrop = function(_el, targetGroup) {\n return dropOverride && (revert || prune || orphan);\n };\n\n this.add = function(_el, doNotFireEvent/*, sourceGroup*/) {\n var dragArea = getDragArea();\n _each(_el, function(__el) {\n\n if (__el._jsPlumbGroup != null) {\n if (__el._jsPlumbGroup === self) {\n return;\n } else {\n __el._jsPlumbGroup.remove(__el, true, doNotFireEvent, false);\n }\n }\n\n __el._jsPlumbGroup = self;\n elements.push(__el);\n // test if draggable and add handlers if so.\n if (_jsPlumb.isAlreadyDraggable(__el)) {\n _bindDragHandlers(__el);\n }\n\n if (__el.parentNode !== dragArea) {\n dragArea.appendChild(__el);\n }\n\n // if (!doNotFireEvent) {\n // var p = {group: self, el: __el};\n // if (sourceGroup) {\n // p.sourceGroup = sourceGroup;\n // }\n // //_jsPlumb.fire(EVT_CHILD_ADDED, p);\n // }\n });\n\n _jsPlumb.getGroupManager().updateConnectionsForGroup(self);\n };\n\n this.remove = function(el, manipulateDOM, doNotFireEvent, doNotUpdateConnections, targetGroup) {\n\n _each(el, function(__el) {\n delete __el._jsPlumbGroup;\n _ju.removeWithFunction(elements, function(e) {\n return e === __el;\n });\n\n if (manipulateDOM) {\n try { self.getDragArea().removeChild(__el); }\n catch (e) {\n jsPlumbUtil.log(\"Could not remove element from Group \" + e);\n }\n }\n _unbindDragHandlers(__el);\n if (!doNotFireEvent) {\n var p = {group: self, el: __el};\n if (targetGroup) {\n p.targetGroup = targetGroup;\n }\n _jsPlumb.fire(EVT_CHILD_REMOVED, p);\n }\n });\n if (!doNotUpdateConnections) {\n _jsPlumb.getGroupManager().updateConnectionsForGroup(self);\n }\n };\n this.removeAll = function(manipulateDOM, doNotFireEvent) {\n for (var i = 0, l = elements.length; i < l; i++) {\n var el = elements[0];\n self.remove(el, manipulateDOM, doNotFireEvent, true);\n _jsPlumb.remove(el, true);\n }\n elements.length = 0;\n _jsPlumb.getGroupManager().updateConnectionsForGroup(self);\n };\n this.orphanAll = function() {\n var orphanedPositions = {};\n for (var i = 0; i < elements.length; i++) {\n var newPosition = _orphan(elements[i]);\n orphanedPositions[newPosition[0]] = newPosition[1];\n }\n elements.length = 0;\n\n return orphanedPositions;\n };\n this.getMembers = function() { return elements; };\n\n el[GROUP] = this;\n\n _jsPlumb.bind(ELEMENT_DRAGGABLE_EVENT, function(dragParams) {\n // if its for the current group,\n if (dragParams.el._jsPlumbGroup === this) {\n _bindDragHandlers(dragParams.el);\n }\n }.bind(this));\n\n function _findParent(_el) {\n return _el.offsetParent;\n }\n\n function _isInsideParent(_el, pos) {\n var p = _findParent(_el),\n s = _jsPlumb.getSize(p),\n ss = _jsPlumb.getSize(_el),\n leftEdge = pos[0],\n rightEdge = leftEdge + ss[0],\n topEdge = pos[1],\n bottomEdge = topEdge + ss[1];\n\n return rightEdge > 0 && leftEdge < s[0] && bottomEdge > 0 && topEdge < s[1];\n }\n\n //\n // orphaning an element means taking it out of the group and adding it to the main jsplumb container.\n // we return the new calculated position from this method and the element's id.\n //\n function _orphan(_el) {\n var id = _jsPlumb.getId(_el);\n var pos = _jsPlumb.getOffset(_el);\n _el.parentNode.removeChild(_el);\n _jsPlumb.getContainer().appendChild(_el);\n _jsPlumb.setPosition(_el, pos);\n delete _el._jsPlumbGroup;\n _unbindDragHandlers(_el);\n _jsPlumb.dragManager.clearParent(_el, id);\n return [id, pos];\n }\n\n //\n // remove an element from the group, then either prune it from the jsplumb instance, or just orphan it.\n //\n function _pruneOrOrphan(p) {\n var orphanedPosition = null;\n if (!_isInsideParent(p.el, p.pos)) {\n var group = p.el._jsPlumbGroup;\n if (prune) {\n _jsPlumb.remove(p.el);\n } else {\n orphanedPosition = _orphan(p.el);\n }\n\n group.remove(p.el);\n }\n\n return orphanedPosition;\n }\n\n //\n // redraws the element\n //\n function _revalidate(_el) {\n var id = _jsPlumb.getId(_el);\n _jsPlumb.revalidate(_el);\n _jsPlumb.dragManager.revalidateParent(_el, id);\n }\n\n //\n // unbind the group specific drag/revert handlers.\n //\n function _unbindDragHandlers(_el) {\n if (!_el._katavorioDrag) {\n return;\n }\n if (prune || orphan) {\n _el._katavorioDrag.off(STOP, _pruneOrOrphan);\n }\n if (!prune && !orphan && revert) {\n _el._katavorioDrag.off(REVERT, _revalidate);\n _el._katavorioDrag.setRevert(null);\n }\n }\n\n function _bindDragHandlers(_el) {\n if (!_el._katavorioDrag) {\n return;\n }\n if (prune || orphan) {\n _el._katavorioDrag.on(STOP, _pruneOrOrphan);\n }\n\n if (constrain) {\n _el._katavorioDrag.setConstrain(true);\n }\n\n if (ghost) {\n _el._katavorioDrag.setUseGhostProxy(true);\n }\n\n if (!prune && !orphan && revert) {\n _el._katavorioDrag.on(REVERT, _revalidate);\n _el._katavorioDrag.setRevert(function(__el, pos) {\n return !_isInsideParent(__el, pos);\n });\n }\n }\n\n this.shouldProxy = function() {\n return proxied;\n };\n\n _jsPlumb.getGroupManager().addGroup(this);\n };\n\n /**\n * Adds a group to the jsPlumb instance.\n * @method addGroup\n * @param {Object} params\n * @return {Group} The newly created Group.\n */\n _jpi.prototype.addGroup = function(params) {\n var j = this;\n j._groups = j._groups || {};\n if (j._groups[params.id] != null) {\n throw new TypeError(\"cannot create Group [\" + params.id + \"]; a Group with that ID exists\");\n }\n if (params.el[GROUP] != null) {\n throw new TypeError(\"cannot create Group [\" + params.id + \"]; the given element is already a Group\");\n }\n var group = new Group(j, params);\n j._groups[group.id] = group;\n if (params.collapsed) {\n this.collapseGroup(group);\n }\n return group;\n };\n\n /**\n * Add an element to a group.\n * @method addToGroup\n * @param {String} group Group, or ID of the group, to add the element to.\n * @param {Element} el Element to add to the group.\n */\n _jpi.prototype.addToGroup = function(group, el, doNotFireEvent) {\n\n var _one = function(_el) {\n var id = this.getId(_el);\n this.manage(id, _el);\n this.getGroupManager().addToGroup(group, _el, doNotFireEvent);\n }.bind(this);\n\n if (Array.isArray(el)) {\n for (var i = 0; i < el.length; i++) {\n _one(el[i]);\n }\n } else {\n _one(el);\n }\n };\n\n /**\n * Remove an element from a group.\n * @method removeFromGroup\n * @param {String} group Group, or ID of the group, to remove the element from.\n * @param {Element} el Element to add to the group.\n */\n _jpi.prototype.removeFromGroup = function(group, el, doNotFireEvent) {\n this.getGroupManager().removeFromGroup(group, el, doNotFireEvent);\n };\n\n /**\n * Remove a group, and optionally remove its members from the jsPlumb instance.\n * @method removeGroup\n * @param {String|Group} group Group to delete, or ID of Group to delete.\n * @param {Boolean} [deleteMembers=false] If true, group members will be removed along with the group. Otherwise they will\n * just be 'orphaned' (returned to the main container).\n * @returns {Map[String, Position}} When deleteMembers is false, this method returns a map of {id->position}\n */\n _jpi.prototype.removeGroup = function(group, deleteMembers, manipulateDOM, doNotFireEvent) {\n return this.getGroupManager().removeGroup(group, deleteMembers, manipulateDOM, doNotFireEvent);\n };\n\n /**\n * Remove all groups, and optionally remove their members from the jsPlumb instance.\n * @method removeAllGroup\n * @param {Boolean} [deleteMembers=false] If true, group members will be removed along with the groups. Otherwise they will\n * just be 'orphaned' (returned to the main container).\n */\n _jpi.prototype.removeAllGroups = function(deleteMembers, manipulateDOM, doNotFireEvent) {\n this.getGroupManager().removeAllGroups(deleteMembers, manipulateDOM, doNotFireEvent);\n };\n\n /**\n * Get a Group\n * @method getGroup\n * @param {String} groupId ID of the group to get\n * @return {Group} Group with the given ID, null if not found.\n */\n _jpi.prototype.getGroup = function(groupId) {\n return this.getGroupManager().getGroup(groupId);\n };\n\n /**\n * Gets all the Groups managed by the jsPlumb instance.\n * @returns {Group[]} List of Groups. Empty if none.\n */\n _jpi.prototype.getGroups = function() {\n return this.getGroupManager().getGroups();\n };\n\n /**\n * Expands a group element. jsPlumb doesn't do \"everything\" for you here, because what it means to expand a Group\n * will vary from application to application. jsPlumb does these things:\n *\n * - Hides any connections that are internal to the group (connections between members, and connections from member of\n * the group to the group itself)\n * - Proxies all connections for which the source or target is a member of the group.\n * - Hides the proxied connections.\n * - Adds the jtk-group-expanded class to the group's element\n * - Removes the jtk-group-collapsed class from the group's element.\n *\n * @method expandGroup\n * @param {String|Group} group Group to expand, or ID of Group to expand.\n */\n _jpi.prototype.expandGroup = function(group) {\n this.getGroupManager().expandGroup(group);\n };\n\n /**\n * Collapses a group element. jsPlumb doesn't do \"everything\" for you here, because what it means to collapse a Group\n * will vary from application to application. jsPlumb does these things:\n *\n * - Shows any connections that are internal to the group (connections between members, and connections from member of\n * the group to the group itself)\n * - Removes proxies for all connections for which the source or target is a member of the group.\n * - Shows the previously proxied connections.\n * - Adds the jtk-group-collapsed class to the group's element\n * - Removes the jtk-group-expanded class from the group's element.\n *\n * @method expandGroup\n * @param {String|Group} group Group to expand, or ID of Group to expand.\n */\n _jpi.prototype.collapseGroup = function(groupId) {\n this.getGroupManager().collapseGroup(groupId);\n };\n\n\n _jpi.prototype.repaintGroup = function(group) {\n this.getGroupManager().repaintGroup(group);\n };\n\n /**\n * Collapses or expands a group element depending on its current state. See notes in the collapseGroup and expandGroup method.\n *\n * @method toggleGroup\n * @param {String|Group} group Group to expand/collapse, or ID of Group to expand/collapse.\n */\n _jpi.prototype.toggleGroup = function(group) {\n group = this.getGroupManager().getGroup(group);\n if (group != null) {\n this.getGroupManager()[group.collapsed ? \"expandGroup\" : \"collapseGroup\"](group);\n }\n };\n\n //\n // lazy init a group manager for the given jsplumb instance.\n //\n _jpi.prototype.getGroupManager = function() {\n var mgr = this[GROUP_MANAGER];\n if (mgr == null) {\n mgr = this[GROUP_MANAGER] = new GroupManager(this);\n }\n return mgr;\n };\n\n _jpi.prototype.removeGroupManager = function() {\n delete this[GROUP_MANAGER];\n };\n\n /**\n * Gets the Group that the given element belongs to, null if none.\n * @method getGroupFor\n * @param {String|Element} el Element, or element ID.\n * @returns {Group} A Group, if found, or null.\n */\n _jpi.prototype.getGroupFor = function(el) {\n el = this.getElement(el);\n if (el) {\n return el[GROUP];\n }\n };\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n\n/*\n * This file contains the 'flowchart' connectors, consisting of vertical and horizontal line segments.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n var STRAIGHT = \"Straight\";\n var ARC = \"Arc\";\n\n var Flowchart = function (params) {\n this.type = \"Flowchart\";\n params = params || {};\n params.stub = params.stub == null ? 30 : params.stub;\n var segments,\n _super = _jp.Connectors.AbstractConnector.apply(this, arguments),\n midpoint = params.midpoint == null ? 0.5 : params.midpoint,\n alwaysRespectStubs = params.alwaysRespectStubs === true,\n lastx = null, lasty = null, lastOrientation,\n cornerRadius = params.cornerRadius != null ? params.cornerRadius : 0,\n\n // TODO now common between this and AbstractBezierEditor; refactor into superclass?\n loopbackRadius = params.loopbackRadius || 25,\n isLoopbackCurrently = false,\n\n sgn = function (n) {\n return n < 0 ? -1 : n === 0 ? 0 : 1;\n },\n segmentDirections = function(segment) {\n return [\n sgn( segment[2] - segment[0] ),\n sgn( segment[3] - segment[1] )\n ];\n },\n /**\n * helper method to add a segment.\n */\n addSegment = function (segments, x, y, paintInfo) {\n if (lastx === x && lasty === y) {\n return;\n }\n var lx = lastx == null ? paintInfo.sx : lastx,\n ly = lasty == null ? paintInfo.sy : lasty,\n o = lx === x ? \"v\" : \"h\";\n\n lastx = x;\n lasty = y;\n segments.push([ lx, ly, x, y, o ]);\n },\n segLength = function (s) {\n return Math.sqrt(Math.pow(s[0] - s[2], 2) + Math.pow(s[1] - s[3], 2));\n },\n _cloneArray = function (a) {\n var _a = [];\n _a.push.apply(_a, a);\n return _a;\n },\n writeSegments = function (conn, segments, paintInfo) {\n var current = null, next, currentDirection, nextDirection;\n for (var i = 0; i < segments.length - 1; i++) {\n\n current = current || _cloneArray(segments[i]);\n next = _cloneArray(segments[i + 1]);\n\n currentDirection = segmentDirections(current);\n nextDirection = segmentDirections(next);\n\n if (cornerRadius > 0 && current[4] !== next[4]) {\n\n var minSegLength = Math.min(segLength(current), segLength(next));\n var radiusToUse = Math.min(cornerRadius, minSegLength / 2);\n\n current[2] -= currentDirection[0] * radiusToUse;\n current[3] -= currentDirection[1] * radiusToUse;\n next[0] += nextDirection[0] * radiusToUse;\n next[1] += nextDirection[1] * radiusToUse;\n\n var ac = (currentDirection[1] === nextDirection[0] && nextDirection[0] === 1) ||\n ((currentDirection[1] === nextDirection[0] && nextDirection[0] === 0) && currentDirection[0] !== nextDirection[1]) ||\n (currentDirection[1] === nextDirection[0] && nextDirection[0] === -1),\n sgny = next[1] > current[3] ? 1 : -1,\n sgnx = next[0] > current[2] ? 1 : -1,\n sgnEqual = sgny === sgnx,\n cx = (sgnEqual && ac || (!sgnEqual && !ac)) ? next[0] : current[2],\n cy = (sgnEqual && ac || (!sgnEqual && !ac)) ? current[3] : next[1];\n\n _super.addSegment(conn, STRAIGHT, {\n x1: current[0], y1: current[1], x2: current[2], y2: current[3]\n });\n\n _super.addSegment(conn, ARC, {\n r: radiusToUse,\n x1: current[2],\n y1: current[3],\n x2: next[0],\n y2: next[1],\n cx: cx,\n cy: cy,\n ac: ac\n });\n }\n else {\n // dx + dy are used to adjust for line width.\n var dx = (current[2] === current[0]) ? 0 : (current[2] > current[0]) ? (paintInfo.lw / 2) : -(paintInfo.lw / 2),\n dy = (current[3] === current[1]) ? 0 : (current[3] > current[1]) ? (paintInfo.lw / 2) : -(paintInfo.lw / 2);\n\n _super.addSegment(conn, STRAIGHT, {\n x1: current[0] - dx, y1: current[1] - dy, x2: current[2] + dx, y2: current[3] + dy\n });\n }\n current = next;\n }\n if (next != null) {\n // last segment\n _super.addSegment(conn, STRAIGHT, {\n x1: next[0], y1: next[1], x2: next[2], y2: next[3]\n });\n }\n };\n\n this._compute = function (paintInfo, params) {\n\n segments = [];\n lastx = null;\n lasty = null;\n lastOrientation = null;\n\n var commonStubCalculator = function () {\n return [paintInfo.startStubX, paintInfo.startStubY, paintInfo.endStubX, paintInfo.endStubY];\n },\n stubCalculators = {\n perpendicular: commonStubCalculator,\n orthogonal: commonStubCalculator,\n opposite: function (axis) {\n var pi = paintInfo,\n idx = axis === \"x\" ? 0 : 1,\n areInProximity = {\n \"x\": function () {\n return ( (pi.so[idx] === 1 && (\n ( (pi.startStubX > pi.endStubX) && (pi.tx > pi.startStubX) ) ||\n ( (pi.sx > pi.endStubX) && (pi.tx > pi.sx))))) ||\n\n ( (pi.so[idx] === -1 && (\n ( (pi.startStubX < pi.endStubX) && (pi.tx < pi.startStubX) ) ||\n ( (pi.sx < pi.endStubX) && (pi.tx < pi.sx)))));\n },\n \"y\": function () {\n return ( (pi.so[idx] === 1 && (\n ( (pi.startStubY > pi.endStubY) && (pi.ty > pi.startStubY) ) ||\n ( (pi.sy > pi.endStubY) && (pi.ty > pi.sy))))) ||\n\n ( (pi.so[idx] === -1 && (\n ( (pi.startStubY < pi.endStubY) && (pi.ty < pi.startStubY) ) ||\n ( (pi.sy < pi.endStubY) && (pi.ty < pi.sy)))));\n }\n };\n\n if (!alwaysRespectStubs && areInProximity[axis]()) {\n return {\n \"x\": [(paintInfo.sx + paintInfo.tx) / 2, paintInfo.startStubY, (paintInfo.sx + paintInfo.tx) / 2, paintInfo.endStubY],\n \"y\": [paintInfo.startStubX, (paintInfo.sy + paintInfo.ty) / 2, paintInfo.endStubX, (paintInfo.sy + paintInfo.ty) / 2]\n }[axis];\n }\n else {\n return [paintInfo.startStubX, paintInfo.startStubY, paintInfo.endStubX, paintInfo.endStubY];\n }\n }\n };\n\n // calculate Stubs.\n var stubs = stubCalculators[paintInfo.anchorOrientation](paintInfo.sourceAxis),\n idx = paintInfo.sourceAxis === \"x\" ? 0 : 1,\n oidx = paintInfo.sourceAxis === \"x\" ? 1 : 0,\n ss = stubs[idx],\n oss = stubs[oidx],\n es = stubs[idx + 2],\n oes = stubs[oidx + 2];\n\n // add the start stub segment. use stubs for loopback as it will look better, with the loop spaced\n // away from the element.\n addSegment(segments, stubs[0], stubs[1], paintInfo);\n\n // if its a loopback and we should treat it differently.\n // if (false && params.sourcePos[0] === params.targetPos[0] && params.sourcePos[1] === params.targetPos[1]) {\n //\n // // we use loopbackRadius here, as statemachine connectors do.\n // // so we go radius to the left from stubs[0], then upwards by 2*radius, to the right by 2*radius,\n // // down by 2*radius, left by radius.\n // addSegment(segments, stubs[0] - loopbackRadius, stubs[1], paintInfo);\n // addSegment(segments, stubs[0] - loopbackRadius, stubs[1] - (2 * loopbackRadius), paintInfo);\n // addSegment(segments, stubs[0] + loopbackRadius, stubs[1] - (2 * loopbackRadius), paintInfo);\n // addSegment(segments, stubs[0] + loopbackRadius, stubs[1], paintInfo);\n // addSegment(segments, stubs[0], stubs[1], paintInfo);\n //\n // }\n // else {\n\n\n var midx = paintInfo.startStubX + ((paintInfo.endStubX - paintInfo.startStubX) * midpoint),\n midy = paintInfo.startStubY + ((paintInfo.endStubY - paintInfo.startStubY) * midpoint);\n\n var orientations = {x: [0, 1], y: [1, 0]},\n lineCalculators = {\n perpendicular: function (axis) {\n var pi = paintInfo,\n sis = {\n x: [\n [[1, 2, 3, 4], null, [2, 1, 4, 3]],\n null,\n [[4, 3, 2, 1], null, [3, 4, 1, 2]]\n ],\n y: [\n [[3, 2, 1, 4], null, [2, 3, 4, 1]],\n null,\n [[4, 1, 2, 3], null, [1, 4, 3, 2]]\n ]\n },\n stubs = {\n x: [[pi.startStubX, pi.endStubX], null, [pi.endStubX, pi.startStubX]],\n y: [[pi.startStubY, pi.endStubY], null, [pi.endStubY, pi.startStubY]]\n },\n midLines = {\n x: [[midx, pi.startStubY], [midx, pi.endStubY]],\n y: [[pi.startStubX, midy], [pi.endStubX, midy]]\n },\n linesToEnd = {\n x: [[pi.endStubX, pi.startStubY]],\n y: [[pi.startStubX, pi.endStubY]]\n },\n startToEnd = {\n x: [[pi.startStubX, pi.endStubY], [pi.endStubX, pi.endStubY]],\n y: [[pi.endStubX, pi.startStubY], [pi.endStubX, pi.endStubY]]\n },\n startToMidToEnd = {\n x: [[pi.startStubX, midy], [pi.endStubX, midy], [pi.endStubX, pi.endStubY]],\n y: [[midx, pi.startStubY], [midx, pi.endStubY], [pi.endStubX, pi.endStubY]]\n },\n otherStubs = {\n x: [pi.startStubY, pi.endStubY],\n y: [pi.startStubX, pi.endStubX]\n },\n soIdx = orientations[axis][0], toIdx = orientations[axis][1],\n _so = pi.so[soIdx] + 1,\n _to = pi.to[toIdx] + 1,\n otherFlipped = (pi.to[toIdx] === -1 && (otherStubs[axis][1] < otherStubs[axis][0])) || (pi.to[toIdx] === 1 && (otherStubs[axis][1] > otherStubs[axis][0])),\n stub1 = stubs[axis][_so][0],\n stub2 = stubs[axis][_so][1],\n segmentIndexes = sis[axis][_so][_to];\n\n if (pi.segment === segmentIndexes[3] || (pi.segment === segmentIndexes[2] && otherFlipped)) {\n return midLines[axis];\n }\n else if (pi.segment === segmentIndexes[2] && stub2 < stub1) {\n return linesToEnd[axis];\n }\n else if ((pi.segment === segmentIndexes[2] && stub2 >= stub1) || (pi.segment === segmentIndexes[1] && !otherFlipped)) {\n return startToMidToEnd[axis];\n }\n else if (pi.segment === segmentIndexes[0] || (pi.segment === segmentIndexes[1] && otherFlipped)) {\n return startToEnd[axis];\n }\n },\n orthogonal: function (axis, startStub, otherStartStub, endStub, otherEndStub) {\n var pi = paintInfo,\n extent = {\n \"x\": pi.so[0] === -1 ? Math.min(startStub, endStub) : Math.max(startStub, endStub),\n \"y\": pi.so[1] === -1 ? Math.min(startStub, endStub) : Math.max(startStub, endStub)\n }[axis];\n\n return {\n \"x\": [\n [extent, otherStartStub],\n [extent, otherEndStub],\n [endStub, otherEndStub]\n ],\n \"y\": [\n [otherStartStub, extent],\n [otherEndStub, extent],\n [otherEndStub, endStub]\n ]\n }[axis];\n },\n opposite: function (axis, ss, oss, es) {\n var pi = paintInfo,\n otherAxis = {\"x\": \"y\", \"y\": \"x\"}[axis],\n dim = {\"x\": \"height\", \"y\": \"width\"}[axis],\n comparator = pi[\"is\" + axis.toUpperCase() + \"GreaterThanStubTimes2\"];\n\n if (params.sourceEndpoint.elementId === params.targetEndpoint.elementId) {\n var _val = oss + ((1 - params.sourceEndpoint.anchor[otherAxis]) * params.sourceInfo[dim]) + _super.maxStub;\n return {\n \"x\": [\n [ss, _val],\n [es, _val]\n ],\n \"y\": [\n [_val, ss],\n [_val, es]\n ]\n }[axis];\n\n }\n else if (!comparator || (pi.so[idx] === 1 && ss > es) || (pi.so[idx] === -1 && ss < es)) {\n return {\n \"x\": [\n [ss, midy],\n [es, midy]\n ],\n \"y\": [\n [midx, ss],\n [midx, es]\n ]\n }[axis];\n }\n else if ((pi.so[idx] === 1 && ss < es) || (pi.so[idx] === -1 && ss > es)) {\n return {\n \"x\": [\n [midx, pi.sy],\n [midx, pi.ty]\n ],\n \"y\": [\n [pi.sx, midy],\n [pi.tx, midy]\n ]\n }[axis];\n }\n }\n };\n\n // compute the rest of the line\n var p = lineCalculators[paintInfo.anchorOrientation](paintInfo.sourceAxis, ss, oss, es, oes);\n if (p) {\n for (var i = 0; i < p.length; i++) {\n addSegment(segments, p[i][0], p[i][1], paintInfo);\n }\n }\n\n // line to end stub\n addSegment(segments, stubs[2], stubs[3], paintInfo);\n\n //}\n\n // end stub to end (common)\n addSegment(segments, paintInfo.tx, paintInfo.ty, paintInfo);\n\n\n\n // write out the segments.\n writeSegments(this, segments, paintInfo);\n\n };\n };\n\n _jp.Connectors.Flowchart = Flowchart;\n _ju.extend(_jp.Connectors.Flowchart, _jp.Connectors.AbstractConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the code for the Bezier connector type.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n _jp.Connectors.AbstractBezierConnector = function(params) {\n params = params || {};\n var showLoopback = params.showLoopback !== false,\n curviness = params.curviness || 10,\n margin = params.margin || 5,\n proximityLimit = params.proximityLimit || 80,\n clockwise = params.orientation && params.orientation === \"clockwise\",\n loopbackRadius = params.loopbackRadius || 25,\n isLoopbackCurrently = false,\n _super;\n\n this._compute = function (paintInfo, p) {\n\n var sp = p.sourcePos,\n tp = p.targetPos,\n _w = Math.abs(sp[0] - tp[0]),\n _h = Math.abs(sp[1] - tp[1]);\n\n if (!showLoopback || (p.sourceEndpoint.elementId !== p.targetEndpoint.elementId)) {\n isLoopbackCurrently = false;\n this._computeBezier(paintInfo, p, sp, tp, _w, _h);\n } else {\n isLoopbackCurrently = true;\n // a loopback connector. draw an arc from one anchor to the other.\n var x1 = p.sourcePos[0], y1 = p.sourcePos[1] - margin,\n cx = x1, cy = y1 - loopbackRadius,\n // canvas sizing stuff, to ensure the whole painted area is visible.\n _x = cx - loopbackRadius,\n _y = cy - loopbackRadius;\n\n _w = 2 * loopbackRadius;\n _h = 2 * loopbackRadius;\n\n paintInfo.points[0] = _x;\n paintInfo.points[1] = _y;\n paintInfo.points[2] = _w;\n paintInfo.points[3] = _h;\n\n // ADD AN ARC SEGMENT.\n _super.addSegment(this, \"Arc\", {\n loopback: true,\n x1: (x1 - _x) + 4,\n y1: y1 - _y,\n startAngle: 0,\n endAngle: 2 * Math.PI,\n r: loopbackRadius,\n ac: !clockwise,\n x2: (x1 - _x) - 4,\n y2: y1 - _y,\n cx: cx - _x,\n cy: cy - _y\n });\n }\n };\n\n _super = _jp.Connectors.AbstractConnector.apply(this, arguments);\n return _super;\n };\n _ju.extend(_jp.Connectors.AbstractBezierConnector, _jp.Connectors.AbstractConnector);\n\n var Bezier = function (params) {\n params = params || {};\n this.type = \"Bezier\";\n\n var _super = _jp.Connectors.AbstractBezierConnector.apply(this, arguments),\n majorAnchor = params.curviness || 150,\n minorAnchor = 10;\n\n this.getCurviness = function () {\n return majorAnchor;\n };\n\n this._findControlPoint = function (point, sourceAnchorPosition, targetAnchorPosition, sourceEndpoint, targetEndpoint, soo, too) {\n // determine if the two anchors are perpendicular to each other in their orientation. we swap the control\n // points around if so (code could be tightened up)\n var perpendicular = soo[0] !== too[0] || soo[1] === too[1],\n p = [];\n\n if (!perpendicular) {\n if (soo[0] === 0) {\n p.push(sourceAnchorPosition[0] < targetAnchorPosition[0] ? point[0] + minorAnchor : point[0] - minorAnchor);\n }\n else {\n p.push(point[0] - (majorAnchor * soo[0]));\n }\n\n if (soo[1] === 0) {\n p.push(sourceAnchorPosition[1] < targetAnchorPosition[1] ? point[1] + minorAnchor : point[1] - minorAnchor);\n }\n else {\n p.push(point[1] + (majorAnchor * too[1]));\n }\n }\n else {\n if (too[0] === 0) {\n p.push(targetAnchorPosition[0] < sourceAnchorPosition[0] ? point[0] + minorAnchor : point[0] - minorAnchor);\n }\n else {\n p.push(point[0] + (majorAnchor * too[0]));\n }\n\n if (too[1] === 0) {\n p.push(targetAnchorPosition[1] < sourceAnchorPosition[1] ? point[1] + minorAnchor : point[1] - minorAnchor);\n }\n else {\n p.push(point[1] + (majorAnchor * soo[1]));\n }\n }\n\n return p;\n };\n\n this._computeBezier = function (paintInfo, p, sp, tp, _w, _h) {\n\n var _CP, _CP2,\n _sx = sp[0] < tp[0] ? _w : 0,\n _sy = sp[1] < tp[1] ? _h : 0,\n _tx = sp[0] < tp[0] ? 0 : _w,\n _ty = sp[1] < tp[1] ? 0 : _h;\n\n _CP = this._findControlPoint([_sx, _sy], sp, tp, p.sourceEndpoint, p.targetEndpoint, paintInfo.so, paintInfo.to);\n _CP2 = this._findControlPoint([_tx, _ty], tp, sp, p.targetEndpoint, p.sourceEndpoint, paintInfo.to, paintInfo.so);\n\n\n _super.addSegment(this, \"Bezier\", {\n x1: _sx, y1: _sy, x2: _tx, y2: _ty,\n cp1x: _CP[0], cp1y: _CP[1], cp2x: _CP2[0], cp2y: _CP2[1]\n });\n };\n\n\n };\n\n _jp.Connectors.Bezier = Bezier;\n _ju.extend(Bezier, _jp.Connectors.AbstractBezierConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the state machine connectors, which extend AbstractBezierConnector.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n var _segment = function (x1, y1, x2, y2) {\n if (x1 <= x2 && y2 <= y1) {\n return 1;\n }\n else if (x1 <= x2 && y1 <= y2) {\n return 2;\n }\n else if (x2 <= x1 && y2 >= y1) {\n return 3;\n }\n return 4;\n },\n\n // the control point we will use depends on the faces to which each end of the connection is assigned, specifically whether or not the\n // two faces are parallel or perpendicular. if they are parallel then the control point lies on the midpoint of the axis in which they\n // are parellel and varies only in the other axis; this variation is proportional to the distance that the anchor points lie from the\n // center of that face. if the two faces are perpendicular then the control point is at some distance from both the midpoints; the amount and\n // direction are dependent on the orientation of the two elements. 'seg', passed in to this method, tells you which segment the target element\n // lies in with respect to the source: 1 is top right, 2 is bottom right, 3 is bottom left, 4 is top left.\n //\n // sourcePos and targetPos are arrays of info about where on the source and target each anchor is located. their contents are:\n //\n // 0 - absolute x\n // 1 - absolute y\n // 2 - proportional x in element (0 is left edge, 1 is right edge)\n // 3 - proportional y in element (0 is top edge, 1 is bottom edge)\n //\n _findControlPoint = function (midx, midy, segment, sourceEdge, targetEdge, dx, dy, distance, proximityLimit) {\n // TODO (maybe)\n // - if anchor pos is 0.5, make the control point take into account the relative position of the elements.\n if (distance <= proximityLimit) {\n return [midx, midy];\n }\n\n if (segment === 1) {\n if (sourceEdge[3] <= 0 && targetEdge[3] >= 1) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] >= 1 && targetEdge[2] <= 0) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + (-1 * dx) , midy + (-1 * dy) ];\n }\n }\n else if (segment === 2) {\n if (sourceEdge[3] >= 1 && targetEdge[3] <= 0) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] >= 1 && targetEdge[2] <= 0) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + dx, midy + (-1 * dy) ];\n }\n }\n else if (segment === 3) {\n if (sourceEdge[3] >= 1 && targetEdge[3] <= 0) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] <= 0 && targetEdge[2] >= 1) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + (-1 * dx) , midy + (-1 * dy) ];\n }\n }\n else if (segment === 4) {\n if (sourceEdge[3] <= 0 && targetEdge[3] >= 1) {\n return [ midx + (sourceEdge[2] < 0.5 ? -1 * dx : dx), midy ];\n }\n else if (sourceEdge[2] <= 0 && targetEdge[2] >= 1) {\n return [ midx, midy + (sourceEdge[3] < 0.5 ? -1 * dy : dy) ];\n }\n else {\n return [ midx + dx , midy + (-1 * dy) ];\n }\n }\n\n };\n\n var StateMachine = function (params) {\n params = params || {};\n this.type = \"StateMachine\";\n\n var _super = _jp.Connectors.AbstractBezierConnector.apply(this, arguments),\n curviness = params.curviness || 10,\n margin = params.margin || 5,\n proximityLimit = params.proximityLimit || 80,\n clockwise = params.orientation && params.orientation === \"clockwise\",\n _controlPoint;\n\n this._computeBezier = function(paintInfo, params, sp, tp, w, h) {\n var _sx = params.sourcePos[0] < params.targetPos[0] ? 0 : w,\n _sy = params.sourcePos[1] < params.targetPos[1] ? 0 : h,\n _tx = params.sourcePos[0] < params.targetPos[0] ? w : 0,\n _ty = params.sourcePos[1] < params.targetPos[1] ? h : 0;\n\n // now adjust for the margin\n if (params.sourcePos[2] === 0) {\n _sx -= margin;\n }\n if (params.sourcePos[2] === 1) {\n _sx += margin;\n }\n if (params.sourcePos[3] === 0) {\n _sy -= margin;\n }\n if (params.sourcePos[3] === 1) {\n _sy += margin;\n }\n if (params.targetPos[2] === 0) {\n _tx -= margin;\n }\n if (params.targetPos[2] === 1) {\n _tx += margin;\n }\n if (params.targetPos[3] === 0) {\n _ty -= margin;\n }\n if (params.targetPos[3] === 1) {\n _ty += margin;\n }\n\n //\n // these connectors are quadratic bezier curves, having a single control point. if both anchors\n // are located at 0.5 on their respective faces, the control point is set to the midpoint and you\n // get a straight line. this is also the case if the two anchors are within 'proximityLimit', since\n // it seems to make good aesthetic sense to do that. outside of that, the control point is positioned\n // at 'curviness' pixels away along the normal to the straight line connecting the two anchors.\n //\n // there may be two improvements to this. firstly, we might actually support the notion of avoiding nodes\n // in the UI, or at least making a good effort at doing so. if a connection would pass underneath some node,\n // for example, we might increase the distance the control point is away from the midpoint in a bid to\n // steer it around that node. this will work within limits, but i think those limits would also be the likely\n // limits for, once again, aesthetic good sense in the layout of a chart using these connectors.\n //\n // the second possible change is actually two possible changes: firstly, it is possible we should gradually\n // decrease the 'curviness' as the distance between the anchors decreases; start tailing it off to 0 at some\n // point (which should be configurable). secondly, we might slightly increase the 'curviness' for connectors\n // with respect to how far their anchor is from the center of its respective face. this could either look cool,\n // or stupid, and may indeed work only in a way that is so subtle as to have been a waste of time.\n //\n\n var _midx = (_sx + _tx) / 2,\n _midy = (_sy + _ty) / 2,\n segment = _segment(_sx, _sy, _tx, _ty),\n distance = Math.sqrt(Math.pow(_tx - _sx, 2) + Math.pow(_ty - _sy, 2)),\n cp1x, cp2x, cp1y, cp2y;\n\n\n // calculate the control point. this code will be where we'll put in a rudimentary element avoidance scheme; it\n // will work by extending the control point to force the curve to be, um, curvier.\n _controlPoint = _findControlPoint(_midx,\n _midy,\n segment,\n params.sourcePos,\n params.targetPos,\n curviness, curviness,\n distance,\n proximityLimit);\n\n cp1x = _controlPoint[0];\n cp2x = _controlPoint[0];\n cp1y = _controlPoint[1];\n cp2y = _controlPoint[1];\n\n _super.addSegment(this, \"Bezier\", {\n x1: _tx, y1: _ty, x2: _sx, y2: _sy,\n cp1x: cp1x, cp1y: cp1y,\n cp2x: cp2x, cp2y: cp2y\n });\n };\n };\n\n _jp.Connectors.StateMachine = StateMachine;\n _ju.extend(StateMachine, _jp.Connectors.AbstractBezierConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the 'flowchart' connectors, consisting of vertical and horizontal line segments.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n var STRAIGHT = \"Straight\";\n\n var Straight = function (params) {\n this.type = STRAIGHT;\n var _super = _jp.Connectors.AbstractConnector.apply(this, arguments);\n\n this._compute = function (paintInfo, _) {\n _super.addSegment(this, STRAIGHT, {x1: paintInfo.sx, y1: paintInfo.sy, x2: paintInfo.startStubX, y2: paintInfo.startStubY});\n _super.addSegment(this, STRAIGHT, {x1: paintInfo.startStubX, y1: paintInfo.startStubY, x2: paintInfo.endStubX, y2: paintInfo.endStubY});\n _super.addSegment(this, STRAIGHT, {x1: paintInfo.endStubX, y1: paintInfo.endStubY, x2: paintInfo.tx, y2: paintInfo.ty});\n };\n };\n\n _jp.Connectors.Straight = Straight;\n _ju.extend(Straight, _jp.Connectors.AbstractConnector);\n\n}).call(typeof window !== 'undefined' ? window : this);\n/*\n * This file contains the SVG renderers.\n *\n * Copyright (c) 2010 - 2018 jsPlumb (hello@jsplumbtoolkit.com)\n * \n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n * \n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n// ************************** SVG utility methods ********************************************\t\n\n \"use strict\";\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil;\n\n var svgAttributeMap = {\n \"stroke-linejoin\": \"stroke-linejoin\",\n \"stroke-dashoffset\": \"stroke-dashoffset\",\n \"stroke-linecap\": \"stroke-linecap\"\n },\n STROKE_DASHARRAY = \"stroke-dasharray\",\n DASHSTYLE = \"dashstyle\",\n LINEAR_GRADIENT = \"linearGradient\",\n RADIAL_GRADIENT = \"radialGradient\",\n DEFS = \"defs\",\n FILL = \"fill\",\n STOP = \"stop\",\n STROKE = \"stroke\",\n STROKE_WIDTH = \"stroke-width\",\n STYLE = \"style\",\n NONE = \"none\",\n JSPLUMB_GRADIENT = \"jsplumb_gradient_\",\n LINE_WIDTH = \"strokeWidth\",\n ns = {\n svg: \"http://www.w3.org/2000/svg\"\n },\n _attr = function (node, attributes) {\n for (var i in attributes) {\n node.setAttribute(i, \"\" + attributes[i]);\n }\n },\n _node = function (name, attributes) {\n attributes = attributes || {};\n attributes.version = \"1.1\";\n attributes.xmlns = ns.svg;\n return _jp.createElementNS(ns.svg, name, null, null, attributes);\n },\n _pos = function (d) {\n return \"position:absolute;left:\" + d[0] + \"px;top:\" + d[1] + \"px\";\n },\n _clearGradient = function (parent) {\n var els = parent.querySelectorAll(\" defs,linearGradient,radialGradient\");\n for (var i = 0; i < els.length; i++) {\n els[i].parentNode.removeChild(els[i]);\n }\n },\n _updateGradient = function (parent, node, style, dimensions, uiComponent) {\n var id = JSPLUMB_GRADIENT + uiComponent._jsPlumb.instance.idstamp();\n // first clear out any existing gradient\n _clearGradient(parent);\n // this checks for an 'offset' property in the gradient, and in the absence of it, assumes\n // we want a linear gradient. if it's there, we create a radial gradient.\n // it is possible that a more explicit means of defining the gradient type would be\n // better. relying on 'offset' means that we can never have a radial gradient that uses\n // some default offset, for instance.\n // issue 244 suggested the 'gradientUnits' attribute; without this, straight/flowchart connectors with gradients would\n // not show gradients when the line was perfectly horizontal or vertical.\n var g;\n if (!style.gradient.offset) {\n g = _node(LINEAR_GRADIENT, {id: id, gradientUnits: \"userSpaceOnUse\"});\n }\n else {\n g = _node(RADIAL_GRADIENT, { id: id });\n }\n\n var defs = _node(DEFS);\n parent.appendChild(defs);\n defs.appendChild(g);\n\n // the svg radial gradient seems to treat stops in the reverse\n // order to how canvas does it. so we want to keep all the maths the same, but\n // iterate the actual style declarations in reverse order, if the x indexes are not in order.\n for (var i = 0; i < style.gradient.stops.length; i++) {\n var styleToUse = uiComponent.segment === 1 || uiComponent.segment === 2 ? i : style.gradient.stops.length - 1 - i,\n stopColor = style.gradient.stops[styleToUse][1],\n s = _node(STOP, {\"offset\": Math.floor(style.gradient.stops[i][0] * 100) + \"%\", \"stop-color\": stopColor});\n\n g.appendChild(s);\n }\n var applyGradientTo = style.stroke ? STROKE : FILL;\n node.setAttribute(applyGradientTo, \"url(#\" + id + \")\");\n },\n _applyStyles = function (parent, node, style, dimensions, uiComponent) {\n\n node.setAttribute(FILL, style.fill ? style.fill : NONE);\n node.setAttribute(STROKE, style.stroke ? style.stroke : NONE);\n\n if (style.gradient) {\n _updateGradient(parent, node, style, dimensions, uiComponent);\n }\n else {\n // make sure we clear any existing gradient\n _clearGradient(parent);\n node.setAttribute(STYLE, \"\");\n }\n\n if (style.strokeWidth) {\n node.setAttribute(STROKE_WIDTH, style.strokeWidth);\n }\n\n // in SVG there is a stroke-dasharray attribute we can set, and its syntax looks like\n // the syntax in VML but is actually kind of nasty: values are given in the pixel\n // coordinate space, whereas in VML they are multiples of the width of the stroked\n // line, which makes a lot more sense. for that reason, jsPlumb is supporting both\n // the native svg 'stroke-dasharray' attribute, and also the 'dashstyle' concept from\n // VML, which will be the preferred method. the code below this converts a dashstyle\n // attribute given in terms of stroke width into a pixel representation, by using the\n // stroke's lineWidth.\n if (style[DASHSTYLE] && style[LINE_WIDTH] && !style[STROKE_DASHARRAY]) {\n var sep = style[DASHSTYLE].indexOf(\",\") === -1 ? \" \" : \",\",\n parts = style[DASHSTYLE].split(sep),\n styleToUse = \"\";\n parts.forEach(function (p) {\n styleToUse += (Math.floor(p * style.strokeWidth) + sep);\n });\n node.setAttribute(STROKE_DASHARRAY, styleToUse);\n }\n else if (style[STROKE_DASHARRAY]) {\n node.setAttribute(STROKE_DASHARRAY, style[STROKE_DASHARRAY]);\n }\n\n // extra attributes such as join type, dash offset.\n for (var i in svgAttributeMap) {\n if (style[i]) {\n node.setAttribute(svgAttributeMap[i], style[i]);\n }\n }\n },\n _appendAtIndex = function (svg, path, idx) {\n if (svg.childNodes.length > idx) {\n svg.insertBefore(path, svg.childNodes[idx]);\n }\n else {\n svg.appendChild(path);\n }\n };\n\n /**\n utility methods for other objects to use.\n */\n _ju.svg = {\n node: _node,\n attr: _attr,\n pos: _pos\n };\n\n // ************************** / SVG utility methods ********************************************\n\n /*\n * Base class for SVG components.\n */\n var SvgComponent = function (params) {\n var pointerEventsSpec = params.pointerEventsSpec || \"all\", renderer = {};\n\n _jp.jsPlumbUIComponent.apply(this, params.originalArgs);\n this.canvas = null;\n this.path = null;\n this.svg = null;\n this.bgCanvas = null;\n\n var clazz = params.cssClass + \" \" + (params.originalArgs[0].cssClass || \"\"),\n svgParams = {\n \"style\": \"\",\n \"width\": 0,\n \"height\": 0,\n \"pointer-events\": pointerEventsSpec,\n \"position\": \"absolute\"\n };\n\n this.svg = _node(\"svg\", svgParams);\n\n if (params.useDivWrapper) {\n this.canvas = _jp.createElement(\"div\", { position : \"absolute\" });\n _ju.sizeElement(this.canvas, 0, 0, 1, 1);\n this.canvas.className = clazz;\n }\n else {\n _attr(this.svg, { \"class\": clazz });\n this.canvas = this.svg;\n }\n\n params._jsPlumb.appendElement(this.canvas, params.originalArgs[0].parent);\n if (params.useDivWrapper) {\n this.canvas.appendChild(this.svg);\n }\n\n var displayElements = [ this.canvas ];\n this.getDisplayElements = function () {\n return displayElements;\n };\n\n this.appendDisplayElement = function (el) {\n displayElements.push(el);\n };\n\n this.paint = function (style, anchor, extents) {\n if (style != null) {\n\n var xy = [ this.x, this.y ], wh = [ this.w, this.h ], p;\n if (extents != null) {\n if (extents.xmin < 0) {\n xy[0] += extents.xmin;\n }\n if (extents.ymin < 0) {\n xy[1] += extents.ymin;\n }\n wh[0] = extents.xmax + ((extents.xmin < 0) ? -extents.xmin : 0);\n wh[1] = extents.ymax + ((extents.ymin < 0) ? -extents.ymin : 0);\n }\n\n if (params.useDivWrapper) {\n _ju.sizeElement(this.canvas, xy[0], xy[1], wh[0], wh[1]);\n xy[0] = 0;\n xy[1] = 0;\n p = _pos([ 0, 0 ]);\n }\n else {\n p = _pos([ xy[0], xy[1] ]);\n }\n\n renderer.paint.apply(this, arguments);\n\n _attr(this.svg, {\n \"style\": p,\n \"width\": wh[0] || 0,\n \"height\": wh[1] || 0\n });\n }\n };\n\n return {\n renderer: renderer\n };\n };\n\n _ju.extend(SvgComponent, _jp.jsPlumbUIComponent, {\n cleanup: function (force) {\n if (force || this.typeId == null) {\n if (this.canvas) {\n this.canvas._jsPlumb = null;\n }\n if (this.svg) {\n this.svg._jsPlumb = null;\n }\n if (this.bgCanvas) {\n this.bgCanvas._jsPlumb = null;\n }\n\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n if (this.bgCanvas && this.bgCanvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n\n this.svg = null;\n this.canvas = null;\n this.path = null;\n this.group = null;\n }\n else {\n // if not a forced cleanup, just detach from DOM for now.\n if (this.canvas && this.canvas.parentNode) {\n this.canvas.parentNode.removeChild(this.canvas);\n }\n if (this.bgCanvas && this.bgCanvas.parentNode) {\n this.bgCanvas.parentNode.removeChild(this.bgCanvas);\n }\n }\n },\n reattach:function(instance) {\n var c = instance.getContainer();\n if (this.canvas && this.canvas.parentNode == null) {\n c.appendChild(this.canvas);\n }\n if (this.bgCanvas && this.bgCanvas.parentNode == null) {\n c.appendChild(this.bgCanvas);\n }\n },\n setVisible: function (v) {\n if (this.canvas) {\n this.canvas.style.display = v ? \"block\" : \"none\";\n }\n }\n });\n\n /*\n * Base class for SVG connectors.\n */\n _jp.ConnectorRenderers.svg = function (params) {\n var self = this,\n _super = SvgComponent.apply(this, [\n {\n cssClass: params._jsPlumb.connectorClass,\n originalArgs: arguments,\n pointerEventsSpec: \"none\",\n _jsPlumb: params._jsPlumb\n }\n ]);\n\n _super.renderer.paint = function (style, anchor, extents) {\n\n var segments = self.getSegments(), p = \"\", offset = [0, 0];\n if (extents.xmin < 0) {\n offset[0] = -extents.xmin;\n }\n if (extents.ymin < 0) {\n offset[1] = -extents.ymin;\n }\n\n if (segments.length > 0) {\n\n p = self.getPathData();\n\n var a = {\n d: p,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\",\n \"pointer-events\": params[\"pointer-events\"] || \"visibleStroke\"\n },\n outlineStyle = null,\n d = [self.x, self.y, self.w, self.h];\n\n // outline style. actually means drawing an svg object underneath the main one.\n if (style.outlineStroke) {\n var outlineWidth = style.outlineWidth || 1,\n outlineStrokeWidth = style.strokeWidth + (2 * outlineWidth);\n outlineStyle = _jp.extend({}, style);\n delete outlineStyle.gradient;\n outlineStyle.stroke = style.outlineStroke;\n outlineStyle.strokeWidth = outlineStrokeWidth;\n\n if (self.bgPath == null) {\n self.bgPath = _node(\"path\", a);\n _jp.addClass(self.bgPath, _jp.connectorOutlineClass);\n _appendAtIndex(self.svg, self.bgPath, 0);\n }\n else {\n _attr(self.bgPath, a);\n }\n\n _applyStyles(self.svg, self.bgPath, outlineStyle, d, self);\n }\n\n if (self.path == null) {\n self.path = _node(\"path\", a);\n _appendAtIndex(self.svg, self.path, style.outlineStroke ? 1 : 0);\n }\n else {\n _attr(self.path, a);\n }\n\n _applyStyles(self.svg, self.path, style, d, self);\n }\n };\n };\n _ju.extend(_jp.ConnectorRenderers.svg, SvgComponent);\n\n// ******************************* svg segment renderer *****************************************************\t\n\n\n// ******************************* /svg segments *****************************************************\n\n /*\n * Base class for SVG endpoints.\n */\n var SvgEndpoint = _jp.SvgEndpoint = function (params) {\n var _super = SvgComponent.apply(this, [\n {\n cssClass: params._jsPlumb.endpointClass,\n originalArgs: arguments,\n pointerEventsSpec: \"all\",\n useDivWrapper: true,\n _jsPlumb: params._jsPlumb\n }\n ]);\n\n _super.renderer.paint = function (style) {\n var s = _jp.extend({}, style);\n if (s.outlineStroke) {\n s.stroke = s.outlineStroke;\n }\n\n if (this.node == null) {\n this.node = this.makeNode(s);\n this.svg.appendChild(this.node);\n }\n else if (this.updateNode != null) {\n this.updateNode(this.node);\n }\n _applyStyles(this.svg, this.node, s, [ this.x, this.y, this.w, this.h ], this);\n _pos(this.node, [ this.x, this.y ]);\n }.bind(this);\n\n };\n _ju.extend(SvgEndpoint, SvgComponent);\n\n /*\n * SVG Dot Endpoint\n */\n _jp.Endpoints.svg.Dot = function () {\n _jp.Endpoints.Dot.apply(this, arguments);\n SvgEndpoint.apply(this, arguments);\n this.makeNode = function (style) {\n return _node(\"circle\", {\n \"cx\": this.w / 2,\n \"cy\": this.h / 2,\n \"r\": this.radius\n });\n };\n this.updateNode = function (node) {\n _attr(node, {\n \"cx\": this.w / 2,\n \"cy\": this.h / 2,\n \"r\": this.radius\n });\n };\n };\n _ju.extend(_jp.Endpoints.svg.Dot, [_jp.Endpoints.Dot, SvgEndpoint]);\n\n /*\n * SVG Rectangle Endpoint\n */\n _jp.Endpoints.svg.Rectangle = function () {\n _jp.Endpoints.Rectangle.apply(this, arguments);\n SvgEndpoint.apply(this, arguments);\n this.makeNode = function (style) {\n return _node(\"rect\", {\n \"width\": this.w,\n \"height\": this.h\n });\n };\n this.updateNode = function (node) {\n _attr(node, {\n \"width\": this.w,\n \"height\": this.h\n });\n };\n };\n _ju.extend(_jp.Endpoints.svg.Rectangle, [_jp.Endpoints.Rectangle, SvgEndpoint]);\n\n /*\n * SVG Image Endpoint is the default image endpoint.\n */\n _jp.Endpoints.svg.Image = _jp.Endpoints.Image;\n /*\n * Blank endpoint in svg renderer is the default Blank endpoint.\n */\n _jp.Endpoints.svg.Blank = _jp.Endpoints.Blank;\n /*\n * Label overlay in svg renderer is the default Label overlay.\n */\n _jp.Overlays.svg.Label = _jp.Overlays.Label;\n /*\n * Custom overlay in svg renderer is the default Custom overlay.\n */\n _jp.Overlays.svg.Custom = _jp.Overlays.Custom;\n\n var AbstractSvgArrowOverlay = function (superclass, originalArgs) {\n superclass.apply(this, originalArgs);\n _jp.jsPlumbUIComponent.apply(this, originalArgs);\n this.isAppendedAtTopLevel = false;\n var self = this;\n this.path = null;\n this.paint = function (params, containerExtents) {\n // only draws on connections, not endpoints.\n if (params.component.svg && containerExtents) {\n if (this.path == null) {\n this.path = _node(\"path\", {\n \"pointer-events\": \"all\"\n });\n params.component.svg.appendChild(this.path);\n if (this.elementCreated) {\n this.elementCreated(this.path, params.component);\n }\n\n this.canvas = params.component.svg; // for the sake of completeness; this behaves the same as other overlays\n }\n var clazz = originalArgs && (originalArgs.length === 1) ? (originalArgs[0].cssClass || \"\") : \"\",\n offset = [0, 0];\n\n if (containerExtents.xmin < 0) {\n offset[0] = -containerExtents.xmin;\n }\n if (containerExtents.ymin < 0) {\n offset[1] = -containerExtents.ymin;\n }\n\n _attr(this.path, {\n \"d\": makePath(params.d),\n \"class\": clazz,\n stroke: params.stroke ? params.stroke : null,\n fill: params.fill ? params.fill : null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n }\n };\n var makePath = function (d) {\n return (isNaN(d.cxy.x) || isNaN(d.cxy.y)) ? \"\" : \"M\" + d.hxy.x + \",\" + d.hxy.y +\n \" L\" + d.tail[0].x + \",\" + d.tail[0].y +\n \" L\" + d.cxy.x + \",\" + d.cxy.y +\n \" L\" + d.tail[1].x + \",\" + d.tail[1].y +\n \" L\" + d.hxy.x + \",\" + d.hxy.y;\n };\n this.transfer = function(target) {\n if (target.canvas && this.path && this.path.parentNode) {\n this.path.parentNode.removeChild(this.path);\n target.canvas.appendChild(this.path);\n }\n };\n };\n _ju.extend(AbstractSvgArrowOverlay, [_jp.jsPlumbUIComponent, _jp.Overlays.AbstractOverlay], {\n cleanup: function (force) {\n if (this.path != null) {\n if (force) {\n this._jsPlumb.instance.removeElement(this.path);\n }\n else {\n if (this.path.parentNode) {\n this.path.parentNode.removeChild(this.path);\n }\n }\n }\n },\n reattach:function(instance, component) {\n if (this.path && component.canvas) {\n component.canvas.appendChild(this.path);\n }\n },\n setVisible: function (v) {\n if (this.path != null) {\n (this.path.style.display = (v ? \"block\" : \"none\"));\n }\n }\n });\n\n _jp.Overlays.svg.Arrow = function () {\n AbstractSvgArrowOverlay.apply(this, [_jp.Overlays.Arrow, arguments]);\n };\n _ju.extend(_jp.Overlays.svg.Arrow, [ _jp.Overlays.Arrow, AbstractSvgArrowOverlay ]);\n\n _jp.Overlays.svg.PlainArrow = function () {\n AbstractSvgArrowOverlay.apply(this, [_jp.Overlays.PlainArrow, arguments]);\n };\n _ju.extend(_jp.Overlays.svg.PlainArrow, [ _jp.Overlays.PlainArrow, AbstractSvgArrowOverlay ]);\n\n _jp.Overlays.svg.Diamond = function () {\n AbstractSvgArrowOverlay.apply(this, [_jp.Overlays.Diamond, arguments]);\n };\n _ju.extend(_jp.Overlays.svg.Diamond, [ _jp.Overlays.Diamond, AbstractSvgArrowOverlay ]);\n\n // a test\n _jp.Overlays.svg.GuideLines = function () {\n var path = null, self = this, p1_1, p1_2;\n _jp.Overlays.GuideLines.apply(this, arguments);\n this.paint = function (params, containerExtents) {\n if (path == null) {\n path = _node(\"path\");\n params.connector.svg.appendChild(path);\n self.attachListeners(path, params.connector);\n self.attachListeners(path, self);\n\n p1_1 = _node(\"path\");\n params.connector.svg.appendChild(p1_1);\n self.attachListeners(p1_1, params.connector);\n self.attachListeners(p1_1, self);\n\n p1_2 = _node(\"path\");\n params.connector.svg.appendChild(p1_2);\n self.attachListeners(p1_2, params.connector);\n self.attachListeners(p1_2, self);\n }\n\n var offset = [0, 0];\n if (containerExtents.xmin < 0) {\n offset[0] = -containerExtents.xmin;\n }\n if (containerExtents.ymin < 0) {\n offset[1] = -containerExtents.ymin;\n }\n\n _attr(path, {\n \"d\": makePath(params.head, params.tail),\n stroke: \"red\",\n fill: null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n\n _attr(p1_1, {\n \"d\": makePath(params.tailLine[0], params.tailLine[1]),\n stroke: \"blue\",\n fill: null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n\n _attr(p1_2, {\n \"d\": makePath(params.headLine[0], params.headLine[1]),\n stroke: \"green\",\n fill: null,\n transform: \"translate(\" + offset[0] + \",\" + offset[1] + \")\"\n });\n };\n\n var makePath = function (d1, d2) {\n return \"M \" + d1.x + \",\" + d1.y +\n \" L\" + d2.x + \",\" + d2.y;\n };\n };\n _ju.extend(_jp.Overlays.svg.GuideLines, _jp.Overlays.GuideLines);\n}).call(typeof window !== 'undefined' ? window : this);\n\n/*\n * This file contains code used when jsPlumb is being rendered in a DOM.\n *\n * Copyright (c) 2010 - 2019 jsPlumb (hello@jsplumbtoolkit.com)\n *\n * https://jsplumbtoolkit.com\n * https://github.com/jsplumb/jsplumb\n *\n * Dual licensed under the MIT and GPL2 licenses.\n */\n;\n(function () {\n\n \"use strict\";\n\n var root = this, _jp = root.jsPlumb, _ju = root.jsPlumbUtil,\n _jk = root.Katavorio, _jg = root.Biltong;\n\n var _getEventManager = function(instance) {\n var e = instance._mottle;\n if (!e) {\n e = instance._mottle = new root.Mottle();\n }\n return e;\n };\n\n var _getDragManager = function (instance, category) {\n\n category = category || \"main\";\n var key = \"_katavorio_\" + category;\n var k = instance[key],\n e = instance.getEventManager();\n\n if (!k) {\n k = new _jk({\n bind: e.on,\n unbind: e.off,\n getSize: _jp.getSize,\n getConstrainingRectangle:function(el) {\n return [ el.parentNode.scrollWidth, el.parentNode.scrollHeight ];\n },\n getPosition: function (el, relativeToRoot) {\n // if this is a nested draggable then compute the offset against its own offsetParent, otherwise\n // compute against the Container's origin. see also the getUIPosition method below.\n var o = instance.getOffset(el, relativeToRoot, el._katavorioDrag ? el.offsetParent : null);\n return [o.left, o.top];\n },\n setPosition: function (el, xy) {\n el.style.left = xy[0] + \"px\";\n el.style.top = xy[1] + \"px\";\n },\n addClass: _jp.addClass,\n removeClass: _jp.removeClass,\n intersects: _jg.intersects,\n indexOf: function(l, i) { return l.indexOf(i); },\n scope:instance.getDefaultScope(),\n css: {\n noSelect: instance.dragSelectClass,\n droppable: \"jtk-droppable\",\n draggable: \"jtk-draggable\",\n drag: \"jtk-drag\",\n selected: \"jtk-drag-selected\",\n active: \"jtk-drag-active\",\n hover: \"jtk-drag-hover\",\n ghostProxy:\"jtk-ghost-proxy\"\n }\n });\n k.setZoom(instance.getZoom());\n instance[key] = k;\n instance.bind(\"zoom\", k.setZoom);\n }\n return k;\n };\n\n var _dragStart=function(params) {\n var options = params.el._jsPlumbDragOptions;\n var cont = true;\n if (options.canDrag) {\n cont = options.canDrag();\n }\n if (cont) {\n this.setHoverSuspended(true);\n this.select({source: params.el}).addClass(this.elementDraggingClass + \" \" + this.sourceElementDraggingClass, true);\n this.select({target: params.el}).addClass(this.elementDraggingClass + \" \" + this.targetElementDraggingClass, true);\n this.setConnectionBeingDragged(true);\n }\n return cont;\n };\n var _dragMove=function(params) {\n var ui = this.getUIPosition(arguments, this.getZoom());\n if (ui != null) {\n var o = params.el._jsPlumbDragOptions;\n this.draw(params.el, ui, null, true);\n if (o._dragging) {\n this.addClass(params.el, \"jtk-dragged\");\n }\n o._dragging = true;\n }\n };\n var _dragStop=function(params) {\n var elements = params.selection, uip;\n\n var _one = function (_e) {\n if (_e[1] != null) {\n // run the reported offset through the code that takes parent containers\n // into account, to adjust if necessary (issue 554)\n uip = this.getUIPosition([{\n el:_e[2].el,\n pos:[_e[1].left, _e[1].top]\n }]);\n this.draw(_e[2].el, uip);\n }\n\n delete _e[0]._jsPlumbDragOptions._dragging;\n\n this.removeClass(_e[0], \"jtk-dragged\");\n this.select({source: _e[2].el}).removeClass(this.elementDraggingClass + \" \" + this.sourceElementDraggingClass, true);\n this.select({target: _e[2].el}).removeClass(this.elementDraggingClass + \" \" + this.targetElementDraggingClass, true);\n this.getDragManager().dragEnded(_e[2].el);\n }.bind(this);\n\n for (var i = 0; i < elements.length; i++) {\n _one(elements[i]);\n }\n\n this.setHoverSuspended(false);\n this.setConnectionBeingDragged(false);\n };\n\n var _animProps = function (o, p) {\n var _one = function (pName) {\n if (p[pName] != null) {\n if (_ju.isString(p[pName])) {\n var m = p[pName].match(/-=/) ? -1 : 1,\n v = p[pName].substring(2);\n return o[pName] + (m * v);\n }\n else {\n return p[pName];\n }\n }\n else {\n return o[pName];\n }\n };\n return [ _one(\"left\"), _one(\"top\") ];\n };\n\n var _genLoc = function (prefix, e) {\n if (e == null) {\n return [ 0, 0 ];\n }\n var ts = _touches(e), t = _getTouch(ts, 0);\n return [t[prefix + \"X\"], t[prefix + \"Y\"]];\n },\n _pageLocation = _genLoc.bind(this, \"page\"),\n _screenLocation = _genLoc.bind(this, \"screen\"),\n _clientLocation = _genLoc.bind(this, \"client\"),\n _getTouch = function (touches, idx) {\n return touches.item ? touches.item(idx) : touches[idx];\n },\n _touches = function (e) {\n return e.touches && e.touches.length > 0 ? e.touches :\n e.changedTouches && e.changedTouches.length > 0 ? e.changedTouches :\n e.targetTouches && e.targetTouches.length > 0 ? e.targetTouches :\n [ e ];\n };\n\n /**\n Manages dragging for some instance of jsPlumb.\n\n TODO instead of this being accessed directly, it should subscribe to events on the jsPlumb instance: every method\n in here is called directly by jsPlumb. But what should happen is that we have unpublished events that this listens\n to. The only trick is getting one of these instantiated with every jsPlumb instance: it needs to have a hook somehow.\n Basically the general idea is to pull ALL the drag code out (prototype method registrations plus this) into a\n dedicated drag script), that does not necessarily need to be included.\n\n\n */\n var DragManager = function (_currentInstance) {\n var _draggables = {}, _dlist = [], _delements = {}, _elementsWithEndpoints = {},\n // elementids mapped to the draggable to which they belong.\n _draggablesForElements = {};\n\n /**\n register some element as draggable. right now the drag init stuff is done elsewhere, and it is\n possible that will continue to be the case.\n */\n this.register = function (el) {\n var id = _currentInstance.getId(el),\n parentOffset;\n\n if (!_draggables[id]) {\n _draggables[id] = el;\n _dlist.push(el);\n _delements[id] = {};\n }\n\n // look for child elements that have endpoints and register them against this draggable.\n var _oneLevel = function (p) {\n if (p) {\n for (var i = 0; i < p.childNodes.length; i++) {\n if (p.childNodes[i].nodeType !== 3 && p.childNodes[i].nodeType !== 8) {\n var cEl = jsPlumb.getElement(p.childNodes[i]),\n cid = _currentInstance.getId(p.childNodes[i], null, true);\n if (cid && _elementsWithEndpoints[cid] && _elementsWithEndpoints[cid] > 0) {\n if (!parentOffset) {\n parentOffset = _currentInstance.getOffset(el);\n }\n var cOff = _currentInstance.getOffset(cEl);\n _delements[id][cid] = {\n id: cid,\n offset: {\n left: cOff.left - parentOffset.left,\n top: cOff.top - parentOffset.top\n }\n };\n _draggablesForElements[cid] = id;\n }\n _oneLevel(p.childNodes[i]);\n }\n }\n }\n };\n\n _oneLevel(el);\n };\n\n // refresh the offsets for child elements of this element.\n this.updateOffsets = function (elId, childOffsetOverrides) {\n if (elId != null) {\n childOffsetOverrides = childOffsetOverrides || {};\n var domEl = jsPlumb.getElement(elId),\n id = _currentInstance.getId(domEl),\n children = _delements[id],\n parentOffset;\n\n if (children) {\n for (var i in children) {\n if (children.hasOwnProperty(i)) {\n var cel = jsPlumb.getElement(i),\n cOff = childOffsetOverrides[i] || _currentInstance.getOffset(cel);\n\n // do not update if we have a value already and we'd just be writing 0,0\n if (cel.offsetParent == null && _delements[id][i] != null) {\n continue;\n }\n\n if (!parentOffset) {\n parentOffset = _currentInstance.getOffset(domEl);\n }\n\n _delements[id][i] = {\n id: i,\n offset: {\n left: cOff.left - parentOffset.left,\n top: cOff.top - parentOffset.top\n }\n };\n _draggablesForElements[i] = id;\n }\n }\n }\n }\n };\n\n /**\n notification that an endpoint was added to the given el. we go up from that el's parent\n node, looking for a parent that has been registered as a draggable. if we find one, we add this\n el to that parent's list of elements to update on drag (if it is not there already)\n */\n this.endpointAdded = function (el, id) {\n\n id = id || _currentInstance.getId(el);\n\n var b = document.body,\n p = el.parentNode;\n\n _elementsWithEndpoints[id] = _elementsWithEndpoints[id] ? _elementsWithEndpoints[id] + 1 : 1;\n\n while (p != null && p !== b) {\n var pid = _currentInstance.getId(p, null, true);\n if (pid && _draggables[pid]) {\n var pLoc = _currentInstance.getOffset(p);\n\n if (_delements[pid][id] == null) {\n var cLoc = _currentInstance.getOffset(el);\n _delements[pid][id] = {\n id: id,\n offset: {\n left: cLoc.left - pLoc.left,\n top: cLoc.top - pLoc.top\n }\n };\n _draggablesForElements[id] = pid;\n }\n break;\n }\n p = p.parentNode;\n }\n };\n\n this.endpointDeleted = function (endpoint) {\n if (_elementsWithEndpoints[endpoint.elementId]) {\n _elementsWithEndpoints[endpoint.elementId]--;\n if (_elementsWithEndpoints[endpoint.elementId] <= 0) {\n for (var i in _delements) {\n if (_delements.hasOwnProperty(i) && _delements[i]) {\n delete _delements[i][endpoint.elementId];\n delete _draggablesForElements[endpoint.elementId];\n }\n }\n }\n }\n };\n\n this.changeId = function (oldId, newId) {\n _delements[newId] = _delements[oldId];\n _delements[oldId] = {};\n _draggablesForElements[newId] = _draggablesForElements[oldId];\n _draggablesForElements[oldId] = null;\n };\n\n this.getElementsForDraggable = function (id) {\n return _delements[id];\n };\n\n this.elementRemoved = function (elementId) {\n var elId = _draggablesForElements[elementId];\n if (elId) {\n delete _delements[elId][elementId];\n delete _draggablesForElements[elementId];\n }\n };\n\n this.reset = function () {\n _draggables = {};\n _dlist = [];\n _delements = {};\n _elementsWithEndpoints = {};\n };\n\n //\n // notification drag ended. We check automatically if need to update some\n // ancestor's offsets.\n //\n this.dragEnded = function (el) {\n if (el.offsetParent != null) {\n var id = _currentInstance.getId(el),\n ancestor = _draggablesForElements[id];\n\n if (ancestor) {\n this.updateOffsets(ancestor);\n }\n }\n };\n\n this.setParent = function (el, elId, p, pId, currentChildLocation) {\n var current = _draggablesForElements[elId];\n if (!_delements[pId]) {\n _delements[pId] = {};\n }\n var pLoc = _currentInstance.getOffset(p),\n cLoc = currentChildLocation || _currentInstance.getOffset(el);\n\n if (current && _delements[current]) {\n delete _delements[current][elId];\n }\n\n _delements[pId][elId] = {\n id:elId,\n offset : {\n left: cLoc.left - pLoc.left,\n top: cLoc.top - pLoc.top\n }\n };\n _draggablesForElements[elId] = pId;\n };\n\n this.clearParent = function(el, elId) {\n var current = _draggablesForElements[elId];\n if (current) {\n delete _delements[current][elId];\n delete _draggablesForElements[elId];\n }\n };\n\n this.revalidateParent = function(el, elId, childOffset) {\n var current = _draggablesForElements[elId];\n if (current) {\n var co = {};\n co[elId] = childOffset;\n this.updateOffsets(current, co);\n _currentInstance.revalidate(current);\n }\n };\n\n this.getDragAncestor = function (el) {\n var de = jsPlumb.getElement(el),\n id = _currentInstance.getId(de),\n aid = _draggablesForElements[id];\n\n if (aid) {\n return jsPlumb.getElement(aid);\n }\n else {\n return null;\n }\n };\n\n };\n\n var _setClassName = function (el, cn, classList) {\n cn = _ju.fastTrim(cn);\n if (typeof el.className.baseVal !== \"undefined\") {\n el.className.baseVal = cn;\n }\n else {\n el.className = cn;\n }\n\n // recent (i currently have 61.0.3163.100) version of chrome do not update classList when you set the base val\n // of an svg element's className. in the long run we'd like to move to just using classList anyway\n try {\n var cl = el.classList;\n if (cl != null) {\n while (cl.length > 0) {\n cl.remove(cl.item(0));\n }\n for (var i = 0; i < classList.length; i++) {\n if (classList[i]) {\n cl.add(classList[i]);\n }\n }\n }\n }\n catch(e) {\n // not fatal\n _ju.log(\"JSPLUMB: cannot set class list\", e);\n }\n },\n _getClassName = function (el) {\n return (typeof el.className.baseVal === \"undefined\") ? el.className : el.className.baseVal;\n },\n _classManip = function (el, classesToAdd, classesToRemove) {\n classesToAdd = classesToAdd == null ? [] : _ju.isArray(classesToAdd) ? classesToAdd : classesToAdd.split(/\\s+/);\n classesToRemove = classesToRemove == null ? [] : _ju.isArray(classesToRemove) ? classesToRemove : classesToRemove.split(/\\s+/);\n\n var className = _getClassName(el),\n curClasses = className.split(/\\s+/);\n\n var _oneSet = function (add, classes) {\n for (var i = 0; i < classes.length; i++) {\n if (add) {\n if (curClasses.indexOf(classes[i]) === -1) {\n curClasses.push(classes[i]);\n }\n }\n else {\n var idx = curClasses.indexOf(classes[i]);\n if (idx !== -1) {\n curClasses.splice(idx, 1);\n }\n }\n }\n };\n\n _oneSet(true, classesToAdd);\n _oneSet(false, classesToRemove);\n\n _setClassName(el, curClasses.join(\" \"), curClasses);\n };\n\n root.jsPlumb.extend(root.jsPlumbInstance.prototype, {\n\n headless: false,\n\n pageLocation: _pageLocation,\n screenLocation: _screenLocation,\n clientLocation: _clientLocation,\n\n getDragManager:function() {\n if (this.dragManager == null) {\n this.dragManager = new DragManager(this);\n }\n\n return this.dragManager;\n },\n\n recalculateOffsets:function(elId) {\n this.getDragManager().updateOffsets(elId);\n },\n\n createElement:function(tag, style, clazz, atts) {\n return this.createElementNS(null, tag, style, clazz, atts);\n },\n\n createElementNS:function(ns, tag, style, clazz, atts) {\n var e = ns == null ? document.createElement(tag) : document.createElementNS(ns, tag);\n var i;\n style = style || {};\n for (i in style) {\n e.style[i] = style[i];\n }\n\n if (clazz) {\n e.className = clazz;\n }\n\n atts = atts || {};\n for (i in atts) {\n e.setAttribute(i, \"\" + atts[i]);\n }\n\n return e;\n },\n\n getAttribute: function (el, attName) {\n return el.getAttribute != null ? el.getAttribute(attName) : null;\n },\n\n setAttribute: function (el, a, v) {\n if (el.setAttribute != null) {\n el.setAttribute(a, v);\n }\n },\n\n setAttributes: function (el, atts) {\n for (var i in atts) {\n if (atts.hasOwnProperty(i)) {\n el.setAttribute(i, atts[i]);\n }\n }\n },\n appendToRoot: function (node) {\n document.body.appendChild(node);\n },\n getRenderModes: function () {\n return [ \"svg\" ];\n },\n getClass:_getClassName,\n addClass: function (el, clazz) {\n jsPlumb.each(el, function (e) {\n _classManip(e, clazz);\n });\n },\n hasClass: function (el, clazz) {\n el = jsPlumb.getElement(el);\n if (el.classList) {\n return el.classList.contains(clazz);\n }\n else {\n return _getClassName(el).indexOf(clazz) !== -1;\n }\n },\n removeClass: function (el, clazz) {\n jsPlumb.each(el, function (e) {\n _classManip(e, null, clazz);\n });\n },\n toggleClass:function(el, clazz) {\n if (jsPlumb.hasClass(el, clazz)) {\n jsPlumb.removeClass(el, clazz);\n } else {\n jsPlumb.addClass(el, clazz);\n }\n },\n updateClasses: function (el, toAdd, toRemove) {\n jsPlumb.each(el, function (e) {\n _classManip(e, toAdd, toRemove);\n });\n },\n setClass: function (el, clazz) {\n if (clazz != null) {\n jsPlumb.each(el, function (e) {\n _setClassName(e, clazz, clazz.split(/\\s+/));\n });\n }\n },\n setPosition: function (el, p) {\n el.style.left = p.left + \"px\";\n el.style.top = p.top + \"px\";\n },\n getPosition: function (el) {\n var _one = function (prop) {\n var v = el.style[prop];\n return v ? v.substring(0, v.length - 2) : 0;\n };\n return {\n left: _one(\"left\"),\n top: _one(\"top\")\n };\n },\n getStyle:function(el, prop) {\n if (typeof window.getComputedStyle !== 'undefined') {\n return getComputedStyle(el, null).getPropertyValue(prop);\n } else {\n return el.currentStyle[prop];\n }\n },\n getSelector: function (ctx, spec) {\n var sel = null;\n if (arguments.length === 1) {\n sel = ctx.nodeType != null ? ctx : document.querySelectorAll(ctx);\n }\n else {\n sel = ctx.querySelectorAll(spec);\n }\n\n return sel;\n },\n getOffset:function(el, relativeToRoot, container) {\n el = jsPlumb.getElement(el);\n container = container || this.getContainer();\n var out = {\n left: el.offsetLeft,\n top: el.offsetTop\n },\n op = (relativeToRoot || (container != null && (el !== container && el.offsetParent !== container))) ? el.offsetParent : null,\n _maybeAdjustScroll = function(offsetParent) {\n if (offsetParent != null && offsetParent !== document.body && (offsetParent.scrollTop > 0 || offsetParent.scrollLeft > 0)) {\n out.left -= offsetParent.scrollLeft;\n out.top -= offsetParent.scrollTop;\n }\n }.bind(this);\n\n while (op != null) {\n out.left += op.offsetLeft;\n out.top += op.offsetTop;\n _maybeAdjustScroll(op);\n op = relativeToRoot ? op.offsetParent :\n op.offsetParent === container ? null : op.offsetParent;\n }\n\n // if container is scrolled and the element (or its offset parent) is not absolute or fixed, adjust accordingly.\n if (container != null && !relativeToRoot && (container.scrollTop > 0 || container.scrollLeft > 0)) {\n var pp = el.offsetParent != null ? this.getStyle(el.offsetParent, \"position\") : \"static\",\n p = this.getStyle(el, \"position\");\n if (p !== \"absolute\" && p !== \"fixed\" && pp !== \"absolute\" && pp !== \"fixed\") {\n out.left -= container.scrollLeft;\n out.top -= container.scrollTop;\n }\n }\n return out;\n },\n //\n // return x+y proportion of the given element's size corresponding to the location of the given event.\n //\n getPositionOnElement: function (evt, el, zoom) {\n var box = typeof el.getBoundingClientRect !== \"undefined\" ? el.getBoundingClientRect() : { left: 0, top: 0, width: 0, height: 0 },\n body = document.body,\n docElem = document.documentElement,\n scrollTop = window.pageYOffset || docElem.scrollTop || body.scrollTop,\n scrollLeft = window.pageXOffset || docElem.scrollLeft || body.scrollLeft,\n clientTop = docElem.clientTop || body.clientTop || 0,\n clientLeft = docElem.clientLeft || body.clientLeft || 0,\n pst = 0,\n psl = 0,\n top = box.top + scrollTop - clientTop + (pst * zoom),\n left = box.left + scrollLeft - clientLeft + (psl * zoom),\n cl = jsPlumb.pageLocation(evt),\n w = box.width || (el.offsetWidth * zoom),\n h = box.height || (el.offsetHeight * zoom),\n x = (cl[0] - left) / w,\n y = (cl[1] - top) / h;\n\n return [ x, y ];\n },\n\n /**\n * Gets the absolute position of some element as read from the left/top properties in its style.\n * @method getAbsolutePosition\n * @param {Element} el The element to retrieve the absolute coordinates from. **Note** this is a DOM element, not a selector from the underlying library.\n * @return {Number[]} [left, top] pixel values.\n */\n getAbsolutePosition: function (el) {\n var _one = function (s) {\n var ss = el.style[s];\n if (ss) {\n return parseFloat(ss.substring(0, ss.length - 2));\n }\n };\n return [ _one(\"left\"), _one(\"top\") ];\n },\n\n /**\n * Sets the absolute position of some element by setting the left/top properties in its style.\n * @method setAbsolutePosition\n * @param {Element} el The element to set the absolute coordinates on. **Note** this is a DOM element, not a selector from the underlying library.\n * @param {Number[]} xy x and y coordinates\n * @param {Number[]} [animateFrom] Optional previous xy to animate from.\n * @param {Object} [animateOptions] Options for the animation.\n */\n setAbsolutePosition: function (el, xy, animateFrom, animateOptions) {\n if (animateFrom) {\n this.animate(el, {\n left: \"+=\" + (xy[0] - animateFrom[0]),\n top: \"+=\" + (xy[1] - animateFrom[1])\n }, animateOptions);\n }\n else {\n el.style.left = xy[0] + \"px\";\n el.style.top = xy[1] + \"px\";\n }\n },\n /**\n * gets the size for the element, in an array : [ width, height ].\n */\n getSize: function (el) {\n return [ el.offsetWidth, el.offsetHeight ];\n },\n getWidth: function (el) {\n return el.offsetWidth;\n },\n getHeight: function (el) {\n return el.offsetHeight;\n },\n getRenderMode : function() { return \"svg\"; },\n draggable : function (el, options) {\n var info;\n el = _ju.isArray(el) || (el.length != null && !_ju.isString(el)) ? el: [ el ];\n Array.prototype.slice.call(el).forEach(function(_el) {\n info = this.info(_el);\n if (info.el) {\n this._initDraggableIfNecessary(info.el, true, options, info.id, true);\n }\n }.bind(this));\n return this;\n },\n initDraggable: function (el, options, category) {\n _getDragManager(this, category).draggable(el, options);\n el._jsPlumbDragOptions = options;\n },\n destroyDraggable: function (el, category) {\n _getDragManager(this, category).destroyDraggable(el);\n delete el._jsPlumbDragOptions;\n },\n unbindDraggable: function (el, evt, fn, category) {\n _getDragManager(this, category).destroyDraggable(el, evt, fn);\n },\n setDraggable : function (element, draggable) {\n return jsPlumb.each(element, function (el) {\n if (this.isDragSupported(el)) {\n this._draggableStates[this.getAttribute(el, \"id\")] = draggable;\n this.setElementDraggable(el, draggable);\n }\n }.bind(this));\n },\n _draggableStates : {},\n /*\n * toggles the draggable state of the given element(s).\n * el is either an id, or an element object, or a list of ids/element objects.\n */\n toggleDraggable : function (el) {\n var state;\n jsPlumb.each(el, function (el) {\n var elId = this.getAttribute(el, \"id\");\n state = this._draggableStates[elId] == null ? false : this._draggableStates[elId];\n state = !state;\n this._draggableStates[elId] = state;\n this.setDraggable(el, state);\n return state;\n }.bind(this));\n return state;\n },\n _initDraggableIfNecessary : function (element, isDraggable, dragOptions, id, fireEvent) {\n // TODO FIRST: move to DragManager. including as much of the decision to init dragging as possible.\n if (!jsPlumb.headless) {\n var _draggable = isDraggable == null ? false : isDraggable;\n if (_draggable) {\n if (jsPlumb.isDragSupported(element, this)) {\n var options = dragOptions || this.Defaults.DragOptions;\n options = jsPlumb.extend({}, options); // make a copy.\n if (!jsPlumb.isAlreadyDraggable(element, this)) {\n var dragEvent = jsPlumb.dragEvents.drag,\n stopEvent = jsPlumb.dragEvents.stop,\n startEvent = jsPlumb.dragEvents.start;\n\n this.manage(id, element);\n\n options[startEvent] = _ju.wrap(options[startEvent], _dragStart.bind(this));\n\n options[dragEvent] = _ju.wrap(options[dragEvent], _dragMove.bind(this));\n\n options[stopEvent] = _ju.wrap(options[stopEvent], _dragStop.bind(this));\n\n var elId = this.getId(element); // need ID\n\n this._draggableStates[elId] = true;\n var draggable = this._draggableStates[elId];\n\n options.disabled = draggable == null ? false : !draggable;\n this.initDraggable(element, options);\n this.getDragManager().register(element);\n if (fireEvent) {\n this.fire(\"elementDraggable\", {el:element, options:options});\n }\n }\n else {\n // already draggable. attach any start, drag or stop listeners to the current Drag.\n if (dragOptions.force) {\n this.initDraggable(element, options);\n }\n }\n }\n }\n }\n },\n animationSupported:true,\n getElement: function (el) {\n if (el == null) {\n return null;\n }\n // here we pluck the first entry if el was a list of entries.\n // this is not my favourite thing to do, but previous versions of\n // jsplumb supported jquery selectors, and it is possible a selector\n // will be passed in here.\n el = typeof el === \"string\" ? el : el.length != null && el.enctype == null ? el[0] : el;\n return typeof el === \"string\" ? document.getElementById(el) : el;\n },\n removeElement: function (element) {\n _getDragManager(this).elementRemoved(element);\n this.getEventManager().remove(element);\n },\n //\n // this adapter supports a rudimentary animation function. no easing is supported. only\n // left/top properties are supported. property delta args are expected to be in the form\n //\n // +=x.xxxx\n //\n // or\n //\n // -=x.xxxx\n //\n doAnimate: function (el, properties, options) {\n options = options || {};\n var o = this.getOffset(el),\n ap = _animProps(o, properties),\n ldist = ap[0] - o.left,\n tdist = ap[1] - o.top,\n d = options.duration || 250,\n step = 15, steps = d / step,\n linc = (step / d) * ldist,\n tinc = (step / d) * tdist,\n idx = 0,\n _int = setInterval(function () {\n _jp.setPosition(el, {\n left: o.left + (linc * (idx + 1)),\n top: o.top + (tinc * (idx + 1))\n });\n if (options.step != null) {\n options.step(idx, Math.ceil(steps));\n }\n idx++;\n if (idx >= steps) {\n window.clearInterval(_int);\n if (options.complete != null) {\n options.complete();\n }\n }\n }, step);\n },\n // DRAG/DROP\n\n\n destroyDroppable: function (el, category) {\n _getDragManager(this, category).destroyDroppable(el);\n },\n unbindDroppable: function (el, evt, fn, category) {\n _getDragManager(this, category).destroyDroppable(el, evt, fn);\n },\n\n droppable :function(el, options) {\n el = _ju.isArray(el) || (el.length != null && !_ju.isString(el)) ? el: [ el ];\n var info;\n options = options || {};\n options.allowLoopback = false;\n Array.prototype.slice.call(el).forEach(function(_el) {\n info = this.info(_el);\n if (info.el) {\n this.initDroppable(info.el, options);\n }\n }.bind(this));\n return this;\n },\n\n initDroppable: function (el, options, category) {\n _getDragManager(this, category).droppable(el, options);\n },\n isAlreadyDraggable: function (el) {\n return el._katavorioDrag != null;\n },\n isDragSupported: function (el, options) {\n return true;\n },\n isDropSupported: function (el, options) {\n return true;\n },\n isElementDraggable: function (el) {\n el = _jp.getElement(el);\n return el._katavorioDrag && el._katavorioDrag.isEnabled();\n },\n getDragObject: function (eventArgs) {\n return eventArgs[0].drag.getDragElement();\n },\n getDragScope: function (el) {\n return el._katavorioDrag && el._katavorioDrag.scopes.join(\" \") || \"\";\n },\n getDropEvent: function (args) {\n return args[0].e;\n },\n getUIPosition: function (eventArgs, zoom) {\n // here the position reported to us by Katavorio is relative to the element's offsetParent. For top\n // level nodes that is fine, but if we have a nested draggable then its offsetParent is actually\n // not going to be the jsplumb container; it's going to be some child of that element. In that case\n // we want to adjust the UI position to account for the offsetParent's position relative to the Container\n // origin.\n var el = eventArgs[0].el;\n if (el.offsetParent == null) {\n return null;\n }\n var finalPos = eventArgs[0].finalPos || eventArgs[0].pos;\n var p = { left:finalPos[0], top:finalPos[1] };\n if (el._katavorioDrag && el.offsetParent !== this.getContainer()) {\n var oc = this.getOffset(el.offsetParent);\n p.left += oc.left;\n p.top += oc.top;\n }\n return p;\n },\n setDragFilter: function (el, filter, _exclude) {\n if (el._katavorioDrag) {\n el._katavorioDrag.setFilter(filter, _exclude);\n }\n },\n setElementDraggable: function (el, draggable) {\n el = _jp.getElement(el);\n if (el._katavorioDrag) {\n el._katavorioDrag.setEnabled(draggable);\n }\n },\n setDragScope: function (el, scope) {\n if (el._katavorioDrag) {\n el._katavorioDrag.k.setDragScope(el, scope);\n }\n },\n setDropScope:function(el, scope) {\n if (el._katavorioDrop && el._katavorioDrop.length > 0) {\n el._katavorioDrop[0].k.setDropScope(el, scope);\n }\n },\n addToPosse:function(el, spec) {\n var specs = Array.prototype.slice.call(arguments, 1);\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) {\n _el = [ _jp.getElement(_el) ];\n _el.push.apply(_el, specs );\n dm.addToPosse.apply(dm, _el);\n });\n },\n setPosse:function(el, spec) {\n var specs = Array.prototype.slice.call(arguments, 1);\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) {\n _el = [ _jp.getElement(_el) ];\n _el.push.apply(_el, specs );\n dm.setPosse.apply(dm, _el);\n });\n },\n removeFromPosse:function(el, posseId) {\n var specs = Array.prototype.slice.call(arguments, 1);\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) {\n _el = [ _jp.getElement(_el) ];\n _el.push.apply(_el, specs );\n dm.removeFromPosse.apply(dm, _el);\n });\n },\n removeFromAllPosses:function(el) {\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) { dm.removeFromAllPosses(_jp.getElement(_el)); });\n },\n setPosseState:function(el, posseId, state) {\n var dm = _getDragManager(this);\n _jp.each(el, function(_el) { dm.setPosseState(_jp.getElement(_el), posseId, state); });\n },\n dragEvents: {\n 'start': 'start', 'stop': 'stop', 'drag': 'drag', 'step': 'step',\n 'over': 'over', 'out': 'out', 'drop': 'drop', 'complete': 'complete',\n 'beforeStart':'beforeStart'\n },\n animEvents: {\n 'step': \"step\", 'complete': 'complete'\n },\n stopDrag: function (el) {\n if (el._katavorioDrag) {\n el._katavorioDrag.abort();\n }\n },\n addToDragSelection: function (spec) {\n _getDragManager(this).select(spec);\n },\n removeFromDragSelection: function (spec) {\n _getDragManager(this).deselect(spec);\n },\n clearDragSelection: function () {\n _getDragManager(this).deselectAll();\n },\n trigger: function (el, event, originalEvent, payload) {\n this.getEventManager().trigger(el, event, originalEvent, payload);\n },\n doReset:function() {\n // look for katavorio instances and reset each one if found.\n for (var key in this) {\n if (key.indexOf(\"_katavorio_\") === 0) {\n this[key].reset();\n }\n }\n },\n getEventManager:function() {\n return _getEventManager(this);\n },\n on : function(el, event, callback) {\n // TODO: here we would like to map the tap event if we know its\n // an internal bind to a click. we have to know its internal because only\n // then can we be sure that the UP event wont be consumed (tap is a synthesized\n // event from a mousedown followed by a mouseup).\n //event = { \"click\":\"tap\", \"dblclick\":\"dbltap\"}[event] || event;\n this.getEventManager().on.apply(this, arguments);\n return this;\n },\n off : function(el, event, callback) {\n this.getEventManager().off.apply(this, arguments);\n return this;\n }\n\n });\n\n var ready = function (f) {\n var _do = function () {\n if (/complete|loaded|interactive/.test(document.readyState) && typeof(document.body) !== \"undefined\" && document.body != null) {\n f();\n }\n else {\n setTimeout(_do, 9);\n }\n };\n\n _do();\n };\n ready(_jp.init);\n\n}).call(typeof window !== 'undefined' ? window : this);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/jsplumb/dist/js/jsplumb.js\n// module id = 721\n// module chunks = 3 4 5","\nimport i18n from '@/module/i18n'\n\n/**\n * cycle\n */\nconst cycleList = [\n {\n value: 'month',\n label: `${i18n.$t('月')}`\n },\n {\n value: 'week',\n label: `${i18n.$t('周')}`\n },\n {\n value: 'day',\n label: `${i18n.$t('日')}`\n },\n {\n value: 'hour',\n label: `${i18n.$t('时')}`\n }\n]\n\n/**\n * cycle value\n */\nconst dateValueList = {\n 'hour': [\n {\n value: 'last1Hour',\n label: `${i18n.$t('前1小时')}`\n },\n {\n value: 'last2Hours',\n label: `${i18n.$t('前2小时')}`\n },\n {\n value: 'last3Hours',\n label: `${i18n.$t('前3小时')}`\n }\n ],\n 'day': [\n {\n value: 'last1Days',\n label: `${i18n.$t('昨天')}`\n },\n {\n value: 'last2Days',\n label: `${i18n.$t('前两天')}`\n },\n {\n value: 'last3Days',\n label: `${i18n.$t('前三天')}`\n },\n {\n value: 'last7Days',\n label: `${i18n.$t('前七天')}`\n }\n ],\n 'week': [\n {\n value: 'lastWeek',\n label: `${i18n.$t('上周')}`\n },\n {\n value: 'lastMonday',\n label: `${i18n.$t('上周一')}`\n },\n {\n value: 'lastTuesday',\n label: `${i18n.$t('上周二')}`\n },\n {\n value: 'lastWednesday',\n label: `${i18n.$t('上周三')}`\n },\n {\n value: 'lastThursday',\n label: `${i18n.$t('上周四')}`\n },\n {\n value: 'lastFriday',\n label: `${i18n.$t('上周五')}`\n },\n {\n value: 'lastSaturday',\n label: `${i18n.$t('上周六')}`\n },\n {\n value: 'lastSunday',\n label: `${i18n.$t('上周日')}`\n }\n ],\n 'month': [\n {\n value: 'lastMonth',\n label: `${i18n.$t('上月')}`\n },\n {\n value: 'lastMonthBegin',\n label: `${i18n.$t('上月初')}`\n },\n {\n value: 'lastMonthEnd',\n label: `${i18n.$t('上月末')}`\n }\n ]\n}\n\n/**\n * direct\n */\nconst directList = [\n {\n id: 1,\n code: 'IN',\n disabled: false\n },\n {\n id: 2,\n code: 'OUT',\n disabled: false\n }\n]\n\n/**\n * type\n */\nconst typeList = [\n {\n id: 1,\n code: 'VARCHAR',\n disabled: false\n },\n {\n id: 2,\n code: 'INTEGER',\n disabled: false\n },\n {\n id: 3,\n code: 'LONG',\n disabled: false\n },\n {\n id: 4,\n code: 'FLOAT',\n disabled: false\n },\n {\n id: 5,\n code: 'DOUBLE',\n disabled: false\n },\n {\n id: 6,\n code: 'DATE',\n disabled: false\n },\n {\n id: 7,\n code: 'TIME',\n disabled: false\n },\n {\n id: 8,\n code: 'TIMESTAMP',\n disabled: false\n },\n {\n id: 9,\n code: 'BOOLEAN',\n disabled: false\n }\n]\n\n/**\n * sqlType\n */\nconst sqlTypeList = [\n {\n id: 0,\n code: `${i18n.$t('查询')}`\n },\n {\n id: 1,\n code: `${i18n.$t('非查询')}`\n }\n]\n\nexport {\n cycleList,\n dateValueList,\n typeList,\n directList,\n sqlTypeList\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/formModel/tasks/_source/commcon.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/log.vue","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var HINT_ELEMENT_CLASS = \"CodeMirror-hint\";\n var ACTIVE_HINT_ELEMENT_CLASS = \"CodeMirror-hint-active\";\n\n // This is the old interface, kept around for now to stay\n // backwards-compatible.\n CodeMirror.showHint = function(cm, getHints, options) {\n if (!getHints) return cm.showHint(options);\n if (options && options.async) getHints.async = true;\n var newOpts = {hint: getHints};\n if (options) for (var prop in options) newOpts[prop] = options[prop];\n return cm.showHint(newOpts);\n };\n\n CodeMirror.defineExtension(\"showHint\", function(options) {\n options = parseOptions(this, this.getCursor(\"start\"), options);\n var selections = this.listSelections()\n if (selections.length > 1) return;\n // By default, don't allow completion when something is selected.\n // A hint function can have a `supportsSelection` property to\n // indicate that it can handle selections.\n if (this.somethingSelected()) {\n if (!options.hint.supportsSelection) return;\n // Don't try with cross-line selections\n for (var i = 0; i < selections.length; i++)\n if (selections[i].head.line != selections[i].anchor.line) return;\n }\n\n if (this.state.completionActive) this.state.completionActive.close();\n var completion = this.state.completionActive = new Completion(this, options);\n if (!completion.options.hint) return;\n\n CodeMirror.signal(this, \"startCompletion\", this);\n completion.update(true);\n });\n\n CodeMirror.defineExtension(\"closeHint\", function() {\n if (this.state.completionActive) this.state.completionActive.close()\n })\n\n function Completion(cm, options) {\n this.cm = cm;\n this.options = options;\n this.widget = null;\n this.debounce = 0;\n this.tick = 0;\n this.startPos = this.cm.getCursor(\"start\");\n this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length;\n\n var self = this;\n cm.on(\"cursorActivity\", this.activityFunc = function() { self.cursorActivity(); });\n }\n\n var requestAnimationFrame = window.requestAnimationFrame || function(fn) {\n return setTimeout(fn, 1000/60);\n };\n var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout;\n\n Completion.prototype = {\n close: function() {\n if (!this.active()) return;\n this.cm.state.completionActive = null;\n this.tick = null;\n this.cm.off(\"cursorActivity\", this.activityFunc);\n\n if (this.widget && this.data) CodeMirror.signal(this.data, \"close\");\n if (this.widget) this.widget.close();\n CodeMirror.signal(this.cm, \"endCompletion\", this.cm);\n },\n\n active: function() {\n return this.cm.state.completionActive == this;\n },\n\n pick: function(data, i) {\n var completion = data.list[i];\n if (completion.hint) completion.hint(this.cm, data, completion);\n else this.cm.replaceRange(getText(completion), completion.from || data.from,\n completion.to || data.to, \"complete\");\n CodeMirror.signal(data, \"pick\", completion);\n this.close();\n },\n\n cursorActivity: function() {\n if (this.debounce) {\n cancelAnimationFrame(this.debounce);\n this.debounce = 0;\n }\n\n var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line);\n if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch ||\n pos.ch < this.startPos.ch || this.cm.somethingSelected() ||\n (!pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) {\n this.close();\n } else {\n var self = this;\n this.debounce = requestAnimationFrame(function() {self.update();});\n if (this.widget) this.widget.disable();\n }\n },\n\n update: function(first) {\n if (this.tick == null) return\n var self = this, myTick = ++this.tick\n fetchHints(this.options.hint, this.cm, this.options, function(data) {\n if (self.tick == myTick) self.finishUpdate(data, first)\n })\n },\n\n finishUpdate: function(data, first) {\n if (this.data) CodeMirror.signal(this.data, \"update\");\n\n var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);\n if (this.widget) this.widget.close();\n\n this.data = data;\n\n if (data && data.list.length) {\n if (picked && data.list.length == 1) {\n this.pick(data, 0);\n } else {\n this.widget = new Widget(this, data);\n CodeMirror.signal(data, \"shown\");\n }\n }\n }\n };\n\n function parseOptions(cm, pos, options) {\n var editor = cm.options.hintOptions;\n var out = {};\n for (var prop in defaultOptions) out[prop] = defaultOptions[prop];\n if (editor) for (var prop in editor)\n if (editor[prop] !== undefined) out[prop] = editor[prop];\n if (options) for (var prop in options)\n if (options[prop] !== undefined) out[prop] = options[prop];\n if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos)\n return out;\n }\n\n function getText(completion) {\n if (typeof completion == \"string\") return completion;\n else return completion.text;\n }\n\n function buildKeyMap(completion, handle) {\n var baseMap = {\n Up: function() {handle.moveFocus(-1);},\n Down: function() {handle.moveFocus(1);},\n PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);},\n PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);},\n Home: function() {handle.setFocus(0);},\n End: function() {handle.setFocus(handle.length - 1);},\n Enter: handle.pick,\n Tab: handle.pick,\n Esc: handle.close\n };\n\n var mac = /Mac/.test(navigator.platform);\n\n if (mac) {\n baseMap[\"Ctrl-P\"] = function() {handle.moveFocus(-1);};\n baseMap[\"Ctrl-N\"] = function() {handle.moveFocus(1);};\n }\n\n var custom = completion.options.customKeys;\n var ourMap = custom ? {} : baseMap;\n function addBinding(key, val) {\n var bound;\n if (typeof val != \"string\")\n bound = function(cm) { return val(cm, handle); };\n // This mechanism is deprecated\n else if (baseMap.hasOwnProperty(val))\n bound = baseMap[val];\n else\n bound = val;\n ourMap[key] = bound;\n }\n if (custom)\n for (var key in custom) if (custom.hasOwnProperty(key))\n addBinding(key, custom[key]);\n var extra = completion.options.extraKeys;\n if (extra)\n for (var key in extra) if (extra.hasOwnProperty(key))\n addBinding(key, extra[key]);\n return ourMap;\n }\n\n function getHintElement(hintsElement, el) {\n while (el && el != hintsElement) {\n if (el.nodeName.toUpperCase() === \"LI\" && el.parentNode == hintsElement) return el;\n el = el.parentNode;\n }\n }\n\n function Widget(completion, data) {\n this.completion = completion;\n this.data = data;\n this.picked = false;\n var widget = this, cm = completion.cm;\n var ownerDocument = cm.getInputField().ownerDocument;\n var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow;\n\n var hints = this.hints = ownerDocument.createElement(\"ul\");\n var theme = completion.cm.options.theme;\n hints.className = \"CodeMirror-hints \" + theme;\n this.selectedHint = data.selectedHint || 0;\n\n var completions = data.list;\n for (var i = 0; i < completions.length; ++i) {\n var elt = hints.appendChild(ownerDocument.createElement(\"li\")), cur = completions[i];\n var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? \"\" : \" \" + ACTIVE_HINT_ELEMENT_CLASS);\n if (cur.className != null) className = cur.className + \" \" + className;\n elt.className = className;\n if (cur.render) cur.render(elt, data, cur);\n else elt.appendChild(ownerDocument.createTextNode(cur.displayText || getText(cur)));\n elt.hintId = i;\n }\n\n var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null);\n var left = pos.left, top = pos.bottom, below = true;\n hints.style.left = left + \"px\";\n hints.style.top = top + \"px\";\n // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.\n var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth);\n var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight);\n (completion.options.container || ownerDocument.body).appendChild(hints);\n var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH;\n var scrolls = hints.scrollHeight > hints.clientHeight + 1\n var startScroll = cm.getScrollInfo();\n\n if (overlapY > 0) {\n var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);\n if (curTop - height > 0) { // Fits above cursor\n hints.style.top = (top = pos.top - height) + \"px\";\n below = false;\n } else if (height > winH) {\n hints.style.height = (winH - 5) + \"px\";\n hints.style.top = (top = pos.bottom - box.top) + \"px\";\n var cursor = cm.getCursor();\n if (data.from.ch != cursor.ch) {\n pos = cm.cursorCoords(cursor);\n hints.style.left = (left = pos.left) + \"px\";\n box = hints.getBoundingClientRect();\n }\n }\n }\n var overlapX = box.right - winW;\n if (overlapX > 0) {\n if (box.right - box.left > winW) {\n hints.style.width = (winW - 5) + \"px\";\n overlapX -= (box.right - box.left) - winW;\n }\n hints.style.left = (left = pos.left - overlapX) + \"px\";\n }\n if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling)\n node.style.paddingRight = cm.display.nativeBarWidth + \"px\"\n\n cm.addKeyMap(this.keyMap = buildKeyMap(completion, {\n moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },\n setFocus: function(n) { widget.changeActive(n); },\n menuSize: function() { return widget.screenAmount(); },\n length: completions.length,\n close: function() { completion.close(); },\n pick: function() { widget.pick(); },\n data: data\n }));\n\n if (completion.options.closeOnUnfocus) {\n var closingOnBlur;\n cm.on(\"blur\", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });\n cm.on(\"focus\", this.onFocus = function() { clearTimeout(closingOnBlur); });\n }\n\n cm.on(\"scroll\", this.onScroll = function() {\n var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();\n var newTop = top + startScroll.top - curScroll.top;\n var point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop);\n if (!below) point += hints.offsetHeight;\n if (point <= editor.top || point >= editor.bottom) return completion.close();\n hints.style.top = newTop + \"px\";\n hints.style.left = (left + startScroll.left - curScroll.left) + \"px\";\n });\n\n CodeMirror.on(hints, \"dblclick\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}\n });\n\n CodeMirror.on(hints, \"click\", function(e) {\n var t = getHintElement(hints, e.target || e.srcElement);\n if (t && t.hintId != null) {\n widget.changeActive(t.hintId);\n if (completion.options.completeOnSingleClick) widget.pick();\n }\n });\n\n CodeMirror.on(hints, \"mousedown\", function() {\n setTimeout(function(){cm.focus();}, 20);\n });\n\n CodeMirror.signal(data, \"select\", completions[this.selectedHint], hints.childNodes[this.selectedHint]);\n return true;\n }\n\n Widget.prototype = {\n close: function() {\n if (this.completion.widget != this) return;\n this.completion.widget = null;\n this.hints.parentNode.removeChild(this.hints);\n this.completion.cm.removeKeyMap(this.keyMap);\n\n var cm = this.completion.cm;\n if (this.completion.options.closeOnUnfocus) {\n cm.off(\"blur\", this.onBlur);\n cm.off(\"focus\", this.onFocus);\n }\n cm.off(\"scroll\", this.onScroll);\n },\n\n disable: function() {\n this.completion.cm.removeKeyMap(this.keyMap);\n var widget = this;\n this.keyMap = {Enter: function() { widget.picked = true; }};\n this.completion.cm.addKeyMap(this.keyMap);\n },\n\n pick: function() {\n this.completion.pick(this.data, this.selectedHint);\n },\n\n changeActive: function(i, avoidWrap) {\n if (i >= this.data.list.length)\n i = avoidWrap ? this.data.list.length - 1 : 0;\n else if (i < 0)\n i = avoidWrap ? 0 : this.data.list.length - 1;\n if (this.selectedHint == i) return;\n var node = this.hints.childNodes[this.selectedHint];\n if (node) node.className = node.className.replace(\" \" + ACTIVE_HINT_ELEMENT_CLASS, \"\");\n node = this.hints.childNodes[this.selectedHint = i];\n node.className += \" \" + ACTIVE_HINT_ELEMENT_CLASS;\n if (node.offsetTop < this.hints.scrollTop)\n this.hints.scrollTop = node.offsetTop - 3;\n else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)\n this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3;\n CodeMirror.signal(this.data, \"select\", this.data.list[this.selectedHint], node);\n },\n\n screenAmount: function() {\n return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;\n }\n };\n\n function applicableHelpers(cm, helpers) {\n if (!cm.somethingSelected()) return helpers\n var result = []\n for (var i = 0; i < helpers.length; i++)\n if (helpers[i].supportsSelection) result.push(helpers[i])\n return result\n }\n\n function fetchHints(hint, cm, options, callback) {\n if (hint.async) {\n hint(cm, callback, options)\n } else {\n var result = hint(cm, options)\n if (result && result.then) result.then(callback)\n else callback(result)\n }\n }\n\n function resolveAutoHints(cm, pos) {\n var helpers = cm.getHelpers(pos, \"hint\"), words\n if (helpers.length) {\n var resolved = function(cm, callback, options) {\n var app = applicableHelpers(cm, helpers);\n function run(i) {\n if (i == app.length) return callback(null)\n fetchHints(app[i], cm, options, function(result) {\n if (result && result.list.length > 0) callback(result)\n else run(i + 1)\n })\n }\n run(0)\n }\n resolved.async = true\n resolved.supportsSelection = true\n return resolved\n } else if (words = cm.getHelper(cm.getCursor(), \"hintWords\")) {\n return function(cm) { return CodeMirror.hint.fromList(cm, {words: words}) }\n } else if (CodeMirror.hint.anyword) {\n return function(cm, options) { return CodeMirror.hint.anyword(cm, options) }\n } else {\n return function() {}\n }\n }\n\n CodeMirror.registerHelper(\"hint\", \"auto\", {\n resolve: resolveAutoHints\n });\n\n CodeMirror.registerHelper(\"hint\", \"fromList\", function(cm, options) {\n var cur = cm.getCursor(), token = cm.getTokenAt(cur)\n var term, from = CodeMirror.Pos(cur.line, token.start), to = cur\n if (token.start < cur.ch && /\\w/.test(token.string.charAt(cur.ch - token.start - 1))) {\n term = token.string.substr(0, cur.ch - token.start)\n } else {\n term = \"\"\n from = cur\n }\n var found = [];\n for (var i = 0; i < options.words.length; i++) {\n var word = options.words[i];\n if (word.slice(0, term.length) == term)\n found.push(word);\n }\n\n if (found.length) return {list: found, from: from, to: to};\n });\n\n CodeMirror.commands.autocomplete = CodeMirror.showHint;\n\n var defaultOptions = {\n hint: CodeMirror.hint.auto,\n completeSingle: true,\n alignWithWord: true,\n closeCharacters: /[\\s()\\[\\]{};:>,]/,\n closeOnUnfocus: true,\n completeOnSingleClick: true,\n container: null,\n customKeys: null,\n extraKeys: null\n };\n\n CodeMirror.defineOption(\"hintOptions\", null);\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/addon/hint/show-hint.js\n// module id = 725\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"), require(\"../../mode/sql/sql\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\", \"../../mode/sql/sql\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var tables;\n var defaultTable;\n var keywords;\n var identifierQuote;\n var CONS = {\n QUERY_DIV: \";\",\n ALIAS_KEYWORD: \"AS\"\n };\n var Pos = CodeMirror.Pos, cmpPos = CodeMirror.cmpPos;\n\n function isArray(val) { return Object.prototype.toString.call(val) == \"[object Array]\" }\n\n function getKeywords(editor) {\n var mode = editor.doc.modeOption;\n if (mode === \"sql\") mode = \"text/x-sql\";\n return CodeMirror.resolveMode(mode).keywords;\n }\n\n function getIdentifierQuote(editor) {\n var mode = editor.doc.modeOption;\n if (mode === \"sql\") mode = \"text/x-sql\";\n return CodeMirror.resolveMode(mode).identifierQuote || \"`\";\n }\n\n function getText(item) {\n return typeof item == \"string\" ? item : item.text;\n }\n\n function wrapTable(name, value) {\n if (isArray(value)) value = {columns: value}\n if (!value.text) value.text = name\n return value\n }\n\n function parseTables(input) {\n var result = {}\n if (isArray(input)) {\n for (var i = input.length - 1; i >= 0; i--) {\n var item = input[i]\n result[getText(item).toUpperCase()] = wrapTable(getText(item), item)\n }\n } else if (input) {\n for (var name in input)\n result[name.toUpperCase()] = wrapTable(name, input[name])\n }\n return result\n }\n\n function getTable(name) {\n return tables[name.toUpperCase()]\n }\n\n function shallowClone(object) {\n var result = {};\n for (var key in object) if (object.hasOwnProperty(key))\n result[key] = object[key];\n return result;\n }\n\n function match(string, word) {\n var len = string.length;\n var sub = getText(word).substr(0, len);\n return string.toUpperCase() === sub.toUpperCase();\n }\n\n function addMatches(result, search, wordlist, formatter) {\n if (isArray(wordlist)) {\n for (var i = 0; i < wordlist.length; i++)\n if (match(search, wordlist[i])) result.push(formatter(wordlist[i]))\n } else {\n for (var word in wordlist) if (wordlist.hasOwnProperty(word)) {\n var val = wordlist[word]\n if (!val || val === true)\n val = word\n else\n val = val.displayText ? {text: val.text, displayText: val.displayText} : val.text\n if (match(search, val)) result.push(formatter(val))\n }\n }\n }\n\n function cleanName(name) {\n // Get rid name from identifierQuote and preceding dot(.)\n if (name.charAt(0) == \".\") {\n name = name.substr(1);\n }\n // replace doublicated identifierQuotes with single identifierQuotes\n // and remove single identifierQuotes\n var nameParts = name.split(identifierQuote+identifierQuote);\n for (var i = 0; i < nameParts.length; i++)\n nameParts[i] = nameParts[i].replace(new RegExp(identifierQuote,\"g\"), \"\");\n return nameParts.join(identifierQuote);\n }\n\n function insertIdentifierQuotes(name) {\n var nameParts = getText(name).split(\".\");\n for (var i = 0; i < nameParts.length; i++)\n nameParts[i] = identifierQuote +\n // doublicate identifierQuotes\n nameParts[i].replace(new RegExp(identifierQuote,\"g\"), identifierQuote+identifierQuote) +\n identifierQuote;\n var escaped = nameParts.join(\".\");\n if (typeof name == \"string\") return escaped;\n name = shallowClone(name);\n name.text = escaped;\n return name;\n }\n\n function nameCompletion(cur, token, result, editor) {\n // Try to complete table, column names and return start position of completion\n var useIdentifierQuotes = false;\n var nameParts = [];\n var start = token.start;\n var cont = true;\n while (cont) {\n cont = (token.string.charAt(0) == \".\");\n useIdentifierQuotes = useIdentifierQuotes || (token.string.charAt(0) == identifierQuote);\n\n start = token.start;\n nameParts.unshift(cleanName(token.string));\n\n token = editor.getTokenAt(Pos(cur.line, token.start));\n if (token.string == \".\") {\n cont = true;\n token = editor.getTokenAt(Pos(cur.line, token.start));\n }\n }\n\n // Try to complete table names\n var string = nameParts.join(\".\");\n addMatches(result, string, tables, function(w) {\n return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;\n });\n\n // Try to complete columns from defaultTable\n addMatches(result, string, defaultTable, function(w) {\n return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;\n });\n\n // Try to complete columns\n string = nameParts.pop();\n var table = nameParts.join(\".\");\n\n var alias = false;\n var aliasTable = table;\n // Check if table is available. If not, find table by Alias\n if (!getTable(table)) {\n var oldTable = table;\n table = findTableByAlias(table, editor);\n if (table !== oldTable) alias = true;\n }\n\n var columns = getTable(table);\n if (columns && columns.columns)\n columns = columns.columns;\n\n if (columns) {\n addMatches(result, string, columns, function(w) {\n var tableInsert = table;\n if (alias == true) tableInsert = aliasTable;\n if (typeof w == \"string\") {\n w = tableInsert + \".\" + w;\n } else {\n w = shallowClone(w);\n w.text = tableInsert + \".\" + w.text;\n }\n return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;\n });\n }\n\n return start;\n }\n\n function eachWord(lineText, f) {\n var words = lineText.split(/\\s+/)\n for (var i = 0; i < words.length; i++)\n if (words[i]) f(words[i].replace(/[,;]/g, ''))\n }\n\n function findTableByAlias(alias, editor) {\n var doc = editor.doc;\n var fullQuery = doc.getValue();\n var aliasUpperCase = alias.toUpperCase();\n var previousWord = \"\";\n var table = \"\";\n var separator = [];\n var validRange = {\n start: Pos(0, 0),\n end: Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).length)\n };\n\n //add separator\n var indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV);\n while(indexOfSeparator != -1) {\n separator.push(doc.posFromIndex(indexOfSeparator));\n indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV, indexOfSeparator+1);\n }\n separator.unshift(Pos(0, 0));\n separator.push(Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).text.length));\n\n //find valid range\n var prevItem = null;\n var current = editor.getCursor()\n for (var i = 0; i < separator.length; i++) {\n if ((prevItem == null || cmpPos(current, prevItem) > 0) && cmpPos(current, separator[i]) <= 0) {\n validRange = {start: prevItem, end: separator[i]};\n break;\n }\n prevItem = separator[i];\n }\n\n if (validRange.start) {\n var query = doc.getRange(validRange.start, validRange.end, false);\n\n for (var i = 0; i < query.length; i++) {\n var lineText = query[i];\n eachWord(lineText, function(word) {\n var wordUpperCase = word.toUpperCase();\n if (wordUpperCase === aliasUpperCase && getTable(previousWord))\n table = previousWord;\n if (wordUpperCase !== CONS.ALIAS_KEYWORD)\n previousWord = word;\n });\n if (table) break;\n }\n }\n return table;\n }\n\n CodeMirror.registerHelper(\"hint\", \"sql\", function(editor, options) {\n tables = parseTables(options && options.tables)\n var defaultTableName = options && options.defaultTable;\n var disableKeywords = options && options.disableKeywords;\n defaultTable = defaultTableName && getTable(defaultTableName);\n keywords = getKeywords(editor);\n identifierQuote = getIdentifierQuote(editor);\n\n if (defaultTableName && !defaultTable)\n defaultTable = findTableByAlias(defaultTableName, editor);\n\n defaultTable = defaultTable || [];\n\n if (defaultTable.columns)\n defaultTable = defaultTable.columns;\n\n var cur = editor.getCursor();\n var result = [];\n var token = editor.getTokenAt(cur), start, end, search;\n if (token.end > cur.ch) {\n token.end = cur.ch;\n token.string = token.string.slice(0, cur.ch - token.start);\n }\n\n if (token.string.match(/^[.`\"\\w@]\\w*$/)) {\n search = token.string;\n start = token.start;\n end = token.end;\n } else {\n start = end = cur.ch;\n search = \"\";\n }\n if (search.charAt(0) == \".\" || search.charAt(0) == identifierQuote) {\n start = nameCompletion(cur, token, result, editor);\n } else {\n var objectOrClass = function(w, className) {\n if (typeof w === \"object\") {\n w.className = className;\n } else {\n w = { text: w, className: className };\n }\n return w;\n };\n addMatches(result, search, defaultTable, function(w) {\n return objectOrClass(w, \"CodeMirror-hint-table CodeMirror-hint-default-table\");\n });\n addMatches(\n result,\n search,\n tables, function(w) {\n return objectOrClass(w, \"CodeMirror-hint-table\");\n }\n );\n if (!disableKeywords)\n addMatches(result, search, keywords, function(w) {\n return objectOrClass(w.toUpperCase(), \"CodeMirror-hint-keyword\");\n });\n }\n\n return {list: result, from: Pos(cur.line, start), to: Pos(cur.line, end)};\n });\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/addon/hint/sql-hint.js\n// module id = 726\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n var Pos = CodeMirror.Pos;\n\n function matches(hint, typed, matchInMiddle) {\n if (matchInMiddle) return hint.indexOf(typed) >= 0;\n else return hint.lastIndexOf(typed, 0) == 0;\n }\n\n function getHints(cm, options) {\n var tags = options && options.schemaInfo;\n var quote = (options && options.quoteChar) || '\"';\n var matchInMiddle = options && options.matchInMiddle;\n if (!tags) return;\n var cur = cm.getCursor(), token = cm.getTokenAt(cur);\n if (token.end > cur.ch) {\n token.end = cur.ch;\n token.string = token.string.slice(0, cur.ch - token.start);\n }\n var inner = CodeMirror.innerMode(cm.getMode(), token.state);\n if (inner.mode.name != \"xml\") return;\n var result = [], replaceToken = false, prefix;\n var tag = /\\btag\\b/.test(token.type) && !/>$/.test(token.string);\n var tagName = tag && /^\\w/.test(token.string), tagStart;\n\n if (tagName) {\n var before = cm.getLine(cur.line).slice(Math.max(0, token.start - 2), token.start);\n var tagType = /<\\/$/.test(before) ? \"close\" : /<$/.test(before) ? \"open\" : null;\n if (tagType) tagStart = token.start - (tagType == \"close\" ? 2 : 1);\n } else if (tag && token.string == \"<\") {\n tagType = \"open\";\n } else if (tag && token.string == \"\");\n } else {\n // Attribute completion\n var curTag = tags[inner.state.tagName], attrs = curTag && curTag.attrs;\n var globalAttrs = tags[\"!attrs\"];\n if (!attrs && !globalAttrs) return;\n if (!attrs) {\n attrs = globalAttrs;\n } else if (globalAttrs) { // Combine tag-local and global attributes\n var set = {};\n for (var nm in globalAttrs) if (globalAttrs.hasOwnProperty(nm)) set[nm] = globalAttrs[nm];\n for (var nm in attrs) if (attrs.hasOwnProperty(nm)) set[nm] = attrs[nm];\n attrs = set;\n }\n if (token.type == \"string\" || token.string == \"=\") { // A value\n var before = cm.getRange(Pos(cur.line, Math.max(0, cur.ch - 60)),\n Pos(cur.line, token.type == \"string\" ? token.start : token.end));\n var atName = before.match(/([^\\s\\u00a0=<>\\\"\\']+)=$/), atValues;\n if (!atName || !attrs.hasOwnProperty(atName[1]) || !(atValues = attrs[atName[1]])) return;\n if (typeof atValues == 'function') atValues = atValues.call(this, cm); // Functions can be used to supply values for autocomplete widget\n if (token.type == \"string\") {\n prefix = token.string;\n var n = 0;\n if (/['\"]/.test(token.string.charAt(0))) {\n quote = token.string.charAt(0);\n prefix = token.string.slice(1);\n n++;\n }\n var len = token.string.length;\n if (/['\"]/.test(token.string.charAt(len - 1))) {\n quote = token.string.charAt(len - 1);\n prefix = token.string.substr(n, len - 2);\n }\n replaceToken = true;\n }\n for (var i = 0; i < atValues.length; ++i) if (!prefix || matches(atValues[i], prefix, matchInMiddle))\n result.push(quote + atValues[i] + quote);\n } else { // An attribute name\n if (token.type == \"attribute\") {\n prefix = token.string;\n replaceToken = true;\n }\n for (var attr in attrs) if (attrs.hasOwnProperty(attr) && (!prefix || matches(attr, prefix, matchInMiddle)))\n result.push(attr);\n }\n }\n return {\n list: result,\n from: replaceToken ? Pos(cur.line, tagStart == null ? token.start : tagStart) : cur,\n to: replaceToken ? Pos(cur.line, token.end) : cur\n };\n }\n\n CodeMirror.registerHelper(\"hint\", \"xml\", getHints);\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/addon/hint/xml-hint.js\n// module id = 727\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n \"use strict\";\n\n function wordRegexp(words) {\n return new RegExp(\"^((\" + words.join(\")|(\") + \"))\\\\b\");\n }\n\n var wordOperators = wordRegexp([\"and\", \"or\", \"not\", \"is\"]);\n var commonKeywords = [\"as\", \"assert\", \"break\", \"class\", \"continue\",\n \"def\", \"del\", \"elif\", \"else\", \"except\", \"finally\",\n \"for\", \"from\", \"global\", \"if\", \"import\",\n \"lambda\", \"pass\", \"raise\", \"return\",\n \"try\", \"while\", \"with\", \"yield\", \"in\"];\n var commonBuiltins = [\"abs\", \"all\", \"any\", \"bin\", \"bool\", \"bytearray\", \"callable\", \"chr\",\n \"classmethod\", \"compile\", \"complex\", \"delattr\", \"dict\", \"dir\", \"divmod\",\n \"enumerate\", \"eval\", \"filter\", \"float\", \"format\", \"frozenset\",\n \"getattr\", \"globals\", \"hasattr\", \"hash\", \"help\", \"hex\", \"id\",\n \"input\", \"int\", \"isinstance\", \"issubclass\", \"iter\", \"len\",\n \"list\", \"locals\", \"map\", \"max\", \"memoryview\", \"min\", \"next\",\n \"object\", \"oct\", \"open\", \"ord\", \"pow\", \"property\", \"range\",\n \"repr\", \"reversed\", \"round\", \"set\", \"setattr\", \"slice\",\n \"sorted\", \"staticmethod\", \"str\", \"sum\", \"super\", \"tuple\",\n \"type\", \"vars\", \"zip\", \"__import__\", \"NotImplemented\",\n \"Ellipsis\", \"__debug__\"];\n CodeMirror.registerHelper(\"hintWords\", \"python\", commonKeywords.concat(commonBuiltins));\n\n function top(state) {\n return state.scopes[state.scopes.length - 1];\n }\n\n CodeMirror.defineMode(\"python\", function(conf, parserConf) {\n var ERRORCLASS = \"error\";\n\n var delimiters = parserConf.delimiters || parserConf.singleDelimiters || /^[\\(\\)\\[\\]\\{\\}@,:`=;\\.\\\\]/;\n // (Backwards-compatiblity with old, cumbersome config system)\n var operators = [parserConf.singleOperators, parserConf.doubleOperators, parserConf.doubleDelimiters, parserConf.tripleDelimiters,\n parserConf.operators || /^([-+*/%\\/&|^]=?|[<>=]+|\\/\\/=?|\\*\\*=?|!=|[~!@])/]\n for (var i = 0; i < operators.length; i++) if (!operators[i]) operators.splice(i--, 1)\n\n var hangingIndent = parserConf.hangingIndent || conf.indentUnit;\n\n var myKeywords = commonKeywords, myBuiltins = commonBuiltins;\n if (parserConf.extra_keywords != undefined)\n myKeywords = myKeywords.concat(parserConf.extra_keywords);\n\n if (parserConf.extra_builtins != undefined)\n myBuiltins = myBuiltins.concat(parserConf.extra_builtins);\n\n var py3 = !(parserConf.version && Number(parserConf.version) < 3)\n if (py3) {\n // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator\n var identifiers = parserConf.identifiers|| /^[_A-Za-z\\u00A1-\\uFFFF][_A-Za-z0-9\\u00A1-\\uFFFF]*/;\n myKeywords = myKeywords.concat([\"nonlocal\", \"False\", \"True\", \"None\", \"async\", \"await\"]);\n myBuiltins = myBuiltins.concat([\"ascii\", \"bytes\", \"exec\", \"print\"]);\n var stringPrefixes = new RegExp(\"^(([rbuf]|(br)|(fr))?('{3}|\\\"{3}|['\\\"]))\", \"i\");\n } else {\n var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/;\n myKeywords = myKeywords.concat([\"exec\", \"print\"]);\n myBuiltins = myBuiltins.concat([\"apply\", \"basestring\", \"buffer\", \"cmp\", \"coerce\", \"execfile\",\n \"file\", \"intern\", \"long\", \"raw_input\", \"reduce\", \"reload\",\n \"unichr\", \"unicode\", \"xrange\", \"False\", \"True\", \"None\"]);\n var stringPrefixes = new RegExp(\"^(([rubf]|(ur)|(br))?('{3}|\\\"{3}|['\\\"]))\", \"i\");\n }\n var keywords = wordRegexp(myKeywords);\n var builtins = wordRegexp(myBuiltins);\n\n // tokenizers\n function tokenBase(stream, state) {\n var sol = stream.sol() && state.lastToken != \"\\\\\"\n if (sol) state.indent = stream.indentation()\n // Handle scope changes\n if (sol && top(state).type == \"py\") {\n var scopeOffset = top(state).offset;\n if (stream.eatSpace()) {\n var lineOffset = stream.indentation();\n if (lineOffset > scopeOffset)\n pushPyScope(state);\n else if (lineOffset < scopeOffset && dedent(stream, state) && stream.peek() != \"#\")\n state.errorToken = true;\n return null;\n } else {\n var style = tokenBaseInner(stream, state);\n if (scopeOffset > 0 && dedent(stream, state))\n style += \" \" + ERRORCLASS;\n return style;\n }\n }\n return tokenBaseInner(stream, state);\n }\n\n function tokenBaseInner(stream, state) {\n if (stream.eatSpace()) return null;\n\n // Handle Comments\n if (stream.match(/^#.*/)) return \"comment\";\n\n // Handle Number Literals\n if (stream.match(/^[0-9\\.]/, false)) {\n var floatLiteral = false;\n // Floats\n if (stream.match(/^[\\d_]*\\.\\d+(e[\\+\\-]?\\d+)?/i)) { floatLiteral = true; }\n if (stream.match(/^[\\d_]+\\.\\d*/)) { floatLiteral = true; }\n if (stream.match(/^\\.\\d+/)) { floatLiteral = true; }\n if (floatLiteral) {\n // Float literals may be \"imaginary\"\n stream.eat(/J/i);\n return \"number\";\n }\n // Integers\n var intLiteral = false;\n // Hex\n if (stream.match(/^0x[0-9a-f_]+/i)) intLiteral = true;\n // Binary\n if (stream.match(/^0b[01_]+/i)) intLiteral = true;\n // Octal\n if (stream.match(/^0o[0-7_]+/i)) intLiteral = true;\n // Decimal\n if (stream.match(/^[1-9][\\d_]*(e[\\+\\-]?[\\d_]+)?/)) {\n // Decimal literals may be \"imaginary\"\n stream.eat(/J/i);\n // TODO - Can you have imaginary longs?\n intLiteral = true;\n }\n // Zero by itself with no other piece of number.\n if (stream.match(/^0(?![\\dx])/i)) intLiteral = true;\n if (intLiteral) {\n // Integer literals may be \"long\"\n stream.eat(/L/i);\n return \"number\";\n }\n }\n\n // Handle Strings\n if (stream.match(stringPrefixes)) {\n var isFmtString = stream.current().toLowerCase().indexOf('f') !== -1;\n if (!isFmtString) {\n state.tokenize = tokenStringFactory(stream.current(), state.tokenize);\n return state.tokenize(stream, state);\n } else {\n state.tokenize = formatStringFactory(stream.current(), state.tokenize);\n return state.tokenize(stream, state);\n }\n }\n\n for (var i = 0; i < operators.length; i++)\n if (stream.match(operators[i])) return \"operator\"\n\n if (stream.match(delimiters)) return \"punctuation\";\n\n if (state.lastToken == \".\" && stream.match(identifiers))\n return \"property\";\n\n if (stream.match(keywords) || stream.match(wordOperators))\n return \"keyword\";\n\n if (stream.match(builtins))\n return \"builtin\";\n\n if (stream.match(/^(self|cls)\\b/))\n return \"variable-2\";\n\n if (stream.match(identifiers)) {\n if (state.lastToken == \"def\" || state.lastToken == \"class\")\n return \"def\";\n return \"variable\";\n }\n\n // Handle non-detected items\n stream.next();\n return ERRORCLASS;\n }\n\n function formatStringFactory(delimiter, tokenOuter) {\n while (\"rubf\".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)\n delimiter = delimiter.substr(1);\n\n var singleline = delimiter.length == 1;\n var OUTCLASS = \"string\";\n\n function tokenNestedExpr(depth) {\n return function(stream, state) {\n var inner = tokenBaseInner(stream, state)\n if (inner == \"punctuation\") {\n if (stream.current() == \"{\") {\n state.tokenize = tokenNestedExpr(depth + 1)\n } else if (stream.current() == \"}\") {\n if (depth > 1) state.tokenize = tokenNestedExpr(depth - 1)\n else state.tokenize = tokenString\n }\n }\n return inner\n }\n }\n\n function tokenString(stream, state) {\n while (!stream.eol()) {\n stream.eatWhile(/[^'\"\\{\\}\\\\]/);\n if (stream.eat(\"\\\\\")) {\n stream.next();\n if (singleline && stream.eol())\n return OUTCLASS;\n } else if (stream.match(delimiter)) {\n state.tokenize = tokenOuter;\n return OUTCLASS;\n } else if (stream.match('{{')) {\n // ignore {{ in f-str\n return OUTCLASS;\n } else if (stream.match('{', false)) {\n // switch to nested mode\n state.tokenize = tokenNestedExpr(0)\n if (stream.current()) return OUTCLASS;\n else return state.tokenize(stream, state)\n } else if (stream.match('}}')) {\n return OUTCLASS;\n } else if (stream.match('}')) {\n // single } in f-string is an error\n return ERRORCLASS;\n } else {\n stream.eat(/['\"]/);\n }\n }\n if (singleline) {\n if (parserConf.singleLineStringErrors)\n return ERRORCLASS;\n else\n state.tokenize = tokenOuter;\n }\n return OUTCLASS;\n }\n tokenString.isString = true;\n return tokenString;\n }\n\n function tokenStringFactory(delimiter, tokenOuter) {\n while (\"rubf\".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)\n delimiter = delimiter.substr(1);\n\n var singleline = delimiter.length == 1;\n var OUTCLASS = \"string\";\n\n function tokenString(stream, state) {\n while (!stream.eol()) {\n stream.eatWhile(/[^'\"\\\\]/);\n if (stream.eat(\"\\\\\")) {\n stream.next();\n if (singleline && stream.eol())\n return OUTCLASS;\n } else if (stream.match(delimiter)) {\n state.tokenize = tokenOuter;\n return OUTCLASS;\n } else {\n stream.eat(/['\"]/);\n }\n }\n if (singleline) {\n if (parserConf.singleLineStringErrors)\n return ERRORCLASS;\n else\n state.tokenize = tokenOuter;\n }\n return OUTCLASS;\n }\n tokenString.isString = true;\n return tokenString;\n }\n\n function pushPyScope(state) {\n while (top(state).type != \"py\") state.scopes.pop()\n state.scopes.push({offset: top(state).offset + conf.indentUnit,\n type: \"py\",\n align: null})\n }\n\n function pushBracketScope(stream, state, type) {\n var align = stream.match(/^([\\s\\[\\{\\(]|#.*)*$/, false) ? null : stream.column() + 1\n state.scopes.push({offset: state.indent + hangingIndent,\n type: type,\n align: align})\n }\n\n function dedent(stream, state) {\n var indented = stream.indentation();\n while (state.scopes.length > 1 && top(state).offset > indented) {\n if (top(state).type != \"py\") return true;\n state.scopes.pop();\n }\n return top(state).offset != indented;\n }\n\n function tokenLexer(stream, state) {\n if (stream.sol()) state.beginningOfLine = true;\n\n var style = state.tokenize(stream, state);\n var current = stream.current();\n\n // Handle decorators\n if (state.beginningOfLine && current == \"@\")\n return stream.match(identifiers, false) ? \"meta\" : py3 ? \"operator\" : ERRORCLASS;\n\n if (/\\S/.test(current)) state.beginningOfLine = false;\n\n if ((style == \"variable\" || style == \"builtin\")\n && state.lastToken == \"meta\")\n style = \"meta\";\n\n // Handle scope changes.\n if (current == \"pass\" || current == \"return\")\n state.dedent += 1;\n\n if (current == \"lambda\") state.lambda = true;\n if (current == \":\" && !state.lambda && top(state).type == \"py\")\n pushPyScope(state);\n\n if (current.length == 1 && !/string|comment/.test(style)) {\n var delimiter_index = \"[({\".indexOf(current);\n if (delimiter_index != -1)\n pushBracketScope(stream, state, \"])}\".slice(delimiter_index, delimiter_index+1));\n\n delimiter_index = \"])}\".indexOf(current);\n if (delimiter_index != -1) {\n if (top(state).type == current) state.indent = state.scopes.pop().offset - hangingIndent\n else return ERRORCLASS;\n }\n }\n if (state.dedent > 0 && stream.eol() && top(state).type == \"py\") {\n if (state.scopes.length > 1) state.scopes.pop();\n state.dedent -= 1;\n }\n\n return style;\n }\n\n var external = {\n startState: function(basecolumn) {\n return {\n tokenize: tokenBase,\n scopes: [{offset: basecolumn || 0, type: \"py\", align: null}],\n indent: basecolumn || 0,\n lastToken: null,\n lambda: false,\n dedent: 0\n };\n },\n\n token: function(stream, state) {\n var addErr = state.errorToken;\n if (addErr) state.errorToken = false;\n var style = tokenLexer(stream, state);\n\n if (style && style != \"comment\")\n state.lastToken = (style == \"keyword\" || style == \"punctuation\") ? stream.current() : style;\n if (style == \"punctuation\") style = null;\n\n if (stream.eol() && state.lambda)\n state.lambda = false;\n return addErr ? style + \" \" + ERRORCLASS : style;\n },\n\n indent: function(state, textAfter) {\n if (state.tokenize != tokenBase)\n return state.tokenize.isString ? CodeMirror.Pass : 0;\n\n var scope = top(state), closing = scope.type == textAfter.charAt(0)\n if (scope.align != null)\n return scope.align - (closing ? 1 : 0)\n else\n return scope.offset - (closing ? hangingIndent : 0)\n },\n\n electricInput: /^\\s*[\\}\\]\\)]$/,\n closeBrackets: {triples: \"'\\\"\"},\n lineComment: \"#\",\n fold: \"indent\"\n };\n return external;\n });\n\n CodeMirror.defineMIME(\"text/x-python\", \"python\");\n\n var words = function(str) { return str.split(\" \"); };\n\n CodeMirror.defineMIME(\"text/x-cython\", {\n name: \"python\",\n extra_keywords: words(\"by cdef cimport cpdef ctypedef enum except \"+\n \"extern gil include nogil property public \"+\n \"readonly struct union DEF IF ELIF ELSE\")\n });\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/python/python.js\n// module id = 728\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nvar htmlConfig = {\n autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,\n 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,\n 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,\n 'track': true, 'wbr': true, 'menuitem': true},\n implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,\n 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,\n 'th': true, 'tr': true},\n contextGrabbers: {\n 'dd': {'dd': true, 'dt': true},\n 'dt': {'dd': true, 'dt': true},\n 'li': {'li': true},\n 'option': {'option': true, 'optgroup': true},\n 'optgroup': {'optgroup': true},\n 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,\n 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,\n 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,\n 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,\n 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},\n 'rp': {'rp': true, 'rt': true},\n 'rt': {'rp': true, 'rt': true},\n 'tbody': {'tbody': true, 'tfoot': true},\n 'td': {'td': true, 'th': true},\n 'tfoot': {'tbody': true},\n 'th': {'td': true, 'th': true},\n 'thead': {'tbody': true, 'tfoot': true},\n 'tr': {'tr': true}\n },\n doNotIndent: {\"pre\": true},\n allowUnquoted: true,\n allowMissing: true,\n caseFold: true\n}\n\nvar xmlConfig = {\n autoSelfClosers: {},\n implicitlyClosed: {},\n contextGrabbers: {},\n doNotIndent: {},\n allowUnquoted: false,\n allowMissing: false,\n allowMissingTagName: false,\n caseFold: false\n}\n\nCodeMirror.defineMode(\"xml\", function(editorConf, config_) {\n var indentUnit = editorConf.indentUnit\n var config = {}\n var defaults = config_.htmlMode ? htmlConfig : xmlConfig\n for (var prop in defaults) config[prop] = defaults[prop]\n for (var prop in config_) config[prop] = config_[prop]\n\n // Return variables for tokenizers\n var type, setStyle;\n\n function inText(stream, state) {\n function chain(parser) {\n state.tokenize = parser;\n return parser(stream, state);\n }\n\n var ch = stream.next();\n if (ch == \"<\") {\n if (stream.eat(\"!\")) {\n if (stream.eat(\"[\")) {\n if (stream.match(\"CDATA[\")) return chain(inBlock(\"atom\", \"]]>\"));\n else return null;\n } else if (stream.match(\"--\")) {\n return chain(inBlock(\"comment\", \"-->\"));\n } else if (stream.match(\"DOCTYPE\", true, true)) {\n stream.eatWhile(/[\\w\\._\\-]/);\n return chain(doctype(1));\n } else {\n return null;\n }\n } else if (stream.eat(\"?\")) {\n stream.eatWhile(/[\\w\\._\\-]/);\n state.tokenize = inBlock(\"meta\", \"?>\");\n return \"meta\";\n } else {\n type = stream.eat(\"/\") ? \"closeTag\" : \"openTag\";\n state.tokenize = inTag;\n return \"tag bracket\";\n }\n } else if (ch == \"&\") {\n var ok;\n if (stream.eat(\"#\")) {\n if (stream.eat(\"x\")) {\n ok = stream.eatWhile(/[a-fA-F\\d]/) && stream.eat(\";\");\n } else {\n ok = stream.eatWhile(/[\\d]/) && stream.eat(\";\");\n }\n } else {\n ok = stream.eatWhile(/[\\w\\.\\-:]/) && stream.eat(\";\");\n }\n return ok ? \"atom\" : \"error\";\n } else {\n stream.eatWhile(/[^&<]/);\n return null;\n }\n }\n inText.isInText = true;\n\n function inTag(stream, state) {\n var ch = stream.next();\n if (ch == \">\" || (ch == \"/\" && stream.eat(\">\"))) {\n state.tokenize = inText;\n type = ch == \">\" ? \"endTag\" : \"selfcloseTag\";\n return \"tag bracket\";\n } else if (ch == \"=\") {\n type = \"equals\";\n return null;\n } else if (ch == \"<\") {\n state.tokenize = inText;\n state.state = baseState;\n state.tagName = state.tagStart = null;\n var next = state.tokenize(stream, state);\n return next ? next + \" tag error\" : \"tag error\";\n } else if (/[\\'\\\"]/.test(ch)) {\n state.tokenize = inAttribute(ch);\n state.stringStartCol = stream.column();\n return state.tokenize(stream, state);\n } else {\n stream.match(/^[^\\s\\u00a0=<>\\\"\\']*[^\\s\\u00a0=<>\\\"\\'\\/]/);\n return \"word\";\n }\n }\n\n function inAttribute(quote) {\n var closure = function(stream, state) {\n while (!stream.eol()) {\n if (stream.next() == quote) {\n state.tokenize = inTag;\n break;\n }\n }\n return \"string\";\n };\n closure.isInAttribute = true;\n return closure;\n }\n\n function inBlock(style, terminator) {\n return function(stream, state) {\n while (!stream.eol()) {\n if (stream.match(terminator)) {\n state.tokenize = inText;\n break;\n }\n stream.next();\n }\n return style;\n }\n }\n\n function doctype(depth) {\n return function(stream, state) {\n var ch;\n while ((ch = stream.next()) != null) {\n if (ch == \"<\") {\n state.tokenize = doctype(depth + 1);\n return state.tokenize(stream, state);\n } else if (ch == \">\") {\n if (depth == 1) {\n state.tokenize = inText;\n break;\n } else {\n state.tokenize = doctype(depth - 1);\n return state.tokenize(stream, state);\n }\n }\n }\n return \"meta\";\n };\n }\n\n function Context(state, tagName, startOfLine) {\n this.prev = state.context;\n this.tagName = tagName;\n this.indent = state.indented;\n this.startOfLine = startOfLine;\n if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent))\n this.noIndent = true;\n }\n function popContext(state) {\n if (state.context) state.context = state.context.prev;\n }\n function maybePopContext(state, nextTagName) {\n var parentTagName;\n while (true) {\n if (!state.context) {\n return;\n }\n parentTagName = state.context.tagName;\n if (!config.contextGrabbers.hasOwnProperty(parentTagName) ||\n !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {\n return;\n }\n popContext(state);\n }\n }\n\n function baseState(type, stream, state) {\n if (type == \"openTag\") {\n state.tagStart = stream.column();\n return tagNameState;\n } else if (type == \"closeTag\") {\n return closeTagNameState;\n } else {\n return baseState;\n }\n }\n function tagNameState(type, stream, state) {\n if (type == \"word\") {\n state.tagName = stream.current();\n setStyle = \"tag\";\n return attrState;\n } else if (config.allowMissingTagName && type == \"endTag\") {\n setStyle = \"tag bracket\";\n return attrState(type, stream, state);\n } else {\n setStyle = \"error\";\n return tagNameState;\n }\n }\n function closeTagNameState(type, stream, state) {\n if (type == \"word\") {\n var tagName = stream.current();\n if (state.context && state.context.tagName != tagName &&\n config.implicitlyClosed.hasOwnProperty(state.context.tagName))\n popContext(state);\n if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) {\n setStyle = \"tag\";\n return closeState;\n } else {\n setStyle = \"tag error\";\n return closeStateErr;\n }\n } else if (config.allowMissingTagName && type == \"endTag\") {\n setStyle = \"tag bracket\";\n return closeState(type, stream, state);\n } else {\n setStyle = \"error\";\n return closeStateErr;\n }\n }\n\n function closeState(type, _stream, state) {\n if (type != \"endTag\") {\n setStyle = \"error\";\n return closeState;\n }\n popContext(state);\n return baseState;\n }\n function closeStateErr(type, stream, state) {\n setStyle = \"error\";\n return closeState(type, stream, state);\n }\n\n function attrState(type, _stream, state) {\n if (type == \"word\") {\n setStyle = \"attribute\";\n return attrEqState;\n } else if (type == \"endTag\" || type == \"selfcloseTag\") {\n var tagName = state.tagName, tagStart = state.tagStart;\n state.tagName = state.tagStart = null;\n if (type == \"selfcloseTag\" ||\n config.autoSelfClosers.hasOwnProperty(tagName)) {\n maybePopContext(state, tagName);\n } else {\n maybePopContext(state, tagName);\n state.context = new Context(state, tagName, tagStart == state.indented);\n }\n return baseState;\n }\n setStyle = \"error\";\n return attrState;\n }\n function attrEqState(type, stream, state) {\n if (type == \"equals\") return attrValueState;\n if (!config.allowMissing) setStyle = \"error\";\n return attrState(type, stream, state);\n }\n function attrValueState(type, stream, state) {\n if (type == \"string\") return attrContinuedState;\n if (type == \"word\" && config.allowUnquoted) {setStyle = \"string\"; return attrState;}\n setStyle = \"error\";\n return attrState(type, stream, state);\n }\n function attrContinuedState(type, stream, state) {\n if (type == \"string\") return attrContinuedState;\n return attrState(type, stream, state);\n }\n\n return {\n startState: function(baseIndent) {\n var state = {tokenize: inText,\n state: baseState,\n indented: baseIndent || 0,\n tagName: null, tagStart: null,\n context: null}\n if (baseIndent != null) state.baseIndent = baseIndent\n return state\n },\n\n token: function(stream, state) {\n if (!state.tagName && stream.sol())\n state.indented = stream.indentation();\n\n if (stream.eatSpace()) return null;\n type = null;\n var style = state.tokenize(stream, state);\n if ((style || type) && style != \"comment\") {\n setStyle = null;\n state.state = state.state(type || style, stream, state);\n if (setStyle)\n style = setStyle == \"error\" ? style + \" error\" : setStyle;\n }\n return style;\n },\n\n indent: function(state, textAfter, fullLine) {\n var context = state.context;\n // Indent multi-line strings (e.g. css).\n if (state.tokenize.isInAttribute) {\n if (state.tagStart == state.indented)\n return state.stringStartCol + 1;\n else\n return state.indented + indentUnit;\n }\n if (context && context.noIndent) return CodeMirror.Pass;\n if (state.tokenize != inTag && state.tokenize != inText)\n return fullLine ? fullLine.match(/^(\\s*)/)[0].length : 0;\n // Indent the starts of attribute names.\n if (state.tagName) {\n if (config.multilineTagIndentPastTag !== false)\n return state.tagStart + state.tagName.length + 2;\n else\n return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1);\n }\n if (config.alignCDATA && /$/,\n blockCommentStart: \"\",\n\n configuration: config.htmlMode ? \"html\" : \"xml\",\n helperType: config.htmlMode ? \"html\" : \"xml\",\n\n skipAttribute: function(state) {\n if (state.state == attrValueState)\n state.state = attrState\n }\n };\n});\n\nCodeMirror.defineMIME(\"text/xml\", \"xml\");\nCodeMirror.defineMIME(\"application/xml\", \"xml\");\nif (!CodeMirror.mimeModes.hasOwnProperty(\"text/html\"))\n CodeMirror.defineMIME(\"text/html\", {name: \"xml\", htmlMode: true});\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/xml/xml.js\n// module id = 729\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") { // CommonJS\n mod(require(\"../../lib/codemirror\"));\n } else if (typeof define == \"function\" && define.amd) { // AMD\n define([\"../../lib/codemirror\"], mod);\n } else { // Plain browser env\n mod(CodeMirror);\n }\n})(function(CodeMirror) {\n \"use strict\";\n\n var TOKEN_STYLES = {\n addition: \"positive\",\n attributes: \"attribute\",\n bold: \"strong\",\n cite: \"keyword\",\n code: \"atom\",\n definitionList: \"number\",\n deletion: \"negative\",\n div: \"punctuation\",\n em: \"em\",\n footnote: \"variable\",\n footCite: \"qualifier\",\n header: \"header\",\n html: \"comment\",\n image: \"string\",\n italic: \"em\",\n link: \"link\",\n linkDefinition: \"link\",\n list1: \"variable-2\",\n list2: \"variable-3\",\n list3: \"keyword\",\n notextile: \"string-2\",\n pre: \"operator\",\n p: \"property\",\n quote: \"bracket\",\n span: \"quote\",\n specialChar: \"tag\",\n strong: \"strong\",\n sub: \"builtin\",\n sup: \"builtin\",\n table: \"variable-3\",\n tableHeading: \"operator\"\n };\n\n function startNewLine(stream, state) {\n state.mode = Modes.newLayout;\n state.tableHeading = false;\n\n if (state.layoutType === \"definitionList\" && state.spanningLayout &&\n stream.match(RE(\"definitionListEnd\"), false))\n state.spanningLayout = false;\n }\n\n function handlePhraseModifier(stream, state, ch) {\n if (ch === \"_\") {\n if (stream.eat(\"_\"))\n return togglePhraseModifier(stream, state, \"italic\", /__/, 2);\n else\n return togglePhraseModifier(stream, state, \"em\", /_/, 1);\n }\n\n if (ch === \"*\") {\n if (stream.eat(\"*\")) {\n return togglePhraseModifier(stream, state, \"bold\", /\\*\\*/, 2);\n }\n return togglePhraseModifier(stream, state, \"strong\", /\\*/, 1);\n }\n\n if (ch === \"[\") {\n if (stream.match(/\\d+\\]/)) state.footCite = true;\n return tokenStyles(state);\n }\n\n if (ch === \"(\") {\n var spec = stream.match(/^(r|tm|c)\\)/);\n if (spec)\n return tokenStylesWith(state, TOKEN_STYLES.specialChar);\n }\n\n if (ch === \"<\" && stream.match(/(\\w+)[^>]+>[^<]+<\\/\\1>/))\n return tokenStylesWith(state, TOKEN_STYLES.html);\n\n if (ch === \"?\" && stream.eat(\"?\"))\n return togglePhraseModifier(stream, state, \"cite\", /\\?\\?/, 2);\n\n if (ch === \"=\" && stream.eat(\"=\"))\n return togglePhraseModifier(stream, state, \"notextile\", /==/, 2);\n\n if (ch === \"-\" && !stream.eat(\"-\"))\n return togglePhraseModifier(stream, state, \"deletion\", /-/, 1);\n\n if (ch === \"+\")\n return togglePhraseModifier(stream, state, \"addition\", /\\+/, 1);\n\n if (ch === \"~\")\n return togglePhraseModifier(stream, state, \"sub\", /~/, 1);\n\n if (ch === \"^\")\n return togglePhraseModifier(stream, state, \"sup\", /\\^/, 1);\n\n if (ch === \"%\")\n return togglePhraseModifier(stream, state, \"span\", /%/, 1);\n\n if (ch === \"@\")\n return togglePhraseModifier(stream, state, \"code\", /@/, 1);\n\n if (ch === \"!\") {\n var type = togglePhraseModifier(stream, state, \"image\", /(?:\\([^\\)]+\\))?!/, 1);\n stream.match(/^:\\S+/); // optional Url portion\n return type;\n }\n return tokenStyles(state);\n }\n\n function togglePhraseModifier(stream, state, phraseModifier, closeRE, openSize) {\n var charBefore = stream.pos > openSize ? stream.string.charAt(stream.pos - openSize - 1) : null;\n var charAfter = stream.peek();\n if (state[phraseModifier]) {\n if ((!charAfter || /\\W/.test(charAfter)) && charBefore && /\\S/.test(charBefore)) {\n var type = tokenStyles(state);\n state[phraseModifier] = false;\n return type;\n }\n } else if ((!charBefore || /\\W/.test(charBefore)) && charAfter && /\\S/.test(charAfter) &&\n stream.match(new RegExp(\"^.*\\\\S\" + closeRE.source + \"(?:\\\\W|$)\"), false)) {\n state[phraseModifier] = true;\n state.mode = Modes.attributes;\n }\n return tokenStyles(state);\n };\n\n function tokenStyles(state) {\n var disabled = textileDisabled(state);\n if (disabled) return disabled;\n\n var styles = [];\n if (state.layoutType) styles.push(TOKEN_STYLES[state.layoutType]);\n\n styles = styles.concat(activeStyles(\n state, \"addition\", \"bold\", \"cite\", \"code\", \"deletion\", \"em\", \"footCite\",\n \"image\", \"italic\", \"link\", \"span\", \"strong\", \"sub\", \"sup\", \"table\", \"tableHeading\"));\n\n if (state.layoutType === \"header\")\n styles.push(TOKEN_STYLES.header + \"-\" + state.header);\n\n return styles.length ? styles.join(\" \") : null;\n }\n\n function textileDisabled(state) {\n var type = state.layoutType;\n\n switch(type) {\n case \"notextile\":\n case \"code\":\n case \"pre\":\n return TOKEN_STYLES[type];\n default:\n if (state.notextile)\n return TOKEN_STYLES.notextile + (type ? (\" \" + TOKEN_STYLES[type]) : \"\");\n return null;\n }\n }\n\n function tokenStylesWith(state, extraStyles) {\n var disabled = textileDisabled(state);\n if (disabled) return disabled;\n\n var type = tokenStyles(state);\n if (extraStyles)\n return type ? (type + \" \" + extraStyles) : extraStyles;\n else\n return type;\n }\n\n function activeStyles(state) {\n var styles = [];\n for (var i = 1; i < arguments.length; ++i) {\n if (state[arguments[i]])\n styles.push(TOKEN_STYLES[arguments[i]]);\n }\n return styles;\n }\n\n function blankLine(state) {\n var spanningLayout = state.spanningLayout, type = state.layoutType;\n\n for (var key in state) if (state.hasOwnProperty(key))\n delete state[key];\n\n state.mode = Modes.newLayout;\n if (spanningLayout) {\n state.layoutType = type;\n state.spanningLayout = true;\n }\n }\n\n var REs = {\n cache: {},\n single: {\n bc: \"bc\",\n bq: \"bq\",\n definitionList: /- .*?:=+/,\n definitionListEnd: /.*=:\\s*$/,\n div: \"div\",\n drawTable: /\\|.*\\|/,\n foot: /fn\\d+/,\n header: /h[1-6]/,\n html: /\\s*<(?:\\/)?(\\w+)(?:[^>]+)?>(?:[^<]+<\\/\\1>)?/,\n link: /[^\"]+\":\\S/,\n linkDefinition: /\\[[^\\s\\]]+\\]\\S+/,\n list: /(?:#+|\\*+)/,\n notextile: \"notextile\",\n para: \"p\",\n pre: \"pre\",\n table: \"table\",\n tableCellAttributes: /[\\/\\\\]\\d+/,\n tableHeading: /\\|_\\./,\n tableText: /[^\"_\\*\\[\\(\\?\\+~\\^%@|-]+/,\n text: /[^!\"_=\\*\\[\\(<\\?\\+~\\^%@-]+/\n },\n attributes: {\n align: /(?:<>|<|>|=)/,\n selector: /\\([^\\(][^\\)]+\\)/,\n lang: /\\[[^\\[\\]]+\\]/,\n pad: /(?:\\(+|\\)+){1,2}/,\n css: /\\{[^\\}]+\\}/\n },\n createRe: function(name) {\n switch (name) {\n case \"drawTable\":\n return REs.makeRe(\"^\", REs.single.drawTable, \"$\");\n case \"html\":\n return REs.makeRe(\"^\", REs.single.html, \"(?:\", REs.single.html, \")*\", \"$\");\n case \"linkDefinition\":\n return REs.makeRe(\"^\", REs.single.linkDefinition, \"$\");\n case \"listLayout\":\n return REs.makeRe(\"^\", REs.single.list, RE(\"allAttributes\"), \"*\\\\s+\");\n case \"tableCellAttributes\":\n return REs.makeRe(\"^\", REs.choiceRe(REs.single.tableCellAttributes,\n RE(\"allAttributes\")), \"+\\\\.\");\n case \"type\":\n return REs.makeRe(\"^\", RE(\"allTypes\"));\n case \"typeLayout\":\n return REs.makeRe(\"^\", RE(\"allTypes\"), RE(\"allAttributes\"),\n \"*\\\\.\\\\.?\", \"(\\\\s+|$)\");\n case \"attributes\":\n return REs.makeRe(\"^\", RE(\"allAttributes\"), \"+\");\n\n case \"allTypes\":\n return REs.choiceRe(REs.single.div, REs.single.foot,\n REs.single.header, REs.single.bc, REs.single.bq,\n REs.single.notextile, REs.single.pre, REs.single.table,\n REs.single.para);\n\n case \"allAttributes\":\n return REs.choiceRe(REs.attributes.selector, REs.attributes.css,\n REs.attributes.lang, REs.attributes.align, REs.attributes.pad);\n\n default:\n return REs.makeRe(\"^\", REs.single[name]);\n }\n },\n makeRe: function() {\n var pattern = \"\";\n for (var i = 0; i < arguments.length; ++i) {\n var arg = arguments[i];\n pattern += (typeof arg === \"string\") ? arg : arg.source;\n }\n return new RegExp(pattern);\n },\n choiceRe: function() {\n var parts = [arguments[0]];\n for (var i = 1; i < arguments.length; ++i) {\n parts[i * 2 - 1] = \"|\";\n parts[i * 2] = arguments[i];\n }\n\n parts.unshift(\"(?:\");\n parts.push(\")\");\n return REs.makeRe.apply(null, parts);\n }\n };\n\n function RE(name) {\n return (REs.cache[name] || (REs.cache[name] = REs.createRe(name)));\n }\n\n var Modes = {\n newLayout: function(stream, state) {\n if (stream.match(RE(\"typeLayout\"), false)) {\n state.spanningLayout = false;\n return (state.mode = Modes.blockType)(stream, state);\n }\n var newMode;\n if (!textileDisabled(state)) {\n if (stream.match(RE(\"listLayout\"), false))\n newMode = Modes.list;\n else if (stream.match(RE(\"drawTable\"), false))\n newMode = Modes.table;\n else if (stream.match(RE(\"linkDefinition\"), false))\n newMode = Modes.linkDefinition;\n else if (stream.match(RE(\"definitionList\")))\n newMode = Modes.definitionList;\n else if (stream.match(RE(\"html\"), false))\n newMode = Modes.html;\n }\n return (state.mode = (newMode || Modes.text))(stream, state);\n },\n\n blockType: function(stream, state) {\n var match, type;\n state.layoutType = null;\n\n if (match = stream.match(RE(\"type\")))\n type = match[0];\n else\n return (state.mode = Modes.text)(stream, state);\n\n if (match = type.match(RE(\"header\"))) {\n state.layoutType = \"header\";\n state.header = parseInt(match[0][1]);\n } else if (type.match(RE(\"bq\"))) {\n state.layoutType = \"quote\";\n } else if (type.match(RE(\"bc\"))) {\n state.layoutType = \"code\";\n } else if (type.match(RE(\"foot\"))) {\n state.layoutType = \"footnote\";\n } else if (type.match(RE(\"notextile\"))) {\n state.layoutType = \"notextile\";\n } else if (type.match(RE(\"pre\"))) {\n state.layoutType = \"pre\";\n } else if (type.match(RE(\"div\"))) {\n state.layoutType = \"div\";\n } else if (type.match(RE(\"table\"))) {\n state.layoutType = \"table\";\n }\n\n state.mode = Modes.attributes;\n return tokenStyles(state);\n },\n\n text: function(stream, state) {\n if (stream.match(RE(\"text\"))) return tokenStyles(state);\n\n var ch = stream.next();\n if (ch === '\"')\n return (state.mode = Modes.link)(stream, state);\n return handlePhraseModifier(stream, state, ch);\n },\n\n attributes: function(stream, state) {\n state.mode = Modes.layoutLength;\n\n if (stream.match(RE(\"attributes\")))\n return tokenStylesWith(state, TOKEN_STYLES.attributes);\n else\n return tokenStyles(state);\n },\n\n layoutLength: function(stream, state) {\n if (stream.eat(\".\") && stream.eat(\".\"))\n state.spanningLayout = true;\n\n state.mode = Modes.text;\n return tokenStyles(state);\n },\n\n list: function(stream, state) {\n var match = stream.match(RE(\"list\"));\n state.listDepth = match[0].length;\n var listMod = (state.listDepth - 1) % 3;\n if (!listMod)\n state.layoutType = \"list1\";\n else if (listMod === 1)\n state.layoutType = \"list2\";\n else\n state.layoutType = \"list3\";\n\n state.mode = Modes.attributes;\n return tokenStyles(state);\n },\n\n link: function(stream, state) {\n state.mode = Modes.text;\n if (stream.match(RE(\"link\"))) {\n stream.match(/\\S+/);\n return tokenStylesWith(state, TOKEN_STYLES.link);\n }\n return tokenStyles(state);\n },\n\n linkDefinition: function(stream, state) {\n stream.skipToEnd();\n return tokenStylesWith(state, TOKEN_STYLES.linkDefinition);\n },\n\n definitionList: function(stream, state) {\n stream.match(RE(\"definitionList\"));\n\n state.layoutType = \"definitionList\";\n\n if (stream.match(/\\s*$/))\n state.spanningLayout = true;\n else\n state.mode = Modes.attributes;\n\n return tokenStyles(state);\n },\n\n html: function(stream, state) {\n stream.skipToEnd();\n return tokenStylesWith(state, TOKEN_STYLES.html);\n },\n\n table: function(stream, state) {\n state.layoutType = \"table\";\n return (state.mode = Modes.tableCell)(stream, state);\n },\n\n tableCell: function(stream, state) {\n if (stream.match(RE(\"tableHeading\")))\n state.tableHeading = true;\n else\n stream.eat(\"|\");\n\n state.mode = Modes.tableCellAttributes;\n return tokenStyles(state);\n },\n\n tableCellAttributes: function(stream, state) {\n state.mode = Modes.tableText;\n\n if (stream.match(RE(\"tableCellAttributes\")))\n return tokenStylesWith(state, TOKEN_STYLES.attributes);\n else\n return tokenStyles(state);\n },\n\n tableText: function(stream, state) {\n if (stream.match(RE(\"tableText\")))\n return tokenStyles(state);\n\n if (stream.peek() === \"|\") { // end of cell\n state.mode = Modes.tableCell;\n return tokenStyles(state);\n }\n return handlePhraseModifier(stream, state, stream.next());\n }\n };\n\n CodeMirror.defineMode(\"textile\", function() {\n return {\n startState: function() {\n return { mode: Modes.newLayout };\n },\n token: function(stream, state) {\n if (stream.sol()) startNewLine(stream, state);\n return state.mode(stream, state);\n },\n blankLine: blankLine\n };\n });\n\n CodeMirror.defineMIME(\"text/x-textile\", \"textile\");\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/textile/textile.js\n// module id = 730\n// module chunks = 3 4 5 7 8 14","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n(function(mod) {\n if (typeof exports == \"object\" && typeof module == \"object\") // CommonJS\n mod(require(\"../../lib/codemirror\"));\n else if (typeof define == \"function\" && define.amd) // AMD\n define([\"../../lib/codemirror\"], mod);\n else // Plain browser env\n mod(CodeMirror);\n})(function(CodeMirror) {\n\"use strict\";\n\nCodeMirror.defineMode('shell', function() {\n\n var words = {};\n function define(style, dict) {\n for(var i = 0; i < dict.length; i++) {\n words[dict[i]] = style;\n }\n };\n\n var commonAtoms = [\"true\", \"false\"];\n var commonKeywords = [\"if\", \"then\", \"do\", \"else\", \"elif\", \"while\", \"until\", \"for\", \"in\", \"esac\", \"fi\",\n \"fin\", \"fil\", \"done\", \"exit\", \"set\", \"unset\", \"export\", \"function\"];\n var commonCommands = [\"ab\", \"awk\", \"bash\", \"beep\", \"cat\", \"cc\", \"cd\", \"chown\", \"chmod\", \"chroot\", \"clear\",\n \"cp\", \"curl\", \"cut\", \"diff\", \"echo\", \"find\", \"gawk\", \"gcc\", \"get\", \"git\", \"grep\", \"hg\", \"kill\", \"killall\",\n \"ln\", \"ls\", \"make\", \"mkdir\", \"openssl\", \"mv\", \"nc\", \"nl\", \"node\", \"npm\", \"ping\", \"ps\", \"restart\", \"rm\",\n \"rmdir\", \"sed\", \"service\", \"sh\", \"shopt\", \"shred\", \"source\", \"sort\", \"sleep\", \"ssh\", \"start\", \"stop\",\n \"su\", \"sudo\", \"svn\", \"tee\", \"telnet\", \"top\", \"touch\", \"vi\", \"vim\", \"wall\", \"wc\", \"wget\", \"who\", \"write\",\n \"yes\", \"zsh\"];\n\n CodeMirror.registerHelper(\"hintWords\", \"shell\", commonAtoms.concat(commonKeywords, commonCommands));\n\n define('atom', commonAtoms);\n define('keyword', commonKeywords);\n define('builtin', commonCommands);\n\n function tokenBase(stream, state) {\n if (stream.eatSpace()) return null;\n\n var sol = stream.sol();\n var ch = stream.next();\n\n if (ch === '\\\\') {\n stream.next();\n return null;\n }\n if (ch === '\\'' || ch === '\"' || ch === '`') {\n state.tokens.unshift(tokenString(ch, ch === \"`\" ? \"quote\" : \"string\"));\n return tokenize(stream, state);\n }\n if (ch === '#') {\n if (sol && stream.eat('!')) {\n stream.skipToEnd();\n return 'meta'; // 'comment'?\n }\n stream.skipToEnd();\n return 'comment';\n }\n if (ch === '$') {\n state.tokens.unshift(tokenDollar);\n return tokenize(stream, state);\n }\n if (ch === '+' || ch === '=') {\n return 'operator';\n }\n if (ch === '-') {\n stream.eat('-');\n stream.eatWhile(/\\w/);\n return 'attribute';\n }\n if (/\\d/.test(ch)) {\n stream.eatWhile(/\\d/);\n if(stream.eol() || !/\\w/.test(stream.peek())) {\n return 'number';\n }\n }\n stream.eatWhile(/[\\w-]/);\n var cur = stream.current();\n if (stream.peek() === '=' && /\\w+/.test(cur)) return 'def';\n return words.hasOwnProperty(cur) ? words[cur] : null;\n }\n\n function tokenString(quote, style) {\n var close = quote == \"(\" ? \")\" : quote == \"{\" ? \"}\" : quote\n return function(stream, state) {\n var next, escaped = false;\n while ((next = stream.next()) != null) {\n if (next === close && !escaped) {\n state.tokens.shift();\n break;\n } else if (next === '$' && !escaped && quote !== \"'\" && stream.peek() != close) {\n escaped = true;\n stream.backUp(1);\n state.tokens.unshift(tokenDollar);\n break;\n } else if (!escaped && quote !== close && next === quote) {\n state.tokens.unshift(tokenString(quote, style))\n return tokenize(stream, state)\n } else if (!escaped && /['\"]/.test(next) && !/['\"]/.test(quote)) {\n state.tokens.unshift(tokenStringStart(next, \"string\"));\n stream.backUp(1);\n break;\n }\n escaped = !escaped && next === '\\\\';\n }\n return style;\n };\n };\n\n function tokenStringStart(quote, style) {\n return function(stream, state) {\n state.tokens[0] = tokenString(quote, style)\n stream.next()\n return tokenize(stream, state)\n }\n }\n\n var tokenDollar = function(stream, state) {\n if (state.tokens.length > 1) stream.eat('$');\n var ch = stream.next()\n if (/['\"({]/.test(ch)) {\n state.tokens[0] = tokenString(ch, ch == \"(\" ? \"quote\" : ch == \"{\" ? \"def\" : \"string\");\n return tokenize(stream, state);\n }\n if (!/\\d/.test(ch)) stream.eatWhile(/\\w/);\n state.tokens.shift();\n return 'def';\n };\n\n function tokenize(stream, state) {\n return (state.tokens[0] || tokenBase) (stream, state);\n };\n\n return {\n startState: function() {return {tokens:[]};},\n token: function(stream, state) {\n return tokenize(stream, state);\n },\n closeBrackets: \"()[]{}''\\\"\\\"``\",\n lineComment: '#',\n fold: \"brace\"\n };\n});\n\nCodeMirror.defineMIME('text/x-sh', 'shell');\n// Apache uses a slightly different Media Type for Shell scripts\n// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types\nCodeMirror.defineMIME('application/x-sh', 'shell');\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/mode/shell/shell.js\n// module id = 731\n// module chunks = 3 4 5 7 8 14","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-17a2306c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./email.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./email.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./email.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-17a2306c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./email.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue\n// module id = 734\n// module chunks = 0 3 4 5 6","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/dag.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Vue from 'vue'\nimport $ from 'jquery'\nimport _ from 'lodash'\nimport i18n from '@/module/i18n'\nimport { jsPlumb } from 'jsplumb'\nimport DragZoom from './dragZoom'\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\nimport Permissions from '@/module/permissions'\nimport { uuid, findComponentDownward } from '@/module/util/'\nimport {\n tasksAll,\n rtTasksTpl,\n setSvgColor,\n saveTargetarr,\n rtTargetarrArr } from './util'\nimport mStart from '@/conf/home/pages/projects/pages/definition/pages/list/_source/start'\n\nlet JSP = function () {\n this.dag = {}\n this.selectedElement = {}\n\n this.config = {\n // Whether to drag\n isDrag: true,\n // Whether to allow connection\n isAttachment: false,\n // Whether to drag a new node\n isNewNodes: true,\n // Whether to support double-click node events\n isDblclick: true,\n // Whether to support right-click menu events\n isContextmenu: true,\n // Whether to allow click events\n isClick: false\n }\n}\n\n/**\n * dag init\n */\nJSP.prototype.init = function ({ dag, instance }) {\n // Get the dag component instance\n this.dag = dag\n // Get jsplumb instance\n this.JspInstance = instance\n // Register jsplumb connection type and configuration\n this.JspInstance.registerConnectionType('basic', {\n anchor: 'Continuous',\n connector: 'Straight' // Line type\n })\n\n // Initial configuration\n this.setConfig({\n isDrag: !store.state.dag.isDetails,\n isAttachment: false,\n isNewNodes: Permissions.getAuth() === false ? false : !store.state.dag.isDetails,\n isDblclick: true,\n isContextmenu: true,\n isClick: false\n })\n\n // Monitor line click\n this.JspInstance.bind('click', e => {\n if (this.config.isClick) {\n this.connectClick(e)\n }\n })\n\n // Drag and drop\n if (this.config.isNewNodes) {\n DragZoom.init()\n }\n}\n\n/**\n * set config attribute\n */\nJSP.prototype.setConfig = function (o) {\n this.config = Object.assign(this.config, {}, o)\n}\n\n/**\n * Node binding event\n */\nJSP.prototype.tasksEvent = function (selfId) {\n let tasks = $(`#${selfId}`)\n // Bind right event\n tasks.on('contextmenu', e => {\n this.tasksContextmenu(e)\n return false\n })\n\n // Binding double click event\n tasks.find('.icos').bind('dblclick', e => {\n this.tasksDblclick(e)\n })\n\n // Binding click event\n tasks.on('click', e => {\n this.tasksClick(e)\n })\n}\n\n/**\n * Dag node drag and drop processing\n */\nJSP.prototype.draggable = function () {\n if (this.config.isNewNodes) {\n let selfId\n let self = this\n $('.toolbar-btn .roundedRect').draggable({\n scope: 'plant',\n helper: 'clone',\n containment: $('.dag-model'),\n stop: function (e, ui) {\n self.tasksEvent(selfId)\n\n // Dom structure is not generated without pop-up form form\n if ($(`#${selfId}`).html()) {\n // dag event\n findComponentDownward(self.dag.$root, 'dag-chart')._createNodes({\n id: selfId\n })\n }\n },\n drag: function () {\n $('body').find('.tooltip.fade.top.in').remove()\n }\n })\n\n $('#canvas').droppable({\n scope: 'plant',\n drop: function (ev, ui) {\n let id = 'tasks-' + Math.ceil(Math.random() * 100000) // eslint-disable-line\n // Get mouse coordinates\n let left = parseInt(ui.offset.left - $(this).offset().left)\n let top = parseInt(ui.offset.top - $(this).offset().top) - 10\n if (top < 25) {\n top = 25\n }\n // Generate template node\n $('#canvas').append(rtTasksTpl({\n id: id,\n name: id,\n x: left,\n y: top,\n isAttachment: self.config.isAttachment,\n taskType: findComponentDownward(self.dag.$root, 'dag-chart').dagBarId\n }))\n\n // Get the generated node\n let thisDom = jsPlumb.getSelector('.statemachine-demo .w')\n\n // Generating a connection node\n self.JspInstance.batch(() => {\n self.initNode(thisDom[thisDom.length - 1])\n })\n selfId = id\n }\n })\n }\n}\n\n/**\n * Echo json processing and old data structure processing\n */\nJSP.prototype.jsonHandle = function ({ largeJson, locations }) {\n _.map(largeJson, v => {\n // Generate template\n $('#canvas').append(rtTasksTpl({\n id: v.id,\n name: v.name,\n x: locations[v.id]['x'],\n y: locations[v.id]['y'],\n targetarr: locations[v.id]['targetarr'],\n isAttachment: this.config.isAttachment,\n taskType: v.type,\n runFlag:v.runFlag\n }))\n\n // contextmenu event\n $(`#${v.id}`).on('contextmenu', e => {\n this.tasksContextmenu(e)\n return false\n })\n\n // dblclick event\n $(`#${v.id}`).find('.icos').bind('dblclick', e => {\n this.tasksDblclick(e)\n })\n\n // click event\n $(`#${v.id}`).bind('click', e => {\n this.tasksClick(e)\n })\n })\n}\n\n/**\n * Initialize a single node\n */\nJSP.prototype.initNode = function (el) {\n // Whether to drag\n if (this.config.isDrag) {\n this.JspInstance.draggable(el, {\n containment: 'dag-container'\n })\n }\n\n // Node attribute configuration\n this.JspInstance.makeSource(el, {\n filter: '.ep',\n anchor: 'Continuous',\n connectorStyle: {\n stroke: '#555',\n strokeWidth: 2,\n outlineStroke: 'transparent',\n outlineWidth: 4\n },\n // This place is leaking\n // connectionType: \"basic\",\n extract: {\n action: 'the-action'\n },\n maxConnections: -1\n })\n\n // Node connection property configuration\n this.JspInstance.makeTarget(el, {\n dropOptions: { hoverClass: 'dragHover' },\n anchor: 'Continuous',\n allowLoopback: false // Forbid yourself to connect yourself\n })\n this.JspInstance.fire('jsPlumbDemoNodeAdded', el)\n}\n\n/**\n * Node right click menu\n */\nJSP.prototype.tasksContextmenu = function (event) {\n if (this.config.isContextmenu) {\n let routerName = router.history.current.name\n // state\n let isOne = routerName === 'projects-definition-details' && this.dag.releaseState !== 'NOT_RELEASE'\n // hide\n let isTwo = store.state.dag.isDetails\n\n let html = [\n `${i18n.$t('开始运行')}`,\n `${i18n.$t('编辑节点')}`,\n `${i18n.$t('复制节点')}`,\n `${i18n.$t('删除节点')}`\n ]\n\n let operationHtml = () => {\n return html.splice(',')\n }\n\n let e = event\n let $id = e.currentTarget.id\n let $contextmenu = $('#contextmenu')\n let $name = $(`#${$id}`).find('.name-p').text()\n let $left = e.pageX + document.body.scrollLeft - 5\n let $top = e.pageY + document.body.scrollTop - 5\n $contextmenu.css({\n left: $left,\n top: $top,\n visibility: 'visible'\n })\n // Action bar\n $contextmenu.html('').append(operationHtml)\n\n if (isOne) {\n // start run\n $('#startRunning').on('click', () => {\n let id = router.history.current.params.id\n store.dispatch('dag/getStartCheck', { processDefinitionId: id }).then(res => {\n let modal = Vue.$modal.dialog({\n closable: false,\n showMask: true,\n escClose: true,\n className: 'v-modal-custom',\n transitionName: 'opacityp',\n render (h) {\n return h(mStart, {\n on: {\n onUpdate () {\n modal.remove()\n },\n close () {\n modal.remove()\n }\n },\n props: {\n item: {\n id: id\n },\n startNodeList: $name,\n sourceType: 'contextmenu'\n }\n })\n }\n })\n }).catch(e => {\n Vue.$message.error(e.msg || '')\n })\n })\n }\n if (!isTwo) {\n // edit node\n $(`#editNodes`).click(ev => {\n findComponentDownward(this.dag.$root, 'dag-chart')._createNodes({\n id: $id,\n type: $(`#${$id}`).attr('data-tasks-type')\n })\n })\n // delete node\n $('#removeNodes').click(ev => {\n this.removeNodes($id)\n })\n\n // copy node\n $('#copyNodes').click(res => {\n this.copyNodes($id)\n })\n }\n }\n}\n\n/**\n * Node double click event\n */\nJSP.prototype.tasksDblclick = function (e) {\n // Untie event\n if (this.config.isDblclick) {\n let id = $(e.currentTarget.offsetParent).attr('id')\n\n findComponentDownward(this.dag.$root, 'dag-chart')._createNodes({\n id: id,\n type: $(`#${id}`).attr('data-tasks-type')\n })\n }\n}\n\n/**\n * Node click event\n */\nJSP.prototype.tasksClick = function (e) {\n let $id\n let self = this\n let $body = $(`body`)\n if (this.config.isClick) {\n let $connect = this.selectedElement.connect\n $('.w').removeClass('jtk-tasks-active')\n $(e.currentTarget).addClass('jtk-tasks-active')\n if ($connect) {\n setSvgColor($connect, '#555')\n this.selectedElement.connect = null\n }\n this.selectedElement.id = $(e.currentTarget).attr('id')\n\n // Unbind copy and paste events\n $body.unbind('copy').unbind('paste')\n // Copy binding id\n $id = self.selectedElement.id\n\n $body.bind({\n copy: function () {\n $id = self.selectedElement.id\n },\n paste: function () {\n $id && self.copyNodes($id)\n }\n })\n }\n}\n\n/**\n * Remove binding events\n * paste\n */\nJSP.prototype.removePaste = function () {\n let $body = $(`body`)\n // Unbind copy and paste events\n $body.unbind('copy').unbind('paste')\n // Remove selected node parameters\n this.selectedElement.id = null\n // Remove node selection effect\n $('.w').removeClass('jtk-tasks-active')\n}\n\n/**\n * Line click event\n */\nJSP.prototype.connectClick = function (e) {\n // Set svg color\n setSvgColor(e, '#0097e0')\n let $id = this.selectedElement.id\n if ($id) {\n $(`#${$id}`).removeClass('jtk-tasks-active')\n this.selectedElement.id = null\n }\n this.selectedElement.connect = e\n}\n\n/**\n * toolbarEvent\n * @param {Pointer}\n */\nJSP.prototype.handleEventPointer = function (is) {\n let wDom = $('.w')\n this.setConfig({\n isClick: is,\n isAttachment: false\n })\n wDom.removeClass('jtk-ep')\n if (!is) {\n wDom.removeClass('jtk-tasks-active')\n this.selectedElement = {}\n _.map($('#canvas svg'), v => {\n if ($(v).attr('class')) {\n _.map($(v).find('path'), v1 => {\n $(v1).attr('fill', '#555')\n $(v1).attr('stroke', '#555')\n })\n }\n })\n }\n}\n\n/**\n * toolbarEvent\n * @param {Line}\n */\nJSP.prototype.handleEventLine = function (is) {\n let wDom = $('.w')\n this.setConfig({\n isAttachment: is\n })\n is ? wDom.addClass('jtk-ep') : wDom.removeClass('jtk-ep')\n}\n\n/**\n * toolbarEvent\n * @param {Remove}\n */\nJSP.prototype.handleEventRemove = function () {\n let $id = this.selectedElement.id || null\n let $connect = this.selectedElement.connect || null\n if ($id) {\n this.removeNodes(this.selectedElement.id)\n } else {\n this.removeConnect($connect)\n }\n\n // Monitor whether to edit DAG\n store.commit('dag/setIsEditDag', true)\n}\n\n/**\n * Delete node\n */\nJSP.prototype.removeNodes = function ($id) {\n // Delete node processing(data-targetarr)\n _.map(tasksAll(), v => {\n let targetarr = v.targetarr.split(',')\n if (targetarr.length) {\n let newArr = _.filter(targetarr, v1 => v1 !== $id)\n $(`#${v.id}`).attr('data-targetarr', newArr.toString())\n }\n })\n // delete node\n this.JspInstance.remove($id)\n}\n\n/**\n * Delete connection\n */\nJSP.prototype.removeConnect = function ($connect) {\n if (!$connect) {\n return\n }\n // Remove connections and remove node and node dependencies\n let targetId = $connect.targetId\n let sourceId = $connect.sourceId\n let targetarr = rtTargetarrArr(targetId)\n if (targetarr.length) {\n targetarr = _.filter(targetarr, v => v !== sourceId)\n $(`#${targetId}`).attr('data-targetarr', targetarr.toString())\n }\n this.JspInstance.deleteConnection($connect)\n\n this.selectedElement = {}\n}\n\n/**\n * Copy node\n */\nJSP.prototype.copyNodes = function ($id) {\n let newNodeInfo = _.cloneDeep(_.find(store.state.dag.tasks, v => v.id === $id))\n let newNodePors = store.state.dag.locations[$id]\n // Unstored nodes do not allow replication\n if (!newNodePors) {\n return\n }\n // Generate random id\n let newUuId = `${uuid() + uuid()}`\n let id = newNodeInfo.id.length > 8 ? newNodeInfo.id.substr(0, 7) : newNodeInfo.id\n let name = newNodeInfo.name.length > 8 ? newNodeInfo.name.substr(0, 7) : newNodeInfo.name\n\n // new id\n let newId = `${id || ''}-${newUuId}`\n // new name\n let newName = `${name || ''}-${newUuId}`\n // coordinate x\n let newX = newNodePors.x + 100\n // coordinate y\n let newY = newNodePors.y + 40\n\n // Generate template node\n $('#canvas').append(rtTasksTpl({\n id: newId,\n name: newName,\n x: newX,\n y: newY,\n isAttachment: this.config.isAttachment,\n taskType: newNodeInfo.type\n }))\n\n // Get the generated node\n let thisDom = jsPlumb.getSelector('.statemachine-demo .w')\n\n // Copy node information\n newNodeInfo = Object.assign(newNodeInfo, {\n id: newId,\n name: newName\n })\n\n // Add new node\n store.commit('dag/addTasks', newNodeInfo)\n // Add node location information\n store.commit('dag/setLocations', {\n [newId]: {\n name: newName,\n targetarr: '',\n x: newX,\n y: newY\n }\n })\n\n // Generating a connection node\n this.JspInstance.batch(() => {\n this.initNode(thisDom[thisDom.length - 1])\n // Add events to nodes\n this.tasksEvent(newId)\n })\n}\n/**\n * toolbarEvent\n * @param {Screen}\n */\nJSP.prototype.handleEventScreen = function ({ item, is }) {\n let screenOpen = true\n if (is) {\n item.icon = ''\n screenOpen = true\n } else {\n item.icon = ''\n screenOpen = false\n }\n let $mainLayoutModel = $('.main-layout-model')\n if (screenOpen) {\n $mainLayoutModel.addClass('dag-screen')\n } else {\n $mainLayoutModel.removeClass('dag-screen')\n }\n}\n/**\n * save task\n * @param tasks\n * @param locations\n * @param connects\n */\nJSP.prototype.saveStore = function () {\n return new Promise((resolve, reject) => {\n let connects = []\n let locations = {}\n let tasks = []\n\n let is = (id) => {\n return !!_.filter(tasksAll(), v => v.id === id).length\n }\n\n // task\n _.map(_.cloneDeep(store.state.dag.tasks), v => {\n if (is(v.id)) {\n let preTasks = []\n let id = $(`#${v.id}`)\n let tar = id.attr('data-targetarr')\n let idDep = tar ? id.attr('data-targetarr').split(',') : []\n if (idDep.length) {\n _.map(idDep, v1 => {\n preTasks.push($(`#${v1}`).find('.name-p').text())\n })\n }\n\n let tasksParam = _.assign(v, {\n preTasks: preTasks\n })\n\n // Sub-workflow has no retries and interval\n if (v.type === 'SUB_PROCESS') {\n tasksParam = _.omit(tasksParam, ['maxRetryTimes', 'retryInterval'])\n }\n\n tasks.push(tasksParam)\n }\n })\n\n _.map(this.JspInstance.getConnections(), v => {\n connects.push({\n 'endPointSourceId': v.sourceId,\n 'endPointTargetId': v.targetId\n })\n })\n\n _.map(tasksAll(), v => {\n locations[v.id] = {\n name: v.name,\n targetarr: v.targetarr,\n x: v.x,\n y: v.y\n }\n })\n\n // Storage node\n store.commit('dag/setTasks', tasks)\n // Store coordinate information\n store.commit('dag/setLocations', locations)\n // Storage line dependence\n store.commit('dag/setConnects', connects)\n\n resolve({\n connects: connects,\n tasks: tasks,\n locations: locations\n })\n })\n}\n/**\n * Event processing\n */\nJSP.prototype.handleEvent = function () {\n this.JspInstance.bind('beforeDrop', function (info) {\n let sourceId = info['sourceId']// 出\n let targetId = info['targetId']// 入\n\n /**\n * Recursive search for nodes\n */\n let recursiveVal\n const recursiveTargetarr = (arr, targetId) => {\n for (var i in arr) {\n if (arr[i] === targetId) {\n recursiveVal = targetId\n } else {\n let recTargetarrArr = rtTargetarrArr(arr[i])\n if (recTargetarrArr.length) {\n recursiveTargetarr(recTargetarrArr, targetId)\n } else {\n return recursiveTargetarr(targetId)\n }\n }\n }\n return recursiveVal\n }\n\n // Connection to connected nodes is not allowed\n if (_.findIndex(rtTargetarrArr(targetId), v => v === sourceId) !== -1) {\n return false\n }\n\n // Recursive form to find if the target Targetarr has a sourceId\n if (recursiveTargetarr(rtTargetarrArr(sourceId), targetId)) {\n // setRecursiveVal(null)\n return false\n }\n\n // Storage node dependency information\n saveTargetarr(sourceId, targetId)\n\n // Monitor whether to edit DAG\n store.commit('dag/setIsEditDag', true)\n\n return true\n })\n}\n/**\n * Backfill data processing\n */\nJSP.prototype.jspBackfill = function ({ connects, locations, largeJson }) {\n // Backfill nodes\n this.jsonHandle({\n largeJson: largeJson,\n locations: locations\n })\n\n let wNodes = jsPlumb.getSelector('.statemachine-demo .w')\n\n // Backfill line\n this.JspInstance.batch(() => {\n for (let i = 0; i < wNodes.length; i++) {\n this.initNode(wNodes[i])\n }\n _.map(connects, v => {\n let sourceId = v.endPointSourceId.split('-')\n let targetId = v.endPointTargetId.split('-')\n if (sourceId.length === 4 && targetId.length === 4) {\n sourceId = `${sourceId[0]}-${sourceId[1]}-${sourceId[2]}`\n targetId = `${targetId[0]}-${targetId[1]}-${targetId[2]}`\n } else {\n sourceId = v.endPointSourceId\n targetId = v.endPointTargetId\n }\n\n this.JspInstance.connect({\n source: sourceId,\n target: targetId,\n type: 'basic',\n paintStyle: { strokeWidth: 2, stroke: '#555' }\n })\n })\n })\n\n jsPlumb.fire('jsPlumbDemoLoaded', this.JspInstance)\n\n // Connection monitoring\n this.handleEvent()\n\n // Drag and drop new nodes\n this.draggable()\n}\n\nexport default new JSP()\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/plugIn/jsPlumbHandle.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/udp/udp.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/localParams.vue","\nimport Vue from 'vue'\nimport mAffirm from './jumpAffirm'\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\nimport { uuid, findComponentDownward } from '@/module/util/'\n\nlet Affirm = {}\nlet $root = {}\nlet $routerType = ''\nlet $isPop = true\n\n/**\n * Listen for route changes\n */\nrouter.beforeEach((to, from, next) => {\n if (from.name === 'projects-definition-details' || from.name === 'projects-instance-details' || from.name === 'definition-create') {\n if (!Affirm.paramVerification(from.name)) {\n Affirm.isPop(() => {\n next()\n })\n } else {\n next()\n }\n } else {\n next()\n }\n})\n\n/**\n * Get judgment initialization data\n */\nAffirm.init = (root) => {\n $isPop = true\n $root = root\n $routerType = router.history.current.name\n}\n\n/**\n * Parameter verification\n */\nAffirm.paramVerification = (name) => {\n if (!$isPop) {\n return true\n }\n let dagStore = store.state.dag\n let flag = false\n if ($routerType === 'definition-create') {\n // No nodes jump out directly\n if (dagStore.tasks.length) {\n if (!dagStore.name) {\n store.commit('dag/setName', `${uuid('dag_')}${uuid() + uuid()}`)\n }\n flag = false\n } else {\n flag = true\n }\n } else {\n // View history direct jump\n flag = name === 'projects-instance-details' ? true : !dagStore.isEditDag\n }\n return flag\n}\n\n/**\n * Pop-up judgment\n */\nAffirm.isPop = (fn) => {\n Vue.$modal.dialog({\n closable: false,\n showMask: true,\n escClose: true,\n className: 'v-modal-custom',\n transitionName: 'opacityp',\n render (h) {\n return h(mAffirm, {\n on: {\n ok () {\n // save\n findComponentDownward($root, 'dag-chart')._save('affirm').then(() => {\n fn()\n Vue.$modal.destroy()\n }).catch(() => {\n fn()\n Vue.$modal.destroy()\n })\n },\n close () {\n fn()\n Vue.$modal.destroy()\n }\n },\n props: {\n }\n })\n }\n })\n}\n\n/**\n * Whether the external setting pops up\n */\nAffirm.setIsPop = (is) => {\n $isPop = is\n}\n\nexport default Affirm\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/jumpAffirm/index.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/jumpAffirm/jumpAffirm.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/formModel.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/listBox.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/resources.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/udfs.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/sqlType.vue","var normalizeComponent = require(\"!../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./datasource.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./datasource.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-62aa87e3\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./datasource.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/dag/_source/formModel/tasks/_source/datasource.vue\n// module id = 786\n// module chunks = 3 4 5","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/datasource.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/procedure.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/_source/dependItemList.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/tasks/sub_process.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/_source/selectInput.vue","\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/dag/_source/formModel/_source/timeoutAlarm.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-2175c153\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./start.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./start.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./start.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-2175c153\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./start.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue\n// module id = 798\n// module chunks = 0 3 4 5","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/timing/_source/list.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-2bd15f74\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./list.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./list.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./list.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-2bd15f74\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./list.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/timing/_source/list.vue\n// module id = 1117\n// module chunks = 6","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\n\nexport default {\n data () {\n return {\n router,\n store,\n isDetails: false\n }\n },\n created () {\n this.isDetails = this.store.state.dag.isDetails\n },\n methods: {\n },\n computed: {\n _isDetails () {\n return this.isDetails ? 'icon-disabled' : ''\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/module/mixin/disabledState.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/priority/priority.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-6a4fc01c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./priority.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./priority.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./priority.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-6a4fc01c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./priority.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/priority/priority.vue\n// module id = 700\n// module chunks = 0 3 4 5 6","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-17a2306c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./email.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./email.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./email.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-17a2306c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./email.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue\n// module id = 734\n// module chunks = 0 3 4 5 6","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-516d5d0c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./timing.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./timing.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./timing.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-516d5d0c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./timing.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue\n// module id = 993\n// module chunks = 0 6","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/timing/_source/list.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-2bd15f74\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./list.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./list.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./list.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-2bd15f74\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./list.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/timing/_source/list.vue\n// module id = 1115\n// module chunks = 6","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport store from '@/conf/home/store'\nimport router from '@/conf/home/router'\n\nexport default {\n data () {\n return {\n router,\n store,\n isDetails: false\n }\n },\n created () {\n this.isDetails = this.store.state.dag.isDetails\n },\n methods: {\n },\n computed: {\n _isDetails () {\n return this.isDetails ? 'icon-disabled' : ''\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/module/mixin/disabledState.js","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/priority/priority.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-6a4fc01c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./priority.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./priority.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./priority.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-6a4fc01c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./priority.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/priority/priority.vue\n// module id = 700\n// module chunks = 0 3 4 5 6","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-17a2306c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./email.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./email.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./email.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-17a2306c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./email.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue\n// module id = 734\n// module chunks = 0 3 4 5 6","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-516d5d0c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./timing.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./timing.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./timing.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-516d5d0c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./timing.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue\n// module id = 993\n// module chunks = 0 6","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/resource/pages/file/pages/details/index.vue","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n// This is CodeMirror (https://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\//.test(userAgent);\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\\/\\w+/.test(userAgent);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt() {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var activeElement;\n try {\n activeElement = document.activeElement;\n } catch(e) {\n activeElement = document.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {this.id = null;};\n Delayed.prototype.set = function (ms, f) {\n clearTimeout(this.id);\n this.id = setTimeout(f, ms);\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 30;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\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]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n input.init(d);\n }\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n // Add a span to a line.\n function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers || (emitter._handlers = {});\n map$$1[type] = (map$$1[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers, arr = map$$1 && map$$1[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map$$1[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range$$1;\n try {range$$1 = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range$$1 || range$$1.parentElement() != te) { return false }\n return range$$1.compareEndPoints(\"StartToEnd\", range$$1) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var this$1 = this;\n\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n var this$1 = this;\n\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this$1.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\s)\" + lineClass[2] + \"(?:$|\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {\n var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (node.className == \"CodeMirror-linewidget\")\n { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\");\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map$$1, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map$$1.length; i += 3) {\n mStart = map$$1[i];\n mEnd = map$$1[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map$$1.length - 3 || ch == mEnd && map$$1[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map$$1[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map$$1[i - 2] == map$$1[i - 3] && map$$1[i - 1].insertLeft) {\n node = map$$1[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map$$1.length - 3 && map$$1[i + 3] == map$$1[i + 4] && !map$$1[i + 5].insertLeft) {\n node = map$$1[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX() {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }\n return window.pageXOffset || (document.documentElement || document.body).scrollLeft\n }\n function pageScrollY() {\n if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }\n return window.pageYOffset || (document.documentElement || document.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var height = 0;\n if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above)\n { height += widgetHeight(lineObj.widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = true; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo$$1, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight$$1 = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo$$1, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight$$1; box.bottom += widgetHeight$$1;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight$$1 <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo$$1, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top || y >= coords.bottom;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo$$1, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo$$1, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo$$1, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo$$1, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range$$1 = doc.sel.ranges[i];\n if (range$$1.from().line >= cm.display.viewTo || range$$1.to().line < cm.display.viewFrom) { continue }\n var collapsed = range$$1.empty();\n if (collapsed || cm.options.showCursorWhenSelecting)\n { drawSelectionCursor(cm, range$$1.head, curFragment); }\n if (!collapsed)\n { drawSelectionRange(cm, range$$1, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\"; },\n cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n onBlur(cm);\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range$$1) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range$$1;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val);\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.pointerEvents = this.vert.style.pointerEvents = \"none\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.pointerEvents = \"auto\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt$$1 = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt$$1 != bar) { bar.style.pointerEvents = \"none\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt();\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this$1.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt();\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = window.getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }\n snapshot.activeElt.focus();\n if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var sel = window.getSelection(), range$$1 = document.createRange();\n range$$1.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range$$1.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range$$1);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(cm) {\n var width = cm.display.gutters.offsetWidth;\n cm.display.sizer.style.marginLeft = width + \"px\";\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }\n\n // Make sure the gutters options contains the element\n // \"CodeMirror-linenumbers\" when the lineNumbers option is true.\n function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && wheelPixelsPerUnit != null) {\n var pixels = dy * wheelPixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n var this$1 = this;\n\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this$1.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var this$1 = this;\n\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this$1.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n var this$1 = this;\n\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this$1.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(startGen) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = startGen || 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm)\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n var this$1 = this;\n\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this$1;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n var this$1 = this;\n\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this$1.lines[i];\n this$1.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var e = at + n; at < e; ++at)\n { if (op(this$1.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n var this$1 = this;\n\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this$1;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n var this$1 = this;\n\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this$1.height -= oldHeight - child.height;\n if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this$1.children.splice(++i, 0, leaf);\n leaf.parent = this$1;\n }\n child.lines = child.lines.slice(0, remaining);\n this$1.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n var this$1 = this;\n\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this$1[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var this$1 = this;\n\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n var this$1 = this;\n\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null));\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n var this$1 = this;\n\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this$1; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this$1.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range$$1 = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range$$1.head; }\n else if (start == \"anchor\") { pos = range$$1.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range$$1.to(); }\n else { pos = range$$1.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n var this$1 = this;\n\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this$1, ranges[i].anchor),\n clipPos(this$1, ranges[i].head)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var this$1 = this;\n\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var this$1 = this;\n\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var this$1 = this;\n\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range$$1 = sel.ranges[i];\n changes[i] = {from: range$$1.from(), to: range$$1.to(), text: this$1.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this$1, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {this.history = new History(this.history.maxGeneration);},\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history.maxGeneration);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo$$1 = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo$$1 == from.line && from.ch >= span.to ||\n span.from == null && lineNo$$1 != from.line ||\n span.from != null && lineNo$$1 == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo$$1;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo$$1 = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo$$1;\n });\n return clipPos(this, Pos(lineNo$$1, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n var this$1 = this;\n\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this$1.linked[i];\n if (link.doc != other) { continue }\n this$1.linked.splice(i, 1);\n other.unlinkDoc(this$1);\n detachSharedMarkers(findSharedMarkers(this$1));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var loadFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1)\n { return }\n\n var reader = new FileReader;\n reader.onload = operation(cm, function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) { content = \"\"; }\n text[i] = content;\n if (++read == n) {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)));\n }\n });\n reader.readAsText(file);\n };\n for (var i = 0; i < n; ++i) { loadFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 127: \"Delete\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Alt-F\": \"goWordRight\", \"Alt-B\": \"goWordLeft\", \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\",\n \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\", \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\",\n \"Alt-D\": \"delWordAfter\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\", \"Ctrl-T\": \"transposeChars\",\n \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map$$1, handle, context) {\n map$$1 = getKeyMap(map$$1);\n var found = map$$1.call ? map$$1.call(key, context) : map$$1[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map$$1.fallthrough) {\n if (Object.prototype.toString.call(map$$1.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map$$1.fallthrough, handle, context) }\n for (var i = 0; i < map$$1.fallthrough.length; i++) {\n var result = lookupKey(key, map$$1.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Cmd\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"char\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(0, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n cm.curOp.focus = activeElt();\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if (webkit || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n delayBlurEvent(cm);\n setTimeout(function () { return display.input.focus(); }, 20);\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.options.gutters.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.options.gutters[i];\n signal(cm, type, cm, line, gutter, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b-\\u200f\\u2028\\u2029\\ufeff]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n guttersChanged(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"firstLineNumber\", 1, guttersChanged, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, guttersChanged, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function guttersChanged(cm) {\n updateGutters(cm);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n setGuttersForLineNumbers(options);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input);\n display.wrapper.CodeMirror = this;\n updateGutters(this);\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(bind(onFocus, this), 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this$1, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range$$1 = sel.ranges[i$1];\n var from = range$$1.from(), to = range$$1.to();\n if (range$$1.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == inserted)\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput)\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range$$1 = sel.ranges[i];\n if (range$$1.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range$$1.head.line)) { continue }\n var mode = cm.getModeAt(range$$1.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range$$1.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range$$1.head.line).text.slice(0, range$$1.head.ch)))\n { indented = indentLine(cm, range$$1.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range$$1.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", !!autocorrect);\n field.setAttribute(\"autocapitalize\", !!autocapitalize);\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n disableBrowserMagic(te);\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map$$1, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n },\n removeKeyMap: function(map$$1) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this$1.state.modeGen++;\n regChange(this$1);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range$$1 = ranges[i];\n if (!range$$1.empty()) {\n var from = range$$1.from(), to = range$$1.to();\n var start = Math.max(end, from.line);\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how); }\n var newRanges = this$1.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range$$1.head.line > end) {\n indentLine(this$1, range$$1.head.line, how, true);\n end = range$$1.head.line;\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range$$1 = this.doc.sel.primary();\n if (start == null) { pos = range$$1.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range$$1.from() : range$$1.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range$$1) {\n if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range$$1) {\n var other = findPosH(doc, range$$1.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this$1, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range$$1) {\n if (collapse)\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range$$1 == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range$$1, margin) {\n if (range$$1 == null) {\n range$$1 = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range$$1 == \"number\") {\n range$$1 = {from: Pos(range$$1, 0), to: null};\n } else if (range$$1.from == null) {\n range$$1 = {from: range$$1, to: null};\n }\n if (!range$$1.to) { range$$1.to = range$$1.from; }\n range$$1.margin = margin || 0;\n\n if (range$$1.from.line != null) {\n scrollToRange(this, range$$1);\n } else {\n scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo$$1 = this.display.viewFrom;\n this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n ++lineNo$$1;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"char\", \"column\" (like char, but doesn't\n // cross line boundaries), \"word\" (across next word), or \"group\" (to\n // the start of next group of word or non-word-non-whitespace\n // chars). The visually param controls whether, in right-to-left\n // text, direction 1 means to move towards the next index in the\n // string, or towards the character to the right of the current\n // position. The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n function findNextLine() {\n var l = pos.line + dir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n on(div, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = document.activeElement;\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = this.cm.state.focused;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map$$1 = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map$$1[map$$1.length - 1], offset: map$$1[map$$1.length - 2] - map$$1[map$$1.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor())\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var input = this;\n if (this.selectionInEditor())\n { this.pollSelection(); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range$$1;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range$$1 = found[0].find(0)))\n { addText(getBetween(cm.doc, range$$1.from, range$$1.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map$$1 = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map$$1.length; j += 3) {\n var curNode = map$$1[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map$$1[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map$$1[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing) { return }\n var cm = this.cm;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt() != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { window.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt();\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, …*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.45.0\";\n\n return CodeMirror;\n\n})));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/lib/codemirror.js\n// module id = 644\n// module chunks = 3 4 5 7 8 14","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./spin.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./spin.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./spin.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./spin.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/spin/spin.vue\n// module id = 646\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue?5ee1","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue?e770","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue?aa4f","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/_source/down_error.png","webpack:///src/js/conf/home/pages/resource/pages/file/pages/details/index.vue","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/index.vue?9e5d","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/index.vue?996b","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/index.vue?39ba","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/index.vue","webpack:///src/js/module/components/spin/spin.vue","webpack:///src/js/module/components/listConstruction/listConstruction.vue","webpack:///src/js/module/components/secondaryMenu/secondaryMenu.vue","webpack:///src/js/module/components/noData/noData.vue","webpack:///./node_modules/codemirror/lib/codemirror.js","webpack:///./src/js/module/components/spin/spin.vue","webpack:///./src/js/module/components/spin/spin.vue?542d","webpack:///./src/js/module/components/spin/spin.vue?9371","webpack:///./src/js/module/components/spin/spin.vue?87eb","webpack:///./src/js/module/components/listConstruction/listConstruction.vue","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?b527","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?50be","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?6117","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?c652","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?7693","webpack:///./src/js/module/components/secondaryMenu/close.png","webpack:///./src/js/module/components/secondaryMenu/open.png","webpack:///./src/js/module/components/secondaryMenu/menu.js","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?048e","webpack:///./src/js/module/components/noData/noData.vue","webpack:///./src/js/module/components/noData/noData.vue?93a9","webpack:///./src/js/module/components/noData/noData.vue?86e8","webpack:///./src/js/module/components/noData/noData.vue?5a51","webpack:///./src/js/module/components/noData/images/errorTip.png","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/_source/codemirror.js","webpack:///./node_modules/codemirror/mode/sql/sql.js","webpack:///./src/js/module/download/index.js","webpack:///./node_modules/codemirror/addon/hint/show-hint.js","webpack:///./node_modules/codemirror/addon/hint/sql-hint.js","webpack:///./node_modules/codemirror/addon/hint/xml-hint.js","webpack:///./node_modules/codemirror/mode/python/python.js","webpack:///./node_modules/codemirror/mode/xml/xml.js","webpack:///./node_modules/codemirror/mode/textile/textile.js","webpack:///./node_modules/codemirror/mode/shell/shell.js","webpack:///./src/js/module/util/util.js","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/_source/common.js","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/_source/utils.js","webpack:///src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue"],"names":["Object","defineProperty","__webpack_exports__","value","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noType_vue__","__webpack_require__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noType_vue___default","n","__WEBPACK_IMPORT_KEY__","key","d","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_511724d0_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_noType_vue__","__vue_styles__","ssrContext","Component","normalizeComponent","a","content","module","i","locals","exports","push","esExports","render","_h","this","$createElement","_c","_self","staticClass","attrs","src","alt","_v","_s","$t","staticRenderFns","p","_vuex","_common","_utils","_download","_util","editor","name","data","isNoType","isLoading","filtTypeArr","loadingIndex","mode","isData","size","msg","props","methods","assign","mapActions","_go","$router","_downloadFile","downloadFile","id","$route","params","_getViewResources","_this","getViewResources","_rtParam","then","res","alias","split","_handlerEditor","setValue","lineCount","setTimeout","$","scrollTop","scrollLeft","catch","e","$message","error","_onUp","_lodash2","default","debounce","_editorOff","leading","trailing","_onDown","remove","_this2","h","height","_codemirror2","display","wrapper","style","scroll","_ref","doc","totalHeight","on","watch","created","file","_localStorage2","getItem","fileName","fileSize","lastIndexOf","substring","length","handlerSuffix","bytesToSize","parseInt","includes","trimStart","mounted","destroyed","toTextArea","off","computed","skipLineNum","limit","components","mListConstruction","_listConstruction2","mNoType","_noType2","mSpin","_spin2","mSecondaryMenu","_secondaryMenu2","mNoData","_noData2","_vm","type","title","staticStyle","margin","slot","data-container","data-toggle","click","_e","is-spin","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_index_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_index_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_946b5f1e_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_index_vue__","isSpin","Boolean","isLeft","String","menuList","_menu2","index","isTogHide","className","is","layoutBox","addClass","removeClass","_toggleSubMenu","item","isOpen","_toggleMenu","factory","userAgent","navigator","platform","gecko","test","ie_upto10","ie_11up","exec","edge","ie","ie_version","document","documentMode","webkit","qtwebkit","chrome","presto","safari","vendor","mac_geMountainLion","phantom","ios","android","mobile","mac","chromeOS","windows","presto_version","match","Number","flipCtrlCmd","captureRightClick","classTest","cls","RegExp","range","rmClass","node","current","after","slice","removeChildren","count","childNodes","removeChild","firstChild","removeChildrenAndAdd","parent","appendChild","elt","tag","createElement","cssText","createTextNode","eltP","setAttribute","contains","child","nodeType","parentNode","host","activeElt","activeElement","body","shadowRoot","joinClasses","b","as","createRange","start","end","endNode","r","setEnd","setStart","createTextRange","moveToElementText","collapse","moveEnd","moveStart","selectInput","select","bind","f","args","Array","prototype","call","arguments","apply","copyObj","obj","target","overwrite","prop","hasOwnProperty","countColumn","string","tabSize","startIndex","startValue","search","nextTab","indexOf","selectionStart","selectionEnd","Delayed","array","set","ms","clearTimeout","scrollerGap","Pass","toString","sel_dontScroll","sel_mouse","origin","sel_move","findColumn","goal","pos","col","skipped","Math","min","spaceStrs","spaceStr","lst","arr","map","out","nothing","createObj","base","inst","create","nonASCIISingleCaseWordChar","isWordCharBasic","ch","toUpperCase","toLowerCase","isWordChar","helper","source","isEmpty","extendingChars","isExtendingChar","charCodeAt","skipExtendingChars","str","dir","charAt","findFirst","pred","from","to","midF","mid","ceil","floor","getLine","first","Error","chunk","lines","children","sz","chunkSize","getBetween","line","iter","text","getLines","updateLineHeight","diff","lineNo","cur","no","lineAtHeight","outer","i$1","lh","isLine","l","lineNumberFor","options","lineNumberFormatter","firstLineNumber","Pos","sticky","cmp","equalCursorPos","copyPos","x","maxPos","minPos","clipLine","max","clipPos","last","linelen","clipToLen","clipPosArray","sawReadOnlySpans","sawCollapsedSpans","MarkedSpan","marker","getMarkedSpanFor","spans","span","removeMarkedSpan","stretchSpansOverChange","change","full","oldFirst","markedSpans","oldLast","startCh","endCh","isInsert","old","nw","inclusiveLeft","insertLeft","endsAfter","inclusiveRight","markedSpansBefore","startsBefore","markedSpansAfter","sameLine","offset","found","span$1","clearEmptySpans","newMarkers","gapMarkers","gap","i$2","i$3","clearWhenEmpty","splice","detachMarkedSpans","detachLine","attachMarkedSpans","attachLine","extraLeft","extraRight","compareCollapsedMarkers","lenDiff","aPos","find","bPos","fromCmp","toCmp","collapsedSpanAtSide","sps","sp","collapsed","collapsedSpanAtStart","collapsedSpanAtEnd","collapsedSpanAround","conflictingCollapsedRange","lineNo$$1","visualLine","merged","visualLineNo","lineN","vis","visualLineEndNo","lastLine","lineIsHidden","widgetNode","lineIsHiddenInner","heightAtLine","lineObj","lineLength","len","found$1","findMaxLine","cm","maxLine","maxLineLength","maxLineChanged","bidiOther","getBidiPartAt","order","bidiOrdering","lowTypes","arabicTypes","bidiRE","isNeutral","isStrong","countsAsLeft","countsAsNum","BidiSpan","level","direction","outerType","code","types","prev","type$1","prev$1","type$2","i$4","type$3","replace","j","i$5","cur$1","type$4","i$6","end$1","before","replace$1","j$1","m","i$7","at","j$2","nstart","unshift","reverse","getOrder","noHandlers","emitter","addEventListener","attachEvent","map$$1","_handlers","concat","getHandlers","removeEventListener","detachEvent","signal","handlers","signalDOMEvent","override","preventDefault","defaultPrevented","e_defaultPrevented","codemirrorIgnore","signalCursorActivity","cursorActivity","curOp","cursorActivityHandlers","hasHandler","eventMixin","ctor","e_preventDefault","returnValue","e_stopPropagation","stopPropagation","cancelBubble","e_stop","e_target","srcElement","e_button","which","button","ctrlKey","zwspSupported","badBidiRects","dragAndDrop","div","zeroWidthElement","measure","offsetHeight","offsetWidth","hasBadBidiRects","txt","r0","getBoundingClientRect","r1","left","right","splitLinesAuto","result","nl","rt","hasSelection","window","getSelection","te","range$$1","ownerDocument","selection","parentElement","compareEndPoints","hasCopyEvent","oncopy","badZoomedRects","modes","mimeModes","resolveMode","spec","getMode","mfactory","modeObj","modeExtensions","exts","helperType","modeProps","prop$1","extendMode","properties","copyState","state","nstate","val","innerMode","info","startState","a1","a2","StringStream","lineOracle","lastColumnPos","lastColumnValue","lineStart","eol","sol","peek","undefined","next","eat","eatWhile","eatSpace","skipToEnd","skipTo","backUp","column","indentation","pattern","consume","caseInsensitive","cased","substr","hideFirstChars","inner","lookAhead","oracle","baseToken","SavedContext","Context","maxLookAhead","baseTokens","baseTokenPos","highlightLine","context","forceToEnd","st","modeGen","lineClasses","runMode","loop","o","overlay","overlays","i_end","opaque","styles","classes","bgClass","textClass","getLineStyles","updateFrontier","getContextBefore","resetState","maxHighlightLength","stateAfter","save","styleClasses","highlightFrontier","modeFrontier","precise","minindent","minline","lim","indented","findStartLine","saved","fromSaved","processLine","viewFrom","viewTo","nextLine","startAt","stream","callBlankLine","readToken","blankLine","token","copy","Token","takeToken","asArray","tokens","extractLineClasses","output","lineClass","flattenSpans","curStart","curStyle","addModeClass","mName","Line","estimateHeight","cleanUpLine","styleToClassCache","styleToClassCacheWithMode","interpretTokenStyle","cache","buildLineContent","lineView","builder","pre","trailingSpace","splitSpaces","getOption","rest","addToken","buildToken","buildTokenBadBidi","insertLineContent","externalMeasured","maps","caches","lastChild","querySelector","defaultSpecialCharPlaceholder","startStyle","endStyle","css","attributes","displayText","trailingBefore","spaceBefore","special","specialChars","mustWrap","createDocumentFragment","lastIndex","txt$1","tabWidth","specialCharPlaceholder","fullStyle","attr","part","buildCollapsedSpan","ignoreWidget","widget","input","needsContentAttribute","setUneditable","allText","spanStyle","spanEndStyle","spanStartStyle","nextChange","Infinity","foundBookmarks","endStyles","upto","tokenText","LineView","visualLineContinued","hidden","buildViewArray","nextPos","view","operationGroup","orphanDelayedCallbacks","signalLater","list","delayedCallbacks","fireOrphanDelayed","delayed","updateLineForChanges","dims","changes","updateLineText","updateLineGutter","updateLineClasses","updateLineWidgets","ensureLineWrapped","replaceChild","zIndex","getLineContent","ext","built","background","wrap","insertBefore","updateLineBackground","wrapClass","gutter","gutterBackground","gutterClass","fixedGutter","fixedPos","gutterTotalWidth","markers","gutterMarkers","lineNumbers","wrap$1","gutterWrap","lineNumber","gutterLeft","k","gutters","gutterWidth","alignable","nextSibling","insertLineWidgets","buildLineElement","insertLineWidgetsFor","allowAbove","widgets","ws","handleMouseEvents","positionLineWidget","above","noHScroll","width","wrapperWidth","coverGutter","paddingLeft","position","marginLeft","widgetHeight","parentStyle","clientWidth","eventInWidget","getAttribute","sizer","mover","paddingTop","lineSpace","offsetTop","paddingVert","paddingH","cachedPaddingH","getComputedStyle","currentStyle","paddingRight","isNaN","scrollGap","nativeBarWidth","displayWidth","scroller","barWidth","displayHeight","clientHeight","barHeight","mapFromLineView","measureChar","bias","measureCharPrepared","prepareMeasureForLine","findViewForLine","findViewIndex","getDimensions","forceUpdate","lineMeasure","updateExternalMeasurement","rect","hasHeights","prepared","varHeight","wrapping","lineWrapping","curWidth","heights","rects","getClientRects","abs","bottom","top","ensureLineHeights","place","nodeAndOffsetInLineMap","coverStart","coverEnd","getUsefulRect","screen","logicalXDPI","deviceXDPI","normal","fromRange","hasBadZoomedRects","scaleX","scaleY","logicalYDPI","deviceYDPI","maybeUpdateRectForZooming","rSpan","charWidth","nullRect","rtop","rbot","bot","bogus","singleCursorHeightPerLine","rbottom","measureCharInner","measureText","mStart","mEnd","clearLineMeasurementCacheFor","clearLineMeasurementCache","externalMeasure","clearCaches","cachedCharWidth","cachedTextHeight","lineNumChars","pageScrollX","pageXOffset","documentElement","pageScrollY","marginTop","pageYOffset","widgetTopHeight","intoCoordSystem","includeWidgets","yOff","viewOffset","lOff","xOff","fromCoordSystem","coords","localBox","lineSpaceBox","charCoords","cursorCoords","preparedMeasure","get","getBidi","partPos","invert","other","estimateCoords","PosWithInfo","outside","xRel","coordsChar","y","coordsCharInner","rangeEnd","wrappedLineExtent","begin","wrappedLineExtentChar","boxIsAfter","box","widgetHeight$$1","ltr","_lineNo","ref","closestDist","endX","dist","baseX","chAround","boxAround","atLeft","atStart","textHeight","anchor","clientLeft","offsetLeft","compensateForHScroll","th","perLine","widgetsHeight","estimateLineHeights","est","estHeight","posFromMouse","liberal","forRect","space","clientX","clientY","colDiff","round","updateSelection","showSelection","prepareSelection","primary","curFragment","cursors","selFragment","sel","ranges","primIndex","empty","showCursorWhenSelecting","drawSelectionCursor","head","drawSelectionRange","cursor","cursorHeight","otherCursor","cmpCoords","fragment","padding","leftSide","rightSide","sizerWidth","docLTR","add","drawForLine","fromArg","toArg","lineLen","wrapX","side","extent","iterateBidiSections","fromPos","toPos","openStart","openEnd","openRight","topLeft","topRight","botLeft","botRight","sFrom","sTo","fromLine","toLine","singleVLine","leftEnd","rightStart","restartBlink","focused","clearInterval","blinker","cursorDiv","visibility","cursorBlinkRate","setInterval","ensureFocus","focus","onFocus","delayBlurEvent","delayingBlurEvent","onBlur","readOnly","selForContextMenu","reset","receivedFocus","shift","updateHeightsInViewport","prevBottom","lineDiv","updateWidgetHeight","chWidth","w","visibleLines","viewport","ensure","ensureFrom","ensureTo","alignHorizontally","alignWidgets","comp","gutterW","align","maybeUpdateLineNumberWidth","innerW","lineGutter","lineNumInnerWidth","lineNumWidth","updateGutterSpace","calculateScrollPos","snapMargin","screentop","docBottom","atTop","atBottom","newTop","screenleft","screenw","tooWide","addToScrollTop","resolveScrollToPos","ensureCursorVisible","getCursor","scrollToPos","cursorScrollMargin","scrollToCoords","scrollToCoordsRange","sPos","updateScrollTop","updateDisplaySimple","setScrollTop","startWorker","forceScroll","scrollHeight","scrollbars","setScrollLeft","isScroller","scrollWidth","measureForScrollbars","docH","viewHeight","viewWidth","barLeft","docHeight","NativeScrollbars","vert","horiz","tabIndex","checkedZeroWidth","minHeight","minWidth","update","needsH","needsV","sWidth","totalWidth","zeroWidthHack","disableHoriz","enableZeroWidthBar","disableVert","pointerEvents","bar","delay","maybeDisable","elementFromPoint","clear","NullScrollbars","updateScrollbars","startWidth","startHeight","updateScrollbarsInner","sizes","paddingBottom","heightForcer","borderBottom","scrollbarFiller","coverGutterNextToScrollbar","gutterFiller","scrollbarModel","native","null","initScrollbars","scrollbarStyle","axis","nextOpId","startOperation","op","viewChanged","updateInput","typing","changeObjs","cursorActivityCalled","selectionChanged","updateMaxLine","ops","ownsGroup","endOperation","endCb","group","callbacks","fireCallbacksForOps","finishOperation","endOperation_R1","updatedDisplay","mustUpdate","updateDisplayIfNeeded","endOperation_R2","endOperation_W2","endOperation_finish","endOperations","scrollbarsClipped","marginBottom","borderRightWidth","maybeClipScrollbars","DisplayUpdate","barMeasure","adjustWidthTo","maxScrollLeft","preparedSelection","takeFocus","setDocumentHeight","postUpdateDisplay","wheelStartX","wheelStartY","doScroll","innerHeight","scrollNode","scrollIntoView","maybeScrollWindow","changed","endCoords","scrollPos","startTop","startLeft","scrollPosIntoView","maybeHiddenMarkers","unhidden","maybeUnhiddenMarkers","finish","runInOp","operation","methodOp","docMethodOp","regChange","lendiff","updateLineNumbers","resetView","cut","viewCuttingPoint","cut$1","cutTop","cutBot","regLineChange","oldN","newN","countDirtyView","dirty","time","highlight","highlightWorker","Date","workTime","changedLines","oldStyles","highlighted","oldCls","newCls","ischange","workDelay","force","visible","editorIsHidden","wrapperHeight","oldDisplayWidth","events","renderedView","viewportMargin","different","lastWrapHeight","lastWrapWidth","adjustView","toUpdate","selSnapshot","hasFocus","active","anchorNode","extend","anchorOffset","focusNode","focusOffset","selectionSnapshot","updateNumbersFrom","container","rm","currentWheelTarget","updateNumber","patchDisplay","snapshot","removeAllRanges","addRange","restoreSelection","selectionDiv","reportedViewFrom","reportedViewTo","updateGutters","specs","gElt","setGuttersForLineNumbers","wheelSamples","wheelPixelsPerUnit","wheelEventDelta","dx","wheelDeltaX","dy","wheelDeltaY","detail","HORIZONTAL_AXIS","VERTICAL_AXIS","wheelDelta","wheelEventPixels","delta","onScrollWheel","canScrollX","canScrollY","pixels","wheelDX","wheelDY","movedX","movedY","sample","Selection","equals","here","there","deepCopy","Range","somethingSelected","normalizeSelection","mayTouch","selectionsMayTouch","prim","sort","inv","simpleSelection","changeEnd","adjustForChange","computeSelAfterChange","offsetPos","loadMode","modeOption","resetModeState","isWholeLineUpdate","wholeLineUpdateBefore","updateDoc","estimateHeight$$1","spansFor","updateLine","linesFor","firstLine","lastText","lastSpans","nlines","insert","added","added$1","added$2","linkedDocs","sharedHistOnly","propagate","skip","sharedHist","linked","rel","shared","attachDoc","setDirectionClass","History","startGen","done","undone","undoDepth","lastModTime","lastSelTime","lastOp","lastSelOp","lastOrigin","lastSelOrigin","generation","maxGeneration","historyChangeFromChange","histChange","attachLocalSpans","clearSelectionEvents","pop","addChangeToHistory","selAfter","opId","hist","history","historyEventDelay","lastChangeEvent","pushSelectionToHistory","addSelectionToHistory","selectionEventCanBeMerged","clearRedo","dest","existing","removeClearedSpans","explicitlyCleared","mergeOldSpans","getOldSpans","stretched","oldCur","stretchCur","copyHistoryArray","newGroup","instantiateSel","event","newChanges","extendRange","posBefore","extendSelection","setSelection","extendSelections","heads","replaceOneSelection","setSimpleSelection","setSelectionReplaceHistory","setSelectionNoUndo","NaN","filterSelectionChange","setSelectionInner","skipAtomicInSelection","reCheckSelection","mayClear","newAnchor","skipAtomic","newHead","skipAtomicInner","oldPos","atomic","near","movePos","far","cantEdit","selectAll","filterChange","canceled","cancel","makeChange","ignoreReadOnly","suppressEdits","mark","parts","mk","newParts","dfrom","dto","removeReadOnlyRanges","makeChangeInner","makeChangeSingleDoc","rebased","rebaseHist","makeChangeFromHistory","allowSelectionOnly","suppress","antiChanges","filter","returned","v","shiftDoc","distance","removed","recomputeMaxLength","checkWidthStart","retreatFrontier","changesHandler","changeHandler","makeChangeSingleDocInEditor","replaceRange","splitLines","rebaseHistSelSingle","rebaseHistArray","sub","ok","copied","changeLine","handle","changeType","LeafChunk","BranchChunk","removeInner","insertInner","iterN","oldHeight","remaining","leaf","maybeSpill","me","sibling","myIndex","used","LineWidget","opt","adjustScrollWhenAboveVisible","this$1","oldH","nextMarkerId","TextMarker","markText","cloneNode","isParent","SharedTextMarker","markTextShared","replacedWith","addToHistory","curLine","addMarkedSpan","clearOnEnter","clearHistory","withOp","visual","dHeight","findSharedMarkers","findMarks","detachSharedMarkers","subMarker","nextDocId","Doc","lineSep","cleanGeneration","constructor","getValue","join","lineSeparator","getRange","getLineHandle","getLineNumber","getLineHandleVisualStart","listSelections","setCursor","extendSelectionsBy","setSelections","addSelection","getSelections","replaceSelection","dup","replaceSelections","newSel","hint","oldPrev","newPrev","computeReplacedSel","undo","redo","undoSelection","redoSelection","setExtending","getExtending","historySize","markClean","changeGeneration","forceSplit","isClean","gen","getHistory","setHistory","histData","setGutterMarker","gutterID","clearGutter","lineInfo","addLineClass","where","removeLineClass","addLineWidget","insertAt","aboveVisible","removeLineWidget","setBookmark","realOpts","findMarksAt","getAllMarks","posFromIndex","sepSize","indexFromPos","copyHistory","linkedDoc","mFrom","mTo","subMark","copySharedMarkers","unlinkDoc","CodeMirror","splitIds","iterLinkedDocs","getEditor","setDirection","eachLine","lastDrop","onDrop","clearDragCursor","files","dataTransfer","isReadOnly","FileReader","File","read","loadFile","allowDropFileTypes","reader","onload","readAsText","draggingText","text$1","getData","selected","dragCursor","forEachCodeMirror","getElementsByClassName","byClass","editors","globalsRegistered","ensureGlobalHandlers","resizeTimer","onResize","setSize","keyNames","3","8","9","13","16","17","18","19","20","27","32","33","34","35","36","37","38","39","40","44","45","46","59","61","91","92","93","106","107","109","110","111","127","145","173","186","187","188","189","190","191","192","219","220","221","222","63232","63233","63234","63235","63272","63273","63275","63276","63277","63302","fromCharCode","keyMap","normalizeKeyName","ctrl","cmd","mod","normalizeKeyMap","keymap","keyname","keys","lookupKey","getKeyMap","fallthrough","isModifierKey","keyCode","addModifierNames","noShift","altKey","metaKey","shiftKey","keyName","altGraphKey","deleteNearSelection","compute","kill","toKill","replaced","moveCharLogically","moveLogically","endOfLine","visually","prep","targetTop","basic","Left","Right","Up","Down","End","Home","PageUp","PageDown","Delete","Backspace","Shift-Backspace","Tab","Shift-Tab","Enter","Insert","Esc","pcDefault","Ctrl-A","Ctrl-D","Ctrl-Z","Shift-Ctrl-Z","Ctrl-Y","Ctrl-Home","Ctrl-End","Ctrl-Up","Ctrl-Down","Ctrl-Left","Ctrl-Right","Alt-Left","Alt-Right","Ctrl-Backspace","Ctrl-Delete","Ctrl-S","Ctrl-F","Ctrl-G","Shift-Ctrl-G","Shift-Ctrl-F","Shift-Ctrl-R","Ctrl-[","Ctrl-]","Ctrl-U","Shift-Ctrl-U","Alt-U","emacsy","Ctrl-B","Ctrl-P","Ctrl-N","Alt-F","Alt-B","Ctrl-E","Ctrl-V","Shift-Ctrl-V","Ctrl-H","Alt-D","Alt-Backspace","Ctrl-K","Ctrl-T","Ctrl-O","macDefault","Cmd-A","Cmd-D","Cmd-Z","Shift-Cmd-Z","Cmd-Y","Cmd-Home","Cmd-Up","Cmd-End","Cmd-Down","Cmd-Left","Cmd-Right","Ctrl-Alt-Backspace","Alt-Delete","Cmd-S","Cmd-F","Cmd-G","Shift-Cmd-G","Cmd-Alt-F","Shift-Cmd-Alt-F","Cmd-[","Cmd-]","Cmd-Backspace","Cmd-Delete","Cmd-U","Shift-Cmd-U","commands","singleSelection","killLine","deleteLine","delLineLeft","delWrappedLineLeft","delWrappedLineRight","rightPos","goDocStart","goDocEnd","goLineStart","goLineStartSmart","lineStartSmart","goLineEnd","visualLineEnd","lineEnd","goLineRight","goLineLeft","goLineLeftSmart","goLineUp","moveV","goLineDown","goPageUp","goPageDown","goCharLeft","moveH","goCharRight","goColumnLeft","goColumnRight","goWordLeft","goGroupRight","goGroupLeft","goWordRight","delCharBefore","deleteH","delCharAfter","delWordBefore","delWordAfter","delGroupBefore","delGroupAfter","indentAuto","indentSelection","indentMore","indentLess","insertTab","insertSoftTab","spaces","defaultTab","execCommand","transposeChars","newlineAndIndent","sels","indentLine","openLine","toggleOverwrite","firstNonWS","inWS","doHandleBinding","bound","dropShift","ensurePolled","prevShift","stopSeq","dispatchKey","seq","keySeq","dispatchKeyInner","keyMaps","extraKeys","lookupKeyForEditor","handleKeyBinding","motion","lastStoppedKey","onKeyDown","handled","up","showCrossHair","onKeyUp","onKeyPress","charCode","handleCharBinding","lastClick","lastDoubleClick","PastClick","onMouseDown","activeTouch","supportsTouch","draggable","clickInGutter","repeat","now","compare","clickRepeat","selectingText","handleMappedButton","contained","behavior","option","unit","addNew","moveOnDrag","configureMouse","dragDrop","moved","dragEnd","mouseMove","dragStart","e2","leftButtonStartDrag","ourRange","ourIndex","startSel","rangeForUnit","lastPos","extendTo","startCol","posCol","leftPos","oldRange","ranges$1","anchorLine","boundary","headIndex","usePart","bidiSimplify","editorSize","counter","move","buttons","curCount","leftButtonSelect","leftButtonDown","onContextMenu","findWordAt","gutterEvent","prevent","mX","mY","touches","lineBox","g","contextMenuInGutter","themeChanged","theme","Init","defaults","optionHandlers","guttersChanged","dragDropChanged","funcs","dragFunctions","toggle","enter","over","leave","drop","wrappingChanged","inputStyles","inputStyle","init","pasteIncoming","cutIncoming","autofocus","word","touchFinished","prevTouch","finishTouch","farAway","touch","radiusX","radiusY","isMouseLikeTouchEvent","pageX","pageY","frag","onDragOver","setData","effectAllowed","setDragImage","img","_top","onDragStart","inp","getField","registerEventHandlers","finishInit","initHooks","textRendering","how","aggressive","indent","curSpace","curSpaceString","indentUnit","indentString","indentWithTabs","pos$1","defineInitHook","lastCopied","setLastCopied","newLastCopied","applyTextInput","inserted","deleted","recent","paste","textLines","multiPaste","pasteLinesPerSelection","lineWise","changeEvent","triggerElectric","handlePaste","pasted","clipboardData","disableInput","electricChars","smartIndent","getModeAt","electricInput","copyableRanges","lineRange","disableBrowserMagic","field","spellcheck","autocorrect","autocapitalize","hiddenTextarea","border","findPosH","origDir","moveOnce","boundToLine","bidi","mv","getWrappedLineExtent","moveInStorageOrder","searchInVisualLine","getRes","nextCh","moveVisually","sawType","getHelper","hitSide","findPosV","pageSize","moveAmount","ContentEditableInput","lastAnchorNode","lastAnchorOffset","lastFocusNode","lastFocusOffset","polling","composing","gracePeriod","readDOMTimeout","posToDOM","badPos","bad","domToPos","lineNode","locateNodeInLineView","textNode","topNode","nodeValue","curNode","textContent","previousSibling","dist$1","onCopyCut","lineWiseCopyCut","clearData","kludge","hadFocus","showPrimarySelection","updateFromDOM","readFromDOMSoon","forceCompositionEnd","showMultipleSelections","curAnchor","curFocus","rng","rangeCount","getRangeAt","startGracePeriod","rememberSelection","selectionInEditor","commonAncestorContainer","blur","pollSelection","pollInterval","poll","scan","isInGutter","triggerOnKeyDown","pollContent","fromIndex","fromNode","toNode","toIndex","newText","closing","extraLinebreak","close","addText","walk","cmText","markerID","isBlock","nodeName","domTextBetween","oldText","cutFront","cutEnd","oldTop","maxCutFront","newBot","oldBot","maxCutEnd","chFrom","chTo","contentEditable","readOnlyChanged","resetPosition","TextareaInput","prevInput","pollingFast","createField","textarea","prepareCopyCut","fastPoll","dispatchEvent","Event","_display","moveInputWithCursor","headPos","wrapOff","lineOff","teTop","teLeft","drawn","contextMenuPending","slowPoll","missed","same","resetSelectionOnContextMenu","oldScrollY","oldCSS","oldWrapperCSS","wrapperBox","offsetParent","scrollY","scrollTo","rehide","detectingSelectAll","prepareSelectAllHack","mouseup","extval","disabled","deflt","notOnInit","defineOption","newBreaks","refresh","getInputField","detach","attach","integer","defineOptions","helpers","setOption","getDoc","addKeyMap","removeKeyMap","addOverlay","score","priority","insertSorted","modeSpec","removeOverlay","newRanges","getTokenAt","getLineTokens","getTokenTypeAt","getHelpers","help","_global","getStateAfter","defaultTextHeight","defaultCharWidth","getViewport","addWidget","vspace","hspace","triggerOnKeyPress","triggerOnKeyUp","triggerOnMouseDown","amount","rtlMoveVisually","goalColumn","goals","startChar","check","getScrollInfo","scrollToRange","interpret","swapDoc","phrase","phraseText","phrases","getWrapperElement","getScrollerElement","getGutterElement","registerHelper","registerGlobalHelper","predicate","addEditorMethods","dontDelegate","method","contenteditable","defineMode","dependencies","defineMIME","mime","defineExtension","func","defineDocExtension","fromTextArea","tabindex","placeholder","realSubmit","form","leaveSubmitMethodAlone","submit","wrappedSubmit","getTextArea","cmpPos","addLegacyProps","version","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_16cfa774_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_spin_vue__","class","xmlns","xmlns:xlink","viewBox","preserveAspectRatio","transform","attributeName","values","keyTimes","dur","repeatCount","fill","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_listConstruction_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_listConstruction_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_eae3645c_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_listConstruction_vue__","_t","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_secondaryMenu_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_secondaryMenu_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_f72bdd3a_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_secondaryMenu_vue__","escape","_i18n","menu","projects","i18n","path","icon","security","resource","user","href","_l","$index","$event","el","active-class","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noData_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noData_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_2d3808af_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_noData_vue__","_m","_codemirror","getElementById","hookIdentifier","hookVar","hookClient","config","parserConfig","client","atoms","false","true","builtin","defaultBuiltin","keywords","sqlKeywords","operatorChars","support","hooks","dateSQL","date","timestamp","backslashStringEscapes","brackets","punctuation","tokenBase","quote","hexNumber","binaryNumber","decimallessFloat","doubleQuote","tokenize","escaped","nCharCast","charsetCast","commentSlashSlash","commentHash","commentSpaceRequired","tokenComment","depth","zerolessFloat","ODBCdotTable","pushContext","tok","popContext","textAfter","cx","blockCommentStart","blockCommentEnd","lineComment","closeBrackets","words","@","`","\\","identifierQuote",":","?","\"","$url","$obj","param","url","forEach","appendTo","warning","HINT_ELEMENT_CLASS","ACTIVE_HINT_ELEMENT_CLASS","Completion","tick","startPos","startLen","self","activityFunc","showHint","getHints","async","newOpts","hintOptions","defaultOptions","resolve","parseOptions","selections","supportsSelection","completionActive","completion","requestAnimationFrame","fn","cancelAnimationFrame","getText","getHintElement","hintsElement","Widget","picked","parentWindow","defaultView","hints","selectedHint","completions","hintId","alignWithWord","below","winW","innerWidth","winH","overlapY","scrolls","startScroll","closingOnBlur","overlapX","baseMap","moveFocus","menuSize","setFocus","pick","custom","customKeys","ourMap","addBinding","extra","buildKeyMap","avoidWrap","changeActive","screenAmount","closeOnUnfocus","onScroll","curScroll","point","t","completeOnSingleClick","fetchHints","callback","closeCharacters","disable","myTick","finishUpdate","completeSingle","resolved","app","applicableHelpers","run","fromList","anyword","term","autocomplete","auto","tables","defaultTable","CONS","QUERY_DIV","ALIAS_KEYWORD","isArray","wrapTable","columns","getTable","shallowClone","object","addMatches","wordlist","formatter","cleanName","nameParts","insertIdentifierQuotes","eachWord","lineText","findTableByAlias","fullQuery","aliasUpperCase","previousWord","table","separator","validRange","indexOfSeparator","prevItem","query","wordUpperCase","parseTables","defaultTableName","disableKeywords","getKeywords","getIdentifierQuote","useIdentifierQuotes","cont","aliasTable","oldTable","tableInsert","nameCompletion","objectOrClass","matches","typed","matchInMiddle","tags","schemaInfo","quoteChar","prefix","tagStart","replaceToken","tagName","tagType","curTag","childList","globalAttrs","nm","atValues","atName","wordRegexp","wordOperators","commonKeywords","commonBuiltins","scopes","conf","parserConf","ERRORCLASS","delimiters","singleDelimiters","operators","singleOperators","doubleOperators","doubleDelimiters","tripleDelimiters","hangingIndent","myKeywords","myBuiltins","extra_keywords","extra_builtins","py3","identifiers","stringPrefixes","builtins","lastToken","scopeOffset","lineOffset","pushPyScope","dedent","errorToken","tokenBaseInner","floatLiteral","intLiteral","delimiter","tokenOuter","singleline","OUTCLASS","tokenNestedExpr","tokenString","singleLineStringErrors","isString","formatStringFactory","tokenStringFactory","tokenLexer","beginningOfLine","lambda","delimiter_index","pushBracketScope","basecolumn","addErr","scope","triples","fold","htmlConfig","autoSelfClosers","area","br","command","embed","frame","hr","keygen","link","meta","track","wbr","menuitem","implicitlyClosed","dd","li","optgroup","rp","tbody","td","tfoot","tr","contextGrabbers","dt","address","article","aside","blockquote","dl","fieldset","footer","h1","h2","h3","h4","h5","h6","header","hgroup","nav","ol","section","ul","thead","doNotIndent","allowUnquoted","allowMissing","caseFold","xmlConfig","allowMissingTagName","editorConf","config_","setStyle","htmlMode","inText","chain","parser","inBlock","doctype","inTag","closure","baseState","isInAttribute","stringStartCol","terminator","maybePopContext","nextTagName","parentTagName","tagNameState","closeTagNameState","attrState","matchClosing","closeState","closeStateErr","_stream","attrEqState","startOfLine","noIndent","attrValueState","attrContinuedState","isInText","baseIndent","fullLine","multilineTagIndentPastTag","multilineTagIndentFactor","alignCDATA","tagAfter","grabbers","configuration","skipAttribute","TOKEN_STYLES","addition","bold","cite","definitionList","deletion","em","footnote","footCite","html","image","italic","linkDefinition","list1","list2","list3","notextile","specialChar","strong","sup","tableHeading","handlePhraseModifier","togglePhraseModifier","tokenStyles","tokenStylesWith","phraseModifier","closeRE","openSize","charBefore","charAfter","Modes","textileDisabled","layoutType","activeStyles","extraStyles","spanningLayout","newLayout","REs","single","bc","bq","definitionListEnd","drawTable","foot","para","tableCellAttributes","tableText","selector","lang","pad","createRe","makeRe","RE","choiceRe","arg","blockType","newMode","layoutLength","listDepth","listMod","tableCell","startNewLine","define","dict","commonAtoms","commonCommands","tokenDollar","tokenStringStart","bytes","log","pow","toPrecision","isJson","JSON","parse","_typeof","syntaxHighlight","json","stringify",".txt",".log",".sh",".conf",".cfg",".py",".java",".sql",".hql",".xml"],"mappings":"oDAAAA,OAAAC,eAAAC,EAAA,cAAAC,OAAA,QAAAC,EAAAC,EAAA,KAAAC,EAAAD,EAAAE,EAAAH,GAAA,QAAAI,KAAAJ,EAAA,YAAAI,GAAA,SAAAC,GAAAJ,EAAAK,EAAAR,EAAAO,EAAA,kBAAAL,EAAAK,KAAA,CAAAD,GAAA,IAAAG,EAAAN,EAAA,MAGA,IASAO,EAZA,SAAAC,GACER,EAAQ,OAgBVS,EAdyBT,EAAQ,GAcjCU,CACET,EAAAU,EACAL,EAAA,GATF,EAWAC,EAPA,KAEA,MAUeV,EAAA,QAAAY,EAAiB,8BCvBhC,IAAAG,EAAcZ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AAM,SAYV,MAXI,KAAK7B,KAAKwB,GAEVK,EADE,KAAK7B,KAAKwB,GACN,MAEA,SAEC,aAAaxB,KAAKwB,GAC3BK,EAAM,UACG,OAAO7B,KAAKwB,KACrBK,EAAM,QAED,gBAAkBA,EAAM,KAAOL,EAAQ,iEC7CzCtJ,aAFU,MAAO,MAAO,KAAM,OAAQ,MAAO,KAAM,OAAQ,MAAO,MAAO,2DCehFmE,eAdAo+E,OAAQ,UACRC,OAAQ,UACRC,MAAO,QACPC,QAAS,UACTC,OAAQ,UACRC,MAAO,SACPC,QAAS,UACTC,OAAQ,MACRC,OAAQ,MACRC,OAAQ,oECtBVpjF,KAAA","file":"js/7.2cb1790.js","sourcesContent":["function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-511724d0\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./noType.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./noType.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./noType.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-511724d0\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./noType.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue\n// module id = 1001\n// module chunks = 7 8","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/resource/pages/file/pages/details/index.vue","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n// This is CodeMirror (https://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\//.test(userAgent);\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\\/\\w+/.test(userAgent);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt() {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var activeElement;\n try {\n activeElement = document.activeElement;\n } catch(e) {\n activeElement = document.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {this.id = null;};\n Delayed.prototype.set = function (ms, f) {\n clearTimeout(this.id);\n this.id = setTimeout(f, ms);\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 30;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\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]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n input.init(d);\n }\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n // Add a span to a line.\n function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers || (emitter._handlers = {});\n map$$1[type] = (map$$1[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers, arr = map$$1 && map$$1[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map$$1[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range$$1;\n try {range$$1 = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range$$1 || range$$1.parentElement() != te) { return false }\n return range$$1.compareEndPoints(\"StartToEnd\", range$$1) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var this$1 = this;\n\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n var this$1 = this;\n\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this$1.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\s)\" + lineClass[2] + \"(?:$|\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {\n var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (node.className == \"CodeMirror-linewidget\")\n { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\");\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map$$1, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map$$1.length; i += 3) {\n mStart = map$$1[i];\n mEnd = map$$1[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map$$1.length - 3 || ch == mEnd && map$$1[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map$$1[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map$$1[i - 2] == map$$1[i - 3] && map$$1[i - 1].insertLeft) {\n node = map$$1[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map$$1.length - 3 && map$$1[i + 3] == map$$1[i + 4] && !map$$1[i + 5].insertLeft) {\n node = map$$1[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX() {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }\n return window.pageXOffset || (document.documentElement || document.body).scrollLeft\n }\n function pageScrollY() {\n if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }\n return window.pageYOffset || (document.documentElement || document.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var height = 0;\n if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above)\n { height += widgetHeight(lineObj.widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = true; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo$$1, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight$$1 = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo$$1, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight$$1; box.bottom += widgetHeight$$1;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight$$1 <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo$$1, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top || y >= coords.bottom;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo$$1, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo$$1, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo$$1, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo$$1, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range$$1 = doc.sel.ranges[i];\n if (range$$1.from().line >= cm.display.viewTo || range$$1.to().line < cm.display.viewFrom) { continue }\n var collapsed = range$$1.empty();\n if (collapsed || cm.options.showCursorWhenSelecting)\n { drawSelectionCursor(cm, range$$1.head, curFragment); }\n if (!collapsed)\n { drawSelectionRange(cm, range$$1, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\"; },\n cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n onBlur(cm);\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range$$1) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range$$1;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val);\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.pointerEvents = this.vert.style.pointerEvents = \"none\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.pointerEvents = \"auto\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt$$1 = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt$$1 != bar) { bar.style.pointerEvents = \"none\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt();\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this$1.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt();\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = window.getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }\n snapshot.activeElt.focus();\n if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var sel = window.getSelection(), range$$1 = document.createRange();\n range$$1.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range$$1.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range$$1);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(cm) {\n var width = cm.display.gutters.offsetWidth;\n cm.display.sizer.style.marginLeft = width + \"px\";\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }\n\n // Make sure the gutters options contains the element\n // \"CodeMirror-linenumbers\" when the lineNumbers option is true.\n function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && wheelPixelsPerUnit != null) {\n var pixels = dy * wheelPixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n var this$1 = this;\n\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this$1.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var this$1 = this;\n\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this$1.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n var this$1 = this;\n\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this$1.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(startGen) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = startGen || 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm)\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n var this$1 = this;\n\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this$1;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n var this$1 = this;\n\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this$1.lines[i];\n this$1.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var e = at + n; at < e; ++at)\n { if (op(this$1.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n var this$1 = this;\n\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this$1;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n var this$1 = this;\n\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this$1.height -= oldHeight - child.height;\n if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this$1.children.splice(++i, 0, leaf);\n leaf.parent = this$1;\n }\n child.lines = child.lines.slice(0, remaining);\n this$1.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n var this$1 = this;\n\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this$1[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var this$1 = this;\n\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n var this$1 = this;\n\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null));\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n var this$1 = this;\n\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this$1; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this$1.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range$$1 = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range$$1.head; }\n else if (start == \"anchor\") { pos = range$$1.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range$$1.to(); }\n else { pos = range$$1.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n var this$1 = this;\n\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this$1, ranges[i].anchor),\n clipPos(this$1, ranges[i].head)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var this$1 = this;\n\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var this$1 = this;\n\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var this$1 = this;\n\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range$$1 = sel.ranges[i];\n changes[i] = {from: range$$1.from(), to: range$$1.to(), text: this$1.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this$1, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {this.history = new History(this.history.maxGeneration);},\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history.maxGeneration);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo$$1 = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo$$1 == from.line && from.ch >= span.to ||\n span.from == null && lineNo$$1 != from.line ||\n span.from != null && lineNo$$1 == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo$$1;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo$$1 = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo$$1;\n });\n return clipPos(this, Pos(lineNo$$1, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n var this$1 = this;\n\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this$1.linked[i];\n if (link.doc != other) { continue }\n this$1.linked.splice(i, 1);\n other.unlinkDoc(this$1);\n detachSharedMarkers(findSharedMarkers(this$1));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var loadFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1)\n { return }\n\n var reader = new FileReader;\n reader.onload = operation(cm, function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) { content = \"\"; }\n text[i] = content;\n if (++read == n) {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)));\n }\n });\n reader.readAsText(file);\n };\n for (var i = 0; i < n; ++i) { loadFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 127: \"Delete\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Alt-F\": \"goWordRight\", \"Alt-B\": \"goWordLeft\", \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\",\n \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\", \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\",\n \"Alt-D\": \"delWordAfter\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\", \"Ctrl-T\": \"transposeChars\",\n \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map$$1, handle, context) {\n map$$1 = getKeyMap(map$$1);\n var found = map$$1.call ? map$$1.call(key, context) : map$$1[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map$$1.fallthrough) {\n if (Object.prototype.toString.call(map$$1.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map$$1.fallthrough, handle, context) }\n for (var i = 0; i < map$$1.fallthrough.length; i++) {\n var result = lookupKey(key, map$$1.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Cmd\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"char\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(0, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n cm.curOp.focus = activeElt();\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if (webkit || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n delayBlurEvent(cm);\n setTimeout(function () { return display.input.focus(); }, 20);\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.options.gutters.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.options.gutters[i];\n signal(cm, type, cm, line, gutter, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b-\\u200f\\u2028\\u2029\\ufeff]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n guttersChanged(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"firstLineNumber\", 1, guttersChanged, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, guttersChanged, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function guttersChanged(cm) {\n updateGutters(cm);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n setGuttersForLineNumbers(options);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input);\n display.wrapper.CodeMirror = this;\n updateGutters(this);\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(bind(onFocus, this), 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this$1, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range$$1 = sel.ranges[i$1];\n var from = range$$1.from(), to = range$$1.to();\n if (range$$1.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == inserted)\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput)\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range$$1 = sel.ranges[i];\n if (range$$1.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range$$1.head.line)) { continue }\n var mode = cm.getModeAt(range$$1.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range$$1.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range$$1.head.line).text.slice(0, range$$1.head.ch)))\n { indented = indentLine(cm, range$$1.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range$$1.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", !!autocorrect);\n field.setAttribute(\"autocapitalize\", !!autocapitalize);\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n disableBrowserMagic(te);\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map$$1, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n },\n removeKeyMap: function(map$$1) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this$1.state.modeGen++;\n regChange(this$1);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range$$1 = ranges[i];\n if (!range$$1.empty()) {\n var from = range$$1.from(), to = range$$1.to();\n var start = Math.max(end, from.line);\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how); }\n var newRanges = this$1.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range$$1.head.line > end) {\n indentLine(this$1, range$$1.head.line, how, true);\n end = range$$1.head.line;\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range$$1 = this.doc.sel.primary();\n if (start == null) { pos = range$$1.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range$$1.from() : range$$1.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range$$1) {\n if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range$$1) {\n var other = findPosH(doc, range$$1.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this$1, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range$$1) {\n if (collapse)\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range$$1 == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range$$1, margin) {\n if (range$$1 == null) {\n range$$1 = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range$$1 == \"number\") {\n range$$1 = {from: Pos(range$$1, 0), to: null};\n } else if (range$$1.from == null) {\n range$$1 = {from: range$$1, to: null};\n }\n if (!range$$1.to) { range$$1.to = range$$1.from; }\n range$$1.margin = margin || 0;\n\n if (range$$1.from.line != null) {\n scrollToRange(this, range$$1);\n } else {\n scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo$$1 = this.display.viewFrom;\n this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n ++lineNo$$1;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"char\", \"column\" (like char, but doesn't\n // cross line boundaries), \"word\" (across next word), or \"group\" (to\n // the start of next group of word or non-word-non-whitespace\n // chars). The visually param controls whether, in right-to-left\n // text, direction 1 means to move towards the next index in the\n // string, or towards the character to the right of the current\n // position. The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n function findNextLine() {\n var l = pos.line + dir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n on(div, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = document.activeElement;\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = this.cm.state.focused;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map$$1 = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map$$1[map$$1.length - 1], offset: map$$1[map$$1.length - 2] - map$$1[map$$1.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor())\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var input = this;\n if (this.selectionInEditor())\n { this.pollSelection(); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range$$1;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range$$1 = found[0].find(0)))\n { addText(getBetween(cm.doc, range$$1.from, range$$1.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map$$1 = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map$$1.length; j += 3) {\n var curNode = map$$1[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map$$1[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map$$1[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing) { return }\n var cm = this.cm;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt() != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { window.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt();\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, …*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.45.0\";\n\n return CodeMirror;\n\n})));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/lib/codemirror.js\n// module id = 644\n// module chunks = 3 4 5 7 8 14","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./spin.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./spin.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./spin.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./spin.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/spin/spin.vue\n// module id = 646\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue"],"sourceRoot":""} \ No newline at end of file diff --git a/escheduler-ui/dist/js/8.d0d692f.js b/escheduler-ui/dist/js/8.e9f2610.js similarity index 99% rename from escheduler-ui/dist/js/8.d0d692f.js rename to escheduler-ui/dist/js/8.e9f2610.js index c60f8221c1..e12625cb4c 100644 --- a/escheduler-ui/dist/js/8.d0d692f.js +++ b/escheduler-ui/dist/js/8.e9f2610.js @@ -1,2 +1,2 @@ -webpackJsonp([8],{1001:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(984),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);var a=n(1004);var s=function(e){n(1002)},l=n(27)(i.a,a.a,!1,s,null,null);t.default=l.exports},1002:function(e,t,n){var r=n(1003);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(35)("3cf3e1ac",r,!0,{})},1003:function(e,t,n){(e.exports=n(34)(!1)).push([e.i,".no-type-model{text-align:center;padding-top:160px}.no-type-model>p{padding-top:10px;color:#666}",""])},1004:function(e,t,n){"use strict";var r={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"no-type-model"},[t("img",{attrs:{src:n(1005),alt:""}}),this._v(" "),t("p",[this._v(this._s(this.$t("不支持在线查看类型")))])])},staticRenderFns:[]};t.a=r},1005:function(e,t,n){e.exports=n.p+"images/down_error.png?4339cb288e29d420babb7d7c848b9093"},1050:function(e,t,n){"use strict";t.__esModule=!0;var r=m(n(28)),i=n(123),o=n(807),a=m(n(1001)),s=n(735),l=m(n(682)),c=m(n(646)),u=m(n(226)),d=m(n(663)),f=n(983),h=m(n(654)),p=m(n(650));function m(e){return e&&e.__esModule?e:{default:e}}var g=void 0;t.default={name:"file-details",data:function(){return{name:"",isNoType:!0,isLoading:!1,filtTypeArr:o.filtTypeArr,loadingIndex:0,mode:"python",isData:!0,size:null,spinnerLoading:!1,msg:""}},props:{},methods:Object.assign({},(0,i.mapActions)("resource",["getViewResources","updateContent"]),{ok:function(){var e=this;this.spinnerLoading=!0,this.updateContent({id:this.$route.params.id,content:g.getValue()}).then(function(t){e.$message.success(t.msg),setTimeout(function(){e.spinnerLoading=!1,e.close()},800)}).catch(function(t){e.$message.error(t.msg||""),e.spinnerLoading=!1})},close:function(){this.$router.push({name:"file"})},_getViewResources:function(){var e=this;this.isLoading=!0,this.getViewResources({id:this.$route.params.id,skipLineNum:0,limit:2e3}).then(function(t){e.name=t.data.alias.split(".")[0],t.data?(e.isData=!0,e._handlerEditor().setValue(t.data.content||""),setTimeout(function(){$(".code-mirror-model").scrollTop(12).scrollLeft(0)},200)):e.isData=!1,e.isLoading=!1}).catch(function(t){e.msg=t.msg||"error",e.$message.error(t.msg||""),e.isLoading=!1})},_handlerEditor:function(){return g=(0,l.default)("code-edit-mirror",{mode:this.mode,readOnly:!1}),this.keypress=function(){g.getOption("readOnly")||g.showHint({completeSingle:!1})},g.on("keypress",this.keypress),g}}),watch:{},created:function(){var e=r.default.split(u.default.getItem("file"),"|",2),t=e[0],n=e[1],i=t.lastIndexOf("."),o=t.substring(i,t.length);this.mode=f.handlerSuffix[o],this.size=(0,s.bytesToSize)(parseInt(n)),this.isNoType=r.default.includes(this.filtTypeArr,r.default.trimStart(o,"."))},mounted:function(){this.isNoType&&this._getViewResources()},destroyed:function(){g&&(g.toTextArea(),g.off($(".code-edit-mirror"),"keypress",this.keypress))},computed:{},components:{mListConstruction:p.default,mNoType:a.default,mSpin:c.default,mSecondaryMenu:h.default,mNoData:d.default}}},1167:function(e,t,n){var r=n(1168);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(35)("786589f0",r,!0,{})},1168:function(e,t,n){(e.exports=n(34)(!1)).push([e.i,".file-edit-content{width:100%;background:#fff;padding-bottom:20px}.file-edit-content>h2{line-height:60px;text-align:center;padding-bottom:6px;position:relative}.file-edit-content>h2 .down{position:absolute;right:0;top:0}.file-edit-content>h2 .down>i{font-size:20px;color:#2d8cf0;cursor:pointer;vertical-align:middle}.file-edit-content>h2 .down em{font-size:12px;font-style:normal;vertical-align:middle;color:#777;margin-left:-2px}.file-edit-content .code-mirror-model{height:calc(100vh - 300px)}.file-edit-content .code-mirror-model .cm-s-mdn-like.CodeMirror{height:calc(100vh - 310px)}.file-edit-content .submit-c{text-align:center;padding-top:12px}.file-operation{padding:30px 0;text-align:center}",""])},1169:function(e,t,n){"use strict";var r={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"main-layout-box"},[n("m-secondary-menu",{attrs:{type:"resource"}}),e._v(" "),n("m-list-construction",{attrs:{title:e.$t("文件详情")}},[n("div",{staticStyle:{margin:"20px"},attrs:{slot:"content"},slot:"content"},[n("div",{staticClass:"file-edit-content"},[n("h2",[n("span",[e._v(e._s(e.name))])]),e._v(" "),[e.msg?e._e():[n("div",{staticClass:"code-mirror-model"},[n("textarea",{attrs:{id:"code-edit-mirror",name:"code-edit-mirror"}})]),e._v(" "),n("div",{staticClass:"submit-c"},[n("x-button",{attrs:{type:"text",shape:"circle",disabled:e.disabled},on:{click:function(t){return e.close()}}},[e._v(" "+e._s(e.$t("返回"))+" ")]),e._v(" "),n("x-button",{attrs:{type:"primary",shape:"circle",loading:e.spinnerLoading},on:{click:function(t){return e.ok()}}},[e._v(e._s(e.spinnerLoading?"Loading...":e.$t("保存"))+" ")])],1)],e._v(" "),e.msg?n("m-no-data",{attrs:{msg:e.msg}}):e._e()],e._v(" "),e.isNoType?e._e():[n("m-no-type")]],2),e._v(" "),n("m-spin",{attrs:{"is-spin":e.isLoading}})],1)])],1)},staticRenderFns:[]};t.a=r},622:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1050),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);var a=n(1169);var s=function(e){n(1167)},l=n(27)(i.a,a.a,!1,s,null,null);t.default=l.exports},639:function(e,t,n){"use strict";t.__esModule=!0,t.default={name:"spin",data:function(){return{}},props:{isSpin:{type:Boolean,default:!0},isLeft:{type:Boolean,default:!0}}}},640:function(e,t,n){"use strict";t.__esModule=!0,t.default={name:"list-construction",data:function(){return{}},props:{title:String}}},641:function(e,t,n){"use strict";t.__esModule=!0;var r,i=n(659),o=(r=i)&&r.__esModule?r:{default:r};t.default={name:"secondary-menu",data:function(){return{menuList:(0,o.default)(this.type),index:0,id:this.$route.params.id,isTogHide:!1}},props:{type:String,className:String},watch:{isTogHide:function(e){var t=$(".main-layout-box");e?t.addClass("toggle"):t.removeClass("toggle")}},methods:{_toggleSubMenu:function(e){e.isOpen=!e.isOpen},_toggleMenu:function(){this.isTogHide=!this.isTogHide}},mounted:function(){}}},643:function(e,t,n){"use strict";t.__esModule=!0,t.default={name:"no-data",props:{msg:String}}},644:function(e,t,n){var r;r=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\//.test(e),d=/Opera\//.test(e),f=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),m=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),g=/Android/.test(e),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),w=d&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(d=!1,l=!0);var k=y&&(c||d&&(null==w||w<12.11)),C=n||a&&s>=9;function _(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var L,S=function(e,t){var n=e.className,r=_(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function M(e,t){return T(e).appendChild(t)}function A(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}m?H=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(H=function(e){try{e.select()}catch(e){}});var I=function(){this.id=null};function R(e,t){for(var n=0;n=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var V=[""];function K(e){for(;V.length<=e;)V.push(Y(V)+" ");return V[e]}function Y(e){return e[e.length-1]}function X(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||J.test(e))}function te(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ee(e))||t.test(e):ee(e)}function ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\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&&re.test(e)}function oe(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function se(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 i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?me(n,se(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?me(e.line,t):n<0?me(e.line,0):e}(t,se(e,t.line).text.length)}function Ce(e,t){for(var n=[],r=0;r=t:o.to>t);(r||(r=[])).push(new Se(a,o.from,s?null:o.to))}}return r}(n,i,a),l=function(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var b=0;bt)&&(!n||He(n,o.marker)<0)&&(n=o.marker)}return n}function Re(e,t,n,r,i){var o=se(e,t),a=Le&&o.markedSpans;if(a)for(var s=0;s=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ge(c.to,n)>=0:ge(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ge(c.from,r)<=0:ge(c.from,r)<0)))return!0}}}function qe(e){for(var t;t=Fe(e);)e=t.find(-1,!0).line;return e}function Be(e,t){var n=se(e,t),r=qe(n);return n==r?t:de(r)}function $e(e,t){if(t>e.lastLine())return t;var n,r=se(e,t);if(!Ue(e,r))return t;for(;n=Pe(r);)r=n.find(1,!0).line;return de(r)+1}function Ue(e,t){var n=Le&&t.markedSpans;if(n)for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}var Ye=null;function Xe(e,t,n){var r;Ye=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:Ye=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:Ye=i)}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]/,i=/[LRr]/,o=/[Lb1n]/,a=/[1n]/;function s(e,t,n){this.level=e,this.from=t,this.to=n}return function(l,c){var u="ltr"==c?"L":"R";if(0==l.length||"ltr"==c&&!n.test(l))return!1;for(var d,f=l.length,h=[],p=0;p-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function rt(e,t){var n=tt(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function st(e){e.prototype.on=function(e,t){et(this,e,t)},e.prototype.off=function(e,t){nt(this,e,t)}}function lt(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ct(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ut(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function dt(e){lt(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 pt,mt,gt=function(){if(a&&s<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function vt(e){if(null==pt){var t=A("span","​");M(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(pt=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=pt?A("span","​"):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function yt(e){if(null!=mt)return mt;var t=M(e,document.createTextNode("AخA")),n=L(t,0,1).getBoundingClientRect(),r=L(t,1,2).getBoundingClientRect();return T(e),!(!n||n.left==n.right)&&(mt=r.right-n.right<3)}var bt,xt=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+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)},kt="oncopy"in(bt=A("div"))||(bt.setAttribute("oncopy","return;"),"function"==typeof bt.oncopy),Ct=null;var _t={},Lt={};function St(e){if("string"==typeof e&&Lt.hasOwnProperty(e))e=Lt[e];else if(e&&"string"==typeof e.name&&Lt.hasOwnProperty(e.name)){var t=Lt[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 St("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return St("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Tt(e,t){t=St(t);var n=_t[t.name];if(!n)return Tt(e,"text/plain");var r=n(e,t);if(Mt.hasOwnProperty(t.name)){var i=Mt[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}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 At(e,t){F(t,Mt.hasOwnProperty(e)?Mt[e]:Mt[e]={})}function Nt(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Ot(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 zt(e,t,n){return!e.startState||e.startState(t,n)}var Dt=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};Dt.prototype.eol=function(){return this.pos>=this.string.length},Dt.prototype.sol=function(){return this.pos==this.lineStart},Dt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Dt.prototype.next=function(){if(this.post},Dt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Dt.prototype.skipToEnd=function(){this.pos=this.string.length},Dt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Dt.prototype.backUp=function(e){this.pos-=e},Dt.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Dt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Dt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Dt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Dt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var Wt=function(e,t){this.state=e,this.lookAhead=t},Ht=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 Et(e,t,n,r){var i=[e.state.modeGen],o={};jt(e,t.text,e.doc.mode,n,function(e,t){return i.push(e,t)},o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],l=1,c=0;n.state=!0,jt(e,t.text,s.mode,n,function(e,t){for(var n=l;ce&&i.splice(l,1,e,i[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength&&Nt(e.doc.mode,r.state),o=Et(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.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 Pt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Ht(r,!0,t);var o=function(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var l=se(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof Wt?c.lookAhead:0)<=o.modeFrontier))return s;var u=P(l.text,null,e.options.tabSize);(null==i||r>u)&&(i=s-1,r=u)}return i}(e,t,n),a=o>r.first&&se(r,o-1).stateAfter,s=a?Ht.fromSaved(r,a,o):new Ht(r,zt(r.mode),o);return r.iter(o,t,function(n){It(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}Ht.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Ht.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}},Ht.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Ht.fromSaved=function(e,t,n){return t instanceof Wt?new Ht(e,Nt(e.mode,t.state),n,t.lookAhead):new Ht(e,Nt(e.mode,t),n)},Ht.prototype.save=function(e){var t=!1!==e?Nt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Wt(t,this.maxLookAhead):t};var Bt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function $t(e,t,n,r){var i,o,a=e.doc,s=a.mode,l=se(a,(t=ke(a,t)).line),c=Pt(e,t.line,n),u=new Dt(l.text,e.options.tabSize,c);for(r&&(o=[]);(r||u.pose.options.maxHighlightLength?(s=!1,a&&It(e,t,r,d.pos),d.pos=t.length,l=null):l=Ut(qt(n,d,r.state,f),o),f){var h=f[0].name;h&&(l="m-"+(l?h+" "+l:h))}if(!s||u!=l){for(;c1&&!/ /.test(e))return e;for(var n=t,r="",i=0;ic&&d.from<=c);f++);if(d.to>=u)return e(n,r,i,o,a,s,l);e(n,r.slice(0,d.to-c),i,o,null,s,l),o=null,r=r.slice(d.to-c),c=d.to}}}function tn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function nn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,c,u,d,f,h=i.length,p=0,m=1,g="",v=0;;){if(v==p){l=c=u=s="",f=null,d=null,v=1/0;for(var y=[],b=void 0,x=0;xp||k.collapsed&&w.to==p&&w.from==p)){if(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,c=""),k.className&&(l+=" "+k.className),k.css&&(s=(s?s+";":"")+k.css),k.startStyle&&w.from==p&&(u+=" "+k.startStyle),k.endStyle&&w.to==v&&(b||(b=[])).push(k.endStyle,w.to),k.title&&((f||(f={})).title=k.title),k.attributes)for(var C in k.attributes)(f||(f={}))[C]=k.attributes[C];k.collapsed&&(!d||He(d.marker,k)<0)&&(d=w)}else w.from>p&&v>w.from&&(v=w.from)}if(b)for(var _=0;_=h)break;for(var S=Math.min(h,v);;){if(g){var T=p+g.length;if(!d){var M=T>S?g.slice(0,S-p):g;t.addToken(t,M,a?a+l:l,u,p+M.length==v?c:"",s,f)}if(T>=S){g=g.slice(S-p),p=S;break}p=T,u=""}g=i.slice(o,o=n[m++]),a=Xt(n[m++],t.cm.options)}}else for(var A=1;An)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Nn(e,t,n,r){return Dn(e,zn(e,t),n,r)}function On(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&t2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,r){var i,o=En(t.map,n,r),l=o.node,c=o.start,u=o.end,d=o.collapse;if(3==l.nodeType){for(var f=0;f<4;f++){for(;c&&ie(t.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u1}(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,i))}else{var h;c>0&&(d=r="right"),i=e.options.lineWrapping&&(h=l.getClientRects()).length>1?h["right"==r?h.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!i||!i.left&&!i.right)){var p=l.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+nr(e.display),top:p.top,bottom:p.bottom}:Hn}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,b=0;bt)&&(i=(o=l-s)-1,t>=l&&(a="right")),null!=i){if(r=e[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],a="left";if("right"==n&&i==l-s)for(;c=0&&(n=e[i]).left==n.right;i--);return n}function Pn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(e,t,n){var r=1==s[t].level;return a(n?e-1:e,r!=n)}var d=Xe(s,l,c),f=Ye,h=u(l,d,"before"==c);return null!=f&&(h.other=u(l,f,"before"!=c)),h}function Kn(e,t){var n=0;t=ke(e.doc,t),e.options.lineWrapping||(n=nr(e.display)*t.ch);var r=se(e.doc,t.line),i=Ge(r)+Cn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Yn(e,t,n,r,i){var o=me(e,t,n);return o.xRel=i,r&&(o.outside=!0),o}function Xn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Yn(r.first,0,null,!0,-1);var i=fe(r,n),o=r.first+r.size-1;if(i>o)return Yn(r.first+r.size-1,se(r,o).text.length,null,!0,1);t<0&&(t=0);for(var a=se(r,i);;){var s=er(e,a,i,t,n),l=Ie(a,s.ch+(s.xRel>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==i)return c;a=se(r,i=c.line)}}function Qn(e,t,n,r){r-=$n(t);var i=t.text.length,o=ae(function(t){return Dn(e,n,t-1).bottom<=r},i,0);return{begin:o,end:i=ae(function(t){return Dn(e,n,t).top>r},o,i)}}function Zn(e,t,n,r){return n||(n=zn(e,t)),Qn(e,t,n,Un(e,t,Dn(e,n,r),"line").top)}function Jn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function er(e,t,n,r,i){i-=Ge(t);var o=zn(e,t),a=$n(t),s=0,l=t.text.length,c=!0,u=Ze(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?function(e,t,n,r,i,o,a){var s=Qn(e,t,r,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,f=0;f=c||h.to<=l)){var p=1!=h.level,m=Dn(e,r,p?Math.min(c,h.to)-1:Math.max(l,h.from)).right,g=mg)&&(u=h,d=g)}}u||(u=i[i.length-1]);u.fromc&&(u={from:u.from,to:c,level:u.level});return u}:function(e,t,n,r,i,o,a){var s=ae(function(s){var l=i[s],c=1!=l.level;return Jn(Vn(e,me(n,c?l.to:l.from,c?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),l=i[s];if(s>0){var c=1!=l.level,u=Vn(e,me(n,c?l.from:l.to,c?"after":"before"),"line",t,r);Jn(u,o,a,!0)&&u.top>a&&(l=i[s-1])}return l})(e,t,n,o,u,r,i);s=(c=1!=d.level)?d.from:d.to-1,l=c?d.to:d.from-1}var f,h,p=null,m=null,g=ae(function(t){var n=Dn(e,o,t);return n.top+=a,n.bottom+=a,!!Jn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,m=n),!0)},s,l),v=!1;if(m){var y=r-m.left=x.bottom}return Yn(n,g=oe(t.text,g,1),h,v,r-f)}function tr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Wn){Wn=A("pre");for(var t=0;t<49;++t)Wn.appendChild(document.createTextNode("x")),Wn.appendChild(A("br"));Wn.appendChild(document.createTextNode("x"))}M(e.measure,Wn);var n=Wn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function nr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),n=A("pre",[t]);M(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function rr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)n[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,r[e.options.gutters[a]]=o.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 or(e){var t=tr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/nr(e.display)-3);return function(i){if(Ue(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r=e.display.viewTo||s.to().linet||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}(m,n||0,null==r?f:r,function(e,t,i,d){var g="ltr"==i,v=h(e,g?"left":"right"),y=h(t-1,g?"right":"left"),b=null==n&&0==e,x=null==r&&t==f,w=0==d,k=!m||d==m.length-1;if(y.top-v.top<=3){var C=(c?x:b)&&k,_=(c?b:x)&&w?s:(g?v:y).left,L=C?l:(g?y:v).right;u(_,v.top,L-_,v.bottom)}else{var S,T,M,A;g?(S=c&&b&&w?s:v.left,T=c?l:p(e,i,"before"),M=c?s:p(t,i,"after"),A=c&&x&&k?l:y.right):(S=c?p(e,i,"before"):s,T=!c&&b&&w?l:v.right,M=!c&&x&&k?s:y.left,A=c?p(t,i,"after"):l),u(S,v.top,T-S,v.bottom),v.bottom0?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(),vr(e))}function gr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,yr(e))},100)}function vr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(rt(e,"focus",e,t),e.state.focused=!0,D(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),pr(e))}function yr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(rt(e,"blur",e,t),e.state.focused=!1,S(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function br(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r.005||f<-.005)&&(ue(i.line,l),xr(i.line),i.rest))for(var h=0;he.display.sizerWidth){var p=Math.ceil(c/nr(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function xr(e){if(e.widgets)for(var t=0;t=a&&(o=fe(t,Ge(se(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function kr(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,i=t.gutters.offsetWidth,o=r+"px",a=0;ao&&(t.bottom=t.top+o);var s=e.doc.height+_n(n),l=t.tops-r;if(t.topi+o){var u=Math.min(t.top,(c?s:t.bottom)-o);u!=i&&(a.scrollTop=u)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,f=Tn(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),h=t.right-t.left>f;return h&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.leftf+d-3&&(a.scrollLeft=t.right+(h?0:10)-f),a}function Lr(e,t){null!=t&&(Mr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Sr(e){Mr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Tr(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;t&&(e.curOp.scrollToPos=null,Ar(e,Kn(e,t.from),Kn(e,t.to),t.margin))}function Ar(e,t,n,r){var i=_r(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});Tr(e,i.scrollLeft,i.scrollTop)}function Nr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||si(e,{top:t}),Or(e,t,!0),n&&si(e),ni(e,100))}function Or(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 zr(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,kr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Dr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+_n(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+Sn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Wr=function(e,t,n){this.cm=n;var r=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),et(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),et(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Wr.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 i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"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 o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"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}},Wr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Wr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Wr.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 I,this.disableVert=new I},Wr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)})},Wr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Hr=function(){};function Er(e,t){t||(t=Dr(e));var n=e.display.barWidth,r=e.display.barHeight;Fr(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&br(e),Fr(e,Dr(e)),n=e.display.barWidth,r=e.display.barHeight}function Fr(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=""}Hr.prototype.update=function(){return{bottom:0,right:0}},Hr.prototype.setScrollLeft=function(){},Hr.prototype.setScrollTop=function(){},Hr.prototype.clear=function(){};var Pr={native:Wr,null:Hr};function Ir(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&S(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Pr[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),et(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?zr(e,t):Nr(e,t)},e),e.display.scrollbars.addClass&&D(e.display.wrapper,e.display.scrollbars.addClass)}var Rr=0;function qr(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Rr},t=e.curOp,an?an.ops.push(t):t.ownsGroup=an={ops:[t],delayedCallbacks:[]}}function Br(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ii(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ur(e){var t=e.cm,n=t.display;e.updatedDisplay&&br(t),e.barMeasure=Dr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Nn(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+Sn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Tn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function jr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=A("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Cn(e.display))+"px;\n height: "+(t.bottom-t.top+Sn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?me(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?me(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=Vn(e,t),l=n&&n!=t?Vn(e,n):s,c=_r(e,i={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}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(Nr(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(zr(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}(t,ke(r,e.scrollToPos.from),ke(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;at)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Le&&Be(e.doc,t)i.viewFrom?Jr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Jr(e);else if(t<=i.viewFrom){var o=ei(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Jr(e)}else if(n>=i.viewTo){var a=ei(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):Jr(e)}else{var s=ei(e,t,t,-1),l=ei(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(on(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):Jr(e)}var c=i.externalMeasured;c&&(n=i.lineN&&t=r.viewTo)){var o=r.view[lr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==R(a,n)&&a.push(n)}}}function Jr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ei(e,t,n,r){var i,o=lr(e,t),a=e.display.view;if(!Le||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;Be(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function ti(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo)){var n=+new Date+e.options.workTime,r=Pt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?Nt(t.mode,r.state):null,l=Et(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),f=0;!d&&fn)return ni(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Vr(e,function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==ti(e))return!1;Cr(e)&&(Jr(e),t.dims=rr(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Le&&(o=Be(e.doc,o),a=$e(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=on(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=on(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,lr(e,n)))),r.viewTo=n}(e,o,a),n.viewOffset=Ge(se(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=ti(e);if(!s&&0==c&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=z();if(!t||!O(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&O(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return c>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=r.view,u=r.viewFrom,d=0;d-1&&(h=!1),un(e,f,u,n)),h&&(T(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(pe(e.options,u)))),a=f.node.nextSibling}else{var p=vn(e,f,u,n);o.insertBefore(p,a)}u+=f.size}for(;a;)a=s(a)}(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=z()&&(e.activeElt.focus(),e.anchorNode&&O(document.body,e.anchorNode)&&O(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(u),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ni(e,400)),n.updateLineNumbers=null,!0}function ai(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Tn(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+_n(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)))&&oi(e,t);r=!1){br(e);var i=Dr(e);cr(e),Er(e,i),ci(e,i),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 si(e,t){var n=new ii(e,t);if(oi(e,n)){br(e),ai(e,n);var r=Dr(e);cr(e),Er(e,r),ci(e,r),n.finish()}}function li(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function ci(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+Sn(e)+"px"}function ui(e){var t=e.display.gutters,n=e.options.gutters;T(t);for(var r=0;r-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}ii.prototype.signal=function(e,t){at(e,t)&&this.events.push(arguments)},ii.prototype.finish=function(){for(var e=0;es.clientWidth,u=s.scrollHeight>s.clientHeight;if(i&&c||o&&u){if(o&&y&&l)e:for(var f=t.target,h=a.view;f!=s;f=f.parentNode)for(var p=0;p=0&&ge(e,r.to())<=0)return n}return-1};var yi=function(e,t){this.anchor=e,this.head=t};function bi(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(e,t){return ge(e.from(),t.from())}),n=R(t,i);for(var o=1;o0:l>=0){var c=xe(s.from(),a.from()),u=be(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new yi(d?u:c,d?c:u))}}return new vi(t,n)}function xi(e,t){return new vi([new yi(e,t||e)],0)}function wi(e){return e.text?me(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function ki(e,t){if(ge(e,t.from)<0)return e;if(ge(e,t.to)<=0)return wi(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+=wi(t).ch-t.to.ch),me(n,r)}function Ci(e,t){for(var n=[],r=0;r1&&e.remove(s.line+1,p-1),e.insert(s.line+1,v)}ln(e,"change",e,t)}function Ai(e,t,n){!function e(r,i,o){if(r.linked)for(var a=0;as-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Wi(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}(i,i.lastOp==r)))a=Y(o.changes),0==ge(t.from,t.to)&&0==ge(t.from,a.to)?a.to=wi(t):o.changes.push(Di(e,t));else{var l=Y(i.done);for(l&&l.ranges||Fi(e.sel,i.done),o={changes:[Di(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||rt(e,"historyAdded")}function Ei(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,Y(i.done),t))?i.done[i.done.length-1]=t:Fi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Wi(i.undone)}function Fi(e,t){var n=Y(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Pi(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function Ii(e){if(!e)return null;for(var t,n=0;n-1&&(Y(s)[d]=c[d],delete c[d])}}}return r}function Bi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=ge(t,i)<0;o!=ge(n,i)<0?(i=t,t=n):o!=ge(t,n)<0&&(t=n)}return new yi(i,t)}return new yi(n||t,t)}function $i(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Ki(e,new vi([Bi(e.sel.primary(),t,n,i)],0),r)}function Ui(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:s.to>t.ch))){if(i&&(rt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var c=l.find(r<0?1:-1),u=void 0;if((r<0?l.inclusiveRight:l.inclusiveLeft)&&(c=to(e,c,-r,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=ge(c,n))&&(r<0?u<0:u>0))return Ji(e,c,t,r,i)}var d=l.find(r<0?-1:1);return(r<0?l.inclusiveLeft:l.inclusiveRight)&&(d=to(e,d,r,d.line==t.line?o:null)),d?Ji(e,d,t,r,i):null}}return t}function eo(e,t,n,r,i){var o=r||1,a=Ji(e,t,n,o,i)||!i&&Ji(e,t,n,o,!0)||Ji(e,t,n,-o,i)||!i&&Ji(e,t,n,-o,!0);return a||(e.cantEdit=!0,me(e.first,0))}function to(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?ke(e,me(t.line-1)):null:n>0&&t.ch==(r||se(e,t.line)).text.length?t.line0)){var u=[l,1],d=ge(c.from,s.from),f=ge(c.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:s.from}),(f>0||!a.inclusiveRight&&!f)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)oo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else oo(e,t)}}function oo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ge(t.from,t.to)){var n=Ci(e,t);Hi(e,t,n,e.cm?e.cm.curOp.id:NaN),lo(e,t,n,Ae(e,t));var r=[];Ai(e,function(e,n){n||-1!=R(r,e.history)||(ho(e.history,t),r.push(e.history)),lo(e,t,null,Ae(e,t))})}}function ao(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,c=0;c=0;--h){var p=f(h);if(p)return p.v}}}}function so(e,t){if(0!=t&&(e.first+=t,e.sel=new vi(X(e.sel.ranges,function(e){return new yi(me(e.anchor.line+t,e.anchor.ch),me(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;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:me(o,se(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=le(e,t.from,t.to),n||(n=Ci(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=de(qe(se(r,o.line))),r.iter(l,a.line+1,function(e){if(e==i.maxLine)return s=!0,!0}));r.sel.contains(t.from,t.to)>-1&&ot(e);Mi(r,t,n,or(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,function(e){var t=Ve(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0));(function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=se(e,r).stateAfter;if(i&&(!(i instanceof Wt)||r+i.lookAhead1||!(this.children[0]instanceof mo))){var s=[];this.collapse(s),this.children=[new mo(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=N("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Re(e,t.line,t,n,o)||t.line!=n.line&&Re(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Le=!0}o.addToHistory&&Hi(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&qe(e)==c.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&ue(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new Se(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l}),o.collapsed&&e.iter(t.line,n.line+1,function(t){Ue(e,t)&&ue(t,0)}),o.clearOnEnter&&et(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(_e=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++bo,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)Qr(c,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=n.line;u++)Zr(c,u,"text");o.atomic&&Qi(c.doc),ln(c,"markerAdded",c,o)}return o}xo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&qr(e),at(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Qr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Qi(e.doc)),e&&ln(e,"markerCleared",e,this,r,i),t&&Br(e),this.parent&&this.parent.clear()}},xo.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=0;l--)io(this,r[l]);s?Vi(this,s):this.cm&&Sr(this.cm)}),undo:Xr(function(){ao(this,"undo")}),redo:Xr(function(){ao(this,"redo")}),undoSelection:Xr(function(){ao(this,"undo",!0)}),redoSelection:Xr(function(){ao(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.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ke(this,e),t=ke(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n}),ke(this,me(n,t))},indexFromPos:function(e){var t=(e=ke(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var u=e.dataTransfer.getData("Text");if(u){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),Yi(t.doc,xi(n,n)),d)for(var f=0;f=0;t--)co(e.doc,"",r[t].from,r[t].to,"+delete");Sr(e)})}function Vo(e,t,n){var r=oe(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ko(e,t,n){var r=Vo(e,t.ch,n);return null==r?null:new me(t.line,r,n<0?"after":"before")}function Yo(e,t,n,r,i){if(e){var o=Ze(n,t.doc.direction);if(o){var a,s=i<0?Y(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=zn(t,n);a=i<0?n.text.length-1:0;var u=Dn(t,c,a).top;a=ae(function(e){return Dn(t,c,e).top==u},i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Vo(n,a,1))}else a=i<0?s.to:s.from;return new me(r,a,l)}}return new me(r,i<0?n.text.length:0,i<0?"before":"after")}Po.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"},Po.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"},Po.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"},Po.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"]},Po.default=y?Po.macDefault:Po.pcDefault;var Xo={selectAll:no,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),$)},killLine:function(e){return Go(e,function(t){if(t.empty()){var n=se(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new me(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),me(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=se(e.doc,i.line-1).text;a&&(i=new me(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),me(i.line-1,a.length-1),i,"+transpose"))}n.push(new yi(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Vr(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-1&&(ge((i=c.ranges[i]).from(),t)<0||t.xRel>0)&&(ge(i.to(),t)>0||t.xRel<0)?function(e,t,n,r){var i=e.display,o=!1,c=Kr(e,function(t){l&&(i.scroller.draggable=!1),e.state.draggingText=!1,nt(i.wrapper.ownerDocument,"mouseup",c),nt(i.wrapper.ownerDocument,"mousemove",u),nt(i.scroller,"dragstart",d),nt(i.scroller,"drop",c),o||(lt(t),r.addNew||$i(e.doc,n,null,null,r.extend),l||a&&9==s?setTimeout(function(){i.wrapper.ownerDocument.body.focus(),i.input.focus()},20):i.input.focus())}),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return o=!0};l&&(i.scroller.draggable=!0);e.state.draggingText=c,c.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop();et(i.wrapper.ownerDocument,"mouseup",c),et(i.wrapper.ownerDocument,"mousemove",u),et(i.scroller,"dragstart",d),et(i.scroller,"drop",c),gr(e),setTimeout(function(){return i.input.focus()},20)}(e,r,t,o):function(e,t,n,r){var i=e.display,o=e.doc;lt(t);var a,s,l=o.sel,c=l.ranges;r.addNew&&!r.extend?(s=o.sel.contains(n),a=s>-1?c[s]:new yi(n,n)):(a=o.sel.primary(),s=o.sel.primIndex);if("rectangle"==r.unit)r.addNew||(a=new yi(n,n)),n=sr(e,t,!0,!0),s=-1;else{var u=fa(e,n,r.unit);a=r.extend?Bi(a,u.anchor,u.head,r.extend):u}r.addNew?-1==s?(s=c.length,Ki(o,bi(e,c.concat([a]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&"char"==r.unit&&!r.extend?(Ki(o,bi(e,c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):ji(o,s,a,U):(s=0,Ki(o,new vi([a],0),U),l=o.sel);var d=n;function f(t){if(0!=ge(d,t))if(d=t,"rectangle"==r.unit){for(var i=[],c=e.options.tabSize,u=P(se(o,n.line).text,n.ch,c),f=P(se(o,t.line).text,t.ch,c),h=Math.min(u,f),p=Math.max(u,f),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=se(o,m).text,y=G(v,h,c);h==p?i.push(new yi(me(m,y),me(m,y))):v.length>y&&i.push(new yi(me(m,y),me(m,G(v,p,c))))}i.length||i.push(new yi(n,n)),Ki(o,bi(e,l.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,x=a,w=fa(e,t,r.unit),k=x.anchor;ge(w.anchor,k)>0?(b=w.head,k=xe(x.from(),w.anchor)):(b=w.anchor,k=be(x.to(),w.head));var C=l.ranges.slice(0);C[s]=function(e,t){var n=t.anchor,r=t.head,i=se(e.doc,n.line);if(0==ge(n,r)&&n.sticky==r.sticky)return t;var o=Ze(i);if(!o)return t;var a=Xe(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=Xe(o,r.ch,r.sticky),d=u-a||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?d<0:d>0}var f=o[c+(l?-1:0)],h=l==(1==f.level),p=h?f.from:f.to,m=h?"after":"before";return n.ch==p&&n.sticky==m?t:new yi(new me(n.line,p,m),r)}(e,new yi(ke(o,k),b)),Ki(o,bi(e,C,s),U)}}var h=i.wrapper.getBoundingClientRect(),p=0;function m(t){e.state.selectingText=!1,p=1/0,lt(t),i.input.focus(),nt(i.wrapper.ownerDocument,"mousemove",g),nt(i.wrapper.ownerDocument,"mouseup",v),o.history.lastSelOrigin=null}var g=Kr(e,function(t){0!==t.buttons&&ht(t)?function t(n){var a=++p;var s=sr(e,n,!0,"rectangle"==r.unit);if(!s)return;if(0!=ge(s,d)){e.curOp.focus=z(),f(s);var l=wr(i,o);(s.line>=l.to||s.lineh.bottom?20:0;c&&setTimeout(Kr(e,function(){p==a&&(i.scroller.scrollTop+=c,t(n))}),50)}}(t):m(t)}),v=Kr(e,m);e.state.selectingText=v,et(i.wrapper.ownerDocument,"mousemove",g),et(i.wrapper.ownerDocument,"mouseup",v)}(e,r,t,o)}(t,r,o,e):ft(e)==n.scroller&<(e):2==i?(r&&$i(t.doc,r),setTimeout(function(){return n.input.focus()},20)):3==i&&(C?t.display.input.onContextMenu(e):gr(t)))}}function fa(e,t,n){if("char"==n)return new yi(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new yi(me(t.line,0),ke(e.doc,me(t.line+1,0)));var r=n(e,t);return new yi(r.from,r.to)}function ha(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&<(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!at(e,n))return ut(t);o-=s.top-a.viewOffset;for(var l=0;l=i)return rt(e,n,e,fe(e.doc,o),e.options.gutters[l],t),ut(t)}}function pa(e,t){return ha(e,t,"gutterClick",!0)}function ma(e,t){kn(e.display,t)||function(e,t){if(!at(e,"gutterContextMenu"))return!1;return ha(e,t,"gutterContextMenu",!1)}(e,t)||it(e,t,"contextmenu")||C||e.display.input.onContextMenu(t)}function ga(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Rn(e)}ua.prototype.compare=function(e,t,n){return this.time+400>e&&0==ge(t,this.pos)&&n==this.button};var va={toString:function(){return"CodeMirror.Init"}},ya={},ba={};function xa(e){ui(e),Qr(e),kr(e)}function wa(e,t,n){if(!t!=!(n&&n!=va)){var r=e.display.dragFunctions,i=t?et:nt;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function ka(e){e.options.lineWrapping?(D(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(S(e.display.wrapper,"CodeMirror-wrap"),Ke(e)),ar(e),Qr(e),Rn(e),setTimeout(function(){return Er(e)},100)}function Ca(e,t){var r=this;if(!(this instanceof Ca))return new Ca(e,t);this.options=t=t?F(t):{},F(ya,t,!1),di(t);var i=t.value;"string"==typeof i?i=new So(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var o=new Ca.inputStyles[t.inputStyle](this),c=this.display=new function(e,t,r){var i=this;this.input=r,i.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=N("div",null,"CodeMirror-code"),i.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=A("div",null,"CodeMirror-cursors"),i.measure=A("div",null,"CodeMirror-measure"),i.lineMeasure=A("div",null,"CodeMirror-measure"),i.lineSpace=N("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=N("div",[i.lineSpace],"CodeMirror-lines");i.mover=A("div",[o],null,"position: relative"),i.sizer=A("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=A("div",null,null,"position: absolute; height: "+q+"px; width: 1px;"),i.gutters=A("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=A("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=A("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),a&&s<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),l||n&&v||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,r.init(i)}(e,i,o);for(var u in c.wrapper.CodeMirror=this,ui(this),ga(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ir(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 I,keySeq:null,specialChars:null},t.autofocus&&!v&&c.input.focus(),a&&s<11&&setTimeout(function(){return r.display.input.reset(!0)},20),function(e){var t=e.display;et(t.scroller,"mousedown",Kr(e,da)),et(t.scroller,"dblclick",a&&s<11?Kr(e,function(t){if(!it(e,t)){var n=sr(e,t);if(n&&!pa(e,t)&&!kn(e.display,t)){lt(t);var r=e.findWordAt(n);$i(e.doc,r.anchor,r.head)}}}):function(t){return it(e,t)||lt(t)});et(t.scroller,"contextmenu",function(t){return ma(e,t)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),(r=t.activeTouch).end=+new Date)}function o(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}et(t.scroller,"touchstart",function(i){if(!it(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!pa(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),et(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),et(t.scroller,"touchend",function(n){var r=t.activeTouch;if(r&&!kn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var a,s=e.coordsChar(t.activeTouch,"page");a=!r.prev||o(r,r.prev)?new yi(s,s):!r.prev.prev||o(r,r.prev.prev)?e.findWordAt(s):new yi(me(s.line,0),ke(e.doc,me(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),lt(n)}i()}),et(t.scroller,"touchcancel",i),et(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Nr(e,t.scroller.scrollTop),zr(e,t.scroller.scrollLeft,!0),rt(e,"scroll",e))}),et(t.scroller,"mousewheel",function(t){return gi(e,t)}),et(t.scroller,"DOMMouseScroll",function(t){return gi(e,t)}),et(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){it(e,t)||dt(t)},over:function(t){it(e,t)||(!function(e,t){var n=sr(e,t);if(n){var r=document.createDocumentFragment();dr(e,n,r),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),M(e.display.dragCursor,r)}}(e,t),dt(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-To<100))dt(t);else if(!it(e,t)&&!kn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f)){var n=A("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}(e,t)},drop:Kr(e,Mo),leave:function(t){it(e,t)||Ao(e)}};var l=t.input.getField();et(l,"keyup",function(t){return aa.call(e,t)}),et(l,"keydown",Kr(e,oa)),et(l,"keypress",Kr(e,sa)),et(l,"focus",function(t){return vr(e,t)}),et(l,"blur",function(t){return yr(e,t)})}(this),zo(),qr(this),this.curOp.forceUpdate=!0,Ni(this,i),t.autofocus&&!v||this.hasFocus()?setTimeout(E(vr,this),20):yr(this),ba)ba.hasOwnProperty(u)&&ba[u](r,t[u],va);Cr(this),t.finishInit&&t.finishInit(this);for(var h=0;h<_a.length;++h)_a[h](r);Br(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(c.lineDiv).textRendering&&(c.lineDiv.style.textRendering="auto")}Ca.defaults=ya,Ca.optionHandlers=ba;var _a=[];function La(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=Pt(e,t).state:n="prev");var a=e.options.tabSize,s=se(o,t),l=P(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((c=o.mode.indent(i,s.text.slice(u.length),s.text))==B||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?P(se(o,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var d="",f=0;if(e.options.indentWithTabs)for(var h=Math.floor(c/a);h;--h)f+=a,d+="\t";if(fa,l=xt(t),c=null;if(s&&r.ranges.length>1)if(Sa&&Sa.text.join("\n")==t){if(r.ranges.length%Sa.text.length==0){c=[];for(var u=0;u=0;f--){var h=r.ranges[f],p=h.from(),m=h.to();h.empty()&&(n&&n>0?p=me(p.line,p.ch-n):e.state.overwrite&&!s?m=me(m.line,Math.min(se(o,m.line).text.length,m.ch+Y(l).length)):s&&Sa&&Sa.lineWise&&Sa.text.join("\n")==t&&(p=m=me(p.line,0)));var g={from:p,to:m,text:c?c[f%c.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};io(e.doc,g),ln(e,"inputRead",e,g)}t&&!s&&Na(e,t),Sr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Aa(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Vr(t,function(){return Ma(t,n,0,null,"paste")}),!0}function Na(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=La(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(se(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=La(e,i.head.line,"smart"));a&&ln(e,"electricInput",e,i.head.line)}}}function Oa(e){for(var t=[],n=[],r=0;r=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=Xe(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&f>=u.begin)){var h=d?"before":"after";return new me(n.line,f,h)}}var p=function(e,t,r){for(var o=function(e,t){return t?new me(n.line,l(e,1),"before"):new me(n.line,e,"after")};e>=0&&e0==(1!=a.level),c=s?r.begin:l(r.end,-1);if(a.from<=c&&c0?u.end:l(u.begin,-1);return null==g||r>0&&g==t.text.length||!(m=p(r>0?0:i.length-1,r,c(g)))?null:m}(e.cm,s,t,n):Ko(s,t,n))){if(r||(a=t.line+n)=e.first+e.size||(t=new me(a,t.ch,t.sticky),!(s=se(e,a))))return!1;t=Yo(i,e.cm,s,t.line,n)}else t=o;return!0}if("char"==r)l();else if("column"==r)l(!0);else if("word"==r||"group"==r)for(var c=null,u="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(n<0)||l(!f);f=!1){var h=s.text.charAt(t.ch)||"\n",p=te(h,d)?"w":u&&"\n"==h?"n":!u||/\s/.test(h)?null:"p";if(!u||f||p||(p="s"),c&&c!=p){n<0&&(n=1,l(),t.sticky="after");break}if(p&&(c=p),n>0&&!l(!f))break}var m=eo(e,t,o,a,!0);return ve(o,m)&&(m.hitSide=!0),m}function Ha(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*tr(e.display),3);i=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Xn(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Ea=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new I,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Fa(e,t){var n=On(e,t.line);if(!n||n.hidden)return null;var r=se(e.doc,t.line),i=An(n,r,t.line),o=Ze(r,e.doc.direction),a="left";o&&(a=Xe(o,t.ch)%2?"right":"left");var s=En(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Pa(e,t){return t&&(e.bad=!0),e}function Ia(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Pa(e.clipPos(me(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 i=0;i=t.display.viewTo||o.line=t.display.viewFrom&&Fa(t,i)||{node:l[0].measure.map[2],offset:0},u=o.liner.firstLine()&&(a=me(a.line-1,se(r.doc,a.line-1).length)),s.ch==se(r.doc,s.line).text.length&&s.linei.viewTo-1)return!1;a.line==i.viewFrom||0==(e=lr(r,a.line))?(t=de(i.view[0].line),n=i.view[0].node):(t=de(i.view[e].line),n=i.view[e-1].node.nextSibling);var l,c,u=lr(r,s.line);if(u==i.view.length-1?(l=i.viewTo-1,c=i.lineDiv.lastChild):(l=de(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(function(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function c(){a&&(o+=s,l&&(o+=s),a=l=!1)}function u(e){e&&(c(),o+=e)}function d(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void u(n);var o,f=t.getAttribute("cm-marker");if(f){var h=e.findMarks(me(r,0),me(i+1,0),(g=+f,function(e){return e.id==g}));return void(h.length&&(o=h[0].find(0))&&u(le(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;p&&c();for(var m=0;m1&&f.length>1;)if(Y(d)==Y(f))d.pop(),f.pop(),l--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var h=0,p=0,m=d[0],g=f[0],v=Math.min(m.length,g.length);ha.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)h--,p++;d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,"");var w=me(t,h),k=me(l,f.length?Y(f).length-p:0);return d.length>1||d[0]||ge(w,k)?(co(r.doc,d,w,k,"+input"),!0):void 0},Ea.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ea.prototype.reset=function(){this.forceCompositionEnd()},Ea.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ea.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))},Ea.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Vr(this.cm,function(){return Qr(e.cm)})},Ea.prototype.setUneditable=function(e){e.contentEditable="false"},Ea.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Kr(this.cm,Ma)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ea.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ea.prototype.onContextMenu=function(){},Ea.prototype.resetPosition=function(){},Ea.prototype.needsContentAttribute=!0;var qa=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new I,this.hasSelection=!1,this.composing=null};qa.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!it(r,e)){if(r.somethingSelected())Ta({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Oa(r);Ta({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,$):(n.prevInput="",i.value=t.text.join("\n"),H(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),et(i,"input",function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),et(i,"paste",function(e){it(r,e)||Aa(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())}),et(i,"cut",o),et(i,"copy",o),et(e.scroller,"paste",function(t){if(!kn(e,t)&&!it(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}}),et(e.lineSpace,"selectstart",function(t){kn(e,t)||lt(t)}),et(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"})}}),et(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},qa.prototype.createField=function(e){this.wrapper=Da(),this.textarea=this.wrapper.firstChild},qa.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=ur(e);if(e.options.moveInputWithCursor){var i=Vn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},qa.prototype.showSelection=function(e){var t=this.cm.display;M(t.cursorDiv,e.cursors),M(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},qa.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&&H(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},qa.prototype.getField=function(){return this.textarea},qa.prototype.supportsTouch=function(){return!1},qa.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||z()!=this.textarea))try{this.textarea.focus()}catch(e){}},qa.prototype.blur=function(){this.textarea.blur()},qa.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},qa.prototype.receivedFocus=function(){this.slowPoll()},qa.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},qa.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))})},qa.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 i=n.value;if(i==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(r.length,i.length);l1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},qa.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},qa.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},qa.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=sr(n,e),c=r.scroller.scrollTop;if(o&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Kr(n,Ki)(n.doc,xi(o),$);var u,f=i.style.cssText,h=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=window.scrollY),r.input.focus(),l&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&g(),C){dt(e);var m=function(){nt(window,"mouseup",m),setTimeout(v,20)};et(window,"mouseup",m)}else setTimeout(v,50)}function g(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=h,i.style.cssText=f,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=i.selectionStart)){(!a||a&&s<9)&&g();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?Kr(n,no)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},qa.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},qa.prototype.setUneditable=function(){},qa.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=va&&i(e,t,n)}:i)}e.defineOption=n,e.Init=va,n("value","",function(e,t){return e.setValue(t)},!0),n("mode",null,function(e,t){e.doc.modeOption=t,Li(e)},!0),n("indentUnit",2,Li,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(e){Si(e),Rn(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 i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(me(r,o))}r++});for(var i=n.length-1;i>=0;i--)co(e.doc,t,n[i],me(n[i].line,n[i].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!=va&&e.refresh()}),n("specialCharPlaceholder",Zt,function(e){return e.refresh()},!0),n("electricChars",!0),n("inputStyle",v?"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("autocorrect",!1,function(e,t){return e.getInputField().autocorrect=t},!0),n("autocapitalize",!1,function(e,t){return e.getInputField().autocapitalize=t},!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",function(e){ga(e),xa(e)},!0),n("keyMap","default",function(e,t,n){var r=jo(t),i=n!=va&&jo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,ka,!0),n("gutters",[],function(e){di(e.options),xa(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 Er(e)},!0),n("scrollbarStyle","native",function(e){Ir(e),Er(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),n("lineNumbers",!1,function(e){di(e.options),xa(e)},!0),n("firstLineNumber",1,xa,!0),n("lineNumberFormatter",function(e){return e},xa,!0),n("showCursorWhenSelecting",!1,cr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),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,Si,!0),n("addModeClass",!1,Si,!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,Si,!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),n("phrases",null)}(Ca),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,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&Kr(this,t[e])(this,n,i),rt(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"](jo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(La(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Sr(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&ji(this.doc,r,new yi(o,c[r].to()),$)}}}),getTokenAt:function(e,t){return $t(this,e,t)},getLineTokens:function(e,t){return $t(this,me(e),t,!0)},getTokenTypeAt:function(e){e=ke(this.doc,e);var t,n=Ft(this,se(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(e=o,i=!0),r=se(this.doc,e)}else r=e;return Un(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-Ge(r):0)},defaultTextHeight:function(){return tr(this.display)},defaultCharWidth:function(){return nr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o,a,s,l=this.display,c=(e=Vn(this,ke(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==r)c=e.top;else if("above"==r||"near"==r){var d=Math.max(l.wrapper.clientHeight,this.doc.height),f=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>d)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=d&&(c=e.bottom),u+t.offsetWidth>f&&(u=f-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==i?(u=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?u=0:"middle"==i&&(u=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&(o=this,a={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(s=_r(o,a)).scrollTop&&Nr(o,s.scrollTop),null!=s.scrollLeft&&zr(o,s.scrollLeft))},triggerOnKeyDown:Yr(oa),triggerOnKeyPress:Yr(sa),triggerOnKeyUp:aa,triggerOnMouseDown:Yr(da),execCommand:function(e){if(Xo.hasOwnProperty(e))return Xo[e].call(null,this)},triggerElectric:Yr(function(e){Na(this,e)}),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=ke(this.doc,e),a=0;a0&&a(t.charAt(n-1));)--n;for(;r.5)&&ar(this),rt(this,"refresh",this)}),swapDoc:Yr(function(e){var t=this.doc;return t.cm=null,Ni(this,e),Rn(this),this.display.input.reset(),Tr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ln(this,"swapDoc",this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},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}},st(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}(Ca);var Ba="iter insert remove copy getEditor constructor".split(" ");for(var $a in So.prototype)So.prototype.hasOwnProperty($a)&&R(Ba,$a)<0&&(Ca.prototype[$a]=function(e){return function(){return e.apply(this.doc,arguments)}}(So.prototype[$a]));return st(So),Ca.inputStyles={textarea:qa,contenteditable:Ea},Ca.defineMode=function(e){Ca.defaults.mode||"null"==e||(Ca.defaults.mode=e),function(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),_t[e]=t}.apply(this,arguments)},Ca.defineMIME=function(e,t){Lt[e]=t},Ca.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ca.defineMIME("text/plain","null"),Ca.defineExtension=function(e,t){Ca.prototype[e]=t},Ca.defineDocExtension=function(e,t){So.prototype[e]=t},Ca.fromTextArea=function(e,t){if((t=t?F(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=z();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(et(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(t){t.save=r,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,r(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(nt(e.form,"submit",r),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var s=Ca(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s},function(e){e.off=nt,e.on=et,e.wheelEventPixels=mi,e.Doc=So,e.splitLines=xt,e.countColumn=P,e.findColumn=G,e.isWordChar=ee,e.Pass=B,e.signal=rt,e.Line=Gt,e.changeEnd=wi,e.scrollbarModel=Pr,e.Pos=me,e.cmpPos=ge,e.modes=_t,e.mimeModes=Lt,e.resolveMode=St,e.getMode=Tt,e.modeExtensions=Mt,e.extendMode=At,e.copyState=Nt,e.startState=zt,e.innerMode=Ot,e.commands=Xo,e.keyMap=Po,e.keyName=Uo,e.isModifierKey=Bo,e.lookupKey=qo,e.normalizeKeyMap=Ro,e.StringStream=Dt,e.SharedTextMarker=ko,e.TextMarker=xo,e.LineWidget=vo,e.e_preventDefault=lt,e.e_stopPropagation=ct,e.e_stop=dt,e.addClass=D,e.contains=O,e.rmClass=S,e.keyNames=Wo}(Ca),Ca.version="5.45.0",Ca},e.exports=r()},646:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(639),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);var a=n(649);var s=function(e){n(647)},l=n(27)(i.a,a.a,!1,s,null,null);t.default=l.exports},647:function(e,t,n){var r=n(648);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(35)("3d76622a",r,!0,{})},648:function(e,t,n){(e.exports=n(34)(!1)).push([e.i,"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}",""])},649:function(e,t,n){"use strict";var r={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.isSpin?n("div",{class:e.isLeft?"spin-sp2":"spin-sp1",attrs:{id:"spin-model"}},[n("div",{staticClass:"svg-box"},[n("svg",{staticClass:"lds-gears",staticStyle:{background:"none"},attrs:{width:"54px",height:"54px",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"}},[n("g",{attrs:{transform:"translate(50 50)"}},[n("g",{attrs:{transform:"translate(-19 -19) scale(0.6)"}},[n("g",{attrs:{transform:"rotate(107.866)"}},[n("animateTransform",{attrs:{attributeName:"transform",type:"rotate",values:"0;360",keyTimes:"0;1",dur:"1s",begin:"0s",repeatCount:"indefinite"}}),n("path",{attrs:{d:"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23",fill:"#0097e0"}})],1)]),e._v(" "),n("g",{attrs:{transform:"translate(19 19) scale(0.6)"}},[n("g",{attrs:{transform:"rotate(229.634)"}},[n("animateTransform",{attrs:{attributeName:"transform",type:"rotate",values:"360;0",keyTimes:"0;1",dur:"1s",begin:"-0.0625s",repeatCount:"indefinite"}}),n("path",{attrs:{d:"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23",fill:"#7f8b95"}})],1)])])]),e._v(" "),n("span",{staticClass:"sp1"},[e._v(e._s(e.$t("正在努力加载中...")))])])]):e._e()},staticRenderFns:[]};t.a=r},650:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(640),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);var a=n(653);var s=function(e){n(651)},l=n(27)(i.a,a.a,!1,s,null,null);t.default=l.exports},651:function(e,t,n){var r=n(652);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(35)("70439c42",r,!0,{})},652:function(e,t,n){(e.exports=n(34)(!1)).push([e.i,"",""])},653:function(e,t,n){"use strict";var r={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"home-main list-construction-model"},[t("div",{staticClass:"content-title"},[t("span",[this._v(this._s(this.title))])]),this._v(" "),t("div",{staticClass:"conditions-box"},[this._t("conditions")],2),this._v(" "),t("div",{staticClass:"list-box"},[this._t("content")],2)])},staticRenderFns:[]};t.a=r},654:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(641),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);var a=n(660);var s=function(e){n(655)},l=n(27)(i.a,a.a,!1,s,null,null);t.default=l.exports},655:function(e,t,n){var r=n(656);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(35)("6a41b246",r,!0,{})},656:function(e,t,n){var r=n(124);(e.exports=n(34)(!1)).push([e.i,".main-layout-box.toggle{padding-left:0}.main-layout-box.toggle>.secondary-menu-model{left:-200px}.secondary-menu-model{position:fixed;left:0;top:0;width:200px;background:#41444c;height:100%;padding-top:80px}.secondary-menu-model .toogle-box{position:absolute;right:-1px;top:calc(50% - 50px)}.secondary-menu-model .toogle-box .tog-close{width:12px;height:102px;background:url("+r(n(657))+") no-repeat;display:inline-block}.secondary-menu-model .toogle-box .tog-open{width:12px;height:102px;background:url("+r(n(658))+") no-repeat;display:inline-block;position:absolute;right:-12px;top:0}.secondary-menu-model .leven-1 .name a{height:40px;line-height:40px;display:block;position:relative;padding-left:12px}.secondary-menu-model .leven-1 .name a>.icon{vertical-align:middle;font-size:15px;width:20px;text-align:center;color:#fff}.secondary-menu-model .leven-1 .name a>span{vertical-align:middle;padding-left:2px;font-size:14px;color:#fff}.secondary-menu-model .leven-1 .name a>.angle{position:absolute;right:12px;top:14px}.secondary-menu-model .leven-1 ul li{height:36px;line-height:36px;cursor:pointer;padding-left:39px;color:#fff}.secondary-menu-model .leven-1 ul li a{font-size:14px}.secondary-menu-model .leven-1 ul li.active{border-right:2px solid #2d8cf0;background:#2c2f39}.secondary-menu-model .leven-1 ul li.active span{font-weight:700;color:#2d8cf0}.secondary-menu-model .leven-1 .router-link-active,.secondary-menu-model .leven-1>.router-link-exact-active{background:#f0f6fb}.secondary-menu-model .leven-1 .router-link-active .name,.secondary-menu-model .leven-1>.router-link-exact-active .name{border-right:2px solid #2d8cf0;background:#2b2e38}.secondary-menu-model .leven-1 .router-link-active .name a span,.secondary-menu-model .leven-1>.router-link-exact-active .name a span{color:#2d8cf0;font-weight:700}.secondary-menu-model .leven-1 .router-link-active .name a .fa,.secondary-menu-model .leven-1>.router-link-exact-active .name a .fa{color:#2d8cf0}",""])},657:function(e,t,n){e.exports=n.p+"images/close.png?02806e641df25c1b4dbff4cb0af3984d"},658:function(e,t,n){e.exports=n.p+"images/open.png?97ec0726c7acab8a2a48282d68cea631"},659:function(e,t,n){"use strict";t.__esModule=!0;var r,i=n(36),o=(r=i)&&r.__esModule?r:{default:r};var a={projects:[{name:""+o.default.$t("项目首页"),id:1,path:"projects-index",isOpen:!0,icon:"fa-home",children:[]},{name:""+o.default.$t("工作流"),id:2,path:"",isOpen:!0,icon:"fa-gear",children:[{name:""+o.default.$t("工作流定义"),path:"definition",id:1},{name:""+o.default.$t("工作流实例"),path:"instance",id:2},{name:""+o.default.$t("任务实例"),path:"task-instance-list",id:3}]}],security:[{name:""+o.default.$t("租户管理"),id:1,path:"tenement-manage",isOpen:!0,icon:"fa-users",children:[]},{name:""+o.default.$t("用户管理"),id:1,path:"users-manage",isOpen:!0,icon:"fa-user-circle",children:[]},{name:""+o.default.$t("告警组管理"),id:1,path:"warning-groups-manage",isOpen:!0,icon:"fa-warning",children:[]},{name:""+o.default.$t("队列管理"),id:1,path:"queue-manage",isOpen:!0,icon:"fa-warning",children:[]},{name:""+o.default.$t("服务管理"),id:1,path:"",isOpen:!0,icon:"fa-server",children:[{name:"master",path:"servers-master",id:1},{name:"worker",path:"servers-worker",id:2}]}],resource:[{name:""+o.default.$t("文件管理"),id:1,path:"file",isOpen:!0,icon:"fa-files-o",children:[],disabled:!1},{name:""+o.default.$t("UDF管理"),id:1,path:"",isOpen:!0,icon:"fa-file-text",disabled:!1,children:[{name:""+o.default.$t("资源管理"),path:"resource-udf-resource",id:1},{name:""+o.default.$t("函数管理"),path:"resource-udf-function",id:2}]}],user:[{name:""+o.default.$t("用户信息"),id:1,path:"account",isOpen:!0,icon:"fa-user",children:[],disabled:!1},{name:""+o.default.$t("修改密码"),id:1,path:"password",isOpen:!0,icon:"fa-key",children:[],disabled:!1}]};t.default=function(e){return a[e]}},660:function(e,t,n){"use strict";var r={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"secondary-menu-model",class:e.className},[n("div",{staticClass:"toogle-box"},[e.isTogHide?e._e():n("a",{staticClass:"tog-close",attrs:{href:"javascript:"},on:{click:e._toggleMenu}}),e._v(" "),e.isTogHide?n("a",{staticClass:"tog-open",attrs:{href:"javascript:"},on:{click:e._toggleMenu}}):e._e()]),e._v(" "),e._l(e.menuList,function(t,r){return n("div",{staticClass:"leven-1"},[t.path?[n("router-link",{attrs:{to:{name:t.path}}},[n("div",{staticClass:"name",on:{click:function(n){return e._toggleSubMenu(t)}}},[n("a",{attrs:{href:"javascript:"}},[n("i",{staticClass:"fa icon",class:t.icon}),e._v(" "),n("span",[e._v(e._s(t.name))]),e._v(" "),t.children.length?n("i",{staticClass:"fa angle",class:t.isOpen?"fa-angle-down":"fa-angle-right"}):e._e()])])])]:e._e(),e._v(" "),t.path?e._e():[n("div",{staticClass:"name",on:{click:function(n){return e._toggleSubMenu(t)}}},[n("a",{attrs:{href:"javascript:"}},[n("i",{staticClass:"fa icon",class:t.icon}),e._v(" "),n("span",[e._v(e._s(t.name))]),e._v(" "),t.children.length?n("i",{staticClass:"fa angle",class:t.isOpen?"fa-angle-down":"fa-angle-right"}):e._e()])])],e._v(" "),t.isOpen&&t.children.length?n("ul",e._l(t.children,function(t,r){return n("router-link",{attrs:{to:{name:t.path},tag:"li","active-class":"active"}},[n("span",[e._v(e._s(t.name))])])}),1):e._e()],2)})],2)},staticRenderFns:[]};t.a=r},663:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(643),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);var a=n(666);var s=function(e){n(664)},l=n(27)(i.a,a.a,!1,s,null,null);t.default=l.exports},664:function(e,t,n){var r=n(665);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(35)("3cb222d8",r,!0,{})},665:function(e,t,n){(e.exports=n(34)(!1)).push([e.i,".no-data-model{position:relative;width:100%;height:calc(100vh - 200px)}.no-data-model .no-data-box{width:210px;height:210px;position:absolute;left:50%;top:50%;margin-left:-105px;margin-top:-105px;text-align:center}.no-data-model .no-data-box .text{padding-top:10px;color:#666}",""])},666:function(e,t,n){"use strict";var r={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"no-data-model"},[t("div",{staticClass:"no-data-box"},[this._m(0),this._v(" "),t("div",{staticClass:"text"},[this._v(this._s(this.msg||this.$t("查询无数据")))])])])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"img"},[t("img",{attrs:{src:n(667),alt:""}})])}]};t.a=r},667:function(e,t,n){e.exports=n.p+"images/errorTip.png?a7b20f0ca8727f22f405c2a34d1363a0"},682:function(e,t,n){"use strict";t.__esModule=!0;var r,i=n(644),o=(r=i)&&r.__esModule?r:{default:r};n(724),n(725),n(726),n(727),n(728),n(683),n(729),n(730),n(731),n(732),n(733),t.default=function(e,t){return o.default.fromTextArea(document.getElementById(e),Object.assign({lineNumbers:!0,theme:"mdn-like",readOnly:!0},{},t))}},683:function(e,t,n){(function(e){"use strict";function t(e){for(var t;null!=(t=e.next());)if("`"==t&&!e.eat("`"))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null}function n(e){return e.eat("@")&&(e.match(/^session\./),e.match(/^local\./),e.match(/^global\./)),e.eat("'")?(e.match(/^.*'/),"variable-2"):e.eat('"')?(e.match(/^.*"/),"variable-2"):e.eat("`")?(e.match(/^.*`/),"variable-2"):e.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function r(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"variable-2":null}e.defineMode("sql",function(t,n){var r=n.client||{},s=n.atoms||{false:!0,true:!0,null:!0},l=n.builtin||o(a),c=n.keywords||o(i),u=n.operatorChars||/^[*+\-%<>!=&|~^\/]/,d=n.support||{},f=n.hooks||{},h=n.dateSQL||{date:!0,time:!0,timestamp:!0},p=!1!==n.backslashStringEscapes,m=n.brackets||/^[\{}\(\)\[\]]/,g=n.punctuation||/^[;.,:]/;function v(e,t){var n,i=e.next();if(f[i]){var o=f[i](e,t);if(!1!==o)return o}if(d.hexNumber&&("0"==i&&e.match(/^[xX][0-9a-fA-F]+/)||("x"==i||"X"==i)&&e.match(/^'[0-9a-fA-F]+'/)))return"number";if(d.binaryNumber&&(("b"==i||"B"==i)&&e.match(/^'[01]+'/)||"0"==i&&e.match(/^b[01]+/)))return"number";if(i.charCodeAt(0)>47&&i.charCodeAt(0)<58)return e.match(/^[0-9]*(\.[0-9]+)?([eE][-+]?[0-9]+)?/),d.decimallessFloat&&e.match(/^\.(?!\.)/),"number";if("?"==i&&(e.eatSpace()||e.eol()||e.eat(";")))return"variable-3";if("'"==i||'"'==i&&d.doubleQuote)return t.tokenize=(n=i,function(e,t){for(var r,i=!1;null!=(r=e.next());){if(r==n&&!i){t.tokenize=v;break}i=p&&!i&&"\\"==r}return"string"}),t.tokenize(e,t);if((d.nCharCast&&("n"==i||"N"==i)||d.charsetCast&&"_"==i&&e.match(/[a-z][a-z0-9]*/i))&&("'"==e.peek()||'"'==e.peek()))return"keyword";if(d.commentSlashSlash&&"/"==i&&e.eat("/"))return e.skipToEnd(),"comment";if(d.commentHash&&"#"==i||"-"==i&&e.eat("-")&&(!d.commentSpaceRequired||e.eat(" ")))return e.skipToEnd(),"comment";if("/"==i&&e.eat("*"))return t.tokenize=function e(t){return function(n,r){var i=n.match(/^.*?(\/\*|\*\/)/);return i?"/*"==i[1]?r.tokenize=e(t+1):r.tokenize=t>1?e(t-1):v:n.skipToEnd(),"comment"}}(1),t.tokenize(e,t);if("."!=i){if(u.test(i))return e.eatWhile(u),"operator";if(m.test(i))return"bracket";if(g.test(i))return e.eatWhile(g),"punctuation";if("{"==i&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";e.eatWhile(/^[_\w\d]/);var a=e.current().toLowerCase();return h.hasOwnProperty(a)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/))?"number":s.hasOwnProperty(a)?"atom":l.hasOwnProperty(a)?"builtin":c.hasOwnProperty(a)?"keyword":r.hasOwnProperty(a)?"string-2":null}return d.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":e.match(/^\.+/)?null:d.ODBCdotTable&&e.match(/^[\w\d_]+/)?"variable-2":void 0}function y(e,t,n){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:n}}return{startState:function(){return{tokenize:v,context:null}},token:function(e,t){if(e.sol()&&t.context&&null==t.context.align&&(t.context.align=!1),t.tokenize==v&&e.eatSpace())return null;var n=t.tokenize(e,t);if("comment"==n)return n;t.context&&null==t.context.align&&(t.context.align=!0);var r=e.current();return"("==r?y(e,t,")"):"["==r?y(e,t,"]"):t.context&&t.context.type==r&&function(e){e.indent=e.context.indent,e.context=e.context.prev}(t),n},indent:function(n,r){var i=n.context;if(!i)return e.Pass;var o=r.charAt(0)==i.type;return i.align?i.col+(o?0:1):i.indent+(o?0:t.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:d.commentSlashSlash?"//":d.commentHash?"#":"--",closeBrackets:"()[]{}''\"\"``"}});var i="alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit ";function o(e){for(var t={},n=e.split(" "),r=0;r!=^\&|\/]/,brackets:/^[\{}\(\)]/,punctuation:/^[;.,:/]/,backslashStringEscapes:!1,dateSQL:o("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":n}}),e.defineMIME("text/x-mysql",{name:"sql",client:o("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:o(i+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:o("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:o("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:o("date time timestamp"),support:o("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-mariadb",{name:"sql",client:o("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:o(i+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:o("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:o("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:o("date time timestamp"),support:o("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-sqlite",{name:"sql",client:o("auth backup bail binary changes check clone databases dbinfo dump echo eqp exit explain fullschema headers help import imposter indexes iotrace limit lint load log mode nullvalue once open output print prompt quit read restore save scanstats schema separator session shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width"),keywords:o(i+"abort action add after all analyze attach autoincrement before begin cascade case cast check collate column commit conflict constraint cross current_date current_time current_timestamp database default deferrable deferred detach each else end escape except exclusive exists explain fail for foreign full glob if ignore immediate index indexed initially inner instead intersect isnull key left limit match natural no notnull null of offset outer plan pragma primary query raise recursive references regexp reindex release rename replace restrict right rollback row savepoint temp temporary then to transaction trigger unique using vacuum view virtual when with without"),builtin:o("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text clob bigint int int2 int8 integer float double char varchar date datetime year unsigned signed numeric real"),atoms:o("null current_date current_time current_timestamp"),operatorChars:/^[*+\-%<>!=&|/~]/,dateSQL:o("date time timestamp datetime"),support:o("decimallessFloat zerolessFloat"),identifierQuote:'"',hooks:{"@":n,":":n,"?":n,$:n,'"':function(e){for(var t;null!=(t=e.next());)if('"'==t&&!e.eat('"'))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null},"`":t}}),e.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:o("add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime"),builtin:o("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"),atoms:o("false true infinity NaN"),operatorChars:/^[<>=]/,dateSQL:{},support:o("commentSlashSlash decimallessFloat"),hooks:{}}),e.defineMIME("text/x-plsql",{name:"sql",client:o("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:o("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),builtin:o("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*\/+\-%<>!=~]/,dateSQL:o("date time timestamp"),support:o("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-hive",{name:"sql",keywords:o("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with admin authorization char compact compactions conf cube current current_date current_timestamp day decimal defined dependency directories elem_type exchange file following for grouping hour ignore inner interval jar less logical macro minute month more none noscan over owner partialscan preceding pretty principals protection reload rewrite role roles rollup rows second server sets skewed transactions truncate unbounded unset uri user values window year"),builtin:o("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype key_type utctimestamp value_type varchar"),atoms:o("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:o("date timestamp"),support:o("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-pgsql",{name:"sql",client:o("source"),keywords:o(i+"a abort abs absent absolute access according action ada add admin after aggregate alias all allocate also alter always analyse analyze and any are array array_agg array_max_cardinality as asc asensitive assert assertion assignment asymmetric at atomic attach attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli between bigint binary bit bit_length blob blocked bom boolean both breadth by c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain char char_length character character_length character_set_catalog character_set_name character_set_schema characteristics characters check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column column_name columns command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constant constraint constraint_catalog constraint_name constraint_schema constraints constructor contains content continue control conversion convert copy corr corresponding cost count covar_pop covar_samp create cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datatype date datetime_interval_code datetime_interval_precision day db deallocate debug dec decimal declare default defaults deferrable deferred defined definer degree delete delimiter delimiters dense_rank depends depth deref derived desc describe descriptor detach detail deterministic diagnostics dictionary disable discard disconnect dispatch distinct dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain double drop dump dynamic dynamic_function dynamic_function_code each element else elseif elsif empty enable encoding encrypted end end_frame end_partition endexec enforced enum equals errcode error escape event every except exception exclude excluding exclusive exec execute exists exit exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreach foreign fortran forward found frame_row free freeze from fs full function functions fusion g general generated get global go goto grant granted greatest group grouping groups handler having header hex hierarchy hint hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import in include including increment indent index indexes indicator info inherit inherits initially inline inner inout input insensitive insert instance instantiable instead int integer integrity intersect intersection interval into invoker is isnull isolation join k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like like_regex limit link listen ln load local localtime localtimestamp location locator lock locked log logged loop lower m map mapping match matched materialized max max_cardinality maxvalue member merge message message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized not nothing notice notify notnull nowait nth_value ntile null nullable nullif nulls number numeric object occurrences_regex octet_length octets of off offset oids old on only open operator option options or order ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parallel parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password path percent percent_rank percentile_cont percentile_disc perform period permission pg_context pg_datatype_name pg_exception_context pg_exception_detail pg_exception_hint placing plans pli policy portion position position_regex power precedes preceding precision prepare prepared preserve primary print_strict_params prior privileges procedural procedure procedures program public publication query quote raise range rank read reads real reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict result result_oid return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns reverse revoke right role rollback rollup routine routine_catalog routine_name routine_schema routines row row_count row_number rows rowtype rule savepoint scale schema schema_name schemas scope scope_catalog scope_name scope_schema scroll search second section security select selective self sensitive sequence sequences serializable server server_name session session_user set setof sets share show similar simple size skip slice smallint snapshot some source space specific specific_name specifictype sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable stacked standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset subscription substring substring_regex succeeds sum symmetric sysid system system_time system_user t table table_name tables tablesample tablespace temp template temporary text then ties time timestamp timezone_hour timezone_minute to token top_level_count trailing transaction transaction_active transactions_committed transactions_rolled_back transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted union unique unknown unlink unlisten unlogged unnamed unnest until untyped update upper uri usage use_column use_variable user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of values var_pop var_samp varbinary varchar variable_conflict variadic varying verbose version versioning view views volatile warning when whenever where while whitespace width_bucket window with within without work wrapper write xml xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes zone"),builtin:o("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:o("false true null unknown"),operatorChars:/^[*\/+\-%<>!=&|^\/#@?~]/,dateSQL:o("date time timestamp"),support:o("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")}),e.defineMIME("text/x-gql",{name:"sql",keywords:o("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"),atoms:o("false true"),builtin:o("blob datetime first key __key__ string integer double boolean null"),operatorChars:/^[*+\-%<>!=]/}),e.defineMIME("text/x-gpsql",{name:"sql",client:o("source"),keywords:o("abort absolute access action active add admin after aggregate all also alter always analyse analyze and any array as asc assertion assignment asymmetric at authorization backward before begin between bigint binary bit boolean both by cache called cascade cascaded case cast chain char character characteristics check checkpoint class close cluster coalesce codegen collate column comment commit committed concurrency concurrently configuration connection constraint constraints contains content continue conversion copy cost cpu_rate_limit create createdb createexttable createrole createuser cross csv cube current current_catalog current_date current_role current_schema current_time current_timestamp current_user cursor cycle data database day deallocate dec decimal declare decode default defaults deferrable deferred definer delete delimiter delimiters deny desc dictionary disable discard distinct distributed do document domain double drop dxl each else enable encoding encrypted end enum errors escape every except exchange exclude excluding exclusive execute exists explain extension external extract false family fetch fields filespace fill filter first float following for force foreign format forward freeze from full function global grant granted greatest group group_id grouping handler hash having header hold host hour identity if ignore ilike immediate immutable implicit in including inclusive increment index indexes inherit inherits initially inline inner inout input insensitive insert instead int integer intersect interval into invoker is isnull isolation join key language large last leading least left level like limit list listen load local localtime localtimestamp location lock log login mapping master match maxvalue median merge minute minvalue missing mode modifies modify month move name names national natural nchar new newline next no nocreatedb nocreateexttable nocreaterole nocreateuser noinherit nologin none noovercommit nosuperuser not nothing notify notnull nowait null nullif nulls numeric object of off offset oids old on only operator option options or order ordered others out outer over overcommit overlaps overlay owned owner parser partial partition partitions passing password percent percentile_cont percentile_disc placing plans position preceding precision prepare prepared preserve primary prior privileges procedural procedure protocol queue quote randomly range read readable reads real reassign recheck recursive ref references reindex reject relative release rename repeatable replace replica reset resource restart restrict returning returns revoke right role rollback rollup rootpartition row rows rule savepoint scatter schema scroll search second security segment select sequence serializable session session_user set setof sets share show similar simple smallint some split sql stable standalone start statement statistics stdin stdout storage strict strip subpartition subpartitions substring superuser symmetric sysid system table tablespace temp template temporary text then threshold ties time timestamp to trailing transaction treat trigger trim true truncate trusted type unbounded uncommitted unencrypted union unique unknown unlisten until update user using vacuum valid validation validator value values varchar variadic varying verbose version view volatile web when where whitespace window with within without work writable write xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlparse xmlpi xmlroot xmlserialize year yes zone"),builtin:o("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:o("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:o("date time timestamp"),support:o("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")}),e.defineMIME("text/x-sparksql",{name:"sql",keywords:o("add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases datata dbproperties defined delete delimited deny desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on optimize option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with"),builtin:o("tinyint smallint int bigint boolean float double string binary timestamp decimal array map struct uniontype delimited serde sequencefile textfile rcfile inputformat outputformat"),atoms:o("false true null"),operatorChars:/^[*\/+\-%<>!=~&|^]/,dateSQL:o("date time timestamp"),support:o("ODBCdotTable doubleQuote zerolessFloat")}),e.defineMIME("text/x-esper",{name:"sql",client:o("source"),keywords:o("alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit after all and as at asc avedev avg between by case cast coalesce count create current_timestamp day days delete define desc distinct else end escape events every exists false first from full group having hour hours in inner insert instanceof into irstream is istream join last lastweekday left limit like max match_recognize matches median measures metadatasql min minute minutes msec millisecond milliseconds not null offset on or order outer output partition pattern prev prior regexp retain-union retain-intersection right rstream sec second seconds select set some snapshot sql stddev sum then true unidirectional until update variable weekday when where window"),builtin:{},atoms:o("false true null"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:o("time"),support:o("decimallessFloat zerolessFloat binaryNumber hexNumber")})})(n(644))},724:function(e,t){},725:function(e,t,n){(function(e){"use strict";var t="CodeMirror-hint",n="CodeMirror-hint-active";function r(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 i in n)r[i]=n[i];return e.showHint(r)},e.defineExtension("showHint",function(t){t=function(e,t,n){var r=e.options.hintOptions,i={};for(var o in u)i[o]=u[o];if(r)for(var o in r)void 0!==r[o]&&(i[o]=r[o]);if(n)for(var o in n)void 0!==n[o]&&(i[o]=n[o]);i.hint.resolve&&(i.hint=i.hint.resolve(e,t));return i}(this,this.getCursor("start"),t);var n=this.listSelections();if(!(n.length>1)){if(this.somethingSelected()){if(!t.hint.supportsSelection)return;for(var i=0;id.clientHeight+1,T=l.getScrollInfo();if(L>0){var M=_.bottom-_.top;if(y.top-(y.bottom-_.top)-M>0)d.style.top=(x=y.top-M)+"px",w=!1;else if(M>C){d.style.height=C-5+"px",d.style.top=(x=y.bottom-_.top)+"px";var A=l.getCursor();i.from.ch!=A.ch&&(y=l.cursorCoords(A),d.style.left=(b=y.left)+"px",_=d.getBoundingClientRect())}}var N,O=_.right-k;if(O>0&&(_.right-_.left>k&&(d.style.width=k-5+"px",O-=_.right-_.left-k),d.style.left=(b=y.left-O)+"px"),S)for(var z=d.firstChild;z;z=z.nextSibling)z.style.paddingRight=l.display.nativeBarWidth+"px";(l.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};/Mac/.test(navigator.platform)&&(n["Ctrl-P"]=function(){t.moveFocus(-1)},n["Ctrl-N"]=function(){t.moveFocus(1)});var r=e.options.customKeys,i=r?{}:n;function o(e,r){var o;o="string"!=typeof r?function(e){return r(e,t)}:n.hasOwnProperty(r)?n[r]:r,i[e]=o}if(r)for(var a in r)r.hasOwnProperty(a)&&o(a,r[a]);var s=e.options.extraKeys;if(s)for(var a in s)s.hasOwnProperty(a)&&o(a,s[a]);return i}(r,{moveFocus:function(e,t){o.changeActive(o.selectedHint+e,t)},setFocus:function(e){o.changeActive(e)},menuSize:function(){return o.screenAmount()},length:h.length,close:function(){r.close()},pick:function(){o.pick()},data:i})),r.options.closeOnUnfocus)&&(l.on("blur",this.onBlur=function(){N=setTimeout(function(){r.close()},100)}),l.on("focus",this.onFocus=function(){clearTimeout(N)}));return l.on("scroll",this.onScroll=function(){var e=l.getScrollInfo(),t=l.getWrapperElement().getBoundingClientRect(),n=x+T.top-e.top,i=n-(u.pageYOffset||(c.documentElement||c.body).scrollTop);if(w||(i+=d.offsetHeight),i<=t.top||i>=t.bottom)return r.close();d.style.top=n+"px",d.style.left=b+T.left-e.left+"px"}),e.on(d,"dblclick",function(e){var t=s(d,e.target||e.srcElement);t&&null!=t.hintId&&(o.changeActive(t.hintId),o.pick())}),e.on(d,"click",function(e){var t=s(d,e.target||e.srcElement);t&&null!=t.hintId&&(o.changeActive(t.hintId),r.options.completeOnSingleClick&&o.pick())}),e.on(d,"mousedown",function(){setTimeout(function(){l.focus()},20)}),e.signal(i,"select",h[this.selectedHint],d.childNodes[this.selectedHint]),!0}function c(e,t,n,r){if(e.async)e(t,r,n);else{var i=e(t,n);i&&i.then?i.then(r):r(i)}}r.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(a(r),r.from||t.from,r.to||t.to,"complete"),e.signal(t,"pick",r),this.close()},cursorActivity:function(){this.debounce&&(o(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.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 i=this.hints.childNodes[this.selectedHint];i&&(i.className=i.className.replace(" "+n,"")),(i=this.hints.childNodes[this.selectedHint=t]).className+=" "+n,i.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=i.offsetTop+i.offsetHeight-this.hints.clientHeight+3),e.signal(this.data,"select",this.data.list[this.selectedHint],i)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},e.registerHelper("hint","auto",{resolve:function(t,n){var r,i=t.getHelpers(n,"hint");if(i.length){var o=function(e,t,n){var r=function(e,t){if(!e.somethingSelected())return t;for(var n=[],r=0;r0?t(e):i(o+1)})}(0)};return o.async=!0,o.supportsSelection=!0,o}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,i=t.getCursor(),o=t.getTokenAt(i),a=e.Pos(i.line,o.start),s=i;o.start,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};e.defineOption("hintOptions",null)})(n(644))},726:function(e,t,n){(function(e){"use strict";var t,n,r,i,o={QUERY_DIV:";",ALIAS_KEYWORD:"AS"},a=e.Pos,s=e.cmpPos;function l(e){return"[object Array]"==Object.prototype.toString.call(e)}function c(e){return"string"==typeof e?e:e.text}function u(e,t){return l(t)&&(t={columns:t}),t.text||(t.text=e),t}function d(e){return t[e.toUpperCase()]}function f(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function h(e,t){var n=e.length,r=c(t).substr(0,n);return e.toUpperCase()===r.toUpperCase()}function p(e,t,n,r){if(l(n))for(var i=0;i0)&&s(m,u[g])<=0){f={start:p,end:u[g]};break}p=u[g]}if(f.start){var y=n.getRange(f.start,f.end,!1);for(g=0;g=0;n--){var r=e[n];t[c(r).toUpperCase()]=u(c(r),r)}else if(e)for(var i in e)t[i.toUpperCase()]=u(i,e[i]);return t}(s&&s.tables);var h=s&&s.defaultTable,v=s&&s.disableKeywords;n=h&&d(h),r=function(t){var n=t.doc.modeOption;return"sql"===n&&(n="text/x-sql"),e.resolveMode(n).keywords}(o),i=function(t){var n=t.doc.modeOption;return"sql"===n&&(n="text/x-sql"),e.resolveMode(n).identifierQuote||"`"}(o),h&&!n&&(n=y(h,o)),(n=n||[]).columns&&(n=n.columns);var b,x,w,k=o.getCursor(),C=[],_=o.getTokenAt(k);if(_.end>k.ch&&(_.end=k.ch,_.string=_.string.slice(0,k.ch-_.start)),_.string.match(/^[.`"\w@]\w*$/)?(w=_.string,b=_.start,x=_.end):(b=x=k.ch,w=""),"."==w.charAt(0)||w.charAt(0)==i)b=function(e,r,o,s){for(var l=!1,c=[],u=r.start,h=!0;h;)h="."==r.string.charAt(0),l=l||r.string.charAt(0)==i,u=r.start,c.unshift(m(r.string)),"."==(r=s.getTokenAt(a(e.line,r.start))).string&&(h=!0,r=s.getTokenAt(a(e.line,r.start)));var v=c.join(".");p(o,v,t,function(e){return l?g(e):e}),p(o,v,n,function(e){return l?g(e):e}),v=c.pop();var b=c.join("."),x=!1,w=b;if(!d(b)){var k=b;(b=y(b,s))!==k&&(x=!0)}var C=d(b);return C&&C.columns&&(C=C.columns),C&&p(o,v,C,function(e){var t=b;return 1==x&&(t=w),"string"==typeof e?e=t+"."+e:(e=f(e)).text=t+"."+e.text,l?g(e):e}),u}(k,_,C,o);else{var L=function(e,t){return"object"==typeof e?e.className=t:e={text:e,className:t},e};p(C,w,n,function(e){return L(e,"CodeMirror-hint-table CodeMirror-hint-default-table")}),p(C,w,t,function(e){return L(e,"CodeMirror-hint-table")}),v||p(C,w,r,function(e){return L(e.toUpperCase(),"CodeMirror-hint-keyword")})}return{list:C,from:a(k.line,b),to:a(k.line,x)}})})(n(644),n(683))},727:function(e,t,n){(function(e){"use strict";var t=e.Pos;function n(e,t,n){return n?e.indexOf(t)>=0:0==e.lastIndexOf(t,0)}e.registerHelper("hint","xml",function(r,i){var o=i&&i.schemaInfo,a=i&&i.quoteChar||'"',s=i&&i.matchInMiddle;if(o){var l=r.getCursor(),c=r.getTokenAt(l);c.end>l.ch&&(c.end=l.ch,c.string=c.string.slice(0,l.ch-c.start));var u=e.innerMode(r.getMode(),c.state);if("xml"==u.mode.name){var d,f,h=[],p=!1,m=/\btag\b/.test(c.type)&&!/>$/.test(c.string),g=m&&/^\w/.test(c.string);if(g){var v=r.getLine(l.line).slice(Math.max(0,c.start-2),c.start),y=/<\/$/.test(v)?"close":/<$/.test(v)?"open":null;y&&(f=c.start-("close"==y?2:1))}else m&&"<"==c.string?y="open":m&&"")}else{var _=(x=o[u.state.tagName])&&x.attrs,L=o["!attrs"];if(!_&&!L)return;if(_){if(L){var S={};for(var T in L)L.hasOwnProperty(T)&&(S[T]=L[T]);for(var T in _)_.hasOwnProperty(T)&&(S[T]=_[T]);_=S}}else _=L;if("string"==c.type||"="==c.string){var M,A=(v=r.getRange(t(l.line,Math.max(0,l.ch-60)),t(l.line,"string"==c.type?c.start:c.end))).match(/([^\s\u00a0=<>\"\']+)=$/);if(!A||!_.hasOwnProperty(A[1])||!(M=_[A[1]]))return;if("function"==typeof M&&(M=M.call(this,r)),"string"==c.type){d=c.string;var N=0;/['"]/.test(c.string.charAt(0))&&(a=c.string.charAt(0),d=c.string.slice(1),N++);var O=c.string.length;/['"]/.test(c.string.charAt(O-1))&&(a=c.string.charAt(O-1),d=c.string.substr(N,O-2)),p=!0}for(k=0;k=]+|\/\/=?|\*\*=?|!=|[~!@])/],d=0;dr?k(t):i0&&C(e,t)&&(a+=" "+l),a}return w(e,t)}function w(e,t){if(e.eatSpace())return null;if(e.match(/^#.*/))return"comment";if(e.match(/^[0-9\.]/,!1)){var r=!1;if(e.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(r=!0),e.match(/^[\d_]+\.\d*/)&&(r=!0),e.match(/^\.\d+/)&&(r=!0),r)return e.eat(/J/i),"number";var i=!1;if(e.match(/^0x[0-9a-f_]+/i)&&(i=!0),e.match(/^0b[01_]+/i)&&(i=!0),e.match(/^0o[0-7_]+/i)&&(i=!0),e.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(e.eat(/J/i),i=!0),e.match(/^0(?![\dx])/i)&&(i=!0),i)return e.eat(/L/i),"number"}if(e.match(v))return-1!==e.current().toLowerCase().indexOf("f")?(t.tokenize=function(e,t){for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";function i(e){return function(t,n){var r=w(t,n);return"punctuation"==r&&("{"==t.current()?n.tokenize=i(e+1):"}"==t.current()&&(n.tokenize=e>1?i(e-1):o)),r}}function o(o,a){for(;!o.eol();)if(o.eatWhile(/[^'"\{\}\\]/),o.eat("\\")){if(o.next(),n&&o.eol())return r}else{if(o.match(e))return a.tokenize=t,r;if(o.match("{{"))return r;if(o.match("{",!1))return a.tokenize=i(0),o.current()?r:a.tokenize(o,a);if(o.match("}}"))return r;if(o.match("}"))return l;o.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return l;a.tokenize=t}return r}return o.isString=!0,o}(e.current(),t.tokenize),t.tokenize(e,t)):(t.tokenize=function(e,t){for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";function i(i,o){for(;!i.eol();)if(i.eatWhile(/[^'"\\]/),i.eat("\\")){if(i.next(),n&&i.eol())return r}else{if(i.match(e))return o.tokenize=t,r;i.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return l;o.tokenize=t}return r}return i.isString=!0,i}(e.current(),t.tokenize),t.tokenize(e,t));for(var o=0;o1&&o(t).offset>n;){if("py"!=o(t).type)return!0;t.scopes.pop()}return o(t).offset!=n}function _(e,t){e.sol()&&(t.beginningOfLine=!0);var n=t.tokenize(e,t),r=e.current();if(t.beginningOfLine&&"@"==r)return e.match(g,!1)?"meta":m?"operator":l;if(/\S/.test(r)&&(t.beginningOfLine=!1),"variable"!=n&&"builtin"!=n||"meta"!=t.lastToken||(n="meta"),"pass"!=r&&"return"!=r||(t.dedent+=1),"lambda"==r&&(t.lambda=!0),":"!=r||t.lambda||"py"!=o(t).type||k(t),1==r.length&&!/string|comment/.test(n)){var i="[({".indexOf(r);if(-1!=i&&function(e,t,n){var r=e.match(/^([\s\[\{\(]|#.*)*$/,!1)?null:e.column()+1;t.scopes.push({offset:t.indent+f,type:n,align:r})}(e,t,"])}".slice(i,i+1)),-1!=(i="])}".indexOf(r))){if(o(t).type!=r)return l;t.indent=t.scopes.pop().offset-f}}return t.dedent>0&&e.eol()&&"py"==o(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),n}return{startState:function(e){return{tokenize:x,scopes:[{offset:e||0,type:"py",align:null}],indent:e||0,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=_(e,t);return r&&"comment"!=r&&(t.lastToken="keyword"==r||"punctuation"==r?e.current():r),"punctuation"==r&&(r=null),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+l:r},indent:function(t,n){if(t.tokenize!=x)return t.tokenize.isString?e.Pass:0;var r=o(t),i=r.type==n.charAt(0);return null!=r.align?r.align-(i?1:0):r.offset-(i?f:0)},electricInput:/^\s*[\}\]\)]$/,closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"}}),e.defineMIME("text/x-python","python");var a;e.defineMIME("text/x-cython",{name:"python",extra_keywords:(a="by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE",a.split(" "))})})(n(644))},729:function(e,t,n){(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,i){var o,a,s=r.indentUnit,l={},c=i.htmlMode?t:n;for(var u in c)l[u]=c[u];for(var u in i)l[u]=i[u];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(h("atom","]]>")):null:e.match("--")?n(h("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(function e(t){return function(n,r){for(var i;null!=(i=n.next());){if("<"==i)return r.tokenize=e(t+1),r.tokenize(n,r);if(">"==i){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=h("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=f,"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 f(e,t){var n,r,i=e.next();if(">"==i||"/"==i&&e.eat(">"))return t.tokenize=d,o=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return o="equals",null;if("<"==i){t.tokenize=d,t.state=g,t.tagName=t.tagStart=null;var a=t.tokenize(e,t);return a?a+" tag error":"tag error"}return/[\'\"]/.test(i)?(t.tokenize=(n=i,(r=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=f;break}return"string"}).isInAttribute=!0,r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=d;break}n.next()}return e}}function p(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;p(e)}}function g(e,t,n){return"openTag"==e?(n.tagStart=t.column(),v):"closeTag"==e?y:g}function v(e,t,n){return"word"==e?(n.tagName=t.current(),a="tag",w):l.allowMissingTagName&&"endTag"==e?(a="tag bracket",w(e,t,n)):(a="error",v)}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)&&p(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",b):(a="tag error",x)}return l.allowMissingTagName&&"endTag"==e?(a="tag bracket",b(e,t,n)):(a="error",x)}function b(e,t,n){return"endTag"!=e?(a="error",b):(p(n),g)}function x(e,t,n){return a="error",b(e,0,n)}function w(e,t,n){if("word"==e)return a="attribute",k;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(r)?m(n,r):(m(n,r),n.context=new function(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)}(n,r,i==n.indented)),g}return a="error",w}function k(e,t,n){return"equals"==e?C:(l.allowMissing||(a="error"),w(e,0,n))}function C(e,t,n){return"string"==e?_:"word"==e&&l.allowUnquoted?(a="string",w):(a="error",w(e,0,n))}function _(e,t,n){return"string"==e?_:w(e,0,n)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:g,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;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(a=null,t.state=t.state(o||n,e,t),a&&(n="error"==a?n+" error":a)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=f&&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&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==C&&(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(644))},730:function(e,t,n){(function(e){"use strict";var t={addition:"positive",attributes:"attribute",bold:"strong",cite:"keyword",code:"atom",definitionList:"number",deletion:"negative",div:"punctuation",em:"em",footnote:"variable",footCite:"qualifier",header:"header",html:"comment",image:"string",italic:"em",link:"link",linkDefinition:"link",list1:"variable-2",list2:"variable-3",list3:"keyword",notextile:"string-2",pre:"operator",p:"property",quote:"bracket",span:"quote",specialChar:"tag",strong:"strong",sub:"builtin",sup:"builtin",table:"variable-3",tableHeading:"operator"};function n(e,n,o){if("_"===o)return e.eat("_")?r(e,n,"italic",/__/,2):r(e,n,"em",/_/,1);if("*"===o)return e.eat("*")?r(e,n,"bold",/\*\*/,2):r(e,n,"strong",/\*/,1);if("["===o)return e.match(/\d+\]/)&&(n.footCite=!0),i(n);if("("===o&&e.match(/^(r|tm|c)\)/))return a(n,t.specialChar);if("<"===o&&e.match(/(\w+)[^>]+>[^<]+<\/\1>/))return a(n,t.html);if("?"===o&&e.eat("?"))return r(e,n,"cite",/\?\?/,2);if("="===o&&e.eat("="))return r(e,n,"notextile",/==/,2);if("-"===o&&!e.eat("-"))return r(e,n,"deletion",/-/,1);if("+"===o)return r(e,n,"addition",/\+/,1);if("~"===o)return r(e,n,"sub",/~/,1);if("^"===o)return r(e,n,"sup",/\^/,1);if("%"===o)return r(e,n,"span",/%/,1);if("@"===o)return r(e,n,"code",/@/,1);if("!"===o){var s=r(e,n,"image",/(?:\([^\)]+\))?!/,1);return e.match(/^:\S+/),s}return i(n)}function r(e,t,n,r,o){var a=e.pos>o?e.string.charAt(e.pos-o-1):null,s=e.peek();if(t[n]){if((!s||/\W/.test(s))&&a&&/\S/.test(a)){var l=i(t);return t[n]=!1,l}}else(!a||/\W/.test(a))&&s&&/\S/.test(s)&&e.match(new RegExp("^.*\\S"+r.source+"(?:\\W|$)"),!1)&&(t[n]=!0,t.mode=u.attributes);return i(t)}function i(e){var n=o(e);if(n)return n;var r=[];return e.layoutType&&r.push(t[e.layoutType]),r=r.concat(function(e){for(var n=[],r=1;r]+)?>(?:[^<]+<\/\1>)?/,link:/[^"]+":\S/,linkDefinition:/\[[^\s\]]+\]\S+/,list:/(?:#+|\*+)/,notextile:"notextile",para:"p",pre:"pre",table:"table",tableCellAttributes:/[\/\\]\d+/,tableHeading:/\|_\./,tableText:/[^"_\*\[\(\?\+~\^%@|-]+/,text:/[^!"_=\*\[\(<\?\+~\^%@-]+/},attributes:{align:/(?:<>|<|>|=)/,selector:/\([^\(][^\)]+\)/,lang:/\[[^\[\]]+\]/,pad:/(?:\(+|\)+){1,2}/,css:/\{[^\}]+\}/},createRe:function(e){switch(e){case"drawTable":return l.makeRe("^",l.single.drawTable,"$");case"html":return l.makeRe("^",l.single.html,"(?:",l.single.html,")*","$");case"linkDefinition":return l.makeRe("^",l.single.linkDefinition,"$");case"listLayout":return l.makeRe("^",l.single.list,c("allAttributes"),"*\\s+");case"tableCellAttributes":return l.makeRe("^",l.choiceRe(l.single.tableCellAttributes,c("allAttributes")),"+\\.");case"type":return l.makeRe("^",c("allTypes"));case"typeLayout":return l.makeRe("^",c("allTypes"),c("allAttributes"),"*\\.\\.?","(\\s+|$)");case"attributes":return l.makeRe("^",c("allAttributes"),"+");case"allTypes":return l.choiceRe(l.single.div,l.single.foot,l.single.header,l.single.bc,l.single.bq,l.single.notextile,l.single.pre,l.single.table,l.single.para);case"allAttributes":return l.choiceRe(l.attributes.selector,l.attributes.css,l.attributes.lang,l.attributes.align,l.attributes.pad);default:return l.makeRe("^",l.single[e])}},makeRe:function(){for(var e="",t=0;t1&&e.eat("$");var n=e.next();return/['"({]/.test(n)?(t.tokens[0]=a(n,"("==n?"quote":"{"==n?"def":"string"),c(e,t)):(/\d/.test(n)||e.eatWhile(/\w/),t.tokens.shift(),"def")};function c(e,n){return(n.tokens[0]||function(e,n){if(e.eatSpace())return null;var r=e.sol(),i=e.next();if("\\"===i)return e.next(),null;if("'"===i||'"'===i||"`"===i)return n.tokens.unshift(a(i,"`"===i?"quote":"string")),c(e,n);if("#"===i)return r&&e.eat("!")?(e.skipToEnd(),"meta"):(e.skipToEnd(),"comment");if("$"===i)return n.tokens.unshift(l),c(e,n);if("+"===i||"="===i)return"operator";if("-"===i)return e.eat("-"),e.eatWhile(/\w/),"attribute";if(/\d/.test(i)&&(e.eatWhile(/\d/),e.eol()||!/\w/.test(e.peek())))return"number";e.eatWhile(/[\w-]/);var o=e.current();return"="===e.peek()&&/\w+/.test(o)?"def":t.hasOwnProperty(o)?t[o]:null})(e,n)}return{startState:function(){return{tokens:[]}},token:function(e,t){return c(e,t)},closeBrackets:"()[]{}''\"\"``",lineComment:"#",fold:"brace"}}),e.defineMIME("text/x-sh","shell"),e.defineMIME("application/x-sh","shell")})(n(644))},732:function(e,t){},733:function(e,t){},735:function(e,t,n){"use strict";t.__esModule=!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.bytesToSize=function(e){if(0===e)return"0 B";var t=Math.floor(Math.log(e)/Math.log(1024));return parseInt((e/Math.pow(1024,t)).toPrecision(3))+" "+["B","KB","MB","GB","TB","PB","EB","ZB","YB"][t]},t.isJson=function(e){if("string"==typeof e)try{var t=JSON.parse(e);return!("object"!==(void 0===t?"undefined":r(t))||!t)}catch(e){return!1}},t.syntaxHighlight=function(e){return"string"!=typeof e&&(e=JSON.stringify(e,void 0,2)),(e=e.replace(/&/g,"&").replace(//g,">")).replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,function(e){var t="number";return/^"/.test(e)?t=/:$/.test(e)?"key":"string":/true|false/.test(e)?t="boolean":/null/.test(e)&&(t="null"),''+e+""})}},807:function(e,t,n){"use strict";t.__esModule=!0;t.filtTypeArr=["txt","log","sh","conf","cfg","py","java","sql","xml","hql"]},983:function(e,t,n){"use strict";t.__esModule=!0;t.handlerSuffix={".txt":"textile",".log":"textile",".sh":"shell",".conf":"textile",".cfg":"textile",".py":"python",".java":"textile",".sql":"sql",".hql":"sql",".xml":"xml"}},984:function(e,t,n){"use strict";t.__esModule=!0,t.default={name:"no-type"}}}); -//# sourceMappingURL=8.d0d692f.js.map \ No newline at end of file +webpackJsonp([8],{1001:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(984),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);var a=n(1004);var s=function(e){n(1002)},l=n(27)(i.a,a.a,!1,s,null,null);t.default=l.exports},1002:function(e,t,n){var r=n(1003);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(35)("3cf3e1ac",r,!0,{})},1003:function(e,t,n){(e.exports=n(34)(!1)).push([e.i,".no-type-model{text-align:center;padding-top:160px}.no-type-model>p{padding-top:10px;color:#666}",""])},1004:function(e,t,n){"use strict";var r={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"no-type-model"},[t("img",{attrs:{src:n(1005),alt:""}}),this._v(" "),t("p",[this._v(this._s(this.$t("不支持在线查看类型")))])])},staticRenderFns:[]};t.a=r},1005:function(e,t,n){e.exports=n.p+"images/down_error.png?4339cb288e29d420babb7d7c848b9093"},1050:function(e,t,n){"use strict";t.__esModule=!0;var r=m(n(28)),i=n(123),o=n(807),a=m(n(1001)),s=n(735),l=m(n(682)),c=m(n(646)),u=m(n(226)),d=m(n(663)),f=n(983),h=m(n(654)),p=m(n(650));function m(e){return e&&e.__esModule?e:{default:e}}var g=void 0;t.default={name:"file-details",data:function(){return{name:"",isNoType:!0,isLoading:!1,filtTypeArr:o.filtTypeArr,loadingIndex:0,mode:"python",isData:!0,size:null,spinnerLoading:!1,msg:""}},props:{},methods:Object.assign({},(0,i.mapActions)("resource",["getViewResources","updateContent"]),{ok:function(){var e=this;this.spinnerLoading=!0,this.updateContent({id:this.$route.params.id,content:g.getValue()}).then(function(t){e.$message.success(t.msg),setTimeout(function(){e.spinnerLoading=!1,e.close()},800)}).catch(function(t){e.$message.error(t.msg||""),e.spinnerLoading=!1})},close:function(){this.$router.push({name:"file"})},_getViewResources:function(){var e=this;this.isLoading=!0,this.getViewResources({id:this.$route.params.id,skipLineNum:0,limit:2e3}).then(function(t){e.name=t.data.alias.split(".")[0],t.data?(e.isData=!0,e._handlerEditor().setValue(t.data.content||""),setTimeout(function(){$(".code-mirror-model").scrollTop(12).scrollLeft(0)},200)):e.isData=!1,e.isLoading=!1}).catch(function(t){e.msg=t.msg||"error",e.$message.error(t.msg||""),e.isLoading=!1})},_handlerEditor:function(){return g=(0,l.default)("code-edit-mirror",{mode:this.mode,readOnly:!1}),this.keypress=function(){g.getOption("readOnly")||g.showHint({completeSingle:!1})},g.on("keypress",this.keypress),g}}),watch:{},created:function(){var e=r.default.split(u.default.getItem("file"),"|",2),t=e[0],n=e[1],i=t.lastIndexOf("."),o=t.substring(i,t.length);this.mode=f.handlerSuffix[o],this.size=(0,s.bytesToSize)(parseInt(n)),this.isNoType=r.default.includes(this.filtTypeArr,r.default.trimStart(o,"."))},mounted:function(){this.isNoType&&this._getViewResources()},destroyed:function(){g&&(g.toTextArea(),g.off($(".code-edit-mirror"),"keypress",this.keypress))},computed:{},components:{mListConstruction:p.default,mNoType:a.default,mSpin:c.default,mSecondaryMenu:h.default,mNoData:d.default}}},1165:function(e,t,n){var r=n(1166);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(35)("786589f0",r,!0,{})},1166:function(e,t,n){(e.exports=n(34)(!1)).push([e.i,".file-edit-content{width:100%;background:#fff;padding-bottom:20px}.file-edit-content>h2{line-height:60px;text-align:center;padding-bottom:6px;position:relative}.file-edit-content>h2 .down{position:absolute;right:0;top:0}.file-edit-content>h2 .down>i{font-size:20px;color:#2d8cf0;cursor:pointer;vertical-align:middle}.file-edit-content>h2 .down em{font-size:12px;font-style:normal;vertical-align:middle;color:#777;margin-left:-2px}.file-edit-content .code-mirror-model{height:calc(100vh - 300px)}.file-edit-content .code-mirror-model .cm-s-mdn-like.CodeMirror{height:calc(100vh - 310px)}.file-edit-content .submit-c{text-align:center;padding-top:12px}.file-operation{padding:30px 0;text-align:center}",""])},1167:function(e,t,n){"use strict";var r={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"main-layout-box"},[n("m-secondary-menu",{attrs:{type:"resource"}}),e._v(" "),n("m-list-construction",{attrs:{title:e.$t("文件详情")}},[n("div",{staticStyle:{margin:"20px"},attrs:{slot:"content"},slot:"content"},[n("div",{staticClass:"file-edit-content"},[n("h2",[n("span",[e._v(e._s(e.name))])]),e._v(" "),[e.msg?e._e():[n("div",{staticClass:"code-mirror-model"},[n("textarea",{attrs:{id:"code-edit-mirror",name:"code-edit-mirror"}})]),e._v(" "),n("div",{staticClass:"submit-c"},[n("x-button",{attrs:{type:"text",shape:"circle",disabled:e.disabled},on:{click:function(t){return e.close()}}},[e._v(" "+e._s(e.$t("返回"))+" ")]),e._v(" "),n("x-button",{attrs:{type:"primary",shape:"circle",loading:e.spinnerLoading},on:{click:function(t){return e.ok()}}},[e._v(e._s(e.spinnerLoading?"Loading...":e.$t("保存"))+" ")])],1)],e._v(" "),e.msg?n("m-no-data",{attrs:{msg:e.msg}}):e._e()],e._v(" "),e.isNoType?e._e():[n("m-no-type")]],2),e._v(" "),n("m-spin",{attrs:{"is-spin":e.isLoading}})],1)])],1)},staticRenderFns:[]};t.a=r},622:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1050),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);var a=n(1167);var s=function(e){n(1165)},l=n(27)(i.a,a.a,!1,s,null,null);t.default=l.exports},639:function(e,t,n){"use strict";t.__esModule=!0,t.default={name:"spin",data:function(){return{}},props:{isSpin:{type:Boolean,default:!0},isLeft:{type:Boolean,default:!0}}}},640:function(e,t,n){"use strict";t.__esModule=!0,t.default={name:"list-construction",data:function(){return{}},props:{title:String}}},641:function(e,t,n){"use strict";t.__esModule=!0;var r,i=n(659),o=(r=i)&&r.__esModule?r:{default:r};t.default={name:"secondary-menu",data:function(){return{menuList:(0,o.default)(this.type),index:0,id:this.$route.params.id,isTogHide:!1}},props:{type:String,className:String},watch:{isTogHide:function(e){var t=$(".main-layout-box");e?t.addClass("toggle"):t.removeClass("toggle")}},methods:{_toggleSubMenu:function(e){e.isOpen=!e.isOpen},_toggleMenu:function(){this.isTogHide=!this.isTogHide}},mounted:function(){}}},643:function(e,t,n){"use strict";t.__esModule=!0,t.default={name:"no-data",props:{msg:String}}},644:function(e,t,n){var r;r=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\//.test(e),d=/Opera\//.test(e),f=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),p=/PhantomJS/.test(e),m=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),g=/Android/.test(e),v=m||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),y=m||/Mac/.test(t),b=/\bCrOS\b/.test(e),x=/win/i.test(t),w=d&&e.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(d=!1,l=!0);var k=y&&(c||d&&(null==w||w<12.11)),C=n||a&&s>=9;function _(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var L,S=function(e,t){var n=e.className,r=_(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function M(e,t){return T(e).appendChild(t)}function A(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}m?H=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(H=function(e){try{e.select()}catch(e){}});var I=function(){this.id=null};function R(e,t){for(var n=0;n=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var V=[""];function K(e){for(;V.length<=e;)V.push(Y(V)+" ");return V[e]}function Y(e){return e[e.length-1]}function X(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||J.test(e))}function te(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ee(e))||t.test(e):ee(e)}function ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\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&&re.test(e)}function oe(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function se(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 i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?me(n,se(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?me(e.line,t):n<0?me(e.line,0):e}(t,se(e,t.line).text.length)}function Ce(e,t){for(var n=[],r=0;r=t:o.to>t);(r||(r=[])).push(new Se(a,o.from,s?null:o.to))}}return r}(n,i,a),l=function(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var b=0;bt)&&(!n||He(n,o.marker)<0)&&(n=o.marker)}return n}function Re(e,t,n,r,i){var o=se(e,t),a=Le&&o.markedSpans;if(a)for(var s=0;s=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ge(c.to,n)>=0:ge(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ge(c.from,r)<=0:ge(c.from,r)<0)))return!0}}}function qe(e){for(var t;t=Fe(e);)e=t.find(-1,!0).line;return e}function Be(e,t){var n=se(e,t),r=qe(n);return n==r?t:de(r)}function $e(e,t){if(t>e.lastLine())return t;var n,r=se(e,t);if(!Ue(e,r))return t;for(;n=Pe(r);)r=n.find(1,!0).line;return de(r)+1}function Ue(e,t){var n=Le&&t.markedSpans;if(n)for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}var Ye=null;function Xe(e,t,n){var r;Ye=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:Ye=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:Ye=i)}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]/,i=/[LRr]/,o=/[Lb1n]/,a=/[1n]/;function s(e,t,n){this.level=e,this.from=t,this.to=n}return function(l,c){var u="ltr"==c?"L":"R";if(0==l.length||"ltr"==c&&!n.test(l))return!1;for(var d,f=l.length,h=[],p=0;p-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function rt(e,t){var n=tt(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function st(e){e.prototype.on=function(e,t){et(this,e,t)},e.prototype.off=function(e,t){nt(this,e,t)}}function lt(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ct(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ut(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function dt(e){lt(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 pt,mt,gt=function(){if(a&&s<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function vt(e){if(null==pt){var t=A("span","​");M(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(pt=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=pt?A("span","​"):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function yt(e){if(null!=mt)return mt;var t=M(e,document.createTextNode("AخA")),n=L(t,0,1).getBoundingClientRect(),r=L(t,1,2).getBoundingClientRect();return T(e),!(!n||n.left==n.right)&&(mt=r.right-n.right<3)}var bt,xt=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+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)},kt="oncopy"in(bt=A("div"))||(bt.setAttribute("oncopy","return;"),"function"==typeof bt.oncopy),Ct=null;var _t={},Lt={};function St(e){if("string"==typeof e&&Lt.hasOwnProperty(e))e=Lt[e];else if(e&&"string"==typeof e.name&&Lt.hasOwnProperty(e.name)){var t=Lt[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 St("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return St("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Tt(e,t){t=St(t);var n=_t[t.name];if(!n)return Tt(e,"text/plain");var r=n(e,t);if(Mt.hasOwnProperty(t.name)){var i=Mt[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}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 At(e,t){F(t,Mt.hasOwnProperty(e)?Mt[e]:Mt[e]={})}function Nt(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Ot(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 zt(e,t,n){return!e.startState||e.startState(t,n)}var Dt=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};Dt.prototype.eol=function(){return this.pos>=this.string.length},Dt.prototype.sol=function(){return this.pos==this.lineStart},Dt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Dt.prototype.next=function(){if(this.post},Dt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Dt.prototype.skipToEnd=function(){this.pos=this.string.length},Dt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Dt.prototype.backUp=function(e){this.pos-=e},Dt.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},Dt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Dt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Dt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Dt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var Wt=function(e,t){this.state=e,this.lookAhead=t},Ht=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 Et(e,t,n,r){var i=[e.state.modeGen],o={};jt(e,t.text,e.doc.mode,n,function(e,t){return i.push(e,t)},o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],l=1,c=0;n.state=!0,jt(e,t.text,s.mode,n,function(e,t){for(var n=l;ce&&i.splice(l,1,e,i[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength&&Nt(e.doc.mode,r.state),o=Et(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.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 Pt(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Ht(r,!0,t);var o=function(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var l=se(o,s-1),c=l.stateAfter;if(c&&(!n||s+(c instanceof Wt?c.lookAhead:0)<=o.modeFrontier))return s;var u=P(l.text,null,e.options.tabSize);(null==i||r>u)&&(i=s-1,r=u)}return i}(e,t,n),a=o>r.first&&se(r,o-1).stateAfter,s=a?Ht.fromSaved(r,a,o):new Ht(r,zt(r.mode),o);return r.iter(o,t,function(n){It(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}Ht.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Ht.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}},Ht.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Ht.fromSaved=function(e,t,n){return t instanceof Wt?new Ht(e,Nt(e.mode,t.state),n,t.lookAhead):new Ht(e,Nt(e.mode,t),n)},Ht.prototype.save=function(e){var t=!1!==e?Nt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Wt(t,this.maxLookAhead):t};var Bt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function $t(e,t,n,r){var i,o,a=e.doc,s=a.mode,l=se(a,(t=ke(a,t)).line),c=Pt(e,t.line,n),u=new Dt(l.text,e.options.tabSize,c);for(r&&(o=[]);(r||u.pose.options.maxHighlightLength?(s=!1,a&&It(e,t,r,d.pos),d.pos=t.length,l=null):l=Ut(qt(n,d,r.state,f),o),f){var h=f[0].name;h&&(l="m-"+(l?h+" "+l:h))}if(!s||u!=l){for(;c1&&!/ /.test(e))return e;for(var n=t,r="",i=0;ic&&d.from<=c);f++);if(d.to>=u)return e(n,r,i,o,a,s,l);e(n,r.slice(0,d.to-c),i,o,null,s,l),o=null,r=r.slice(d.to-c),c=d.to}}}function tn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function nn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,c,u,d,f,h=i.length,p=0,m=1,g="",v=0;;){if(v==p){l=c=u=s="",f=null,d=null,v=1/0;for(var y=[],b=void 0,x=0;xp||k.collapsed&&w.to==p&&w.from==p)){if(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,c=""),k.className&&(l+=" "+k.className),k.css&&(s=(s?s+";":"")+k.css),k.startStyle&&w.from==p&&(u+=" "+k.startStyle),k.endStyle&&w.to==v&&(b||(b=[])).push(k.endStyle,w.to),k.title&&((f||(f={})).title=k.title),k.attributes)for(var C in k.attributes)(f||(f={}))[C]=k.attributes[C];k.collapsed&&(!d||He(d.marker,k)<0)&&(d=w)}else w.from>p&&v>w.from&&(v=w.from)}if(b)for(var _=0;_=h)break;for(var S=Math.min(h,v);;){if(g){var T=p+g.length;if(!d){var M=T>S?g.slice(0,S-p):g;t.addToken(t,M,a?a+l:l,u,p+M.length==v?c:"",s,f)}if(T>=S){g=g.slice(S-p),p=S;break}p=T,u=""}g=i.slice(o,o=n[m++]),a=Xt(n[m++],t.cm.options)}}else for(var A=1;An)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Nn(e,t,n,r){return Dn(e,zn(e,t),n,r)}function On(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&t2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,r){var i,o=En(t.map,n,r),l=o.node,c=o.start,u=o.end,d=o.collapse;if(3==l.nodeType){for(var f=0;f<4;f++){for(;c&&ie(t.line.text.charAt(o.coverStart+c));)--c;for(;o.coverStart+u1}(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,i))}else{var h;c>0&&(d=r="right"),i=e.options.lineWrapping&&(h=l.getClientRects()).length>1?h["right"==r?h.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!c&&(!i||!i.left&&!i.right)){var p=l.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+nr(e.display),top:p.top,bottom:p.bottom}:Hn}for(var m=i.top-t.rect.top,g=i.bottom-t.rect.top,v=(m+g)/2,y=t.view.measure.heights,b=0;bt)&&(i=(o=l-s)-1,t>=l&&(a="right")),null!=i){if(r=e[c+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)r=e[2+(c-=3)],a="left";if("right"==n&&i==l-s)for(;c=0&&(n=e[i]).left==n.right;i--);return n}function Pn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=r.text.length?(l=r.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(e,t,n){var r=1==s[t].level;return a(n?e-1:e,r!=n)}var d=Xe(s,l,c),f=Ye,h=u(l,d,"before"==c);return null!=f&&(h.other=u(l,f,"before"!=c)),h}function Kn(e,t){var n=0;t=ke(e.doc,t),e.options.lineWrapping||(n=nr(e.display)*t.ch);var r=se(e.doc,t.line),i=Ge(r)+Cn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Yn(e,t,n,r,i){var o=me(e,t,n);return o.xRel=i,r&&(o.outside=!0),o}function Xn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Yn(r.first,0,null,!0,-1);var i=fe(r,n),o=r.first+r.size-1;if(i>o)return Yn(r.first+r.size-1,se(r,o).text.length,null,!0,1);t<0&&(t=0);for(var a=se(r,i);;){var s=er(e,a,i,t,n),l=Ie(a,s.ch+(s.xRel>0?1:0));if(!l)return s;var c=l.find(1);if(c.line==i)return c;a=se(r,i=c.line)}}function Qn(e,t,n,r){r-=$n(t);var i=t.text.length,o=ae(function(t){return Dn(e,n,t-1).bottom<=r},i,0);return{begin:o,end:i=ae(function(t){return Dn(e,n,t).top>r},o,i)}}function Zn(e,t,n,r){return n||(n=zn(e,t)),Qn(e,t,n,Un(e,t,Dn(e,n,r),"line").top)}function Jn(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function er(e,t,n,r,i){i-=Ge(t);var o=zn(e,t),a=$n(t),s=0,l=t.text.length,c=!0,u=Ze(t,e.doc.direction);if(u){var d=(e.options.lineWrapping?function(e,t,n,r,i,o,a){var s=Qn(e,t,r,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,f=0;f=c||h.to<=l)){var p=1!=h.level,m=Dn(e,r,p?Math.min(c,h.to)-1:Math.max(l,h.from)).right,g=mg)&&(u=h,d=g)}}u||(u=i[i.length-1]);u.fromc&&(u={from:u.from,to:c,level:u.level});return u}:function(e,t,n,r,i,o,a){var s=ae(function(s){var l=i[s],c=1!=l.level;return Jn(Vn(e,me(n,c?l.to:l.from,c?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),l=i[s];if(s>0){var c=1!=l.level,u=Vn(e,me(n,c?l.from:l.to,c?"after":"before"),"line",t,r);Jn(u,o,a,!0)&&u.top>a&&(l=i[s-1])}return l})(e,t,n,o,u,r,i);s=(c=1!=d.level)?d.from:d.to-1,l=c?d.to:d.from-1}var f,h,p=null,m=null,g=ae(function(t){var n=Dn(e,o,t);return n.top+=a,n.bottom+=a,!!Jn(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=t,m=n),!0)},s,l),v=!1;if(m){var y=r-m.left=x.bottom}return Yn(n,g=oe(t.text,g,1),h,v,r-f)}function tr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Wn){Wn=A("pre");for(var t=0;t<49;++t)Wn.appendChild(document.createTextNode("x")),Wn.appendChild(A("br"));Wn.appendChild(document.createTextNode("x"))}M(e.measure,Wn);var n=Wn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),T(e.measure),n||1}function nr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),n=A("pre",[t]);M(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function rr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)n[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,r[e.options.gutters[a]]=o.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 or(e){var t=tr(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/nr(e.display)-3);return function(i){if(Ue(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;r=e.display.viewTo||s.to().linet||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}(m,n||0,null==r?f:r,function(e,t,i,d){var g="ltr"==i,v=h(e,g?"left":"right"),y=h(t-1,g?"right":"left"),b=null==n&&0==e,x=null==r&&t==f,w=0==d,k=!m||d==m.length-1;if(y.top-v.top<=3){var C=(c?x:b)&&k,_=(c?b:x)&&w?s:(g?v:y).left,L=C?l:(g?y:v).right;u(_,v.top,L-_,v.bottom)}else{var S,T,M,A;g?(S=c&&b&&w?s:v.left,T=c?l:p(e,i,"before"),M=c?s:p(t,i,"after"),A=c&&x&&k?l:y.right):(S=c?p(e,i,"before"):s,T=!c&&b&&w?l:v.right,M=!c&&x&&k?s:y.left,A=c?p(t,i,"after"):l),u(S,v.top,T-S,v.bottom),v.bottom0?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(),vr(e))}function gr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,yr(e))},100)}function vr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(rt(e,"focus",e,t),e.state.focused=!0,D(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),pr(e))}function yr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(rt(e,"blur",e,t),e.state.focused=!1,S(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function br(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r.005||f<-.005)&&(ue(i.line,l),xr(i.line),i.rest))for(var h=0;he.display.sizerWidth){var p=Math.ceil(c/nr(e.display));p>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function xr(e){if(e.widgets)for(var t=0;t=a&&(o=fe(t,Ge(se(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function kr(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,i=t.gutters.offsetWidth,o=r+"px",a=0;ao&&(t.bottom=t.top+o);var s=e.doc.height+_n(n),l=t.tops-r;if(t.topi+o){var u=Math.min(t.top,(c?s:t.bottom)-o);u!=i&&(a.scrollTop=u)}var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft,f=Tn(e)-(e.options.fixedGutter?n.gutters.offsetWidth:0),h=t.right-t.left>f;return h&&(t.right=t.left+f),t.left<10?a.scrollLeft=0:t.leftf+d-3&&(a.scrollLeft=t.right+(h?0:10)-f),a}function Lr(e,t){null!=t&&(Mr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Sr(e){Mr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Tr(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;t&&(e.curOp.scrollToPos=null,Ar(e,Kn(e,t.from),Kn(e,t.to),t.margin))}function Ar(e,t,n,r){var i=_r(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});Tr(e,i.scrollLeft,i.scrollTop)}function Nr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||si(e,{top:t}),Or(e,t,!0),n&&si(e),ni(e,100))}function Or(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 zr(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,kr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Dr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+_n(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+Sn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Wr=function(e,t,n){this.cm=n;var r=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),et(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),et(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Wr.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 i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"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 o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"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}},Wr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Wr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Wr.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 I,this.disableVert=new I},Wr.prototype.enableZeroWidthBar=function(e,t,n){e.style.pointerEvents="auto",t.set(1e3,function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,r)})},Wr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Hr=function(){};function Er(e,t){t||(t=Dr(e));var n=e.display.barWidth,r=e.display.barHeight;Fr(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&br(e),Fr(e,Dr(e)),n=e.display.barWidth,r=e.display.barHeight}function Fr(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=""}Hr.prototype.update=function(){return{bottom:0,right:0}},Hr.prototype.setScrollLeft=function(){},Hr.prototype.setScrollTop=function(){},Hr.prototype.clear=function(){};var Pr={native:Wr,null:Hr};function Ir(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&S(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Pr[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),et(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?zr(e,t):Nr(e,t)},e),e.display.scrollbars.addClass&&D(e.display.wrapper,e.display.scrollbars.addClass)}var Rr=0;function qr(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Rr},t=e.curOp,an?an.ops.push(t):t.ownsGroup=an={ops:[t],delayedCallbacks:[]}}function Br(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ii(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ur(e){var t=e.cm,n=t.display;e.updatedDisplay&&br(t),e.barMeasure=Dr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Nn(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+Sn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Tn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function jr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=A("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-Cn(e.display))+"px;\n height: "+(t.bottom-t.top+Sn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==(t=t.ch?me(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?me(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var a=!1,s=Vn(e,t),l=n&&n!=t?Vn(e,n):s,c=_r(e,i={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}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(Nr(e,c.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=c.scrollLeft&&(zr(e,c.scrollLeft),Math.abs(e.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}(t,ke(r,e.scrollToPos.from),ke(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;at)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Le&&Be(e.doc,t)i.viewFrom?Jr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Jr(e);else if(t<=i.viewFrom){var o=ei(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Jr(e)}else if(n>=i.viewTo){var a=ei(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):Jr(e)}else{var s=ei(e,t,t,-1),l=ei(e,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(on(e,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):Jr(e)}var c=i.externalMeasured;c&&(n=i.lineN&&t=r.viewTo)){var o=r.view[lr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==R(a,n)&&a.push(n)}}}function Jr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ei(e,t,n,r){var i,o=lr(e,t),a=e.display.view;if(!Le||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,l=0;l0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;Be(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function ti(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo)){var n=+new Date+e.options.workTime,r=Pt(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?Nt(t.mode,r.state):null,l=Et(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),f=0;!d&&fn)return ni(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&Vr(e,function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==ti(e))return!1;Cr(e)&&(Jr(e),t.dims=rr(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Le&&(o=Be(e.doc,o),a=$e(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;!function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=on(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=on(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,lr(e,n)))),r.viewTo=n}(e,o,a),n.viewOffset=Ge(se(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=ti(e);if(!s&&0==c&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=z();if(!t||!O(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&O(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return c>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return l&&y&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var c=r.view,u=r.viewFrom,d=0;d-1&&(h=!1),un(e,f,u,n)),h&&(T(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(pe(e.options,u)))),a=f.node.nextSibling}else{var p=vn(e,f,u,n);o.insertBefore(p,a)}u+=f.size}for(;a;)a=s(a)}(e,n.updateLineNumbers,t.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=z()&&(e.activeElt.focus(),e.anchorNode&&O(document.body,e.anchorNode)&&O(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(u),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,ni(e,400)),n.updateLineNumbers=null,!0}function ai(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Tn(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+_n(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)))&&oi(e,t);r=!1){br(e);var i=Dr(e);cr(e),Er(e,i),ci(e,i),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 si(e,t){var n=new ii(e,t);if(oi(e,n)){br(e),ai(e,n);var r=Dr(e);cr(e),Er(e,r),ci(e,r),n.finish()}}function li(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function ci(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+Sn(e)+"px"}function ui(e){var t=e.display.gutters,n=e.options.gutters;T(t);for(var r=0;r-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}ii.prototype.signal=function(e,t){at(e,t)&&this.events.push(arguments)},ii.prototype.finish=function(){for(var e=0;es.clientWidth,u=s.scrollHeight>s.clientHeight;if(i&&c||o&&u){if(o&&y&&l)e:for(var f=t.target,h=a.view;f!=s;f=f.parentNode)for(var p=0;p=0&&ge(e,r.to())<=0)return n}return-1};var yi=function(e,t){this.anchor=e,this.head=t};function bi(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(e,t){return ge(e.from(),t.from())}),n=R(t,i);for(var o=1;o0:l>=0){var c=xe(s.from(),a.from()),u=be(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new yi(d?u:c,d?c:u))}}return new vi(t,n)}function xi(e,t){return new vi([new yi(e,t||e)],0)}function wi(e){return e.text?me(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function ki(e,t){if(ge(e,t.from)<0)return e;if(ge(e,t.to)<=0)return wi(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+=wi(t).ch-t.to.ch),me(n,r)}function Ci(e,t){for(var n=[],r=0;r1&&e.remove(s.line+1,p-1),e.insert(s.line+1,v)}ln(e,"change",e,t)}function Ai(e,t,n){!function e(r,i,o){if(r.linked)for(var a=0;as-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(Wi(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}(i,i.lastOp==r)))a=Y(o.changes),0==ge(t.from,t.to)&&0==ge(t.from,a.to)?a.to=wi(t):o.changes.push(Di(e,t));else{var l=Y(i.done);for(l&&l.ranges||Fi(e.sel,i.done),o={changes:[Di(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||rt(e,"historyAdded")}function Ei(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,Y(i.done),t))?i.done[i.done.length-1]=t:Fi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&Wi(i.undone)}function Fi(e,t){var n=Y(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Pi(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function Ii(e){if(!e)return null;for(var t,n=0;n-1&&(Y(s)[d]=c[d],delete c[d])}}}return r}function Bi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=ge(t,i)<0;o!=ge(n,i)<0?(i=t,t=n):o!=ge(t,n)<0&&(t=n)}return new yi(i,t)}return new yi(n||t,t)}function $i(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),Ki(e,new vi([Bi(e.sel.primary(),t,n,i)],0),r)}function Ui(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:s.to>t.ch))){if(i&&(rt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var c=l.find(r<0?1:-1),u=void 0;if((r<0?l.inclusiveRight:l.inclusiveLeft)&&(c=to(e,c,-r,c&&c.line==t.line?o:null)),c&&c.line==t.line&&(u=ge(c,n))&&(r<0?u<0:u>0))return Ji(e,c,t,r,i)}var d=l.find(r<0?-1:1);return(r<0?l.inclusiveLeft:l.inclusiveRight)&&(d=to(e,d,r,d.line==t.line?o:null)),d?Ji(e,d,t,r,i):null}}return t}function eo(e,t,n,r,i){var o=r||1,a=Ji(e,t,n,o,i)||!i&&Ji(e,t,n,o,!0)||Ji(e,t,n,-o,i)||!i&&Ji(e,t,n,-o,!0);return a||(e.cantEdit=!0,me(e.first,0))}function to(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?ke(e,me(t.line-1)):null:n>0&&t.ch==(r||se(e,t.line)).text.length?t.line0)){var u=[l,1],d=ge(c.from,s.from),f=ge(c.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:s.from}),(f>0||!a.inclusiveRight&&!f)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-3}}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)oo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else oo(e,t)}}function oo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ge(t.from,t.to)){var n=Ci(e,t);Hi(e,t,n,e.cm?e.cm.curOp.id:NaN),lo(e,t,n,Ae(e,t));var r=[];Ai(e,function(e,n){n||-1!=R(r,e.history)||(ho(e.history,t),r.push(e.history)),lo(e,t,null,Ae(e,t))})}}function ao(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,c=0;c=0;--h){var p=f(h);if(p)return p.v}}}}function so(e,t){if(0!=t&&(e.first+=t,e.sel=new vi(X(e.sel.ranges,function(e){return new yi(me(e.anchor.line+t,e.anchor.ch),me(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;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:me(o,se(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=le(e,t.from,t.to),n||(n=Ci(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=de(qe(se(r,o.line))),r.iter(l,a.line+1,function(e){if(e==i.maxLine)return s=!0,!0}));r.sel.contains(t.from,t.to)>-1&&ot(e);Mi(r,t,n,or(e)),e.options.lineWrapping||(r.iter(l,o.line+t.text.length,function(e){var t=Ve(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0));(function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=se(e,r).stateAfter;if(i&&(!(i instanceof Wt)||r+i.lookAhead1||!(this.children[0]instanceof mo))){var s=[];this.collapse(s),this.children=[new mo(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=N("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Re(e,t.line,t,n,o)||t.line!=n.line&&Re(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Le=!0}o.addToHistory&&Hi(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&qe(e)==c.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&ue(e,0),function(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}(e,new Se(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l}),o.collapsed&&e.iter(t.line,n.line+1,function(t){Ue(e,t)&&ue(t,0)}),o.clearOnEnter&&et(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(_e=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++bo,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)Qr(c,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=n.line;u++)Zr(c,u,"text");o.atomic&&Qi(c.doc),ln(c,"markerAdded",c,o)}return o}xo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&qr(e),at(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=c,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Qr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Qi(e.doc)),e&&ln(e,"markerCleared",e,this,r,i),t&&Br(e),this.parent&&this.parent.clear()}},xo.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=0;l--)io(this,r[l]);s?Vi(this,s):this.cm&&Sr(this.cm)}),undo:Xr(function(){ao(this,"undo")}),redo:Xr(function(){ao(this,"redo")}),undoSelection:Xr(function(){ao(this,"undo",!0)}),redoSelection:Xr(function(){ao(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.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ke(this,e),t=ke(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n}),ke(this,me(n,t))},indexFromPos:function(e){var t=(e=ke(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var u=e.dataTransfer.getData("Text");if(u){var d;if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),Yi(t.doc,xi(n,n)),d)for(var f=0;f=0;t--)co(e.doc,"",r[t].from,r[t].to,"+delete");Sr(e)})}function Vo(e,t,n){var r=oe(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ko(e,t,n){var r=Vo(e,t.ch,n);return null==r?null:new me(t.line,r,n<0?"after":"before")}function Yo(e,t,n,r,i){if(e){var o=Ze(n,t.doc.direction);if(o){var a,s=i<0?Y(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var c=zn(t,n);a=i<0?n.text.length-1:0;var u=Dn(t,c,a).top;a=ae(function(e){return Dn(t,c,e).top==u},i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=Vo(n,a,1))}else a=i<0?s.to:s.from;return new me(r,a,l)}}return new me(r,i<0?n.text.length:0,i<0?"before":"after")}Po.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"},Po.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"},Po.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"},Po.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"]},Po.default=y?Po.macDefault:Po.pcDefault;var Xo={selectAll:no,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),$)},killLine:function(e){return Go(e,function(t){if(t.empty()){var n=se(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new me(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),me(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=se(e.doc,i.line-1).text;a&&(i=new me(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),me(i.line-1,a.length-1),i,"+transpose"))}n.push(new yi(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return Vr(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-1&&(ge((i=c.ranges[i]).from(),t)<0||t.xRel>0)&&(ge(i.to(),t)>0||t.xRel<0)?function(e,t,n,r){var i=e.display,o=!1,c=Kr(e,function(t){l&&(i.scroller.draggable=!1),e.state.draggingText=!1,nt(i.wrapper.ownerDocument,"mouseup",c),nt(i.wrapper.ownerDocument,"mousemove",u),nt(i.scroller,"dragstart",d),nt(i.scroller,"drop",c),o||(lt(t),r.addNew||$i(e.doc,n,null,null,r.extend),l||a&&9==s?setTimeout(function(){i.wrapper.ownerDocument.body.focus(),i.input.focus()},20):i.input.focus())}),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},d=function(){return o=!0};l&&(i.scroller.draggable=!0);e.state.draggingText=c,c.copy=!r.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop();et(i.wrapper.ownerDocument,"mouseup",c),et(i.wrapper.ownerDocument,"mousemove",u),et(i.scroller,"dragstart",d),et(i.scroller,"drop",c),gr(e),setTimeout(function(){return i.input.focus()},20)}(e,r,t,o):function(e,t,n,r){var i=e.display,o=e.doc;lt(t);var a,s,l=o.sel,c=l.ranges;r.addNew&&!r.extend?(s=o.sel.contains(n),a=s>-1?c[s]:new yi(n,n)):(a=o.sel.primary(),s=o.sel.primIndex);if("rectangle"==r.unit)r.addNew||(a=new yi(n,n)),n=sr(e,t,!0,!0),s=-1;else{var u=fa(e,n,r.unit);a=r.extend?Bi(a,u.anchor,u.head,r.extend):u}r.addNew?-1==s?(s=c.length,Ki(o,bi(e,c.concat([a]),s),{scroll:!1,origin:"*mouse"})):c.length>1&&c[s].empty()&&"char"==r.unit&&!r.extend?(Ki(o,bi(e,c.slice(0,s).concat(c.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):ji(o,s,a,U):(s=0,Ki(o,new vi([a],0),U),l=o.sel);var d=n;function f(t){if(0!=ge(d,t))if(d=t,"rectangle"==r.unit){for(var i=[],c=e.options.tabSize,u=P(se(o,n.line).text,n.ch,c),f=P(se(o,t.line).text,t.ch,c),h=Math.min(u,f),p=Math.max(u,f),m=Math.min(n.line,t.line),g=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=g;m++){var v=se(o,m).text,y=G(v,h,c);h==p?i.push(new yi(me(m,y),me(m,y))):v.length>y&&i.push(new yi(me(m,y),me(m,G(v,p,c))))}i.length||i.push(new yi(n,n)),Ki(o,bi(e,l.ranges.slice(0,s).concat(i),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,x=a,w=fa(e,t,r.unit),k=x.anchor;ge(w.anchor,k)>0?(b=w.head,k=xe(x.from(),w.anchor)):(b=w.anchor,k=be(x.to(),w.head));var C=l.ranges.slice(0);C[s]=function(e,t){var n=t.anchor,r=t.head,i=se(e.doc,n.line);if(0==ge(n,r)&&n.sticky==r.sticky)return t;var o=Ze(i);if(!o)return t;var a=Xe(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var l,c=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==c||c==o.length)return t;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=Xe(o,r.ch,r.sticky),d=u-a||(r.ch-n.ch)*(1==s.level?-1:1);l=u==c-1||u==c?d<0:d>0}var f=o[c+(l?-1:0)],h=l==(1==f.level),p=h?f.from:f.to,m=h?"after":"before";return n.ch==p&&n.sticky==m?t:new yi(new me(n.line,p,m),r)}(e,new yi(ke(o,k),b)),Ki(o,bi(e,C,s),U)}}var h=i.wrapper.getBoundingClientRect(),p=0;function m(t){e.state.selectingText=!1,p=1/0,lt(t),i.input.focus(),nt(i.wrapper.ownerDocument,"mousemove",g),nt(i.wrapper.ownerDocument,"mouseup",v),o.history.lastSelOrigin=null}var g=Kr(e,function(t){0!==t.buttons&&ht(t)?function t(n){var a=++p;var s=sr(e,n,!0,"rectangle"==r.unit);if(!s)return;if(0!=ge(s,d)){e.curOp.focus=z(),f(s);var l=wr(i,o);(s.line>=l.to||s.lineh.bottom?20:0;c&&setTimeout(Kr(e,function(){p==a&&(i.scroller.scrollTop+=c,t(n))}),50)}}(t):m(t)}),v=Kr(e,m);e.state.selectingText=v,et(i.wrapper.ownerDocument,"mousemove",g),et(i.wrapper.ownerDocument,"mouseup",v)}(e,r,t,o)}(t,r,o,e):ft(e)==n.scroller&<(e):2==i?(r&&$i(t.doc,r),setTimeout(function(){return n.input.focus()},20)):3==i&&(C?t.display.input.onContextMenu(e):gr(t)))}}function fa(e,t,n){if("char"==n)return new yi(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new yi(me(t.line,0),ke(e.doc,me(t.line+1,0)));var r=n(e,t);return new yi(r.from,r.to)}function ha(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&<(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!at(e,n))return ut(t);o-=s.top-a.viewOffset;for(var l=0;l=i)return rt(e,n,e,fe(e.doc,o),e.options.gutters[l],t),ut(t)}}function pa(e,t){return ha(e,t,"gutterClick",!0)}function ma(e,t){kn(e.display,t)||function(e,t){if(!at(e,"gutterContextMenu"))return!1;return ha(e,t,"gutterContextMenu",!1)}(e,t)||it(e,t,"contextmenu")||C||e.display.input.onContextMenu(t)}function ga(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Rn(e)}ua.prototype.compare=function(e,t,n){return this.time+400>e&&0==ge(t,this.pos)&&n==this.button};var va={toString:function(){return"CodeMirror.Init"}},ya={},ba={};function xa(e){ui(e),Qr(e),kr(e)}function wa(e,t,n){if(!t!=!(n&&n!=va)){var r=e.display.dragFunctions,i=t?et:nt;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function ka(e){e.options.lineWrapping?(D(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(S(e.display.wrapper,"CodeMirror-wrap"),Ke(e)),ar(e),Qr(e),Rn(e),setTimeout(function(){return Er(e)},100)}function Ca(e,t){var r=this;if(!(this instanceof Ca))return new Ca(e,t);this.options=t=t?F(t):{},F(ya,t,!1),di(t);var i=t.value;"string"==typeof i?i=new So(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var o=new Ca.inputStyles[t.inputStyle](this),c=this.display=new function(e,t,r){var i=this;this.input=r,i.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=N("div",null,"CodeMirror-code"),i.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=A("div",null,"CodeMirror-cursors"),i.measure=A("div",null,"CodeMirror-measure"),i.lineMeasure=A("div",null,"CodeMirror-measure"),i.lineSpace=N("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=N("div",[i.lineSpace],"CodeMirror-lines");i.mover=A("div",[o],null,"position: relative"),i.sizer=A("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=A("div",null,null,"position: absolute; height: "+q+"px; width: 1px;"),i.gutters=A("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=A("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=A("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),a&&s<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),l||n&&v||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,r.init(i)}(e,i,o);for(var u in c.wrapper.CodeMirror=this,ui(this),ga(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ir(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 I,keySeq:null,specialChars:null},t.autofocus&&!v&&c.input.focus(),a&&s<11&&setTimeout(function(){return r.display.input.reset(!0)},20),function(e){var t=e.display;et(t.scroller,"mousedown",Kr(e,da)),et(t.scroller,"dblclick",a&&s<11?Kr(e,function(t){if(!it(e,t)){var n=sr(e,t);if(n&&!pa(e,t)&&!kn(e.display,t)){lt(t);var r=e.findWordAt(n);$i(e.doc,r.anchor,r.head)}}}):function(t){return it(e,t)||lt(t)});et(t.scroller,"contextmenu",function(t){return ma(e,t)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),(r=t.activeTouch).end=+new Date)}function o(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}et(t.scroller,"touchstart",function(i){if(!it(e,i)&&!function(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}(i)&&!pa(e,i)){t.input.ensurePolled(),clearTimeout(n);var o=+new Date;t.activeTouch={start:o,moved:!1,prev:o-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}}),et(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),et(t.scroller,"touchend",function(n){var r=t.activeTouch;if(r&&!kn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var a,s=e.coordsChar(t.activeTouch,"page");a=!r.prev||o(r,r.prev)?new yi(s,s):!r.prev.prev||o(r,r.prev.prev)?e.findWordAt(s):new yi(me(s.line,0),ke(e.doc,me(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),lt(n)}i()}),et(t.scroller,"touchcancel",i),et(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Nr(e,t.scroller.scrollTop),zr(e,t.scroller.scrollLeft,!0),rt(e,"scroll",e))}),et(t.scroller,"mousewheel",function(t){return gi(e,t)}),et(t.scroller,"DOMMouseScroll",function(t){return gi(e,t)}),et(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){it(e,t)||dt(t)},over:function(t){it(e,t)||(!function(e,t){var n=sr(e,t);if(n){var r=document.createDocumentFragment();dr(e,n,r),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),M(e.display.dragCursor,r)}}(e,t),dt(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-To<100))dt(t);else if(!it(e,t)&&!kn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!f)){var n=A("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}(e,t)},drop:Kr(e,Mo),leave:function(t){it(e,t)||Ao(e)}};var l=t.input.getField();et(l,"keyup",function(t){return aa.call(e,t)}),et(l,"keydown",Kr(e,oa)),et(l,"keypress",Kr(e,sa)),et(l,"focus",function(t){return vr(e,t)}),et(l,"blur",function(t){return yr(e,t)})}(this),zo(),qr(this),this.curOp.forceUpdate=!0,Ni(this,i),t.autofocus&&!v||this.hasFocus()?setTimeout(E(vr,this),20):yr(this),ba)ba.hasOwnProperty(u)&&ba[u](r,t[u],va);Cr(this),t.finishInit&&t.finishInit(this);for(var h=0;h<_a.length;++h)_a[h](r);Br(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(c.lineDiv).textRendering&&(c.lineDiv.style.textRendering="auto")}Ca.defaults=ya,Ca.optionHandlers=ba;var _a=[];function La(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=Pt(e,t).state:n="prev");var a=e.options.tabSize,s=se(o,t),l=P(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((c=o.mode.indent(i,s.text.slice(u.length),s.text))==B||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?P(se(o,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var d="",f=0;if(e.options.indentWithTabs)for(var h=Math.floor(c/a);h;--h)f+=a,d+="\t";if(fa,l=xt(t),c=null;if(s&&r.ranges.length>1)if(Sa&&Sa.text.join("\n")==t){if(r.ranges.length%Sa.text.length==0){c=[];for(var u=0;u=0;f--){var h=r.ranges[f],p=h.from(),m=h.to();h.empty()&&(n&&n>0?p=me(p.line,p.ch-n):e.state.overwrite&&!s?m=me(m.line,Math.min(se(o,m.line).text.length,m.ch+Y(l).length)):s&&Sa&&Sa.lineWise&&Sa.text.join("\n")==t&&(p=m=me(p.line,0)));var g={from:p,to:m,text:c?c[f%c.length]:l,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};io(e.doc,g),ln(e,"inputRead",e,g)}t&&!s&&Na(e,t),Sr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Aa(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||Vr(t,function(){return Ma(t,n,0,null,"paste")}),!0}function Na(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=La(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(se(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=La(e,i.head.line,"smart"));a&&ln(e,"electricInput",e,i.head.line)}}}function Oa(e){for(var t=[],n=[],r=0;r=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=Xe(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&f>=u.begin)){var h=d?"before":"after";return new me(n.line,f,h)}}var p=function(e,t,r){for(var o=function(e,t){return t?new me(n.line,l(e,1),"before"):new me(n.line,e,"after")};e>=0&&e0==(1!=a.level),c=s?r.begin:l(r.end,-1);if(a.from<=c&&c0?u.end:l(u.begin,-1);return null==g||r>0&&g==t.text.length||!(m=p(r>0?0:i.length-1,r,c(g)))?null:m}(e.cm,s,t,n):Ko(s,t,n))){if(r||(a=t.line+n)=e.first+e.size||(t=new me(a,t.ch,t.sticky),!(s=se(e,a))))return!1;t=Yo(i,e.cm,s,t.line,n)}else t=o;return!0}if("char"==r)l();else if("column"==r)l(!0);else if("word"==r||"group"==r)for(var c=null,u="group"==r,d=e.cm&&e.cm.getHelper(t,"wordChars"),f=!0;!(n<0)||l(!f);f=!1){var h=s.text.charAt(t.ch)||"\n",p=te(h,d)?"w":u&&"\n"==h?"n":!u||/\s/.test(h)?null:"p";if(!u||f||p||(p="s"),c&&c!=p){n<0&&(n=1,l(),t.sticky="after");break}if(p&&(c=p),n>0&&!l(!f))break}var m=eo(e,t,o,a,!0);return ve(o,m)&&(m.hitSide=!0),m}function Ha(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var l=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),c=Math.max(l-.5*tr(e.display),3);i=(n>0?t.bottom:t.top)+n*c}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Xn(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Ea=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new I,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Fa(e,t){var n=On(e,t.line);if(!n||n.hidden)return null;var r=se(e.doc,t.line),i=An(n,r,t.line),o=Ze(r,e.doc.direction),a="left";o&&(a=Xe(o,t.ch)%2?"right":"left");var s=En(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Pa(e,t){return t&&(e.bad=!0),e}function Ia(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Pa(e.clipPos(me(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 i=0;i=t.display.viewTo||o.line=t.display.viewFrom&&Fa(t,i)||{node:l[0].measure.map[2],offset:0},u=o.liner.firstLine()&&(a=me(a.line-1,se(r.doc,a.line-1).length)),s.ch==se(r.doc,s.line).text.length&&s.linei.viewTo-1)return!1;a.line==i.viewFrom||0==(e=lr(r,a.line))?(t=de(i.view[0].line),n=i.view[0].node):(t=de(i.view[e].line),n=i.view[e-1].node.nextSibling);var l,c,u=lr(r,s.line);if(u==i.view.length-1?(l=i.viewTo-1,c=i.lineDiv.lastChild):(l=de(i.view[u+1].line)-1,c=i.view[u+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(function(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function c(){a&&(o+=s,l&&(o+=s),a=l=!1)}function u(e){e&&(c(),o+=e)}function d(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void u(n);var o,f=t.getAttribute("cm-marker");if(f){var h=e.findMarks(me(r,0),me(i+1,0),(g=+f,function(e){return e.id==g}));return void(h.length&&(o=h[0].find(0))&&u(le(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var p=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;p&&c();for(var m=0;m1&&f.length>1;)if(Y(d)==Y(f))d.pop(),f.pop(),l--;else{if(d[0]!=f[0])break;d.shift(),f.shift(),t++}for(var h=0,p=0,m=d[0],g=f[0],v=Math.min(m.length,g.length);ha.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)h--,p++;d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,"");var w=me(t,h),k=me(l,f.length?Y(f).length-p:0);return d.length>1||d[0]||ge(w,k)?(co(r.doc,d,w,k,"+input"),!0):void 0},Ea.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ea.prototype.reset=function(){this.forceCompositionEnd()},Ea.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ea.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))},Ea.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Vr(this.cm,function(){return Qr(e.cm)})},Ea.prototype.setUneditable=function(e){e.contentEditable="false"},Ea.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Kr(this.cm,Ma)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ea.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ea.prototype.onContextMenu=function(){},Ea.prototype.resetPosition=function(){},Ea.prototype.needsContentAttribute=!0;var qa=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new I,this.hasSelection=!1,this.composing=null};qa.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!it(r,e)){if(r.somethingSelected())Ta({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=Oa(r);Ta({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,$):(n.prevInput="",i.value=t.text.join("\n"),H(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),m&&(i.style.width="0px"),et(i,"input",function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),et(i,"paste",function(e){it(r,e)||Aa(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())}),et(i,"cut",o),et(i,"copy",o),et(e.scroller,"paste",function(t){if(!kn(e,t)&&!it(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}}),et(e.lineSpace,"selectstart",function(t){kn(e,t)||lt(t)}),et(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"})}}),et(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},qa.prototype.createField=function(e){this.wrapper=Da(),this.textarea=this.wrapper.firstChild},qa.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=ur(e);if(e.options.moveInputWithCursor){var i=Vn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},qa.prototype.showSelection=function(e){var t=this.cm.display;M(t.cursorDiv,e.cursors),M(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},qa.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&&H(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},qa.prototype.getField=function(){return this.textarea},qa.prototype.supportsTouch=function(){return!1},qa.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||z()!=this.textarea))try{this.textarea.focus()}catch(e){}},qa.prototype.blur=function(){this.textarea.blur()},qa.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},qa.prototype.receivedFocus=function(){this.slowPoll()},qa.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},qa.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))})},qa.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 i=n.value;if(i==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(r.length,i.length);l1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},qa.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},qa.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},qa.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=sr(n,e),c=r.scroller.scrollTop;if(o&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Kr(n,Ki)(n.doc,xi(o),$);var u,f=i.style.cssText,h=t.wrapper.style.cssText,p=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-p.top-5)+"px; left: "+(e.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(u=window.scrollY),r.input.focus(),l&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&g(),C){dt(e);var m=function(){nt(window,"mouseup",m),setTimeout(v,20)};et(window,"mouseup",m)}else setTimeout(v,50)}function g(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function v(){if(t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=h,i.style.cssText=f,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),null!=i.selectionStart)){(!a||a&&s<9)&&g();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?Kr(n,no)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},qa.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},qa.prototype.setUneditable=function(){},qa.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=va&&i(e,t,n)}:i)}e.defineOption=n,e.Init=va,n("value","",function(e,t){return e.setValue(t)},!0),n("mode",null,function(e,t){e.doc.modeOption=t,Li(e)},!0),n("indentUnit",2,Li,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(e){Si(e),Rn(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 i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(me(r,o))}r++});for(var i=n.length-1;i>=0;i--)co(e.doc,t,n[i],me(n[i].line,n[i].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!=va&&e.refresh()}),n("specialCharPlaceholder",Zt,function(e){return e.refresh()},!0),n("electricChars",!0),n("inputStyle",v?"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("autocorrect",!1,function(e,t){return e.getInputField().autocorrect=t},!0),n("autocapitalize",!1,function(e,t){return e.getInputField().autocapitalize=t},!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",function(e){ga(e),xa(e)},!0),n("keyMap","default",function(e,t,n){var r=jo(t),i=n!=va&&jo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,ka,!0),n("gutters",[],function(e){di(e.options),xa(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 Er(e)},!0),n("scrollbarStyle","native",function(e){Ir(e),Er(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),n("lineNumbers",!1,function(e){di(e.options),xa(e)},!0),n("firstLineNumber",1,xa,!0),n("lineNumberFormatter",function(e){return e},xa,!0),n("showCursorWhenSelecting",!1,cr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),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,Si,!0),n("addModeClass",!1,Si,!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,Si,!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),n("phrases",null)}(Ca),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,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&Kr(this,t[e])(this,n,i),rt(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"](jo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(La(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Sr(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&ji(this.doc,r,new yi(o,c[r].to()),$)}}}),getTokenAt:function(e,t){return $t(this,e,t)},getLineTokens:function(e,t){return $t(this,me(e),t,!0)},getTokenTypeAt:function(e){e=ke(this.doc,e);var t,n=Ft(this,se(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(e=o,i=!0),r=se(this.doc,e)}else r=e;return Un(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-Ge(r):0)},defaultTextHeight:function(){return tr(this.display)},defaultCharWidth:function(){return nr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o,a,s,l=this.display,c=(e=Vn(this,ke(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),l.sizer.appendChild(t),"over"==r)c=e.top;else if("above"==r||"near"==r){var d=Math.max(l.wrapper.clientHeight,this.doc.height),f=Math.max(l.sizer.clientWidth,l.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>d)&&e.top>t.offsetHeight?c=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=d&&(c=e.bottom),u+t.offsetWidth>f&&(u=f-t.offsetWidth)}t.style.top=c+"px",t.style.left=t.style.right="","right"==i?(u=l.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?u=0:"middle"==i&&(u=(l.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&(o=this,a={left:u,top:c,right:u+t.offsetWidth,bottom:c+t.offsetHeight},null!=(s=_r(o,a)).scrollTop&&Nr(o,s.scrollTop),null!=s.scrollLeft&&zr(o,s.scrollLeft))},triggerOnKeyDown:Yr(oa),triggerOnKeyPress:Yr(sa),triggerOnKeyUp:aa,triggerOnMouseDown:Yr(da),execCommand:function(e){if(Xo.hasOwnProperty(e))return Xo[e].call(null,this)},triggerElectric:Yr(function(e){Na(this,e)}),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=ke(this.doc,e),a=0;a0&&a(t.charAt(n-1));)--n;for(;r.5)&&ar(this),rt(this,"refresh",this)}),swapDoc:Yr(function(e){var t=this.doc;return t.cm=null,Ni(this,e),Rn(this),this.display.input.reset(),Tr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ln(this,"swapDoc",this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},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}},st(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}(Ca);var Ba="iter insert remove copy getEditor constructor".split(" ");for(var $a in So.prototype)So.prototype.hasOwnProperty($a)&&R(Ba,$a)<0&&(Ca.prototype[$a]=function(e){return function(){return e.apply(this.doc,arguments)}}(So.prototype[$a]));return st(So),Ca.inputStyles={textarea:qa,contenteditable:Ea},Ca.defineMode=function(e){Ca.defaults.mode||"null"==e||(Ca.defaults.mode=e),function(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),_t[e]=t}.apply(this,arguments)},Ca.defineMIME=function(e,t){Lt[e]=t},Ca.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ca.defineMIME("text/plain","null"),Ca.defineExtension=function(e,t){Ca.prototype[e]=t},Ca.defineDocExtension=function(e,t){So.prototype[e]=t},Ca.fromTextArea=function(e,t){if((t=t?F(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=z();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(et(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(t){t.save=r,t.getTextArea=function(){return e},t.toTextArea=function(){t.toTextArea=isNaN,r(),e.parentNode.removeChild(t.getWrapperElement()),e.style.display="",e.form&&(nt(e.form,"submit",r),"function"==typeof e.form.submit&&(e.form.submit=i))}},e.style.display="none";var s=Ca(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s},function(e){e.off=nt,e.on=et,e.wheelEventPixels=mi,e.Doc=So,e.splitLines=xt,e.countColumn=P,e.findColumn=G,e.isWordChar=ee,e.Pass=B,e.signal=rt,e.Line=Gt,e.changeEnd=wi,e.scrollbarModel=Pr,e.Pos=me,e.cmpPos=ge,e.modes=_t,e.mimeModes=Lt,e.resolveMode=St,e.getMode=Tt,e.modeExtensions=Mt,e.extendMode=At,e.copyState=Nt,e.startState=zt,e.innerMode=Ot,e.commands=Xo,e.keyMap=Po,e.keyName=Uo,e.isModifierKey=Bo,e.lookupKey=qo,e.normalizeKeyMap=Ro,e.StringStream=Dt,e.SharedTextMarker=ko,e.TextMarker=xo,e.LineWidget=vo,e.e_preventDefault=lt,e.e_stopPropagation=ct,e.e_stop=dt,e.addClass=D,e.contains=O,e.rmClass=S,e.keyNames=Wo}(Ca),Ca.version="5.45.0",Ca},e.exports=r()},646:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(639),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);var a=n(649);var s=function(e){n(647)},l=n(27)(i.a,a.a,!1,s,null,null);t.default=l.exports},647:function(e,t,n){var r=n(648);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(35)("3d76622a",r,!0,{})},648:function(e,t,n){(e.exports=n(34)(!1)).push([e.i,"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}",""])},649:function(e,t,n){"use strict";var r={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.isSpin?n("div",{class:e.isLeft?"spin-sp2":"spin-sp1",attrs:{id:"spin-model"}},[n("div",{staticClass:"svg-box"},[n("svg",{staticClass:"lds-gears",staticStyle:{background:"none"},attrs:{width:"54px",height:"54px",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"}},[n("g",{attrs:{transform:"translate(50 50)"}},[n("g",{attrs:{transform:"translate(-19 -19) scale(0.6)"}},[n("g",{attrs:{transform:"rotate(107.866)"}},[n("animateTransform",{attrs:{attributeName:"transform",type:"rotate",values:"0;360",keyTimes:"0;1",dur:"1s",begin:"0s",repeatCount:"indefinite"}}),n("path",{attrs:{d:"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23",fill:"#0097e0"}})],1)]),e._v(" "),n("g",{attrs:{transform:"translate(19 19) scale(0.6)"}},[n("g",{attrs:{transform:"rotate(229.634)"}},[n("animateTransform",{attrs:{attributeName:"transform",type:"rotate",values:"360;0",keyTimes:"0;1",dur:"1s",begin:"-0.0625s",repeatCount:"indefinite"}}),n("path",{attrs:{d:"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23",fill:"#7f8b95"}})],1)])])]),e._v(" "),n("span",{staticClass:"sp1"},[e._v(e._s(e.$t("正在努力加载中...")))])])]):e._e()},staticRenderFns:[]};t.a=r},650:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(640),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);var a=n(653);var s=function(e){n(651)},l=n(27)(i.a,a.a,!1,s,null,null);t.default=l.exports},651:function(e,t,n){var r=n(652);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(35)("70439c42",r,!0,{})},652:function(e,t,n){(e.exports=n(34)(!1)).push([e.i,"",""])},653:function(e,t,n){"use strict";var r={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"home-main list-construction-model"},[t("div",{staticClass:"content-title"},[t("span",[this._v(this._s(this.title))])]),this._v(" "),t("div",{staticClass:"conditions-box"},[this._t("conditions")],2),this._v(" "),t("div",{staticClass:"list-box"},[this._t("content")],2)])},staticRenderFns:[]};t.a=r},654:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(641),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);var a=n(660);var s=function(e){n(655)},l=n(27)(i.a,a.a,!1,s,null,null);t.default=l.exports},655:function(e,t,n){var r=n(656);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(35)("6a41b246",r,!0,{})},656:function(e,t,n){var r=n(124);(e.exports=n(34)(!1)).push([e.i,".main-layout-box.toggle{padding-left:0}.main-layout-box.toggle>.secondary-menu-model{left:-200px}.secondary-menu-model{position:fixed;left:0;top:0;width:200px;background:#41444c;height:100%;padding-top:80px}.secondary-menu-model .toogle-box{position:absolute;right:-1px;top:calc(50% - 50px)}.secondary-menu-model .toogle-box .tog-close{width:12px;height:102px;background:url("+r(n(657))+") no-repeat;display:inline-block}.secondary-menu-model .toogle-box .tog-open{width:12px;height:102px;background:url("+r(n(658))+") no-repeat;display:inline-block;position:absolute;right:-12px;top:0}.secondary-menu-model .leven-1 .name a{height:40px;line-height:40px;display:block;position:relative;padding-left:12px}.secondary-menu-model .leven-1 .name a>.icon{vertical-align:middle;font-size:15px;width:20px;text-align:center;color:#fff}.secondary-menu-model .leven-1 .name a>span{vertical-align:middle;padding-left:2px;font-size:14px;color:#fff}.secondary-menu-model .leven-1 .name a>.angle{position:absolute;right:12px;top:14px}.secondary-menu-model .leven-1 ul li{height:36px;line-height:36px;cursor:pointer;padding-left:39px;color:#fff}.secondary-menu-model .leven-1 ul li a{font-size:14px}.secondary-menu-model .leven-1 ul li.active{border-right:2px solid #2d8cf0;background:#2c2f39}.secondary-menu-model .leven-1 ul li.active span{font-weight:700;color:#2d8cf0}.secondary-menu-model .leven-1 .router-link-active,.secondary-menu-model .leven-1>.router-link-exact-active{background:#f0f6fb}.secondary-menu-model .leven-1 .router-link-active .name,.secondary-menu-model .leven-1>.router-link-exact-active .name{border-right:2px solid #2d8cf0;background:#2b2e38}.secondary-menu-model .leven-1 .router-link-active .name a span,.secondary-menu-model .leven-1>.router-link-exact-active .name a span{color:#2d8cf0;font-weight:700}.secondary-menu-model .leven-1 .router-link-active .name a .fa,.secondary-menu-model .leven-1>.router-link-exact-active .name a .fa{color:#2d8cf0}",""])},657:function(e,t,n){e.exports=n.p+"images/close.png?02806e641df25c1b4dbff4cb0af3984d"},658:function(e,t,n){e.exports=n.p+"images/open.png?97ec0726c7acab8a2a48282d68cea631"},659:function(e,t,n){"use strict";t.__esModule=!0;var r,i=n(36),o=(r=i)&&r.__esModule?r:{default:r};var a={projects:[{name:""+o.default.$t("项目首页"),id:1,path:"projects-index",isOpen:!0,icon:"fa-home",children:[]},{name:""+o.default.$t("工作流"),id:2,path:"",isOpen:!0,icon:"fa-gear",children:[{name:""+o.default.$t("工作流定义"),path:"definition",id:1},{name:""+o.default.$t("工作流实例"),path:"instance",id:2},{name:""+o.default.$t("任务实例"),path:"task-instance-list",id:3}]}],security:[{name:""+o.default.$t("租户管理"),id:1,path:"tenement-manage",isOpen:!0,icon:"fa-users",children:[]},{name:""+o.default.$t("用户管理"),id:1,path:"users-manage",isOpen:!0,icon:"fa-user-circle",children:[]},{name:""+o.default.$t("告警组管理"),id:1,path:"warning-groups-manage",isOpen:!0,icon:"fa-warning",children:[]},{name:""+o.default.$t("队列管理"),id:1,path:"queue-manage",isOpen:!0,icon:"fa-recycle",children:[]},{name:""+o.default.$t("服务管理"),id:1,path:"",isOpen:!0,icon:"fa-server",children:[{name:"master",path:"servers-master",id:1},{name:"worker",path:"servers-worker",id:2}]}],resource:[{name:""+o.default.$t("文件管理"),id:1,path:"file",isOpen:!0,icon:"fa-files-o",children:[],disabled:!1},{name:""+o.default.$t("UDF管理"),id:1,path:"",isOpen:!0,icon:"fa-file-text",disabled:!1,children:[{name:""+o.default.$t("资源管理"),path:"resource-udf-resource",id:1},{name:""+o.default.$t("函数管理"),path:"resource-udf-function",id:2}]}],user:[{name:""+o.default.$t("用户信息"),id:1,path:"account",isOpen:!0,icon:"fa-user",children:[],disabled:!1},{name:""+o.default.$t("修改密码"),id:1,path:"password",isOpen:!0,icon:"fa-key",children:[],disabled:!1}]};t.default=function(e){return a[e]}},660:function(e,t,n){"use strict";var r={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"secondary-menu-model",class:e.className},[n("div",{staticClass:"toogle-box"},[e.isTogHide?e._e():n("a",{staticClass:"tog-close",attrs:{href:"javascript:"},on:{click:e._toggleMenu}}),e._v(" "),e.isTogHide?n("a",{staticClass:"tog-open",attrs:{href:"javascript:"},on:{click:e._toggleMenu}}):e._e()]),e._v(" "),e._l(e.menuList,function(t,r){return n("div",{staticClass:"leven-1"},[t.path?[n("router-link",{attrs:{to:{name:t.path}}},[n("div",{staticClass:"name",on:{click:function(n){return e._toggleSubMenu(t)}}},[n("a",{attrs:{href:"javascript:"}},[n("i",{staticClass:"fa icon",class:t.icon}),e._v(" "),n("span",[e._v(e._s(t.name))]),e._v(" "),t.children.length?n("i",{staticClass:"fa angle",class:t.isOpen?"fa-angle-down":"fa-angle-right"}):e._e()])])])]:e._e(),e._v(" "),t.path?e._e():[n("div",{staticClass:"name",on:{click:function(n){return e._toggleSubMenu(t)}}},[n("a",{attrs:{href:"javascript:"}},[n("i",{staticClass:"fa icon",class:t.icon}),e._v(" "),n("span",[e._v(e._s(t.name))]),e._v(" "),t.children.length?n("i",{staticClass:"fa angle",class:t.isOpen?"fa-angle-down":"fa-angle-right"}):e._e()])])],e._v(" "),t.isOpen&&t.children.length?n("ul",e._l(t.children,function(t,r){return n("router-link",{attrs:{to:{name:t.path},tag:"li","active-class":"active"}},[n("span",[e._v(e._s(t.name))])])}),1):e._e()],2)})],2)},staticRenderFns:[]};t.a=r},663:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(643),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);var a=n(666);var s=function(e){n(664)},l=n(27)(i.a,a.a,!1,s,null,null);t.default=l.exports},664:function(e,t,n){var r=n(665);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(35)("3cb222d8",r,!0,{})},665:function(e,t,n){(e.exports=n(34)(!1)).push([e.i,".no-data-model{position:relative;width:100%;height:calc(100vh - 200px)}.no-data-model .no-data-box{width:210px;height:210px;position:absolute;left:50%;top:50%;margin-left:-105px;margin-top:-105px;text-align:center}.no-data-model .no-data-box .text{padding-top:10px;color:#666}",""])},666:function(e,t,n){"use strict";var r={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"no-data-model"},[t("div",{staticClass:"no-data-box"},[this._m(0),this._v(" "),t("div",{staticClass:"text"},[this._v(this._s(this.msg||this.$t("查询无数据")))])])])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"img"},[t("img",{attrs:{src:n(667),alt:""}})])}]};t.a=r},667:function(e,t,n){e.exports=n.p+"images/errorTip.png?a7b20f0ca8727f22f405c2a34d1363a0"},682:function(e,t,n){"use strict";t.__esModule=!0;var r,i=n(644),o=(r=i)&&r.__esModule?r:{default:r};n(724),n(725),n(726),n(727),n(728),n(683),n(729),n(730),n(731),n(732),n(733),t.default=function(e,t){return o.default.fromTextArea(document.getElementById(e),Object.assign({lineNumbers:!0,theme:"mdn-like",readOnly:!0},{},t))}},683:function(e,t,n){(function(e){"use strict";function t(e){for(var t;null!=(t=e.next());)if("`"==t&&!e.eat("`"))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null}function n(e){return e.eat("@")&&(e.match(/^session\./),e.match(/^local\./),e.match(/^global\./)),e.eat("'")?(e.match(/^.*'/),"variable-2"):e.eat('"')?(e.match(/^.*"/),"variable-2"):e.eat("`")?(e.match(/^.*`/),"variable-2"):e.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function r(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"variable-2":null}e.defineMode("sql",function(t,n){var r=n.client||{},s=n.atoms||{false:!0,true:!0,null:!0},l=n.builtin||o(a),c=n.keywords||o(i),u=n.operatorChars||/^[*+\-%<>!=&|~^\/]/,d=n.support||{},f=n.hooks||{},h=n.dateSQL||{date:!0,time:!0,timestamp:!0},p=!1!==n.backslashStringEscapes,m=n.brackets||/^[\{}\(\)\[\]]/,g=n.punctuation||/^[;.,:]/;function v(e,t){var n,i=e.next();if(f[i]){var o=f[i](e,t);if(!1!==o)return o}if(d.hexNumber&&("0"==i&&e.match(/^[xX][0-9a-fA-F]+/)||("x"==i||"X"==i)&&e.match(/^'[0-9a-fA-F]+'/)))return"number";if(d.binaryNumber&&(("b"==i||"B"==i)&&e.match(/^'[01]+'/)||"0"==i&&e.match(/^b[01]+/)))return"number";if(i.charCodeAt(0)>47&&i.charCodeAt(0)<58)return e.match(/^[0-9]*(\.[0-9]+)?([eE][-+]?[0-9]+)?/),d.decimallessFloat&&e.match(/^\.(?!\.)/),"number";if("?"==i&&(e.eatSpace()||e.eol()||e.eat(";")))return"variable-3";if("'"==i||'"'==i&&d.doubleQuote)return t.tokenize=(n=i,function(e,t){for(var r,i=!1;null!=(r=e.next());){if(r==n&&!i){t.tokenize=v;break}i=p&&!i&&"\\"==r}return"string"}),t.tokenize(e,t);if((d.nCharCast&&("n"==i||"N"==i)||d.charsetCast&&"_"==i&&e.match(/[a-z][a-z0-9]*/i))&&("'"==e.peek()||'"'==e.peek()))return"keyword";if(d.commentSlashSlash&&"/"==i&&e.eat("/"))return e.skipToEnd(),"comment";if(d.commentHash&&"#"==i||"-"==i&&e.eat("-")&&(!d.commentSpaceRequired||e.eat(" ")))return e.skipToEnd(),"comment";if("/"==i&&e.eat("*"))return t.tokenize=function e(t){return function(n,r){var i=n.match(/^.*?(\/\*|\*\/)/);return i?"/*"==i[1]?r.tokenize=e(t+1):r.tokenize=t>1?e(t-1):v:n.skipToEnd(),"comment"}}(1),t.tokenize(e,t);if("."!=i){if(u.test(i))return e.eatWhile(u),"operator";if(m.test(i))return"bracket";if(g.test(i))return e.eatWhile(g),"punctuation";if("{"==i&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";e.eatWhile(/^[_\w\d]/);var a=e.current().toLowerCase();return h.hasOwnProperty(a)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/))?"number":s.hasOwnProperty(a)?"atom":l.hasOwnProperty(a)?"builtin":c.hasOwnProperty(a)?"keyword":r.hasOwnProperty(a)?"string-2":null}return d.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":e.match(/^\.+/)?null:d.ODBCdotTable&&e.match(/^[\w\d_]+/)?"variable-2":void 0}function y(e,t,n){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:n}}return{startState:function(){return{tokenize:v,context:null}},token:function(e,t){if(e.sol()&&t.context&&null==t.context.align&&(t.context.align=!1),t.tokenize==v&&e.eatSpace())return null;var n=t.tokenize(e,t);if("comment"==n)return n;t.context&&null==t.context.align&&(t.context.align=!0);var r=e.current();return"("==r?y(e,t,")"):"["==r?y(e,t,"]"):t.context&&t.context.type==r&&function(e){e.indent=e.context.indent,e.context=e.context.prev}(t),n},indent:function(n,r){var i=n.context;if(!i)return e.Pass;var o=r.charAt(0)==i.type;return i.align?i.col+(o?0:1):i.indent+(o?0:t.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:d.commentSlashSlash?"//":d.commentHash?"#":"--",closeBrackets:"()[]{}''\"\"``"}});var i="alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit ";function o(e){for(var t={},n=e.split(" "),r=0;r!=^\&|\/]/,brackets:/^[\{}\(\)]/,punctuation:/^[;.,:/]/,backslashStringEscapes:!1,dateSQL:o("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":n}}),e.defineMIME("text/x-mysql",{name:"sql",client:o("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:o(i+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:o("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:o("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:o("date time timestamp"),support:o("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-mariadb",{name:"sql",client:o("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:o(i+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:o("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:o("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:o("date time timestamp"),support:o("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-sqlite",{name:"sql",client:o("auth backup bail binary changes check clone databases dbinfo dump echo eqp exit explain fullschema headers help import imposter indexes iotrace limit lint load log mode nullvalue once open output print prompt quit read restore save scanstats schema separator session shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width"),keywords:o(i+"abort action add after all analyze attach autoincrement before begin cascade case cast check collate column commit conflict constraint cross current_date current_time current_timestamp database default deferrable deferred detach each else end escape except exclusive exists explain fail for foreign full glob if ignore immediate index indexed initially inner instead intersect isnull key left limit match natural no notnull null of offset outer plan pragma primary query raise recursive references regexp reindex release rename replace restrict right rollback row savepoint temp temporary then to transaction trigger unique using vacuum view virtual when with without"),builtin:o("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text clob bigint int int2 int8 integer float double char varchar date datetime year unsigned signed numeric real"),atoms:o("null current_date current_time current_timestamp"),operatorChars:/^[*+\-%<>!=&|/~]/,dateSQL:o("date time timestamp datetime"),support:o("decimallessFloat zerolessFloat"),identifierQuote:'"',hooks:{"@":n,":":n,"?":n,$:n,'"':function(e){for(var t;null!=(t=e.next());)if('"'==t&&!e.eat('"'))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null},"`":t}}),e.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:o("add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime"),builtin:o("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"),atoms:o("false true infinity NaN"),operatorChars:/^[<>=]/,dateSQL:{},support:o("commentSlashSlash decimallessFloat"),hooks:{}}),e.defineMIME("text/x-plsql",{name:"sql",client:o("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:o("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),builtin:o("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*\/+\-%<>!=~]/,dateSQL:o("date time timestamp"),support:o("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-hive",{name:"sql",keywords:o("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with admin authorization char compact compactions conf cube current current_date current_timestamp day decimal defined dependency directories elem_type exchange file following for grouping hour ignore inner interval jar less logical macro minute month more none noscan over owner partialscan preceding pretty principals protection reload rewrite role roles rollup rows second server sets skewed transactions truncate unbounded unset uri user values window year"),builtin:o("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype key_type utctimestamp value_type varchar"),atoms:o("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:o("date timestamp"),support:o("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-pgsql",{name:"sql",client:o("source"),keywords:o(i+"a abort abs absent absolute access according action ada add admin after aggregate alias all allocate also alter always analyse analyze and any are array array_agg array_max_cardinality as asc asensitive assert assertion assignment asymmetric at atomic attach attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli between bigint binary bit bit_length blob blocked bom boolean both breadth by c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain char char_length character character_length character_set_catalog character_set_name character_set_schema characteristics characters check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column column_name columns command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constant constraint constraint_catalog constraint_name constraint_schema constraints constructor contains content continue control conversion convert copy corr corresponding cost count covar_pop covar_samp create cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datatype date datetime_interval_code datetime_interval_precision day db deallocate debug dec decimal declare default defaults deferrable deferred defined definer degree delete delimiter delimiters dense_rank depends depth deref derived desc describe descriptor detach detail deterministic diagnostics dictionary disable discard disconnect dispatch distinct dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain double drop dump dynamic dynamic_function dynamic_function_code each element else elseif elsif empty enable encoding encrypted end end_frame end_partition endexec enforced enum equals errcode error escape event every except exception exclude excluding exclusive exec execute exists exit exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreach foreign fortran forward found frame_row free freeze from fs full function functions fusion g general generated get global go goto grant granted greatest group grouping groups handler having header hex hierarchy hint hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import in include including increment indent index indexes indicator info inherit inherits initially inline inner inout input insensitive insert instance instantiable instead int integer integrity intersect intersection interval into invoker is isnull isolation join k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like like_regex limit link listen ln load local localtime localtimestamp location locator lock locked log logged loop lower m map mapping match matched materialized max max_cardinality maxvalue member merge message message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized not nothing notice notify notnull nowait nth_value ntile null nullable nullif nulls number numeric object occurrences_regex octet_length octets of off offset oids old on only open operator option options or order ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parallel parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password path percent percent_rank percentile_cont percentile_disc perform period permission pg_context pg_datatype_name pg_exception_context pg_exception_detail pg_exception_hint placing plans pli policy portion position position_regex power precedes preceding precision prepare prepared preserve primary print_strict_params prior privileges procedural procedure procedures program public publication query quote raise range rank read reads real reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict result result_oid return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns reverse revoke right role rollback rollup routine routine_catalog routine_name routine_schema routines row row_count row_number rows rowtype rule savepoint scale schema schema_name schemas scope scope_catalog scope_name scope_schema scroll search second section security select selective self sensitive sequence sequences serializable server server_name session session_user set setof sets share show similar simple size skip slice smallint snapshot some source space specific specific_name specifictype sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable stacked standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset subscription substring substring_regex succeeds sum symmetric sysid system system_time system_user t table table_name tables tablesample tablespace temp template temporary text then ties time timestamp timezone_hour timezone_minute to token top_level_count trailing transaction transaction_active transactions_committed transactions_rolled_back transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted union unique unknown unlink unlisten unlogged unnamed unnest until untyped update upper uri usage use_column use_variable user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of values var_pop var_samp varbinary varchar variable_conflict variadic varying verbose version versioning view views volatile warning when whenever where while whitespace width_bucket window with within without work wrapper write xml xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes zone"),builtin:o("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:o("false true null unknown"),operatorChars:/^[*\/+\-%<>!=&|^\/#@?~]/,dateSQL:o("date time timestamp"),support:o("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")}),e.defineMIME("text/x-gql",{name:"sql",keywords:o("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"),atoms:o("false true"),builtin:o("blob datetime first key __key__ string integer double boolean null"),operatorChars:/^[*+\-%<>!=]/}),e.defineMIME("text/x-gpsql",{name:"sql",client:o("source"),keywords:o("abort absolute access action active add admin after aggregate all also alter always analyse analyze and any array as asc assertion assignment asymmetric at authorization backward before begin between bigint binary bit boolean both by cache called cascade cascaded case cast chain char character characteristics check checkpoint class close cluster coalesce codegen collate column comment commit committed concurrency concurrently configuration connection constraint constraints contains content continue conversion copy cost cpu_rate_limit create createdb createexttable createrole createuser cross csv cube current current_catalog current_date current_role current_schema current_time current_timestamp current_user cursor cycle data database day deallocate dec decimal declare decode default defaults deferrable deferred definer delete delimiter delimiters deny desc dictionary disable discard distinct distributed do document domain double drop dxl each else enable encoding encrypted end enum errors escape every except exchange exclude excluding exclusive execute exists explain extension external extract false family fetch fields filespace fill filter first float following for force foreign format forward freeze from full function global grant granted greatest group group_id grouping handler hash having header hold host hour identity if ignore ilike immediate immutable implicit in including inclusive increment index indexes inherit inherits initially inline inner inout input insensitive insert instead int integer intersect interval into invoker is isnull isolation join key language large last leading least left level like limit list listen load local localtime localtimestamp location lock log login mapping master match maxvalue median merge minute minvalue missing mode modifies modify month move name names national natural nchar new newline next no nocreatedb nocreateexttable nocreaterole nocreateuser noinherit nologin none noovercommit nosuperuser not nothing notify notnull nowait null nullif nulls numeric object of off offset oids old on only operator option options or order ordered others out outer over overcommit overlaps overlay owned owner parser partial partition partitions passing password percent percentile_cont percentile_disc placing plans position preceding precision prepare prepared preserve primary prior privileges procedural procedure protocol queue quote randomly range read readable reads real reassign recheck recursive ref references reindex reject relative release rename repeatable replace replica reset resource restart restrict returning returns revoke right role rollback rollup rootpartition row rows rule savepoint scatter schema scroll search second security segment select sequence serializable session session_user set setof sets share show similar simple smallint some split sql stable standalone start statement statistics stdin stdout storage strict strip subpartition subpartitions substring superuser symmetric sysid system table tablespace temp template temporary text then threshold ties time timestamp to trailing transaction treat trigger trim true truncate trusted type unbounded uncommitted unencrypted union unique unknown unlisten until update user using vacuum valid validation validator value values varchar variadic varying verbose version view volatile web when where whitespace window with within without work writable write xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlparse xmlpi xmlroot xmlserialize year yes zone"),builtin:o("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:o("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:o("date time timestamp"),support:o("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")}),e.defineMIME("text/x-sparksql",{name:"sql",keywords:o("add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases datata dbproperties defined delete delimited deny desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on optimize option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with"),builtin:o("tinyint smallint int bigint boolean float double string binary timestamp decimal array map struct uniontype delimited serde sequencefile textfile rcfile inputformat outputformat"),atoms:o("false true null"),operatorChars:/^[*\/+\-%<>!=~&|^]/,dateSQL:o("date time timestamp"),support:o("ODBCdotTable doubleQuote zerolessFloat")}),e.defineMIME("text/x-esper",{name:"sql",client:o("source"),keywords:o("alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit after all and as at asc avedev avg between by case cast coalesce count create current_timestamp day days delete define desc distinct else end escape events every exists false first from full group having hour hours in inner insert instanceof into irstream is istream join last lastweekday left limit like max match_recognize matches median measures metadatasql min minute minutes msec millisecond milliseconds not null offset on or order outer output partition pattern prev prior regexp retain-union retain-intersection right rstream sec second seconds select set some snapshot sql stddev sum then true unidirectional until update variable weekday when where window"),builtin:{},atoms:o("false true null"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:o("time"),support:o("decimallessFloat zerolessFloat binaryNumber hexNumber")})})(n(644))},724:function(e,t){},725:function(e,t,n){(function(e){"use strict";var t="CodeMirror-hint",n="CodeMirror-hint-active";function r(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 i in n)r[i]=n[i];return e.showHint(r)},e.defineExtension("showHint",function(t){t=function(e,t,n){var r=e.options.hintOptions,i={};for(var o in u)i[o]=u[o];if(r)for(var o in r)void 0!==r[o]&&(i[o]=r[o]);if(n)for(var o in n)void 0!==n[o]&&(i[o]=n[o]);i.hint.resolve&&(i.hint=i.hint.resolve(e,t));return i}(this,this.getCursor("start"),t);var n=this.listSelections();if(!(n.length>1)){if(this.somethingSelected()){if(!t.hint.supportsSelection)return;for(var i=0;id.clientHeight+1,T=l.getScrollInfo();if(L>0){var M=_.bottom-_.top;if(y.top-(y.bottom-_.top)-M>0)d.style.top=(x=y.top-M)+"px",w=!1;else if(M>C){d.style.height=C-5+"px",d.style.top=(x=y.bottom-_.top)+"px";var A=l.getCursor();i.from.ch!=A.ch&&(y=l.cursorCoords(A),d.style.left=(b=y.left)+"px",_=d.getBoundingClientRect())}}var N,O=_.right-k;if(O>0&&(_.right-_.left>k&&(d.style.width=k-5+"px",O-=_.right-_.left-k),d.style.left=(b=y.left-O)+"px"),S)for(var z=d.firstChild;z;z=z.nextSibling)z.style.paddingRight=l.display.nativeBarWidth+"px";(l.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};/Mac/.test(navigator.platform)&&(n["Ctrl-P"]=function(){t.moveFocus(-1)},n["Ctrl-N"]=function(){t.moveFocus(1)});var r=e.options.customKeys,i=r?{}:n;function o(e,r){var o;o="string"!=typeof r?function(e){return r(e,t)}:n.hasOwnProperty(r)?n[r]:r,i[e]=o}if(r)for(var a in r)r.hasOwnProperty(a)&&o(a,r[a]);var s=e.options.extraKeys;if(s)for(var a in s)s.hasOwnProperty(a)&&o(a,s[a]);return i}(r,{moveFocus:function(e,t){o.changeActive(o.selectedHint+e,t)},setFocus:function(e){o.changeActive(e)},menuSize:function(){return o.screenAmount()},length:h.length,close:function(){r.close()},pick:function(){o.pick()},data:i})),r.options.closeOnUnfocus)&&(l.on("blur",this.onBlur=function(){N=setTimeout(function(){r.close()},100)}),l.on("focus",this.onFocus=function(){clearTimeout(N)}));return l.on("scroll",this.onScroll=function(){var e=l.getScrollInfo(),t=l.getWrapperElement().getBoundingClientRect(),n=x+T.top-e.top,i=n-(u.pageYOffset||(c.documentElement||c.body).scrollTop);if(w||(i+=d.offsetHeight),i<=t.top||i>=t.bottom)return r.close();d.style.top=n+"px",d.style.left=b+T.left-e.left+"px"}),e.on(d,"dblclick",function(e){var t=s(d,e.target||e.srcElement);t&&null!=t.hintId&&(o.changeActive(t.hintId),o.pick())}),e.on(d,"click",function(e){var t=s(d,e.target||e.srcElement);t&&null!=t.hintId&&(o.changeActive(t.hintId),r.options.completeOnSingleClick&&o.pick())}),e.on(d,"mousedown",function(){setTimeout(function(){l.focus()},20)}),e.signal(i,"select",h[this.selectedHint],d.childNodes[this.selectedHint]),!0}function c(e,t,n,r){if(e.async)e(t,r,n);else{var i=e(t,n);i&&i.then?i.then(r):r(i)}}r.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(a(r),r.from||t.from,r.to||t.to,"complete"),e.signal(t,"pick",r),this.close()},cursorActivity:function(){this.debounce&&(o(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.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 i=this.hints.childNodes[this.selectedHint];i&&(i.className=i.className.replace(" "+n,"")),(i=this.hints.childNodes[this.selectedHint=t]).className+=" "+n,i.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=i.offsetTop+i.offsetHeight-this.hints.clientHeight+3),e.signal(this.data,"select",this.data.list[this.selectedHint],i)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},e.registerHelper("hint","auto",{resolve:function(t,n){var r,i=t.getHelpers(n,"hint");if(i.length){var o=function(e,t,n){var r=function(e,t){if(!e.somethingSelected())return t;for(var n=[],r=0;r0?t(e):i(o+1)})}(0)};return o.async=!0,o.supportsSelection=!0,o}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,i=t.getCursor(),o=t.getTokenAt(i),a=e.Pos(i.line,o.start),s=i;o.start,]/,closeOnUnfocus:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null};e.defineOption("hintOptions",null)})(n(644))},726:function(e,t,n){(function(e){"use strict";var t,n,r,i,o={QUERY_DIV:";",ALIAS_KEYWORD:"AS"},a=e.Pos,s=e.cmpPos;function l(e){return"[object Array]"==Object.prototype.toString.call(e)}function c(e){return"string"==typeof e?e:e.text}function u(e,t){return l(t)&&(t={columns:t}),t.text||(t.text=e),t}function d(e){return t[e.toUpperCase()]}function f(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function h(e,t){var n=e.length,r=c(t).substr(0,n);return e.toUpperCase()===r.toUpperCase()}function p(e,t,n,r){if(l(n))for(var i=0;i0)&&s(m,u[g])<=0){f={start:p,end:u[g]};break}p=u[g]}if(f.start){var y=n.getRange(f.start,f.end,!1);for(g=0;g=0;n--){var r=e[n];t[c(r).toUpperCase()]=u(c(r),r)}else if(e)for(var i in e)t[i.toUpperCase()]=u(i,e[i]);return t}(s&&s.tables);var h=s&&s.defaultTable,v=s&&s.disableKeywords;n=h&&d(h),r=function(t){var n=t.doc.modeOption;return"sql"===n&&(n="text/x-sql"),e.resolveMode(n).keywords}(o),i=function(t){var n=t.doc.modeOption;return"sql"===n&&(n="text/x-sql"),e.resolveMode(n).identifierQuote||"`"}(o),h&&!n&&(n=y(h,o)),(n=n||[]).columns&&(n=n.columns);var b,x,w,k=o.getCursor(),C=[],_=o.getTokenAt(k);if(_.end>k.ch&&(_.end=k.ch,_.string=_.string.slice(0,k.ch-_.start)),_.string.match(/^[.`"\w@]\w*$/)?(w=_.string,b=_.start,x=_.end):(b=x=k.ch,w=""),"."==w.charAt(0)||w.charAt(0)==i)b=function(e,r,o,s){for(var l=!1,c=[],u=r.start,h=!0;h;)h="."==r.string.charAt(0),l=l||r.string.charAt(0)==i,u=r.start,c.unshift(m(r.string)),"."==(r=s.getTokenAt(a(e.line,r.start))).string&&(h=!0,r=s.getTokenAt(a(e.line,r.start)));var v=c.join(".");p(o,v,t,function(e){return l?g(e):e}),p(o,v,n,function(e){return l?g(e):e}),v=c.pop();var b=c.join("."),x=!1,w=b;if(!d(b)){var k=b;(b=y(b,s))!==k&&(x=!0)}var C=d(b);return C&&C.columns&&(C=C.columns),C&&p(o,v,C,function(e){var t=b;return 1==x&&(t=w),"string"==typeof e?e=t+"."+e:(e=f(e)).text=t+"."+e.text,l?g(e):e}),u}(k,_,C,o);else{var L=function(e,t){return"object"==typeof e?e.className=t:e={text:e,className:t},e};p(C,w,n,function(e){return L(e,"CodeMirror-hint-table CodeMirror-hint-default-table")}),p(C,w,t,function(e){return L(e,"CodeMirror-hint-table")}),v||p(C,w,r,function(e){return L(e.toUpperCase(),"CodeMirror-hint-keyword")})}return{list:C,from:a(k.line,b),to:a(k.line,x)}})})(n(644),n(683))},727:function(e,t,n){(function(e){"use strict";var t=e.Pos;function n(e,t,n){return n?e.indexOf(t)>=0:0==e.lastIndexOf(t,0)}e.registerHelper("hint","xml",function(r,i){var o=i&&i.schemaInfo,a=i&&i.quoteChar||'"',s=i&&i.matchInMiddle;if(o){var l=r.getCursor(),c=r.getTokenAt(l);c.end>l.ch&&(c.end=l.ch,c.string=c.string.slice(0,l.ch-c.start));var u=e.innerMode(r.getMode(),c.state);if("xml"==u.mode.name){var d,f,h=[],p=!1,m=/\btag\b/.test(c.type)&&!/>$/.test(c.string),g=m&&/^\w/.test(c.string);if(g){var v=r.getLine(l.line).slice(Math.max(0,c.start-2),c.start),y=/<\/$/.test(v)?"close":/<$/.test(v)?"open":null;y&&(f=c.start-("close"==y?2:1))}else m&&"<"==c.string?y="open":m&&"")}else{var _=(x=o[u.state.tagName])&&x.attrs,L=o["!attrs"];if(!_&&!L)return;if(_){if(L){var S={};for(var T in L)L.hasOwnProperty(T)&&(S[T]=L[T]);for(var T in _)_.hasOwnProperty(T)&&(S[T]=_[T]);_=S}}else _=L;if("string"==c.type||"="==c.string){var M,A=(v=r.getRange(t(l.line,Math.max(0,l.ch-60)),t(l.line,"string"==c.type?c.start:c.end))).match(/([^\s\u00a0=<>\"\']+)=$/);if(!A||!_.hasOwnProperty(A[1])||!(M=_[A[1]]))return;if("function"==typeof M&&(M=M.call(this,r)),"string"==c.type){d=c.string;var N=0;/['"]/.test(c.string.charAt(0))&&(a=c.string.charAt(0),d=c.string.slice(1),N++);var O=c.string.length;/['"]/.test(c.string.charAt(O-1))&&(a=c.string.charAt(O-1),d=c.string.substr(N,O-2)),p=!0}for(k=0;k=]+|\/\/=?|\*\*=?|!=|[~!@])/],d=0;dr?k(t):i0&&C(e,t)&&(a+=" "+l),a}return w(e,t)}function w(e,t){if(e.eatSpace())return null;if(e.match(/^#.*/))return"comment";if(e.match(/^[0-9\.]/,!1)){var r=!1;if(e.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(r=!0),e.match(/^[\d_]+\.\d*/)&&(r=!0),e.match(/^\.\d+/)&&(r=!0),r)return e.eat(/J/i),"number";var i=!1;if(e.match(/^0x[0-9a-f_]+/i)&&(i=!0),e.match(/^0b[01_]+/i)&&(i=!0),e.match(/^0o[0-7_]+/i)&&(i=!0),e.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(e.eat(/J/i),i=!0),e.match(/^0(?![\dx])/i)&&(i=!0),i)return e.eat(/L/i),"number"}if(e.match(v))return-1!==e.current().toLowerCase().indexOf("f")?(t.tokenize=function(e,t){for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";function i(e){return function(t,n){var r=w(t,n);return"punctuation"==r&&("{"==t.current()?n.tokenize=i(e+1):"}"==t.current()&&(n.tokenize=e>1?i(e-1):o)),r}}function o(o,a){for(;!o.eol();)if(o.eatWhile(/[^'"\{\}\\]/),o.eat("\\")){if(o.next(),n&&o.eol())return r}else{if(o.match(e))return a.tokenize=t,r;if(o.match("{{"))return r;if(o.match("{",!1))return a.tokenize=i(0),o.current()?r:a.tokenize(o,a);if(o.match("}}"))return r;if(o.match("}"))return l;o.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return l;a.tokenize=t}return r}return o.isString=!0,o}(e.current(),t.tokenize),t.tokenize(e,t)):(t.tokenize=function(e,t){for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";function i(i,o){for(;!i.eol();)if(i.eatWhile(/[^'"\\]/),i.eat("\\")){if(i.next(),n&&i.eol())return r}else{if(i.match(e))return o.tokenize=t,r;i.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return l;o.tokenize=t}return r}return i.isString=!0,i}(e.current(),t.tokenize),t.tokenize(e,t));for(var o=0;o1&&o(t).offset>n;){if("py"!=o(t).type)return!0;t.scopes.pop()}return o(t).offset!=n}function _(e,t){e.sol()&&(t.beginningOfLine=!0);var n=t.tokenize(e,t),r=e.current();if(t.beginningOfLine&&"@"==r)return e.match(g,!1)?"meta":m?"operator":l;if(/\S/.test(r)&&(t.beginningOfLine=!1),"variable"!=n&&"builtin"!=n||"meta"!=t.lastToken||(n="meta"),"pass"!=r&&"return"!=r||(t.dedent+=1),"lambda"==r&&(t.lambda=!0),":"!=r||t.lambda||"py"!=o(t).type||k(t),1==r.length&&!/string|comment/.test(n)){var i="[({".indexOf(r);if(-1!=i&&function(e,t,n){var r=e.match(/^([\s\[\{\(]|#.*)*$/,!1)?null:e.column()+1;t.scopes.push({offset:t.indent+f,type:n,align:r})}(e,t,"])}".slice(i,i+1)),-1!=(i="])}".indexOf(r))){if(o(t).type!=r)return l;t.indent=t.scopes.pop().offset-f}}return t.dedent>0&&e.eol()&&"py"==o(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),n}return{startState:function(e){return{tokenize:x,scopes:[{offset:e||0,type:"py",align:null}],indent:e||0,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=_(e,t);return r&&"comment"!=r&&(t.lastToken="keyword"==r||"punctuation"==r?e.current():r),"punctuation"==r&&(r=null),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+l:r},indent:function(t,n){if(t.tokenize!=x)return t.tokenize.isString?e.Pass:0;var r=o(t),i=r.type==n.charAt(0);return null!=r.align?r.align-(i?1:0):r.offset-(i?f:0)},electricInput:/^\s*[\}\]\)]$/,closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"}}),e.defineMIME("text/x-python","python");var a;e.defineMIME("text/x-cython",{name:"python",extra_keywords:(a="by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE",a.split(" "))})})(n(644))},729:function(e,t,n){(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,i){var o,a,s=r.indentUnit,l={},c=i.htmlMode?t:n;for(var u in c)l[u]=c[u];for(var u in i)l[u]=i[u];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(h("atom","]]>")):null:e.match("--")?n(h("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(function e(t){return function(n,r){for(var i;null!=(i=n.next());){if("<"==i)return r.tokenize=e(t+1),r.tokenize(n,r);if(">"==i){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=h("meta","?>"),"meta"):(o=e.eat("/")?"closeTag":"openTag",t.tokenize=f,"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 f(e,t){var n,r,i=e.next();if(">"==i||"/"==i&&e.eat(">"))return t.tokenize=d,o=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return o="equals",null;if("<"==i){t.tokenize=d,t.state=g,t.tagName=t.tagStart=null;var a=t.tokenize(e,t);return a?a+" tag error":"tag error"}return/[\'\"]/.test(i)?(t.tokenize=(n=i,(r=function(e,t){for(;!e.eol();)if(e.next()==n){t.tokenize=f;break}return"string"}).isInAttribute=!0,r),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=d;break}n.next()}return e}}function p(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;p(e)}}function g(e,t,n){return"openTag"==e?(n.tagStart=t.column(),v):"closeTag"==e?y:g}function v(e,t,n){return"word"==e?(n.tagName=t.current(),a="tag",w):l.allowMissingTagName&&"endTag"==e?(a="tag bracket",w(e,t,n)):(a="error",v)}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)&&p(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",b):(a="tag error",x)}return l.allowMissingTagName&&"endTag"==e?(a="tag bracket",b(e,t,n)):(a="error",x)}function b(e,t,n){return"endTag"!=e?(a="error",b):(p(n),g)}function x(e,t,n){return a="error",b(e,0,n)}function w(e,t,n){if("word"==e)return a="attribute",k;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||l.autoSelfClosers.hasOwnProperty(r)?m(n,r):(m(n,r),n.context=new function(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)}(n,r,i==n.indented)),g}return a="error",w}function k(e,t,n){return"equals"==e?C:(l.allowMissing||(a="error"),w(e,0,n))}function C(e,t,n){return"string"==e?_:"word"==e&&l.allowUnquoted?(a="string",w):(a="error",w(e,0,n))}function _(e,t,n){return"string"==e?_:w(e,0,n)}return d.isInText=!0,{startState:function(e){var t={tokenize:d,state:g,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;o=null;var n=t.tokenize(e,t);return(n||o)&&"comment"!=n&&(a=null,t.state=t.state(o||n,e,t),a&&(n="error"==a?n+" error":a)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=f&&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&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(e){e.state==C&&(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(644))},730:function(e,t,n){(function(e){"use strict";var t={addition:"positive",attributes:"attribute",bold:"strong",cite:"keyword",code:"atom",definitionList:"number",deletion:"negative",div:"punctuation",em:"em",footnote:"variable",footCite:"qualifier",header:"header",html:"comment",image:"string",italic:"em",link:"link",linkDefinition:"link",list1:"variable-2",list2:"variable-3",list3:"keyword",notextile:"string-2",pre:"operator",p:"property",quote:"bracket",span:"quote",specialChar:"tag",strong:"strong",sub:"builtin",sup:"builtin",table:"variable-3",tableHeading:"operator"};function n(e,n,o){if("_"===o)return e.eat("_")?r(e,n,"italic",/__/,2):r(e,n,"em",/_/,1);if("*"===o)return e.eat("*")?r(e,n,"bold",/\*\*/,2):r(e,n,"strong",/\*/,1);if("["===o)return e.match(/\d+\]/)&&(n.footCite=!0),i(n);if("("===o&&e.match(/^(r|tm|c)\)/))return a(n,t.specialChar);if("<"===o&&e.match(/(\w+)[^>]+>[^<]+<\/\1>/))return a(n,t.html);if("?"===o&&e.eat("?"))return r(e,n,"cite",/\?\?/,2);if("="===o&&e.eat("="))return r(e,n,"notextile",/==/,2);if("-"===o&&!e.eat("-"))return r(e,n,"deletion",/-/,1);if("+"===o)return r(e,n,"addition",/\+/,1);if("~"===o)return r(e,n,"sub",/~/,1);if("^"===o)return r(e,n,"sup",/\^/,1);if("%"===o)return r(e,n,"span",/%/,1);if("@"===o)return r(e,n,"code",/@/,1);if("!"===o){var s=r(e,n,"image",/(?:\([^\)]+\))?!/,1);return e.match(/^:\S+/),s}return i(n)}function r(e,t,n,r,o){var a=e.pos>o?e.string.charAt(e.pos-o-1):null,s=e.peek();if(t[n]){if((!s||/\W/.test(s))&&a&&/\S/.test(a)){var l=i(t);return t[n]=!1,l}}else(!a||/\W/.test(a))&&s&&/\S/.test(s)&&e.match(new RegExp("^.*\\S"+r.source+"(?:\\W|$)"),!1)&&(t[n]=!0,t.mode=u.attributes);return i(t)}function i(e){var n=o(e);if(n)return n;var r=[];return e.layoutType&&r.push(t[e.layoutType]),r=r.concat(function(e){for(var n=[],r=1;r]+)?>(?:[^<]+<\/\1>)?/,link:/[^"]+":\S/,linkDefinition:/\[[^\s\]]+\]\S+/,list:/(?:#+|\*+)/,notextile:"notextile",para:"p",pre:"pre",table:"table",tableCellAttributes:/[\/\\]\d+/,tableHeading:/\|_\./,tableText:/[^"_\*\[\(\?\+~\^%@|-]+/,text:/[^!"_=\*\[\(<\?\+~\^%@-]+/},attributes:{align:/(?:<>|<|>|=)/,selector:/\([^\(][^\)]+\)/,lang:/\[[^\[\]]+\]/,pad:/(?:\(+|\)+){1,2}/,css:/\{[^\}]+\}/},createRe:function(e){switch(e){case"drawTable":return l.makeRe("^",l.single.drawTable,"$");case"html":return l.makeRe("^",l.single.html,"(?:",l.single.html,")*","$");case"linkDefinition":return l.makeRe("^",l.single.linkDefinition,"$");case"listLayout":return l.makeRe("^",l.single.list,c("allAttributes"),"*\\s+");case"tableCellAttributes":return l.makeRe("^",l.choiceRe(l.single.tableCellAttributes,c("allAttributes")),"+\\.");case"type":return l.makeRe("^",c("allTypes"));case"typeLayout":return l.makeRe("^",c("allTypes"),c("allAttributes"),"*\\.\\.?","(\\s+|$)");case"attributes":return l.makeRe("^",c("allAttributes"),"+");case"allTypes":return l.choiceRe(l.single.div,l.single.foot,l.single.header,l.single.bc,l.single.bq,l.single.notextile,l.single.pre,l.single.table,l.single.para);case"allAttributes":return l.choiceRe(l.attributes.selector,l.attributes.css,l.attributes.lang,l.attributes.align,l.attributes.pad);default:return l.makeRe("^",l.single[e])}},makeRe:function(){for(var e="",t=0;t1&&e.eat("$");var n=e.next();return/['"({]/.test(n)?(t.tokens[0]=a(n,"("==n?"quote":"{"==n?"def":"string"),c(e,t)):(/\d/.test(n)||e.eatWhile(/\w/),t.tokens.shift(),"def")};function c(e,n){return(n.tokens[0]||function(e,n){if(e.eatSpace())return null;var r=e.sol(),i=e.next();if("\\"===i)return e.next(),null;if("'"===i||'"'===i||"`"===i)return n.tokens.unshift(a(i,"`"===i?"quote":"string")),c(e,n);if("#"===i)return r&&e.eat("!")?(e.skipToEnd(),"meta"):(e.skipToEnd(),"comment");if("$"===i)return n.tokens.unshift(l),c(e,n);if("+"===i||"="===i)return"operator";if("-"===i)return e.eat("-"),e.eatWhile(/\w/),"attribute";if(/\d/.test(i)&&(e.eatWhile(/\d/),e.eol()||!/\w/.test(e.peek())))return"number";e.eatWhile(/[\w-]/);var o=e.current();return"="===e.peek()&&/\w+/.test(o)?"def":t.hasOwnProperty(o)?t[o]:null})(e,n)}return{startState:function(){return{tokens:[]}},token:function(e,t){return c(e,t)},closeBrackets:"()[]{}''\"\"``",lineComment:"#",fold:"brace"}}),e.defineMIME("text/x-sh","shell"),e.defineMIME("application/x-sh","shell")})(n(644))},732:function(e,t){},733:function(e,t){},735:function(e,t,n){"use strict";t.__esModule=!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.bytesToSize=function(e){if(0===e)return"0 B";var t=Math.floor(Math.log(e)/Math.log(1024));return parseInt((e/Math.pow(1024,t)).toPrecision(3))+" "+["B","KB","MB","GB","TB","PB","EB","ZB","YB"][t]},t.isJson=function(e){if("string"==typeof e)try{var t=JSON.parse(e);return!("object"!==(void 0===t?"undefined":r(t))||!t)}catch(e){return!1}},t.syntaxHighlight=function(e){return"string"!=typeof e&&(e=JSON.stringify(e,void 0,2)),(e=e.replace(/&/g,"&").replace(//g,">")).replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,function(e){var t="number";return/^"/.test(e)?t=/:$/.test(e)?"key":"string":/true|false/.test(e)?t="boolean":/null/.test(e)&&(t="null"),''+e+""})}},807:function(e,t,n){"use strict";t.__esModule=!0;t.filtTypeArr=["txt","log","sh","conf","cfg","py","java","sql","xml","hql"]},983:function(e,t,n){"use strict";t.__esModule=!0;t.handlerSuffix={".txt":"textile",".log":"textile",".sh":"shell",".conf":"textile",".cfg":"textile",".py":"python",".java":"textile",".sql":"sql",".hql":"sql",".xml":"xml"}},984:function(e,t,n){"use strict";t.__esModule=!0,t.default={name:"no-type"}}}); +//# sourceMappingURL=8.e9f2610.js.map \ No newline at end of file diff --git a/escheduler-ui/dist/js/8.d0d692f.js.map b/escheduler-ui/dist/js/8.e9f2610.js.map similarity index 99% rename from escheduler-ui/dist/js/8.d0d692f.js.map rename to escheduler-ui/dist/js/8.e9f2610.js.map index 05aeaa3610..3a12bba327 100644 --- a/escheduler-ui/dist/js/8.d0d692f.js.map +++ b/escheduler-ui/dist/js/8.e9f2610.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue?5ee1","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue?e770","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue?aa4f","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/_source/down_error.png","webpack:///src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue?b44a","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue?b68d","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue?33ff","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue","webpack:///src/js/module/components/spin/spin.vue","webpack:///src/js/module/components/listConstruction/listConstruction.vue","webpack:///src/js/module/components/secondaryMenu/secondaryMenu.vue","webpack:///src/js/module/components/noData/noData.vue","webpack:///./node_modules/codemirror/lib/codemirror.js","webpack:///./src/js/module/components/spin/spin.vue","webpack:///./src/js/module/components/spin/spin.vue?542d","webpack:///./src/js/module/components/spin/spin.vue?9371","webpack:///./src/js/module/components/spin/spin.vue?87eb","webpack:///./src/js/module/components/listConstruction/listConstruction.vue","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?b527","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?50be","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?6117","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?c652","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?7693","webpack:///./src/js/module/components/secondaryMenu/close.png","webpack:///./src/js/module/components/secondaryMenu/open.png","webpack:///./src/js/module/components/secondaryMenu/menu.js","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?048e","webpack:///./src/js/module/components/noData/noData.vue","webpack:///./src/js/module/components/noData/noData.vue?93a9","webpack:///./src/js/module/components/noData/noData.vue?86e8","webpack:///./src/js/module/components/noData/noData.vue?5a51","webpack:///./src/js/module/components/noData/images/errorTip.png","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/_source/codemirror.js","webpack:///./node_modules/codemirror/mode/sql/sql.js","webpack:///./node_modules/codemirror/addon/hint/show-hint.js","webpack:///./node_modules/codemirror/addon/hint/sql-hint.js","webpack:///./node_modules/codemirror/addon/hint/xml-hint.js","webpack:///./node_modules/codemirror/mode/python/python.js","webpack:///./node_modules/codemirror/mode/xml/xml.js","webpack:///./node_modules/codemirror/mode/textile/textile.js","webpack:///./node_modules/codemirror/mode/shell/shell.js","webpack:///./src/js/module/util/util.js","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/_source/common.js","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/_source/utils.js","webpack:///src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue"],"names":["Object","defineProperty","__webpack_exports__","value","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noType_vue__","__webpack_require__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noType_vue___default","n","__WEBPACK_IMPORT_KEY__","key","d","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_511724d0_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_noType_vue__","__vue_styles__","ssrContext","Component","normalizeComponent","a","content","module","i","locals","exports","push","esExports","render","_h","this","$createElement","_c","_self","staticClass","attrs","src","alt","_v","_s","$t","staticRenderFns","p","_vuex","_common","_util","_utils","editor","name","data","isNoType","isLoading","filtTypeArr","loadingIndex","mode","isData","size","spinnerLoading","msg","props","methods","assign","mapActions","ok","_this","updateContent","id","$route","params","getValue","then","res","$message","success","setTimeout","close","catch","e","error","$router","_getViewResources","_this2","getViewResources","skipLineNum","limit","alias","split","_handlerEditor","setValue","$","scrollTop","scrollLeft","_codemirror2","default","readOnly","keypress","getOption","showHint","completeSingle","on","watch","created","file","_lodash2","_localStorage2","getItem","fileName","fileSize","lastIndexOf","substring","length","handlerSuffix","bytesToSize","parseInt","includes","trimStart","mounted","destroyed","toTextArea","off","computed","components","mListConstruction","_listConstruction2","mNoType","_noType2","mSpin","_spin2","mSecondaryMenu","_secondaryMenu2","mNoData","_noData2","_vm","type","title","staticStyle","margin","slot","_e","shape","disabled","click","$event","loading","is-spin","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_index_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_index_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_6ba7df63_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_index_vue__","isSpin","Boolean","isLeft","String","menuList","_menu2","index","isTogHide","className","is","layoutBox","addClass","removeClass","_toggleSubMenu","item","isOpen","_toggleMenu","factory","userAgent","navigator","platform","gecko","test","ie_upto10","ie_11up","exec","edge","ie","ie_version","document","documentMode","webkit","qtwebkit","chrome","presto","safari","vendor","mac_geMountainLion","phantom","ios","android","mobile","mac","chromeOS","windows","presto_version","match","Number","flipCtrlCmd","captureRightClick","classTest","cls","RegExp","range","rmClass","node","current","after","slice","removeChildren","count","childNodes","removeChild","firstChild","removeChildrenAndAdd","parent","appendChild","elt","tag","style","createElement","cssText","createTextNode","eltP","setAttribute","contains","child","nodeType","parentNode","host","activeElt","activeElement","body","shadowRoot","joinClasses","b","as","createRange","start","end","endNode","r","setEnd","setStart","createTextRange","moveToElementText","collapse","moveEnd","moveStart","selectInput","select","bind","f","args","Array","prototype","call","arguments","apply","copyObj","obj","target","overwrite","prop","hasOwnProperty","countColumn","string","tabSize","startIndex","startValue","search","nextTab","indexOf","selectionStart","selectionEnd","Delayed","array","set","ms","clearTimeout","scrollerGap","Pass","toString","sel_dontScroll","scroll","sel_mouse","origin","sel_move","findColumn","goal","pos","col","skipped","Math","min","spaceStrs","spaceStr","lst","arr","map","out","nothing","createObj","base","inst","create","nonASCIISingleCaseWordChar","isWordCharBasic","ch","toUpperCase","toLowerCase","isWordChar","helper","source","isEmpty","extendingChars","isExtendingChar","charCodeAt","skipExtendingChars","str","dir","charAt","findFirst","pred","from","to","midF","mid","ceil","floor","getLine","doc","first","Error","chunk","lines","children","sz","chunkSize","getBetween","line","iter","text","getLines","updateLineHeight","height","diff","lineNo","cur","no","lineAtHeight","h","outer","i$1","lh","isLine","l","lineNumberFor","options","lineNumberFormatter","firstLineNumber","Pos","sticky","cmp","equalCursorPos","copyPos","x","maxPos","minPos","clipLine","max","clipPos","last","linelen","clipToLen","clipPosArray","sawReadOnlySpans","sawCollapsedSpans","MarkedSpan","marker","getMarkedSpanFor","spans","span","removeMarkedSpan","stretchSpansOverChange","change","full","oldFirst","markedSpans","oldLast","startCh","endCh","isInsert","old","nw","inclusiveLeft","insertLeft","endsAfter","inclusiveRight","markedSpansBefore","startsBefore","markedSpansAfter","sameLine","offset","found","span$1","clearEmptySpans","newMarkers","gapMarkers","gap","i$2","i$3","clearWhenEmpty","splice","detachMarkedSpans","detachLine","attachMarkedSpans","attachLine","extraLeft","extraRight","compareCollapsedMarkers","lenDiff","aPos","find","bPos","fromCmp","toCmp","collapsedSpanAtSide","sps","sp","collapsed","collapsedSpanAtStart","collapsedSpanAtEnd","collapsedSpanAround","conflictingCollapsedRange","lineNo$$1","visualLine","merged","visualLineNo","lineN","vis","visualLineEndNo","lastLine","lineIsHidden","widgetNode","lineIsHiddenInner","heightAtLine","lineObj","lineLength","len","found$1","findMaxLine","cm","display","maxLine","maxLineLength","maxLineChanged","bidiOther","getBidiPartAt","order","bidiOrdering","lowTypes","arabicTypes","bidiRE","isNeutral","isStrong","countsAsLeft","countsAsNum","BidiSpan","level","direction","outerType","code","types","prev","type$1","prev$1","type$2","i$4","type$3","replace","j","i$5","cur$1","type$4","i$6","end$1","before","replace$1","j$1","m","i$7","at","j$2","nstart","unshift","reverse","getOrder","noHandlers","emitter","addEventListener","attachEvent","map$$1","_handlers","concat","getHandlers","removeEventListener","detachEvent","signal","handlers","signalDOMEvent","override","preventDefault","defaultPrevented","e_defaultPrevented","codemirrorIgnore","signalCursorActivity","cursorActivity","curOp","cursorActivityHandlers","hasHandler","eventMixin","ctor","e_preventDefault","returnValue","e_stopPropagation","stopPropagation","cancelBubble","e_stop","e_target","srcElement","e_button","which","button","ctrlKey","zwspSupported","badBidiRects","dragAndDrop","div","zeroWidthElement","measure","offsetHeight","offsetWidth","hasBadBidiRects","txt","r0","getBoundingClientRect","r1","left","right","splitLinesAuto","result","nl","rt","hasSelection","window","getSelection","te","range$$1","ownerDocument","selection","parentElement","compareEndPoints","hasCopyEvent","oncopy","badZoomedRects","modes","mimeModes","resolveMode","spec","getMode","mfactory","modeObj","modeExtensions","exts","helperType","modeProps","prop$1","extendMode","properties","copyState","state","nstate","val","innerMode","info","startState","a1","a2","StringStream","lineOracle","lastColumnPos","lastColumnValue","lineStart","eol","sol","peek","undefined","next","eat","eatWhile","eatSpace","skipToEnd","skipTo","backUp","column","indentation","pattern","consume","caseInsensitive","cased","substr","hideFirstChars","inner","lookAhead","oracle","baseToken","SavedContext","Context","maxLookAhead","baseTokens","baseTokenPos","highlightLine","context","forceToEnd","st","modeGen","lineClasses","runMode","loop","o","overlay","overlays","i_end","opaque","styles","classes","bgClass","textClass","getLineStyles","updateFrontier","getContextBefore","resetState","maxHighlightLength","stateAfter","save","styleClasses","highlightFrontier","modeFrontier","precise","minindent","minline","lim","indented","findStartLine","saved","fromSaved","processLine","viewFrom","viewTo","nextLine","startAt","stream","callBlankLine","readToken","blankLine","token","copy","Token","takeToken","asArray","tokens","extractLineClasses","output","lineClass","flattenSpans","curStart","curStyle","addModeClass","mName","Line","estimateHeight","cleanUpLine","styleToClassCache","styleToClassCacheWithMode","interpretTokenStyle","cache","buildLineContent","lineView","builder","pre","trailingSpace","splitSpaces","rest","addToken","buildToken","buildTokenBadBidi","insertLineContent","externalMeasured","maps","caches","lastChild","querySelector","defaultSpecialCharPlaceholder","startStyle","endStyle","css","attributes","displayText","trailingBefore","spaceBefore","special","specialChars","mustWrap","createDocumentFragment","lastIndex","txt$1","tabWidth","specialCharPlaceholder","fullStyle","attr","part","buildCollapsedSpan","ignoreWidget","widget","input","needsContentAttribute","setUneditable","allText","spanStyle","spanEndStyle","spanStartStyle","nextChange","Infinity","foundBookmarks","endStyles","upto","tokenText","LineView","visualLineContinued","hidden","buildViewArray","nextPos","view","operationGroup","orphanDelayedCallbacks","signalLater","list","delayedCallbacks","fireOrphanDelayed","delayed","updateLineForChanges","dims","changes","updateLineText","updateLineGutter","updateLineClasses","updateLineWidgets","ensureLineWrapped","replaceChild","zIndex","getLineContent","ext","built","background","wrap","insertBefore","updateLineBackground","wrapClass","gutter","gutterBackground","gutterClass","fixedGutter","fixedPos","gutterTotalWidth","markers","gutterMarkers","lineNumbers","wrap$1","gutterWrap","lineNumber","gutterLeft","k","gutters","gutterWidth","alignable","nextSibling","insertLineWidgets","buildLineElement","insertLineWidgetsFor","allowAbove","widgets","ws","handleMouseEvents","positionLineWidget","above","noHScroll","width","wrapperWidth","coverGutter","paddingLeft","position","marginLeft","widgetHeight","parentStyle","wrapper","clientWidth","eventInWidget","getAttribute","sizer","mover","paddingTop","lineSpace","offsetTop","paddingVert","paddingH","cachedPaddingH","getComputedStyle","currentStyle","paddingRight","isNaN","scrollGap","nativeBarWidth","displayWidth","scroller","barWidth","displayHeight","clientHeight","barHeight","mapFromLineView","measureChar","bias","measureCharPrepared","prepareMeasureForLine","findViewForLine","findViewIndex","getDimensions","forceUpdate","lineMeasure","updateExternalMeasurement","rect","hasHeights","prepared","varHeight","wrapping","lineWrapping","curWidth","heights","rects","getClientRects","abs","bottom","top","ensureLineHeights","place","nodeAndOffsetInLineMap","coverStart","coverEnd","getUsefulRect","screen","logicalXDPI","deviceXDPI","normal","fromRange","hasBadZoomedRects","scaleX","scaleY","logicalYDPI","deviceYDPI","maybeUpdateRectForZooming","rSpan","charWidth","nullRect","rtop","rbot","bot","bogus","singleCursorHeightPerLine","rbottom","measureCharInner","measureText","mStart","mEnd","clearLineMeasurementCacheFor","clearLineMeasurementCache","externalMeasure","clearCaches","cachedCharWidth","cachedTextHeight","lineNumChars","pageScrollX","pageXOffset","documentElement","pageScrollY","marginTop","pageYOffset","widgetTopHeight","intoCoordSystem","includeWidgets","yOff","viewOffset","lOff","xOff","fromCoordSystem","coords","localBox","lineSpaceBox","charCoords","cursorCoords","preparedMeasure","get","getBidi","partPos","invert","other","estimateCoords","PosWithInfo","outside","xRel","coordsChar","y","coordsCharInner","rangeEnd","wrappedLineExtent","begin","wrappedLineExtentChar","boxIsAfter","box","widgetHeight$$1","ltr","_lineNo","ref","closestDist","endX","dist","baseX","chAround","boxAround","atLeft","atStart","textHeight","anchor","clientLeft","offsetLeft","compensateForHScroll","th","perLine","widgetsHeight","estimateLineHeights","est","estHeight","posFromMouse","liberal","forRect","space","clientX","clientY","colDiff","round","updateSelection","showSelection","prepareSelection","primary","curFragment","cursors","selFragment","sel","ranges","primIndex","empty","showCursorWhenSelecting","drawSelectionCursor","head","drawSelectionRange","cursor","cursorHeight","otherCursor","cmpCoords","fragment","padding","leftSide","rightSide","sizerWidth","docLTR","add","drawForLine","fromArg","toArg","lineLen","wrapX","side","extent","iterateBidiSections","fromPos","toPos","openStart","openEnd","openRight","topLeft","topRight","botLeft","botRight","sFrom","sTo","fromLine","toLine","singleVLine","leftEnd","rightStart","restartBlink","focused","clearInterval","blinker","cursorDiv","visibility","cursorBlinkRate","setInterval","ensureFocus","focus","onFocus","delayBlurEvent","delayingBlurEvent","onBlur","selForContextMenu","reset","receivedFocus","shift","updateHeightsInViewport","prevBottom","lineDiv","updateWidgetHeight","chWidth","w","visibleLines","viewport","ensure","ensureFrom","ensureTo","alignHorizontally","alignWidgets","comp","gutterW","align","maybeUpdateLineNumberWidth","innerW","lineGutter","lineNumInnerWidth","lineNumWidth","updateGutterSpace","calculateScrollPos","snapMargin","screentop","docBottom","atTop","atBottom","newTop","screenleft","screenw","tooWide","addToScrollTop","resolveScrollToPos","ensureCursorVisible","getCursor","scrollToPos","cursorScrollMargin","scrollToCoords","scrollToCoordsRange","sPos","updateScrollTop","updateDisplaySimple","setScrollTop","startWorker","forceScroll","scrollHeight","scrollbars","setScrollLeft","isScroller","scrollWidth","measureForScrollbars","docH","viewHeight","viewWidth","barLeft","docHeight","NativeScrollbars","vert","horiz","tabIndex","checkedZeroWidth","minHeight","minWidth","update","needsH","needsV","sWidth","totalHeight","totalWidth","zeroWidthHack","disableHoriz","enableZeroWidthBar","disableVert","pointerEvents","bar","delay","maybeDisable","elementFromPoint","clear","NullScrollbars","updateScrollbars","startWidth","startHeight","updateScrollbarsInner","sizes","paddingBottom","heightForcer","borderBottom","scrollbarFiller","coverGutterNextToScrollbar","gutterFiller","scrollbarModel","native","null","initScrollbars","scrollbarStyle","axis","nextOpId","startOperation","op","viewChanged","updateInput","typing","changeObjs","cursorActivityCalled","selectionChanged","updateMaxLine","ops","ownsGroup","endOperation","endCb","group","callbacks","fireCallbacksForOps","finishOperation","endOperation_R1","updatedDisplay","mustUpdate","updateDisplayIfNeeded","endOperation_R2","endOperation_W2","endOperation_finish","endOperations","scrollbarsClipped","marginBottom","borderRightWidth","maybeClipScrollbars","DisplayUpdate","barMeasure","adjustWidthTo","maxScrollLeft","preparedSelection","takeFocus","setDocumentHeight","postUpdateDisplay","wheelStartX","wheelStartY","doScroll","innerHeight","scrollNode","scrollIntoView","maybeScrollWindow","changed","endCoords","scrollPos","startTop","startLeft","scrollPosIntoView","maybeHiddenMarkers","unhidden","maybeUnhiddenMarkers","finish","runInOp","operation","methodOp","docMethodOp","regChange","lendiff","updateLineNumbers","resetView","cut","viewCuttingPoint","cut$1","cutTop","cutBot","regLineChange","oldN","newN","countDirtyView","dirty","time","highlight","highlightWorker","Date","workTime","changedLines","oldStyles","highlighted","oldCls","newCls","ischange","workDelay","force","visible","editorIsHidden","wrapperHeight","oldDisplayWidth","events","renderedView","viewportMargin","different","lastWrapHeight","lastWrapWidth","adjustView","toUpdate","selSnapshot","hasFocus","active","anchorNode","extend","anchorOffset","focusNode","focusOffset","selectionSnapshot","updateNumbersFrom","container","rm","currentWheelTarget","updateNumber","patchDisplay","snapshot","removeAllRanges","addRange","restoreSelection","selectionDiv","reportedViewFrom","reportedViewTo","updateGutters","specs","gElt","setGuttersForLineNumbers","wheelSamples","wheelPixelsPerUnit","wheelEventDelta","dx","wheelDeltaX","dy","wheelDeltaY","detail","HORIZONTAL_AXIS","VERTICAL_AXIS","wheelDelta","wheelEventPixels","delta","onScrollWheel","canScrollX","canScrollY","pixels","wheelDX","wheelDY","movedX","movedY","sample","Selection","equals","here","there","deepCopy","Range","somethingSelected","normalizeSelection","mayTouch","selectionsMayTouch","prim","sort","inv","simpleSelection","changeEnd","adjustForChange","computeSelAfterChange","offsetPos","loadMode","modeOption","resetModeState","isWholeLineUpdate","wholeLineUpdateBefore","updateDoc","estimateHeight$$1","spansFor","updateLine","linesFor","firstLine","lastText","lastSpans","nlines","insert","remove","added","added$1","added$2","linkedDocs","sharedHistOnly","propagate","skip","sharedHist","linked","rel","shared","attachDoc","setDirectionClass","History","startGen","done","undone","undoDepth","lastModTime","lastSelTime","lastOp","lastSelOp","lastOrigin","lastSelOrigin","generation","maxGeneration","historyChangeFromChange","histChange","attachLocalSpans","clearSelectionEvents","pop","addChangeToHistory","selAfter","opId","hist","history","historyEventDelay","lastChangeEvent","pushSelectionToHistory","addSelectionToHistory","selectionEventCanBeMerged","clearRedo","dest","existing","removeClearedSpans","explicitlyCleared","mergeOldSpans","getOldSpans","stretched","oldCur","stretchCur","copyHistoryArray","newGroup","instantiateSel","event","newChanges","extendRange","posBefore","extendSelection","setSelection","extendSelections","heads","replaceOneSelection","setSimpleSelection","setSelectionReplaceHistory","setSelectionNoUndo","NaN","filterSelectionChange","setSelectionInner","skipAtomicInSelection","reCheckSelection","mayClear","newAnchor","skipAtomic","newHead","skipAtomicInner","oldPos","atomic","near","movePos","far","cantEdit","selectAll","filterChange","canceled","cancel","makeChange","ignoreReadOnly","suppressEdits","mark","parts","mk","newParts","dfrom","dto","removeReadOnlyRanges","makeChangeInner","makeChangeSingleDoc","rebased","rebaseHist","makeChangeFromHistory","allowSelectionOnly","suppress","antiChanges","filter","returned","v","shiftDoc","distance","removed","recomputeMaxLength","checkWidthStart","retreatFrontier","changesHandler","changeHandler","makeChangeSingleDocInEditor","replaceRange","splitLines","rebaseHistSelSingle","rebaseHistArray","sub","copied","changeLine","handle","changeType","LeafChunk","BranchChunk","removeInner","insertInner","iterN","oldHeight","remaining","leaf","maybeSpill","me","sibling","myIndex","used","LineWidget","opt","adjustScrollWhenAboveVisible","this$1","oldH","nextMarkerId","TextMarker","markText","cloneNode","isParent","SharedTextMarker","markTextShared","replacedWith","addToHistory","curLine","addMarkedSpan","clearOnEnter","clearHistory","withOp","visual","dHeight","findSharedMarkers","findMarks","detachSharedMarkers","subMarker","nextDocId","Doc","lineSep","cleanGeneration","constructor","join","lineSeparator","getRange","getLineHandle","getLineNumber","getLineHandleVisualStart","lineCount","listSelections","setCursor","extendSelectionsBy","setSelections","addSelection","getSelections","replaceSelection","dup","replaceSelections","newSel","hint","oldPrev","newPrev","computeReplacedSel","undo","redo","undoSelection","redoSelection","setExtending","getExtending","historySize","markClean","changeGeneration","forceSplit","isClean","gen","getHistory","setHistory","histData","setGutterMarker","gutterID","clearGutter","lineInfo","addLineClass","where","removeLineClass","addLineWidget","insertAt","aboveVisible","removeLineWidget","setBookmark","realOpts","findMarksAt","getAllMarks","posFromIndex","sepSize","indexFromPos","copyHistory","linkedDoc","mFrom","mTo","subMark","copySharedMarkers","unlinkDoc","CodeMirror","splitIds","iterLinkedDocs","getEditor","setDirection","eachLine","lastDrop","onDrop","clearDragCursor","files","dataTransfer","isReadOnly","FileReader","File","read","loadFile","allowDropFileTypes","reader","onload","readAsText","draggingText","text$1","getData","selected","dragCursor","forEachCodeMirror","getElementsByClassName","byClass","editors","globalsRegistered","ensureGlobalHandlers","resizeTimer","onResize","setSize","keyNames","3","8","9","13","16","17","18","19","20","27","32","33","34","35","36","37","38","39","40","44","45","46","59","61","91","92","93","106","107","109","110","111","127","145","173","186","187","188","189","190","191","192","219","220","221","222","63232","63233","63234","63235","63272","63273","63275","63276","63277","63302","fromCharCode","keyMap","normalizeKeyName","ctrl","cmd","mod","normalizeKeyMap","keymap","keyname","keys","lookupKey","getKeyMap","fallthrough","isModifierKey","keyCode","addModifierNames","noShift","altKey","metaKey","shiftKey","keyName","altGraphKey","deleteNearSelection","compute","kill","toKill","replaced","moveCharLogically","moveLogically","endOfLine","visually","prep","targetTop","basic","Left","Right","Up","Down","End","Home","PageUp","PageDown","Delete","Backspace","Shift-Backspace","Tab","Shift-Tab","Enter","Insert","Esc","pcDefault","Ctrl-A","Ctrl-D","Ctrl-Z","Shift-Ctrl-Z","Ctrl-Y","Ctrl-Home","Ctrl-End","Ctrl-Up","Ctrl-Down","Ctrl-Left","Ctrl-Right","Alt-Left","Alt-Right","Ctrl-Backspace","Ctrl-Delete","Ctrl-S","Ctrl-F","Ctrl-G","Shift-Ctrl-G","Shift-Ctrl-F","Shift-Ctrl-R","Ctrl-[","Ctrl-]","Ctrl-U","Shift-Ctrl-U","Alt-U","emacsy","Ctrl-B","Ctrl-P","Ctrl-N","Alt-F","Alt-B","Ctrl-E","Ctrl-V","Shift-Ctrl-V","Ctrl-H","Alt-D","Alt-Backspace","Ctrl-K","Ctrl-T","Ctrl-O","macDefault","Cmd-A","Cmd-D","Cmd-Z","Shift-Cmd-Z","Cmd-Y","Cmd-Home","Cmd-Up","Cmd-End","Cmd-Down","Cmd-Left","Cmd-Right","Ctrl-Alt-Backspace","Alt-Delete","Cmd-S","Cmd-F","Cmd-G","Shift-Cmd-G","Cmd-Alt-F","Shift-Cmd-Alt-F","Cmd-[","Cmd-]","Cmd-Backspace","Cmd-Delete","Cmd-U","Shift-Cmd-U","commands","singleSelection","killLine","deleteLine","delLineLeft","delWrappedLineLeft","delWrappedLineRight","rightPos","goDocStart","goDocEnd","goLineStart","goLineStartSmart","lineStartSmart","goLineEnd","visualLineEnd","lineEnd","goLineRight","goLineLeft","goLineLeftSmart","goLineUp","moveV","goLineDown","goPageUp","goPageDown","goCharLeft","moveH","goCharRight","goColumnLeft","goColumnRight","goWordLeft","goGroupRight","goGroupLeft","goWordRight","delCharBefore","deleteH","delCharAfter","delWordBefore","delWordAfter","delGroupBefore","delGroupAfter","indentAuto","indentSelection","indentMore","indentLess","insertTab","insertSoftTab","spaces","defaultTab","execCommand","transposeChars","newlineAndIndent","sels","indentLine","openLine","toggleOverwrite","firstNonWS","inWS","doHandleBinding","bound","dropShift","ensurePolled","prevShift","stopSeq","dispatchKey","seq","keySeq","dispatchKeyInner","keyMaps","extraKeys","lookupKeyForEditor","handleKeyBinding","motion","lastStoppedKey","onKeyDown","handled","up","showCrossHair","onKeyUp","onKeyPress","charCode","handleCharBinding","lastClick","lastDoubleClick","PastClick","onMouseDown","activeTouch","supportsTouch","draggable","clickInGutter","repeat","now","compare","clickRepeat","selectingText","handleMappedButton","contained","behavior","option","unit","addNew","moveOnDrag","configureMouse","dragDrop","moved","dragEnd","mouseMove","dragStart","e2","leftButtonStartDrag","ourRange","ourIndex","startSel","rangeForUnit","lastPos","extendTo","startCol","posCol","leftPos","oldRange","ranges$1","anchorLine","boundary","headIndex","usePart","bidiSimplify","editorSize","counter","move","buttons","curCount","leftButtonSelect","leftButtonDown","onContextMenu","findWordAt","gutterEvent","prevent","mX","mY","touches","lineBox","g","contextMenuInGutter","themeChanged","theme","Init","defaults","optionHandlers","guttersChanged","dragDropChanged","funcs","dragFunctions","toggle","enter","over","leave","drop","wrappingChanged","inputStyles","inputStyle","init","pasteIncoming","cutIncoming","autofocus","word","touchFinished","prevTouch","finishTouch","farAway","touch","radiusX","radiusY","isMouseLikeTouchEvent","pageX","pageY","frag","onDragOver","setData","effectAllowed","setDragImage","img","_top","onDragStart","inp","getField","registerEventHandlers","finishInit","initHooks","textRendering","how","aggressive","indent","curSpace","curSpaceString","indentUnit","indentString","indentWithTabs","pos$1","defineInitHook","lastCopied","setLastCopied","newLastCopied","applyTextInput","inserted","deleted","recent","paste","textLines","multiPaste","pasteLinesPerSelection","lineWise","changeEvent","triggerElectric","handlePaste","pasted","clipboardData","disableInput","electricChars","smartIndent","getModeAt","electricInput","copyableRanges","lineRange","disableBrowserMagic","field","spellcheck","autocorrect","autocapitalize","hiddenTextarea","border","findPosH","origDir","moveOnce","boundToLine","bidi","mv","getWrappedLineExtent","moveInStorageOrder","searchInVisualLine","getRes","nextCh","moveVisually","sawType","getHelper","hitSide","findPosV","pageSize","moveAmount","ContentEditableInput","lastAnchorNode","lastAnchorOffset","lastFocusNode","lastFocusOffset","polling","composing","gracePeriod","readDOMTimeout","posToDOM","badPos","bad","domToPos","lineNode","locateNodeInLineView","textNode","topNode","nodeValue","curNode","textContent","previousSibling","dist$1","onCopyCut","lineWiseCopyCut","clearData","kludge","hadFocus","showPrimarySelection","updateFromDOM","readFromDOMSoon","forceCompositionEnd","showMultipleSelections","curAnchor","curFocus","rng","rangeCount","getRangeAt","startGracePeriod","rememberSelection","selectionInEditor","commonAncestorContainer","blur","pollSelection","pollInterval","poll","scan","isInGutter","triggerOnKeyDown","pollContent","fromIndex","fromNode","toNode","toIndex","newText","closing","extraLinebreak","addText","walk","cmText","markerID","isBlock","nodeName","domTextBetween","oldText","cutFront","cutEnd","oldTop","maxCutFront","newBot","oldBot","maxCutEnd","chFrom","chTo","contentEditable","readOnlyChanged","resetPosition","TextareaInput","prevInput","pollingFast","createField","textarea","prepareCopyCut","fastPoll","dispatchEvent","Event","_display","moveInputWithCursor","headPos","wrapOff","lineOff","teTop","teLeft","drawn","contextMenuPending","slowPoll","missed","same","resetSelectionOnContextMenu","oldScrollY","oldCSS","oldWrapperCSS","wrapperBox","offsetParent","scrollY","scrollTo","rehide","detectingSelectAll","prepareSelectAllHack","mouseup","extval","deflt","notOnInit","defineOption","newBreaks","refresh","getInputField","detach","attach","integer","defineOptions","helpers","setOption","getDoc","addKeyMap","removeKeyMap","addOverlay","score","priority","insertSorted","modeSpec","removeOverlay","newRanges","getTokenAt","getLineTokens","getTokenTypeAt","getHelpers","help","_global","getStateAfter","defaultTextHeight","defaultCharWidth","getViewport","addWidget","vspace","hspace","triggerOnKeyPress","triggerOnKeyUp","triggerOnMouseDown","amount","rtlMoveVisually","goalColumn","goals","startChar","check","getScrollInfo","scrollToRange","interpret","swapDoc","phrase","phraseText","phrases","getWrapperElement","getScrollerElement","getGutterElement","registerHelper","registerGlobalHelper","predicate","addEditorMethods","dontDelegate","method","contenteditable","defineMode","dependencies","defineMIME","mime","defineExtension","func","defineDocExtension","fromTextArea","tabindex","placeholder","realSubmit","form","leaveSubmitMethodAlone","submit","wrappedSubmit","getTextArea","cmpPos","addLegacyProps","version","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_16cfa774_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_spin_vue__","class","xmlns","xmlns:xlink","viewBox","preserveAspectRatio","transform","attributeName","values","keyTimes","dur","repeatCount","fill","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_listConstruction_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_listConstruction_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_eae3645c_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_listConstruction_vue__","_t","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_secondaryMenu_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_secondaryMenu_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_f72bdd3a_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_secondaryMenu_vue__","escape","_i18n","menu","projects","i18n","path","icon","security","resource","user","href","_l","$index","el","active-class","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noData_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noData_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_2d3808af_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_noData_vue__","_m","_codemirror","getElementById","hookIdentifier","hookVar","hookClient","config","parserConfig","client","atoms","false","true","builtin","defaultBuiltin","keywords","sqlKeywords","operatorChars","support","hooks","dateSQL","date","timestamp","backslashStringEscapes","brackets","punctuation","tokenBase","quote","hexNumber","binaryNumber","decimallessFloat","doubleQuote","tokenize","escaped","nCharCast","charsetCast","commentSlashSlash","commentHash","commentSpaceRequired","tokenComment","depth","zerolessFloat","ODBCdotTable","pushContext","tok","popContext","textAfter","cx","blockCommentStart","blockCommentEnd","lineComment","closeBrackets","words","@","`","\\","identifierQuote",":","?","\"","HINT_ELEMENT_CLASS","ACTIVE_HINT_ELEMENT_CLASS","Completion","debounce","tick","startPos","startLen","self","activityFunc","getHints","async","newOpts","hintOptions","defaultOptions","resolve","parseOptions","selections","supportsSelection","completionActive","completion","requestAnimationFrame","fn","cancelAnimationFrame","getText","getHintElement","hintsElement","Widget","picked","parentWindow","defaultView","hints","selectedHint","completions","hintId","alignWithWord","below","winW","innerWidth","winH","overlapY","scrolls","startScroll","closingOnBlur","overlapX","baseMap","moveFocus","menuSize","setFocus","pick","custom","customKeys","ourMap","addBinding","extra","buildKeyMap","avoidWrap","changeActive","screenAmount","closeOnUnfocus","onScroll","curScroll","point","t","completeOnSingleClick","fetchHints","callback","closeCharacters","disable","myTick","finishUpdate","resolved","app","applicableHelpers","run","fromList","anyword","term","autocomplete","auto","tables","defaultTable","CONS","QUERY_DIV","ALIAS_KEYWORD","isArray","wrapTable","columns","getTable","shallowClone","object","addMatches","wordlist","formatter","cleanName","nameParts","insertIdentifierQuotes","eachWord","lineText","findTableByAlias","fullQuery","aliasUpperCase","previousWord","table","separator","validRange","indexOfSeparator","prevItem","query","wordUpperCase","parseTables","defaultTableName","disableKeywords","getKeywords","getIdentifierQuote","useIdentifierQuotes","cont","aliasTable","oldTable","tableInsert","nameCompletion","objectOrClass","matches","typed","matchInMiddle","tags","schemaInfo","quoteChar","prefix","tagStart","replaceToken","tagName","tagType","curTag","childList","globalAttrs","nm","atValues","atName","wordRegexp","wordOperators","commonKeywords","commonBuiltins","scopes","conf","parserConf","ERRORCLASS","delimiters","singleDelimiters","operators","singleOperators","doubleOperators","doubleDelimiters","tripleDelimiters","hangingIndent","myKeywords","myBuiltins","extra_keywords","extra_builtins","py3","identifiers","stringPrefixes","builtins","lastToken","scopeOffset","lineOffset","pushPyScope","dedent","errorToken","tokenBaseInner","floatLiteral","intLiteral","delimiter","tokenOuter","singleline","OUTCLASS","tokenNestedExpr","tokenString","singleLineStringErrors","isString","formatStringFactory","tokenStringFactory","tokenLexer","beginningOfLine","lambda","delimiter_index","pushBracketScope","basecolumn","addErr","scope","triples","fold","htmlConfig","autoSelfClosers","area","br","command","embed","frame","hr","keygen","link","meta","param","track","wbr","menuitem","implicitlyClosed","dd","li","optgroup","rp","tbody","td","tfoot","tr","contextGrabbers","dt","address","article","aside","blockquote","dl","fieldset","footer","h1","h2","h3","h4","h5","h6","header","hgroup","nav","ol","section","ul","thead","doNotIndent","allowUnquoted","allowMissing","caseFold","xmlConfig","allowMissingTagName","editorConf","config_","setStyle","htmlMode","inText","chain","parser","inBlock","doctype","inTag","closure","baseState","isInAttribute","stringStartCol","terminator","maybePopContext","nextTagName","parentTagName","tagNameState","closeTagNameState","attrState","matchClosing","closeState","closeStateErr","_stream","attrEqState","startOfLine","noIndent","attrValueState","attrContinuedState","isInText","baseIndent","fullLine","multilineTagIndentPastTag","multilineTagIndentFactor","alignCDATA","tagAfter","grabbers","configuration","skipAttribute","TOKEN_STYLES","addition","bold","cite","definitionList","deletion","em","footnote","footCite","html","image","italic","linkDefinition","list1","list2","list3","notextile","specialChar","strong","sup","tableHeading","handlePhraseModifier","togglePhraseModifier","tokenStyles","tokenStylesWith","phraseModifier","closeRE","openSize","charBefore","charAfter","Modes","textileDisabled","layoutType","activeStyles","extraStyles","spanningLayout","newLayout","REs","single","bc","bq","definitionListEnd","drawTable","foot","para","tableCellAttributes","tableText","selector","lang","pad","createRe","makeRe","RE","choiceRe","arg","blockType","newMode","layoutLength","listDepth","listMod","tableCell","startNewLine","define","dict","commonAtoms","commonCommands","tokenDollar","tokenStringStart","bytes","log","pow","toPrecision","isJson","JSON","parse","_typeof","syntaxHighlight","json","stringify",".txt",".log",".sh",".conf",".cfg",".py",".java",".sql",".hql",".xml"],"mappings":"oDAAAA,OAAAC,eAAAC,EAAA,cAAAC,OAAA,QAAAC,EAAAC,EAAA,KAAAC,EAAAD,EAAAE,EAAAH,GAAA,QAAAI,KAAAJ,EAAA,YAAAI,GAAA,SAAAC,GAAAJ,EAAAK,EAAAR,EAAAO,EAAA,kBAAAL,EAAAK,KAAA,CAAAD,GAAA,IAAAG,EAAAN,EAAA,MAGA,IASAO,EAZA,SAAAC,GACER,EAAQ,OAgBVS,EAdyBT,EAAQ,GAcjCU,CACET,EAAAU,EACAL,EAAA,G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node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-511724d0\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./noType.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./noType.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./noType.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-511724d0\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./noType.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue\n// module id = 1001\n// module chunks = 7 8","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n// This is CodeMirror (https://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\//.test(userAgent);\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\\/\\w+/.test(userAgent);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt() {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var activeElement;\n try {\n activeElement = document.activeElement;\n } catch(e) {\n activeElement = document.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {this.id = null;};\n Delayed.prototype.set = function (ms, f) {\n clearTimeout(this.id);\n this.id = setTimeout(f, ms);\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 30;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\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]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n input.init(d);\n }\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n // Add a span to a line.\n function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers || (emitter._handlers = {});\n map$$1[type] = (map$$1[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers, arr = map$$1 && map$$1[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map$$1[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range$$1;\n try {range$$1 = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range$$1 || range$$1.parentElement() != te) { return false }\n return range$$1.compareEndPoints(\"StartToEnd\", range$$1) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var this$1 = this;\n\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n var this$1 = this;\n\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this$1.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\s)\" + lineClass[2] + \"(?:$|\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {\n var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (node.className == \"CodeMirror-linewidget\")\n { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\");\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map$$1, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map$$1.length; i += 3) {\n mStart = map$$1[i];\n mEnd = map$$1[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map$$1.length - 3 || ch == mEnd && map$$1[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map$$1[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map$$1[i - 2] == map$$1[i - 3] && map$$1[i - 1].insertLeft) {\n node = map$$1[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map$$1.length - 3 && map$$1[i + 3] == map$$1[i + 4] && !map$$1[i + 5].insertLeft) {\n node = map$$1[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX() {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }\n return window.pageXOffset || (document.documentElement || document.body).scrollLeft\n }\n function pageScrollY() {\n if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }\n return window.pageYOffset || (document.documentElement || document.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var height = 0;\n if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above)\n { height += widgetHeight(lineObj.widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = true; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo$$1, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight$$1 = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo$$1, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight$$1; box.bottom += widgetHeight$$1;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight$$1 <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo$$1, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top || y >= coords.bottom;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo$$1, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo$$1, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo$$1, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo$$1, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range$$1 = doc.sel.ranges[i];\n if (range$$1.from().line >= cm.display.viewTo || range$$1.to().line < cm.display.viewFrom) { continue }\n var collapsed = range$$1.empty();\n if (collapsed || cm.options.showCursorWhenSelecting)\n { drawSelectionCursor(cm, range$$1.head, curFragment); }\n if (!collapsed)\n { drawSelectionRange(cm, range$$1, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\"; },\n cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n onBlur(cm);\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range$$1) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range$$1;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val);\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.pointerEvents = this.vert.style.pointerEvents = \"none\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.pointerEvents = \"auto\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt$$1 = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt$$1 != bar) { bar.style.pointerEvents = \"none\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt();\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this$1.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt();\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = window.getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }\n snapshot.activeElt.focus();\n if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var sel = window.getSelection(), range$$1 = document.createRange();\n range$$1.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range$$1.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range$$1);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(cm) {\n var width = cm.display.gutters.offsetWidth;\n cm.display.sizer.style.marginLeft = width + \"px\";\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }\n\n // Make sure the gutters options contains the element\n // \"CodeMirror-linenumbers\" when the lineNumbers option is true.\n function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && wheelPixelsPerUnit != null) {\n var pixels = dy * wheelPixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n var this$1 = this;\n\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this$1.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var this$1 = this;\n\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this$1.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n var this$1 = this;\n\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this$1.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(startGen) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = startGen || 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm)\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n var this$1 = this;\n\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this$1;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n var this$1 = this;\n\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this$1.lines[i];\n this$1.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var e = at + n; at < e; ++at)\n { if (op(this$1.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n var this$1 = this;\n\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this$1;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n var this$1 = this;\n\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this$1.height -= oldHeight - child.height;\n if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this$1.children.splice(++i, 0, leaf);\n leaf.parent = this$1;\n }\n child.lines = child.lines.slice(0, remaining);\n this$1.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n var this$1 = this;\n\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this$1[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var this$1 = this;\n\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n var this$1 = this;\n\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null));\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n var this$1 = this;\n\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this$1; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this$1.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range$$1 = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range$$1.head; }\n else if (start == \"anchor\") { pos = range$$1.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range$$1.to(); }\n else { pos = range$$1.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n var this$1 = this;\n\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this$1, ranges[i].anchor),\n clipPos(this$1, ranges[i].head)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var this$1 = this;\n\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var this$1 = this;\n\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var this$1 = this;\n\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range$$1 = sel.ranges[i];\n changes[i] = {from: range$$1.from(), to: range$$1.to(), text: this$1.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this$1, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {this.history = new History(this.history.maxGeneration);},\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history.maxGeneration);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo$$1 = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo$$1 == from.line && from.ch >= span.to ||\n span.from == null && lineNo$$1 != from.line ||\n span.from != null && lineNo$$1 == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo$$1;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo$$1 = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo$$1;\n });\n return clipPos(this, Pos(lineNo$$1, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n var this$1 = this;\n\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this$1.linked[i];\n if (link.doc != other) { continue }\n this$1.linked.splice(i, 1);\n other.unlinkDoc(this$1);\n detachSharedMarkers(findSharedMarkers(this$1));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var loadFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1)\n { return }\n\n var reader = new FileReader;\n reader.onload = operation(cm, function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) { content = \"\"; }\n text[i] = content;\n if (++read == n) {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)));\n }\n });\n reader.readAsText(file);\n };\n for (var i = 0; i < n; ++i) { loadFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 127: \"Delete\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Alt-F\": \"goWordRight\", \"Alt-B\": \"goWordLeft\", \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\",\n \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\", \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\",\n \"Alt-D\": \"delWordAfter\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\", \"Ctrl-T\": \"transposeChars\",\n \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map$$1, handle, context) {\n map$$1 = getKeyMap(map$$1);\n var found = map$$1.call ? map$$1.call(key, context) : map$$1[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map$$1.fallthrough) {\n if (Object.prototype.toString.call(map$$1.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map$$1.fallthrough, handle, context) }\n for (var i = 0; i < map$$1.fallthrough.length; i++) {\n var result = lookupKey(key, map$$1.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Cmd\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"char\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(0, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n cm.curOp.focus = activeElt();\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if (webkit || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n delayBlurEvent(cm);\n setTimeout(function () { return display.input.focus(); }, 20);\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.options.gutters.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.options.gutters[i];\n signal(cm, type, cm, line, gutter, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b-\\u200f\\u2028\\u2029\\ufeff]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n guttersChanged(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"firstLineNumber\", 1, guttersChanged, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, guttersChanged, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function guttersChanged(cm) {\n updateGutters(cm);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n setGuttersForLineNumbers(options);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input);\n display.wrapper.CodeMirror = this;\n updateGutters(this);\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(bind(onFocus, this), 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this$1, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range$$1 = sel.ranges[i$1];\n var from = range$$1.from(), to = range$$1.to();\n if (range$$1.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == inserted)\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput)\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range$$1 = sel.ranges[i];\n if (range$$1.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range$$1.head.line)) { continue }\n var mode = cm.getModeAt(range$$1.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range$$1.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range$$1.head.line).text.slice(0, range$$1.head.ch)))\n { indented = indentLine(cm, range$$1.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range$$1.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", !!autocorrect);\n field.setAttribute(\"autocapitalize\", !!autocapitalize);\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n disableBrowserMagic(te);\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map$$1, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n },\n removeKeyMap: function(map$$1) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this$1.state.modeGen++;\n regChange(this$1);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range$$1 = ranges[i];\n if (!range$$1.empty()) {\n var from = range$$1.from(), to = range$$1.to();\n var start = Math.max(end, from.line);\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how); }\n var newRanges = this$1.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range$$1.head.line > end) {\n indentLine(this$1, range$$1.head.line, how, true);\n end = range$$1.head.line;\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range$$1 = this.doc.sel.primary();\n if (start == null) { pos = range$$1.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range$$1.from() : range$$1.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range$$1) {\n if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range$$1) {\n var other = findPosH(doc, range$$1.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this$1, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range$$1) {\n if (collapse)\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range$$1 == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range$$1, margin) {\n if (range$$1 == null) {\n range$$1 = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range$$1 == \"number\") {\n range$$1 = {from: Pos(range$$1, 0), to: null};\n } else if (range$$1.from == null) {\n range$$1 = {from: range$$1, to: null};\n }\n if (!range$$1.to) { range$$1.to = range$$1.from; }\n range$$1.margin = margin || 0;\n\n if (range$$1.from.line != null) {\n scrollToRange(this, range$$1);\n } else {\n scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo$$1 = this.display.viewFrom;\n this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n ++lineNo$$1;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"char\", \"column\" (like char, but doesn't\n // cross line boundaries), \"word\" (across next word), or \"group\" (to\n // the start of next group of word or non-word-non-whitespace\n // chars). The visually param controls whether, in right-to-left\n // text, direction 1 means to move towards the next index in the\n // string, or towards the character to the right of the current\n // position. The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n function findNextLine() {\n var l = pos.line + dir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n on(div, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = document.activeElement;\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = this.cm.state.focused;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map$$1 = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map$$1[map$$1.length - 1], offset: map$$1[map$$1.length - 2] - map$$1[map$$1.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor())\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var input = this;\n if (this.selectionInEditor())\n { this.pollSelection(); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range$$1;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range$$1 = found[0].find(0)))\n { addText(getBetween(cm.doc, range$$1.from, range$$1.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map$$1 = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map$$1.length; j += 3) {\n var curNode = map$$1[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map$$1[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map$$1[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing) { return }\n var cm = this.cm;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt() != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { window.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt();\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, …*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.45.0\";\n\n return CodeMirror;\n\n})));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/lib/codemirror.js\n// module id = 644\n// module chunks = 3 4 5 7 8 14","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./spin.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./spin.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./spin.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./spin.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/spin/spin.vue\n// module id = 646\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue?5ee1","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue?e770","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue?aa4f","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/_source/down_error.png","webpack:///src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue?b44a","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue?b68d","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue?33ff","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue","webpack:///src/js/module/components/spin/spin.vue","webpack:///src/js/module/components/listConstruction/listConstruction.vue","webpack:///src/js/module/components/secondaryMenu/secondaryMenu.vue","webpack:///src/js/module/components/noData/noData.vue","webpack:///./node_modules/codemirror/lib/codemirror.js","webpack:///./src/js/module/components/spin/spin.vue","webpack:///./src/js/module/components/spin/spin.vue?542d","webpack:///./src/js/module/components/spin/spin.vue?9371","webpack:///./src/js/module/components/spin/spin.vue?87eb","webpack:///./src/js/module/components/listConstruction/listConstruction.vue","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?b527","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?50be","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?6117","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?c652","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?7693","webpack:///./src/js/module/components/secondaryMenu/close.png","webpack:///./src/js/module/components/secondaryMenu/open.png","webpack:///./src/js/module/components/secondaryMenu/menu.js","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?048e","webpack:///./src/js/module/components/noData/noData.vue","webpack:///./src/js/module/components/noData/noData.vue?93a9","webpack:///./src/js/module/components/noData/noData.vue?86e8","webpack:///./src/js/module/components/noData/noData.vue?5a51","webpack:///./src/js/module/components/noData/images/errorTip.png","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/_source/codemirror.js","webpack:///./node_modules/codemirror/mode/sql/sql.js","webpack:///./node_modules/codemirror/addon/hint/show-hint.js","webpack:///./node_modules/codemirror/addon/hint/sql-hint.js","webpack:///./node_modules/codemirror/addon/hint/xml-hint.js","webpack:///./node_modules/codemirror/mode/python/python.js","webpack:///./node_modules/codemirror/mode/xml/xml.js","webpack:///./node_modules/codemirror/mode/textile/textile.js","webpack:///./node_modules/codemirror/mode/shell/shell.js","webpack:///./src/js/module/util/util.js","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/_source/common.js","webpack:///./src/js/conf/home/pages/resource/pages/file/pages/details/_source/utils.js","webpack:///src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue"],"names":["Object","defineProperty","__webpack_exports__","value","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noType_vue__","__webpack_require__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noType_vue___default","n","__WEBPACK_IMPORT_KEY__","key","d","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_511724d0_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_noType_vue__","__vue_styles__","ssrContext","Component","normalizeComponent","a","content","module","i","locals","exports","push","esExports","render","_h","this","$createElement","_c","_self","staticClass","attrs","src","alt","_v","_s","$t","staticRenderFns","p","_vuex","_common","_util","_utils","editor","name","data","isNoType","isLoading","filtTypeArr","loadingIndex","mode","isData","size","spinnerLoading","msg","props","methods","assign","mapActions","ok","_this","updateContent","id","$route","params","getValue","then","res","$message","success","setTimeout","close","catch","e","error","$router","_getViewResources","_this2","getViewResources","skipLineNum","limit","alias","split","_handlerEditor","setValue","$","scrollTop","scrollLeft","_codemirror2","default","readOnly","keypress","getOption","showHint","completeSingle","on","watch","created","file","_lodash2","_localStorage2","getItem","fileName","fileSize","lastIndexOf","substring","length","handlerSuffix","bytesToSize","parseInt","includes","trimStart","mounted","destroyed","toTextArea","off","computed","components","mListConstruction","_listConstruction2","mNoType","_noType2","mSpin","_spin2","mSecondaryMenu","_secondaryMenu2","mNoData","_noData2","_vm","type","title","staticStyle","margin","slot","_e","shape","disabled","click","$event","loading","is-spin","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_index_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_index_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_6ba7df63_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_index_vue__","isSpin","Boolean","isLeft","String","menuList","_menu2","index","isTogHide","className","is","layoutBox","addClass","removeClass","_toggleSubMenu","item","isOpen","_toggleMenu","factory","userAgent","navigator","platform","gecko","test","ie_upto10","ie_11up","exec","edge","ie","ie_version","document","documentMode","webkit","qtwebkit","chrome","presto","safari","vendor","mac_geMountainLion","phantom","ios","android","mobile","mac","chromeOS","windows","presto_version","match","Number","flipCtrlCmd","captureRightClick","classTest","cls","RegExp","range","rmClass","node","current","after","slice","removeChildren","count","childNodes","removeChild","firstChild","removeChildrenAndAdd","parent","appendChild","elt","tag","style","createElement","cssText","createTextNode","eltP","setAttribute","contains","child","nodeType","parentNode","host","activeElt","activeElement","body","shadowRoot","joinClasses","b","as","createRange","start","end","endNode","r","setEnd","setStart","createTextRange","moveToElementText","collapse","moveEnd","moveStart","selectInput","select","bind","f","args","Array","prototype","call","arguments","apply","copyObj","obj","target","overwrite","prop","hasOwnProperty","countColumn","string","tabSize","startIndex","startValue","search","nextTab","indexOf","selectionStart","selectionEnd","Delayed","array","set","ms","clearTimeout","scrollerGap","Pass","toString","sel_dontScroll","scroll","sel_mouse","origin","sel_move","findColumn","goal","pos","col","skipped","Math","min","spaceStrs","spaceStr","lst","arr","map","out","nothing","createObj","base","inst","create","nonASCIISingleCaseWordChar","isWordCharBasic","ch","toUpperCase","toLowerCase","isWordChar","helper","source","isEmpty","extendingChars","isExtendingChar","charCodeAt","skipExtendingChars","str","dir","charAt","findFirst","pred","from","to","midF","mid","ceil","floor","getLine","doc","first","Error","chunk","lines","children","sz","chunkSize","getBetween","line","iter","text","getLines","updateLineHeight","height","diff","lineNo","cur","no","lineAtHeight","h","outer","i$1","lh","isLine","l","lineNumberFor","options","lineNumberFormatter","firstLineNumber","Pos","sticky","cmp","equalCursorPos","copyPos","x","maxPos","minPos","clipLine","max","clipPos","last","linelen","clipToLen","clipPosArray","sawReadOnlySpans","sawCollapsedSpans","MarkedSpan","marker","getMarkedSpanFor","spans","span","removeMarkedSpan","stretchSpansOverChange","change","full","oldFirst","markedSpans","oldLast","startCh","endCh","isInsert","old","nw","inclusiveLeft","insertLeft","endsAfter","inclusiveRight","markedSpansBefore","startsBefore","markedSpansAfter","sameLine","offset","found","span$1","clearEmptySpans","newMarkers","gapMarkers","gap","i$2","i$3","clearWhenEmpty","splice","detachMarkedSpans","detachLine","attachMarkedSpans","attachLine","extraLeft","extraRight","compareCollapsedMarkers","lenDiff","aPos","find","bPos","fromCmp","toCmp","collapsedSpanAtSide","sps","sp","collapsed","collapsedSpanAtStart","collapsedSpanAtEnd","collapsedSpanAround","conflictingCollapsedRange","lineNo$$1","visualLine","merged","visualLineNo","lineN","vis","visualLineEndNo","lastLine","lineIsHidden","widgetNode","lineIsHiddenInner","heightAtLine","lineObj","lineLength","len","found$1","findMaxLine","cm","display","maxLine","maxLineLength","maxLineChanged","bidiOther","getBidiPartAt","order","bidiOrdering","lowTypes","arabicTypes","bidiRE","isNeutral","isStrong","countsAsLeft","countsAsNum","BidiSpan","level","direction","outerType","code","types","prev","type$1","prev$1","type$2","i$4","type$3","replace","j","i$5","cur$1","type$4","i$6","end$1","before","replace$1","j$1","m","i$7","at","j$2","nstart","unshift","reverse","getOrder","noHandlers","emitter","addEventListener","attachEvent","map$$1","_handlers","concat","getHandlers","removeEventListener","detachEvent","signal","handlers","signalDOMEvent","override","preventDefault","defaultPrevented","e_defaultPrevented","codemirrorIgnore","signalCursorActivity","cursorActivity","curOp","cursorActivityHandlers","hasHandler","eventMixin","ctor","e_preventDefault","returnValue","e_stopPropagation","stopPropagation","cancelBubble","e_stop","e_target","srcElement","e_button","which","button","ctrlKey","zwspSupported","badBidiRects","dragAndDrop","div","zeroWidthElement","measure","offsetHeight","offsetWidth","hasBadBidiRects","txt","r0","getBoundingClientRect","r1","left","right","splitLinesAuto","result","nl","rt","hasSelection","window","getSelection","te","range$$1","ownerDocument","selection","parentElement","compareEndPoints","hasCopyEvent","oncopy","badZoomedRects","modes","mimeModes","resolveMode","spec","getMode","mfactory","modeObj","modeExtensions","exts","helperType","modeProps","prop$1","extendMode","properties","copyState","state","nstate","val","innerMode","info","startState","a1","a2","StringStream","lineOracle","lastColumnPos","lastColumnValue","lineStart","eol","sol","peek","undefined","next","eat","eatWhile","eatSpace","skipToEnd","skipTo","backUp","column","indentation","pattern","consume","caseInsensitive","cased","substr","hideFirstChars","inner","lookAhead","oracle","baseToken","SavedContext","Context","maxLookAhead","baseTokens","baseTokenPos","highlightLine","context","forceToEnd","st","modeGen","lineClasses","runMode","loop","o","overlay","overlays","i_end","opaque","styles","classes","bgClass","textClass","getLineStyles","updateFrontier","getContextBefore","resetState","maxHighlightLength","stateAfter","save","styleClasses","highlightFrontier","modeFrontier","precise","minindent","minline","lim","indented","findStartLine","saved","fromSaved","processLine","viewFrom","viewTo","nextLine","startAt","stream","callBlankLine","readToken","blankLine","token","copy","Token","takeToken","asArray","tokens","extractLineClasses","output","lineClass","flattenSpans","curStart","curStyle","addModeClass","mName","Line","estimateHeight","cleanUpLine","styleToClassCache","styleToClassCacheWithMode","interpretTokenStyle","cache","buildLineContent","lineView","builder","pre","trailingSpace","splitSpaces","rest","addToken","buildToken","buildTokenBadBidi","insertLineContent","externalMeasured","maps","caches","lastChild","querySelector","defaultSpecialCharPlaceholder","startStyle","endStyle","css","attributes","displayText","trailingBefore","spaceBefore","special","specialChars","mustWrap","createDocumentFragment","lastIndex","txt$1","tabWidth","specialCharPlaceholder","fullStyle","attr","part","buildCollapsedSpan","ignoreWidget","widget","input","needsContentAttribute","setUneditable","allText","spanStyle","spanEndStyle","spanStartStyle","nextChange","Infinity","foundBookmarks","endStyles","upto","tokenText","LineView","visualLineContinued","hidden","buildViewArray","nextPos","view","operationGroup","orphanDelayedCallbacks","signalLater","list","delayedCallbacks","fireOrphanDelayed","delayed","updateLineForChanges","dims","changes","updateLineText","updateLineGutter","updateLineClasses","updateLineWidgets","ensureLineWrapped","replaceChild","zIndex","getLineContent","ext","built","background","wrap","insertBefore","updateLineBackground","wrapClass","gutter","gutterBackground","gutterClass","fixedGutter","fixedPos","gutterTotalWidth","markers","gutterMarkers","lineNumbers","wrap$1","gutterWrap","lineNumber","gutterLeft","k","gutters","gutterWidth","alignable","nextSibling","insertLineWidgets","buildLineElement","insertLineWidgetsFor","allowAbove","widgets","ws","handleMouseEvents","positionLineWidget","above","noHScroll","width","wrapperWidth","coverGutter","paddingLeft","position","marginLeft","widgetHeight","parentStyle","wrapper","clientWidth","eventInWidget","getAttribute","sizer","mover","paddingTop","lineSpace","offsetTop","paddingVert","paddingH","cachedPaddingH","getComputedStyle","currentStyle","paddingRight","isNaN","scrollGap","nativeBarWidth","displayWidth","scroller","barWidth","displayHeight","clientHeight","barHeight","mapFromLineView","measureChar","bias","measureCharPrepared","prepareMeasureForLine","findViewForLine","findViewIndex","getDimensions","forceUpdate","lineMeasure","updateExternalMeasurement","rect","hasHeights","prepared","varHeight","wrapping","lineWrapping","curWidth","heights","rects","getClientRects","abs","bottom","top","ensureLineHeights","place","nodeAndOffsetInLineMap","coverStart","coverEnd","getUsefulRect","screen","logicalXDPI","deviceXDPI","normal","fromRange","hasBadZoomedRects","scaleX","scaleY","logicalYDPI","deviceYDPI","maybeUpdateRectForZooming","rSpan","charWidth","nullRect","rtop","rbot","bot","bogus","singleCursorHeightPerLine","rbottom","measureCharInner","measureText","mStart","mEnd","clearLineMeasurementCacheFor","clearLineMeasurementCache","externalMeasure","clearCaches","cachedCharWidth","cachedTextHeight","lineNumChars","pageScrollX","pageXOffset","documentElement","pageScrollY","marginTop","pageYOffset","widgetTopHeight","intoCoordSystem","includeWidgets","yOff","viewOffset","lOff","xOff","fromCoordSystem","coords","localBox","lineSpaceBox","charCoords","cursorCoords","preparedMeasure","get","getBidi","partPos","invert","other","estimateCoords","PosWithInfo","outside","xRel","coordsChar","y","coordsCharInner","rangeEnd","wrappedLineExtent","begin","wrappedLineExtentChar","boxIsAfter","box","widgetHeight$$1","ltr","_lineNo","ref","closestDist","endX","dist","baseX","chAround","boxAround","atLeft","atStart","textHeight","anchor","clientLeft","offsetLeft","compensateForHScroll","th","perLine","widgetsHeight","estimateLineHeights","est","estHeight","posFromMouse","liberal","forRect","space","clientX","clientY","colDiff","round","updateSelection","showSelection","prepareSelection","primary","curFragment","cursors","selFragment","sel","ranges","primIndex","empty","showCursorWhenSelecting","drawSelectionCursor","head","drawSelectionRange","cursor","cursorHeight","otherCursor","cmpCoords","fragment","padding","leftSide","rightSide","sizerWidth","docLTR","add","drawForLine","fromArg","toArg","lineLen","wrapX","side","extent","iterateBidiSections","fromPos","toPos","openStart","openEnd","openRight","topLeft","topRight","botLeft","botRight","sFrom","sTo","fromLine","toLine","singleVLine","leftEnd","rightStart","restartBlink","focused","clearInterval","blinker","cursorDiv","visibility","cursorBlinkRate","setInterval","ensureFocus","focus","onFocus","delayBlurEvent","delayingBlurEvent","onBlur","selForContextMenu","reset","receivedFocus","shift","updateHeightsInViewport","prevBottom","lineDiv","updateWidgetHeight","chWidth","w","visibleLines","viewport","ensure","ensureFrom","ensureTo","alignHorizontally","alignWidgets","comp","gutterW","align","maybeUpdateLineNumberWidth","innerW","lineGutter","lineNumInnerWidth","lineNumWidth","updateGutterSpace","calculateScrollPos","snapMargin","screentop","docBottom","atTop","atBottom","newTop","screenleft","screenw","tooWide","addToScrollTop","resolveScrollToPos","ensureCursorVisible","getCursor","scrollToPos","cursorScrollMargin","scrollToCoords","scrollToCoordsRange","sPos","updateScrollTop","updateDisplaySimple","setScrollTop","startWorker","forceScroll","scrollHeight","scrollbars","setScrollLeft","isScroller","scrollWidth","measureForScrollbars","docH","viewHeight","viewWidth","barLeft","docHeight","NativeScrollbars","vert","horiz","tabIndex","checkedZeroWidth","minHeight","minWidth","update","needsH","needsV","sWidth","totalHeight","totalWidth","zeroWidthHack","disableHoriz","enableZeroWidthBar","disableVert","pointerEvents","bar","delay","maybeDisable","elementFromPoint","clear","NullScrollbars","updateScrollbars","startWidth","startHeight","updateScrollbarsInner","sizes","paddingBottom","heightForcer","borderBottom","scrollbarFiller","coverGutterNextToScrollbar","gutterFiller","scrollbarModel","native","null","initScrollbars","scrollbarStyle","axis","nextOpId","startOperation","op","viewChanged","updateInput","typing","changeObjs","cursorActivityCalled","selectionChanged","updateMaxLine","ops","ownsGroup","endOperation","endCb","group","callbacks","fireCallbacksForOps","finishOperation","endOperation_R1","updatedDisplay","mustUpdate","updateDisplayIfNeeded","endOperation_R2","endOperation_W2","endOperation_finish","endOperations","scrollbarsClipped","marginBottom","borderRightWidth","maybeClipScrollbars","DisplayUpdate","barMeasure","adjustWidthTo","maxScrollLeft","preparedSelection","takeFocus","setDocumentHeight","postUpdateDisplay","wheelStartX","wheelStartY","doScroll","innerHeight","scrollNode","scrollIntoView","maybeScrollWindow","changed","endCoords","scrollPos","startTop","startLeft","scrollPosIntoView","maybeHiddenMarkers","unhidden","maybeUnhiddenMarkers","finish","runInOp","operation","methodOp","docMethodOp","regChange","lendiff","updateLineNumbers","resetView","cut","viewCuttingPoint","cut$1","cutTop","cutBot","regLineChange","oldN","newN","countDirtyView","dirty","time","highlight","highlightWorker","Date","workTime","changedLines","oldStyles","highlighted","oldCls","newCls","ischange","workDelay","force","visible","editorIsHidden","wrapperHeight","oldDisplayWidth","events","renderedView","viewportMargin","different","lastWrapHeight","lastWrapWidth","adjustView","toUpdate","selSnapshot","hasFocus","active","anchorNode","extend","anchorOffset","focusNode","focusOffset","selectionSnapshot","updateNumbersFrom","container","rm","currentWheelTarget","updateNumber","patchDisplay","snapshot","removeAllRanges","addRange","restoreSelection","selectionDiv","reportedViewFrom","reportedViewTo","updateGutters","specs","gElt","setGuttersForLineNumbers","wheelSamples","wheelPixelsPerUnit","wheelEventDelta","dx","wheelDeltaX","dy","wheelDeltaY","detail","HORIZONTAL_AXIS","VERTICAL_AXIS","wheelDelta","wheelEventPixels","delta","onScrollWheel","canScrollX","canScrollY","pixels","wheelDX","wheelDY","movedX","movedY","sample","Selection","equals","here","there","deepCopy","Range","somethingSelected","normalizeSelection","mayTouch","selectionsMayTouch","prim","sort","inv","simpleSelection","changeEnd","adjustForChange","computeSelAfterChange","offsetPos","loadMode","modeOption","resetModeState","isWholeLineUpdate","wholeLineUpdateBefore","updateDoc","estimateHeight$$1","spansFor","updateLine","linesFor","firstLine","lastText","lastSpans","nlines","insert","remove","added","added$1","added$2","linkedDocs","sharedHistOnly","propagate","skip","sharedHist","linked","rel","shared","attachDoc","setDirectionClass","History","startGen","done","undone","undoDepth","lastModTime","lastSelTime","lastOp","lastSelOp","lastOrigin","lastSelOrigin","generation","maxGeneration","historyChangeFromChange","histChange","attachLocalSpans","clearSelectionEvents","pop","addChangeToHistory","selAfter","opId","hist","history","historyEventDelay","lastChangeEvent","pushSelectionToHistory","addSelectionToHistory","selectionEventCanBeMerged","clearRedo","dest","existing","removeClearedSpans","explicitlyCleared","mergeOldSpans","getOldSpans","stretched","oldCur","stretchCur","copyHistoryArray","newGroup","instantiateSel","event","newChanges","extendRange","posBefore","extendSelection","setSelection","extendSelections","heads","replaceOneSelection","setSimpleSelection","setSelectionReplaceHistory","setSelectionNoUndo","NaN","filterSelectionChange","setSelectionInner","skipAtomicInSelection","reCheckSelection","mayClear","newAnchor","skipAtomic","newHead","skipAtomicInner","oldPos","atomic","near","movePos","far","cantEdit","selectAll","filterChange","canceled","cancel","makeChange","ignoreReadOnly","suppressEdits","mark","parts","mk","newParts","dfrom","dto","removeReadOnlyRanges","makeChangeInner","makeChangeSingleDoc","rebased","rebaseHist","makeChangeFromHistory","allowSelectionOnly","suppress","antiChanges","filter","returned","v","shiftDoc","distance","removed","recomputeMaxLength","checkWidthStart","retreatFrontier","changesHandler","changeHandler","makeChangeSingleDocInEditor","replaceRange","splitLines","rebaseHistSelSingle","rebaseHistArray","sub","copied","changeLine","handle","changeType","LeafChunk","BranchChunk","removeInner","insertInner","iterN","oldHeight","remaining","leaf","maybeSpill","me","sibling","myIndex","used","LineWidget","opt","adjustScrollWhenAboveVisible","this$1","oldH","nextMarkerId","TextMarker","markText","cloneNode","isParent","SharedTextMarker","markTextShared","replacedWith","addToHistory","curLine","addMarkedSpan","clearOnEnter","clearHistory","withOp","visual","dHeight","findSharedMarkers","findMarks","detachSharedMarkers","subMarker","nextDocId","Doc","lineSep","cleanGeneration","constructor","join","lineSeparator","getRange","getLineHandle","getLineNumber","getLineHandleVisualStart","lineCount","listSelections","setCursor","extendSelectionsBy","setSelections","addSelection","getSelections","replaceSelection","dup","replaceSelections","newSel","hint","oldPrev","newPrev","computeReplacedSel","undo","redo","undoSelection","redoSelection","setExtending","getExtending","historySize","markClean","changeGeneration","forceSplit","isClean","gen","getHistory","setHistory","histData","setGutterMarker","gutterID","clearGutter","lineInfo","addLineClass","where","removeLineClass","addLineWidget","insertAt","aboveVisible","removeLineWidget","setBookmark","realOpts","findMarksAt","getAllMarks","posFromIndex","sepSize","indexFromPos","copyHistory","linkedDoc","mFrom","mTo","subMark","copySharedMarkers","unlinkDoc","CodeMirror","splitIds","iterLinkedDocs","getEditor","setDirection","eachLine","lastDrop","onDrop","clearDragCursor","files","dataTransfer","isReadOnly","FileReader","File","read","loadFile","allowDropFileTypes","reader","onload","readAsText","draggingText","text$1","getData","selected","dragCursor","forEachCodeMirror","getElementsByClassName","byClass","editors","globalsRegistered","ensureGlobalHandlers","resizeTimer","onResize","setSize","keyNames","3","8","9","13","16","17","18","19","20","27","32","33","34","35","36","37","38","39","40","44","45","46","59","61","91","92","93","106","107","109","110","111","127","145","173","186","187","188","189","190","191","192","219","220","221","222","63232","63233","63234","63235","63272","63273","63275","63276","63277","63302","fromCharCode","keyMap","normalizeKeyName","ctrl","cmd","mod","normalizeKeyMap","keymap","keyname","keys","lookupKey","getKeyMap","fallthrough","isModifierKey","keyCode","addModifierNames","noShift","altKey","metaKey","shiftKey","keyName","altGraphKey","deleteNearSelection","compute","kill","toKill","replaced","moveCharLogically","moveLogically","endOfLine","visually","prep","targetTop","basic","Left","Right","Up","Down","End","Home","PageUp","PageDown","Delete","Backspace","Shift-Backspace","Tab","Shift-Tab","Enter","Insert","Esc","pcDefault","Ctrl-A","Ctrl-D","Ctrl-Z","Shift-Ctrl-Z","Ctrl-Y","Ctrl-Home","Ctrl-End","Ctrl-Up","Ctrl-Down","Ctrl-Left","Ctrl-Right","Alt-Left","Alt-Right","Ctrl-Backspace","Ctrl-Delete","Ctrl-S","Ctrl-F","Ctrl-G","Shift-Ctrl-G","Shift-Ctrl-F","Shift-Ctrl-R","Ctrl-[","Ctrl-]","Ctrl-U","Shift-Ctrl-U","Alt-U","emacsy","Ctrl-B","Ctrl-P","Ctrl-N","Alt-F","Alt-B","Ctrl-E","Ctrl-V","Shift-Ctrl-V","Ctrl-H","Alt-D","Alt-Backspace","Ctrl-K","Ctrl-T","Ctrl-O","macDefault","Cmd-A","Cmd-D","Cmd-Z","Shift-Cmd-Z","Cmd-Y","Cmd-Home","Cmd-Up","Cmd-End","Cmd-Down","Cmd-Left","Cmd-Right","Ctrl-Alt-Backspace","Alt-Delete","Cmd-S","Cmd-F","Cmd-G","Shift-Cmd-G","Cmd-Alt-F","Shift-Cmd-Alt-F","Cmd-[","Cmd-]","Cmd-Backspace","Cmd-Delete","Cmd-U","Shift-Cmd-U","commands","singleSelection","killLine","deleteLine","delLineLeft","delWrappedLineLeft","delWrappedLineRight","rightPos","goDocStart","goDocEnd","goLineStart","goLineStartSmart","lineStartSmart","goLineEnd","visualLineEnd","lineEnd","goLineRight","goLineLeft","goLineLeftSmart","goLineUp","moveV","goLineDown","goPageUp","goPageDown","goCharLeft","moveH","goCharRight","goColumnLeft","goColumnRight","goWordLeft","goGroupRight","goGroupLeft","goWordRight","delCharBefore","deleteH","delCharAfter","delWordBefore","delWordAfter","delGroupBefore","delGroupAfter","indentAuto","indentSelection","indentMore","indentLess","insertTab","insertSoftTab","spaces","defaultTab","execCommand","transposeChars","newlineAndIndent","sels","indentLine","openLine","toggleOverwrite","firstNonWS","inWS","doHandleBinding","bound","dropShift","ensurePolled","prevShift","stopSeq","dispatchKey","seq","keySeq","dispatchKeyInner","keyMaps","extraKeys","lookupKeyForEditor","handleKeyBinding","motion","lastStoppedKey","onKeyDown","handled","up","showCrossHair","onKeyUp","onKeyPress","charCode","handleCharBinding","lastClick","lastDoubleClick","PastClick","onMouseDown","activeTouch","supportsTouch","draggable","clickInGutter","repeat","now","compare","clickRepeat","selectingText","handleMappedButton","contained","behavior","option","unit","addNew","moveOnDrag","configureMouse","dragDrop","moved","dragEnd","mouseMove","dragStart","e2","leftButtonStartDrag","ourRange","ourIndex","startSel","rangeForUnit","lastPos","extendTo","startCol","posCol","leftPos","oldRange","ranges$1","anchorLine","boundary","headIndex","usePart","bidiSimplify","editorSize","counter","move","buttons","curCount","leftButtonSelect","leftButtonDown","onContextMenu","findWordAt","gutterEvent","prevent","mX","mY","touches","lineBox","g","contextMenuInGutter","themeChanged","theme","Init","defaults","optionHandlers","guttersChanged","dragDropChanged","funcs","dragFunctions","toggle","enter","over","leave","drop","wrappingChanged","inputStyles","inputStyle","init","pasteIncoming","cutIncoming","autofocus","word","touchFinished","prevTouch","finishTouch","farAway","touch","radiusX","radiusY","isMouseLikeTouchEvent","pageX","pageY","frag","onDragOver","setData","effectAllowed","setDragImage","img","_top","onDragStart","inp","getField","registerEventHandlers","finishInit","initHooks","textRendering","how","aggressive","indent","curSpace","curSpaceString","indentUnit","indentString","indentWithTabs","pos$1","defineInitHook","lastCopied","setLastCopied","newLastCopied","applyTextInput","inserted","deleted","recent","paste","textLines","multiPaste","pasteLinesPerSelection","lineWise","changeEvent","triggerElectric","handlePaste","pasted","clipboardData","disableInput","electricChars","smartIndent","getModeAt","electricInput","copyableRanges","lineRange","disableBrowserMagic","field","spellcheck","autocorrect","autocapitalize","hiddenTextarea","border","findPosH","origDir","moveOnce","boundToLine","bidi","mv","getWrappedLineExtent","moveInStorageOrder","searchInVisualLine","getRes","nextCh","moveVisually","sawType","getHelper","hitSide","findPosV","pageSize","moveAmount","ContentEditableInput","lastAnchorNode","lastAnchorOffset","lastFocusNode","lastFocusOffset","polling","composing","gracePeriod","readDOMTimeout","posToDOM","badPos","bad","domToPos","lineNode","locateNodeInLineView","textNode","topNode","nodeValue","curNode","textContent","previousSibling","dist$1","onCopyCut","lineWiseCopyCut","clearData","kludge","hadFocus","showPrimarySelection","updateFromDOM","readFromDOMSoon","forceCompositionEnd","showMultipleSelections","curAnchor","curFocus","rng","rangeCount","getRangeAt","startGracePeriod","rememberSelection","selectionInEditor","commonAncestorContainer","blur","pollSelection","pollInterval","poll","scan","isInGutter","triggerOnKeyDown","pollContent","fromIndex","fromNode","toNode","toIndex","newText","closing","extraLinebreak","addText","walk","cmText","markerID","isBlock","nodeName","domTextBetween","oldText","cutFront","cutEnd","oldTop","maxCutFront","newBot","oldBot","maxCutEnd","chFrom","chTo","contentEditable","readOnlyChanged","resetPosition","TextareaInput","prevInput","pollingFast","createField","textarea","prepareCopyCut","fastPoll","dispatchEvent","Event","_display","moveInputWithCursor","headPos","wrapOff","lineOff","teTop","teLeft","drawn","contextMenuPending","slowPoll","missed","same","resetSelectionOnContextMenu","oldScrollY","oldCSS","oldWrapperCSS","wrapperBox","offsetParent","scrollY","scrollTo","rehide","detectingSelectAll","prepareSelectAllHack","mouseup","extval","deflt","notOnInit","defineOption","newBreaks","refresh","getInputField","detach","attach","integer","defineOptions","helpers","setOption","getDoc","addKeyMap","removeKeyMap","addOverlay","score","priority","insertSorted","modeSpec","removeOverlay","newRanges","getTokenAt","getLineTokens","getTokenTypeAt","getHelpers","help","_global","getStateAfter","defaultTextHeight","defaultCharWidth","getViewport","addWidget","vspace","hspace","triggerOnKeyPress","triggerOnKeyUp","triggerOnMouseDown","amount","rtlMoveVisually","goalColumn","goals","startChar","check","getScrollInfo","scrollToRange","interpret","swapDoc","phrase","phraseText","phrases","getWrapperElement","getScrollerElement","getGutterElement","registerHelper","registerGlobalHelper","predicate","addEditorMethods","dontDelegate","method","contenteditable","defineMode","dependencies","defineMIME","mime","defineExtension","func","defineDocExtension","fromTextArea","tabindex","placeholder","realSubmit","form","leaveSubmitMethodAlone","submit","wrappedSubmit","getTextArea","cmpPos","addLegacyProps","version","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_16cfa774_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_spin_vue__","class","xmlns","xmlns:xlink","viewBox","preserveAspectRatio","transform","attributeName","values","keyTimes","dur","repeatCount","fill","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_listConstruction_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_listConstruction_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_eae3645c_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_listConstruction_vue__","_t","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_secondaryMenu_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_secondaryMenu_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_f72bdd3a_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_secondaryMenu_vue__","escape","_i18n","menu","projects","i18n","path","icon","security","resource","user","href","_l","$index","el","active-class","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noData_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noData_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_2d3808af_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_noData_vue__","_m","_codemirror","getElementById","hookIdentifier","hookVar","hookClient","config","parserConfig","client","atoms","false","true","builtin","defaultBuiltin","keywords","sqlKeywords","operatorChars","support","hooks","dateSQL","date","timestamp","backslashStringEscapes","brackets","punctuation","tokenBase","quote","hexNumber","binaryNumber","decimallessFloat","doubleQuote","tokenize","escaped","nCharCast","charsetCast","commentSlashSlash","commentHash","commentSpaceRequired","tokenComment","depth","zerolessFloat","ODBCdotTable","pushContext","tok","popContext","textAfter","cx","blockCommentStart","blockCommentEnd","lineComment","closeBrackets","words","@","`","\\","identifierQuote",":","?","\"","HINT_ELEMENT_CLASS","ACTIVE_HINT_ELEMENT_CLASS","Completion","debounce","tick","startPos","startLen","self","activityFunc","getHints","async","newOpts","hintOptions","defaultOptions","resolve","parseOptions","selections","supportsSelection","completionActive","completion","requestAnimationFrame","fn","cancelAnimationFrame","getText","getHintElement","hintsElement","Widget","picked","parentWindow","defaultView","hints","selectedHint","completions","hintId","alignWithWord","below","winW","innerWidth","winH","overlapY","scrolls","startScroll","closingOnBlur","overlapX","baseMap","moveFocus","menuSize","setFocus","pick","custom","customKeys","ourMap","addBinding","extra","buildKeyMap","avoidWrap","changeActive","screenAmount","closeOnUnfocus","onScroll","curScroll","point","t","completeOnSingleClick","fetchHints","callback","closeCharacters","disable","myTick","finishUpdate","resolved","app","applicableHelpers","run","fromList","anyword","term","autocomplete","auto","tables","defaultTable","CONS","QUERY_DIV","ALIAS_KEYWORD","isArray","wrapTable","columns","getTable","shallowClone","object","addMatches","wordlist","formatter","cleanName","nameParts","insertIdentifierQuotes","eachWord","lineText","findTableByAlias","fullQuery","aliasUpperCase","previousWord","table","separator","validRange","indexOfSeparator","prevItem","query","wordUpperCase","parseTables","defaultTableName","disableKeywords","getKeywords","getIdentifierQuote","useIdentifierQuotes","cont","aliasTable","oldTable","tableInsert","nameCompletion","objectOrClass","matches","typed","matchInMiddle","tags","schemaInfo","quoteChar","prefix","tagStart","replaceToken","tagName","tagType","curTag","childList","globalAttrs","nm","atValues","atName","wordRegexp","wordOperators","commonKeywords","commonBuiltins","scopes","conf","parserConf","ERRORCLASS","delimiters","singleDelimiters","operators","singleOperators","doubleOperators","doubleDelimiters","tripleDelimiters","hangingIndent","myKeywords","myBuiltins","extra_keywords","extra_builtins","py3","identifiers","stringPrefixes","builtins","lastToken","scopeOffset","lineOffset","pushPyScope","dedent","errorToken","tokenBaseInner","floatLiteral","intLiteral","delimiter","tokenOuter","singleline","OUTCLASS","tokenNestedExpr","tokenString","singleLineStringErrors","isString","formatStringFactory","tokenStringFactory","tokenLexer","beginningOfLine","lambda","delimiter_index","pushBracketScope","basecolumn","addErr","scope","triples","fold","htmlConfig","autoSelfClosers","area","br","command","embed","frame","hr","keygen","link","meta","param","track","wbr","menuitem","implicitlyClosed","dd","li","optgroup","rp","tbody","td","tfoot","tr","contextGrabbers","dt","address","article","aside","blockquote","dl","fieldset","footer","h1","h2","h3","h4","h5","h6","header","hgroup","nav","ol","section","ul","thead","doNotIndent","allowUnquoted","allowMissing","caseFold","xmlConfig","allowMissingTagName","editorConf","config_","setStyle","htmlMode","inText","chain","parser","inBlock","doctype","inTag","closure","baseState","isInAttribute","stringStartCol","terminator","maybePopContext","nextTagName","parentTagName","tagNameState","closeTagNameState","attrState","matchClosing","closeState","closeStateErr","_stream","attrEqState","startOfLine","noIndent","attrValueState","attrContinuedState","isInText","baseIndent","fullLine","multilineTagIndentPastTag","multilineTagIndentFactor","alignCDATA","tagAfter","grabbers","configuration","skipAttribute","TOKEN_STYLES","addition","bold","cite","definitionList","deletion","em","footnote","footCite","html","image","italic","linkDefinition","list1","list2","list3","notextile","specialChar","strong","sup","tableHeading","handlePhraseModifier","togglePhraseModifier","tokenStyles","tokenStylesWith","phraseModifier","closeRE","openSize","charBefore","charAfter","Modes","textileDisabled","layoutType","activeStyles","extraStyles","spanningLayout","newLayout","REs","single","bc","bq","definitionListEnd","drawTable","foot","para","tableCellAttributes","tableText","selector","lang","pad","createRe","makeRe","RE","choiceRe","arg","blockType","newMode","layoutLength","listDepth","listMod","tableCell","startNewLine","define","dict","commonAtoms","commonCommands","tokenDollar","tokenStringStart","bytes","log","pow","toPrecision","isJson","JSON","parse","_typeof","syntaxHighlight","json","stringify",".txt",".log",".sh",".conf",".cfg",".py",".java",".sql",".hql",".xml"],"mappings":"oDAAAA,OAAAC,eAAAC,EAAA,cAAAC,OAAA,QAAAC,EAAAC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,MAAO,KAAM,OAAQ,MAAO,KAAM,OAAQ,MAAO,MAAO,2DCehF2D,eAdAg+E,OAAQ,UACRC,OAAQ,UACRC,MAAO,QACPC,QAAS,UACTC,OAAQ,UACRC,MAAO,SACPC,QAAS,UACTC,OAAQ,MACRC,OAAQ,MACRC,OAAQ,oECtBVxiF,KAAA","file":"js/8.e9f2610.js","sourcesContent":["function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-511724d0\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./noType.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./noType.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./noType.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-511724d0\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./noType.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue\n// module id = 1001\n// module chunks = 7 8","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","// CodeMirror, copyright (c) by Marijn Haverbeke and others\n// Distributed under an MIT license: https://codemirror.net/LICENSE\n\n// This is CodeMirror (https://codemirror.net), a code editor\n// implemented in JavaScript on top of the browser's DOM.\n//\n// You can find some technical background for some of the code below\n// at http://marijnhaverbeke.nl/blog/#cm-internals .\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global.CodeMirror = factory());\n}(this, (function () { 'use strict';\n\n // Kludges for bugs and behavior differences that can't be feature\n // detected are enabled based on userAgent etc sniffing.\n var userAgent = navigator.userAgent;\n var platform = navigator.platform;\n\n var gecko = /gecko\\/\\d/i.test(userAgent);\n var ie_upto10 = /MSIE \\d/.test(userAgent);\n var ie_11up = /Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(userAgent);\n var edge = /Edge\\/(\\d+)/.exec(userAgent);\n var ie = ie_upto10 || ie_11up || edge;\n var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]);\n var webkit = !edge && /WebKit\\//.test(userAgent);\n var qtwebkit = webkit && /Qt\\/\\d+\\.\\d+/.test(userAgent);\n var chrome = !edge && /Chrome\\//.test(userAgent);\n var presto = /Opera\\//.test(userAgent);\n var safari = /Apple Computer/.test(navigator.vendor);\n var mac_geMountainLion = /Mac OS X 1\\d\\D([8-9]|\\d\\d)\\D/.test(userAgent);\n var phantom = /PhantomJS/.test(userAgent);\n\n var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\\/\\w+/.test(userAgent);\n var android = /Android/.test(userAgent);\n // This is woefully incomplete. Suggestions for alternative methods welcome.\n var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent);\n var mac = ios || /Mac/.test(platform);\n var chromeOS = /\\bCrOS\\b/.test(userAgent);\n var windows = /win/i.test(platform);\n\n var presto_version = presto && userAgent.match(/Version\\/(\\d*\\.\\d*)/);\n if (presto_version) { presto_version = Number(presto_version[1]); }\n if (presto_version && presto_version >= 15) { presto = false; webkit = true; }\n // Some browsers use the wrong event properties to signal cmd/ctrl on OS X\n var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11));\n var captureRightClick = gecko || (ie && ie_version >= 9);\n\n function classTest(cls) { return new RegExp(\"(^|\\\\s)\" + cls + \"(?:$|\\\\s)\\\\s*\") }\n\n var rmClass = function(node, cls) {\n var current = node.className;\n var match = classTest(cls).exec(current);\n if (match) {\n var after = current.slice(match.index + match[0].length);\n node.className = current.slice(0, match.index) + (after ? match[1] + after : \"\");\n }\n };\n\n function removeChildren(e) {\n for (var count = e.childNodes.length; count > 0; --count)\n { e.removeChild(e.firstChild); }\n return e\n }\n\n function removeChildrenAndAdd(parent, e) {\n return removeChildren(parent).appendChild(e)\n }\n\n function elt(tag, content, className, style) {\n var e = document.createElement(tag);\n if (className) { e.className = className; }\n if (style) { e.style.cssText = style; }\n if (typeof content == \"string\") { e.appendChild(document.createTextNode(content)); }\n else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } }\n return e\n }\n // wrapper for elt, which removes the elt from the accessibility tree\n function eltP(tag, content, className, style) {\n var e = elt(tag, content, className, style);\n e.setAttribute(\"role\", \"presentation\");\n return e\n }\n\n var range;\n if (document.createRange) { range = function(node, start, end, endNode) {\n var r = document.createRange();\n r.setEnd(endNode || node, end);\n r.setStart(node, start);\n return r\n }; }\n else { range = function(node, start, end) {\n var r = document.body.createTextRange();\n try { r.moveToElementText(node.parentNode); }\n catch(e) { return r }\n r.collapse(true);\n r.moveEnd(\"character\", end);\n r.moveStart(\"character\", start);\n return r\n }; }\n\n function contains(parent, child) {\n if (child.nodeType == 3) // Android browser always returns false when child is a textnode\n { child = child.parentNode; }\n if (parent.contains)\n { return parent.contains(child) }\n do {\n if (child.nodeType == 11) { child = child.host; }\n if (child == parent) { return true }\n } while (child = child.parentNode)\n }\n\n function activeElt() {\n // IE and Edge may throw an \"Unspecified Error\" when accessing document.activeElement.\n // IE < 10 will throw when accessed while the page is loading or in an iframe.\n // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable.\n var activeElement;\n try {\n activeElement = document.activeElement;\n } catch(e) {\n activeElement = document.body || null;\n }\n while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)\n { activeElement = activeElement.shadowRoot.activeElement; }\n return activeElement\n }\n\n function addClass(node, cls) {\n var current = node.className;\n if (!classTest(cls).test(current)) { node.className += (current ? \" \" : \"\") + cls; }\n }\n function joinClasses(a, b) {\n var as = a.split(\" \");\n for (var i = 0; i < as.length; i++)\n { if (as[i] && !classTest(as[i]).test(b)) { b += \" \" + as[i]; } }\n return b\n }\n\n var selectInput = function(node) { node.select(); };\n if (ios) // Mobile Safari apparently has a bug where select() is broken.\n { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; }\n else if (ie) // Suppress mysterious IE10 errors\n { selectInput = function(node) { try { node.select(); } catch(_e) {} }; }\n\n function bind(f) {\n var args = Array.prototype.slice.call(arguments, 1);\n return function(){return f.apply(null, args)}\n }\n\n function copyObj(obj, target, overwrite) {\n if (!target) { target = {}; }\n for (var prop in obj)\n { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))\n { target[prop] = obj[prop]; } }\n return target\n }\n\n // Counts the column offset in a string, taking tabs into account.\n // Used mostly to find indentation.\n function countColumn(string, end, tabSize, startIndex, startValue) {\n if (end == null) {\n end = string.search(/[^\\s\\u00a0]/);\n if (end == -1) { end = string.length; }\n }\n for (var i = startIndex || 0, n = startValue || 0;;) {\n var nextTab = string.indexOf(\"\\t\", i);\n if (nextTab < 0 || nextTab >= end)\n { return n + (end - i) }\n n += nextTab - i;\n n += tabSize - (n % tabSize);\n i = nextTab + 1;\n }\n }\n\n var Delayed = function() {this.id = null;};\n Delayed.prototype.set = function (ms, f) {\n clearTimeout(this.id);\n this.id = setTimeout(f, ms);\n };\n\n function indexOf(array, elt) {\n for (var i = 0; i < array.length; ++i)\n { if (array[i] == elt) { return i } }\n return -1\n }\n\n // Number of pixels added to scroller and sizer to hide scrollbar\n var scrollerGap = 30;\n\n // Returned or thrown by various protocols to signal 'I'm not\n // handling this'.\n var Pass = {toString: function(){return \"CodeMirror.Pass\"}};\n\n // Reused option objects for setSelection & friends\n var sel_dontScroll = {scroll: false}, sel_mouse = {origin: \"*mouse\"}, sel_move = {origin: \"+move\"};\n\n // The inverse of countColumn -- find the offset that corresponds to\n // a particular column.\n function findColumn(string, goal, tabSize) {\n for (var pos = 0, col = 0;;) {\n var nextTab = string.indexOf(\"\\t\", pos);\n if (nextTab == -1) { nextTab = string.length; }\n var skipped = nextTab - pos;\n if (nextTab == string.length || col + skipped >= goal)\n { return pos + Math.min(skipped, goal - col) }\n col += nextTab - pos;\n col += tabSize - (col % tabSize);\n pos = nextTab + 1;\n if (col >= goal) { return pos }\n }\n }\n\n var spaceStrs = [\"\"];\n function spaceStr(n) {\n while (spaceStrs.length <= n)\n { spaceStrs.push(lst(spaceStrs) + \" \"); }\n return spaceStrs[n]\n }\n\n function lst(arr) { return arr[arr.length-1] }\n\n function map(array, f) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); }\n return out\n }\n\n function insertSorted(array, value, score) {\n var pos = 0, priority = score(value);\n while (pos < array.length && score(array[pos]) <= priority) { pos++; }\n array.splice(pos, 0, value);\n }\n\n function nothing() {}\n\n function createObj(base, props) {\n var inst;\n if (Object.create) {\n inst = Object.create(base);\n } else {\n nothing.prototype = base;\n inst = new nothing();\n }\n if (props) { copyObj(props, inst); }\n return inst\n }\n\n var nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n function isWordCharBasic(ch) {\n return /\\w/.test(ch) || ch > \"\\x80\" &&\n (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch))\n }\n function isWordChar(ch, helper) {\n if (!helper) { return isWordCharBasic(ch) }\n if (helper.source.indexOf(\"\\\\w\") > -1 && isWordCharBasic(ch)) { return true }\n return helper.test(ch)\n }\n\n function isEmpty(obj) {\n for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } }\n return true\n }\n\n // Extending unicode characters. A series of a non-extending char +\n // any number of extending chars is treated as a single unit as far\n // as editing and measuring is concerned. This is not fully correct,\n // since some scripts/fonts/browsers also treat other configurations\n // of code points as a group.\n var extendingChars = /[\\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]/;\n function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) }\n\n // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range.\n function skipExtendingChars(str, pos, dir) {\n while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; }\n return pos\n }\n\n // Returns the value from the range [`from`; `to`] that satisfies\n // `pred` and is closest to `from`. Assumes that at least `to`\n // satisfies `pred`. Supports `from` being greater than `to`.\n function findFirst(pred, from, to) {\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var dir = from > to ? -1 : 1;\n for (;;) {\n if (from == to) { return from }\n var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF);\n if (mid == from) { return pred(mid) ? from : to }\n if (pred(mid)) { to = mid; }\n else { from = mid + dir; }\n }\n }\n\n // The display handles the DOM integration, both for input reading\n // and content drawing. It holds references to DOM nodes and\n // display-related state.\n\n function Display(place, doc, input) {\n var d = this;\n this.input = input;\n\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"cm-not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"cm-not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = eltP(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = eltP(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n var lines = eltP(\"div\", [d.lineSpace], \"CodeMirror-lines\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [lines], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; }\n\n if (place) {\n if (place.appendChild) { place.appendChild(d.wrapper); }\n else { place(d.wrapper); }\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n\n d.activeTouch = null;\n\n input.init(d);\n }\n\n // Find the line object corresponding to the given line number.\n function getLine(doc, n) {\n n -= doc.first;\n if (n < 0 || n >= doc.size) { throw new Error(\"There is no line \" + (n + doc.first) + \" in the document.\") }\n var chunk = doc;\n while (!chunk.lines) {\n for (var i = 0;; ++i) {\n var child = chunk.children[i], sz = child.chunkSize();\n if (n < sz) { chunk = child; break }\n n -= sz;\n }\n }\n return chunk.lines[n]\n }\n\n // Get the part of a document between two positions, as an array of\n // strings.\n function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }\n // Get the lines between from and to, as array of strings.\n function getLines(doc, from, to) {\n var out = [];\n doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value\n return out\n }\n\n // Update the height of a line, propagating the height change\n // upwards to parent nodes.\n function updateLineHeight(line, height) {\n var diff = height - line.height;\n if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } }\n }\n\n // Given a line object, find its line number by walking up through\n // its parent links.\n function lineNo(line) {\n if (line.parent == null) { return null }\n var cur = line.parent, no = indexOf(cur.lines, line);\n for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {\n for (var i = 0;; ++i) {\n if (chunk.children[i] == cur) { break }\n no += chunk.children[i].chunkSize();\n }\n }\n return no + cur.first\n }\n\n // Find the line at the given vertical position, using the height\n // information in the document tree.\n function lineAtHeight(chunk, h) {\n var n = chunk.first;\n outer: do {\n for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) {\n var child = chunk.children[i$1], ch = child.height;\n if (h < ch) { chunk = child; continue outer }\n h -= ch;\n n += child.chunkSize();\n }\n return n\n } while (!chunk.lines)\n var i = 0;\n for (; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i], lh = line.height;\n if (h < lh) { break }\n h -= lh;\n }\n return n + i\n }\n\n function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size}\n\n function lineNumberFor(options, i) {\n return String(options.lineNumberFormatter(i + options.firstLineNumber))\n }\n\n // A Pos instance represents a position within the text.\n function Pos(line, ch, sticky) {\n if ( sticky === void 0 ) sticky = null;\n\n if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) }\n this.line = line;\n this.ch = ch;\n this.sticky = sticky;\n }\n\n // Compare two positions, return 0 if they are the same, a negative\n // number when a is less, and a positive number otherwise.\n function cmp(a, b) { return a.line - b.line || a.ch - b.ch }\n\n function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 }\n\n function copyPos(x) {return Pos(x.line, x.ch)}\n function maxPos(a, b) { return cmp(a, b) < 0 ? b : a }\n function minPos(a, b) { return cmp(a, b) < 0 ? a : b }\n\n // Most of the external API clips given positions to make sure they\n // actually exist within the document.\n function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))}\n function clipPos(doc, pos) {\n if (pos.line < doc.first) { return Pos(doc.first, 0) }\n var last = doc.first + doc.size - 1;\n if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) }\n return clipToLen(pos, getLine(doc, pos.line).text.length)\n }\n function clipToLen(pos, linelen) {\n var ch = pos.ch;\n if (ch == null || ch > linelen) { return Pos(pos.line, linelen) }\n else if (ch < 0) { return Pos(pos.line, 0) }\n else { return pos }\n }\n function clipPosArray(doc, array) {\n var out = [];\n for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); }\n return out\n }\n\n // Optimize some code when these features are not used.\n var sawReadOnlySpans = false, sawCollapsedSpans = false;\n\n function seeReadOnlySpans() {\n sawReadOnlySpans = true;\n }\n\n function seeCollapsedSpans() {\n sawCollapsedSpans = true;\n }\n\n // TEXTMARKER SPANS\n\n function MarkedSpan(marker, from, to) {\n this.marker = marker;\n this.from = from; this.to = to;\n }\n\n // Search an array of spans for a span matching the given marker.\n function getMarkedSpanFor(spans, marker) {\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.marker == marker) { return span }\n } }\n }\n // Remove a span from an array, returning undefined if no spans are\n // left (we don't store arrays for lines without spans).\n function removeMarkedSpan(spans, span) {\n var r;\n for (var i = 0; i < spans.length; ++i)\n { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } }\n return r\n }\n // Add a span to a line.\n function addMarkedSpan(line, span) {\n line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];\n span.marker.attachLine(line);\n }\n\n // Used for the algorithm that adjusts markers for a change in the\n // document. These functions cut an array of spans at a given\n // character position, returning an array of remaining chunks (or\n // undefined if nothing remains).\n function markedSpansBefore(old, startCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);\n if (startsBefore || span.from == startCh && marker.type == \"bookmark\" && (!isInsert || !span.marker.insertLeft)) {\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));\n }\n } }\n return nw\n }\n function markedSpansAfter(old, endCh, isInsert) {\n var nw;\n if (old) { for (var i = 0; i < old.length; ++i) {\n var span = old[i], marker = span.marker;\n var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);\n if (endsAfter || span.from == endCh && marker.type == \"bookmark\" && (!isInsert || span.marker.insertLeft)) {\n var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh)\n ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,\n span.to == null ? null : span.to - endCh));\n }\n } }\n return nw\n }\n\n // Given a change object, compute the new set of marker spans that\n // cover the line in which the change took place. Removes spans\n // entirely within the change, reconnects spans belonging to the\n // same marker that appear on both sides of the change, and cuts off\n // spans partially within the change. Returns an array of span\n // arrays with one element for each line in (after) the change.\n function stretchSpansOverChange(doc, change) {\n if (change.full) { return null }\n var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;\n var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;\n if (!oldFirst && !oldLast) { return null }\n\n var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0;\n // Get the spans that 'stick out' on both sides\n var first = markedSpansBefore(oldFirst, startCh, isInsert);\n var last = markedSpansAfter(oldLast, endCh, isInsert);\n\n // Next, merge those two ends\n var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);\n if (first) {\n // Fix up .to properties of first\n for (var i = 0; i < first.length; ++i) {\n var span = first[i];\n if (span.to == null) {\n var found = getMarkedSpanFor(last, span.marker);\n if (!found) { span.to = startCh; }\n else if (sameLine) { span.to = found.to == null ? null : found.to + offset; }\n }\n }\n }\n if (last) {\n // Fix up .from in last (or move them into first in case of sameLine)\n for (var i$1 = 0; i$1 < last.length; ++i$1) {\n var span$1 = last[i$1];\n if (span$1.to != null) { span$1.to += offset; }\n if (span$1.from == null) {\n var found$1 = getMarkedSpanFor(first, span$1.marker);\n if (!found$1) {\n span$1.from = offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n } else {\n span$1.from += offset;\n if (sameLine) { (first || (first = [])).push(span$1); }\n }\n }\n }\n // Make sure we didn't create any zero-length spans\n if (first) { first = clearEmptySpans(first); }\n if (last && last != first) { last = clearEmptySpans(last); }\n\n var newMarkers = [first];\n if (!sameLine) {\n // Fill gap with whole-line-spans\n var gap = change.text.length - 2, gapMarkers;\n if (gap > 0 && first)\n { for (var i$2 = 0; i$2 < first.length; ++i$2)\n { if (first[i$2].to == null)\n { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } }\n for (var i$3 = 0; i$3 < gap; ++i$3)\n { newMarkers.push(gapMarkers); }\n newMarkers.push(last);\n }\n return newMarkers\n }\n\n // Remove spans that are empty and don't have a clearWhenEmpty\n // option of false.\n function clearEmptySpans(spans) {\n for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false)\n { spans.splice(i--, 1); }\n }\n if (!spans.length) { return null }\n return spans\n }\n\n // Used to 'clip' out readOnly ranges when making a change.\n function removeReadOnlyRanges(doc, from, to) {\n var markers = null;\n doc.iter(from.line, to.line + 1, function (line) {\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var mark = line.markedSpans[i].marker;\n if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))\n { (markers || (markers = [])).push(mark); }\n } }\n });\n if (!markers) { return null }\n var parts = [{from: from, to: to}];\n for (var i = 0; i < markers.length; ++i) {\n var mk = markers[i], m = mk.find(0);\n for (var j = 0; j < parts.length; ++j) {\n var p = parts[j];\n if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue }\n var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to);\n if (dfrom < 0 || !mk.inclusiveLeft && !dfrom)\n { newParts.push({from: p.from, to: m.from}); }\n if (dto > 0 || !mk.inclusiveRight && !dto)\n { newParts.push({from: m.to, to: p.to}); }\n parts.splice.apply(parts, newParts);\n j += newParts.length - 3;\n }\n }\n return parts\n }\n\n // Connect or disconnect spans from a line.\n function detachMarkedSpans(line) {\n var spans = line.markedSpans;\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.detachLine(line); }\n line.markedSpans = null;\n }\n function attachMarkedSpans(line, spans) {\n if (!spans) { return }\n for (var i = 0; i < spans.length; ++i)\n { spans[i].marker.attachLine(line); }\n line.markedSpans = spans;\n }\n\n // Helpers used when computing which overlapping collapsed span\n // counts as the larger one.\n function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 }\n function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 }\n\n // Returns a number indicating which of two overlapping collapsed\n // spans is larger (and thus includes the other). Falls back to\n // comparing ids when the spans cover exactly the same range.\n function compareCollapsedMarkers(a, b) {\n var lenDiff = a.lines.length - b.lines.length;\n if (lenDiff != 0) { return lenDiff }\n var aPos = a.find(), bPos = b.find();\n var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b);\n if (fromCmp) { return -fromCmp }\n var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b);\n if (toCmp) { return toCmp }\n return b.id - a.id\n }\n\n // Find out whether a line ends or starts in a collapsed span. If\n // so, return the marker for that span.\n function collapsedSpanAtSide(line, start) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (sp.marker.collapsed && (start ? sp.from : sp.to) == null &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0))\n { found = sp.marker; }\n } }\n return found\n }\n function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) }\n function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) }\n\n function collapsedSpanAround(line, ch) {\n var sps = sawCollapsedSpans && line.markedSpans, found;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) &&\n (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; }\n } }\n return found\n }\n\n // Test whether there exists a collapsed span that partially\n // overlaps (covers the start or end, but not both) of a new span.\n // Such overlap is not allowed.\n function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) {\n var line = getLine(doc, lineNo$$1);\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i) {\n var sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n var found = sp.marker.find(0);\n var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker);\n var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker);\n if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue }\n if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) ||\n fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0))\n { return true }\n } }\n }\n\n // A visual line is a line as drawn on the screen. Folding, for\n // example, can cause multiple logical lines to appear on the same\n // visual line. This finds the start of the visual line that the\n // given line is part of (usually that is the line itself).\n function visualLine(line) {\n var merged;\n while (merged = collapsedSpanAtStart(line))\n { line = merged.find(-1, true).line; }\n return line\n }\n\n function visualLineEnd(line) {\n var merged;\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return line\n }\n\n // Returns an array of logical lines that continue the visual line\n // started by the argument, or undefined if there are no such lines.\n function visualLineContinued(line) {\n var merged, lines;\n while (merged = collapsedSpanAtEnd(line)) {\n line = merged.find(1, true).line\n ;(lines || (lines = [])).push(line);\n }\n return lines\n }\n\n // Get the line number of the start of the visual line that the\n // given line number is part of.\n function visualLineNo(doc, lineN) {\n var line = getLine(doc, lineN), vis = visualLine(line);\n if (line == vis) { return lineN }\n return lineNo(vis)\n }\n\n // Get the line number of the start of the next visual line after\n // the given line.\n function visualLineEndNo(doc, lineN) {\n if (lineN > doc.lastLine()) { return lineN }\n var line = getLine(doc, lineN), merged;\n if (!lineIsHidden(doc, line)) { return lineN }\n while (merged = collapsedSpanAtEnd(line))\n { line = merged.find(1, true).line; }\n return lineNo(line) + 1\n }\n\n // Compute whether a line is hidden. Lines count as hidden when they\n // are part of a visual line that starts with another line, or when\n // they are entirely covered by collapsed, non-widget span.\n function lineIsHidden(doc, line) {\n var sps = sawCollapsedSpans && line.markedSpans;\n if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) {\n sp = sps[i];\n if (!sp.marker.collapsed) { continue }\n if (sp.from == null) { return true }\n if (sp.marker.widgetNode) { continue }\n if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))\n { return true }\n } }\n }\n function lineIsHiddenInner(doc, line, span) {\n if (span.to == null) {\n var end = span.marker.find(1, true);\n return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker))\n }\n if (span.marker.inclusiveRight && span.to == line.text.length)\n { return true }\n for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) {\n sp = line.markedSpans[i];\n if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&\n (sp.to == null || sp.to != span.from) &&\n (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&\n lineIsHiddenInner(doc, line, sp)) { return true }\n }\n }\n\n // Find the height above the given line.\n function heightAtLine(lineObj) {\n lineObj = visualLine(lineObj);\n\n var h = 0, chunk = lineObj.parent;\n for (var i = 0; i < chunk.lines.length; ++i) {\n var line = chunk.lines[i];\n if (line == lineObj) { break }\n else { h += line.height; }\n }\n for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {\n for (var i$1 = 0; i$1 < p.children.length; ++i$1) {\n var cur = p.children[i$1];\n if (cur == chunk) { break }\n else { h += cur.height; }\n }\n }\n return h\n }\n\n // Compute the character length of a line, taking into account\n // collapsed ranges (see markText) that might hide parts, and join\n // other lines onto it.\n function lineLength(line) {\n if (line.height == 0) { return 0 }\n var len = line.text.length, merged, cur = line;\n while (merged = collapsedSpanAtStart(cur)) {\n var found = merged.find(0, true);\n cur = found.from.line;\n len += found.from.ch - found.to.ch;\n }\n cur = line;\n while (merged = collapsedSpanAtEnd(cur)) {\n var found$1 = merged.find(0, true);\n len -= cur.text.length - found$1.from.ch;\n cur = found$1.to.line;\n len += cur.text.length - found$1.to.ch;\n }\n return len\n }\n\n // Find the longest line in the document.\n function findMaxLine(cm) {\n var d = cm.display, doc = cm.doc;\n d.maxLine = getLine(doc, doc.first);\n d.maxLineLength = lineLength(d.maxLine);\n d.maxLineChanged = true;\n doc.iter(function (line) {\n var len = lineLength(line);\n if (len > d.maxLineLength) {\n d.maxLineLength = len;\n d.maxLine = line;\n }\n });\n }\n\n // BIDI HELPERS\n\n function iterateBidiSections(order, from, to, f) {\n if (!order) { return f(from, to, \"ltr\", 0) }\n var found = false;\n for (var i = 0; i < order.length; ++i) {\n var part = order[i];\n if (part.from < to && part.to > from || from == to && part.to == from) {\n f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? \"rtl\" : \"ltr\", i);\n found = true;\n }\n }\n if (!found) { f(from, to, \"ltr\"); }\n }\n\n var bidiOther = null;\n function getBidiPartAt(order, ch, sticky) {\n var found;\n bidiOther = null;\n for (var i = 0; i < order.length; ++i) {\n var cur = order[i];\n if (cur.from < ch && cur.to > ch) { return i }\n if (cur.to == ch) {\n if (cur.from != cur.to && sticky == \"before\") { found = i; }\n else { bidiOther = i; }\n }\n if (cur.from == ch) {\n if (cur.from != cur.to && sticky != \"before\") { found = i; }\n else { bidiOther = i; }\n }\n }\n return found != null ? found : bidiOther\n }\n\n // Bidirectional ordering algorithm\n // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm\n // that this (partially) implements.\n\n // One-char codes used for character types:\n // L (L): Left-to-Right\n // R (R): Right-to-Left\n // r (AL): Right-to-Left Arabic\n // 1 (EN): European Number\n // + (ES): European Number Separator\n // % (ET): European Number Terminator\n // n (AN): Arabic Number\n // , (CS): Common Number Separator\n // m (NSM): Non-Spacing Mark\n // b (BN): Boundary Neutral\n // s (B): Paragraph Separator\n // t (S): Segment Separator\n // w (WS): Whitespace\n // N (ON): Other Neutrals\n\n // Returns null if characters are ordered as they appear\n // (left-to-right), or an array of sections ({from, to, level}\n // objects) in the order in which they occur visually.\n var bidiOrdering = (function() {\n // Character types for codepoints 0 to 0xff\n var lowTypes = \"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN\";\n // Character types for codepoints 0x600 to 0x6f9\n var arabicTypes = \"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111\";\n function charType(code) {\n if (code <= 0xf7) { return lowTypes.charAt(code) }\n else if (0x590 <= code && code <= 0x5f4) { return \"R\" }\n else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) }\n else if (0x6ee <= code && code <= 0x8ac) { return \"r\" }\n else if (0x2000 <= code && code <= 0x200b) { return \"w\" }\n else if (code == 0x200c) { return \"b\" }\n else { return \"L\" }\n }\n\n var bidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac]/;\n var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;\n\n function BidiSpan(level, from, to) {\n this.level = level;\n this.from = from; this.to = to;\n }\n\n return function(str, direction) {\n var outerType = direction == \"ltr\" ? \"L\" : \"R\";\n\n if (str.length == 0 || direction == \"ltr\" && !bidiRE.test(str)) { return false }\n var len = str.length, types = [];\n for (var i = 0; i < len; ++i)\n { types.push(charType(str.charCodeAt(i))); }\n\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) {\n var type = types[i$1];\n if (type == \"m\") { types[i$1] = prev; }\n else { prev = type; }\n }\n\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) {\n var type$1 = types[i$2];\n if (type$1 == \"1\" && cur == \"r\") { types[i$2] = \"n\"; }\n else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == \"r\") { types[i$2] = \"R\"; } }\n }\n\n // W4. A single European separator between two European numbers\n // changes to a European number. A single common separator between\n // two numbers of the same type changes to that type.\n for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) {\n var type$2 = types[i$3];\n if (type$2 == \"+\" && prev$1 == \"1\" && types[i$3+1] == \"1\") { types[i$3] = \"1\"; }\n else if (type$2 == \",\" && prev$1 == types[i$3+1] &&\n (prev$1 == \"1\" || prev$1 == \"n\")) { types[i$3] = prev$1; }\n prev$1 = type$2;\n }\n\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n for (var i$4 = 0; i$4 < len; ++i$4) {\n var type$3 = types[i$4];\n if (type$3 == \",\") { types[i$4] = \"N\"; }\n else if (type$3 == \"%\") {\n var end = (void 0);\n for (end = i$4 + 1; end < len && types[end] == \"%\"; ++end) {}\n var replace = (i$4 && types[i$4-1] == \"!\") || (end < len && types[end] == \"1\") ? \"1\" : \"N\";\n for (var j = i$4; j < end; ++j) { types[j] = replace; }\n i$4 = end - 1;\n }\n }\n\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) {\n var type$4 = types[i$5];\n if (cur$1 == \"L\" && type$4 == \"1\") { types[i$5] = \"L\"; }\n else if (isStrong.test(type$4)) { cur$1 = type$4; }\n }\n\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n for (var i$6 = 0; i$6 < len; ++i$6) {\n if (isNeutral.test(types[i$6])) {\n var end$1 = (void 0);\n for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}\n var before = (i$6 ? types[i$6-1] : outerType) == \"L\";\n var after = (end$1 < len ? types[end$1] : outerType) == \"L\";\n var replace$1 = before == after ? (before ? \"L\" : \"R\") : outerType;\n for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; }\n i$6 = end$1 - 1;\n }\n }\n\n // Here we depart from the documented algorithm, in order to avoid\n // building up an actual levels array. Since there are only three\n // levels (0, 1, 2) in an implementation that doesn't take\n // explicit embedding into account, we can build up the order on\n // the fly, without following the level-based algorithm.\n var order = [], m;\n for (var i$7 = 0; i$7 < len;) {\n if (countsAsLeft.test(types[i$7])) {\n var start = i$7;\n for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {}\n order.push(new BidiSpan(0, start, i$7));\n } else {\n var pos = i$7, at = order.length;\n for (++i$7; i$7 < len && types[i$7] != \"L\"; ++i$7) {}\n for (var j$2 = pos; j$2 < i$7;) {\n if (countsAsNum.test(types[j$2])) {\n if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); }\n var nstart = j$2;\n for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {}\n order.splice(at, 0, new BidiSpan(2, nstart, j$2));\n pos = j$2;\n } else { ++j$2; }\n }\n if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); }\n }\n }\n if (direction == \"ltr\") {\n if (order[0].level == 1 && (m = str.match(/^\\s+/))) {\n order[0].from = m[0].length;\n order.unshift(new BidiSpan(0, 0, m[0].length));\n }\n if (lst(order).level == 1 && (m = str.match(/\\s+$/))) {\n lst(order).to -= m[0].length;\n order.push(new BidiSpan(0, len - m[0].length, len));\n }\n }\n\n return direction == \"rtl\" ? order.reverse() : order\n }\n })();\n\n // Get the bidi ordering for the given line (and cache it). Returns\n // false for lines that are fully left-to-right, and an array of\n // BidiSpan objects otherwise.\n function getOrder(line, direction) {\n var order = line.order;\n if (order == null) { order = line.order = bidiOrdering(line.text, direction); }\n return order\n }\n\n // EVENT HANDLING\n\n // Lightweight event framework. on/off also work on DOM nodes,\n // registering native DOM handlers.\n\n var noHandlers = [];\n\n var on = function(emitter, type, f) {\n if (emitter.addEventListener) {\n emitter.addEventListener(type, f, false);\n } else if (emitter.attachEvent) {\n emitter.attachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers || (emitter._handlers = {});\n map$$1[type] = (map$$1[type] || noHandlers).concat(f);\n }\n };\n\n function getHandlers(emitter, type) {\n return emitter._handlers && emitter._handlers[type] || noHandlers\n }\n\n function off(emitter, type, f) {\n if (emitter.removeEventListener) {\n emitter.removeEventListener(type, f, false);\n } else if (emitter.detachEvent) {\n emitter.detachEvent(\"on\" + type, f);\n } else {\n var map$$1 = emitter._handlers, arr = map$$1 && map$$1[type];\n if (arr) {\n var index = indexOf(arr, f);\n if (index > -1)\n { map$$1[type] = arr.slice(0, index).concat(arr.slice(index + 1)); }\n }\n }\n }\n\n function signal(emitter, type /*, values...*/) {\n var handlers = getHandlers(emitter, type);\n if (!handlers.length) { return }\n var args = Array.prototype.slice.call(arguments, 2);\n for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); }\n }\n\n // The DOM events that CodeMirror handles can be overridden by\n // registering a (non-DOM) handler on the editor for the event name,\n // and preventDefault-ing the event in that handler.\n function signalDOMEvent(cm, e, override) {\n if (typeof e == \"string\")\n { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; }\n signal(cm, override || e.type, cm, e);\n return e_defaultPrevented(e) || e.codemirrorIgnore\n }\n\n function signalCursorActivity(cm) {\n var arr = cm._handlers && cm._handlers.cursorActivity;\n if (!arr) { return }\n var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []);\n for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1)\n { set.push(arr[i]); } }\n }\n\n function hasHandler(emitter, type) {\n return getHandlers(emitter, type).length > 0\n }\n\n // Add on and off methods to a constructor's prototype, to make\n // registering events on such objects more convenient.\n function eventMixin(ctor) {\n ctor.prototype.on = function(type, f) {on(this, type, f);};\n ctor.prototype.off = function(type, f) {off(this, type, f);};\n }\n\n // Due to the fact that we still support jurassic IE versions, some\n // compatibility wrappers are needed.\n\n function e_preventDefault(e) {\n if (e.preventDefault) { e.preventDefault(); }\n else { e.returnValue = false; }\n }\n function e_stopPropagation(e) {\n if (e.stopPropagation) { e.stopPropagation(); }\n else { e.cancelBubble = true; }\n }\n function e_defaultPrevented(e) {\n return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false\n }\n function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}\n\n function e_target(e) {return e.target || e.srcElement}\n function e_button(e) {\n var b = e.which;\n if (b == null) {\n if (e.button & 1) { b = 1; }\n else if (e.button & 2) { b = 3; }\n else if (e.button & 4) { b = 2; }\n }\n if (mac && e.ctrlKey && b == 1) { b = 3; }\n return b\n }\n\n // Detect drag-and-drop\n var dragAndDrop = function() {\n // There is *some* kind of drag-and-drop support in IE6-8, but I\n // couldn't get it to work yet.\n if (ie && ie_version < 9) { return false }\n var div = elt('div');\n return \"draggable\" in div || \"dragDrop\" in div\n }();\n\n var zwspSupported;\n function zeroWidthElement(measure) {\n if (zwspSupported == null) {\n var test = elt(\"span\", \"\\u200b\");\n removeChildrenAndAdd(measure, elt(\"span\", [test, document.createTextNode(\"x\")]));\n if (measure.firstChild.offsetHeight != 0)\n { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); }\n }\n var node = zwspSupported ? elt(\"span\", \"\\u200b\") :\n elt(\"span\", \"\\u00a0\", null, \"display: inline-block; width: 1px; margin-right: -1px\");\n node.setAttribute(\"cm-text\", \"\");\n return node\n }\n\n // Feature-detect IE's crummy client rect reporting for bidi text\n var badBidiRects;\n function hasBadBidiRects(measure) {\n if (badBidiRects != null) { return badBidiRects }\n var txt = removeChildrenAndAdd(measure, document.createTextNode(\"A\\u062eA\"));\n var r0 = range(txt, 0, 1).getBoundingClientRect();\n var r1 = range(txt, 1, 2).getBoundingClientRect();\n removeChildren(measure);\n if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780)\n return badBidiRects = (r1.right - r0.right < 3)\n }\n\n // See if \"\".split is the broken IE version, if so, provide an\n // alternative way to split lines.\n var splitLinesAuto = \"\\n\\nb\".split(/\\n/).length != 3 ? function (string) {\n var pos = 0, result = [], l = string.length;\n while (pos <= l) {\n var nl = string.indexOf(\"\\n\", pos);\n if (nl == -1) { nl = string.length; }\n var line = string.slice(pos, string.charAt(nl - 1) == \"\\r\" ? nl - 1 : nl);\n var rt = line.indexOf(\"\\r\");\n if (rt != -1) {\n result.push(line.slice(0, rt));\n pos += rt + 1;\n } else {\n result.push(line);\n pos = nl + 1;\n }\n }\n return result\n } : function (string) { return string.split(/\\r\\n?|\\n/); };\n\n var hasSelection = window.getSelection ? function (te) {\n try { return te.selectionStart != te.selectionEnd }\n catch(e) { return false }\n } : function (te) {\n var range$$1;\n try {range$$1 = te.ownerDocument.selection.createRange();}\n catch(e) {}\n if (!range$$1 || range$$1.parentElement() != te) { return false }\n return range$$1.compareEndPoints(\"StartToEnd\", range$$1) != 0\n };\n\n var hasCopyEvent = (function () {\n var e = elt(\"div\");\n if (\"oncopy\" in e) { return true }\n e.setAttribute(\"oncopy\", \"return;\");\n return typeof e.oncopy == \"function\"\n })();\n\n var badZoomedRects = null;\n function hasBadZoomedRects(measure) {\n if (badZoomedRects != null) { return badZoomedRects }\n var node = removeChildrenAndAdd(measure, elt(\"span\", \"x\"));\n var normal = node.getBoundingClientRect();\n var fromRange = range(node, 0, 1).getBoundingClientRect();\n return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1\n }\n\n // Known modes, by name and by MIME\n var modes = {}, mimeModes = {};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n function defineMode(name, mode) {\n if (arguments.length > 2)\n { mode.dependencies = Array.prototype.slice.call(arguments, 2); }\n modes[name] = mode;\n }\n\n function defineMIME(mime, spec) {\n mimeModes[mime] = spec;\n }\n\n // Given a MIME type, a {name, ...options} config object, or a name\n // string, return a mode config object.\n function resolveMode(spec) {\n if (typeof spec == \"string\" && mimeModes.hasOwnProperty(spec)) {\n spec = mimeModes[spec];\n } else if (spec && typeof spec.name == \"string\" && mimeModes.hasOwnProperty(spec.name)) {\n var found = mimeModes[spec.name];\n if (typeof found == \"string\") { found = {name: found}; }\n spec = createObj(found, spec);\n spec.name = found.name;\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+xml$/.test(spec)) {\n return resolveMode(\"application/xml\")\n } else if (typeof spec == \"string\" && /^[\\w\\-]+\\/[\\w\\-]+\\+json$/.test(spec)) {\n return resolveMode(\"application/json\")\n }\n if (typeof spec == \"string\") { return {name: spec} }\n else { return spec || {name: \"null\"} }\n }\n\n // Given a mode spec (anything that resolveMode accepts), find and\n // initialize an actual mode object.\n function getMode(options, spec) {\n spec = resolveMode(spec);\n var mfactory = modes[spec.name];\n if (!mfactory) { return getMode(options, \"text/plain\") }\n var modeObj = mfactory(options, spec);\n if (modeExtensions.hasOwnProperty(spec.name)) {\n var exts = modeExtensions[spec.name];\n for (var prop in exts) {\n if (!exts.hasOwnProperty(prop)) { continue }\n if (modeObj.hasOwnProperty(prop)) { modeObj[\"_\" + prop] = modeObj[prop]; }\n modeObj[prop] = exts[prop];\n }\n }\n modeObj.name = spec.name;\n if (spec.helperType) { modeObj.helperType = spec.helperType; }\n if (spec.modeProps) { for (var prop$1 in spec.modeProps)\n { modeObj[prop$1] = spec.modeProps[prop$1]; } }\n\n return modeObj\n }\n\n // This can be used to attach properties to mode objects from\n // outside the actual mode definition.\n var modeExtensions = {};\n function extendMode(mode, properties) {\n var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});\n copyObj(properties, exts);\n }\n\n function copyState(mode, state) {\n if (state === true) { return state }\n if (mode.copyState) { return mode.copyState(state) }\n var nstate = {};\n for (var n in state) {\n var val = state[n];\n if (val instanceof Array) { val = val.concat([]); }\n nstate[n] = val;\n }\n return nstate\n }\n\n // Given a mode and a state (for that mode), find the inner mode and\n // state at the position that the state refers to.\n function innerMode(mode, state) {\n var info;\n while (mode.innerMode) {\n info = mode.innerMode(state);\n if (!info || info.mode == mode) { break }\n state = info.state;\n mode = info.mode;\n }\n return info || {mode: mode, state: state}\n }\n\n function startState(mode, a1, a2) {\n return mode.startState ? mode.startState(a1, a2) : true\n }\n\n // STRING STREAM\n\n // Fed to the mode parsers, provides helper functions to make\n // parsers more succinct.\n\n var StringStream = function(string, tabSize, lineOracle) {\n this.pos = this.start = 0;\n this.string = string;\n this.tabSize = tabSize || 8;\n this.lastColumnPos = this.lastColumnValue = 0;\n this.lineStart = 0;\n this.lineOracle = lineOracle;\n };\n\n StringStream.prototype.eol = function () {return this.pos >= this.string.length};\n StringStream.prototype.sol = function () {return this.pos == this.lineStart};\n StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined};\n StringStream.prototype.next = function () {\n if (this.pos < this.string.length)\n { return this.string.charAt(this.pos++) }\n };\n StringStream.prototype.eat = function (match) {\n var ch = this.string.charAt(this.pos);\n var ok;\n if (typeof match == \"string\") { ok = ch == match; }\n else { ok = ch && (match.test ? match.test(ch) : match(ch)); }\n if (ok) {++this.pos; return ch}\n };\n StringStream.prototype.eatWhile = function (match) {\n var start = this.pos;\n while (this.eat(match)){}\n return this.pos > start\n };\n StringStream.prototype.eatSpace = function () {\n var this$1 = this;\n\n var start = this.pos;\n while (/[\\s\\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos; }\n return this.pos > start\n };\n StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;};\n StringStream.prototype.skipTo = function (ch) {\n var found = this.string.indexOf(ch, this.pos);\n if (found > -1) {this.pos = found; return true}\n };\n StringStream.prototype.backUp = function (n) {this.pos -= n;};\n StringStream.prototype.column = function () {\n if (this.lastColumnPos < this.start) {\n this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);\n this.lastColumnPos = this.start;\n }\n return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.indentation = function () {\n return countColumn(this.string, null, this.tabSize) -\n (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0)\n };\n StringStream.prototype.match = function (pattern, consume, caseInsensitive) {\n if (typeof pattern == \"string\") {\n var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; };\n var substr = this.string.substr(this.pos, pattern.length);\n if (cased(substr) == cased(pattern)) {\n if (consume !== false) { this.pos += pattern.length; }\n return true\n }\n } else {\n var match = this.string.slice(this.pos).match(pattern);\n if (match && match.index > 0) { return null }\n if (match && consume !== false) { this.pos += match[0].length; }\n return match\n }\n };\n StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)};\n StringStream.prototype.hideFirstChars = function (n, inner) {\n this.lineStart += n;\n try { return inner() }\n finally { this.lineStart -= n; }\n };\n StringStream.prototype.lookAhead = function (n) {\n var oracle = this.lineOracle;\n return oracle && oracle.lookAhead(n)\n };\n StringStream.prototype.baseToken = function () {\n var oracle = this.lineOracle;\n return oracle && oracle.baseToken(this.pos)\n };\n\n var SavedContext = function(state, lookAhead) {\n this.state = state;\n this.lookAhead = lookAhead;\n };\n\n var Context = function(doc, state, line, lookAhead) {\n this.state = state;\n this.doc = doc;\n this.line = line;\n this.maxLookAhead = lookAhead || 0;\n this.baseTokens = null;\n this.baseTokenPos = 1;\n };\n\n Context.prototype.lookAhead = function (n) {\n var line = this.doc.getLine(this.line + n);\n if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; }\n return line\n };\n\n Context.prototype.baseToken = function (n) {\n var this$1 = this;\n\n if (!this.baseTokens) { return null }\n while (this.baseTokens[this.baseTokenPos] <= n)\n { this$1.baseTokenPos += 2; }\n var type = this.baseTokens[this.baseTokenPos + 1];\n return {type: type && type.replace(/( |^)overlay .*/, \"\"),\n size: this.baseTokens[this.baseTokenPos] - n}\n };\n\n Context.prototype.nextLine = function () {\n this.line++;\n if (this.maxLookAhead > 0) { this.maxLookAhead--; }\n };\n\n Context.fromSaved = function (doc, saved, line) {\n if (saved instanceof SavedContext)\n { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }\n else\n { return new Context(doc, copyState(doc.mode, saved), line) }\n };\n\n Context.prototype.save = function (copy) {\n var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state;\n return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state\n };\n\n\n // Compute a style array (an array starting with a mode generation\n // -- for invalidation -- followed by pairs of end positions and\n // style strings), which is used to highlight the tokens on the\n // line.\n function highlightLine(cm, line, context, forceToEnd) {\n // A styles array always starts with a number identifying the\n // mode/overlays that it is based on (for easy invalidation).\n var st = [cm.state.modeGen], lineClasses = {};\n // Compute the base array of styles\n runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },\n lineClasses, forceToEnd);\n var state = context.state;\n\n // Run overlays, adjust style array.\n var loop = function ( o ) {\n context.baseTokens = st;\n var overlay = cm.state.overlays[o], i = 1, at = 0;\n context.state = true;\n runMode(cm, line.text, overlay.mode, context, function (end, style) {\n var start = i;\n // Ensure there's a token end at the current position, and that i points at it\n while (at < end) {\n var i_end = st[i];\n if (i_end > end)\n { st.splice(i, 1, end, st[i+1], i_end); }\n i += 2;\n at = Math.min(end, i_end);\n }\n if (!style) { return }\n if (overlay.opaque) {\n st.splice(start, i - start, end, \"overlay \" + style);\n i = start + 2;\n } else {\n for (; start < i; start += 2) {\n var cur = st[start+1];\n st[start+1] = (cur ? cur + \" \" : \"\") + \"overlay \" + style;\n }\n }\n }, lineClasses);\n context.state = state;\n context.baseTokens = null;\n context.baseTokenPos = 1;\n };\n\n for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );\n\n return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null}\n }\n\n function getLineStyles(cm, line, updateFrontier) {\n if (!line.styles || line.styles[0] != cm.state.modeGen) {\n var context = getContextBefore(cm, lineNo(line));\n var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state);\n var result = highlightLine(cm, line, context);\n if (resetState) { context.state = resetState; }\n line.stateAfter = context.save(!resetState);\n line.styles = result.styles;\n if (result.classes) { line.styleClasses = result.classes; }\n else if (line.styleClasses) { line.styleClasses = null; }\n if (updateFrontier === cm.doc.highlightFrontier)\n { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); }\n }\n return line.styles\n }\n\n function getContextBefore(cm, n, precise) {\n var doc = cm.doc, display = cm.display;\n if (!doc.mode.startState) { return new Context(doc, true, n) }\n var start = findStartLine(cm, n, precise);\n var saved = start > doc.first && getLine(doc, start - 1).stateAfter;\n var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start);\n\n doc.iter(start, n, function (line) {\n processLine(cm, line.text, context);\n var pos = context.line;\n line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null;\n context.nextLine();\n });\n if (precise) { doc.modeFrontier = context.line; }\n return context\n }\n\n // Lightweight form of highlight -- proceed over this line and\n // update state, but don't save a style array. Used for lines that\n // aren't currently visible.\n function processLine(cm, text, context, startAt) {\n var mode = cm.doc.mode;\n var stream = new StringStream(text, cm.options.tabSize, context);\n stream.start = stream.pos = startAt || 0;\n if (text == \"\") { callBlankLine(mode, context.state); }\n while (!stream.eol()) {\n readToken(mode, stream, context.state);\n stream.start = stream.pos;\n }\n }\n\n function callBlankLine(mode, state) {\n if (mode.blankLine) { return mode.blankLine(state) }\n if (!mode.innerMode) { return }\n var inner = innerMode(mode, state);\n if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) }\n }\n\n function readToken(mode, stream, state, inner) {\n for (var i = 0; i < 10; i++) {\n if (inner) { inner[0] = innerMode(mode, state).mode; }\n var style = mode.token(stream, state);\n if (stream.pos > stream.start) { return style }\n }\n throw new Error(\"Mode \" + mode.name + \" failed to advance stream.\")\n }\n\n var Token = function(stream, type, state) {\n this.start = stream.start; this.end = stream.pos;\n this.string = stream.current();\n this.type = type || null;\n this.state = state;\n };\n\n // Utility for getTokenAt and getLineTokens\n function takeToken(cm, pos, precise, asArray) {\n var doc = cm.doc, mode = doc.mode, style;\n pos = clipPos(doc, pos);\n var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise);\n var stream = new StringStream(line.text, cm.options.tabSize, context), tokens;\n if (asArray) { tokens = []; }\n while ((asArray || stream.pos < pos.ch) && !stream.eol()) {\n stream.start = stream.pos;\n style = readToken(mode, stream, context.state);\n if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); }\n }\n return asArray ? tokens : new Token(stream, style, context.state)\n }\n\n function extractLineClasses(type, output) {\n if (type) { for (;;) {\n var lineClass = type.match(/(?:^|\\s+)line-(background-)?(\\S+)/);\n if (!lineClass) { break }\n type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length);\n var prop = lineClass[1] ? \"bgClass\" : \"textClass\";\n if (output[prop] == null)\n { output[prop] = lineClass[2]; }\n else if (!(new RegExp(\"(?:^|\\s)\" + lineClass[2] + \"(?:$|\\s)\")).test(output[prop]))\n { output[prop] += \" \" + lineClass[2]; }\n } }\n return type\n }\n\n // Run the given mode's parser over a line, calling f for each token.\n function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {\n var flattenSpans = mode.flattenSpans;\n if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; }\n var curStart = 0, curStyle = null;\n var stream = new StringStream(text, cm.options.tabSize, context), style;\n var inner = cm.options.addModeClass && [null];\n if (text == \"\") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); }\n while (!stream.eol()) {\n if (stream.pos > cm.options.maxHighlightLength) {\n flattenSpans = false;\n if (forceToEnd) { processLine(cm, text, context, stream.pos); }\n stream.pos = text.length;\n style = null;\n } else {\n style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses);\n }\n if (inner) {\n var mName = inner[0].name;\n if (mName) { style = \"m-\" + (style ? mName + \" \" + style : mName); }\n }\n if (!flattenSpans || curStyle != style) {\n while (curStart < stream.start) {\n curStart = Math.min(stream.start, curStart + 5000);\n f(curStart, curStyle);\n }\n curStyle = style;\n }\n stream.start = stream.pos;\n }\n while (curStart < stream.pos) {\n // Webkit seems to refuse to render text nodes longer than 57444\n // characters, and returns inaccurate measurements in nodes\n // starting around 5000 chars.\n var pos = Math.min(stream.pos, curStart + 5000);\n f(pos, curStyle);\n curStart = pos;\n }\n }\n\n // Finds the line to start with when starting a parse. Tries to\n // find a line with a stateAfter, so that it can start with a\n // valid state. If that fails, it returns the line with the\n // smallest indentation, which tends to need the least context to\n // parse correctly.\n function findStartLine(cm, n, precise) {\n var minindent, minline, doc = cm.doc;\n var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100);\n for (var search = n; search > lim; --search) {\n if (search <= doc.first) { return doc.first }\n var line = getLine(doc, search - 1), after = line.stateAfter;\n if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))\n { return search }\n var indented = countColumn(line.text, null, cm.options.tabSize);\n if (minline == null || minindent > indented) {\n minline = search - 1;\n minindent = indented;\n }\n }\n return minline\n }\n\n function retreatFrontier(doc, n) {\n doc.modeFrontier = Math.min(doc.modeFrontier, n);\n if (doc.highlightFrontier < n - 10) { return }\n var start = doc.first;\n for (var line = n - 1; line > start; line--) {\n var saved = getLine(doc, line).stateAfter;\n // change is on 3\n // state on line 1 looked ahead 2 -- so saw 3\n // test 1 + 2 < 3 should cover this\n if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {\n start = line + 1;\n break\n }\n }\n doc.highlightFrontier = Math.min(doc.highlightFrontier, start);\n }\n\n // LINE DATA STRUCTURE\n\n // Line objects. These hold state related to a line, including\n // highlighting info (the styles array).\n var Line = function(text, markedSpans, estimateHeight) {\n this.text = text;\n attachMarkedSpans(this, markedSpans);\n this.height = estimateHeight ? estimateHeight(this) : 1;\n };\n\n Line.prototype.lineNo = function () { return lineNo(this) };\n eventMixin(Line);\n\n // Change the content (text, markers) of a line. Automatically\n // invalidates cached information and tries to re-estimate the\n // line's height.\n function updateLine(line, text, markedSpans, estimateHeight) {\n line.text = text;\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n if (line.order != null) { line.order = null; }\n detachMarkedSpans(line);\n attachMarkedSpans(line, markedSpans);\n var estHeight = estimateHeight ? estimateHeight(line) : 1;\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n }\n\n // Detach a line from the document tree and its markers.\n function cleanUpLine(line) {\n line.parent = null;\n detachMarkedSpans(line);\n }\n\n // Convert a style as returned by a mode (either null, or a string\n // containing one or more styles) to a CSS style. This is cached,\n // and also looks for line-wide styles.\n var styleToClassCache = {}, styleToClassCacheWithMode = {};\n function interpretTokenStyle(style, options) {\n if (!style || /^\\s*$/.test(style)) { return null }\n var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache;\n return cache[style] ||\n (cache[style] = style.replace(/\\S+/g, \"cm-$&\"))\n }\n\n // Render the DOM representation of the text of a line. Also builds\n // up a 'line map', which points at the DOM nodes that represent\n // specific stretches of text, and is used by the measuring code.\n // The returned object contains the DOM node, this map, and\n // information about line-wide styles that were set by the mode.\n function buildLineContent(cm, lineView) {\n // The padding-right forces the element to have a 'border', which\n // is needed on Webkit to be able to get line-level bounding\n // rectangles for it (in measureChar).\n var content = eltP(\"span\", null, null, webkit ? \"padding-right: .1px\" : null);\n var builder = {pre: eltP(\"pre\", [content], \"CodeMirror-line\"), content: content,\n col: 0, pos: 0, cm: cm,\n trailingSpace: false,\n splitSpaces: cm.getOption(\"lineWrapping\")};\n lineView.measure = {};\n\n // Iterate over the logical lines that make up this visual line.\n for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) {\n var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0);\n builder.pos = 0;\n builder.addToken = buildToken;\n // Optionally wire in some hacks into the token-rendering\n // algorithm, to deal with browser quirks.\n if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))\n { builder.addToken = buildTokenBadBidi(builder.addToken, order); }\n builder.map = [];\n var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line);\n insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate));\n if (line.styleClasses) {\n if (line.styleClasses.bgClass)\n { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || \"\"); }\n if (line.styleClasses.textClass)\n { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || \"\"); }\n }\n\n // Ensure at least a single node is present, for measuring.\n if (builder.map.length == 0)\n { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); }\n\n // Store the map and a cache object for the current logical line\n if (i == 0) {\n lineView.measure.map = builder.map;\n lineView.measure.cache = {};\n } else {\n (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map)\n ;(lineView.measure.caches || (lineView.measure.caches = [])).push({});\n }\n }\n\n // See issue #2901\n if (webkit) {\n var last = builder.content.lastChild;\n if (/\\bcm-tab\\b/.test(last.className) || (last.querySelector && last.querySelector(\".cm-tab\")))\n { builder.content.className = \"cm-tab-wrap-hack\"; }\n }\n\n signal(cm, \"renderLine\", cm, lineView.line, builder.pre);\n if (builder.pre.className)\n { builder.textClass = joinClasses(builder.pre.className, builder.textClass || \"\"); }\n\n return builder\n }\n\n function defaultSpecialCharPlaceholder(ch) {\n var token = elt(\"span\", \"\\u2022\", \"cm-invalidchar\");\n token.title = \"\\\\u\" + ch.charCodeAt(0).toString(16);\n token.setAttribute(\"aria-label\", token.title);\n return token\n }\n\n // Build up the DOM representation for a single token, and add it to\n // the line map. Takes care to render special characters separately.\n function buildToken(builder, text, style, startStyle, endStyle, css, attributes) {\n if (!text) { return }\n var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text;\n var special = builder.cm.state.specialChars, mustWrap = false;\n var content;\n if (!special.test(text)) {\n builder.col += text.length;\n content = document.createTextNode(displayText);\n builder.map.push(builder.pos, builder.pos + text.length, content);\n if (ie && ie_version < 9) { mustWrap = true; }\n builder.pos += text.length;\n } else {\n content = document.createDocumentFragment();\n var pos = 0;\n while (true) {\n special.lastIndex = pos;\n var m = special.exec(text);\n var skipped = m ? m.index - pos : text.length - pos;\n if (skipped) {\n var txt = document.createTextNode(displayText.slice(pos, pos + skipped));\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt])); }\n else { content.appendChild(txt); }\n builder.map.push(builder.pos, builder.pos + skipped, txt);\n builder.col += skipped;\n builder.pos += skipped;\n }\n if (!m) { break }\n pos += skipped + 1;\n var txt$1 = (void 0);\n if (m[0] == \"\\t\") {\n var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;\n txt$1 = content.appendChild(elt(\"span\", spaceStr(tabWidth), \"cm-tab\"));\n txt$1.setAttribute(\"role\", \"presentation\");\n txt$1.setAttribute(\"cm-text\", \"\\t\");\n builder.col += tabWidth;\n } else if (m[0] == \"\\r\" || m[0] == \"\\n\") {\n txt$1 = content.appendChild(elt(\"span\", m[0] == \"\\r\" ? \"\\u240d\" : \"\\u2424\", \"cm-invalidchar\"));\n txt$1.setAttribute(\"cm-text\", m[0]);\n builder.col += 1;\n } else {\n txt$1 = builder.cm.options.specialCharPlaceholder(m[0]);\n txt$1.setAttribute(\"cm-text\", m[0]);\n if (ie && ie_version < 9) { content.appendChild(elt(\"span\", [txt$1])); }\n else { content.appendChild(txt$1); }\n builder.col += 1;\n }\n builder.map.push(builder.pos, builder.pos + 1, txt$1);\n builder.pos++;\n }\n }\n builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32;\n if (style || startStyle || endStyle || mustWrap || css) {\n var fullStyle = style || \"\";\n if (startStyle) { fullStyle += startStyle; }\n if (endStyle) { fullStyle += endStyle; }\n var token = elt(\"span\", [content], fullStyle, css);\n if (attributes) {\n for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != \"style\" && attr != \"class\")\n { token.setAttribute(attr, attributes[attr]); } }\n }\n return builder.content.appendChild(token)\n }\n builder.content.appendChild(content);\n }\n\n // Change some spaces to NBSP to prevent the browser from collapsing\n // trailing spaces at the end of a line when rendering text (issue #1362).\n function splitSpaces(text, trailingBefore) {\n if (text.length > 1 && !/ /.test(text)) { return text }\n var spaceBefore = trailingBefore, result = \"\";\n for (var i = 0; i < text.length; i++) {\n var ch = text.charAt(i);\n if (ch == \" \" && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32))\n { ch = \"\\u00a0\"; }\n result += ch;\n spaceBefore = ch == \" \";\n }\n return result\n }\n\n // Work around nonsense dimensions being reported for stretches of\n // right-to-left text.\n function buildTokenBadBidi(inner, order) {\n return function (builder, text, style, startStyle, endStyle, css, attributes) {\n style = style ? style + \" cm-force-border\" : \"cm-force-border\";\n var start = builder.pos, end = start + text.length;\n for (;;) {\n // Find the part that overlaps with the start of this text\n var part = (void 0);\n for (var i = 0; i < order.length; i++) {\n part = order[i];\n if (part.to > start && part.from <= start) { break }\n }\n if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) }\n inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes);\n startStyle = null;\n text = text.slice(part.to - start);\n start = part.to;\n }\n }\n }\n\n function buildCollapsedSpan(builder, size, marker, ignoreWidget) {\n var widget = !ignoreWidget && marker.widgetNode;\n if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); }\n if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) {\n if (!widget)\n { widget = builder.content.appendChild(document.createElement(\"span\")); }\n widget.setAttribute(\"cm-marker\", marker.id);\n }\n if (widget) {\n builder.cm.display.input.setUneditable(widget);\n builder.content.appendChild(widget);\n }\n builder.pos += size;\n builder.trailingSpace = false;\n }\n\n // Outputs a number of spans to make up a line, taking highlighting\n // and marked text into account.\n function insertLineContent(line, builder, styles) {\n var spans = line.markedSpans, allText = line.text, at = 0;\n if (!spans) {\n for (var i$1 = 1; i$1 < styles.length; i$1+=2)\n { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); }\n return\n }\n\n var len = allText.length, pos = 0, i = 1, text = \"\", style, css;\n var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes;\n for (;;) {\n if (nextChange == pos) { // Update current marker set\n spanStyle = spanEndStyle = spanStartStyle = css = \"\";\n attributes = null;\n collapsed = null; nextChange = Infinity;\n var foundBookmarks = [], endStyles = (void 0);\n for (var j = 0; j < spans.length; ++j) {\n var sp = spans[j], m = sp.marker;\n if (m.type == \"bookmark\" && sp.from == pos && m.widgetNode) {\n foundBookmarks.push(m);\n } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {\n if (sp.to != null && sp.to != pos && nextChange > sp.to) {\n nextChange = sp.to;\n spanEndStyle = \"\";\n }\n if (m.className) { spanStyle += \" \" + m.className; }\n if (m.css) { css = (css ? css + \";\" : \"\") + m.css; }\n if (m.startStyle && sp.from == pos) { spanStartStyle += \" \" + m.startStyle; }\n if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); }\n // support for the old title property\n // https://github.com/codemirror/CodeMirror/pull/5673\n if (m.title) { (attributes || (attributes = {})).title = m.title; }\n if (m.attributes) {\n for (var attr in m.attributes)\n { (attributes || (attributes = {}))[attr] = m.attributes[attr]; }\n }\n if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))\n { collapsed = sp; }\n } else if (sp.from > pos && nextChange > sp.from) {\n nextChange = sp.from;\n }\n }\n if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2)\n { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += \" \" + endStyles[j$1]; } } }\n\n if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2)\n { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } }\n if (collapsed && (collapsed.from || 0) == pos) {\n buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos,\n collapsed.marker, collapsed.from == null);\n if (collapsed.to == null) { return }\n if (collapsed.to == pos) { collapsed = false; }\n }\n }\n if (pos >= len) { break }\n\n var upto = Math.min(len, nextChange);\n while (true) {\n if (text) {\n var end = pos + text.length;\n if (!collapsed) {\n var tokenText = end > upto ? text.slice(0, upto - pos) : text;\n builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,\n spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : \"\", css, attributes);\n }\n if (end >= upto) {text = text.slice(upto - pos); pos = upto; break}\n pos = end;\n spanStartStyle = \"\";\n }\n text = allText.slice(at, at = styles[i++]);\n style = interpretTokenStyle(styles[i++], builder.cm.options);\n }\n }\n }\n\n\n // These objects are used to represent the visible (currently drawn)\n // part of the document. A LineView may correspond to multiple\n // logical lines, if those are connected by collapsed ranges.\n function LineView(doc, line, lineN) {\n // The starting line\n this.line = line;\n // Continuing lines, if any\n this.rest = visualLineContinued(line);\n // Number of logical lines in this visual line\n this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1;\n this.node = this.text = null;\n this.hidden = lineIsHidden(doc, line);\n }\n\n // Create a range of LineView objects for the given lines.\n function buildViewArray(cm, from, to) {\n var array = [], nextPos;\n for (var pos = from; pos < to; pos = nextPos) {\n var view = new LineView(cm.doc, getLine(cm.doc, pos), pos);\n nextPos = pos + view.size;\n array.push(view);\n }\n return array\n }\n\n var operationGroup = null;\n\n function pushOperation(op) {\n if (operationGroup) {\n operationGroup.ops.push(op);\n } else {\n op.ownsGroup = operationGroup = {\n ops: [op],\n delayedCallbacks: []\n };\n }\n }\n\n function fireCallbacksForOps(group) {\n // Calls delayed callbacks and cursorActivity handlers until no\n // new ones appear\n var callbacks = group.delayedCallbacks, i = 0;\n do {\n for (; i < callbacks.length; i++)\n { callbacks[i].call(null); }\n for (var j = 0; j < group.ops.length; j++) {\n var op = group.ops[j];\n if (op.cursorActivityHandlers)\n { while (op.cursorActivityCalled < op.cursorActivityHandlers.length)\n { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } }\n }\n } while (i < callbacks.length)\n }\n\n function finishOperation(op, endCb) {\n var group = op.ownsGroup;\n if (!group) { return }\n\n try { fireCallbacksForOps(group); }\n finally {\n operationGroup = null;\n endCb(group);\n }\n }\n\n var orphanDelayedCallbacks = null;\n\n // Often, we want to signal events at a point where we are in the\n // middle of some work, but don't want the handler to start calling\n // other methods on the editor, which might be in an inconsistent\n // state or simply not expect any other events to happen.\n // signalLater looks whether there are any handlers, and schedules\n // them to be executed when the last operation ends, or, if no\n // operation is active, when a timeout fires.\n function signalLater(emitter, type /*, values...*/) {\n var arr = getHandlers(emitter, type);\n if (!arr.length) { return }\n var args = Array.prototype.slice.call(arguments, 2), list;\n if (operationGroup) {\n list = operationGroup.delayedCallbacks;\n } else if (orphanDelayedCallbacks) {\n list = orphanDelayedCallbacks;\n } else {\n list = orphanDelayedCallbacks = [];\n setTimeout(fireOrphanDelayed, 0);\n }\n var loop = function ( i ) {\n list.push(function () { return arr[i].apply(null, args); });\n };\n\n for (var i = 0; i < arr.length; ++i)\n loop( i );\n }\n\n function fireOrphanDelayed() {\n var delayed = orphanDelayedCallbacks;\n orphanDelayedCallbacks = null;\n for (var i = 0; i < delayed.length; ++i) { delayed[i](); }\n }\n\n // When an aspect of a line changes, a string is added to\n // lineView.changes. This updates the relevant part of the line's\n // DOM structure.\n function updateLineForChanges(cm, lineView, lineN, dims) {\n for (var j = 0; j < lineView.changes.length; j++) {\n var type = lineView.changes[j];\n if (type == \"text\") { updateLineText(cm, lineView); }\n else if (type == \"gutter\") { updateLineGutter(cm, lineView, lineN, dims); }\n else if (type == \"class\") { updateLineClasses(cm, lineView); }\n else if (type == \"widget\") { updateLineWidgets(cm, lineView, dims); }\n }\n lineView.changes = null;\n }\n\n // Lines with gutter elements, widgets or a background class need to\n // be wrapped, and have the extra elements added to the wrapper div\n function ensureLineWrapped(lineView) {\n if (lineView.node == lineView.text) {\n lineView.node = elt(\"div\", null, null, \"position: relative\");\n if (lineView.text.parentNode)\n { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); }\n lineView.node.appendChild(lineView.text);\n if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; }\n }\n return lineView.node\n }\n\n function updateLineBackground(cm, lineView) {\n var cls = lineView.bgClass ? lineView.bgClass + \" \" + (lineView.line.bgClass || \"\") : lineView.line.bgClass;\n if (cls) { cls += \" CodeMirror-linebackground\"; }\n if (lineView.background) {\n if (cls) { lineView.background.className = cls; }\n else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; }\n } else if (cls) {\n var wrap = ensureLineWrapped(lineView);\n lineView.background = wrap.insertBefore(elt(\"div\", null, cls), wrap.firstChild);\n cm.display.input.setUneditable(lineView.background);\n }\n }\n\n // Wrapper around buildLineContent which will reuse the structure\n // in display.externalMeasured when possible.\n function getLineContent(cm, lineView) {\n var ext = cm.display.externalMeasured;\n if (ext && ext.line == lineView.line) {\n cm.display.externalMeasured = null;\n lineView.measure = ext.measure;\n return ext.built\n }\n return buildLineContent(cm, lineView)\n }\n\n // Redraw the line's text. Interacts with the background and text\n // classes because the mode may output tokens that influence these\n // classes.\n function updateLineText(cm, lineView) {\n var cls = lineView.text.className;\n var built = getLineContent(cm, lineView);\n if (lineView.text == lineView.node) { lineView.node = built.pre; }\n lineView.text.parentNode.replaceChild(built.pre, lineView.text);\n lineView.text = built.pre;\n if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {\n lineView.bgClass = built.bgClass;\n lineView.textClass = built.textClass;\n updateLineClasses(cm, lineView);\n } else if (cls) {\n lineView.text.className = cls;\n }\n }\n\n function updateLineClasses(cm, lineView) {\n updateLineBackground(cm, lineView);\n if (lineView.line.wrapClass)\n { ensureLineWrapped(lineView).className = lineView.line.wrapClass; }\n else if (lineView.node != lineView.text)\n { lineView.node.className = \"\"; }\n var textClass = lineView.textClass ? lineView.textClass + \" \" + (lineView.line.textClass || \"\") : lineView.line.textClass;\n lineView.text.className = textClass || \"\";\n }\n\n function updateLineGutter(cm, lineView, lineN, dims) {\n if (lineView.gutter) {\n lineView.node.removeChild(lineView.gutter);\n lineView.gutter = null;\n }\n if (lineView.gutterBackground) {\n lineView.node.removeChild(lineView.gutterBackground);\n lineView.gutterBackground = null;\n }\n if (lineView.line.gutterClass) {\n var wrap = ensureLineWrapped(lineView);\n lineView.gutterBackground = elt(\"div\", null, \"CodeMirror-gutter-background \" + lineView.line.gutterClass,\n (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px; width: \" + (dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(lineView.gutterBackground);\n wrap.insertBefore(lineView.gutterBackground, lineView.text);\n }\n var markers = lineView.line.gutterMarkers;\n if (cm.options.lineNumbers || markers) {\n var wrap$1 = ensureLineWrapped(lineView);\n var gutterWrap = lineView.gutter = elt(\"div\", null, \"CodeMirror-gutter-wrapper\", (\"left: \" + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + \"px\"));\n cm.display.input.setUneditable(gutterWrap);\n wrap$1.insertBefore(gutterWrap, lineView.text);\n if (lineView.line.gutterClass)\n { gutterWrap.className += \" \" + lineView.line.gutterClass; }\n if (cm.options.lineNumbers && (!markers || !markers[\"CodeMirror-linenumbers\"]))\n { lineView.lineNumber = gutterWrap.appendChild(\n elt(\"div\", lineNumberFor(cm.options, lineN),\n \"CodeMirror-linenumber CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[\"CodeMirror-linenumbers\"]) + \"px; width: \" + (cm.display.lineNumInnerWidth) + \"px\"))); }\n if (markers) { for (var k = 0; k < cm.options.gutters.length; ++k) {\n var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];\n if (found)\n { gutterWrap.appendChild(elt(\"div\", [found], \"CodeMirror-gutter-elt\",\n (\"left: \" + (dims.gutterLeft[id]) + \"px; width: \" + (dims.gutterWidth[id]) + \"px\"))); }\n } }\n }\n }\n\n function updateLineWidgets(cm, lineView, dims) {\n if (lineView.alignable) { lineView.alignable = null; }\n for (var node = lineView.node.firstChild, next = (void 0); node; node = next) {\n next = node.nextSibling;\n if (node.className == \"CodeMirror-linewidget\")\n { lineView.node.removeChild(node); }\n }\n insertLineWidgets(cm, lineView, dims);\n }\n\n // Build a line's DOM representation from scratch\n function buildLineElement(cm, lineView, lineN, dims) {\n var built = getLineContent(cm, lineView);\n lineView.text = lineView.node = built.pre;\n if (built.bgClass) { lineView.bgClass = built.bgClass; }\n if (built.textClass) { lineView.textClass = built.textClass; }\n\n updateLineClasses(cm, lineView);\n updateLineGutter(cm, lineView, lineN, dims);\n insertLineWidgets(cm, lineView, dims);\n return lineView.node\n }\n\n // A lineView may contain multiple logical lines (when merged by\n // collapsed spans). The widgets for all of them need to be drawn.\n function insertLineWidgets(cm, lineView, dims) {\n insertLineWidgetsFor(cm, lineView.line, lineView, dims, true);\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } }\n }\n\n function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {\n if (!line.widgets) { return }\n var wrap = ensureLineWrapped(lineView);\n for (var i = 0, ws = line.widgets; i < ws.length; ++i) {\n var widget = ws[i], node = elt(\"div\", [widget.node], \"CodeMirror-linewidget\");\n if (!widget.handleMouseEvents) { node.setAttribute(\"cm-ignore-events\", \"true\"); }\n positionLineWidget(widget, node, lineView, dims);\n cm.display.input.setUneditable(node);\n if (allowAbove && widget.above)\n { wrap.insertBefore(node, lineView.gutter || lineView.text); }\n else\n { wrap.appendChild(node); }\n signalLater(widget, \"redraw\");\n }\n }\n\n function positionLineWidget(widget, node, lineView, dims) {\n if (widget.noHScroll) {\n (lineView.alignable || (lineView.alignable = [])).push(node);\n var width = dims.wrapperWidth;\n node.style.left = dims.fixedPos + \"px\";\n if (!widget.coverGutter) {\n width -= dims.gutterTotalWidth;\n node.style.paddingLeft = dims.gutterTotalWidth + \"px\";\n }\n node.style.width = width + \"px\";\n }\n if (widget.coverGutter) {\n node.style.zIndex = 5;\n node.style.position = \"relative\";\n if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + \"px\"; }\n }\n }\n\n function widgetHeight(widget) {\n if (widget.height != null) { return widget.height }\n var cm = widget.doc.cm;\n if (!cm) { return 0 }\n if (!contains(document.body, widget.node)) {\n var parentStyle = \"position: relative;\";\n if (widget.coverGutter)\n { parentStyle += \"margin-left: -\" + cm.display.gutters.offsetWidth + \"px;\"; }\n if (widget.noHScroll)\n { parentStyle += \"width: \" + cm.display.wrapper.clientWidth + \"px;\"; }\n removeChildrenAndAdd(cm.display.measure, elt(\"div\", [widget.node], null, parentStyle));\n }\n return widget.height = widget.node.parentNode.offsetHeight\n }\n\n // Return true when the given mouse event happened in a widget\n function eventInWidget(display, e) {\n for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {\n if (!n || (n.nodeType == 1 && n.getAttribute(\"cm-ignore-events\") == \"true\") ||\n (n.parentNode == display.sizer && n != display.mover))\n { return true }\n }\n }\n\n // POSITION MEASUREMENT\n\n function paddingTop(display) {return display.lineSpace.offsetTop}\n function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight}\n function paddingH(display) {\n if (display.cachedPaddingH) { return display.cachedPaddingH }\n var e = removeChildrenAndAdd(display.measure, elt(\"pre\", \"x\"));\n var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle;\n var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)};\n if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; }\n return data\n }\n\n function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth }\n function displayWidth(cm) {\n return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth\n }\n function displayHeight(cm) {\n return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight\n }\n\n // Ensure the lineView.wrapping.heights array is populated. This is\n // an array of bottom offsets for the lines that make up a drawn\n // line. When lineWrapping is on, there might be more than one\n // height.\n function ensureLineHeights(cm, lineView, rect) {\n var wrapping = cm.options.lineWrapping;\n var curWidth = wrapping && displayWidth(cm);\n if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) {\n var heights = lineView.measure.heights = [];\n if (wrapping) {\n lineView.measure.width = curWidth;\n var rects = lineView.text.firstChild.getClientRects();\n for (var i = 0; i < rects.length - 1; i++) {\n var cur = rects[i], next = rects[i + 1];\n if (Math.abs(cur.bottom - next.bottom) > 2)\n { heights.push((cur.bottom + next.top) / 2 - rect.top); }\n }\n }\n heights.push(rect.bottom - rect.top);\n }\n }\n\n // Find a line map (mapping character offsets to text nodes) and a\n // measurement cache for the given line number. (A line view might\n // contain multiple lines when collapsed ranges are present.)\n function mapFromLineView(lineView, line, lineN) {\n if (lineView.line == line)\n { return {map: lineView.measure.map, cache: lineView.measure.cache} }\n for (var i = 0; i < lineView.rest.length; i++)\n { if (lineView.rest[i] == line)\n { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } }\n for (var i$1 = 0; i$1 < lineView.rest.length; i$1++)\n { if (lineNo(lineView.rest[i$1]) > lineN)\n { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } }\n }\n\n // Render a line into the hidden node display.externalMeasured. Used\n // when measurement is needed for a line that's not in the viewport.\n function updateExternalMeasurement(cm, line) {\n line = visualLine(line);\n var lineN = lineNo(line);\n var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN);\n view.lineN = lineN;\n var built = view.built = buildLineContent(cm, view);\n view.text = built.pre;\n removeChildrenAndAdd(cm.display.lineMeasure, built.pre);\n return view\n }\n\n // Get a {top, bottom, left, right} box (in line-local coordinates)\n // for a given character.\n function measureChar(cm, line, ch, bias) {\n return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias)\n }\n\n // Find a line view that corresponds to the given line number.\n function findViewForLine(cm, lineN) {\n if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo)\n { return cm.display.view[findViewIndex(cm, lineN)] }\n var ext = cm.display.externalMeasured;\n if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size)\n { return ext }\n }\n\n // Measurement can be split in two steps, the set-up work that\n // applies to the whole line, and the measurement of the actual\n // character. Functions like coordsChar, that need to do a lot of\n // measurements in a row, can thus ensure that the set-up work is\n // only done once.\n function prepareMeasureForLine(cm, line) {\n var lineN = lineNo(line);\n var view = findViewForLine(cm, lineN);\n if (view && !view.text) {\n view = null;\n } else if (view && view.changes) {\n updateLineForChanges(cm, view, lineN, getDimensions(cm));\n cm.curOp.forceUpdate = true;\n }\n if (!view)\n { view = updateExternalMeasurement(cm, line); }\n\n var info = mapFromLineView(view, line, lineN);\n return {\n line: line, view: view, rect: null,\n map: info.map, cache: info.cache, before: info.before,\n hasHeights: false\n }\n }\n\n // Given a prepared measurement object, measures the position of an\n // actual character (or fetches it from the cache).\n function measureCharPrepared(cm, prepared, ch, bias, varHeight) {\n if (prepared.before) { ch = -1; }\n var key = ch + (bias || \"\"), found;\n if (prepared.cache.hasOwnProperty(key)) {\n found = prepared.cache[key];\n } else {\n if (!prepared.rect)\n { prepared.rect = prepared.view.text.getBoundingClientRect(); }\n if (!prepared.hasHeights) {\n ensureLineHeights(cm, prepared.view, prepared.rect);\n prepared.hasHeights = true;\n }\n found = measureCharInner(cm, prepared, ch, bias);\n if (!found.bogus) { prepared.cache[key] = found; }\n }\n return {left: found.left, right: found.right,\n top: varHeight ? found.rtop : found.top,\n bottom: varHeight ? found.rbottom : found.bottom}\n }\n\n var nullRect = {left: 0, right: 0, top: 0, bottom: 0};\n\n function nodeAndOffsetInLineMap(map$$1, ch, bias) {\n var node, start, end, collapse, mStart, mEnd;\n // First, search the line map for the text node corresponding to,\n // or closest to, the target character.\n for (var i = 0; i < map$$1.length; i += 3) {\n mStart = map$$1[i];\n mEnd = map$$1[i + 1];\n if (ch < mStart) {\n start = 0; end = 1;\n collapse = \"left\";\n } else if (ch < mEnd) {\n start = ch - mStart;\n end = start + 1;\n } else if (i == map$$1.length - 3 || ch == mEnd && map$$1[i + 3] > ch) {\n end = mEnd - mStart;\n start = end - 1;\n if (ch >= mEnd) { collapse = \"right\"; }\n }\n if (start != null) {\n node = map$$1[i + 2];\n if (mStart == mEnd && bias == (node.insertLeft ? \"left\" : \"right\"))\n { collapse = bias; }\n if (bias == \"left\" && start == 0)\n { while (i && map$$1[i - 2] == map$$1[i - 3] && map$$1[i - 1].insertLeft) {\n node = map$$1[(i -= 3) + 2];\n collapse = \"left\";\n } }\n if (bias == \"right\" && start == mEnd - mStart)\n { while (i < map$$1.length - 3 && map$$1[i + 3] == map$$1[i + 4] && !map$$1[i + 5].insertLeft) {\n node = map$$1[(i += 3) + 2];\n collapse = \"right\";\n } }\n break\n }\n }\n return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd}\n }\n\n function getUsefulRect(rects, bias) {\n var rect = nullRect;\n if (bias == \"left\") { for (var i = 0; i < rects.length; i++) {\n if ((rect = rects[i]).left != rect.right) { break }\n } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) {\n if ((rect = rects[i$1]).left != rect.right) { break }\n } }\n return rect\n }\n\n function measureCharInner(cm, prepared, ch, bias) {\n var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);\n var node = place.node, start = place.start, end = place.end, collapse = place.collapse;\n\n var rect;\n if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates.\n for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned\n while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; }\n while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; }\n if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart)\n { rect = node.parentNode.getBoundingClientRect(); }\n else\n { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); }\n if (rect.left || rect.right || start == 0) { break }\n end = start;\n start = start - 1;\n collapse = \"right\";\n }\n if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); }\n } else { // If it is a widget, simply get the box for the whole widget.\n if (start > 0) { collapse = bias = \"right\"; }\n var rects;\n if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1)\n { rect = rects[bias == \"right\" ? rects.length - 1 : 0]; }\n else\n { rect = node.getBoundingClientRect(); }\n }\n if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {\n var rSpan = node.parentNode.getClientRects()[0];\n if (rSpan)\n { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; }\n else\n { rect = nullRect; }\n }\n\n var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top;\n var mid = (rtop + rbot) / 2;\n var heights = prepared.view.measure.heights;\n var i = 0;\n for (; i < heights.length - 1; i++)\n { if (mid < heights[i]) { break } }\n var top = i ? heights[i - 1] : 0, bot = heights[i];\n var result = {left: (collapse == \"right\" ? rect.right : rect.left) - prepared.rect.left,\n right: (collapse == \"left\" ? rect.left : rect.right) - prepared.rect.left,\n top: top, bottom: bot};\n if (!rect.left && !rect.right) { result.bogus = true; }\n if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; }\n\n return result\n }\n\n // Work around problem with bounding client rects on ranges being\n // returned incorrectly when zoomed on IE10 and below.\n function maybeUpdateRectForZooming(measure, rect) {\n if (!window.screen || screen.logicalXDPI == null ||\n screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure))\n { return rect }\n var scaleX = screen.logicalXDPI / screen.deviceXDPI;\n var scaleY = screen.logicalYDPI / screen.deviceYDPI;\n return {left: rect.left * scaleX, right: rect.right * scaleX,\n top: rect.top * scaleY, bottom: rect.bottom * scaleY}\n }\n\n function clearLineMeasurementCacheFor(lineView) {\n if (lineView.measure) {\n lineView.measure.cache = {};\n lineView.measure.heights = null;\n if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++)\n { lineView.measure.caches[i] = {}; } }\n }\n }\n\n function clearLineMeasurementCache(cm) {\n cm.display.externalMeasure = null;\n removeChildren(cm.display.lineMeasure);\n for (var i = 0; i < cm.display.view.length; i++)\n { clearLineMeasurementCacheFor(cm.display.view[i]); }\n }\n\n function clearCaches(cm) {\n clearLineMeasurementCache(cm);\n cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null;\n if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; }\n cm.display.lineNumChars = null;\n }\n\n function pageScrollX() {\n // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206\n // which causes page_Offset and bounding client rects to use\n // different reference viewports and invalidate our calculations.\n if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }\n return window.pageXOffset || (document.documentElement || document.body).scrollLeft\n }\n function pageScrollY() {\n if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }\n return window.pageYOffset || (document.documentElement || document.body).scrollTop\n }\n\n function widgetTopHeight(lineObj) {\n var height = 0;\n if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above)\n { height += widgetHeight(lineObj.widgets[i]); } } }\n return height\n }\n\n // Converts a {top, bottom, left, right} box from line-local\n // coordinates into another coordinate system. Context may be one of\n // \"line\", \"div\" (display.lineDiv), \"local\"./null (editor), \"window\",\n // or \"page\".\n function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {\n if (!includeWidgets) {\n var height = widgetTopHeight(lineObj);\n rect.top += height; rect.bottom += height;\n }\n if (context == \"line\") { return rect }\n if (!context) { context = \"local\"; }\n var yOff = heightAtLine(lineObj);\n if (context == \"local\") { yOff += paddingTop(cm.display); }\n else { yOff -= cm.display.viewOffset; }\n if (context == \"page\" || context == \"window\") {\n var lOff = cm.display.lineSpace.getBoundingClientRect();\n yOff += lOff.top + (context == \"window\" ? 0 : pageScrollY());\n var xOff = lOff.left + (context == \"window\" ? 0 : pageScrollX());\n rect.left += xOff; rect.right += xOff;\n }\n rect.top += yOff; rect.bottom += yOff;\n return rect\n }\n\n // Coverts a box from \"div\" coords to another coordinate system.\n // Context may be \"window\", \"page\", \"div\", or \"local\"./null.\n function fromCoordSystem(cm, coords, context) {\n if (context == \"div\") { return coords }\n var left = coords.left, top = coords.top;\n // First move into \"page\" coordinate system\n if (context == \"page\") {\n left -= pageScrollX();\n top -= pageScrollY();\n } else if (context == \"local\" || !context) {\n var localBox = cm.display.sizer.getBoundingClientRect();\n left += localBox.left;\n top += localBox.top;\n }\n\n var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect();\n return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top}\n }\n\n function charCoords(cm, pos, context, lineObj, bias) {\n if (!lineObj) { lineObj = getLine(cm.doc, pos.line); }\n return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context)\n }\n\n // Returns a box for a given cursor position, which may have an\n // 'other' property containing the position of the secondary cursor\n // on a bidi boundary.\n // A cursor Pos(line, char, \"before\") is on the same visual line as `char - 1`\n // and after `char - 1` in writing order of `char - 1`\n // A cursor Pos(line, char, \"after\") is on the same visual line as `char`\n // and before `char` in writing order of `char`\n // Examples (upper-case letters are RTL, lower-case are LTR):\n // Pos(0, 1, ...)\n // before after\n // ab a|b a|b\n // aB a|B aB|\n // Ab |Ab A|b\n // AB B|A B|A\n // Every position after the last character on a line is considered to stick\n // to the last character on the line.\n function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {\n lineObj = lineObj || getLine(cm.doc, pos.line);\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n function get(ch, right) {\n var m = measureCharPrepared(cm, preparedMeasure, ch, right ? \"right\" : \"left\", varHeight);\n if (right) { m.left = m.right; } else { m.right = m.left; }\n return intoCoordSystem(cm, lineObj, m, context)\n }\n var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky;\n if (ch >= lineObj.text.length) {\n ch = lineObj.text.length;\n sticky = \"before\";\n } else if (ch <= 0) {\n ch = 0;\n sticky = \"after\";\n }\n if (!order) { return get(sticky == \"before\" ? ch - 1 : ch, sticky == \"before\") }\n\n function getBidi(ch, partPos, invert) {\n var part = order[partPos], right = part.level == 1;\n return get(invert ? ch - 1 : ch, right != invert)\n }\n var partPos = getBidiPartAt(order, ch, sticky);\n var other = bidiOther;\n var val = getBidi(ch, partPos, sticky == \"before\");\n if (other != null) { val.other = getBidi(ch, other, sticky != \"before\"); }\n return val\n }\n\n // Used to cheaply estimate the coordinates for a position. Used for\n // intermediate scroll updates.\n function estimateCoords(cm, pos) {\n var left = 0;\n pos = clipPos(cm.doc, pos);\n if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; }\n var lineObj = getLine(cm.doc, pos.line);\n var top = heightAtLine(lineObj) + paddingTop(cm.display);\n return {left: left, right: left, top: top, bottom: top + lineObj.height}\n }\n\n // Positions returned by coordsChar contain some extra information.\n // xRel is the relative x position of the input coordinates compared\n // to the found position (so xRel > 0 means the coordinates are to\n // the right of the character position, for example). When outside\n // is true, that means the coordinates lie outside the line's\n // vertical range.\n function PosWithInfo(line, ch, sticky, outside, xRel) {\n var pos = Pos(line, ch, sticky);\n pos.xRel = xRel;\n if (outside) { pos.outside = true; }\n return pos\n }\n\n // Compute the character position closest to the given coordinates.\n // Input must be lineSpace-local (\"div\" coordinate system).\n function coordsChar(cm, x, y) {\n var doc = cm.doc;\n y += cm.display.viewOffset;\n if (y < 0) { return PosWithInfo(doc.first, 0, null, true, -1) }\n var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1;\n if (lineN > last)\n { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, true, 1) }\n if (x < 0) { x = 0; }\n\n var lineObj = getLine(doc, lineN);\n for (;;) {\n var found = coordsCharInner(cm, lineObj, lineN, x, y);\n var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 ? 1 : 0));\n if (!collapsed) { return found }\n var rangeEnd = collapsed.find(1);\n if (rangeEnd.line == lineN) { return rangeEnd }\n lineObj = getLine(doc, lineN = rangeEnd.line);\n }\n }\n\n function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {\n y -= widgetTopHeight(lineObj);\n var end = lineObj.text.length;\n var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0);\n end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end);\n return {begin: begin, end: end}\n }\n\n function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {\n if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); }\n var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), \"line\").top;\n return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)\n }\n\n // Returns true if the given side of a box is after the given\n // coordinates, in top-to-bottom, left-to-right order.\n function boxIsAfter(box, x, y, left) {\n return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x\n }\n\n function coordsCharInner(cm, lineObj, lineNo$$1, x, y) {\n // Move y into line-local coordinate space\n y -= heightAtLine(lineObj);\n var preparedMeasure = prepareMeasureForLine(cm, lineObj);\n // When directly calling `measureCharPrepared`, we have to adjust\n // for the widgets at this line.\n var widgetHeight$$1 = widgetTopHeight(lineObj);\n var begin = 0, end = lineObj.text.length, ltr = true;\n\n var order = getOrder(lineObj, cm.doc.direction);\n // If the line isn't plain left-to-right text, first figure out\n // which bidi section the coordinates fall into.\n if (order) {\n var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)\n (cm, lineObj, lineNo$$1, preparedMeasure, order, x, y);\n ltr = part.level != 1;\n // The awkward -1 offsets are needed because findFirst (called\n // on these below) will treat its first bound as inclusive,\n // second as exclusive, but we want to actually address the\n // characters in the part's range\n begin = ltr ? part.from : part.to - 1;\n end = ltr ? part.to : part.from - 1;\n }\n\n // A binary search to find the first character whose bounding box\n // starts after the coordinates. If we run across any whose box wrap\n // the coordinates, store that.\n var chAround = null, boxAround = null;\n var ch = findFirst(function (ch) {\n var box = measureCharPrepared(cm, preparedMeasure, ch);\n box.top += widgetHeight$$1; box.bottom += widgetHeight$$1;\n if (!boxIsAfter(box, x, y, false)) { return false }\n if (box.top <= y && box.left <= x) {\n chAround = ch;\n boxAround = box;\n }\n return true\n }, begin, end);\n\n var baseX, sticky, outside = false;\n // If a box around the coordinates was found, use that\n if (boxAround) {\n // Distinguish coordinates nearer to the left or right side of the box\n var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr;\n ch = chAround + (atStart ? 0 : 1);\n sticky = atStart ? \"after\" : \"before\";\n baseX = atLeft ? boxAround.left : boxAround.right;\n } else {\n // (Adjust for extended bound, if necessary.)\n if (!ltr && (ch == end || ch == begin)) { ch++; }\n // To determine which side to associate with, get the box to the\n // left of the character and compare it's vertical position to the\n // coordinates\n sticky = ch == 0 ? \"after\" : ch == lineObj.text.length ? \"before\" :\n (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight$$1 <= y) == ltr ?\n \"after\" : \"before\";\n // Now get accurate coordinates for this place, in order to get a\n // base X position\n var coords = cursorCoords(cm, Pos(lineNo$$1, ch, sticky), \"line\", lineObj, preparedMeasure);\n baseX = coords.left;\n outside = y < coords.top || y >= coords.bottom;\n }\n\n ch = skipExtendingChars(lineObj.text, ch, 1);\n return PosWithInfo(lineNo$$1, ch, sticky, outside, x - baseX)\n }\n\n function coordsBidiPart(cm, lineObj, lineNo$$1, preparedMeasure, order, x, y) {\n // Bidi parts are sorted left-to-right, and in a non-line-wrapping\n // situation, we can take this ordering to correspond to the visual\n // ordering. This finds the first part whose end is after the given\n // coordinates.\n var index = findFirst(function (i) {\n var part = order[i], ltr = part.level != 1;\n return boxIsAfter(cursorCoords(cm, Pos(lineNo$$1, ltr ? part.to : part.from, ltr ? \"before\" : \"after\"),\n \"line\", lineObj, preparedMeasure), x, y, true)\n }, 0, order.length - 1);\n var part = order[index];\n // If this isn't the first part, the part's start is also after\n // the coordinates, and the coordinates aren't on the same line as\n // that start, move one part back.\n if (index > 0) {\n var ltr = part.level != 1;\n var start = cursorCoords(cm, Pos(lineNo$$1, ltr ? part.from : part.to, ltr ? \"after\" : \"before\"),\n \"line\", lineObj, preparedMeasure);\n if (boxIsAfter(start, x, y, true) && start.top > y)\n { part = order[index - 1]; }\n }\n return part\n }\n\n function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {\n // In a wrapped line, rtl text on wrapping boundaries can do things\n // that don't correspond to the ordering in our `order` array at\n // all, so a binary search doesn't work, and we want to return a\n // part that only spans one line so that the binary search in\n // coordsCharInner is safe. As such, we first find the extent of the\n // wrapped line, and then do a flat search in which we discard any\n // spans that aren't on the line.\n var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);\n var begin = ref.begin;\n var end = ref.end;\n if (/\\s/.test(lineObj.text.charAt(end - 1))) { end--; }\n var part = null, closestDist = null;\n for (var i = 0; i < order.length; i++) {\n var p = order[i];\n if (p.from >= end || p.to <= begin) { continue }\n var ltr = p.level != 1;\n var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right;\n // Weigh against spans ending before this, so that they are only\n // picked if nothing ends after\n var dist = endX < x ? x - endX + 1e9 : endX - x;\n if (!part || closestDist > dist) {\n part = p;\n closestDist = dist;\n }\n }\n if (!part) { part = order[order.length - 1]; }\n // Clip the part to the wrapped line.\n if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; }\n if (part.to > end) { part = {from: part.from, to: end, level: part.level}; }\n return part\n }\n\n var measureText;\n // Compute the default text height.\n function textHeight(display) {\n if (display.cachedTextHeight != null) { return display.cachedTextHeight }\n if (measureText == null) {\n measureText = elt(\"pre\");\n // Measure a bunch of lines, for browsers that compute\n // fractional heights.\n for (var i = 0; i < 49; ++i) {\n measureText.appendChild(document.createTextNode(\"x\"));\n measureText.appendChild(elt(\"br\"));\n }\n measureText.appendChild(document.createTextNode(\"x\"));\n }\n removeChildrenAndAdd(display.measure, measureText);\n var height = measureText.offsetHeight / 50;\n if (height > 3) { display.cachedTextHeight = height; }\n removeChildren(display.measure);\n return height || 1\n }\n\n // Compute the default character width.\n function charWidth(display) {\n if (display.cachedCharWidth != null) { return display.cachedCharWidth }\n var anchor = elt(\"span\", \"xxxxxxxxxx\");\n var pre = elt(\"pre\", [anchor]);\n removeChildrenAndAdd(display.measure, pre);\n var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10;\n if (width > 2) { display.cachedCharWidth = width; }\n return width || 10\n }\n\n // Do a bulk-read of the DOM positions and sizes needed to draw the\n // view, so that we don't interleave reading and writing to the DOM.\n function getDimensions(cm) {\n var d = cm.display, left = {}, width = {};\n var gutterLeft = d.gutters.clientLeft;\n for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {\n left[cm.options.gutters[i]] = n.offsetLeft + n.clientLeft + gutterLeft;\n width[cm.options.gutters[i]] = n.clientWidth;\n }\n return {fixedPos: compensateForHScroll(d),\n gutterTotalWidth: d.gutters.offsetWidth,\n gutterLeft: left,\n gutterWidth: width,\n wrapperWidth: d.wrapper.clientWidth}\n }\n\n // Computes display.scroller.scrollLeft + display.gutters.offsetWidth,\n // but using getBoundingClientRect to get a sub-pixel-accurate\n // result.\n function compensateForHScroll(display) {\n return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left\n }\n\n // Returns a function that estimates the height of a line, to use as\n // first approximation until the line becomes visible (and is thus\n // properly measurable).\n function estimateHeight(cm) {\n var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;\n var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);\n return function (line) {\n if (lineIsHidden(cm.doc, line)) { return 0 }\n\n var widgetsHeight = 0;\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) {\n if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; }\n } }\n\n if (wrapping)\n { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th }\n else\n { return widgetsHeight + th }\n }\n }\n\n function estimateLineHeights(cm) {\n var doc = cm.doc, est = estimateHeight(cm);\n doc.iter(function (line) {\n var estHeight = est(line);\n if (estHeight != line.height) { updateLineHeight(line, estHeight); }\n });\n }\n\n // Given a mouse event, find the corresponding position. If liberal\n // is false, it checks whether a gutter or scrollbar was clicked,\n // and returns null if it was. forRect is used by rectangular\n // selections, and tries to estimate a character position even for\n // coordinates beyond the right of the text.\n function posFromMouse(cm, e, liberal, forRect) {\n var display = cm.display;\n if (!liberal && e_target(e).getAttribute(\"cm-not-content\") == \"true\") { return null }\n\n var x, y, space = display.lineSpace.getBoundingClientRect();\n // Fails unpredictably on IE[67] when mouse is dragged around quickly.\n try { x = e.clientX - space.left; y = e.clientY - space.top; }\n catch (e) { return null }\n var coords = coordsChar(cm, x, y), line;\n if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) {\n var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length;\n coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff));\n }\n return coords\n }\n\n // Find the view element corresponding to a given line. Return null\n // when the line isn't visible.\n function findViewIndex(cm, n) {\n if (n >= cm.display.viewTo) { return null }\n n -= cm.display.viewFrom;\n if (n < 0) { return null }\n var view = cm.display.view;\n for (var i = 0; i < view.length; i++) {\n n -= view[i].size;\n if (n < 0) { return i }\n }\n }\n\n function updateSelection(cm) {\n cm.display.input.showSelection(cm.display.input.prepareSelection());\n }\n\n function prepareSelection(cm, primary) {\n if ( primary === void 0 ) primary = true;\n\n var doc = cm.doc, result = {};\n var curFragment = result.cursors = document.createDocumentFragment();\n var selFragment = result.selection = document.createDocumentFragment();\n\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n if (!primary && i == doc.sel.primIndex) { continue }\n var range$$1 = doc.sel.ranges[i];\n if (range$$1.from().line >= cm.display.viewTo || range$$1.to().line < cm.display.viewFrom) { continue }\n var collapsed = range$$1.empty();\n if (collapsed || cm.options.showCursorWhenSelecting)\n { drawSelectionCursor(cm, range$$1.head, curFragment); }\n if (!collapsed)\n { drawSelectionRange(cm, range$$1, selFragment); }\n }\n return result\n }\n\n // Draws a cursor for the given range\n function drawSelectionCursor(cm, head, output) {\n var pos = cursorCoords(cm, head, \"div\", null, null, !cm.options.singleCursorHeightPerLine);\n\n var cursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor\"));\n cursor.style.left = pos.left + \"px\";\n cursor.style.top = pos.top + \"px\";\n cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + \"px\";\n\n if (pos.other) {\n // Secondary cursor, shown when on a 'jump' in bi-directional text\n var otherCursor = output.appendChild(elt(\"div\", \"\\u00a0\", \"CodeMirror-cursor CodeMirror-secondarycursor\"));\n otherCursor.style.display = \"\";\n otherCursor.style.left = pos.other.left + \"px\";\n otherCursor.style.top = pos.other.top + \"px\";\n otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + \"px\";\n }\n }\n\n function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }\n\n // Draws the given range as a highlighted selection\n function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }\n\n // Cursor-blinking\n function restartBlink(cm) {\n if (!cm.state.focused) { return }\n var display = cm.display;\n clearInterval(display.blinker);\n var on = true;\n display.cursorDiv.style.visibility = \"\";\n if (cm.options.cursorBlinkRate > 0)\n { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? \"\" : \"hidden\"; },\n cm.options.cursorBlinkRate); }\n else if (cm.options.cursorBlinkRate < 0)\n { display.cursorDiv.style.visibility = \"hidden\"; }\n }\n\n function ensureFocus(cm) {\n if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); }\n }\n\n function delayBlurEvent(cm) {\n cm.state.delayingBlurEvent = true;\n setTimeout(function () { if (cm.state.delayingBlurEvent) {\n cm.state.delayingBlurEvent = false;\n onBlur(cm);\n } }, 100);\n }\n\n function onFocus(cm, e) {\n if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false; }\n\n if (cm.options.readOnly == \"nocursor\") { return }\n if (!cm.state.focused) {\n signal(cm, \"focus\", cm, e);\n cm.state.focused = true;\n addClass(cm.display.wrapper, \"CodeMirror-focused\");\n // This test prevents this from firing when a context\n // menu is closed (since the input reset would kill the\n // select-all detection hack)\n if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) {\n cm.display.input.reset();\n if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730\n }\n cm.display.input.receivedFocus();\n }\n restartBlink(cm);\n }\n function onBlur(cm, e) {\n if (cm.state.delayingBlurEvent) { return }\n\n if (cm.state.focused) {\n signal(cm, \"blur\", cm, e);\n cm.state.focused = false;\n rmClass(cm.display.wrapper, \"CodeMirror-focused\");\n }\n clearInterval(cm.display.blinker);\n setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150);\n }\n\n // Read the actual heights of the rendered lines, and update their\n // stored heights to match.\n function updateHeightsInViewport(cm) {\n var display = cm.display;\n var prevBottom = display.lineDiv.offsetTop;\n for (var i = 0; i < display.view.length; i++) {\n var cur = display.view[i], wrapping = cm.options.lineWrapping;\n var height = (void 0), width = 0;\n if (cur.hidden) { continue }\n if (ie && ie_version < 8) {\n var bot = cur.node.offsetTop + cur.node.offsetHeight;\n height = bot - prevBottom;\n prevBottom = bot;\n } else {\n var box = cur.node.getBoundingClientRect();\n height = box.bottom - box.top;\n // Check that lines don't extend past the right of the current\n // editor width\n if (!wrapping && cur.text.firstChild)\n { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; }\n }\n var diff = cur.line.height - height;\n if (diff > .005 || diff < -.005) {\n updateLineHeight(cur.line, height);\n updateWidgetHeight(cur.line);\n if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)\n { updateWidgetHeight(cur.rest[j]); } }\n }\n if (width > cm.display.sizerWidth) {\n var chWidth = Math.ceil(width / charWidth(cm.display));\n if (chWidth > cm.display.maxLineLength) {\n cm.display.maxLineLength = chWidth;\n cm.display.maxLine = cur.line;\n cm.display.maxLineChanged = true;\n }\n }\n }\n }\n\n // Read and store the height of line widgets associated with the\n // given line.\n function updateWidgetHeight(line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {\n var w = line.widgets[i], parent = w.node.parentNode;\n if (parent) { w.height = parent.offsetHeight; }\n } }\n }\n\n // Compute the lines that are visible in a given viewport (defaults\n // the the current scroll position). viewport may contain top,\n // height, and ensure (see op.scrollToPos) properties.\n function visibleLines(display, doc, viewport) {\n var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop;\n top = Math.floor(top - paddingTop(display));\n var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight;\n\n var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom);\n // Ensure is a {from: {line, ch}, to: {line, ch}} object, and\n // forces those lines into the viewport (if possible).\n if (viewport && viewport.ensure) {\n var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line;\n if (ensureFrom < from) {\n from = ensureFrom;\n to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight);\n } else if (Math.min(ensureTo, doc.lastLine()) >= to) {\n from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight);\n to = ensureTo;\n }\n }\n return {from: from, to: Math.max(to, from + 1)}\n }\n\n // Re-align line numbers and gutter marks to compensate for\n // horizontal scrolling.\n function alignHorizontally(cm) {\n var display = cm.display, view = display.view;\n if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }\n var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;\n var gutterW = display.gutters.offsetWidth, left = comp + \"px\";\n for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {\n if (cm.options.fixedGutter) {\n if (view[i].gutter)\n { view[i].gutter.style.left = left; }\n if (view[i].gutterBackground)\n { view[i].gutterBackground.style.left = left; }\n }\n var align = view[i].alignable;\n if (align) { for (var j = 0; j < align.length; j++)\n { align[j].style.left = left; } }\n } }\n if (cm.options.fixedGutter)\n { display.gutters.style.left = (comp + gutterW) + \"px\"; }\n }\n\n // Used to ensure that the line number gutter is still the right\n // size for the current document size. Returns true when an update\n // is needed.\n function maybeUpdateLineNumberWidth(cm) {\n if (!cm.options.lineNumbers) { return false }\n var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;\n if (last.length != display.lineNumChars) {\n var test = display.measure.appendChild(elt(\"div\", [elt(\"div\", last)],\n \"CodeMirror-linenumber CodeMirror-gutter-elt\"));\n var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;\n display.lineGutter.style.width = \"\";\n display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1;\n display.lineNumWidth = display.lineNumInnerWidth + padding;\n display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;\n display.lineGutter.style.width = display.lineNumWidth + \"px\";\n updateGutterSpace(cm);\n return true\n }\n return false\n }\n\n // SCROLLING THINGS INTO VIEW\n\n // If an editor sits on the top or bottom of the window, partially\n // scrolled out of view, this ensures that the cursor is visible.\n function maybeScrollWindow(cm, rect) {\n if (signalDOMEvent(cm, \"scrollCursorIntoView\")) { return }\n\n var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null;\n if (rect.top + box.top < 0) { doScroll = true; }\n else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; }\n if (doScroll != null && !phantom) {\n var scrollNode = elt(\"div\", \"\\u200b\", null, (\"position: absolute;\\n top: \" + (rect.top - display.viewOffset - paddingTop(cm.display)) + \"px;\\n height: \" + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + \"px;\\n left: \" + (rect.left) + \"px; width: \" + (Math.max(2, rect.right - rect.left)) + \"px;\"));\n cm.display.lineSpace.appendChild(scrollNode);\n scrollNode.scrollIntoView(doScroll);\n cm.display.lineSpace.removeChild(scrollNode);\n }\n }\n\n // Scroll a given position into view (immediately), verifying that\n // it actually became visible (as line heights are accurately\n // measured, the position of something may 'drift' during drawing).\n function scrollPosIntoView(cm, pos, end, margin) {\n if (margin == null) { margin = 0; }\n var rect;\n if (!cm.options.lineWrapping && pos == end) {\n // Set pos and end to the cursor positions around the character pos sticks to\n // If pos.sticky == \"before\", that is around pos.ch - 1, otherwise around pos.ch\n // If pos == Pos(_, 0, \"before\"), pos and end are unchanged\n pos = pos.ch ? Pos(pos.line, pos.sticky == \"before\" ? pos.ch - 1 : pos.ch, \"after\") : pos;\n end = pos.sticky == \"before\" ? Pos(pos.line, pos.ch + 1, \"before\") : pos;\n }\n for (var limit = 0; limit < 5; limit++) {\n var changed = false;\n var coords = cursorCoords(cm, pos);\n var endCoords = !end || end == pos ? coords : cursorCoords(cm, end);\n rect = {left: Math.min(coords.left, endCoords.left),\n top: Math.min(coords.top, endCoords.top) - margin,\n right: Math.max(coords.left, endCoords.left),\n bottom: Math.max(coords.bottom, endCoords.bottom) + margin};\n var scrollPos = calculateScrollPos(cm, rect);\n var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;\n if (scrollPos.scrollTop != null) {\n updateScrollTop(cm, scrollPos.scrollTop);\n if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; }\n }\n if (scrollPos.scrollLeft != null) {\n setScrollLeft(cm, scrollPos.scrollLeft);\n if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; }\n }\n if (!changed) { break }\n }\n return rect\n }\n\n // Scroll a given set of coordinates into view (immediately).\n function scrollIntoView(cm, rect) {\n var scrollPos = calculateScrollPos(cm, rect);\n if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); }\n if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); }\n }\n\n // Calculate a new scroll position needed to scroll the given\n // rectangle into view. Returns an object with scrollTop and\n // scrollLeft properties. When these are undefined, the\n // vertical/horizontal position does not need to be adjusted.\n function calculateScrollPos(cm, rect) {\n var display = cm.display, snapMargin = textHeight(cm.display);\n if (rect.top < 0) { rect.top = 0; }\n var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;\n var screen = displayHeight(cm), result = {};\n if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; }\n var docBottom = cm.doc.height + paddingVert(display);\n var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin;\n if (rect.top < screentop) {\n result.scrollTop = atTop ? 0 : rect.top;\n } else if (rect.bottom > screentop + screen) {\n var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen);\n if (newTop != screentop) { result.scrollTop = newTop; }\n }\n\n var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;\n var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0);\n var tooWide = rect.right - rect.left > screenw;\n if (tooWide) { rect.right = rect.left + screenw; }\n if (rect.left < 10)\n { result.scrollLeft = 0; }\n else if (rect.left < screenleft)\n { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); }\n else if (rect.right > screenw + screenleft - 3)\n { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; }\n return result\n }\n\n // Store a relative adjustment to the scroll position in the current\n // operation (to be applied when the operation finishes).\n function addToScrollTop(cm, top) {\n if (top == null) { return }\n resolveScrollToPos(cm);\n cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;\n }\n\n // Make sure that at the end of the operation the current cursor is\n // shown.\n function ensureCursorVisible(cm) {\n resolveScrollToPos(cm);\n var cur = cm.getCursor();\n cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin};\n }\n\n function scrollToCoords(cm, x, y) {\n if (x != null || y != null) { resolveScrollToPos(cm); }\n if (x != null) { cm.curOp.scrollLeft = x; }\n if (y != null) { cm.curOp.scrollTop = y; }\n }\n\n function scrollToRange(cm, range$$1) {\n resolveScrollToPos(cm);\n cm.curOp.scrollToPos = range$$1;\n }\n\n // When an operation has its scrollToPos property set, and another\n // scroll action is applied before the end of the operation, this\n // 'simulates' scrolling that position into view in a cheap way, so\n // that the effect of intermediate scroll commands is not ignored.\n function resolveScrollToPos(cm) {\n var range$$1 = cm.curOp.scrollToPos;\n if (range$$1) {\n cm.curOp.scrollToPos = null;\n var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to);\n scrollToCoordsRange(cm, from, to, range$$1.margin);\n }\n }\n\n function scrollToCoordsRange(cm, from, to, margin) {\n var sPos = calculateScrollPos(cm, {\n left: Math.min(from.left, to.left),\n top: Math.min(from.top, to.top) - margin,\n right: Math.max(from.right, to.right),\n bottom: Math.max(from.bottom, to.bottom) + margin\n });\n scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop);\n }\n\n // Sync the scrollable area and scrollbars, ensure the viewport\n // covers the visible area.\n function updateScrollTop(cm, val) {\n if (Math.abs(cm.doc.scrollTop - val) < 2) { return }\n if (!gecko) { updateDisplaySimple(cm, {top: val}); }\n setScrollTop(cm, val, true);\n if (gecko) { updateDisplaySimple(cm); }\n startWorker(cm, 100);\n }\n\n function setScrollTop(cm, val, forceScroll) {\n val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val);\n if (cm.display.scroller.scrollTop == val && !forceScroll) { return }\n cm.doc.scrollTop = val;\n cm.display.scrollbars.setScrollTop(val);\n if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; }\n }\n\n // Sync scroller and scrollbar, ensure the gutter elements are\n // aligned.\n function setScrollLeft(cm, val, isScroller, forceScroll) {\n val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);\n if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }\n cm.doc.scrollLeft = val;\n alignHorizontally(cm);\n if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; }\n cm.display.scrollbars.setScrollLeft(val);\n }\n\n // SCROLLBARS\n\n // Prepare DOM reads needed to update the scrollbars. Done in one\n // shot to minimize update/measure roundtrips.\n function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }\n\n var NativeScrollbars = function(place, scroll, cm) {\n this.cm = cm;\n var vert = this.vert = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n var horiz = this.horiz = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n vert.tabIndex = horiz.tabIndex = -1;\n place(vert); place(horiz);\n\n on(vert, \"scroll\", function () {\n if (vert.clientHeight) { scroll(vert.scrollTop, \"vertical\"); }\n });\n on(horiz, \"scroll\", function () {\n if (horiz.clientWidth) { scroll(horiz.scrollLeft, \"horizontal\"); }\n });\n\n this.checkedZeroWidth = false;\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = \"18px\"; }\n };\n\n NativeScrollbars.prototype.update = function (measure) {\n var needsH = measure.scrollWidth > measure.clientWidth + 1;\n var needsV = measure.scrollHeight > measure.clientHeight + 1;\n var sWidth = measure.nativeBarWidth;\n\n if (needsV) {\n this.vert.style.display = \"block\";\n this.vert.style.bottom = needsH ? sWidth + \"px\" : \"0\";\n var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);\n // A bug in IE8 can cause this value to be negative, so guard it.\n this.vert.firstChild.style.height =\n Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + \"px\";\n } else {\n this.vert.style.display = \"\";\n this.vert.firstChild.style.height = \"0\";\n }\n\n if (needsH) {\n this.horiz.style.display = \"block\";\n this.horiz.style.right = needsV ? sWidth + \"px\" : \"0\";\n this.horiz.style.left = measure.barLeft + \"px\";\n var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);\n this.horiz.firstChild.style.width =\n Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + \"px\";\n } else {\n this.horiz.style.display = \"\";\n this.horiz.firstChild.style.width = \"0\";\n }\n\n if (!this.checkedZeroWidth && measure.clientHeight > 0) {\n if (sWidth == 0) { this.zeroWidthHack(); }\n this.checkedZeroWidth = true;\n }\n\n return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0}\n };\n\n NativeScrollbars.prototype.setScrollLeft = function (pos) {\n if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; }\n if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, \"horiz\"); }\n };\n\n NativeScrollbars.prototype.setScrollTop = function (pos) {\n if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; }\n if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, \"vert\"); }\n };\n\n NativeScrollbars.prototype.zeroWidthHack = function () {\n var w = mac && !mac_geMountainLion ? \"12px\" : \"18px\";\n this.horiz.style.height = this.vert.style.width = w;\n this.horiz.style.pointerEvents = this.vert.style.pointerEvents = \"none\";\n this.disableHoriz = new Delayed;\n this.disableVert = new Delayed;\n };\n\n NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {\n bar.style.pointerEvents = \"auto\";\n function maybeDisable() {\n // To find out whether the scrollbar is still visible, we\n // check whether the element under the pixel in the bottom\n // right corner of the scrollbar box is the scrollbar box\n // itself (when the bar is still visible) or its filler child\n // (when the bar is hidden). If it is still visible, we keep\n // it enabled, if it's hidden, we disable pointer events.\n var box = bar.getBoundingClientRect();\n var elt$$1 = type == \"vert\" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)\n : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1);\n if (elt$$1 != bar) { bar.style.pointerEvents = \"none\"; }\n else { delay.set(1000, maybeDisable); }\n }\n delay.set(1000, maybeDisable);\n };\n\n NativeScrollbars.prototype.clear = function () {\n var parent = this.horiz.parentNode;\n parent.removeChild(this.horiz);\n parent.removeChild(this.vert);\n };\n\n var NullScrollbars = function () {};\n\n NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} };\n NullScrollbars.prototype.setScrollLeft = function () {};\n NullScrollbars.prototype.setScrollTop = function () {};\n NullScrollbars.prototype.clear = function () {};\n\n function updateScrollbars(cm, measure) {\n if (!measure) { measure = measureForScrollbars(cm); }\n var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight;\n updateScrollbarsInner(cm, measure);\n for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) {\n if (startWidth != cm.display.barWidth && cm.options.lineWrapping)\n { updateHeightsInViewport(cm); }\n updateScrollbarsInner(cm, measureForScrollbars(cm));\n startWidth = cm.display.barWidth; startHeight = cm.display.barHeight;\n }\n }\n\n // Re-synchronize the fake scrollbars with the actual size of the\n // content.\n function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }\n\n var scrollbarModel = {\"native\": NativeScrollbars, \"null\": NullScrollbars};\n\n function initScrollbars(cm) {\n if (cm.display.scrollbars) {\n cm.display.scrollbars.clear();\n if (cm.display.scrollbars.addClass)\n { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) {\n cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller);\n // Prevent clicks in the scrollbars from killing focus\n on(node, \"mousedown\", function () {\n if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); }\n });\n node.setAttribute(\"cm-not-content\", \"true\");\n }, function (pos, axis) {\n if (axis == \"horizontal\") { setScrollLeft(cm, pos); }\n else { updateScrollTop(cm, pos); }\n }, cm);\n if (cm.display.scrollbars.addClass)\n { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); }\n }\n\n // Operations are used to wrap a series of changes to the editor\n // state in such a way that each change won't have to update the\n // cursor and display (which would be awkward, slow, and\n // error-prone). Instead, display updates are batched and then all\n // combined and executed at once.\n\n var nextOpId = 0;\n // Start a new operation.\n function startOperation(cm) {\n cm.curOp = {\n cm: cm,\n viewChanged: false, // Flag that indicates that lines might need to be redrawn\n startHeight: cm.doc.height, // Used to detect need to update scrollbar\n forceUpdate: false, // Used to force a redraw\n updateInput: 0, // Whether to reset the input textarea\n typing: false, // Whether this reset should be careful to leave existing text (for compositing)\n changeObjs: null, // Accumulated changes, for firing change events\n cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on\n cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already\n selectionChanged: false, // Whether the selection needs to be redrawn\n updateMaxLine: false, // Set when the widest line needs to be determined anew\n scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet\n scrollToPos: null, // Used to scroll to a specific position\n focus: false,\n id: ++nextOpId // Unique ID\n };\n pushOperation(cm.curOp);\n }\n\n // Finish an operation, updating the display and signalling delayed events\n function endOperation(cm) {\n var op = cm.curOp;\n if (op) { finishOperation(op, function (group) {\n for (var i = 0; i < group.ops.length; i++)\n { group.ops[i].cm.curOp = null; }\n endOperations(group);\n }); }\n }\n\n // The DOM updates done when an operation finishes are batched so\n // that the minimum number of relayouts are required.\n function endOperations(group) {\n var ops = group.ops;\n for (var i = 0; i < ops.length; i++) // Read DOM\n { endOperation_R1(ops[i]); }\n for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe)\n { endOperation_W1(ops[i$1]); }\n for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM\n { endOperation_R2(ops[i$2]); }\n for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe)\n { endOperation_W2(ops[i$3]); }\n for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM\n { endOperation_finish(ops[i$4]); }\n }\n\n function endOperation_R1(op) {\n var cm = op.cm, display = cm.display;\n maybeClipScrollbars(cm);\n if (op.updateMaxLine) { findMaxLine(cm); }\n\n op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null ||\n op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom ||\n op.scrollToPos.to.line >= display.viewTo) ||\n display.maxLineChanged && cm.options.lineWrapping;\n op.update = op.mustUpdate &&\n new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate);\n }\n\n function endOperation_W1(op) {\n op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update);\n }\n\n function endOperation_R2(op) {\n var cm = op.cm, display = cm.display;\n if (op.updatedDisplay) { updateHeightsInViewport(cm); }\n\n op.barMeasure = measureForScrollbars(cm);\n\n // If the max line changed since it was last measured, measure it,\n // and ensure the document's width matches it.\n // updateDisplay_W2 will use these properties to do the actual resizing\n if (display.maxLineChanged && !cm.options.lineWrapping) {\n op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3;\n cm.display.sizerWidth = op.adjustWidthTo;\n op.barMeasure.scrollWidth =\n Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth);\n op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm));\n }\n\n if (op.updatedDisplay || op.selectionChanged)\n { op.preparedSelection = display.input.prepareSelection(); }\n }\n\n function endOperation_W2(op) {\n var cm = op.cm;\n\n if (op.adjustWidthTo != null) {\n cm.display.sizer.style.minWidth = op.adjustWidthTo + \"px\";\n if (op.maxScrollLeft < cm.doc.scrollLeft)\n { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); }\n cm.display.maxLineChanged = false;\n }\n\n var takeFocus = op.focus && op.focus == activeElt();\n if (op.preparedSelection)\n { cm.display.input.showSelection(op.preparedSelection, takeFocus); }\n if (op.updatedDisplay || op.startHeight != cm.doc.height)\n { updateScrollbars(cm, op.barMeasure); }\n if (op.updatedDisplay)\n { setDocumentHeight(cm, op.barMeasure); }\n\n if (op.selectionChanged) { restartBlink(cm); }\n\n if (cm.state.focused && op.updateInput)\n { cm.display.input.reset(op.typing); }\n if (takeFocus) { ensureFocus(op.cm); }\n }\n\n function endOperation_finish(op) {\n var cm = op.cm, display = cm.display, doc = cm.doc;\n\n if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); }\n\n // Abort mouse wheel delta measurement, when scrolling explicitly\n if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos))\n { display.wheelStartX = display.wheelStartY = null; }\n\n // Propagate the scroll position to the actual DOM scroller\n if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); }\n\n if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); }\n // If we need to scroll a specific position into view, do so.\n if (op.scrollToPos) {\n var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),\n clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin);\n maybeScrollWindow(cm, rect);\n }\n\n // Fire events for markers that are hidden/unidden by editing or\n // undoing\n var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;\n if (hidden) { for (var i = 0; i < hidden.length; ++i)\n { if (!hidden[i].lines.length) { signal(hidden[i], \"hide\"); } } }\n if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1)\n { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], \"unhide\"); } } }\n\n if (display.wrapper.offsetHeight)\n { doc.scrollTop = cm.display.scroller.scrollTop; }\n\n // Fire change events, and delayed event handlers\n if (op.changeObjs)\n { signal(cm, \"changes\", cm, op.changeObjs); }\n if (op.update)\n { op.update.finish(); }\n }\n\n // Run the given function in an operation\n function runInOp(cm, f) {\n if (cm.curOp) { return f() }\n startOperation(cm);\n try { return f() }\n finally { endOperation(cm); }\n }\n // Wraps a function in an operation. Returns the wrapped function.\n function operation(cm, f) {\n return function() {\n if (cm.curOp) { return f.apply(cm, arguments) }\n startOperation(cm);\n try { return f.apply(cm, arguments) }\n finally { endOperation(cm); }\n }\n }\n // Used to add methods to editor and doc instances, wrapping them in\n // operations.\n function methodOp(f) {\n return function() {\n if (this.curOp) { return f.apply(this, arguments) }\n startOperation(this);\n try { return f.apply(this, arguments) }\n finally { endOperation(this); }\n }\n }\n function docMethodOp(f) {\n return function() {\n var cm = this.cm;\n if (!cm || cm.curOp) { return f.apply(this, arguments) }\n startOperation(cm);\n try { return f.apply(this, arguments) }\n finally { endOperation(cm); }\n }\n }\n\n // Updates the display.view data structure for a given change to the\n // document. From and to are in pre-change coordinates. Lendiff is\n // the amount of lines added or subtracted by the change. This is\n // used for changes that span multiple lines, or change the way\n // lines are divided into visual lines. regLineChange (below)\n // registers single-line changes.\n function regChange(cm, from, to, lendiff) {\n if (from == null) { from = cm.doc.first; }\n if (to == null) { to = cm.doc.first + cm.doc.size; }\n if (!lendiff) { lendiff = 0; }\n\n var display = cm.display;\n if (lendiff && to < display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers > from))\n { display.updateLineNumbers = from; }\n\n cm.curOp.viewChanged = true;\n\n if (from >= display.viewTo) { // Change after\n if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo)\n { resetView(cm); }\n } else if (to <= display.viewFrom) { // Change before\n if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) {\n resetView(cm);\n } else {\n display.viewFrom += lendiff;\n display.viewTo += lendiff;\n }\n } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap\n resetView(cm);\n } else if (from <= display.viewFrom) { // Top overlap\n var cut = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cut) {\n display.view = display.view.slice(cut.index);\n display.viewFrom = cut.lineN;\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n } else if (to >= display.viewTo) { // Bottom overlap\n var cut$1 = viewCuttingPoint(cm, from, from, -1);\n if (cut$1) {\n display.view = display.view.slice(0, cut$1.index);\n display.viewTo = cut$1.lineN;\n } else {\n resetView(cm);\n }\n } else { // Gap in the middle\n var cutTop = viewCuttingPoint(cm, from, from, -1);\n var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1);\n if (cutTop && cutBot) {\n display.view = display.view.slice(0, cutTop.index)\n .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))\n .concat(display.view.slice(cutBot.index));\n display.viewTo += lendiff;\n } else {\n resetView(cm);\n }\n }\n\n var ext = display.externalMeasured;\n if (ext) {\n if (to < ext.lineN)\n { ext.lineN += lendiff; }\n else if (from < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n }\n }\n\n // Register a change to a single line. Type must be one of \"text\",\n // \"gutter\", \"class\", \"widget\"\n function regLineChange(cm, line, type) {\n cm.curOp.viewChanged = true;\n var display = cm.display, ext = cm.display.externalMeasured;\n if (ext && line >= ext.lineN && line < ext.lineN + ext.size)\n { display.externalMeasured = null; }\n\n if (line < display.viewFrom || line >= display.viewTo) { return }\n var lineView = display.view[findViewIndex(cm, line)];\n if (lineView.node == null) { return }\n var arr = lineView.changes || (lineView.changes = []);\n if (indexOf(arr, type) == -1) { arr.push(type); }\n }\n\n // Clear the view.\n function resetView(cm) {\n cm.display.viewFrom = cm.display.viewTo = cm.doc.first;\n cm.display.view = [];\n cm.display.viewOffset = 0;\n }\n\n function viewCuttingPoint(cm, oldN, newN, dir) {\n var index = findViewIndex(cm, oldN), diff, view = cm.display.view;\n if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size)\n { return {index: index, lineN: newN} }\n var n = cm.display.viewFrom;\n for (var i = 0; i < index; i++)\n { n += view[i].size; }\n if (n != oldN) {\n if (dir > 0) {\n if (index == view.length - 1) { return null }\n diff = (n + view[index].size) - oldN;\n index++;\n } else {\n diff = n - oldN;\n }\n oldN += diff; newN += diff;\n }\n while (visualLineNo(cm.doc, newN) != newN) {\n if (index == (dir < 0 ? 0 : view.length - 1)) { return null }\n newN += dir * view[index - (dir < 0 ? 1 : 0)].size;\n index += dir;\n }\n return {index: index, lineN: newN}\n }\n\n // Force the view to cover a given range, adding empty view element\n // or clipping off existing ones as needed.\n function adjustView(cm, from, to) {\n var display = cm.display, view = display.view;\n if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) {\n display.view = buildViewArray(cm, from, to);\n display.viewFrom = from;\n } else {\n if (display.viewFrom > from)\n { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); }\n else if (display.viewFrom < from)\n { display.view = display.view.slice(findViewIndex(cm, from)); }\n display.viewFrom = from;\n if (display.viewTo < to)\n { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); }\n else if (display.viewTo > to)\n { display.view = display.view.slice(0, findViewIndex(cm, to)); }\n }\n display.viewTo = to;\n }\n\n // Count the number of lines in the view whose DOM representation is\n // out of date (or nonexistent).\n function countDirtyView(cm) {\n var view = cm.display.view, dirty = 0;\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; }\n }\n return dirty\n }\n\n // HIGHLIGHT WORKER\n\n function startWorker(cm, time) {\n if (cm.doc.highlightFrontier < cm.display.viewTo)\n { cm.state.highlight.set(time, bind(highlightWorker, cm)); }\n }\n\n function highlightWorker(cm) {\n var doc = cm.doc;\n if (doc.highlightFrontier >= cm.display.viewTo) { return }\n var end = +new Date + cm.options.workTime;\n var context = getContextBefore(cm, doc.highlightFrontier);\n var changedLines = [];\n\n doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {\n if (context.line >= cm.display.viewFrom) { // Visible\n var oldStyles = line.styles;\n var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null;\n var highlighted = highlightLine(cm, line, context, true);\n if (resetState) { context.state = resetState; }\n line.styles = highlighted.styles;\n var oldCls = line.styleClasses, newCls = highlighted.classes;\n if (newCls) { line.styleClasses = newCls; }\n else if (oldCls) { line.styleClasses = null; }\n var ischange = !oldStyles || oldStyles.length != line.styles.length ||\n oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass);\n for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; }\n if (ischange) { changedLines.push(context.line); }\n line.stateAfter = context.save();\n context.nextLine();\n } else {\n if (line.text.length <= cm.options.maxHighlightLength)\n { processLine(cm, line.text, context); }\n line.stateAfter = context.line % 5 == 0 ? context.save() : null;\n context.nextLine();\n }\n if (+new Date > end) {\n startWorker(cm, cm.options.workDelay);\n return true\n }\n });\n doc.highlightFrontier = context.line;\n doc.modeFrontier = Math.max(doc.modeFrontier, context.line);\n if (changedLines.length) { runInOp(cm, function () {\n for (var i = 0; i < changedLines.length; i++)\n { regLineChange(cm, changedLines[i], \"text\"); }\n }); }\n }\n\n // DISPLAY DRAWING\n\n var DisplayUpdate = function(cm, viewport, force) {\n var display = cm.display;\n\n this.viewport = viewport;\n // Store some values that we'll need later (but don't want to force a relayout for)\n this.visible = visibleLines(display, cm.doc, viewport);\n this.editorIsHidden = !display.wrapper.offsetWidth;\n this.wrapperHeight = display.wrapper.clientHeight;\n this.wrapperWidth = display.wrapper.clientWidth;\n this.oldDisplayWidth = displayWidth(cm);\n this.force = force;\n this.dims = getDimensions(cm);\n this.events = [];\n };\n\n DisplayUpdate.prototype.signal = function (emitter, type) {\n if (hasHandler(emitter, type))\n { this.events.push(arguments); }\n };\n DisplayUpdate.prototype.finish = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.events.length; i++)\n { signal.apply(null, this$1.events[i]); }\n };\n\n function maybeClipScrollbars(cm) {\n var display = cm.display;\n if (!display.scrollbarsClipped && display.scroller.offsetWidth) {\n display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth;\n display.heightForcer.style.height = scrollGap(cm) + \"px\";\n display.sizer.style.marginBottom = -display.nativeBarWidth + \"px\";\n display.sizer.style.borderRightWidth = scrollGap(cm) + \"px\";\n display.scrollbarsClipped = true;\n }\n }\n\n function selectionSnapshot(cm) {\n if (cm.hasFocus()) { return null }\n var active = activeElt();\n if (!active || !contains(cm.display.lineDiv, active)) { return null }\n var result = {activeElt: active};\n if (window.getSelection) {\n var sel = window.getSelection();\n if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {\n result.anchorNode = sel.anchorNode;\n result.anchorOffset = sel.anchorOffset;\n result.focusNode = sel.focusNode;\n result.focusOffset = sel.focusOffset;\n }\n }\n return result\n }\n\n function restoreSelection(snapshot) {\n if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }\n snapshot.activeElt.focus();\n if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {\n var sel = window.getSelection(), range$$1 = document.createRange();\n range$$1.setEnd(snapshot.anchorNode, snapshot.anchorOffset);\n range$$1.collapse(false);\n sel.removeAllRanges();\n sel.addRange(range$$1);\n sel.extend(snapshot.focusNode, snapshot.focusOffset);\n }\n }\n\n // Does the actual updating of the line display. Bails out\n // (returning false) when there is nothing to be done and forced is\n // false.\n function updateDisplayIfNeeded(cm, update) {\n var display = cm.display, doc = cm.doc;\n\n if (update.editorIsHidden) {\n resetView(cm);\n return false\n }\n\n // Bail out if the visible area is already rendered and nothing changed.\n if (!update.force &&\n update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n display.renderedView == display.view && countDirtyView(cm) == 0)\n { return false }\n\n if (maybeUpdateLineNumberWidth(cm)) {\n resetView(cm);\n update.dims = getDimensions(cm);\n }\n\n // Compute a suitable new viewport (from & to)\n var end = doc.first + doc.size;\n var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n if (sawCollapsedSpans) {\n from = visualLineNo(cm.doc, from);\n to = visualLineEndNo(cm.doc, to);\n }\n\n var different = from != display.viewFrom || to != display.viewTo ||\n display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n adjustView(cm, from, to);\n\n display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n // Position the mover div to align with the current scroll position\n cm.display.mover.style.top = display.viewOffset + \"px\";\n\n var toUpdate = countDirtyView(cm);\n if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n { return false }\n\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var selSnapshot = selectionSnapshot(cm);\n if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n patchDisplay(cm, display.updateLineNumbers, update.dims);\n if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n display.renderedView = display.view;\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n restoreSelection(selSnapshot);\n\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n removeChildren(display.cursorDiv);\n removeChildren(display.selectionDiv);\n display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n if (different) {\n display.lastWrapHeight = update.wrapperHeight;\n display.lastWrapWidth = update.wrapperWidth;\n startWorker(cm, 400);\n }\n\n display.updateLineNumbers = null;\n\n return true\n }\n\n function postUpdateDisplay(cm, update) {\n var viewport = update.viewport;\n\n for (var first = true;; first = false) {\n if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) {\n // Clip forced viewport to actual scrollable area.\n if (viewport && viewport.top != null)\n { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; }\n // Updated line heights might result in the drawn area not\n // actually covering the viewport. Keep looping until it does.\n update.visible = visibleLines(cm.display, cm.doc, viewport);\n if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo)\n { break }\n }\n if (!updateDisplayIfNeeded(cm, update)) { break }\n updateHeightsInViewport(cm);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.force = false;\n }\n\n update.signal(cm, \"update\", cm);\n if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) {\n update.signal(cm, \"viewportChange\", cm, cm.display.viewFrom, cm.display.viewTo);\n cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo;\n }\n }\n\n function updateDisplaySimple(cm, viewport) {\n var update = new DisplayUpdate(cm, viewport);\n if (updateDisplayIfNeeded(cm, update)) {\n updateHeightsInViewport(cm);\n postUpdateDisplay(cm, update);\n var barMeasure = measureForScrollbars(cm);\n updateSelection(cm);\n updateScrollbars(cm, barMeasure);\n setDocumentHeight(cm, barMeasure);\n update.finish();\n }\n }\n\n // Sync the actual display DOM structure with display.view, removing\n // nodes for lines that are no longer in view, and creating the ones\n // that are not there yet, and updating the ones that are out of\n // date.\n function patchDisplay(cm, updateNumbersFrom, dims) {\n var display = cm.display, lineNumbers = cm.options.lineNumbers;\n var container = display.lineDiv, cur = container.firstChild;\n\n function rm(node) {\n var next = node.nextSibling;\n // Works around a throw-scroll bug in OS X Webkit\n if (webkit && mac && cm.display.currentWheelTarget == node)\n { node.style.display = \"none\"; }\n else\n { node.parentNode.removeChild(node); }\n return next\n }\n\n var view = display.view, lineN = display.viewFrom;\n // Loop over the elements in the view, syncing cur (the DOM nodes\n // in display.lineDiv) with the view as we go.\n for (var i = 0; i < view.length; i++) {\n var lineView = view[i];\n if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet\n var node = buildLineElement(cm, lineView, lineN, dims);\n container.insertBefore(node, cur);\n } else { // Already drawn\n while (cur != lineView.node) { cur = rm(cur); }\n var updateNumber = lineNumbers && updateNumbersFrom != null &&\n updateNumbersFrom <= lineN && lineView.lineNumber;\n if (lineView.changes) {\n if (indexOf(lineView.changes, \"gutter\") > -1) { updateNumber = false; }\n updateLineForChanges(cm, lineView, lineN, dims);\n }\n if (updateNumber) {\n removeChildren(lineView.lineNumber);\n lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN)));\n }\n cur = lineView.node.nextSibling;\n }\n lineN += lineView.size;\n }\n while (cur) { cur = rm(cur); }\n }\n\n function updateGutterSpace(cm) {\n var width = cm.display.gutters.offsetWidth;\n cm.display.sizer.style.marginLeft = width + \"px\";\n }\n\n function setDocumentHeight(cm, measure) {\n cm.display.sizer.style.minHeight = measure.docHeight + \"px\";\n cm.display.heightForcer.style.top = measure.docHeight + \"px\";\n cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + \"px\";\n }\n\n // Rebuild the gutter elements, ensure the margin to the left of the\n // code matches their width.\n function updateGutters(cm) {\n var gutters = cm.display.gutters, specs = cm.options.gutters;\n removeChildren(gutters);\n var i = 0;\n for (; i < specs.length; ++i) {\n var gutterClass = specs[i];\n var gElt = gutters.appendChild(elt(\"div\", null, \"CodeMirror-gutter \" + gutterClass));\n if (gutterClass == \"CodeMirror-linenumbers\") {\n cm.display.lineGutter = gElt;\n gElt.style.width = (cm.display.lineNumWidth || 1) + \"px\";\n }\n }\n gutters.style.display = i ? \"\" : \"none\";\n updateGutterSpace(cm);\n }\n\n // Make sure the gutters options contains the element\n // \"CodeMirror-linenumbers\" when the lineNumbers option is true.\n function setGuttersForLineNumbers(options) {\n var found = indexOf(options.gutters, \"CodeMirror-linenumbers\");\n if (found == -1 && options.lineNumbers) {\n options.gutters = options.gutters.concat([\"CodeMirror-linenumbers\"]);\n } else if (found > -1 && !options.lineNumbers) {\n options.gutters = options.gutters.slice(0);\n options.gutters.splice(found, 1);\n }\n }\n\n // Since the delta values reported on mouse wheel events are\n // unstandardized between browsers and even browser versions, and\n // generally horribly unpredictable, this code starts by measuring\n // the scroll effect that the first few mouse wheel events have,\n // and, from that, detects the way it can convert deltas to pixel\n // offsets afterwards.\n //\n // The reason we want to know the amount a wheel event will scroll\n // is that it gives us a chance to update the display before the\n // actual scrolling happens, reducing flickering.\n\n var wheelSamples = 0, wheelPixelsPerUnit = null;\n // Fill in a browser-detected starting value on browsers where we\n // know one. These don't have to be accurate -- the result of them\n // being wrong would just be a slight flicker on the first wheel\n // scroll (if it is large enough).\n if (ie) { wheelPixelsPerUnit = -.53; }\n else if (gecko) { wheelPixelsPerUnit = 15; }\n else if (chrome) { wheelPixelsPerUnit = -.7; }\n else if (safari) { wheelPixelsPerUnit = -1/3; }\n\n function wheelEventDelta(e) {\n var dx = e.wheelDeltaX, dy = e.wheelDeltaY;\n if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; }\n if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; }\n else if (dy == null) { dy = e.wheelDelta; }\n return {x: dx, y: dy}\n }\n function wheelEventPixels(e) {\n var delta = wheelEventDelta(e);\n delta.x *= wheelPixelsPerUnit;\n delta.y *= wheelPixelsPerUnit;\n return delta\n }\n\n function onScrollWheel(cm, e) {\n var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;\n\n var display = cm.display, scroll = display.scroller;\n // Quit if there's nothing to scroll here\n var canScrollX = scroll.scrollWidth > scroll.clientWidth;\n var canScrollY = scroll.scrollHeight > scroll.clientHeight;\n if (!(dx && canScrollX || dy && canScrollY)) { return }\n\n // Webkit browsers on OS X abort momentum scrolls when the target\n // of the scroll event is removed from the scrollable element.\n // This hack (see related code in patchDisplay) makes sure the\n // element is kept around.\n if (dy && mac && webkit) {\n outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {\n for (var i = 0; i < view.length; i++) {\n if (view[i].node == cur) {\n cm.display.currentWheelTarget = cur;\n break outer\n }\n }\n }\n }\n\n // On some browsers, horizontal scrolling will cause redraws to\n // happen before the gutter has been realigned, causing it to\n // wriggle around in a most unseemly way. When we have an\n // estimated pixels/delta value, we just handle horizontal\n // scrolling entirely here. It'll be slightly off from native, but\n // better than glitching out.\n if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {\n if (dy && canScrollY)\n { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); }\n setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit));\n // Only prevent default scrolling if vertical scrolling is\n // actually possible. Otherwise, it causes vertical scroll\n // jitter on OSX trackpads when deltaX is small and deltaY\n // is large (issue #3579)\n if (!dy || (dy && canScrollY))\n { e_preventDefault(e); }\n display.wheelStartX = null; // Abort measurement, if in progress\n return\n }\n\n // 'Project' the visible viewport to cover the area that is being\n // scrolled into view (if we know enough to estimate it).\n if (dy && wheelPixelsPerUnit != null) {\n var pixels = dy * wheelPixelsPerUnit;\n var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;\n if (pixels < 0) { top = Math.max(0, top + pixels - 50); }\n else { bot = Math.min(cm.doc.height, bot + pixels + 50); }\n updateDisplaySimple(cm, {top: top, bottom: bot});\n }\n\n if (wheelSamples < 20) {\n if (display.wheelStartX == null) {\n display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;\n display.wheelDX = dx; display.wheelDY = dy;\n setTimeout(function () {\n if (display.wheelStartX == null) { return }\n var movedX = scroll.scrollLeft - display.wheelStartX;\n var movedY = scroll.scrollTop - display.wheelStartY;\n var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||\n (movedX && display.wheelDX && movedX / display.wheelDX);\n display.wheelStartX = display.wheelStartY = null;\n if (!sample) { return }\n wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);\n ++wheelSamples;\n }, 200);\n } else {\n display.wheelDX += dx; display.wheelDY += dy;\n }\n }\n }\n\n // Selection objects are immutable. A new one is created every time\n // the selection changes. A selection is one or more non-overlapping\n // (and non-touching) ranges, sorted, and an integer that indicates\n // which one is the primary selection (the one that's scrolled into\n // view, that getCursor returns, etc).\n var Selection = function(ranges, primIndex) {\n this.ranges = ranges;\n this.primIndex = primIndex;\n };\n\n Selection.prototype.primary = function () { return this.ranges[this.primIndex] };\n\n Selection.prototype.equals = function (other) {\n var this$1 = this;\n\n if (other == this) { return true }\n if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false }\n for (var i = 0; i < this.ranges.length; i++) {\n var here = this$1.ranges[i], there = other.ranges[i];\n if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false }\n }\n return true\n };\n\n Selection.prototype.deepCopy = function () {\n var this$1 = this;\n\n var out = [];\n for (var i = 0; i < this.ranges.length; i++)\n { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)); }\n return new Selection(out, this.primIndex)\n };\n\n Selection.prototype.somethingSelected = function () {\n var this$1 = this;\n\n for (var i = 0; i < this.ranges.length; i++)\n { if (!this$1.ranges[i].empty()) { return true } }\n return false\n };\n\n Selection.prototype.contains = function (pos, end) {\n var this$1 = this;\n\n if (!end) { end = pos; }\n for (var i = 0; i < this.ranges.length; i++) {\n var range = this$1.ranges[i];\n if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0)\n { return i }\n }\n return -1\n };\n\n var Range = function(anchor, head) {\n this.anchor = anchor; this.head = head;\n };\n\n Range.prototype.from = function () { return minPos(this.anchor, this.head) };\n Range.prototype.to = function () { return maxPos(this.anchor, this.head) };\n Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch };\n\n // Take an unsorted, potentially overlapping set of ranges, and\n // build a selection out of it. 'Consumes' ranges array (modifying\n // it).\n function normalizeSelection(cm, ranges, primIndex) {\n var mayTouch = cm && cm.options.selectionsMayTouch;\n var prim = ranges[primIndex];\n ranges.sort(function (a, b) { return cmp(a.from(), b.from()); });\n primIndex = indexOf(ranges, prim);\n for (var i = 1; i < ranges.length; i++) {\n var cur = ranges[i], prev = ranges[i - 1];\n var diff = cmp(prev.to(), cur.from());\n if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) {\n var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to());\n var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head;\n if (i <= primIndex) { --primIndex; }\n ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to));\n }\n }\n return new Selection(ranges, primIndex)\n }\n\n function simpleSelection(anchor, head) {\n return new Selection([new Range(anchor, head || anchor)], 0)\n }\n\n // Compute the position of the end of a change (its 'to' property\n // refers to the pre-change end).\n function changeEnd(change) {\n if (!change.text) { return change.to }\n return Pos(change.from.line + change.text.length - 1,\n lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0))\n }\n\n // Adjust a position to refer to the post-change position of the\n // same text, or the end of the change if the change covers it.\n function adjustForChange(pos, change) {\n if (cmp(pos, change.from) < 0) { return pos }\n if (cmp(pos, change.to) <= 0) { return changeEnd(change) }\n\n var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;\n if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; }\n return Pos(line, ch)\n }\n\n function computeSelAfterChange(doc, change) {\n var out = [];\n for (var i = 0; i < doc.sel.ranges.length; i++) {\n var range = doc.sel.ranges[i];\n out.push(new Range(adjustForChange(range.anchor, change),\n adjustForChange(range.head, change)));\n }\n return normalizeSelection(doc.cm, out, doc.sel.primIndex)\n }\n\n function offsetPos(pos, old, nw) {\n if (pos.line == old.line)\n { return Pos(nw.line, pos.ch - old.ch + nw.ch) }\n else\n { return Pos(nw.line + (pos.line - old.line), pos.ch) }\n }\n\n // Used by replaceSelections to allow moving the selection to the\n // start or around the replaced test. Hint may be \"start\" or \"around\".\n function computeReplacedSel(doc, changes, hint) {\n var out = [];\n var oldPrev = Pos(doc.first, 0), newPrev = oldPrev;\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n var from = offsetPos(change.from, oldPrev, newPrev);\n var to = offsetPos(changeEnd(change), oldPrev, newPrev);\n oldPrev = change.to;\n newPrev = to;\n if (hint == \"around\") {\n var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0;\n out[i] = new Range(inv ? to : from, inv ? from : to);\n } else {\n out[i] = new Range(from, from);\n }\n }\n return new Selection(out, doc.sel.primIndex)\n }\n\n // Used to get the editor into a consistent state again when options change.\n\n function loadMode(cm) {\n cm.doc.mode = getMode(cm.options, cm.doc.modeOption);\n resetModeState(cm);\n }\n\n function resetModeState(cm) {\n cm.doc.iter(function (line) {\n if (line.stateAfter) { line.stateAfter = null; }\n if (line.styles) { line.styles = null; }\n });\n cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first;\n startWorker(cm, 100);\n cm.state.modeGen++;\n if (cm.curOp) { regChange(cm); }\n }\n\n // DOCUMENT DATA STRUCTURE\n\n // By default, updates that start and end at the beginning of a line\n // are treated specially, in order to make the association of line\n // widgets and marker elements with the text behave more intuitive.\n function isWholeLineUpdate(doc, change) {\n return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == \"\" &&\n (!doc.cm || doc.cm.options.wholeLineUpdateBefore)\n }\n\n // Perform a change on the document data structure.\n function updateDoc(doc, change, markedSpans, estimateHeight$$1) {\n function spansFor(n) {return markedSpans ? markedSpans[n] : null}\n function update(line, text, spans) {\n updateLine(line, text, spans, estimateHeight$$1);\n signalLater(line, \"change\", line, change);\n }\n function linesFor(start, end) {\n var result = [];\n for (var i = start; i < end; ++i)\n { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); }\n return result\n }\n\n var from = change.from, to = change.to, text = change.text;\n var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);\n var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;\n\n // Adjust the line structure\n if (change.full) {\n doc.insert(0, linesFor(0, text.length));\n doc.remove(text.length, doc.size - text.length);\n } else if (isWholeLineUpdate(doc, change)) {\n // This is a whole-line replace. Treated specially to make\n // sure line objects move the way they are supposed to.\n var added = linesFor(0, text.length - 1);\n update(lastLine, lastLine.text, lastSpans);\n if (nlines) { doc.remove(from.line, nlines); }\n if (added.length) { doc.insert(from.line, added); }\n } else if (firstLine == lastLine) {\n if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);\n } else {\n var added$1 = linesFor(1, text.length - 1);\n added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1));\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n doc.insert(from.line + 1, added$1);\n }\n } else if (text.length == 1) {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));\n doc.remove(from.line + 1, nlines);\n } else {\n update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));\n update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);\n var added$2 = linesFor(1, text.length - 1);\n if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); }\n doc.insert(from.line + 1, added$2);\n }\n\n signalLater(doc, \"change\", doc, change);\n }\n\n // Call f for all linked documents.\n function linkedDocs(doc, f, sharedHistOnly) {\n function propagate(doc, skip, sharedHist) {\n if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) {\n var rel = doc.linked[i];\n if (rel.doc == skip) { continue }\n var shared = sharedHist && rel.sharedHist;\n if (sharedHistOnly && !shared) { continue }\n f(rel.doc, shared);\n propagate(rel.doc, doc, shared);\n } }\n }\n propagate(doc, null, true);\n }\n\n // Attach a document to an editor.\n function attachDoc(cm, doc) {\n if (doc.cm) { throw new Error(\"This document is already in use.\") }\n cm.doc = doc;\n doc.cm = cm;\n estimateLineHeights(cm);\n loadMode(cm);\n setDirectionClass(cm);\n if (!cm.options.lineWrapping) { findMaxLine(cm); }\n cm.options.mode = doc.modeOption;\n regChange(cm);\n }\n\n function setDirectionClass(cm) {\n (cm.doc.direction == \"rtl\" ? addClass : rmClass)(cm.display.lineDiv, \"CodeMirror-rtl\");\n }\n\n function directionChanged(cm) {\n runInOp(cm, function () {\n setDirectionClass(cm);\n regChange(cm);\n });\n }\n\n function History(startGen) {\n // Arrays of change events and selections. Doing something adds an\n // event to done and clears undo. Undoing moves events from done\n // to undone, redoing moves them in the other direction.\n this.done = []; this.undone = [];\n this.undoDepth = Infinity;\n // Used to track when changes can be merged into a single undo\n // event\n this.lastModTime = this.lastSelTime = 0;\n this.lastOp = this.lastSelOp = null;\n this.lastOrigin = this.lastSelOrigin = null;\n // Used by the isClean() method\n this.generation = this.maxGeneration = startGen || 1;\n }\n\n // Create a history change event from an updateDoc-style change\n // object.\n function historyChangeFromChange(doc, change) {\n var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)};\n attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);\n linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true);\n return histChange\n }\n\n // Pop all selection events off the end of a history array. Stop at\n // a change event.\n function clearSelectionEvents(array) {\n while (array.length) {\n var last = lst(array);\n if (last.ranges) { array.pop(); }\n else { break }\n }\n }\n\n // Find the top change event in the history. Pop off selection\n // events that are in the way.\n function lastChangeEvent(hist, force) {\n if (force) {\n clearSelectionEvents(hist.done);\n return lst(hist.done)\n } else if (hist.done.length && !lst(hist.done).ranges) {\n return lst(hist.done)\n } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) {\n hist.done.pop();\n return lst(hist.done)\n }\n }\n\n // Register a change in the history. Merges changes that are within\n // a single operation, or are close together with an origin that\n // allows merging (starting with \"+\") into a single event.\n function addChangeToHistory(doc, change, selAfter, opId) {\n var hist = doc.history;\n hist.undone.length = 0;\n var time = +new Date, cur;\n var last;\n\n if ((hist.lastOp == opId ||\n hist.lastOrigin == change.origin && change.origin &&\n ((change.origin.charAt(0) == \"+\" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||\n change.origin.charAt(0) == \"*\")) &&\n (cur = lastChangeEvent(hist, hist.lastOp == opId))) {\n // Merge this change into the last event\n last = lst(cur.changes);\n if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) {\n // Optimized case for simple insertion -- don't want to add\n // new changesets for every character typed\n last.to = changeEnd(change);\n } else {\n // Add new sub-event\n cur.changes.push(historyChangeFromChange(doc, change));\n }\n } else {\n // Can not be merged, start a new event.\n var before = lst(hist.done);\n if (!before || !before.ranges)\n { pushSelectionToHistory(doc.sel, hist.done); }\n cur = {changes: [historyChangeFromChange(doc, change)],\n generation: hist.generation};\n hist.done.push(cur);\n while (hist.done.length > hist.undoDepth) {\n hist.done.shift();\n if (!hist.done[0].ranges) { hist.done.shift(); }\n }\n }\n hist.done.push(selAfter);\n hist.generation = ++hist.maxGeneration;\n hist.lastModTime = hist.lastSelTime = time;\n hist.lastOp = hist.lastSelOp = opId;\n hist.lastOrigin = hist.lastSelOrigin = change.origin;\n\n if (!last) { signal(doc, \"historyAdded\"); }\n }\n\n function selectionEventCanBeMerged(doc, origin, prev, sel) {\n var ch = origin.charAt(0);\n return ch == \"*\" ||\n ch == \"+\" &&\n prev.ranges.length == sel.ranges.length &&\n prev.somethingSelected() == sel.somethingSelected() &&\n new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500)\n }\n\n // Called whenever the selection changes, sets the new selection as\n // the pending selection in the history, and pushes the old pending\n // selection into the 'done' array when it was significantly\n // different (in number of selected ranges, emptiness, or time).\n function addSelectionToHistory(doc, sel, opId, options) {\n var hist = doc.history, origin = options && options.origin;\n\n // A new event is started when the previous origin does not match\n // the current, or the origins don't allow matching. Origins\n // starting with * are always merged, those starting with + are\n // merged when similar and close together in time.\n if (opId == hist.lastSelOp ||\n (origin && hist.lastSelOrigin == origin &&\n (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||\n selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))\n { hist.done[hist.done.length - 1] = sel; }\n else\n { pushSelectionToHistory(sel, hist.done); }\n\n hist.lastSelTime = +new Date;\n hist.lastSelOrigin = origin;\n hist.lastSelOp = opId;\n if (options && options.clearRedo !== false)\n { clearSelectionEvents(hist.undone); }\n }\n\n function pushSelectionToHistory(sel, dest) {\n var top = lst(dest);\n if (!(top && top.ranges && top.equals(sel)))\n { dest.push(sel); }\n }\n\n // Used to store marked span information in the history.\n function attachLocalSpans(doc, change, from, to) {\n var existing = change[\"spans_\" + doc.id], n = 0;\n doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n if (line.markedSpans)\n { (existing || (existing = change[\"spans_\" + doc.id] = {}))[n] = line.markedSpans; }\n ++n;\n });\n }\n\n // When un/re-doing restores text containing marked spans, those\n // that have been explicitly cleared should not be restored.\n function removeClearedSpans(spans) {\n if (!spans) { return null }\n var out;\n for (var i = 0; i < spans.length; ++i) {\n if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } }\n else if (out) { out.push(spans[i]); }\n }\n return !out ? spans : out.length ? out : null\n }\n\n // Retrieve and filter the old marked spans stored in a change event.\n function getOldSpans(doc, change) {\n var found = change[\"spans_\" + doc.id];\n if (!found) { return null }\n var nw = [];\n for (var i = 0; i < change.text.length; ++i)\n { nw.push(removeClearedSpans(found[i])); }\n return nw\n }\n\n // Used for un/re-doing changes from the history. Combines the\n // result of computing the existing spans with the set of spans that\n // existed in the history (so that deleting around a span and then\n // undoing brings back the span).\n function mergeOldSpans(doc, change) {\n var old = getOldSpans(doc, change);\n var stretched = stretchSpansOverChange(doc, change);\n if (!old) { return stretched }\n if (!stretched) { return old }\n\n for (var i = 0; i < old.length; ++i) {\n var oldCur = old[i], stretchCur = stretched[i];\n if (oldCur && stretchCur) {\n spans: for (var j = 0; j < stretchCur.length; ++j) {\n var span = stretchCur[j];\n for (var k = 0; k < oldCur.length; ++k)\n { if (oldCur[k].marker == span.marker) { continue spans } }\n oldCur.push(span);\n }\n } else if (stretchCur) {\n old[i] = stretchCur;\n }\n }\n return old\n }\n\n // Used both to provide a JSON-safe object in .getHistory, and, when\n // detaching a document, to split the history in two\n function copyHistoryArray(events, newGroup, instantiateSel) {\n var copy = [];\n for (var i = 0; i < events.length; ++i) {\n var event = events[i];\n if (event.ranges) {\n copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event);\n continue\n }\n var changes = event.changes, newChanges = [];\n copy.push({changes: newChanges});\n for (var j = 0; j < changes.length; ++j) {\n var change = changes[j], m = (void 0);\n newChanges.push({from: change.from, to: change.to, text: change.text});\n if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\\d+)$/)) {\n if (indexOf(newGroup, Number(m[1])) > -1) {\n lst(newChanges)[prop] = change[prop];\n delete change[prop];\n }\n } } }\n }\n }\n return copy\n }\n\n // The 'scroll' parameter given to many of these indicated whether\n // the new cursor position should be scrolled into view after\n // modifying the selection.\n\n // If shift is held or the extend flag is set, extends a range to\n // include a given position (and optionally a second position).\n // Otherwise, simply returns the range between the given positions.\n // Used for cursor motion and such.\n function extendRange(range, head, other, extend) {\n if (extend) {\n var anchor = range.anchor;\n if (other) {\n var posBefore = cmp(head, anchor) < 0;\n if (posBefore != (cmp(other, anchor) < 0)) {\n anchor = head;\n head = other;\n } else if (posBefore != (cmp(head, other) < 0)) {\n head = other;\n }\n }\n return new Range(anchor, head)\n } else {\n return new Range(other || head, head)\n }\n }\n\n // Extend the primary selection range, discard the rest.\n function extendSelection(doc, head, other, options, extend) {\n if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); }\n setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options);\n }\n\n // Extend all selections (pos is an array of selections with length\n // equal the number of selections)\n function extendSelections(doc, heads, options) {\n var out = [];\n var extend = doc.cm && (doc.cm.display.shift || doc.extend);\n for (var i = 0; i < doc.sel.ranges.length; i++)\n { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); }\n var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex);\n setSelection(doc, newSel, options);\n }\n\n // Updates a single range in the selection.\n function replaceOneSelection(doc, i, range, options) {\n var ranges = doc.sel.ranges.slice(0);\n ranges[i] = range;\n setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options);\n }\n\n // Reset the selection to a single range.\n function setSimpleSelection(doc, anchor, head, options) {\n setSelection(doc, simpleSelection(anchor, head), options);\n }\n\n // Give beforeSelectionChange handlers a change to influence a\n // selection update.\n function filterSelectionChange(doc, sel, options) {\n var obj = {\n ranges: sel.ranges,\n update: function(ranges) {\n var this$1 = this;\n\n this.ranges = [];\n for (var i = 0; i < ranges.length; i++)\n { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor),\n clipPos(doc, ranges[i].head)); }\n },\n origin: options && options.origin\n };\n signal(doc, \"beforeSelectionChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeSelectionChange\", doc.cm, obj); }\n if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) }\n else { return sel }\n }\n\n function setSelectionReplaceHistory(doc, sel, options) {\n var done = doc.history.done, last = lst(done);\n if (last && last.ranges) {\n done[done.length - 1] = sel;\n setSelectionNoUndo(doc, sel, options);\n } else {\n setSelection(doc, sel, options);\n }\n }\n\n // Set a new selection.\n function setSelection(doc, sel, options) {\n setSelectionNoUndo(doc, sel, options);\n addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options);\n }\n\n function setSelectionNoUndo(doc, sel, options) {\n if (hasHandler(doc, \"beforeSelectionChange\") || doc.cm && hasHandler(doc.cm, \"beforeSelectionChange\"))\n { sel = filterSelectionChange(doc, sel, options); }\n\n var bias = options && options.bias ||\n (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1);\n setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true));\n\n if (!(options && options.scroll === false) && doc.cm)\n { ensureCursorVisible(doc.cm); }\n }\n\n function setSelectionInner(doc, sel) {\n if (sel.equals(doc.sel)) { return }\n\n doc.sel = sel;\n\n if (doc.cm) {\n doc.cm.curOp.updateInput = 1;\n doc.cm.curOp.selectionChanged = true;\n signalCursorActivity(doc.cm);\n }\n signalLater(doc, \"cursorActivity\", doc);\n }\n\n // Verify that the selection does not partially select any atomic\n // marked ranges.\n function reCheckSelection(doc) {\n setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false));\n }\n\n // Return a selection that does not partially select any atomic\n // ranges.\n function skipAtomicInSelection(doc, sel, bias, mayClear) {\n var out;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range = sel.ranges[i];\n var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i];\n var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear);\n var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear);\n if (out || newAnchor != range.anchor || newHead != range.head) {\n if (!out) { out = sel.ranges.slice(0, i); }\n out[i] = new Range(newAnchor, newHead);\n }\n }\n return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel\n }\n\n function skipAtomicInner(doc, pos, oldPos, dir, mayClear) {\n var line = getLine(doc, pos.line);\n if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) {\n var sp = line.markedSpans[i], m = sp.marker;\n if ((sp.from == null || (m.inclusiveLeft ? sp.from <= pos.ch : sp.from < pos.ch)) &&\n (sp.to == null || (m.inclusiveRight ? sp.to >= pos.ch : sp.to > pos.ch))) {\n if (mayClear) {\n signal(m, \"beforeCursorEnter\");\n if (m.explicitlyCleared) {\n if (!line.markedSpans) { break }\n else {--i; continue}\n }\n }\n if (!m.atomic) { continue }\n\n if (oldPos) {\n var near = m.find(dir < 0 ? 1 : -1), diff = (void 0);\n if (dir < 0 ? m.inclusiveRight : m.inclusiveLeft)\n { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); }\n if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0))\n { return skipAtomicInner(doc, near, pos, dir, mayClear) }\n }\n\n var far = m.find(dir < 0 ? -1 : 1);\n if (dir < 0 ? m.inclusiveLeft : m.inclusiveRight)\n { far = movePos(doc, far, dir, far.line == pos.line ? line : null); }\n return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null\n }\n } }\n return pos\n }\n\n // Ensure a given position is not inside an atomic range.\n function skipAtomic(doc, pos, oldPos, bias, mayClear) {\n var dir = bias || 1;\n var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) ||\n skipAtomicInner(doc, pos, oldPos, -dir, mayClear) ||\n (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true));\n if (!found) {\n doc.cantEdit = true;\n return Pos(doc.first, 0)\n }\n return found\n }\n\n function movePos(doc, pos, dir, line) {\n if (dir < 0 && pos.ch == 0) {\n if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) }\n else { return null }\n } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) {\n if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) }\n else { return null }\n } else {\n return new Pos(pos.line, pos.ch + dir)\n }\n }\n\n function selectAll(cm) {\n cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll);\n }\n\n // UPDATING\n\n // Allow \"beforeChange\" event handlers to influence a change\n function filterChange(doc, change, update) {\n var obj = {\n canceled: false,\n from: change.from,\n to: change.to,\n text: change.text,\n origin: change.origin,\n cancel: function () { return obj.canceled = true; }\n };\n if (update) { obj.update = function (from, to, text, origin) {\n if (from) { obj.from = clipPos(doc, from); }\n if (to) { obj.to = clipPos(doc, to); }\n if (text) { obj.text = text; }\n if (origin !== undefined) { obj.origin = origin; }\n }; }\n signal(doc, \"beforeChange\", doc, obj);\n if (doc.cm) { signal(doc.cm, \"beforeChange\", doc.cm, obj); }\n\n if (obj.canceled) {\n if (doc.cm) { doc.cm.curOp.updateInput = 2; }\n return null\n }\n return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin}\n }\n\n // Apply a change to a document, and add it to the document's\n // history, and propagating it to all linked documents.\n function makeChange(doc, change, ignoreReadOnly) {\n if (doc.cm) {\n if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) }\n if (doc.cm.state.suppressEdits) { return }\n }\n\n if (hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\")) {\n change = filterChange(doc, change, true);\n if (!change) { return }\n }\n\n // Possibly split or suppress the update based on the presence\n // of read-only spans in its range.\n var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);\n if (split) {\n for (var i = split.length - 1; i >= 0; --i)\n { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [\"\"] : change.text, origin: change.origin}); }\n } else {\n makeChangeInner(doc, change);\n }\n }\n\n function makeChangeInner(doc, change) {\n if (change.text.length == 1 && change.text[0] == \"\" && cmp(change.from, change.to) == 0) { return }\n var selAfter = computeSelAfterChange(doc, change);\n addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);\n\n makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));\n var rebased = [];\n\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));\n });\n }\n\n // Revert a change stored in a document's history.\n function makeChangeFromHistory(doc, type, allowSelectionOnly) {\n var suppress = doc.cm && doc.cm.state.suppressEdits;\n if (suppress && !allowSelectionOnly) { return }\n\n var hist = doc.history, event, selAfter = doc.sel;\n var source = type == \"undo\" ? hist.done : hist.undone, dest = type == \"undo\" ? hist.undone : hist.done;\n\n // Verify that there is a useable event (so that ctrl-z won't\n // needlessly clear selection events)\n var i = 0;\n for (; i < source.length; i++) {\n event = source[i];\n if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges)\n { break }\n }\n if (i == source.length) { return }\n hist.lastOrigin = hist.lastSelOrigin = null;\n\n for (;;) {\n event = source.pop();\n if (event.ranges) {\n pushSelectionToHistory(event, dest);\n if (allowSelectionOnly && !event.equals(doc.sel)) {\n setSelection(doc, event, {clearRedo: false});\n return\n }\n selAfter = event;\n } else if (suppress) {\n source.push(event);\n return\n } else { break }\n }\n\n // Build up a reverse change object to add to the opposite history\n // stack (redo when undoing, and vice versa).\n var antiChanges = [];\n pushSelectionToHistory(selAfter, dest);\n dest.push({changes: antiChanges, generation: hist.generation});\n hist.generation = event.generation || ++hist.maxGeneration;\n\n var filter = hasHandler(doc, \"beforeChange\") || doc.cm && hasHandler(doc.cm, \"beforeChange\");\n\n var loop = function ( i ) {\n var change = event.changes[i];\n change.origin = type;\n if (filter && !filterChange(doc, change, false)) {\n source.length = 0;\n return {}\n }\n\n antiChanges.push(historyChangeFromChange(doc, change));\n\n var after = i ? computeSelAfterChange(doc, change) : lst(source);\n makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));\n if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); }\n var rebased = [];\n\n // Propagate to the linked documents\n linkedDocs(doc, function (doc, sharedHist) {\n if (!sharedHist && indexOf(rebased, doc.history) == -1) {\n rebaseHist(doc.history, change);\n rebased.push(doc.history);\n }\n makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));\n });\n };\n\n for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) {\n var returned = loop( i$1 );\n\n if ( returned ) return returned.v;\n }\n }\n\n // Sub-views need their line numbers shifted when text is added\n // above or below them in the parent document.\n function shiftDoc(doc, distance) {\n if (distance == 0) { return }\n doc.first += distance;\n doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range(\n Pos(range.anchor.line + distance, range.anchor.ch),\n Pos(range.head.line + distance, range.head.ch)\n ); }), doc.sel.primIndex);\n if (doc.cm) {\n regChange(doc.cm, doc.first, doc.first - distance, distance);\n for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++)\n { regLineChange(doc.cm, l, \"gutter\"); }\n }\n }\n\n // More lower-level change function, handling only a single document\n // (not linked ones).\n function makeChangeSingleDoc(doc, change, selAfter, spans) {\n if (doc.cm && !doc.cm.curOp)\n { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) }\n\n if (change.to.line < doc.first) {\n shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));\n return\n }\n if (change.from.line > doc.lastLine()) { return }\n\n // Clip the change to the size of this doc\n if (change.from.line < doc.first) {\n var shift = change.text.length - 1 - (doc.first - change.from.line);\n shiftDoc(doc, shift);\n change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),\n text: [lst(change.text)], origin: change.origin};\n }\n var last = doc.lastLine();\n if (change.to.line > last) {\n change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),\n text: [change.text[0]], origin: change.origin};\n }\n\n change.removed = getBetween(doc, change.from, change.to);\n\n if (!selAfter) { selAfter = computeSelAfterChange(doc, change); }\n if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); }\n else { updateDoc(doc, change, spans); }\n setSelectionNoUndo(doc, selAfter, sel_dontScroll);\n }\n\n // Handle the interaction of a change to a document with the editor\n // that this document is part of.\n function makeChangeSingleDocInEditor(cm, change, spans) {\n var doc = cm.doc, display = cm.display, from = change.from, to = change.to;\n\n var recomputeMaxLength = false, checkWidthStart = from.line;\n if (!cm.options.lineWrapping) {\n checkWidthStart = lineNo(visualLine(getLine(doc, from.line)));\n doc.iter(checkWidthStart, to.line + 1, function (line) {\n if (line == display.maxLine) {\n recomputeMaxLength = true;\n return true\n }\n });\n }\n\n if (doc.sel.contains(change.from, change.to) > -1)\n { signalCursorActivity(cm); }\n\n updateDoc(doc, change, spans, estimateHeight(cm));\n\n if (!cm.options.lineWrapping) {\n doc.iter(checkWidthStart, from.line + change.text.length, function (line) {\n var len = lineLength(line);\n if (len > display.maxLineLength) {\n display.maxLine = line;\n display.maxLineLength = len;\n display.maxLineChanged = true;\n recomputeMaxLength = false;\n }\n });\n if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; }\n }\n\n retreatFrontier(doc, from.line);\n startWorker(cm, 400);\n\n var lendiff = change.text.length - (to.line - from.line) - 1;\n // Remember that these lines changed, for updating the display\n if (change.full)\n { regChange(cm); }\n else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change))\n { regLineChange(cm, from.line, \"text\"); }\n else\n { regChange(cm, from.line, to.line + 1, lendiff); }\n\n var changesHandler = hasHandler(cm, \"changes\"), changeHandler = hasHandler(cm, \"change\");\n if (changeHandler || changesHandler) {\n var obj = {\n from: from, to: to,\n text: change.text,\n removed: change.removed,\n origin: change.origin\n };\n if (changeHandler) { signalLater(cm, \"change\", cm, obj); }\n if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); }\n }\n cm.display.selForContextMenu = null;\n }\n\n function replaceRange(doc, code, from, to, origin) {\n var assign;\n\n if (!to) { to = from; }\n if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); }\n if (typeof code == \"string\") { code = doc.splitLines(code); }\n makeChange(doc, {from: from, to: to, text: code, origin: origin});\n }\n\n // Rebasing/resetting history to deal with externally-sourced changes\n\n function rebaseHistSelSingle(pos, from, to, diff) {\n if (to < pos.line) {\n pos.line += diff;\n } else if (from < pos.line) {\n pos.line = from;\n pos.ch = 0;\n }\n }\n\n // Tries to rebase an array of history events given a change in the\n // document. If the change touches the same lines as the event, the\n // event, and everything 'behind' it, is discarded. If the change is\n // before the event, the event's positions are updated. Uses a\n // copy-on-write scheme for the positions, to avoid having to\n // reallocate them all on every rebase, but also avoid problems with\n // shared position objects being unsafely updated.\n function rebaseHistArray(array, from, to, diff) {\n for (var i = 0; i < array.length; ++i) {\n var sub = array[i], ok = true;\n if (sub.ranges) {\n if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; }\n for (var j = 0; j < sub.ranges.length; j++) {\n rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff);\n rebaseHistSelSingle(sub.ranges[j].head, from, to, diff);\n }\n continue\n }\n for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) {\n var cur = sub.changes[j$1];\n if (to < cur.from.line) {\n cur.from = Pos(cur.from.line + diff, cur.from.ch);\n cur.to = Pos(cur.to.line + diff, cur.to.ch);\n } else if (from <= cur.to.line) {\n ok = false;\n break\n }\n }\n if (!ok) {\n array.splice(0, i + 1);\n i = 0;\n }\n }\n }\n\n function rebaseHist(hist, change) {\n var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;\n rebaseHistArray(hist.done, from, to, diff);\n rebaseHistArray(hist.undone, from, to, diff);\n }\n\n // Utility for applying a change to a line by handle or number,\n // returning the number and optionally registering the line as\n // changed.\n function changeLine(doc, handle, changeType, op) {\n var no = handle, line = handle;\n if (typeof handle == \"number\") { line = getLine(doc, clipLine(doc, handle)); }\n else { no = lineNo(handle); }\n if (no == null) { return null }\n if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); }\n return line\n }\n\n // The document is represented as a BTree consisting of leaves, with\n // chunk of lines in them, and branches, with up to ten leaves or\n // other branch nodes below them. The top node is always a branch\n // node, and is the document object itself (meaning it has\n // additional methods and properties).\n //\n // All nodes have parent links. The tree is used both to go from\n // line numbers to line objects, and to go from objects to numbers.\n // It also indexes by height, and is used to convert between height\n // and line object, and to find the total height of the document.\n //\n // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html\n\n function LeafChunk(lines) {\n var this$1 = this;\n\n this.lines = lines;\n this.parent = null;\n var height = 0;\n for (var i = 0; i < lines.length; ++i) {\n lines[i].parent = this$1;\n height += lines[i].height;\n }\n this.height = height;\n }\n\n LeafChunk.prototype = {\n chunkSize: function() { return this.lines.length },\n\n // Remove the n lines at offset 'at'.\n removeInner: function(at, n) {\n var this$1 = this;\n\n for (var i = at, e = at + n; i < e; ++i) {\n var line = this$1.lines[i];\n this$1.height -= line.height;\n cleanUpLine(line);\n signalLater(line, \"delete\");\n }\n this.lines.splice(at, n);\n },\n\n // Helper used to collapse a small branch into a single leaf.\n collapse: function(lines) {\n lines.push.apply(lines, this.lines);\n },\n\n // Insert the given array of lines at offset 'at', count them as\n // having the given height.\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.height += height;\n this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));\n for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1; }\n },\n\n // Used to iterate over a part of the tree.\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var e = at + n; at < e; ++at)\n { if (op(this$1.lines[at])) { return true } }\n }\n };\n\n function BranchChunk(children) {\n var this$1 = this;\n\n this.children = children;\n var size = 0, height = 0;\n for (var i = 0; i < children.length; ++i) {\n var ch = children[i];\n size += ch.chunkSize(); height += ch.height;\n ch.parent = this$1;\n }\n this.size = size;\n this.height = height;\n this.parent = null;\n }\n\n BranchChunk.prototype = {\n chunkSize: function() { return this.size },\n\n removeInner: function(at, n) {\n var this$1 = this;\n\n this.size -= n;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var rm = Math.min(n, sz - at), oldHeight = child.height;\n child.removeInner(at, rm);\n this$1.height -= oldHeight - child.height;\n if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null; }\n if ((n -= rm) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n // If the result is smaller than 25 lines, ensure that it is a\n // single leaf node.\n if (this.size - n < 25 &&\n (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {\n var lines = [];\n this.collapse(lines);\n this.children = [new LeafChunk(lines)];\n this.children[0].parent = this;\n }\n },\n\n collapse: function(lines) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines); }\n },\n\n insertInner: function(at, lines, height) {\n var this$1 = this;\n\n this.size += lines.length;\n this.height += height;\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at <= sz) {\n child.insertInner(at, lines, height);\n if (child.lines && child.lines.length > 50) {\n // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.\n // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.\n var remaining = child.lines.length % 25 + 25;\n for (var pos = remaining; pos < child.lines.length;) {\n var leaf = new LeafChunk(child.lines.slice(pos, pos += 25));\n child.height -= leaf.height;\n this$1.children.splice(++i, 0, leaf);\n leaf.parent = this$1;\n }\n child.lines = child.lines.slice(0, remaining);\n this$1.maybeSpill();\n }\n break\n }\n at -= sz;\n }\n },\n\n // When a node has grown, check whether it should be split.\n maybeSpill: function() {\n if (this.children.length <= 10) { return }\n var me = this;\n do {\n var spilled = me.children.splice(me.children.length - 5, 5);\n var sibling = new BranchChunk(spilled);\n if (!me.parent) { // Become the parent node\n var copy = new BranchChunk(me.children);\n copy.parent = me;\n me.children = [copy, sibling];\n me = copy;\n } else {\n me.size -= sibling.size;\n me.height -= sibling.height;\n var myIndex = indexOf(me.parent.children, me);\n me.parent.children.splice(myIndex + 1, 0, sibling);\n }\n sibling.parent = me.parent;\n } while (me.children.length > 10)\n me.parent.maybeSpill();\n },\n\n iterN: function(at, n, op) {\n var this$1 = this;\n\n for (var i = 0; i < this.children.length; ++i) {\n var child = this$1.children[i], sz = child.chunkSize();\n if (at < sz) {\n var used = Math.min(n, sz - at);\n if (child.iterN(at, used, op)) { return true }\n if ((n -= used) == 0) { break }\n at = 0;\n } else { at -= sz; }\n }\n }\n };\n\n // Line widgets are block elements displayed above or below a line.\n\n var LineWidget = function(doc, node, options) {\n var this$1 = this;\n\n if (options) { for (var opt in options) { if (options.hasOwnProperty(opt))\n { this$1[opt] = options[opt]; } } }\n this.doc = doc;\n this.node = node;\n };\n\n LineWidget.prototype.clear = function () {\n var this$1 = this;\n\n var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line);\n if (no == null || !ws) { return }\n for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1); } }\n if (!ws.length) { line.widgets = null; }\n var height = widgetHeight(this);\n updateLineHeight(line, Math.max(0, line.height - height));\n if (cm) {\n runInOp(cm, function () {\n adjustScrollWhenAboveVisible(cm, line, -height);\n regLineChange(cm, no, \"widget\");\n });\n signalLater(cm, \"lineWidgetCleared\", cm, this, no);\n }\n };\n\n LineWidget.prototype.changed = function () {\n var this$1 = this;\n\n var oldH = this.height, cm = this.doc.cm, line = this.line;\n this.height = null;\n var diff = widgetHeight(this) - oldH;\n if (!diff) { return }\n if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); }\n if (cm) {\n runInOp(cm, function () {\n cm.curOp.forceUpdate = true;\n adjustScrollWhenAboveVisible(cm, line, diff);\n signalLater(cm, \"lineWidgetChanged\", cm, this$1, lineNo(line));\n });\n }\n };\n eventMixin(LineWidget);\n\n function adjustScrollWhenAboveVisible(cm, line, diff) {\n if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))\n { addToScrollTop(cm, diff); }\n }\n\n function addLineWidget(doc, handle, node, options) {\n var widget = new LineWidget(doc, node, options);\n var cm = doc.cm;\n if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }\n changeLine(doc, handle, \"widget\", function (line) {\n var widgets = line.widgets || (line.widgets = []);\n if (widget.insertAt == null) { widgets.push(widget); }\n else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); }\n widget.line = line;\n if (cm && !lineIsHidden(doc, line)) {\n var aboveVisible = heightAtLine(line) < doc.scrollTop;\n updateLineHeight(line, line.height + widgetHeight(widget));\n if (aboveVisible) { addToScrollTop(cm, widget.height); }\n cm.curOp.forceUpdate = true;\n }\n return true\n });\n if (cm) { signalLater(cm, \"lineWidgetAdded\", cm, widget, typeof handle == \"number\" ? handle : lineNo(handle)); }\n return widget\n }\n\n // TEXTMARKERS\n\n // Created with markText and setBookmark methods. A TextMarker is a\n // handle that can be used to clear or find a marked position in the\n // document. Line objects hold arrays (markedSpans) containing\n // {from, to, marker} object pointing to such marker objects, and\n // indicating that such a marker is present on that line. Multiple\n // lines may point to the same marker when it spans across lines.\n // The spans will have null for their from/to properties when the\n // marker continues beyond the start/end of the line. Markers have\n // links back to the lines they currently touch.\n\n // Collapsed markers have unique ids, in order to be able to order\n // them, which is needed for uniquely determining an outer marker\n // when they overlap (they may nest, but not partially overlap).\n var nextMarkerId = 0;\n\n var TextMarker = function(doc, type) {\n this.lines = [];\n this.type = type;\n this.doc = doc;\n this.id = ++nextMarkerId;\n };\n\n // Clear the marker.\n TextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n var cm = this.doc.cm, withOp = cm && !cm.curOp;\n if (withOp) { startOperation(cm); }\n if (hasHandler(this, \"clear\")) {\n var found = this.find();\n if (found) { signalLater(this, \"clear\", found.from, found.to); }\n }\n var min = null, max = null;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), \"text\"); }\n else if (cm) {\n if (span.to != null) { max = lineNo(line); }\n if (span.from != null) { min = lineNo(line); }\n }\n line.markedSpans = removeMarkedSpan(line.markedSpans, span);\n if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm)\n { updateLineHeight(line, textHeight(cm.display)); }\n }\n if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) {\n var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual);\n if (len > cm.display.maxLineLength) {\n cm.display.maxLine = visual;\n cm.display.maxLineLength = len;\n cm.display.maxLineChanged = true;\n }\n } }\n\n if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); }\n this.lines.length = 0;\n this.explicitlyCleared = true;\n if (this.atomic && this.doc.cantEdit) {\n this.doc.cantEdit = false;\n if (cm) { reCheckSelection(cm.doc); }\n }\n if (cm) { signalLater(cm, \"markerCleared\", cm, this, min, max); }\n if (withOp) { endOperation(cm); }\n if (this.parent) { this.parent.clear(); }\n };\n\n // Find the position of the marker in the document. Returns a {from,\n // to} object by default. Side can be passed to get a specific side\n // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the\n // Pos objects returned contain a line object, rather than a line\n // number (used to prevent looking up the same line twice).\n TextMarker.prototype.find = function (side, lineObj) {\n var this$1 = this;\n\n if (side == null && this.type == \"bookmark\") { side = 1; }\n var from, to;\n for (var i = 0; i < this.lines.length; ++i) {\n var line = this$1.lines[i];\n var span = getMarkedSpanFor(line.markedSpans, this$1);\n if (span.from != null) {\n from = Pos(lineObj ? line : lineNo(line), span.from);\n if (side == -1) { return from }\n }\n if (span.to != null) {\n to = Pos(lineObj ? line : lineNo(line), span.to);\n if (side == 1) { return to }\n }\n }\n return from && {from: from, to: to}\n };\n\n // Signals that the marker's widget changed, and surrounding layout\n // should be recomputed.\n TextMarker.prototype.changed = function () {\n var this$1 = this;\n\n var pos = this.find(-1, true), widget = this, cm = this.doc.cm;\n if (!pos || !cm) { return }\n runInOp(cm, function () {\n var line = pos.line, lineN = lineNo(pos.line);\n var view = findViewForLine(cm, lineN);\n if (view) {\n clearLineMeasurementCacheFor(view);\n cm.curOp.selectionChanged = cm.curOp.forceUpdate = true;\n }\n cm.curOp.updateMaxLine = true;\n if (!lineIsHidden(widget.doc, line) && widget.height != null) {\n var oldHeight = widget.height;\n widget.height = null;\n var dHeight = widgetHeight(widget) - oldHeight;\n if (dHeight)\n { updateLineHeight(line, line.height + dHeight); }\n }\n signalLater(cm, \"markerChanged\", cm, this$1);\n });\n };\n\n TextMarker.prototype.attachLine = function (line) {\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp;\n if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)\n { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); }\n }\n this.lines.push(line);\n };\n\n TextMarker.prototype.detachLine = function (line) {\n this.lines.splice(indexOf(this.lines, line), 1);\n if (!this.lines.length && this.doc.cm) {\n var op = this.doc.cm.curOp\n ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);\n }\n };\n eventMixin(TextMarker);\n\n // Create a marker, wire it up to the right lines, and\n function markText(doc, from, to, options, type) {\n // Shared markers (across linked documents) are handled separately\n // (markTextShared will call out to this again, once per\n // document).\n if (options && options.shared) { return markTextShared(doc, from, to, options, type) }\n // Ensure we are in an operation.\n if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) }\n\n var marker = new TextMarker(doc, type), diff = cmp(from, to);\n if (options) { copyObj(options, marker, false); }\n // Don't connect empty markers unless clearWhenEmpty is false\n if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false)\n { return marker }\n if (marker.replacedWith) {\n // Showing up as a widget implies collapsed (widget replaces text)\n marker.collapsed = true;\n marker.widgetNode = eltP(\"span\", [marker.replacedWith], \"CodeMirror-widget\");\n if (!options.handleMouseEvents) { marker.widgetNode.setAttribute(\"cm-ignore-events\", \"true\"); }\n if (options.insertLeft) { marker.widgetNode.insertLeft = true; }\n }\n if (marker.collapsed) {\n if (conflictingCollapsedRange(doc, from.line, from, to, marker) ||\n from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker))\n { throw new Error(\"Inserting collapsed marker partially overlapping an existing one\") }\n seeCollapsedSpans();\n }\n\n if (marker.addToHistory)\n { addChangeToHistory(doc, {from: from, to: to, origin: \"markText\"}, doc.sel, NaN); }\n\n var curLine = from.line, cm = doc.cm, updateMaxLine;\n doc.iter(curLine, to.line + 1, function (line) {\n if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine)\n { updateMaxLine = true; }\n if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); }\n addMarkedSpan(line, new MarkedSpan(marker,\n curLine == from.line ? from.ch : null,\n curLine == to.line ? to.ch : null));\n ++curLine;\n });\n // lineIsHidden depends on the presence of the spans, so needs a second pass\n if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) {\n if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); }\n }); }\n\n if (marker.clearOnEnter) { on(marker, \"beforeCursorEnter\", function () { return marker.clear(); }); }\n\n if (marker.readOnly) {\n seeReadOnlySpans();\n if (doc.history.done.length || doc.history.undone.length)\n { doc.clearHistory(); }\n }\n if (marker.collapsed) {\n marker.id = ++nextMarkerId;\n marker.atomic = true;\n }\n if (cm) {\n // Sync editor state\n if (updateMaxLine) { cm.curOp.updateMaxLine = true; }\n if (marker.collapsed)\n { regChange(cm, from.line, to.line + 1); }\n else if (marker.className || marker.startStyle || marker.endStyle || marker.css ||\n marker.attributes || marker.title)\n { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, \"text\"); } }\n if (marker.atomic) { reCheckSelection(cm.doc); }\n signalLater(cm, \"markerAdded\", cm, marker);\n }\n return marker\n }\n\n // SHARED TEXTMARKERS\n\n // A shared marker spans multiple linked documents. It is\n // implemented as a meta-marker-object controlling multiple normal\n // markers.\n var SharedTextMarker = function(markers, primary) {\n var this$1 = this;\n\n this.markers = markers;\n this.primary = primary;\n for (var i = 0; i < markers.length; ++i)\n { markers[i].parent = this$1; }\n };\n\n SharedTextMarker.prototype.clear = function () {\n var this$1 = this;\n\n if (this.explicitlyCleared) { return }\n this.explicitlyCleared = true;\n for (var i = 0; i < this.markers.length; ++i)\n { this$1.markers[i].clear(); }\n signalLater(this, \"clear\");\n };\n\n SharedTextMarker.prototype.find = function (side, lineObj) {\n return this.primary.find(side, lineObj)\n };\n eventMixin(SharedTextMarker);\n\n function markTextShared(doc, from, to, options, type) {\n options = copyObj(options);\n options.shared = false;\n var markers = [markText(doc, from, to, options, type)], primary = markers[0];\n var widget = options.widgetNode;\n linkedDocs(doc, function (doc) {\n if (widget) { options.widgetNode = widget.cloneNode(true); }\n markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));\n for (var i = 0; i < doc.linked.length; ++i)\n { if (doc.linked[i].isParent) { return } }\n primary = lst(markers);\n });\n return new SharedTextMarker(markers, primary)\n }\n\n function findSharedMarkers(doc) {\n return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; })\n }\n\n function copySharedMarkers(doc, markers) {\n for (var i = 0; i < markers.length; i++) {\n var marker = markers[i], pos = marker.find();\n var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to);\n if (cmp(mFrom, mTo)) {\n var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type);\n marker.markers.push(subMark);\n subMark.parent = marker;\n }\n }\n }\n\n function detachSharedMarkers(markers) {\n var loop = function ( i ) {\n var marker = markers[i], linked = [marker.primary.doc];\n linkedDocs(marker.primary.doc, function (d) { return linked.push(d); });\n for (var j = 0; j < marker.markers.length; j++) {\n var subMarker = marker.markers[j];\n if (indexOf(linked, subMarker.doc) == -1) {\n subMarker.parent = null;\n marker.markers.splice(j--, 1);\n }\n }\n };\n\n for (var i = 0; i < markers.length; i++) loop( i );\n }\n\n var nextDocId = 0;\n var Doc = function(text, mode, firstLine, lineSep, direction) {\n if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }\n if (firstLine == null) { firstLine = 0; }\n\n BranchChunk.call(this, [new LeafChunk([new Line(\"\", null)])]);\n this.first = firstLine;\n this.scrollTop = this.scrollLeft = 0;\n this.cantEdit = false;\n this.cleanGeneration = 1;\n this.modeFrontier = this.highlightFrontier = firstLine;\n var start = Pos(firstLine, 0);\n this.sel = simpleSelection(start);\n this.history = new History(null);\n this.id = ++nextDocId;\n this.modeOption = mode;\n this.lineSep = lineSep;\n this.direction = (direction == \"rtl\") ? \"rtl\" : \"ltr\";\n this.extend = false;\n\n if (typeof text == \"string\") { text = this.splitLines(text); }\n updateDoc(this, {from: start, to: start, text: text});\n setSelection(this, simpleSelection(start), sel_dontScroll);\n };\n\n Doc.prototype = createObj(BranchChunk.prototype, {\n constructor: Doc,\n // Iterate over the document. Supports two forms -- with only one\n // argument, it calls that for each line in the document. With\n // three, it iterates over the range given by the first two (with\n // the second being non-inclusive).\n iter: function(from, to, op) {\n if (op) { this.iterN(from - this.first, to - from, op); }\n else { this.iterN(this.first, this.first + this.size, from); }\n },\n\n // Non-public interface for adding and removing lines.\n insert: function(at, lines) {\n var height = 0;\n for (var i = 0; i < lines.length; ++i) { height += lines[i].height; }\n this.insertInner(at - this.first, lines, height);\n },\n remove: function(at, n) { this.removeInner(at - this.first, n); },\n\n // From here, the methods are part of the public interface. Most\n // are also available from CodeMirror (editor) instances.\n\n getValue: function(lineSep) {\n var lines = getLines(this, this.first, this.first + this.size);\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n setValue: docMethodOp(function(code) {\n var top = Pos(this.first, 0), last = this.first + this.size - 1;\n makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),\n text: this.splitLines(code), origin: \"setValue\", full: true}, true);\n if (this.cm) { scrollToCoords(this.cm, 0, 0); }\n setSelection(this, simpleSelection(top), sel_dontScroll);\n }),\n replaceRange: function(code, from, to, origin) {\n from = clipPos(this, from);\n to = to ? clipPos(this, to) : from;\n replaceRange(this, code, from, to, origin);\n },\n getRange: function(from, to, lineSep) {\n var lines = getBetween(this, clipPos(this, from), clipPos(this, to));\n if (lineSep === false) { return lines }\n return lines.join(lineSep || this.lineSeparator())\n },\n\n getLine: function(line) {var l = this.getLineHandle(line); return l && l.text},\n\n getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }},\n getLineNumber: function(line) {return lineNo(line)},\n\n getLineHandleVisualStart: function(line) {\n if (typeof line == \"number\") { line = getLine(this, line); }\n return visualLine(line)\n },\n\n lineCount: function() {return this.size},\n firstLine: function() {return this.first},\n lastLine: function() {return this.first + this.size - 1},\n\n clipPos: function(pos) {return clipPos(this, pos)},\n\n getCursor: function(start) {\n var range$$1 = this.sel.primary(), pos;\n if (start == null || start == \"head\") { pos = range$$1.head; }\n else if (start == \"anchor\") { pos = range$$1.anchor; }\n else if (start == \"end\" || start == \"to\" || start === false) { pos = range$$1.to(); }\n else { pos = range$$1.from(); }\n return pos\n },\n listSelections: function() { return this.sel.ranges },\n somethingSelected: function() {return this.sel.somethingSelected()},\n\n setCursor: docMethodOp(function(line, ch, options) {\n setSimpleSelection(this, clipPos(this, typeof line == \"number\" ? Pos(line, ch || 0) : line), null, options);\n }),\n setSelection: docMethodOp(function(anchor, head, options) {\n setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options);\n }),\n extendSelection: docMethodOp(function(head, other, options) {\n extendSelection(this, clipPos(this, head), other && clipPos(this, other), options);\n }),\n extendSelections: docMethodOp(function(heads, options) {\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n extendSelectionsBy: docMethodOp(function(f, options) {\n var heads = map(this.sel.ranges, f);\n extendSelections(this, clipPosArray(this, heads), options);\n }),\n setSelections: docMethodOp(function(ranges, primary, options) {\n var this$1 = this;\n\n if (!ranges.length) { return }\n var out = [];\n for (var i = 0; i < ranges.length; i++)\n { out[i] = new Range(clipPos(this$1, ranges[i].anchor),\n clipPos(this$1, ranges[i].head)); }\n if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); }\n setSelection(this, normalizeSelection(this.cm, out, primary), options);\n }),\n addSelection: docMethodOp(function(anchor, head, options) {\n var ranges = this.sel.ranges.slice(0);\n ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor)));\n setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options);\n }),\n\n getSelection: function(lineSep) {\n var this$1 = this;\n\n var ranges = this.sel.ranges, lines;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n lines = lines ? lines.concat(sel) : sel;\n }\n if (lineSep === false) { return lines }\n else { return lines.join(lineSep || this.lineSeparator()) }\n },\n getSelections: function(lineSep) {\n var this$1 = this;\n\n var parts = [], ranges = this.sel.ranges;\n for (var i = 0; i < ranges.length; i++) {\n var sel = getBetween(this$1, ranges[i].from(), ranges[i].to());\n if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()); }\n parts[i] = sel;\n }\n return parts\n },\n replaceSelection: function(code, collapse, origin) {\n var dup = [];\n for (var i = 0; i < this.sel.ranges.length; i++)\n { dup[i] = code; }\n this.replaceSelections(dup, collapse, origin || \"+input\");\n },\n replaceSelections: docMethodOp(function(code, collapse, origin) {\n var this$1 = this;\n\n var changes = [], sel = this.sel;\n for (var i = 0; i < sel.ranges.length; i++) {\n var range$$1 = sel.ranges[i];\n changes[i] = {from: range$$1.from(), to: range$$1.to(), text: this$1.splitLines(code[i]), origin: origin};\n }\n var newSel = collapse && collapse != \"end\" && computeReplacedSel(this, changes, collapse);\n for (var i$1 = changes.length - 1; i$1 >= 0; i$1--)\n { makeChange(this$1, changes[i$1]); }\n if (newSel) { setSelectionReplaceHistory(this, newSel); }\n else if (this.cm) { ensureCursorVisible(this.cm); }\n }),\n undo: docMethodOp(function() {makeChangeFromHistory(this, \"undo\");}),\n redo: docMethodOp(function() {makeChangeFromHistory(this, \"redo\");}),\n undoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"undo\", true);}),\n redoSelection: docMethodOp(function() {makeChangeFromHistory(this, \"redo\", true);}),\n\n setExtending: function(val) {this.extend = val;},\n getExtending: function() {return this.extend},\n\n historySize: function() {\n var hist = this.history, done = 0, undone = 0;\n for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } }\n for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } }\n return {undo: done, redo: undone}\n },\n clearHistory: function() {this.history = new History(this.history.maxGeneration);},\n\n markClean: function() {\n this.cleanGeneration = this.changeGeneration(true);\n },\n changeGeneration: function(forceSplit) {\n if (forceSplit)\n { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; }\n return this.history.generation\n },\n isClean: function (gen) {\n return this.history.generation == (gen || this.cleanGeneration)\n },\n\n getHistory: function() {\n return {done: copyHistoryArray(this.history.done),\n undone: copyHistoryArray(this.history.undone)}\n },\n setHistory: function(histData) {\n var hist = this.history = new History(this.history.maxGeneration);\n hist.done = copyHistoryArray(histData.done.slice(0), null, true);\n hist.undone = copyHistoryArray(histData.undone.slice(0), null, true);\n },\n\n setGutterMarker: docMethodOp(function(line, gutterID, value) {\n return changeLine(this, line, \"gutter\", function (line) {\n var markers = line.gutterMarkers || (line.gutterMarkers = {});\n markers[gutterID] = value;\n if (!value && isEmpty(markers)) { line.gutterMarkers = null; }\n return true\n })\n }),\n\n clearGutter: docMethodOp(function(gutterID) {\n var this$1 = this;\n\n this.iter(function (line) {\n if (line.gutterMarkers && line.gutterMarkers[gutterID]) {\n changeLine(this$1, line, \"gutter\", function () {\n line.gutterMarkers[gutterID] = null;\n if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; }\n return true\n });\n }\n });\n }),\n\n lineInfo: function(line) {\n var n;\n if (typeof line == \"number\") {\n if (!isLine(this, line)) { return null }\n n = line;\n line = getLine(this, line);\n if (!line) { return null }\n } else {\n n = lineNo(line);\n if (n == null) { return null }\n }\n return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,\n textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,\n widgets: line.widgets}\n },\n\n addLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n if (!line[prop]) { line[prop] = cls; }\n else if (classTest(cls).test(line[prop])) { return false }\n else { line[prop] += \" \" + cls; }\n return true\n })\n }),\n removeLineClass: docMethodOp(function(handle, where, cls) {\n return changeLine(this, handle, where == \"gutter\" ? \"gutter\" : \"class\", function (line) {\n var prop = where == \"text\" ? \"textClass\"\n : where == \"background\" ? \"bgClass\"\n : where == \"gutter\" ? \"gutterClass\" : \"wrapClass\";\n var cur = line[prop];\n if (!cur) { return false }\n else if (cls == null) { line[prop] = null; }\n else {\n var found = cur.match(classTest(cls));\n if (!found) { return false }\n var end = found.index + found[0].length;\n line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? \"\" : \" \") + cur.slice(end) || null;\n }\n return true\n })\n }),\n\n addLineWidget: docMethodOp(function(handle, node, options) {\n return addLineWidget(this, handle, node, options)\n }),\n removeLineWidget: function(widget) { widget.clear(); },\n\n markText: function(from, to, options) {\n return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || \"range\")\n },\n setBookmark: function(pos, options) {\n var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),\n insertLeft: options && options.insertLeft,\n clearWhenEmpty: false, shared: options && options.shared,\n handleMouseEvents: options && options.handleMouseEvents};\n pos = clipPos(this, pos);\n return markText(this, pos, pos, realOpts, \"bookmark\")\n },\n findMarksAt: function(pos) {\n pos = clipPos(this, pos);\n var markers = [], spans = getLine(this, pos.line).markedSpans;\n if (spans) { for (var i = 0; i < spans.length; ++i) {\n var span = spans[i];\n if ((span.from == null || span.from <= pos.ch) &&\n (span.to == null || span.to >= pos.ch))\n { markers.push(span.marker.parent || span.marker); }\n } }\n return markers\n },\n findMarks: function(from, to, filter) {\n from = clipPos(this, from); to = clipPos(this, to);\n var found = [], lineNo$$1 = from.line;\n this.iter(from.line, to.line + 1, function (line) {\n var spans = line.markedSpans;\n if (spans) { for (var i = 0; i < spans.length; i++) {\n var span = spans[i];\n if (!(span.to != null && lineNo$$1 == from.line && from.ch >= span.to ||\n span.from == null && lineNo$$1 != from.line ||\n span.from != null && lineNo$$1 == to.line && span.from >= to.ch) &&\n (!filter || filter(span.marker)))\n { found.push(span.marker.parent || span.marker); }\n } }\n ++lineNo$$1;\n });\n return found\n },\n getAllMarks: function() {\n var markers = [];\n this.iter(function (line) {\n var sps = line.markedSpans;\n if (sps) { for (var i = 0; i < sps.length; ++i)\n { if (sps[i].from != null) { markers.push(sps[i].marker); } } }\n });\n return markers\n },\n\n posFromIndex: function(off) {\n var ch, lineNo$$1 = this.first, sepSize = this.lineSeparator().length;\n this.iter(function (line) {\n var sz = line.text.length + sepSize;\n if (sz > off) { ch = off; return true }\n off -= sz;\n ++lineNo$$1;\n });\n return clipPos(this, Pos(lineNo$$1, ch))\n },\n indexFromPos: function (coords) {\n coords = clipPos(this, coords);\n var index = coords.ch;\n if (coords.line < this.first || coords.ch < 0) { return 0 }\n var sepSize = this.lineSeparator().length;\n this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value\n index += line.text.length + sepSize;\n });\n return index\n },\n\n copy: function(copyHistory) {\n var doc = new Doc(getLines(this, this.first, this.first + this.size),\n this.modeOption, this.first, this.lineSep, this.direction);\n doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;\n doc.sel = this.sel;\n doc.extend = false;\n if (copyHistory) {\n doc.history.undoDepth = this.history.undoDepth;\n doc.setHistory(this.getHistory());\n }\n return doc\n },\n\n linkedDoc: function(options) {\n if (!options) { options = {}; }\n var from = this.first, to = this.first + this.size;\n if (options.from != null && options.from > from) { from = options.from; }\n if (options.to != null && options.to < to) { to = options.to; }\n var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction);\n if (options.sharedHist) { copy.history = this.history\n ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});\n copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];\n copySharedMarkers(copy, findSharedMarkers(this));\n return copy\n },\n unlinkDoc: function(other) {\n var this$1 = this;\n\n if (other instanceof CodeMirror) { other = other.doc; }\n if (this.linked) { for (var i = 0; i < this.linked.length; ++i) {\n var link = this$1.linked[i];\n if (link.doc != other) { continue }\n this$1.linked.splice(i, 1);\n other.unlinkDoc(this$1);\n detachSharedMarkers(findSharedMarkers(this$1));\n break\n } }\n // If the histories were shared, split them again\n if (other.history == this.history) {\n var splitIds = [other.id];\n linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true);\n other.history = new History(null);\n other.history.done = copyHistoryArray(this.history.done, splitIds);\n other.history.undone = copyHistoryArray(this.history.undone, splitIds);\n }\n },\n iterLinkedDocs: function(f) {linkedDocs(this, f);},\n\n getMode: function() {return this.mode},\n getEditor: function() {return this.cm},\n\n splitLines: function(str) {\n if (this.lineSep) { return str.split(this.lineSep) }\n return splitLinesAuto(str)\n },\n lineSeparator: function() { return this.lineSep || \"\\n\" },\n\n setDirection: docMethodOp(function (dir) {\n if (dir != \"rtl\") { dir = \"ltr\"; }\n if (dir == this.direction) { return }\n this.direction = dir;\n this.iter(function (line) { return line.order = null; });\n if (this.cm) { directionChanged(this.cm); }\n })\n });\n\n // Public alias.\n Doc.prototype.eachLine = Doc.prototype.iter;\n\n // Kludge to work around strange IE behavior where it'll sometimes\n // re-fire a series of drag-related events right after the drop (#1551)\n var lastDrop = 0;\n\n function onDrop(e) {\n var cm = this;\n clearDragCursor(cm);\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))\n { return }\n e_preventDefault(e);\n if (ie) { lastDrop = +new Date; }\n var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;\n if (!pos || cm.isReadOnly()) { return }\n // Might be a file drop, in which case we simply extract the text\n // and insert it.\n if (files && files.length && window.FileReader && window.File) {\n var n = files.length, text = Array(n), read = 0;\n var loadFile = function (file, i) {\n if (cm.options.allowDropFileTypes &&\n indexOf(cm.options.allowDropFileTypes, file.type) == -1)\n { return }\n\n var reader = new FileReader;\n reader.onload = operation(cm, function () {\n var content = reader.result;\n if (/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(content)) { content = \"\"; }\n text[i] = content;\n if (++read == n) {\n pos = clipPos(cm.doc, pos);\n var change = {from: pos, to: pos,\n text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())),\n origin: \"paste\"};\n makeChange(cm.doc, change);\n setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change)));\n }\n });\n reader.readAsText(file);\n };\n for (var i = 0; i < n; ++i) { loadFile(files[i], i); }\n } else { // Normal drop\n // Don't do a replace if the drop happened inside of the selected text.\n if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) {\n cm.state.draggingText(e);\n // Ensure the editor is re-focused\n setTimeout(function () { return cm.display.input.focus(); }, 20);\n return\n }\n try {\n var text$1 = e.dataTransfer.getData(\"Text\");\n if (text$1) {\n var selected;\n if (cm.state.draggingText && !cm.state.draggingText.copy)\n { selected = cm.listSelections(); }\n setSelectionNoUndo(cm.doc, simpleSelection(pos, pos));\n if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1)\n { replaceRange(cm.doc, \"\", selected[i$1].anchor, selected[i$1].head, \"drag\"); } }\n cm.replaceSelection(text$1, \"around\", \"paste\");\n cm.display.input.focus();\n }\n }\n catch(e){}\n }\n }\n\n function onDragStart(cm, e) {\n if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return }\n if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return }\n\n e.dataTransfer.setData(\"Text\", cm.getSelection());\n e.dataTransfer.effectAllowed = \"copyMove\";\n\n // Use dummy image instead of default browsers image.\n // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.\n if (e.dataTransfer.setDragImage && !safari) {\n var img = elt(\"img\", null, null, \"position: fixed; left: 0; top: 0;\");\n img.src = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n if (presto) {\n img.width = img.height = 1;\n cm.display.wrapper.appendChild(img);\n // Force a relayout, or Opera won't use our image for some obscure reason\n img._top = img.offsetTop;\n }\n e.dataTransfer.setDragImage(img, 0, 0);\n if (presto) { img.parentNode.removeChild(img); }\n }\n }\n\n function onDragOver(cm, e) {\n var pos = posFromMouse(cm, e);\n if (!pos) { return }\n var frag = document.createDocumentFragment();\n drawSelectionCursor(cm, pos, frag);\n if (!cm.display.dragCursor) {\n cm.display.dragCursor = elt(\"div\", null, \"CodeMirror-cursors CodeMirror-dragcursors\");\n cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv);\n }\n removeChildrenAndAdd(cm.display.dragCursor, frag);\n }\n\n function clearDragCursor(cm) {\n if (cm.display.dragCursor) {\n cm.display.lineSpace.removeChild(cm.display.dragCursor);\n cm.display.dragCursor = null;\n }\n }\n\n // These must be handled carefully, because naively registering a\n // handler for each editor will cause the editors to never be\n // garbage collected.\n\n function forEachCodeMirror(f) {\n if (!document.getElementsByClassName) { return }\n var byClass = document.getElementsByClassName(\"CodeMirror\"), editors = [];\n for (var i = 0; i < byClass.length; i++) {\n var cm = byClass[i].CodeMirror;\n if (cm) { editors.push(cm); }\n }\n if (editors.length) { editors[0].operation(function () {\n for (var i = 0; i < editors.length; i++) { f(editors[i]); }\n }); }\n }\n\n var globalsRegistered = false;\n function ensureGlobalHandlers() {\n if (globalsRegistered) { return }\n registerGlobalHandlers();\n globalsRegistered = true;\n }\n function registerGlobalHandlers() {\n // When the window resizes, we need to refresh active editors.\n var resizeTimer;\n on(window, \"resize\", function () {\n if (resizeTimer == null) { resizeTimer = setTimeout(function () {\n resizeTimer = null;\n forEachCodeMirror(onResize);\n }, 100); }\n });\n // When the window loses focus, we want to show the editor as blurred\n on(window, \"blur\", function () { return forEachCodeMirror(onBlur); });\n }\n // Called when the window resizes\n function onResize(cm) {\n var d = cm.display;\n // Might be a text scaling operation, clear size caches.\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n d.scrollbarsClipped = false;\n cm.setSize();\n }\n\n var keyNames = {\n 3: \"Pause\", 8: \"Backspace\", 9: \"Tab\", 13: \"Enter\", 16: \"Shift\", 17: \"Ctrl\", 18: \"Alt\",\n 19: \"Pause\", 20: \"CapsLock\", 27: \"Esc\", 32: \"Space\", 33: \"PageUp\", 34: \"PageDown\", 35: \"End\",\n 36: \"Home\", 37: \"Left\", 38: \"Up\", 39: \"Right\", 40: \"Down\", 44: \"PrintScrn\", 45: \"Insert\",\n 46: \"Delete\", 59: \";\", 61: \"=\", 91: \"Mod\", 92: \"Mod\", 93: \"Mod\",\n 106: \"*\", 107: \"=\", 109: \"-\", 110: \".\", 111: \"/\", 127: \"Delete\", 145: \"ScrollLock\",\n 173: \"-\", 186: \";\", 187: \"=\", 188: \",\", 189: \"-\", 190: \".\", 191: \"/\", 192: \"`\", 219: \"[\", 220: \"\\\\\",\n 221: \"]\", 222: \"'\", 63232: \"Up\", 63233: \"Down\", 63234: \"Left\", 63235: \"Right\", 63272: \"Delete\",\n 63273: \"Home\", 63275: \"End\", 63276: \"PageUp\", 63277: \"PageDown\", 63302: \"Insert\"\n };\n\n // Number keys\n for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); }\n // Alphabetic keys\n for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); }\n // Function keys\n for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = \"F\" + i$2; }\n\n var keyMap = {};\n\n keyMap.basic = {\n \"Left\": \"goCharLeft\", \"Right\": \"goCharRight\", \"Up\": \"goLineUp\", \"Down\": \"goLineDown\",\n \"End\": \"goLineEnd\", \"Home\": \"goLineStartSmart\", \"PageUp\": \"goPageUp\", \"PageDown\": \"goPageDown\",\n \"Delete\": \"delCharAfter\", \"Backspace\": \"delCharBefore\", \"Shift-Backspace\": \"delCharBefore\",\n \"Tab\": \"defaultTab\", \"Shift-Tab\": \"indentAuto\",\n \"Enter\": \"newlineAndIndent\", \"Insert\": \"toggleOverwrite\",\n \"Esc\": \"singleSelection\"\n };\n // Note that the save and find-related commands aren't defined by\n // default. User code or addons can define them. Unknown commands\n // are simply ignored.\n keyMap.pcDefault = {\n \"Ctrl-A\": \"selectAll\", \"Ctrl-D\": \"deleteLine\", \"Ctrl-Z\": \"undo\", \"Shift-Ctrl-Z\": \"redo\", \"Ctrl-Y\": \"redo\",\n \"Ctrl-Home\": \"goDocStart\", \"Ctrl-End\": \"goDocEnd\", \"Ctrl-Up\": \"goLineUp\", \"Ctrl-Down\": \"goLineDown\",\n \"Ctrl-Left\": \"goGroupLeft\", \"Ctrl-Right\": \"goGroupRight\", \"Alt-Left\": \"goLineStart\", \"Alt-Right\": \"goLineEnd\",\n \"Ctrl-Backspace\": \"delGroupBefore\", \"Ctrl-Delete\": \"delGroupAfter\", \"Ctrl-S\": \"save\", \"Ctrl-F\": \"find\",\n \"Ctrl-G\": \"findNext\", \"Shift-Ctrl-G\": \"findPrev\", \"Shift-Ctrl-F\": \"replace\", \"Shift-Ctrl-R\": \"replaceAll\",\n \"Ctrl-[\": \"indentLess\", \"Ctrl-]\": \"indentMore\",\n \"Ctrl-U\": \"undoSelection\", \"Shift-Ctrl-U\": \"redoSelection\", \"Alt-U\": \"redoSelection\",\n \"fallthrough\": \"basic\"\n };\n // Very basic readline/emacs-style bindings, which are standard on Mac.\n keyMap.emacsy = {\n \"Ctrl-F\": \"goCharRight\", \"Ctrl-B\": \"goCharLeft\", \"Ctrl-P\": \"goLineUp\", \"Ctrl-N\": \"goLineDown\",\n \"Alt-F\": \"goWordRight\", \"Alt-B\": \"goWordLeft\", \"Ctrl-A\": \"goLineStart\", \"Ctrl-E\": \"goLineEnd\",\n \"Ctrl-V\": \"goPageDown\", \"Shift-Ctrl-V\": \"goPageUp\", \"Ctrl-D\": \"delCharAfter\", \"Ctrl-H\": \"delCharBefore\",\n \"Alt-D\": \"delWordAfter\", \"Alt-Backspace\": \"delWordBefore\", \"Ctrl-K\": \"killLine\", \"Ctrl-T\": \"transposeChars\",\n \"Ctrl-O\": \"openLine\"\n };\n keyMap.macDefault = {\n \"Cmd-A\": \"selectAll\", \"Cmd-D\": \"deleteLine\", \"Cmd-Z\": \"undo\", \"Shift-Cmd-Z\": \"redo\", \"Cmd-Y\": \"redo\",\n \"Cmd-Home\": \"goDocStart\", \"Cmd-Up\": \"goDocStart\", \"Cmd-End\": \"goDocEnd\", \"Cmd-Down\": \"goDocEnd\", \"Alt-Left\": \"goGroupLeft\",\n \"Alt-Right\": \"goGroupRight\", \"Cmd-Left\": \"goLineLeft\", \"Cmd-Right\": \"goLineRight\", \"Alt-Backspace\": \"delGroupBefore\",\n \"Ctrl-Alt-Backspace\": \"delGroupAfter\", \"Alt-Delete\": \"delGroupAfter\", \"Cmd-S\": \"save\", \"Cmd-F\": \"find\",\n \"Cmd-G\": \"findNext\", \"Shift-Cmd-G\": \"findPrev\", \"Cmd-Alt-F\": \"replace\", \"Shift-Cmd-Alt-F\": \"replaceAll\",\n \"Cmd-[\": \"indentLess\", \"Cmd-]\": \"indentMore\", \"Cmd-Backspace\": \"delWrappedLineLeft\", \"Cmd-Delete\": \"delWrappedLineRight\",\n \"Cmd-U\": \"undoSelection\", \"Shift-Cmd-U\": \"redoSelection\", \"Ctrl-Up\": \"goDocStart\", \"Ctrl-Down\": \"goDocEnd\",\n \"fallthrough\": [\"basic\", \"emacsy\"]\n };\n keyMap[\"default\"] = mac ? keyMap.macDefault : keyMap.pcDefault;\n\n // KEYMAP DISPATCH\n\n function normalizeKeyName(name) {\n var parts = name.split(/-(?!$)/);\n name = parts[parts.length - 1];\n var alt, ctrl, shift, cmd;\n for (var i = 0; i < parts.length - 1; i++) {\n var mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; }\n else if (/^a(lt)?$/i.test(mod)) { alt = true; }\n else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; }\n else if (/^s(hift)?$/i.test(mod)) { shift = true; }\n else { throw new Error(\"Unrecognized modifier name: \" + mod) }\n }\n if (alt) { name = \"Alt-\" + name; }\n if (ctrl) { name = \"Ctrl-\" + name; }\n if (cmd) { name = \"Cmd-\" + name; }\n if (shift) { name = \"Shift-\" + name; }\n return name\n }\n\n // This is a kludge to keep keymaps mostly working as raw objects\n // (backwards compatibility) while at the same time support features\n // like normalization and multi-stroke key bindings. It compiles a\n // new normalized keymap, and then updates the old object to reflect\n // this.\n function normalizeKeyMap(keymap) {\n var copy = {};\n for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) {\n var value = keymap[keyname];\n if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue }\n if (value == \"...\") { delete keymap[keyname]; continue }\n\n var keys = map(keyname.split(\" \"), normalizeKeyName);\n for (var i = 0; i < keys.length; i++) {\n var val = (void 0), name = (void 0);\n if (i == keys.length - 1) {\n name = keys.join(\" \");\n val = value;\n } else {\n name = keys.slice(0, i + 1).join(\" \");\n val = \"...\";\n }\n var prev = copy[name];\n if (!prev) { copy[name] = val; }\n else if (prev != val) { throw new Error(\"Inconsistent bindings for \" + name) }\n }\n delete keymap[keyname];\n } }\n for (var prop in copy) { keymap[prop] = copy[prop]; }\n return keymap\n }\n\n function lookupKey(key, map$$1, handle, context) {\n map$$1 = getKeyMap(map$$1);\n var found = map$$1.call ? map$$1.call(key, context) : map$$1[key];\n if (found === false) { return \"nothing\" }\n if (found === \"...\") { return \"multi\" }\n if (found != null && handle(found)) { return \"handled\" }\n\n if (map$$1.fallthrough) {\n if (Object.prototype.toString.call(map$$1.fallthrough) != \"[object Array]\")\n { return lookupKey(key, map$$1.fallthrough, handle, context) }\n for (var i = 0; i < map$$1.fallthrough.length; i++) {\n var result = lookupKey(key, map$$1.fallthrough[i], handle, context);\n if (result) { return result }\n }\n }\n }\n\n // Modifier key presses don't count as 'real' key presses for the\n // purpose of keymap fallthrough.\n function isModifierKey(value) {\n var name = typeof value == \"string\" ? value : keyNames[value.keyCode];\n return name == \"Ctrl\" || name == \"Alt\" || name == \"Shift\" || name == \"Mod\"\n }\n\n function addModifierNames(name, event, noShift) {\n var base = name;\n if (event.altKey && base != \"Alt\") { name = \"Alt-\" + name; }\n if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != \"Ctrl\") { name = \"Ctrl-\" + name; }\n if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != \"Cmd\") { name = \"Cmd-\" + name; }\n if (!noShift && event.shiftKey && base != \"Shift\") { name = \"Shift-\" + name; }\n return name\n }\n\n // Look up the name of a key as indicated by an event object.\n function keyName(event, noShift) {\n if (presto && event.keyCode == 34 && event[\"char\"]) { return false }\n var name = keyNames[event.keyCode];\n if (name == null || event.altGraphKey) { return false }\n // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,\n // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)\n if (event.keyCode == 3 && event.code) { name = event.code; }\n return addModifierNames(name, event, noShift)\n }\n\n function getKeyMap(val) {\n return typeof val == \"string\" ? keyMap[val] : val\n }\n\n // Helper for deleting text near the selection(s), used to implement\n // backspace, delete, and similar functionality.\n function deleteNearSelection(cm, compute) {\n var ranges = cm.doc.sel.ranges, kill = [];\n // Build up a set of ranges to kill first, merging overlapping\n // ranges.\n for (var i = 0; i < ranges.length; i++) {\n var toKill = compute(ranges[i]);\n while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) {\n var replaced = kill.pop();\n if (cmp(replaced.from, toKill.from) < 0) {\n toKill.from = replaced.from;\n break\n }\n }\n kill.push(toKill);\n }\n // Next, remove those actual ranges.\n runInOp(cm, function () {\n for (var i = kill.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, \"\", kill[i].from, kill[i].to, \"+delete\"); }\n ensureCursorVisible(cm);\n });\n }\n\n function moveCharLogically(line, ch, dir) {\n var target = skipExtendingChars(line.text, ch + dir, dir);\n return target < 0 || target > line.text.length ? null : target\n }\n\n function moveLogically(line, start, dir) {\n var ch = moveCharLogically(line, start.ch, dir);\n return ch == null ? null : new Pos(start.line, ch, dir < 0 ? \"after\" : \"before\")\n }\n\n function endOfLine(visually, cm, lineObj, lineNo, dir) {\n if (visually) {\n var order = getOrder(lineObj, cm.doc.direction);\n if (order) {\n var part = dir < 0 ? lst(order) : order[0];\n var moveInStorageOrder = (dir < 0) == (part.level == 1);\n var sticky = moveInStorageOrder ? \"after\" : \"before\";\n var ch;\n // With a wrapped rtl chunk (possibly spanning multiple bidi parts),\n // it could be that the last bidi part is not on the last visual line,\n // since visual lines contain content order-consecutive chunks.\n // Thus, in rtl, we are looking for the first (content-order) character\n // in the rtl chunk that is on the last line (that is, the same line\n // as the last (content-order) character).\n if (part.level > 0 || cm.doc.direction == \"rtl\") {\n var prep = prepareMeasureForLine(cm, lineObj);\n ch = dir < 0 ? lineObj.text.length - 1 : 0;\n var targetTop = measureCharPrepared(cm, prep, ch).top;\n ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch);\n if (sticky == \"before\") { ch = moveCharLogically(lineObj, ch, 1); }\n } else { ch = dir < 0 ? part.to : part.from; }\n return new Pos(lineNo, ch, sticky)\n }\n }\n return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? \"before\" : \"after\")\n }\n\n function moveVisually(cm, line, start, dir) {\n var bidi = getOrder(line, cm.doc.direction);\n if (!bidi) { return moveLogically(line, start, dir) }\n if (start.ch >= line.text.length) {\n start.ch = line.text.length;\n start.sticky = \"before\";\n } else if (start.ch <= 0) {\n start.ch = 0;\n start.sticky = \"after\";\n }\n var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos];\n if (cm.doc.direction == \"ltr\" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {\n // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,\n // nothing interesting happens.\n return moveLogically(line, start, dir)\n }\n\n var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); };\n var prep;\n var getWrappedLineExtent = function (ch) {\n if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }\n prep = prep || prepareMeasureForLine(cm, line);\n return wrappedLineExtentChar(cm, line, prep, ch)\n };\n var wrappedLineExtent = getWrappedLineExtent(start.sticky == \"before\" ? mv(start, -1) : start.ch);\n\n if (cm.doc.direction == \"rtl\" || part.level == 1) {\n var moveInStorageOrder = (part.level == 1) == (dir < 0);\n var ch = mv(start, moveInStorageOrder ? 1 : -1);\n if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {\n // Case 2: We move within an rtl part or in an rtl editor on the same visual line\n var sticky = moveInStorageOrder ? \"before\" : \"after\";\n return new Pos(start.line, ch, sticky)\n }\n }\n\n // Case 3: Could not move within this bidi part in this visual line, so leave\n // the current bidi part\n\n var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {\n var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder\n ? new Pos(start.line, mv(ch, 1), \"before\")\n : new Pos(start.line, ch, \"after\"); };\n\n for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {\n var part = bidi[partPos];\n var moveInStorageOrder = (dir > 0) == (part.level != 1);\n var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1);\n if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }\n ch = moveInStorageOrder ? part.from : mv(part.to, -1);\n if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }\n }\n };\n\n // Case 3a: Look for other bidi parts on the same visual line\n var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent);\n if (res) { return res }\n\n // Case 3b: Look for other bidi parts on the next visual line\n var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1);\n if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {\n res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh));\n if (res) { return res }\n }\n\n // Case 4: Nowhere to move\n return null\n }\n\n // Commands are parameter-less actions that can be performed on an\n // editor, mostly used for keybindings.\n var commands = {\n selectAll: selectAll,\n singleSelection: function (cm) { return cm.setSelection(cm.getCursor(\"anchor\"), cm.getCursor(\"head\"), sel_dontScroll); },\n killLine: function (cm) { return deleteNearSelection(cm, function (range) {\n if (range.empty()) {\n var len = getLine(cm.doc, range.head.line).text.length;\n if (range.head.ch == len && range.head.line < cm.lastLine())\n { return {from: range.head, to: Pos(range.head.line + 1, 0)} }\n else\n { return {from: range.head, to: Pos(range.head.line, len)} }\n } else {\n return {from: range.from(), to: range.to()}\n }\n }); },\n deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0),\n to: clipPos(cm.doc, Pos(range.to().line + 1, 0))\n }); }); },\n delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({\n from: Pos(range.from().line, 0), to: range.from()\n }); }); },\n delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var leftPos = cm.coordsChar({left: 0, top: top}, \"div\");\n return {from: leftPos, to: range.from()}\n }); },\n delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) {\n var top = cm.charCoords(range.head, \"div\").top + 5;\n var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\");\n return {from: range.from(), to: rightPos }\n }); },\n undo: function (cm) { return cm.undo(); },\n redo: function (cm) { return cm.redo(); },\n undoSelection: function (cm) { return cm.undoSelection(); },\n redoSelection: function (cm) { return cm.redoSelection(); },\n goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); },\n goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); },\n goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); },\n {origin: \"+move\", bias: 1}\n ); },\n goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); },\n {origin: \"+move\", bias: -1}\n ); },\n goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, \"div\")\n }, sel_move); },\n goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n return cm.coordsChar({left: 0, top: top}, \"div\")\n }, sel_move); },\n goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {\n var top = cm.cursorCoords(range.head, \"div\").top + 5;\n var pos = cm.coordsChar({left: 0, top: top}, \"div\");\n if (pos.ch < cm.getLine(pos.line).search(/\\S/)) { return lineStartSmart(cm, range.head) }\n return pos\n }, sel_move); },\n goLineUp: function (cm) { return cm.moveV(-1, \"line\"); },\n goLineDown: function (cm) { return cm.moveV(1, \"line\"); },\n goPageUp: function (cm) { return cm.moveV(-1, \"page\"); },\n goPageDown: function (cm) { return cm.moveV(1, \"page\"); },\n goCharLeft: function (cm) { return cm.moveH(-1, \"char\"); },\n goCharRight: function (cm) { return cm.moveH(1, \"char\"); },\n goColumnLeft: function (cm) { return cm.moveH(-1, \"column\"); },\n goColumnRight: function (cm) { return cm.moveH(1, \"column\"); },\n goWordLeft: function (cm) { return cm.moveH(-1, \"word\"); },\n goGroupRight: function (cm) { return cm.moveH(1, \"group\"); },\n goGroupLeft: function (cm) { return cm.moveH(-1, \"group\"); },\n goWordRight: function (cm) { return cm.moveH(1, \"word\"); },\n delCharBefore: function (cm) { return cm.deleteH(-1, \"char\"); },\n delCharAfter: function (cm) { return cm.deleteH(1, \"char\"); },\n delWordBefore: function (cm) { return cm.deleteH(-1, \"word\"); },\n delWordAfter: function (cm) { return cm.deleteH(1, \"word\"); },\n delGroupBefore: function (cm) { return cm.deleteH(-1, \"group\"); },\n delGroupAfter: function (cm) { return cm.deleteH(1, \"group\"); },\n indentAuto: function (cm) { return cm.indentSelection(\"smart\"); },\n indentMore: function (cm) { return cm.indentSelection(\"add\"); },\n indentLess: function (cm) { return cm.indentSelection(\"subtract\"); },\n insertTab: function (cm) { return cm.replaceSelection(\"\\t\"); },\n insertSoftTab: function (cm) {\n var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize;\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].from();\n var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize);\n spaces.push(spaceStr(tabSize - col % tabSize));\n }\n cm.replaceSelections(spaces);\n },\n defaultTab: function (cm) {\n if (cm.somethingSelected()) { cm.indentSelection(\"add\"); }\n else { cm.execCommand(\"insertTab\"); }\n },\n // Swap the two chars left and right of each selection's head.\n // Move cursor behind the two swapped characters afterwards.\n //\n // Doesn't consider line feeds a character.\n // Doesn't scan more than one line above to find a character.\n // Doesn't do anything on an empty line.\n // Doesn't do anything with non-empty selections.\n transposeChars: function (cm) { return runInOp(cm, function () {\n var ranges = cm.listSelections(), newSel = [];\n for (var i = 0; i < ranges.length; i++) {\n if (!ranges[i].empty()) { continue }\n var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text;\n if (line) {\n if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); }\n if (cur.ch > 0) {\n cur = new Pos(cur.line, cur.ch + 1);\n cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2),\n Pos(cur.line, cur.ch - 2), cur, \"+transpose\");\n } else if (cur.line > cm.doc.first) {\n var prev = getLine(cm.doc, cur.line - 1).text;\n if (prev) {\n cur = new Pos(cur.line, 1);\n cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() +\n prev.charAt(prev.length - 1),\n Pos(cur.line - 1, prev.length - 1), cur, \"+transpose\");\n }\n }\n }\n newSel.push(new Range(cur, cur));\n }\n cm.setSelections(newSel);\n }); },\n newlineAndIndent: function (cm) { return runInOp(cm, function () {\n var sels = cm.listSelections();\n for (var i = sels.length - 1; i >= 0; i--)\n { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, \"+input\"); }\n sels = cm.listSelections();\n for (var i$1 = 0; i$1 < sels.length; i$1++)\n { cm.indentLine(sels[i$1].from().line, null, true); }\n ensureCursorVisible(cm);\n }); },\n openLine: function (cm) { return cm.replaceSelection(\"\\n\", \"start\"); },\n toggleOverwrite: function (cm) { return cm.toggleOverwrite(); }\n };\n\n\n function lineStart(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLine(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, visual, lineN, 1)\n }\n function lineEnd(cm, lineN) {\n var line = getLine(cm.doc, lineN);\n var visual = visualLineEnd(line);\n if (visual != line) { lineN = lineNo(visual); }\n return endOfLine(true, cm, line, lineN, -1)\n }\n function lineStartSmart(cm, pos) {\n var start = lineStart(cm, pos.line);\n var line = getLine(cm.doc, start.line);\n var order = getOrder(line, cm.doc.direction);\n if (!order || order[0].level == 0) {\n var firstNonWS = Math.max(0, line.text.search(/\\S/));\n var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch;\n return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky)\n }\n return start\n }\n\n // Run a handler that was bound to a key.\n function doHandleBinding(cm, bound, dropShift) {\n if (typeof bound == \"string\") {\n bound = commands[bound];\n if (!bound) { return false }\n }\n // Ensure previous input has been read, so that the handler sees a\n // consistent view of the document\n cm.display.input.ensurePolled();\n var prevShift = cm.display.shift, done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n if (dropShift) { cm.display.shift = false; }\n done = bound(cm) != Pass;\n } finally {\n cm.display.shift = prevShift;\n cm.state.suppressEdits = false;\n }\n return done\n }\n\n function lookupKeyForEditor(cm, name, handle) {\n for (var i = 0; i < cm.state.keyMaps.length; i++) {\n var result = lookupKey(name, cm.state.keyMaps[i], handle, cm);\n if (result) { return result }\n }\n return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm))\n || lookupKey(name, cm.options.keyMap, handle, cm)\n }\n\n // Note that, despite the name, this function is also used to check\n // for bound mouse clicks.\n\n var stopSeq = new Delayed;\n\n function dispatchKey(cm, name, e, handle) {\n var seq = cm.state.keySeq;\n if (seq) {\n if (isModifierKey(name)) { return \"handled\" }\n if (/\\'$/.test(name))\n { cm.state.keySeq = null; }\n else\n { stopSeq.set(50, function () {\n if (cm.state.keySeq == seq) {\n cm.state.keySeq = null;\n cm.display.input.reset();\n }\n }); }\n if (dispatchKeyInner(cm, seq + \" \" + name, e, handle)) { return true }\n }\n return dispatchKeyInner(cm, name, e, handle)\n }\n\n function dispatchKeyInner(cm, name, e, handle) {\n var result = lookupKeyForEditor(cm, name, handle);\n\n if (result == \"multi\")\n { cm.state.keySeq = name; }\n if (result == \"handled\")\n { signalLater(cm, \"keyHandled\", cm, name, e); }\n\n if (result == \"handled\" || result == \"multi\") {\n e_preventDefault(e);\n restartBlink(cm);\n }\n\n return !!result\n }\n\n // Handle a key from the keydown event.\n function handleKeyBinding(cm, e) {\n var name = keyName(e, true);\n if (!name) { return false }\n\n if (e.shiftKey && !cm.state.keySeq) {\n // First try to resolve full name (including 'Shift-'). Failing\n // that, see if there is a cursor-motion command (starting with\n // 'go') bound to the keyname without 'Shift-'.\n return dispatchKey(cm, \"Shift-\" + name, e, function (b) { return doHandleBinding(cm, b, true); })\n || dispatchKey(cm, name, e, function (b) {\n if (typeof b == \"string\" ? /^go[A-Z]/.test(b) : b.motion)\n { return doHandleBinding(cm, b) }\n })\n } else {\n return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); })\n }\n }\n\n // Handle a key from the keypress event\n function handleCharBinding(cm, e, ch) {\n return dispatchKey(cm, \"'\" + ch + \"'\", e, function (b) { return doHandleBinding(cm, b, true); })\n }\n\n var lastStoppedKey = null;\n function onKeyDown(e) {\n var cm = this;\n cm.curOp.focus = activeElt();\n if (signalDOMEvent(cm, e)) { return }\n // IE does strange things with escape.\n if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; }\n var code = e.keyCode;\n cm.display.shift = code == 16 || e.shiftKey;\n var handled = handleKeyBinding(cm, e);\n if (presto) {\n lastStoppedKey = handled ? code : null;\n // Opera has no cut event... we try to at least catch the key combo\n if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))\n { cm.replaceSelection(\"\", null, \"cut\"); }\n }\n\n // Turn mouse into crosshair when Alt is held on Mac.\n if (code == 18 && !/\\bCodeMirror-crosshair\\b/.test(cm.display.lineDiv.className))\n { showCrossHair(cm); }\n }\n\n function showCrossHair(cm) {\n var lineDiv = cm.display.lineDiv;\n addClass(lineDiv, \"CodeMirror-crosshair\");\n\n function up(e) {\n if (e.keyCode == 18 || !e.altKey) {\n rmClass(lineDiv, \"CodeMirror-crosshair\");\n off(document, \"keyup\", up);\n off(document, \"mouseover\", up);\n }\n }\n on(document, \"keyup\", up);\n on(document, \"mouseover\", up);\n }\n\n function onKeyUp(e) {\n if (e.keyCode == 16) { this.doc.sel.shift = false; }\n signalDOMEvent(this, e);\n }\n\n function onKeyPress(e) {\n var cm = this;\n if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return }\n var keyCode = e.keyCode, charCode = e.charCode;\n if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return}\n if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return }\n var ch = String.fromCharCode(charCode == null ? keyCode : charCode);\n // Some browsers fire keypress events for backspace\n if (ch == \"\\x08\") { return }\n if (handleCharBinding(cm, e, ch)) { return }\n cm.display.input.onKeyPress(e);\n }\n\n var DOUBLECLICK_DELAY = 400;\n\n var PastClick = function(time, pos, button) {\n this.time = time;\n this.pos = pos;\n this.button = button;\n };\n\n PastClick.prototype.compare = function (time, pos, button) {\n return this.time + DOUBLECLICK_DELAY > time &&\n cmp(pos, this.pos) == 0 && button == this.button\n };\n\n var lastClick, lastDoubleClick;\n function clickRepeat(pos, button) {\n var now = +new Date;\n if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {\n lastClick = lastDoubleClick = null;\n return \"triple\"\n } else if (lastClick && lastClick.compare(now, pos, button)) {\n lastDoubleClick = new PastClick(now, pos, button);\n lastClick = null;\n return \"double\"\n } else {\n lastClick = new PastClick(now, pos, button);\n lastDoubleClick = null;\n return \"single\"\n }\n }\n\n // A mouse down can be a single click, double click, triple click,\n // start of selection drag, start of text drag, new cursor\n // (ctrl-click), rectangle drag (alt-drag), or xwin\n // middle-click-paste. Or it might be a click on something we should\n // not interfere with, such as a scrollbar or widget.\n function onMouseDown(e) {\n var cm = this, display = cm.display;\n if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }\n display.input.ensurePolled();\n display.shift = e.shiftKey;\n\n if (eventInWidget(display, e)) {\n if (!webkit) {\n // Briefly turn off draggability, to allow widgets to do\n // normal dragging things.\n display.scroller.draggable = false;\n setTimeout(function () { return display.scroller.draggable = true; }, 100);\n }\n return\n }\n if (clickInGutter(cm, e)) { return }\n var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : \"single\";\n window.focus();\n\n // #3261: make sure, that we're not starting a second selection\n if (button == 1 && cm.state.selectingText)\n { cm.state.selectingText(e); }\n\n if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }\n\n if (button == 1) {\n if (pos) { leftButtonDown(cm, pos, repeat, e); }\n else if (e_target(e) == display.scroller) { e_preventDefault(e); }\n } else if (button == 2) {\n if (pos) { extendSelection(cm.doc, pos); }\n setTimeout(function () { return display.input.focus(); }, 20);\n } else if (button == 3) {\n if (captureRightClick) { cm.display.input.onContextMenu(e); }\n else { delayBlurEvent(cm); }\n }\n }\n\n function handleMappedButton(cm, button, pos, repeat, event) {\n var name = \"Click\";\n if (repeat == \"double\") { name = \"Double\" + name; }\n else if (repeat == \"triple\") { name = \"Triple\" + name; }\n name = (button == 1 ? \"Left\" : button == 2 ? \"Middle\" : \"Right\") + name;\n\n return dispatchKey(cm, addModifierNames(name, event), event, function (bound) {\n if (typeof bound == \"string\") { bound = commands[bound]; }\n if (!bound) { return false }\n var done = false;\n try {\n if (cm.isReadOnly()) { cm.state.suppressEdits = true; }\n done = bound(cm, pos) != Pass;\n } finally {\n cm.state.suppressEdits = false;\n }\n return done\n })\n }\n\n function configureMouse(cm, repeat, event) {\n var option = cm.getOption(\"configureMouse\");\n var value = option ? option(cm, repeat, event) : {};\n if (value.unit == null) {\n var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey;\n value.unit = rect ? \"rectangle\" : repeat == \"single\" ? \"char\" : repeat == \"double\" ? \"word\" : \"line\";\n }\n if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; }\n if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; }\n if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); }\n return value\n }\n\n function leftButtonDown(cm, pos, repeat, event) {\n if (ie) { setTimeout(bind(ensureFocus, cm), 0); }\n else { cm.curOp.focus = activeElt(); }\n\n var behavior = configureMouse(cm, repeat, event);\n\n var sel = cm.doc.sel, contained;\n if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&\n repeat == \"single\" && (contained = sel.contains(pos)) > -1 &&\n (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&\n (cmp(contained.to(), pos) > 0 || pos.xRel < 0))\n { leftButtonStartDrag(cm, event, pos, behavior); }\n else\n { leftButtonSelect(cm, event, pos, behavior); }\n }\n\n // Start a text drag. When it ends, see if any dragging actually\n // happen, and treat as a click if it didn't.\n function leftButtonStartDrag(cm, event, pos, behavior) {\n var display = cm.display, moved = false;\n var dragEnd = operation(cm, function (e) {\n if (webkit) { display.scroller.draggable = false; }\n cm.state.draggingText = false;\n off(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n off(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n off(display.scroller, \"dragstart\", dragStart);\n off(display.scroller, \"drop\", dragEnd);\n if (!moved) {\n e_preventDefault(e);\n if (!behavior.addNew)\n { extendSelection(cm.doc, pos, null, null, behavior.extend); }\n // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)\n if (webkit || ie && ie_version == 9)\n { setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus();}, 20); }\n else\n { display.input.focus(); }\n }\n });\n var mouseMove = function(e2) {\n moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10;\n };\n var dragStart = function () { return moved = true; };\n // Let the drag handler handle this.\n if (webkit) { display.scroller.draggable = true; }\n cm.state.draggingText = dragEnd;\n dragEnd.copy = !behavior.moveOnDrag;\n // IE's approach to draggable\n if (display.scroller.dragDrop) { display.scroller.dragDrop(); }\n on(display.wrapper.ownerDocument, \"mouseup\", dragEnd);\n on(display.wrapper.ownerDocument, \"mousemove\", mouseMove);\n on(display.scroller, \"dragstart\", dragStart);\n on(display.scroller, \"drop\", dragEnd);\n\n delayBlurEvent(cm);\n setTimeout(function () { return display.input.focus(); }, 20);\n }\n\n function rangeForUnit(cm, pos, unit) {\n if (unit == \"char\") { return new Range(pos, pos) }\n if (unit == \"word\") { return cm.findWordAt(pos) }\n if (unit == \"line\") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }\n var result = unit(cm, pos);\n return new Range(result.from, result.to)\n }\n\n // Normal selection, as opposed to text dragging.\n function leftButtonSelect(cm, event, start, behavior) {\n var display = cm.display, doc = cm.doc;\n e_preventDefault(event);\n\n var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;\n if (behavior.addNew && !behavior.extend) {\n ourIndex = doc.sel.contains(start);\n if (ourIndex > -1)\n { ourRange = ranges[ourIndex]; }\n else\n { ourRange = new Range(start, start); }\n } else {\n ourRange = doc.sel.primary();\n ourIndex = doc.sel.primIndex;\n }\n\n if (behavior.unit == \"rectangle\") {\n if (!behavior.addNew) { ourRange = new Range(start, start); }\n start = posFromMouse(cm, event, true, true);\n ourIndex = -1;\n } else {\n var range$$1 = rangeForUnit(cm, start, behavior.unit);\n if (behavior.extend)\n { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); }\n else\n { ourRange = range$$1; }\n }\n\n if (!behavior.addNew) {\n ourIndex = 0;\n setSelection(doc, new Selection([ourRange], 0), sel_mouse);\n startSel = doc.sel;\n } else if (ourIndex == -1) {\n ourIndex = ranges.length;\n setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex),\n {scroll: false, origin: \"*mouse\"});\n } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == \"char\" && !behavior.extend) {\n setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),\n {scroll: false, origin: \"*mouse\"});\n startSel = doc.sel;\n } else {\n replaceOneSelection(doc, ourIndex, ourRange, sel_mouse);\n }\n\n var lastPos = start;\n function extendTo(pos) {\n if (cmp(lastPos, pos) == 0) { return }\n lastPos = pos;\n\n if (behavior.unit == \"rectangle\") {\n var ranges = [], tabSize = cm.options.tabSize;\n var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize);\n var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize);\n var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol);\n for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line));\n line <= end; line++) {\n var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize);\n if (left == right)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); }\n else if (text.length > leftPos)\n { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); }\n }\n if (!ranges.length) { ranges.push(new Range(start, start)); }\n setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex),\n {origin: \"*mouse\", scroll: false});\n cm.scrollIntoView(pos);\n } else {\n var oldRange = ourRange;\n var range$$1 = rangeForUnit(cm, pos, behavior.unit);\n var anchor = oldRange.anchor, head;\n if (cmp(range$$1.anchor, anchor) > 0) {\n head = range$$1.head;\n anchor = minPos(oldRange.from(), range$$1.anchor);\n } else {\n head = range$$1.anchor;\n anchor = maxPos(oldRange.to(), range$$1.head);\n }\n var ranges$1 = startSel.ranges.slice(0);\n ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head));\n setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse);\n }\n }\n\n var editorSize = display.wrapper.getBoundingClientRect();\n // Used to ensure timeout re-tries don't fire when another extend\n // happened in the meantime (clearTimeout isn't reliable -- at\n // least on Chrome, the timeouts still happen even when cleared,\n // if the clear happens after their scheduled firing time).\n var counter = 0;\n\n function extend(e) {\n var curCount = ++counter;\n var cur = posFromMouse(cm, e, true, behavior.unit == \"rectangle\");\n if (!cur) { return }\n if (cmp(cur, lastPos) != 0) {\n cm.curOp.focus = activeElt();\n extendTo(cur);\n var visible = visibleLines(display, doc);\n if (cur.line >= visible.to || cur.line < visible.from)\n { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }\n } else {\n var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;\n if (outside) { setTimeout(operation(cm, function () {\n if (counter != curCount) { return }\n display.scroller.scrollTop += outside;\n extend(e);\n }), 50); }\n }\n }\n\n function done(e) {\n cm.state.selectingText = false;\n counter = Infinity;\n e_preventDefault(e);\n display.input.focus();\n off(display.wrapper.ownerDocument, \"mousemove\", move);\n off(display.wrapper.ownerDocument, \"mouseup\", up);\n doc.history.lastSelOrigin = null;\n }\n\n var move = operation(cm, function (e) {\n if (e.buttons === 0 || !e_button(e)) { done(e); }\n else { extend(e); }\n });\n var up = operation(cm, done);\n cm.state.selectingText = up;\n on(display.wrapper.ownerDocument, \"mousemove\", move);\n on(display.wrapper.ownerDocument, \"mouseup\", up);\n }\n\n // Used when mouse-selecting to adjust the anchor to the proper side\n // of a bidi jump depending on the visual position of the head.\n function bidiSimplify(cm, range$$1) {\n var anchor = range$$1.anchor;\n var head = range$$1.head;\n var anchorLine = getLine(cm.doc, anchor.line);\n if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 }\n var order = getOrder(anchorLine);\n if (!order) { return range$$1 }\n var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index];\n if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 }\n var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1);\n if (boundary == 0 || boundary == order.length) { return range$$1 }\n\n // Compute the relative visual position of the head compared to the\n // anchor (<0 is to the left, >0 to the right)\n var leftSide;\n if (head.line != anchor.line) {\n leftSide = (head.line - anchor.line) * (cm.doc.direction == \"ltr\" ? 1 : -1) > 0;\n } else {\n var headIndex = getBidiPartAt(order, head.ch, head.sticky);\n var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1);\n if (headIndex == boundary - 1 || headIndex == boundary)\n { leftSide = dir < 0; }\n else\n { leftSide = dir > 0; }\n }\n\n var usePart = order[boundary + (leftSide ? -1 : 0)];\n var from = leftSide == (usePart.level == 1);\n var ch = from ? usePart.from : usePart.to, sticky = from ? \"after\" : \"before\";\n return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head)\n }\n\n\n // Determines whether an event happened in the gutter, and fires the\n // handlers for the corresponding event.\n function gutterEvent(cm, e, type, prevent) {\n var mX, mY;\n if (e.touches) {\n mX = e.touches[0].clientX;\n mY = e.touches[0].clientY;\n } else {\n try { mX = e.clientX; mY = e.clientY; }\n catch(e) { return false }\n }\n if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }\n if (prevent) { e_preventDefault(e); }\n\n var display = cm.display;\n var lineBox = display.lineDiv.getBoundingClientRect();\n\n if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }\n mY -= lineBox.top - display.viewOffset;\n\n for (var i = 0; i < cm.options.gutters.length; ++i) {\n var g = display.gutters.childNodes[i];\n if (g && g.getBoundingClientRect().right >= mX) {\n var line = lineAtHeight(cm.doc, mY);\n var gutter = cm.options.gutters[i];\n signal(cm, type, cm, line, gutter, e);\n return e_defaultPrevented(e)\n }\n }\n }\n\n function clickInGutter(cm, e) {\n return gutterEvent(cm, e, \"gutterClick\", true)\n }\n\n // CONTEXT MENU HANDLING\n\n // To make the context menu work, we need to briefly unhide the\n // textarea (making it as unobtrusive as possible) to let the\n // right-click take effect on it.\n function onContextMenu(cm, e) {\n if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return }\n if (signalDOMEvent(cm, e, \"contextmenu\")) { return }\n if (!captureRightClick) { cm.display.input.onContextMenu(e); }\n }\n\n function contextMenuInGutter(cm, e) {\n if (!hasHandler(cm, \"gutterContextMenu\")) { return false }\n return gutterEvent(cm, e, \"gutterContextMenu\", false)\n }\n\n function themeChanged(cm) {\n cm.display.wrapper.className = cm.display.wrapper.className.replace(/\\s*cm-s-\\S+/g, \"\") +\n cm.options.theme.replace(/(^|\\s)\\s*/g, \" cm-s-\");\n clearCaches(cm);\n }\n\n var Init = {toString: function(){return \"CodeMirror.Init\"}};\n\n var defaults = {};\n var optionHandlers = {};\n\n function defineOptions(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n function option(name, deflt, handle, notOnInit) {\n CodeMirror.defaults[name] = deflt;\n if (handle) { optionHandlers[name] =\n notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; }\n }\n\n CodeMirror.defineOption = option;\n\n // Passed to option handlers when there is no old value.\n CodeMirror.Init = Init;\n\n // These two are, on init, called from the constructor because they\n // have to be initialized before the editor can start at all.\n option(\"value\", \"\", function (cm, val) { return cm.setValue(val); }, true);\n option(\"mode\", null, function (cm, val) {\n cm.doc.modeOption = val;\n loadMode(cm);\n }, true);\n\n option(\"indentUnit\", 2, loadMode, true);\n option(\"indentWithTabs\", false);\n option(\"smartIndent\", true);\n option(\"tabSize\", 4, function (cm) {\n resetModeState(cm);\n clearCaches(cm);\n regChange(cm);\n }, true);\n\n option(\"lineSeparator\", null, function (cm, val) {\n cm.doc.lineSep = val;\n if (!val) { return }\n var newBreaks = [], lineNo = cm.doc.first;\n cm.doc.iter(function (line) {\n for (var pos = 0;;) {\n var found = line.text.indexOf(val, pos);\n if (found == -1) { break }\n pos = found + val.length;\n newBreaks.push(Pos(lineNo, found));\n }\n lineNo++;\n });\n for (var i = newBreaks.length - 1; i >= 0; i--)\n { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); }\n });\n option(\"specialChars\", /[\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b-\\u200f\\u2028\\u2029\\ufeff]/g, function (cm, val, old) {\n cm.state.specialChars = new RegExp(val.source + (val.test(\"\\t\") ? \"\" : \"|\\t\"), \"g\");\n if (old != Init) { cm.refresh(); }\n });\n option(\"specialCharPlaceholder\", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true);\n option(\"electricChars\", true);\n option(\"inputStyle\", mobile ? \"contenteditable\" : \"textarea\", function () {\n throw new Error(\"inputStyle can not (yet) be changed in a running editor\") // FIXME\n }, true);\n option(\"spellcheck\", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true);\n option(\"autocorrect\", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true);\n option(\"autocapitalize\", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true);\n option(\"rtlMoveVisually\", !windows);\n option(\"wholeLineUpdateBefore\", true);\n\n option(\"theme\", \"default\", function (cm) {\n themeChanged(cm);\n guttersChanged(cm);\n }, true);\n option(\"keyMap\", \"default\", function (cm, val, old) {\n var next = getKeyMap(val);\n var prev = old != Init && getKeyMap(old);\n if (prev && prev.detach) { prev.detach(cm, next); }\n if (next.attach) { next.attach(cm, prev || null); }\n });\n option(\"extraKeys\", null);\n option(\"configureMouse\", null);\n\n option(\"lineWrapping\", false, wrappingChanged, true);\n option(\"gutters\", [], function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"fixedGutter\", true, function (cm, val) {\n cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + \"px\" : \"0\";\n cm.refresh();\n }, true);\n option(\"coverGutterNextToScrollbar\", false, function (cm) { return updateScrollbars(cm); }, true);\n option(\"scrollbarStyle\", \"native\", function (cm) {\n initScrollbars(cm);\n updateScrollbars(cm);\n cm.display.scrollbars.setScrollTop(cm.doc.scrollTop);\n cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft);\n }, true);\n option(\"lineNumbers\", false, function (cm) {\n setGuttersForLineNumbers(cm.options);\n guttersChanged(cm);\n }, true);\n option(\"firstLineNumber\", 1, guttersChanged, true);\n option(\"lineNumberFormatter\", function (integer) { return integer; }, guttersChanged, true);\n option(\"showCursorWhenSelecting\", false, updateSelection, true);\n\n option(\"resetSelectionOnContextMenu\", true);\n option(\"lineWiseCopyCut\", true);\n option(\"pasteLinesPerSelection\", true);\n option(\"selectionsMayTouch\", false);\n\n option(\"readOnly\", false, function (cm, val) {\n if (val == \"nocursor\") {\n onBlur(cm);\n cm.display.input.blur();\n }\n cm.display.input.readOnlyChanged(val);\n });\n option(\"disableInput\", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true);\n option(\"dragDrop\", true, dragDropChanged);\n option(\"allowDropFileTypes\", null);\n\n option(\"cursorBlinkRate\", 530);\n option(\"cursorScrollMargin\", 0);\n option(\"cursorHeight\", 1, updateSelection, true);\n option(\"singleCursorHeightPerLine\", true, updateSelection, true);\n option(\"workTime\", 100);\n option(\"workDelay\", 100);\n option(\"flattenSpans\", true, resetModeState, true);\n option(\"addModeClass\", false, resetModeState, true);\n option(\"pollInterval\", 100);\n option(\"undoDepth\", 200, function (cm, val) { return cm.doc.history.undoDepth = val; });\n option(\"historyEventDelay\", 1250);\n option(\"viewportMargin\", 10, function (cm) { return cm.refresh(); }, true);\n option(\"maxHighlightLength\", 10000, resetModeState, true);\n option(\"moveInputWithCursor\", true, function (cm, val) {\n if (!val) { cm.display.input.resetPosition(); }\n });\n\n option(\"tabindex\", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || \"\"; });\n option(\"autofocus\", null);\n option(\"direction\", \"ltr\", function (cm, val) { return cm.doc.setDirection(val); }, true);\n option(\"phrases\", null);\n }\n\n function guttersChanged(cm) {\n updateGutters(cm);\n regChange(cm);\n alignHorizontally(cm);\n }\n\n function dragDropChanged(cm, value, old) {\n var wasOn = old && old != Init;\n if (!value != !wasOn) {\n var funcs = cm.display.dragFunctions;\n var toggle = value ? on : off;\n toggle(cm.display.scroller, \"dragstart\", funcs.start);\n toggle(cm.display.scroller, \"dragenter\", funcs.enter);\n toggle(cm.display.scroller, \"dragover\", funcs.over);\n toggle(cm.display.scroller, \"dragleave\", funcs.leave);\n toggle(cm.display.scroller, \"drop\", funcs.drop);\n }\n }\n\n function wrappingChanged(cm) {\n if (cm.options.lineWrapping) {\n addClass(cm.display.wrapper, \"CodeMirror-wrap\");\n cm.display.sizer.style.minWidth = \"\";\n cm.display.sizerWidth = null;\n } else {\n rmClass(cm.display.wrapper, \"CodeMirror-wrap\");\n findMaxLine(cm);\n }\n estimateLineHeights(cm);\n regChange(cm);\n clearCaches(cm);\n setTimeout(function () { return updateScrollbars(cm); }, 100);\n }\n\n // A CodeMirror instance represents an editor. This is the object\n // that user code is usually dealing with.\n\n function CodeMirror(place, options) {\n var this$1 = this;\n\n if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) }\n\n this.options = options = options ? copyObj(options) : {};\n // Determine effective options based on given values and defaults.\n copyObj(defaults, options, false);\n setGuttersForLineNumbers(options);\n\n var doc = options.value;\n if (typeof doc == \"string\") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); }\n else if (options.mode) { doc.modeOption = options.mode; }\n this.doc = doc;\n\n var input = new CodeMirror.inputStyles[options.inputStyle](this);\n var display = this.display = new Display(place, doc, input);\n display.wrapper.CodeMirror = this;\n updateGutters(this);\n themeChanged(this);\n if (options.lineWrapping)\n { this.display.wrapper.className += \" CodeMirror-wrap\"; }\n initScrollbars(this);\n\n this.state = {\n keyMaps: [], // stores maps added by addKeyMap\n overlays: [], // highlighting overlays, as added by addOverlay\n modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info\n overwrite: false,\n delayingBlurEvent: false,\n focused: false,\n suppressEdits: false, // used to disable editing during key handlers when in readOnly mode\n pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll\n selectingText: false,\n draggingText: false,\n highlight: new Delayed(), // stores highlight worker timeout\n keySeq: null, // Unfinished key sequence\n specialChars: null\n };\n\n if (options.autofocus && !mobile) { display.input.focus(); }\n\n // Override magic textarea content restore that IE sometimes does\n // on our hidden textarea on reload\n if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); }\n\n registerEventHandlers(this);\n ensureGlobalHandlers();\n\n startOperation(this);\n this.curOp.forceUpdate = true;\n attachDoc(this, doc);\n\n if ((options.autofocus && !mobile) || this.hasFocus())\n { setTimeout(bind(onFocus, this), 20); }\n else\n { onBlur(this); }\n\n for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt))\n { optionHandlers[opt](this$1, options[opt], Init); } }\n maybeUpdateLineNumberWidth(this);\n if (options.finishInit) { options.finishInit(this); }\n for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1); }\n endOperation(this);\n // Suppress optimizelegibility in Webkit, since it breaks text\n // measuring on line wrapping boundaries.\n if (webkit && options.lineWrapping &&\n getComputedStyle(display.lineDiv).textRendering == \"optimizelegibility\")\n { display.lineDiv.style.textRendering = \"auto\"; }\n }\n\n // The default configuration options.\n CodeMirror.defaults = defaults;\n // Functions to run when options are changed.\n CodeMirror.optionHandlers = optionHandlers;\n\n // Attach the necessary event handlers when initializing the editor\n function registerEventHandlers(cm) {\n var d = cm.display;\n on(d.scroller, \"mousedown\", operation(cm, onMouseDown));\n // Older IE's will not fire a second mousedown for a double click\n if (ie && ie_version < 11)\n { on(d.scroller, \"dblclick\", operation(cm, function (e) {\n if (signalDOMEvent(cm, e)) { return }\n var pos = posFromMouse(cm, e);\n if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return }\n e_preventDefault(e);\n var word = cm.findWordAt(pos);\n extendSelection(cm.doc, word.anchor, word.head);\n })); }\n else\n { on(d.scroller, \"dblclick\", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); }\n // Some browsers fire contextmenu *after* opening the menu, at\n // which point we can't mess with it anymore. Context menu is\n // handled in onMouseDown for these browsers.\n on(d.scroller, \"contextmenu\", function (e) { return onContextMenu(cm, e); });\n\n // Used to suppress mouse event handling when a touch happens\n var touchFinished, prevTouch = {end: 0};\n function finishTouch() {\n if (d.activeTouch) {\n touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000);\n prevTouch = d.activeTouch;\n prevTouch.end = +new Date;\n }\n }\n function isMouseLikeTouchEvent(e) {\n if (e.touches.length != 1) { return false }\n var touch = e.touches[0];\n return touch.radiusX <= 1 && touch.radiusY <= 1\n }\n function farAway(touch, other) {\n if (other.left == null) { return true }\n var dx = other.left - touch.left, dy = other.top - touch.top;\n return dx * dx + dy * dy > 20 * 20\n }\n on(d.scroller, \"touchstart\", function (e) {\n if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {\n d.input.ensurePolled();\n clearTimeout(touchFinished);\n var now = +new Date;\n d.activeTouch = {start: now, moved: false,\n prev: now - prevTouch.end <= 300 ? prevTouch : null};\n if (e.touches.length == 1) {\n d.activeTouch.left = e.touches[0].pageX;\n d.activeTouch.top = e.touches[0].pageY;\n }\n }\n });\n on(d.scroller, \"touchmove\", function () {\n if (d.activeTouch) { d.activeTouch.moved = true; }\n });\n on(d.scroller, \"touchend\", function (e) {\n var touch = d.activeTouch;\n if (touch && !eventInWidget(d, e) && touch.left != null &&\n !touch.moved && new Date - touch.start < 300) {\n var pos = cm.coordsChar(d.activeTouch, \"page\"), range;\n if (!touch.prev || farAway(touch, touch.prev)) // Single tap\n { range = new Range(pos, pos); }\n else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap\n { range = cm.findWordAt(pos); }\n else // Triple tap\n { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); }\n cm.setSelection(range.anchor, range.head);\n cm.focus();\n e_preventDefault(e);\n }\n finishTouch();\n });\n on(d.scroller, \"touchcancel\", finishTouch);\n\n // Sync scrolling between fake scrollbars and real scrollable\n // area, ensure viewport is updated when scrolling.\n on(d.scroller, \"scroll\", function () {\n if (d.scroller.clientHeight) {\n updateScrollTop(cm, d.scroller.scrollTop);\n setScrollLeft(cm, d.scroller.scrollLeft, true);\n signal(cm, \"scroll\", cm);\n }\n });\n\n // Listen to wheel events in order to try and update the viewport on time.\n on(d.scroller, \"mousewheel\", function (e) { return onScrollWheel(cm, e); });\n on(d.scroller, \"DOMMouseScroll\", function (e) { return onScrollWheel(cm, e); });\n\n // Prevent wrapper from ever scrolling\n on(d.wrapper, \"scroll\", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });\n\n d.dragFunctions = {\n enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }},\n over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }},\n start: function (e) { return onDragStart(cm, e); },\n drop: operation(cm, onDrop),\n leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }}\n };\n\n var inp = d.input.getField();\n on(inp, \"keyup\", function (e) { return onKeyUp.call(cm, e); });\n on(inp, \"keydown\", operation(cm, onKeyDown));\n on(inp, \"keypress\", operation(cm, onKeyPress));\n on(inp, \"focus\", function (e) { return onFocus(cm, e); });\n on(inp, \"blur\", function (e) { return onBlur(cm, e); });\n }\n\n var initHooks = [];\n CodeMirror.defineInitHook = function (f) { return initHooks.push(f); };\n\n // Indent the given line. The how parameter can be \"smart\",\n // \"add\"/null, \"subtract\", or \"prev\". When aggressive is false\n // (typically set to true for forced single-line indents), empty\n // lines are not indented, and places where the mode returns Pass\n // are left alone.\n function indentLine(cm, n, how, aggressive) {\n var doc = cm.doc, state;\n if (how == null) { how = \"add\"; }\n if (how == \"smart\") {\n // Fall back to \"prev\" when the mode doesn't have an indentation\n // method.\n if (!doc.mode.indent) { how = \"prev\"; }\n else { state = getContextBefore(cm, n).state; }\n }\n\n var tabSize = cm.options.tabSize;\n var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);\n if (line.stateAfter) { line.stateAfter = null; }\n var curSpaceString = line.text.match(/^\\s*/)[0], indentation;\n if (!aggressive && !/\\S/.test(line.text)) {\n indentation = 0;\n how = \"not\";\n } else if (how == \"smart\") {\n indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);\n if (indentation == Pass || indentation > 150) {\n if (!aggressive) { return }\n how = \"prev\";\n }\n }\n if (how == \"prev\") {\n if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); }\n else { indentation = 0; }\n } else if (how == \"add\") {\n indentation = curSpace + cm.options.indentUnit;\n } else if (how == \"subtract\") {\n indentation = curSpace - cm.options.indentUnit;\n } else if (typeof how == \"number\") {\n indentation = curSpace + how;\n }\n indentation = Math.max(0, indentation);\n\n var indentString = \"\", pos = 0;\n if (cm.options.indentWithTabs)\n { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += \"\\t\";} }\n if (pos < indentation) { indentString += spaceStr(indentation - pos); }\n\n if (indentString != curSpaceString) {\n replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), \"+input\");\n line.stateAfter = null;\n return true\n } else {\n // Ensure that, if the cursor was in the whitespace at the start\n // of the line, it is moved to the end of that space.\n for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) {\n var range = doc.sel.ranges[i$1];\n if (range.head.line == n && range.head.ch < curSpaceString.length) {\n var pos$1 = Pos(n, curSpaceString.length);\n replaceOneSelection(doc, i$1, new Range(pos$1, pos$1));\n break\n }\n }\n }\n }\n\n // This will be set to a {lineWise: bool, text: [string]} object, so\n // that, when pasting, we know what kind of selections the copied\n // text was made out of.\n var lastCopied = null;\n\n function setLastCopied(newLastCopied) {\n lastCopied = newLastCopied;\n }\n\n function applyTextInput(cm, inserted, deleted, sel, origin) {\n var doc = cm.doc;\n cm.display.shift = false;\n if (!sel) { sel = doc.sel; }\n\n var recent = +new Date - 200;\n var paste = origin == \"paste\" || cm.state.pasteIncoming > recent;\n var textLines = splitLinesAuto(inserted), multiPaste = null;\n // When pasting N lines into N selections, insert one line per selection\n if (paste && sel.ranges.length > 1) {\n if (lastCopied && lastCopied.text.join(\"\\n\") == inserted) {\n if (sel.ranges.length % lastCopied.text.length == 0) {\n multiPaste = [];\n for (var i = 0; i < lastCopied.text.length; i++)\n { multiPaste.push(doc.splitLines(lastCopied.text[i])); }\n }\n } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {\n multiPaste = map(textLines, function (l) { return [l]; });\n }\n }\n\n var updateInput = cm.curOp.updateInput;\n // Normal behavior is to insert the new text into every selection\n for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) {\n var range$$1 = sel.ranges[i$1];\n var from = range$$1.from(), to = range$$1.to();\n if (range$$1.empty()) {\n if (deleted && deleted > 0) // Handle deletion\n { from = Pos(from.line, from.ch - deleted); }\n else if (cm.state.overwrite && !paste) // Handle overwrite\n { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); }\n else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join(\"\\n\") == inserted)\n { from = to = Pos(from.line, 0); }\n }\n var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines,\n origin: origin || (paste ? \"paste\" : cm.state.cutIncoming > recent ? \"cut\" : \"+input\")};\n makeChange(cm.doc, changeEvent);\n signalLater(cm, \"inputRead\", cm, changeEvent);\n }\n if (inserted && !paste)\n { triggerElectric(cm, inserted); }\n\n ensureCursorVisible(cm);\n if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; }\n cm.curOp.typing = true;\n cm.state.pasteIncoming = cm.state.cutIncoming = -1;\n }\n\n function handlePaste(e, cm) {\n var pasted = e.clipboardData && e.clipboardData.getData(\"Text\");\n if (pasted) {\n e.preventDefault();\n if (!cm.isReadOnly() && !cm.options.disableInput)\n { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, \"paste\"); }); }\n return true\n }\n }\n\n function triggerElectric(cm, inserted) {\n // When an 'electric' character is inserted, immediately trigger a reindent\n if (!cm.options.electricChars || !cm.options.smartIndent) { return }\n var sel = cm.doc.sel;\n\n for (var i = sel.ranges.length - 1; i >= 0; i--) {\n var range$$1 = sel.ranges[i];\n if (range$$1.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range$$1.head.line)) { continue }\n var mode = cm.getModeAt(range$$1.head);\n var indented = false;\n if (mode.electricChars) {\n for (var j = 0; j < mode.electricChars.length; j++)\n { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) {\n indented = indentLine(cm, range$$1.head.line, \"smart\");\n break\n } }\n } else if (mode.electricInput) {\n if (mode.electricInput.test(getLine(cm.doc, range$$1.head.line).text.slice(0, range$$1.head.ch)))\n { indented = indentLine(cm, range$$1.head.line, \"smart\"); }\n }\n if (indented) { signalLater(cm, \"electricInput\", cm, range$$1.head.line); }\n }\n }\n\n function copyableRanges(cm) {\n var text = [], ranges = [];\n for (var i = 0; i < cm.doc.sel.ranges.length; i++) {\n var line = cm.doc.sel.ranges[i].head.line;\n var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)};\n ranges.push(lineRange);\n text.push(cm.getRange(lineRange.anchor, lineRange.head));\n }\n return {text: text, ranges: ranges}\n }\n\n function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) {\n field.setAttribute(\"autocorrect\", !!autocorrect);\n field.setAttribute(\"autocapitalize\", !!autocapitalize);\n field.setAttribute(\"spellcheck\", !!spellcheck);\n }\n\n function hiddenTextarea() {\n var te = elt(\"textarea\", null, null, \"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none\");\n var div = elt(\"div\", [te], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) { te.style.width = \"1000px\"; }\n else { te.setAttribute(\"wrap\", \"off\"); }\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) { te.style.border = \"1px solid black\"; }\n disableBrowserMagic(te);\n return div\n }\n\n // The publicly visible API. Note that methodOp(f) means\n // 'wrap f in an operation, performed on its `this` parameter'.\n\n // This is not the complete set of editor methods. Most of the\n // methods defined on the Doc type are also injected into\n // CodeMirror.prototype, for backwards compatibility and\n // convenience.\n\n function addEditorMethods(CodeMirror) {\n var optionHandlers = CodeMirror.optionHandlers;\n\n var helpers = CodeMirror.helpers = {};\n\n CodeMirror.prototype = {\n constructor: CodeMirror,\n focus: function(){window.focus(); this.display.input.focus();},\n\n setOption: function(option, value) {\n var options = this.options, old = options[option];\n if (options[option] == value && option != \"mode\") { return }\n options[option] = value;\n if (optionHandlers.hasOwnProperty(option))\n { operation(this, optionHandlers[option])(this, value, old); }\n signal(this, \"optionChange\", this, option);\n },\n\n getOption: function(option) {return this.options[option]},\n getDoc: function() {return this.doc},\n\n addKeyMap: function(map$$1, bottom) {\n this.state.keyMaps[bottom ? \"push\" : \"unshift\"](getKeyMap(map$$1));\n },\n removeKeyMap: function(map$$1) {\n var maps = this.state.keyMaps;\n for (var i = 0; i < maps.length; ++i)\n { if (maps[i] == map$$1 || maps[i].name == map$$1) {\n maps.splice(i, 1);\n return true\n } }\n },\n\n addOverlay: methodOp(function(spec, options) {\n var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);\n if (mode.startState) { throw new Error(\"Overlays may not be stateful.\") }\n insertSorted(this.state.overlays,\n {mode: mode, modeSpec: spec, opaque: options && options.opaque,\n priority: (options && options.priority) || 0},\n function (overlay) { return overlay.priority; });\n this.state.modeGen++;\n regChange(this);\n }),\n removeOverlay: methodOp(function(spec) {\n var this$1 = this;\n\n var overlays = this.state.overlays;\n for (var i = 0; i < overlays.length; ++i) {\n var cur = overlays[i].modeSpec;\n if (cur == spec || typeof spec == \"string\" && cur.name == spec) {\n overlays.splice(i, 1);\n this$1.state.modeGen++;\n regChange(this$1);\n return\n }\n }\n }),\n\n indentLine: methodOp(function(n, dir, aggressive) {\n if (typeof dir != \"string\" && typeof dir != \"number\") {\n if (dir == null) { dir = this.options.smartIndent ? \"smart\" : \"prev\"; }\n else { dir = dir ? \"add\" : \"subtract\"; }\n }\n if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); }\n }),\n indentSelection: methodOp(function(how) {\n var this$1 = this;\n\n var ranges = this.doc.sel.ranges, end = -1;\n for (var i = 0; i < ranges.length; i++) {\n var range$$1 = ranges[i];\n if (!range$$1.empty()) {\n var from = range$$1.from(), to = range$$1.to();\n var start = Math.max(end, from.line);\n end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1;\n for (var j = start; j < end; ++j)\n { indentLine(this$1, j, how); }\n var newRanges = this$1.doc.sel.ranges;\n if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0)\n { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); }\n } else if (range$$1.head.line > end) {\n indentLine(this$1, range$$1.head.line, how, true);\n end = range$$1.head.line;\n if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); }\n }\n }\n }),\n\n // Fetch the parser token for a given character. Useful for hacks\n // that want to inspect the mode state (say, for completion).\n getTokenAt: function(pos, precise) {\n return takeToken(this, pos, precise)\n },\n\n getLineTokens: function(line, precise) {\n return takeToken(this, Pos(line), precise, true)\n },\n\n getTokenTypeAt: function(pos) {\n pos = clipPos(this.doc, pos);\n var styles = getLineStyles(this, getLine(this.doc, pos.line));\n var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;\n var type;\n if (ch == 0) { type = styles[2]; }\n else { for (;;) {\n var mid = (before + after) >> 1;\n if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; }\n else if (styles[mid * 2 + 1] < ch) { before = mid + 1; }\n else { type = styles[mid * 2 + 2]; break }\n } }\n var cut = type ? type.indexOf(\"overlay \") : -1;\n return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1)\n },\n\n getModeAt: function(pos) {\n var mode = this.doc.mode;\n if (!mode.innerMode) { return mode }\n return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode\n },\n\n getHelper: function(pos, type) {\n return this.getHelpers(pos, type)[0]\n },\n\n getHelpers: function(pos, type) {\n var this$1 = this;\n\n var found = [];\n if (!helpers.hasOwnProperty(type)) { return found }\n var help = helpers[type], mode = this.getModeAt(pos);\n if (typeof mode[type] == \"string\") {\n if (help[mode[type]]) { found.push(help[mode[type]]); }\n } else if (mode[type]) {\n for (var i = 0; i < mode[type].length; i++) {\n var val = help[mode[type][i]];\n if (val) { found.push(val); }\n }\n } else if (mode.helperType && help[mode.helperType]) {\n found.push(help[mode.helperType]);\n } else if (help[mode.name]) {\n found.push(help[mode.name]);\n }\n for (var i$1 = 0; i$1 < help._global.length; i$1++) {\n var cur = help._global[i$1];\n if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1)\n { found.push(cur.val); }\n }\n return found\n },\n\n getStateAfter: function(line, precise) {\n var doc = this.doc;\n line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);\n return getContextBefore(this, line + 1, precise).state\n },\n\n cursorCoords: function(start, mode) {\n var pos, range$$1 = this.doc.sel.primary();\n if (start == null) { pos = range$$1.head; }\n else if (typeof start == \"object\") { pos = clipPos(this.doc, start); }\n else { pos = start ? range$$1.from() : range$$1.to(); }\n return cursorCoords(this, pos, mode || \"page\")\n },\n\n charCoords: function(pos, mode) {\n return charCoords(this, clipPos(this.doc, pos), mode || \"page\")\n },\n\n coordsChar: function(coords, mode) {\n coords = fromCoordSystem(this, coords, mode || \"page\");\n return coordsChar(this, coords.left, coords.top)\n },\n\n lineAtHeight: function(height, mode) {\n height = fromCoordSystem(this, {top: height, left: 0}, mode || \"page\").top;\n return lineAtHeight(this.doc, height + this.display.viewOffset)\n },\n heightAtLine: function(line, mode, includeWidgets) {\n var end = false, lineObj;\n if (typeof line == \"number\") {\n var last = this.doc.first + this.doc.size - 1;\n if (line < this.doc.first) { line = this.doc.first; }\n else if (line > last) { line = last; end = true; }\n lineObj = getLine(this.doc, line);\n } else {\n lineObj = line;\n }\n return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || \"page\", includeWidgets || end).top +\n (end ? this.doc.height - heightAtLine(lineObj) : 0)\n },\n\n defaultTextHeight: function() { return textHeight(this.display) },\n defaultCharWidth: function() { return charWidth(this.display) },\n\n getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}},\n\n addWidget: function(pos, node, scroll, vert, horiz) {\n var display = this.display;\n pos = cursorCoords(this, clipPos(this.doc, pos));\n var top = pos.bottom, left = pos.left;\n node.style.position = \"absolute\";\n node.setAttribute(\"cm-ignore-events\", \"true\");\n this.display.input.setUneditable(node);\n display.sizer.appendChild(node);\n if (vert == \"over\") {\n top = pos.top;\n } else if (vert == \"above\" || vert == \"near\") {\n var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),\n hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);\n // Default to positioning above (if specified and possible); otherwise default to positioning below\n if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)\n { top = pos.top - node.offsetHeight; }\n else if (pos.bottom + node.offsetHeight <= vspace)\n { top = pos.bottom; }\n if (left + node.offsetWidth > hspace)\n { left = hspace - node.offsetWidth; }\n }\n node.style.top = top + \"px\";\n node.style.left = node.style.right = \"\";\n if (horiz == \"right\") {\n left = display.sizer.clientWidth - node.offsetWidth;\n node.style.right = \"0px\";\n } else {\n if (horiz == \"left\") { left = 0; }\n else if (horiz == \"middle\") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; }\n node.style.left = left + \"px\";\n }\n if (scroll)\n { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); }\n },\n\n triggerOnKeyDown: methodOp(onKeyDown),\n triggerOnKeyPress: methodOp(onKeyPress),\n triggerOnKeyUp: onKeyUp,\n triggerOnMouseDown: methodOp(onMouseDown),\n\n execCommand: function(cmd) {\n if (commands.hasOwnProperty(cmd))\n { return commands[cmd].call(null, this) }\n },\n\n triggerElectric: methodOp(function(text) { triggerElectric(this, text); }),\n\n findPosH: function(from, amount, unit, visually) {\n var this$1 = this;\n\n var dir = 1;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n cur = findPosH(this$1.doc, cur, dir, unit, visually);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveH: methodOp(function(dir, unit) {\n var this$1 = this;\n\n this.extendSelectionsBy(function (range$$1) {\n if (this$1.display.shift || this$1.doc.extend || range$$1.empty())\n { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) }\n else\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n }, sel_move);\n }),\n\n deleteH: methodOp(function(dir, unit) {\n var sel = this.doc.sel, doc = this.doc;\n if (sel.somethingSelected())\n { doc.replaceSelection(\"\", null, \"+delete\"); }\n else\n { deleteNearSelection(this, function (range$$1) {\n var other = findPosH(doc, range$$1.head, dir, unit, false);\n return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other}\n }); }\n }),\n\n findPosV: function(from, amount, unit, goalColumn) {\n var this$1 = this;\n\n var dir = 1, x = goalColumn;\n if (amount < 0) { dir = -1; amount = -amount; }\n var cur = clipPos(this.doc, from);\n for (var i = 0; i < amount; ++i) {\n var coords = cursorCoords(this$1, cur, \"div\");\n if (x == null) { x = coords.left; }\n else { coords.left = x; }\n cur = findPosV(this$1, coords, dir, unit);\n if (cur.hitSide) { break }\n }\n return cur\n },\n\n moveV: methodOp(function(dir, unit) {\n var this$1 = this;\n\n var doc = this.doc, goals = [];\n var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected();\n doc.extendSelectionsBy(function (range$$1) {\n if (collapse)\n { return dir < 0 ? range$$1.from() : range$$1.to() }\n var headPos = cursorCoords(this$1, range$$1.head, \"div\");\n if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; }\n goals.push(headPos.left);\n var pos = findPosV(this$1, headPos, dir, unit);\n if (unit == \"page\" && range$$1 == doc.sel.primary())\n { addToScrollTop(this$1, charCoords(this$1, pos, \"div\").top - headPos.top); }\n return pos\n }, sel_move);\n if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)\n { doc.sel.ranges[i].goalColumn = goals[i]; } }\n }),\n\n // Find the word at the given position (as returned by coordsChar).\n findWordAt: function(pos) {\n var doc = this.doc, line = getLine(doc, pos.line).text;\n var start = pos.ch, end = pos.ch;\n if (line) {\n var helper = this.getHelper(pos, \"wordChars\");\n if ((pos.sticky == \"before\" || end == line.length) && start) { --start; } else { ++end; }\n var startChar = line.charAt(start);\n var check = isWordChar(startChar, helper)\n ? function (ch) { return isWordChar(ch, helper); }\n : /\\s/.test(startChar) ? function (ch) { return /\\s/.test(ch); }\n : function (ch) { return (!/\\s/.test(ch) && !isWordChar(ch)); };\n while (start > 0 && check(line.charAt(start - 1))) { --start; }\n while (end < line.length && check(line.charAt(end))) { ++end; }\n }\n return new Range(Pos(pos.line, start), Pos(pos.line, end))\n },\n\n toggleOverwrite: function(value) {\n if (value != null && value == this.state.overwrite) { return }\n if (this.state.overwrite = !this.state.overwrite)\n { addClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n else\n { rmClass(this.display.cursorDiv, \"CodeMirror-overwrite\"); }\n\n signal(this, \"overwriteToggle\", this, this.state.overwrite);\n },\n hasFocus: function() { return this.display.input.getField() == activeElt() },\n isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },\n\n scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }),\n getScrollInfo: function() {\n var scroller = this.display.scroller;\n return {left: scroller.scrollLeft, top: scroller.scrollTop,\n height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight,\n width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth,\n clientHeight: displayHeight(this), clientWidth: displayWidth(this)}\n },\n\n scrollIntoView: methodOp(function(range$$1, margin) {\n if (range$$1 == null) {\n range$$1 = {from: this.doc.sel.primary().head, to: null};\n if (margin == null) { margin = this.options.cursorScrollMargin; }\n } else if (typeof range$$1 == \"number\") {\n range$$1 = {from: Pos(range$$1, 0), to: null};\n } else if (range$$1.from == null) {\n range$$1 = {from: range$$1, to: null};\n }\n if (!range$$1.to) { range$$1.to = range$$1.from; }\n range$$1.margin = margin || 0;\n\n if (range$$1.from.line != null) {\n scrollToRange(this, range$$1);\n } else {\n scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin);\n }\n }),\n\n setSize: methodOp(function(width, height) {\n var this$1 = this;\n\n var interpret = function (val) { return typeof val == \"number\" || /^\\d+$/.test(String(val)) ? val + \"px\" : val; };\n if (width != null) { this.display.wrapper.style.width = interpret(width); }\n if (height != null) { this.display.wrapper.style.height = interpret(height); }\n if (this.options.lineWrapping) { clearLineMeasurementCache(this); }\n var lineNo$$1 = this.display.viewFrom;\n this.doc.iter(lineNo$$1, this.display.viewTo, function (line) {\n if (line.widgets) { for (var i = 0; i < line.widgets.length; i++)\n { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, \"widget\"); break } } }\n ++lineNo$$1;\n });\n this.curOp.forceUpdate = true;\n signal(this, \"refresh\", this);\n }),\n\n operation: function(f){return runInOp(this, f)},\n startOperation: function(){return startOperation(this)},\n endOperation: function(){return endOperation(this)},\n\n refresh: methodOp(function() {\n var oldHeight = this.display.cachedTextHeight;\n regChange(this);\n this.curOp.forceUpdate = true;\n clearCaches(this);\n scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop);\n updateGutterSpace(this);\n if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)\n { estimateLineHeights(this); }\n signal(this, \"refresh\", this);\n }),\n\n swapDoc: methodOp(function(doc) {\n var old = this.doc;\n old.cm = null;\n attachDoc(this, doc);\n clearCaches(this);\n this.display.input.reset();\n scrollToCoords(this, doc.scrollLeft, doc.scrollTop);\n this.curOp.forceScroll = true;\n signalLater(this, \"swapDoc\", this, old);\n return old\n }),\n\n phrase: function(phraseText) {\n var phrases = this.options.phrases;\n return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText\n },\n\n getInputField: function(){return this.display.input.getField()},\n getWrapperElement: function(){return this.display.wrapper},\n getScrollerElement: function(){return this.display.scroller},\n getGutterElement: function(){return this.display.gutters}\n };\n eventMixin(CodeMirror);\n\n CodeMirror.registerHelper = function(type, name, value) {\n if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; }\n helpers[type][name] = value;\n };\n CodeMirror.registerGlobalHelper = function(type, name, predicate, value) {\n CodeMirror.registerHelper(type, name, value);\n helpers[type]._global.push({pred: predicate, val: value});\n };\n }\n\n // Used for horizontal relative motion. Dir is -1 or 1 (left or\n // right), unit can be \"char\", \"column\" (like char, but doesn't\n // cross line boundaries), \"word\" (across next word), or \"group\" (to\n // the start of next group of word or non-word-non-whitespace\n // chars). The visually param controls whether, in right-to-left\n // text, direction 1 means to move towards the next index in the\n // string, or towards the character to the right of the current\n // position. The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosH(doc, pos, dir, unit, visually) {\n var oldPos = pos;\n var origDir = dir;\n var lineObj = getLine(doc, pos.line);\n function findNextLine() {\n var l = pos.line + dir;\n if (l < doc.first || l >= doc.first + doc.size) { return false }\n pos = new Pos(l, pos.ch, pos.sticky);\n return lineObj = getLine(doc, l)\n }\n function moveOnce(boundToLine) {\n var next;\n if (visually) {\n next = moveVisually(doc.cm, lineObj, pos, dir);\n } else {\n next = moveLogically(lineObj, pos, dir);\n }\n if (next == null) {\n if (!boundToLine && findNextLine())\n { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir); }\n else\n { return false }\n } else {\n pos = next;\n }\n return true\n }\n\n if (unit == \"char\") {\n moveOnce();\n } else if (unit == \"column\") {\n moveOnce(true);\n } else if (unit == \"word\" || unit == \"group\") {\n var sawType = null, group = unit == \"group\";\n var helper = doc.cm && doc.cm.getHelper(pos, \"wordChars\");\n for (var first = true;; first = false) {\n if (dir < 0 && !moveOnce(!first)) { break }\n var cur = lineObj.text.charAt(pos.ch) || \"\\n\";\n var type = isWordChar(cur, helper) ? \"w\"\n : group && cur == \"\\n\" ? \"n\"\n : !group || /\\s/.test(cur) ? null\n : \"p\";\n if (group && !first && !type) { type = \"s\"; }\n if (sawType && sawType != type) {\n if (dir < 0) {dir = 1; moveOnce(); pos.sticky = \"after\";}\n break\n }\n\n if (type) { sawType = type; }\n if (dir > 0 && !moveOnce(!first)) { break }\n }\n }\n var result = skipAtomic(doc, pos, oldPos, origDir, true);\n if (equalCursorPos(oldPos, result)) { result.hitSide = true; }\n return result\n }\n\n // For relative vertical movement. Dir may be -1 or 1. Unit can be\n // \"page\" or \"line\". The resulting position will have a hitSide=true\n // property if it reached the end of the document.\n function findPosV(cm, pos, dir, unit) {\n var doc = cm.doc, x = pos.left, y;\n if (unit == \"page\") {\n var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);\n var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3);\n y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount;\n\n } else if (unit == \"line\") {\n y = dir > 0 ? pos.bottom + 3 : pos.top - 3;\n }\n var target;\n for (;;) {\n target = coordsChar(cm, x, y);\n if (!target.outside) { break }\n if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break }\n y += dir * 5;\n }\n return target\n }\n\n // CONTENTEDITABLE INPUT STYLE\n\n var ContentEditableInput = function(cm) {\n this.cm = cm;\n this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null;\n this.polling = new Delayed();\n this.composing = null;\n this.gracePeriod = false;\n this.readDOMTimeout = null;\n };\n\n ContentEditableInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = input.cm;\n var div = input.div = display.lineDiv;\n disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize);\n\n on(div, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n // IE doesn't fire input events, so we schedule a read for the pasted content in this way\n if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); }\n });\n\n on(div, \"compositionstart\", function (e) {\n this$1.composing = {data: e.data, done: false};\n });\n on(div, \"compositionupdate\", function (e) {\n if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; }\n });\n on(div, \"compositionend\", function (e) {\n if (this$1.composing) {\n if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); }\n this$1.composing.done = true;\n }\n });\n\n on(div, \"touchstart\", function () { return input.forceCompositionEnd(); });\n\n on(div, \"input\", function () {\n if (!this$1.composing) { this$1.readFromDOMSoon(); }\n });\n\n function onCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n if (e.type == \"cut\") { cm.replaceSelection(\"\", null, \"cut\"); }\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.operation(function () {\n cm.setSelections(ranges.ranges, 0, sel_dontScroll);\n cm.replaceSelection(\"\", null, \"cut\");\n });\n }\n }\n if (e.clipboardData) {\n e.clipboardData.clearData();\n var content = lastCopied.text.join(\"\\n\");\n // iOS exposes the clipboard API, but seems to discard content inserted into it\n e.clipboardData.setData(\"Text\", content);\n if (e.clipboardData.getData(\"Text\") == content) {\n e.preventDefault();\n return\n }\n }\n // Old-fashioned briefly-focus-a-textarea hack\n var kludge = hiddenTextarea(), te = kludge.firstChild;\n cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild);\n te.value = lastCopied.text.join(\"\\n\");\n var hadFocus = document.activeElement;\n selectInput(te);\n setTimeout(function () {\n cm.display.lineSpace.removeChild(kludge);\n hadFocus.focus();\n if (hadFocus == div) { input.showPrimarySelection(); }\n }, 50);\n }\n on(div, \"copy\", onCopyCut);\n on(div, \"cut\", onCopyCut);\n };\n\n ContentEditableInput.prototype.prepareSelection = function () {\n var result = prepareSelection(this.cm, false);\n result.focus = this.cm.state.focused;\n return result\n };\n\n ContentEditableInput.prototype.showSelection = function (info, takeFocus) {\n if (!info || !this.cm.display.view.length) { return }\n if (info.focus || takeFocus) { this.showPrimarySelection(); }\n this.showMultipleSelections(info);\n };\n\n ContentEditableInput.prototype.getSelection = function () {\n return this.cm.display.wrapper.ownerDocument.getSelection()\n };\n\n ContentEditableInput.prototype.showPrimarySelection = function () {\n var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary();\n var from = prim.from(), to = prim.to();\n\n if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {\n sel.removeAllRanges();\n return\n }\n\n var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&\n cmp(minPos(curAnchor, curFocus), from) == 0 &&\n cmp(maxPos(curAnchor, curFocus), to) == 0)\n { return }\n\n var view = cm.display.view;\n var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||\n {node: view[0].measure.map[2], offset: 0};\n var end = to.line < cm.display.viewTo && posToDOM(cm, to);\n if (!end) {\n var measure = view[view.length - 1].measure;\n var map$$1 = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map;\n end = {node: map$$1[map$$1.length - 1], offset: map$$1[map$$1.length - 2] - map$$1[map$$1.length - 3]};\n }\n\n if (!start || !end) {\n sel.removeAllRanges();\n return\n }\n\n var old = sel.rangeCount && sel.getRangeAt(0), rng;\n try { rng = range(start.node, start.offset, end.offset, end.node); }\n catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible\n if (rng) {\n if (!gecko && cm.state.focused) {\n sel.collapse(start.node, start.offset);\n if (!rng.collapsed) {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n } else {\n sel.removeAllRanges();\n sel.addRange(rng);\n }\n if (old && sel.anchorNode == null) { sel.addRange(old); }\n else if (gecko) { this.startGracePeriod(); }\n }\n this.rememberSelection();\n };\n\n ContentEditableInput.prototype.startGracePeriod = function () {\n var this$1 = this;\n\n clearTimeout(this.gracePeriod);\n this.gracePeriod = setTimeout(function () {\n this$1.gracePeriod = false;\n if (this$1.selectionChanged())\n { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); }\n }, 20);\n };\n\n ContentEditableInput.prototype.showMultipleSelections = function (info) {\n removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors);\n removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection);\n };\n\n ContentEditableInput.prototype.rememberSelection = function () {\n var sel = this.getSelection();\n this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset;\n this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset;\n };\n\n ContentEditableInput.prototype.selectionInEditor = function () {\n var sel = this.getSelection();\n if (!sel.rangeCount) { return false }\n var node = sel.getRangeAt(0).commonAncestorContainer;\n return contains(this.div, node)\n };\n\n ContentEditableInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\") {\n if (!this.selectionInEditor())\n { this.showSelection(this.prepareSelection(), true); }\n this.div.focus();\n }\n };\n ContentEditableInput.prototype.blur = function () { this.div.blur(); };\n ContentEditableInput.prototype.getField = function () { return this.div };\n\n ContentEditableInput.prototype.supportsTouch = function () { return true };\n\n ContentEditableInput.prototype.receivedFocus = function () {\n var input = this;\n if (this.selectionInEditor())\n { this.pollSelection(); }\n else\n { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); }\n\n function poll() {\n if (input.cm.state.focused) {\n input.pollSelection();\n input.polling.set(input.cm.options.pollInterval, poll);\n }\n }\n this.polling.set(this.cm.options.pollInterval, poll);\n };\n\n ContentEditableInput.prototype.selectionChanged = function () {\n var sel = this.getSelection();\n return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset ||\n sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset\n };\n\n ContentEditableInput.prototype.pollSelection = function () {\n if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }\n var sel = this.getSelection(), cm = this.cm;\n // On Android Chrome (version 56, at least), backspacing into an\n // uneditable block element will put the cursor in that element,\n // and then, because it's not editable, hide the virtual keyboard.\n // Because Android doesn't allow us to actually detect backspace\n // presses in a sane way, this code checks for when that happens\n // and simulates a backspace press in this case.\n if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) {\n this.cm.triggerOnKeyDown({type: \"keydown\", keyCode: 8, preventDefault: Math.abs});\n this.blur();\n this.focus();\n return\n }\n if (this.composing) { return }\n this.rememberSelection();\n var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset);\n var head = domToPos(cm, sel.focusNode, sel.focusOffset);\n if (anchor && head) { runInOp(cm, function () {\n setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll);\n if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; }\n }); }\n };\n\n ContentEditableInput.prototype.pollContent = function () {\n if (this.readDOMTimeout != null) {\n clearTimeout(this.readDOMTimeout);\n this.readDOMTimeout = null;\n }\n\n var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();\n var from = sel.from(), to = sel.to();\n if (from.ch == 0 && from.line > cm.firstLine())\n { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); }\n if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine())\n { to = Pos(to.line + 1, 0); }\n if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false }\n\n var fromIndex, fromLine, fromNode;\n if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) {\n fromLine = lineNo(display.view[0].line);\n fromNode = display.view[0].node;\n } else {\n fromLine = lineNo(display.view[fromIndex].line);\n fromNode = display.view[fromIndex - 1].node.nextSibling;\n }\n var toIndex = findViewIndex(cm, to.line);\n var toLine, toNode;\n if (toIndex == display.view.length - 1) {\n toLine = display.viewTo - 1;\n toNode = display.lineDiv.lastChild;\n } else {\n toLine = lineNo(display.view[toIndex + 1].line) - 1;\n toNode = display.view[toIndex + 1].node.previousSibling;\n }\n\n if (!fromNode) { return false }\n var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine));\n var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length));\n while (newText.length > 1 && oldText.length > 1) {\n if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; }\n else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; }\n else { break }\n }\n\n var cutFront = 0, cutEnd = 0;\n var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length);\n while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront))\n { ++cutFront; }\n var newBot = lst(newText), oldBot = lst(oldText);\n var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0),\n oldBot.length - (oldText.length == 1 ? cutFront : 0));\n while (cutEnd < maxCutEnd &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))\n { ++cutEnd; }\n // Try to move start of change to start of selection if ambiguous\n if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {\n while (cutFront && cutFront > from.ch &&\n newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {\n cutFront--;\n cutEnd++;\n }\n }\n\n newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\\u200b+/, \"\");\n newText[0] = newText[0].slice(cutFront).replace(/\\u200b+$/, \"\");\n\n var chFrom = Pos(fromLine, cutFront);\n var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0);\n if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) {\n replaceRange(cm.doc, newText, chFrom, chTo, \"+input\");\n return true\n }\n };\n\n ContentEditableInput.prototype.ensurePolled = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.reset = function () {\n this.forceCompositionEnd();\n };\n ContentEditableInput.prototype.forceCompositionEnd = function () {\n if (!this.composing) { return }\n clearTimeout(this.readDOMTimeout);\n this.composing = null;\n this.updateFromDOM();\n this.div.blur();\n this.div.focus();\n };\n ContentEditableInput.prototype.readFromDOMSoon = function () {\n var this$1 = this;\n\n if (this.readDOMTimeout != null) { return }\n this.readDOMTimeout = setTimeout(function () {\n this$1.readDOMTimeout = null;\n if (this$1.composing) {\n if (this$1.composing.done) { this$1.composing = null; }\n else { return }\n }\n this$1.updateFromDOM();\n }, 80);\n };\n\n ContentEditableInput.prototype.updateFromDOM = function () {\n var this$1 = this;\n\n if (this.cm.isReadOnly() || !this.pollContent())\n { runInOp(this.cm, function () { return regChange(this$1.cm); }); }\n };\n\n ContentEditableInput.prototype.setUneditable = function (node) {\n node.contentEditable = \"false\";\n };\n\n ContentEditableInput.prototype.onKeyPress = function (e) {\n if (e.charCode == 0 || this.composing) { return }\n e.preventDefault();\n if (!this.cm.isReadOnly())\n { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); }\n };\n\n ContentEditableInput.prototype.readOnlyChanged = function (val) {\n this.div.contentEditable = String(val != \"nocursor\");\n };\n\n ContentEditableInput.prototype.onContextMenu = function () {};\n ContentEditableInput.prototype.resetPosition = function () {};\n\n ContentEditableInput.prototype.needsContentAttribute = true;\n\n function posToDOM(cm, pos) {\n var view = findViewForLine(cm, pos.line);\n if (!view || view.hidden) { return null }\n var line = getLine(cm.doc, pos.line);\n var info = mapFromLineView(view, line, pos.line);\n\n var order = getOrder(line, cm.doc.direction), side = \"left\";\n if (order) {\n var partPos = getBidiPartAt(order, pos.ch);\n side = partPos % 2 ? \"right\" : \"left\";\n }\n var result = nodeAndOffsetInLineMap(info.map, pos.ch, side);\n result.offset = result.collapse == \"right\" ? result.end : result.start;\n return result\n }\n\n function isInGutter(node) {\n for (var scan = node; scan; scan = scan.parentNode)\n { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }\n return false\n }\n\n function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }\n\n function domTextBetween(cm, from, to, fromLine, toLine) {\n var text = \"\", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false;\n function recognizeMarker(id) { return function (marker) { return marker.id == id; } }\n function close() {\n if (closing) {\n text += lineSep;\n if (extraLinebreak) { text += lineSep; }\n closing = extraLinebreak = false;\n }\n }\n function addText(str) {\n if (str) {\n close();\n text += str;\n }\n }\n function walk(node) {\n if (node.nodeType == 1) {\n var cmText = node.getAttribute(\"cm-text\");\n if (cmText) {\n addText(cmText);\n return\n }\n var markerID = node.getAttribute(\"cm-marker\"), range$$1;\n if (markerID) {\n var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID));\n if (found.length && (range$$1 = found[0].find(0)))\n { addText(getBetween(cm.doc, range$$1.from, range$$1.to).join(lineSep)); }\n return\n }\n if (node.getAttribute(\"contenteditable\") == \"false\") { return }\n var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName);\n if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return }\n\n if (isBlock) { close(); }\n for (var i = 0; i < node.childNodes.length; i++)\n { walk(node.childNodes[i]); }\n\n if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; }\n if (isBlock) { closing = true; }\n } else if (node.nodeType == 3) {\n addText(node.nodeValue.replace(/\\u200b/g, \"\").replace(/\\u00a0/g, \" \"));\n }\n }\n for (;;) {\n walk(from);\n if (from == to) { break }\n from = from.nextSibling;\n extraLinebreak = false;\n }\n return text\n }\n\n function domToPos(cm, node, offset) {\n var lineNode;\n if (node == cm.display.lineDiv) {\n lineNode = cm.display.lineDiv.childNodes[offset];\n if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) }\n node = null; offset = 0;\n } else {\n for (lineNode = node;; lineNode = lineNode.parentNode) {\n if (!lineNode || lineNode == cm.display.lineDiv) { return null }\n if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break }\n }\n }\n for (var i = 0; i < cm.display.view.length; i++) {\n var lineView = cm.display.view[i];\n if (lineView.node == lineNode)\n { return locateNodeInLineView(lineView, node, offset) }\n }\n }\n\n function locateNodeInLineView(lineView, node, offset) {\n var wrapper = lineView.text.firstChild, bad = false;\n if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) }\n if (node == wrapper) {\n bad = true;\n node = wrapper.childNodes[offset];\n offset = 0;\n if (!node) {\n var line = lineView.rest ? lst(lineView.rest) : lineView.line;\n return badPos(Pos(lineNo(line), line.text.length), bad)\n }\n }\n\n var textNode = node.nodeType == 3 ? node : null, topNode = node;\n if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {\n textNode = node.firstChild;\n if (offset) { offset = textNode.nodeValue.length; }\n }\n while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; }\n var measure = lineView.measure, maps = measure.maps;\n\n function find(textNode, topNode, offset) {\n for (var i = -1; i < (maps ? maps.length : 0); i++) {\n var map$$1 = i < 0 ? measure.map : maps[i];\n for (var j = 0; j < map$$1.length; j += 3) {\n var curNode = map$$1[j + 2];\n if (curNode == textNode || curNode == topNode) {\n var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]);\n var ch = map$$1[j] + offset;\n if (offset < 0 || curNode != textNode) { ch = map$$1[j + (offset ? 1 : 0)]; }\n return Pos(line, ch)\n }\n }\n }\n }\n var found = find(textNode, topNode, offset);\n if (found) { return badPos(found, bad) }\n\n // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems\n for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) {\n found = find(after, after.firstChild, 0);\n if (found)\n { return badPos(Pos(found.line, found.ch - dist), bad) }\n else\n { dist += after.textContent.length; }\n }\n for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) {\n found = find(before, before.firstChild, -1);\n if (found)\n { return badPos(Pos(found.line, found.ch + dist$1), bad) }\n else\n { dist$1 += before.textContent.length; }\n }\n }\n\n // TEXTAREA INPUT STYLE\n\n var TextareaInput = function(cm) {\n this.cm = cm;\n // See input.poll and input.reset\n this.prevInput = \"\";\n\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n this.pollingFast = false;\n // Self-resetting timeout for the poller\n this.polling = new Delayed();\n // Used to work around IE issue with selection being forgotten when focus moves away from textarea\n this.hasSelection = false;\n this.composing = null;\n };\n\n TextareaInput.prototype.init = function (display) {\n var this$1 = this;\n\n var input = this, cm = this.cm;\n this.createField(display);\n var te = this.textarea;\n\n display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild);\n\n // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)\n if (ios) { te.style.width = \"0px\"; }\n\n on(te, \"input\", function () {\n if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; }\n input.poll();\n });\n\n on(te, \"paste\", function (e) {\n if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }\n\n cm.state.pasteIncoming = +new Date;\n input.fastPoll();\n });\n\n function prepareCopyCut(e) {\n if (signalDOMEvent(cm, e)) { return }\n if (cm.somethingSelected()) {\n setLastCopied({lineWise: false, text: cm.getSelections()});\n } else if (!cm.options.lineWiseCopyCut) {\n return\n } else {\n var ranges = copyableRanges(cm);\n setLastCopied({lineWise: true, text: ranges.text});\n if (e.type == \"cut\") {\n cm.setSelections(ranges.ranges, null, sel_dontScroll);\n } else {\n input.prevInput = \"\";\n te.value = ranges.text.join(\"\\n\");\n selectInput(te);\n }\n }\n if (e.type == \"cut\") { cm.state.cutIncoming = +new Date; }\n }\n on(te, \"cut\", prepareCopyCut);\n on(te, \"copy\", prepareCopyCut);\n\n on(display.scroller, \"paste\", function (e) {\n if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return }\n if (!te.dispatchEvent) {\n cm.state.pasteIncoming = +new Date;\n input.focus();\n return\n }\n\n // Pass the `paste` event to the textarea so it's handled by its event listener.\n var event = new Event(\"paste\");\n event.clipboardData = e.clipboardData;\n te.dispatchEvent(event);\n });\n\n // Prevent normal selection in the editor (we handle our own)\n on(display.lineSpace, \"selectstart\", function (e) {\n if (!eventInWidget(display, e)) { e_preventDefault(e); }\n });\n\n on(te, \"compositionstart\", function () {\n var start = cm.getCursor(\"from\");\n if (input.composing) { input.composing.range.clear(); }\n input.composing = {\n start: start,\n range: cm.markText(start, cm.getCursor(\"to\"), {className: \"CodeMirror-composing\"})\n };\n });\n on(te, \"compositionend\", function () {\n if (input.composing) {\n input.poll();\n input.composing.range.clear();\n input.composing = null;\n }\n });\n };\n\n TextareaInput.prototype.createField = function (_display) {\n // Wraps and hides input textarea\n this.wrapper = hiddenTextarea();\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n this.textarea = this.wrapper.firstChild;\n };\n\n TextareaInput.prototype.prepareSelection = function () {\n // Redraw the selection and/or cursor\n var cm = this.cm, display = cm.display, doc = cm.doc;\n var result = prepareSelection(cm);\n\n // Move the hidden textarea near the cursor to prevent scrolling artifacts\n if (cm.options.moveInputWithCursor) {\n var headPos = cursorCoords(cm, doc.sel.primary().head, \"div\");\n var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect();\n result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,\n headPos.top + lineOff.top - wrapOff.top));\n result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,\n headPos.left + lineOff.left - wrapOff.left));\n }\n\n return result\n };\n\n TextareaInput.prototype.showSelection = function (drawn) {\n var cm = this.cm, display = cm.display;\n removeChildrenAndAdd(display.cursorDiv, drawn.cursors);\n removeChildrenAndAdd(display.selectionDiv, drawn.selection);\n if (drawn.teTop != null) {\n this.wrapper.style.top = drawn.teTop + \"px\";\n this.wrapper.style.left = drawn.teLeft + \"px\";\n }\n };\n\n // Reset the input to correspond to the selection (or to be empty,\n // when not typing and nothing is selected)\n TextareaInput.prototype.reset = function (typing) {\n if (this.contextMenuPending || this.composing) { return }\n var cm = this.cm;\n if (cm.somethingSelected()) {\n this.prevInput = \"\";\n var content = cm.getSelection();\n this.textarea.value = content;\n if (cm.state.focused) { selectInput(this.textarea); }\n if (ie && ie_version >= 9) { this.hasSelection = content; }\n } else if (!typing) {\n this.prevInput = this.textarea.value = \"\";\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n }\n };\n\n TextareaInput.prototype.getField = function () { return this.textarea };\n\n TextareaInput.prototype.supportsTouch = function () { return false };\n\n TextareaInput.prototype.focus = function () {\n if (this.cm.options.readOnly != \"nocursor\" && (!mobile || activeElt() != this.textarea)) {\n try { this.textarea.focus(); }\n catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM\n }\n };\n\n TextareaInput.prototype.blur = function () { this.textarea.blur(); };\n\n TextareaInput.prototype.resetPosition = function () {\n this.wrapper.style.top = this.wrapper.style.left = 0;\n };\n\n TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); };\n\n // Poll for input changes, using the normal rate of polling. This\n // runs as long as the editor is focused.\n TextareaInput.prototype.slowPoll = function () {\n var this$1 = this;\n\n if (this.pollingFast) { return }\n this.polling.set(this.cm.options.pollInterval, function () {\n this$1.poll();\n if (this$1.cm.state.focused) { this$1.slowPoll(); }\n });\n };\n\n // When an event has just come in that is likely to add or change\n // something in the input textarea, we poll faster, to ensure that\n // the change appears on the screen quickly.\n TextareaInput.prototype.fastPoll = function () {\n var missed = false, input = this;\n input.pollingFast = true;\n function p() {\n var changed = input.poll();\n if (!changed && !missed) {missed = true; input.polling.set(60, p);}\n else {input.pollingFast = false; input.slowPoll();}\n }\n input.polling.set(20, p);\n };\n\n // Read input from the textarea, and update the document to match.\n // When something is selected, it is present in the textarea, and\n // selected (unless it is huge, in which case a placeholder is\n // used). When nothing is selected, the cursor sits after previously\n // seen text (can be empty), which is stored in prevInput (we must\n // not reset the textarea when typing, because that breaks IME).\n TextareaInput.prototype.poll = function () {\n var this$1 = this;\n\n var cm = this.cm, input = this.textarea, prevInput = this.prevInput;\n // Since this is called a *lot*, try to bail out as cheaply as\n // possible when it is clear that nothing happened. hasSelection\n // will be the case when there is a lot of text in the textarea,\n // in which case reading its value would be expensive.\n if (this.contextMenuPending || !cm.state.focused ||\n (hasSelection(input) && !prevInput && !this.composing) ||\n cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq)\n { return false }\n\n var text = input.value;\n // If nothing changed, bail.\n if (text == prevInput && !cm.somethingSelected()) { return false }\n // Work around nonsensical selection resetting in IE9/10, and\n // inexplicable appearance of private area unicode characters on\n // some key combos in Mac (#2689).\n if (ie && ie_version >= 9 && this.hasSelection === text ||\n mac && /[\\uf700-\\uf7ff]/.test(text)) {\n cm.display.input.reset();\n return false\n }\n\n if (cm.doc.sel == cm.display.selForContextMenu) {\n var first = text.charCodeAt(0);\n if (first == 0x200b && !prevInput) { prevInput = \"\\u200b\"; }\n if (first == 0x21da) { this.reset(); return this.cm.execCommand(\"undo\") }\n }\n // Find the part of the input that is actually new\n var same = 0, l = Math.min(prevInput.length, text.length);\n while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; }\n\n runInOp(cm, function () {\n applyTextInput(cm, text.slice(same), prevInput.length - same,\n null, this$1.composing ? \"*compose\" : null);\n\n // Don't leave long text in the textarea, since it makes further polling slow\n if (text.length > 1000 || text.indexOf(\"\\n\") > -1) { input.value = this$1.prevInput = \"\"; }\n else { this$1.prevInput = text; }\n\n if (this$1.composing) {\n this$1.composing.range.clear();\n this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor(\"to\"),\n {className: \"CodeMirror-composing\"});\n }\n });\n return true\n };\n\n TextareaInput.prototype.ensurePolled = function () {\n if (this.pollingFast && this.poll()) { this.pollingFast = false; }\n };\n\n TextareaInput.prototype.onKeyPress = function () {\n if (ie && ie_version >= 9) { this.hasSelection = null; }\n this.fastPoll();\n };\n\n TextareaInput.prototype.onContextMenu = function (e) {\n var input = this, cm = input.cm, display = cm.display, te = input.textarea;\n if (input.contextMenuPending) { input.contextMenuPending(); }\n var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;\n if (!pos || presto) { return } // Opera is difficult.\n\n // Reset the current text selection only if the click is done outside of the selection\n // and 'resetSelectionOnContextMenu' option is true.\n var reset = cm.options.resetSelectionOnContextMenu;\n if (reset && cm.doc.sel.contains(pos) == -1)\n { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); }\n\n var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText;\n var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect();\n input.wrapper.style.cssText = \"position: static\";\n te.style.cssText = \"position: absolute; width: 30px; height: 30px;\\n top: \" + (e.clientY - wrapperBox.top - 5) + \"px; left: \" + (e.clientX - wrapperBox.left - 5) + \"px;\\n z-index: 1000; background: \" + (ie ? \"rgba(255, 255, 255, .05)\" : \"transparent\") + \";\\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);\";\n var oldScrollY;\n if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712)\n display.input.focus();\n if (webkit) { window.scrollTo(null, oldScrollY); }\n display.input.reset();\n // Adds \"Select all\" to context menu in FF\n if (!cm.somethingSelected()) { te.value = input.prevInput = \" \"; }\n input.contextMenuPending = rehide;\n display.selForContextMenu = cm.doc.sel;\n clearTimeout(display.detectingSelectAll);\n\n // Select-all will be greyed out if there's nothing to select, so\n // this adds a zero-width space so that we can later check whether\n // it got selected.\n function prepareSelectAllHack() {\n if (te.selectionStart != null) {\n var selected = cm.somethingSelected();\n var extval = \"\\u200b\" + (selected ? te.value : \"\");\n te.value = \"\\u21da\"; // Used to catch context-menu undo\n te.value = extval;\n input.prevInput = selected ? \"\" : \"\\u200b\";\n te.selectionStart = 1; te.selectionEnd = extval.length;\n // Re-set this, in case some other handler touched the\n // selection in the meantime.\n display.selForContextMenu = cm.doc.sel;\n }\n }\n function rehide() {\n if (input.contextMenuPending != rehide) { return }\n input.contextMenuPending = false;\n input.wrapper.style.cssText = oldWrapperCSS;\n te.style.cssText = oldCSS;\n if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); }\n\n // Try to detect the user choosing select-all\n if (te.selectionStart != null) {\n if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); }\n var i = 0, poll = function () {\n if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 &&\n te.selectionEnd > 0 && input.prevInput == \"\\u200b\") {\n operation(cm, selectAll)(cm);\n } else if (i++ < 10) {\n display.detectingSelectAll = setTimeout(poll, 500);\n } else {\n display.selForContextMenu = null;\n display.input.reset();\n }\n };\n display.detectingSelectAll = setTimeout(poll, 200);\n }\n }\n\n if (ie && ie_version >= 9) { prepareSelectAllHack(); }\n if (captureRightClick) {\n e_stop(e);\n var mouseup = function () {\n off(window, \"mouseup\", mouseup);\n setTimeout(rehide, 20);\n };\n on(window, \"mouseup\", mouseup);\n } else {\n setTimeout(rehide, 50);\n }\n };\n\n TextareaInput.prototype.readOnlyChanged = function (val) {\n if (!val) { this.reset(); }\n this.textarea.disabled = val == \"nocursor\";\n };\n\n TextareaInput.prototype.setUneditable = function () {};\n\n TextareaInput.prototype.needsContentAttribute = false;\n\n function fromTextArea(textarea, options) {\n options = options ? copyObj(options) : {};\n options.value = textarea.value;\n if (!options.tabindex && textarea.tabIndex)\n { options.tabindex = textarea.tabIndex; }\n if (!options.placeholder && textarea.placeholder)\n { options.placeholder = textarea.placeholder; }\n // Set autofocus to true if this textarea is focused, or if it has\n // autofocus and no other element is focused.\n if (options.autofocus == null) {\n var hasFocus = activeElt();\n options.autofocus = hasFocus == textarea ||\n textarea.getAttribute(\"autofocus\") != null && hasFocus == document.body;\n }\n\n function save() {textarea.value = cm.getValue();}\n\n var realSubmit;\n if (textarea.form) {\n on(textarea.form, \"submit\", save);\n // Deplorable hack to make the submit method do the right thing.\n if (!options.leaveSubmitMethodAlone) {\n var form = textarea.form;\n realSubmit = form.submit;\n try {\n var wrappedSubmit = form.submit = function () {\n save();\n form.submit = realSubmit;\n form.submit();\n form.submit = wrappedSubmit;\n };\n } catch(e) {}\n }\n }\n\n options.finishInit = function (cm) {\n cm.save = save;\n cm.getTextArea = function () { return textarea; };\n cm.toTextArea = function () {\n cm.toTextArea = isNaN; // Prevent this from being ran twice\n save();\n textarea.parentNode.removeChild(cm.getWrapperElement());\n textarea.style.display = \"\";\n if (textarea.form) {\n off(textarea.form, \"submit\", save);\n if (typeof textarea.form.submit == \"function\")\n { textarea.form.submit = realSubmit; }\n }\n };\n };\n\n textarea.style.display = \"none\";\n var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); },\n options);\n return cm\n }\n\n function addLegacyProps(CodeMirror) {\n CodeMirror.off = off;\n CodeMirror.on = on;\n CodeMirror.wheelEventPixels = wheelEventPixels;\n CodeMirror.Doc = Doc;\n CodeMirror.splitLines = splitLinesAuto;\n CodeMirror.countColumn = countColumn;\n CodeMirror.findColumn = findColumn;\n CodeMirror.isWordChar = isWordCharBasic;\n CodeMirror.Pass = Pass;\n CodeMirror.signal = signal;\n CodeMirror.Line = Line;\n CodeMirror.changeEnd = changeEnd;\n CodeMirror.scrollbarModel = scrollbarModel;\n CodeMirror.Pos = Pos;\n CodeMirror.cmpPos = cmp;\n CodeMirror.modes = modes;\n CodeMirror.mimeModes = mimeModes;\n CodeMirror.resolveMode = resolveMode;\n CodeMirror.getMode = getMode;\n CodeMirror.modeExtensions = modeExtensions;\n CodeMirror.extendMode = extendMode;\n CodeMirror.copyState = copyState;\n CodeMirror.startState = startState;\n CodeMirror.innerMode = innerMode;\n CodeMirror.commands = commands;\n CodeMirror.keyMap = keyMap;\n CodeMirror.keyName = keyName;\n CodeMirror.isModifierKey = isModifierKey;\n CodeMirror.lookupKey = lookupKey;\n CodeMirror.normalizeKeyMap = normalizeKeyMap;\n CodeMirror.StringStream = StringStream;\n CodeMirror.SharedTextMarker = SharedTextMarker;\n CodeMirror.TextMarker = TextMarker;\n CodeMirror.LineWidget = LineWidget;\n CodeMirror.e_preventDefault = e_preventDefault;\n CodeMirror.e_stopPropagation = e_stopPropagation;\n CodeMirror.e_stop = e_stop;\n CodeMirror.addClass = addClass;\n CodeMirror.contains = contains;\n CodeMirror.rmClass = rmClass;\n CodeMirror.keyNames = keyNames;\n }\n\n // EDITOR CONSTRUCTOR\n\n defineOptions(CodeMirror);\n\n addEditorMethods(CodeMirror);\n\n // Set up methods on CodeMirror's prototype to redirect to the editor's document.\n var dontDelegate = \"iter insert remove copy getEditor constructor\".split(\" \");\n for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)\n { CodeMirror.prototype[prop] = (function(method) {\n return function() {return method.apply(this.doc, arguments)}\n })(Doc.prototype[prop]); } }\n\n eventMixin(Doc);\n CodeMirror.inputStyles = {\"textarea\": TextareaInput, \"contenteditable\": ContentEditableInput};\n\n // Extra arguments are stored as the mode's dependencies, which is\n // used by (legacy) mechanisms like loadmode.js to automatically\n // load a mode. (Preferred mechanism is the require/define calls.)\n CodeMirror.defineMode = function(name/*, mode, …*/) {\n if (!CodeMirror.defaults.mode && name != \"null\") { CodeMirror.defaults.mode = name; }\n defineMode.apply(this, arguments);\n };\n\n CodeMirror.defineMIME = defineMIME;\n\n // Minimal default mode.\n CodeMirror.defineMode(\"null\", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); });\n CodeMirror.defineMIME(\"text/plain\", \"null\");\n\n // EXTENSIONS\n\n CodeMirror.defineExtension = function (name, func) {\n CodeMirror.prototype[name] = func;\n };\n CodeMirror.defineDocExtension = function (name, func) {\n Doc.prototype[name] = func;\n };\n\n CodeMirror.fromTextArea = fromTextArea;\n\n addLegacyProps(CodeMirror);\n\n CodeMirror.version = \"5.45.0\";\n\n return CodeMirror;\n\n})));\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/codemirror/lib/codemirror.js\n// module id = 644\n// module chunks = 3 4 5 7 8 14","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./spin.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./spin.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./spin.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./spin.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/spin/spin.vue\n// module id = 646\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/resource/pages/file/pages/details/_source/noType.vue"],"sourceRoot":""} \ No newline at end of file diff --git a/escheduler-ui/dist/js/9.8d22246.js b/escheduler-ui/dist/js/9.8d22246.js new file mode 100644 index 0000000000..3f2ac53b07 --- /dev/null +++ b/escheduler-ui/dist/js/9.8d22246.js @@ -0,0 +1,2 @@ +webpackJsonp([9],{1006:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(985),i=n.n(s);for(var a in s)"default"!==a&&function(t){n.d(e,t,function(){return s[t]})}(a);var r=n(1009);var o=function(t){n(1007)},u=n(27)(i.a,r.a,!1,o,null,null);e.default=u.exports},1007:function(t,e,n){var s=n(1008);"string"==typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);n(35)("246f52bc",s,!0,{})},1008:function(t,e,n){(t.exports=n(34)(!1)).push([t.i,".transfer-model{padding:0 20px}.transfer-model .select-list-box{width:220px;float:left;border:1px solid #dcdee2;border-radius:3px}.transfer-model .select-list-box .tf-header{height:36px;line-height:36px;background:#f9fafc;position:relative;border-bottom:1px solid #dcdee2;margin-bottom:8px}.transfer-model .select-list-box .tf-header .title{position:absolute;left:8px;top:0}.transfer-model .select-list-box .tf-header .count{position:absolute;right:8px;top:0;font-size:12px}.transfer-model .select-list-box .tf-search{background:#fff;padding:8px}.transfer-model .select-list-box .tf-search .fa-search{color:#999}.transfer-model .select-list-box .tf-content{height:280px}.transfer-model .select-list-box .tf-content ul li{height:28px;line-height:28px;cursor:pointer}.transfer-model .select-list-box .tf-content ul li span{padding-left:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:210px;display:inline-block}.transfer-model .select-list-box .tf-content ul li:hover{background:#f6faff}.transfer-model .select-oper-box{width:20px;float:left}",""])},1009:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("m-popup",{ref:"popup",attrs:{"ok-text":t.$t("确认提交"),nameText:t.type.name+t.$t("授权")},on:{ok:t._ok}},[n("template",{slot:"content"},[n("div",{staticClass:"clearfix transfer-model"},[n("div",{staticClass:"select-list-box"},[n("div",{staticClass:"tf-header"},[n("div",{staticClass:"title"},[t._v(t._s(t.type.name)+t._s(t.$t("列表")))]),t._v(" "),n("div",{staticClass:"count"},[t._v("("+t._s(t.cacheSourceList.length)+")")])]),t._v(" "),n("div",{staticClass:"scrollbar tf-content"},[n("ul",t._l(t.sourceList,function(e,s){return n("li",{key:e.id,on:{click:function(n){return t._ckSource(e)}}},[n("span",[t._v(t._s(e.name))]),t._v(" "),n("a",{attrs:{href:"javascript:"}})])}),0)])]),t._v(" "),n("div",{staticClass:"select-oper-box"},[t._v(" ")]),t._v(" "),n("div",{staticClass:"select-list-box"},[n("div",{staticClass:"tf-header"},[n("div",{staticClass:"title"},[t._v(t._s(t.$t("已选"))+t._s(t.type.name))]),t._v(" "),n("div",{staticClass:"count"},[t._v("("+t._s(t.cacheTargetList.length)+")")])]),t._v(" "),n("div",{staticClass:"scrollbar tf-content"},[n("ul",t._l(t.targetList,function(e,s){return n("li",{key:e.id,on:{click:function(n){return t._ckTarget(e)}}},[n("span",[t._v(t._s(e.name))])])}),0)])])])])],2)},staticRenderFns:[]};e.a=s},1010:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(986),i=n.n(s);for(var a in s)"default"!==a&&function(t){n.d(e,t,function(){return s[t]})}(a);var r=n(1011),o=n(27)(i.a,r.a,!1,null,null,null);e.default=o.exports},1011:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("m-popup",{ref:"popup",attrs:{"ok-text":t.item?t.$t("确认编辑"):t.$t("确认提交"),nameText:t.item?t.$t("编辑用户"):t.$t("创建用户")},on:{ok:t._ok}},[n("template",{slot:"content"},[n("div",{staticClass:"create-user-model"},[n("m-list-box-f",[n("template",{slot:"name"},[n("b",[t._v("*")]),t._v(t._s(t.$t("用户名称")))]),t._v(" "),n("template",{slot:"content"},[n("x-input",{attrs:{type:"input",placeholder:t.$t("请输入用户名称")},model:{value:t.userName,callback:function(e){t.userName=e},expression:"userName"}})],1)],2),t._v(" "),"account"!==t.router.history.current.name?n("m-list-box-f",[n("template",{slot:"name"},[n("b",[t._v("*")]),t._v(t._s(t.$t("密码")))]),t._v(" "),n("template",{slot:"content"},[n("x-input",{attrs:{type:"input",placeholder:t.$t("请输入密码")},model:{value:t.userPassword,callback:function(e){t.userPassword=e},expression:"userPassword"}})],1)],2):t._e(),t._v(" "),t.isADMIN?n("m-list-box-f",[n("template",{slot:"name"},[n("b",[t._v("*")]),t._v(t._s(t.$t("租户")))]),t._v(" "),n("template",{slot:"content"},[n("x-select",{model:{value:t.tenantId,callback:function(e){t.tenantId=e},expression:"tenantId"}},t._l(t.tenantList,function(t){return n("x-option",{key:t.id,attrs:{value:t,label:t.code}})}),1)],1)],2):t._e(),t._v(" "),n("m-list-box-f",[n("template",{slot:"name"},[n("b",[t._v("*")]),t._v(t._s(t.$t("邮件")))]),t._v(" "),n("template",{slot:"content"},[n("x-input",{attrs:{type:"input",placeholder:t.$t("请输入邮件")},model:{value:t.email,callback:function(e){t.email=e},expression:"email"}})],1)],2),t._v(" "),n("m-list-box-f",[n("template",{slot:"name"},[t._v(t._s(t.$t("手机")))]),t._v(" "),n("template",{slot:"content"},[n("x-input",{attrs:{type:"input",placeholder:t.$t("请输入手机")},model:{value:t.phone,callback:function(e){t.phone=e},expression:"phone"}})],1)],2)],1)])],2)},staticRenderFns:[]};e.a=s},1069:function(t,e,n){"use strict";e.__esModule=!0;var s=n(123),i=d(n(1200)),a=d(n(1010)),r=d(n(646)),o=d(n(663)),u=d(n(670)),c=d(n(654)),l=d(n(650));function d(t){return t&&t.__esModule?t:{default:t}}e.default={name:"users-index",data:function(){return{pageSize:10,pageNo:1,total:null,searchVal:"",isLoading:!0,userList:[]}},props:{},methods:Object.assign({},(0,s.mapActions)("security",["getUsersList"]),{_onConditions:function(t){this.searchVal=t.searchVal,this.pageNo=1,this._getUsersListP()},_page:function(t){this.pageNo=t,this._getUsersListP()},_create:function(t){var e=this,n=this.$modal.dialog({closable:!1,showMask:!0,escClose:!0,className:"v-modal-custom",transitionName:"opacityp",render:function(s){return s(a.default,{on:{onUpdate:function(){e._getUsersListP("false"),n.remove()},close:function(){n.remove()}},props:{item:t}})}})},_getUsersListP:function(t){var e=this;this.isLoading=!t,this.getUsersList({pageSize:this.pageSize,pageNo:this.pageNo,searchVal:this.searchVal}).then(function(t){e.userList=t.totalList,e.total=t.total,e.isLoading=!1}).catch(function(t){e.isLoading=!1})}}),watch:{},created:function(){this._getUsersListP()},mounted:function(){},components:{mSecondaryMenu:c.default,mList:i.default,mListConstruction:l.default,mConditions:u.default,mSpin:r.default,mNoData:o.default}}},1070:function(t,e,n){"use strict";e.__esModule=!0;var s=u(n(28)),i=u(n(36)),a=n(123);n(668);var r=n(125),o=u(n(1006));function u(t){return t&&t.__esModule?t:{default:t}}e.default={name:"user-list",data:function(){return{list:[]}},props:{userList:Array,pageNo:Number,pageSize:Number},methods:Object.assign({},(0,a.mapActions)("security",["deleteUser","getAuthList","grantAuthorization"]),{_closeDelete:function(t){this.$refs["poptip-delete-"+t][0].doClose()},_delete:function(t,e){var n=this;this.deleteUser({id:t.id}).then(function(t){n.$refs["poptip-delete-"+e][0].doClose(),n.list.splice(e,1),n.$message.success(t.msg)}).catch(function(t){n.$refs["poptip-delete-"+e][0].doClose(),n.$message.error(t.msg||"")})},_edit:function(t){(0,r.findComponentDownward)(this.$root,"users-index")._create(t)},_authProject:function(t,e){var n=this;this.$refs["poptip-auth-"+e][0].doClose(),this.getAuthList({id:t.id,type:"project",category:"projects"}).then(function(e){var a=s.default.map(e[0],function(t){return{id:t.id,name:t.name}}),r=s.default.map(e[1],function(t){return{id:t.id,name:t.name}}),u=n,c=n.$modal.dialog({closable:!1,showMask:!0,escClose:!0,className:"v-modal-custom",transitionName:"opacityp",render:function(e){return e(o.default,{on:{onUpdate:function(e){u._grantAuthorization("users/grant-project",{userId:t.id,projectIds:e}),c.remove()},close:function(){c.remove()}},props:{sourceListPrs:a,targetListPrs:r,type:{name:""+i.default.$t("项目")}}})}})})},_authFile:function(t,e){var n=this;this.$refs["poptip-auth-"+e][0].doClose(),this.getAuthList({id:t.id,type:"file",category:"resources"}).then(function(e){var a=s.default.map(e[0],function(t){return{id:t.id,name:t.name}}),r=s.default.map(e[1],function(t){return{id:t.id,name:t.name}}),u=n,c=n.$modal.dialog({closable:!1,showMask:!0,escClose:!0,className:"v-modal-custom",transitionName:"opacityp",render:function(e){return e(o.default,{on:{onUpdate:function(e){u._grantAuthorization("users/grant-file",{userId:t.id,resourceIds:e}),c.remove()},close:function(){c.remove()}},props:{sourceListPrs:a,targetListPrs:r,type:{name:""+i.default.$t("资源")}}})}})})},_authDataSource:function(t,e){var n=this;this.$refs["poptip-auth-"+e][0].doClose(),this.getAuthList({id:t.id,type:"datasource",category:"datasources"}).then(function(e){var a=s.default.map(e[0],function(t){return{id:t.id,name:t.name}}),r=s.default.map(e[1],function(t){return{id:t.id,name:t.name}}),u=n,c=n.$modal.dialog({closable:!1,showMask:!0,escClose:!0,className:"v-modal-custom",transitionName:"opacityp",render:function(e){return e(o.default,{on:{onUpdate:function(e){u._grantAuthorization("users/grant-datasource",{userId:t.id,datasourceIds:e}),c.remove()},close:function(){c.remove()}},props:{sourceListPrs:a,targetListPrs:r,type:{name:""+i.default.$t("数据源")}}})}})})},_authUdfFunc:function(t,e){var n=this;this.$refs["poptip-auth-"+e][0].doClose(),this.getAuthList({id:t.id,type:"udf-func",category:"resources"}).then(function(e){var i=s.default.map(e[0],function(t){return{id:t.id,name:t.funcName}}),a=s.default.map(e[1],function(t){return{id:t.id,name:t.funcName}}),r=n,u=n.$modal.dialog({closable:!1,showMask:!0,escClose:!0,className:"v-modal-custom",transitionName:"opacityp",render:function(e){return e(o.default,{on:{onUpdate:function(e){r._grantAuthorization("users/grant-udf-func",{userId:t.id,udfIds:e}),u.remove()},close:function(){u.remove()}},props:{sourceListPrs:i,targetListPrs:a,type:{name:"UDF函数"}}})}})})},_grantAuthorization:function(t,e){var n=this;this.grantAuthorization({api:t,param:e}).then(function(t){n.$message.success(t.msg)}).catch(function(t){n.$message.error(t.msg||"")})}}),watch:{userList:function(t){var e=this;this.list=[],setTimeout(function(){e.list=t})}},created:function(){this.list=this.userList},mounted:function(){},components:{}}},1200:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(1070),i=n.n(s);for(var a in s)"default"!==a&&function(t){n.d(e,t,function(){return s[t]})}(a);var r=n(1203);var o=function(t){n(1201)},u=n(27)(i.a,r.a,!1,o,null,null);e.default=u.exports},1201:function(t,e,n){var s=n(1202);"string"==typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);n(35)("0e7bd02e",s,!0,{})},1202:function(t,e,n){(t.exports=n(34)(!1)).push([t.i,".user-list-model .user-list-poptip{min-width:90px!important}.user-list-model .user-list-poptip .auth-select-box a{font-size:14px;height:28px;line-height:28px;display:block}",""])},1203:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"list-model user-list-model"},[n("div",{staticClass:"table-box"},[n("table",[n("tr",[n("th",[n("span",[t._v(t._s(t.$t("编号")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("用户名称")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("租户")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("邮箱")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("手机")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("创建时间")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("更新时间")))])]),t._v(" "),n("th",{attrs:{width:"120"}},[n("span",[t._v(t._s(t.$t("操作")))])])]),t._v(" "),t._l(t.list,function(e,s){return n("tr",{key:e.id},[n("td",[n("span",[t._v(t._s(parseInt(1===t.pageNo?s+1:s+1+t.pageSize*(t.pageNo-1))))])]),t._v(" "),n("td",[n("span",[n("a",{staticClass:"links",attrs:{href:"javascript:"}},[t._v(t._s(e.userName||"-"))])])]),t._v(" "),n("td",[n("span",[t._v(t._s(e.tenantName||"-"))])]),t._v(" "),n("td",[n("span",[t._v(t._s(e.email||"-"))])]),t._v(" "),n("td",[n("span",[t._v(t._s(e.phone||"-"))])]),t._v(" "),n("td",[n("span",[t._v(t._s(t._f("formatDate")(e.createTime)))])]),t._v(" "),n("td",[n("span",[t._v(t._s(t._f("formatDate")(e.updateTime)))])]),t._v(" "),n("td",[n("x-poptip",{ref:"poptip-auth-"+s,refInFor:!0,attrs:{"popper-class":"user-list-poptip",placement:"bottom-end"}},[n("div",{staticClass:"auth-select-box"},[n("a",{attrs:{href:"javascript:"},on:{click:function(n){return t._authProject(e,s)}}},[t._v(t._s(t.$t("项目")))]),t._v(" "),n("a",{attrs:{href:"javascript:"},on:{click:function(n){return t._authFile(e,s)}}},[t._v(t._s(t.$t("资源")))]),t._v(" "),n("a",{attrs:{href:"javascript:"},on:{click:function(n){return t._authDataSource(e,s)}}},[t._v(t._s(t.$t("数据源")))]),t._v(" "),n("a",{attrs:{href:"javascript:"},on:{click:function(n){return t._authUdfFunc(e,s)}}},[t._v(t._s(t.$t("UDF函数")))])]),t._v(" "),n("template",{slot:"reference"},[n("x-button",{attrs:{type:"warning",shape:"circle",size:"xsmall","data-toggle":"tooltip",title:t.$t("授权"),icon:"iconfont icon-yonghu1"}})],1)],2),t._v(" "),n("x-button",{attrs:{type:"info",shape:"circle",size:"xsmall","data-toggle":"tooltip",icon:"iconfont icon-bianjixiugai",title:t.$t("编辑")},on:{click:function(n){return t._edit(e)}}}),t._v(" "),n("x-poptip",{ref:"poptip-delete-"+s,refInFor:!0,attrs:{placement:"bottom-end",width:"90"}},[n("p",[t._v(t._s(t.$t("确定删除吗?")))]),t._v(" "),n("div",{staticStyle:{"text-align":"right",margin:"0","padding-top":"4px"}},[n("x-button",{attrs:{type:"text",size:"xsmall",shape:"circle"},on:{click:function(e){return t._closeDelete(s)}}},[t._v(t._s(t.$t("取消")))]),t._v(" "),n("x-button",{attrs:{type:"primary",size:"xsmall",shape:"circle"},on:{click:function(n){return t._delete(e,s)}}},[t._v(t._s(t.$t("确定")))])],1),t._v(" "),n("template",{slot:"reference"},[n("x-button",{attrs:{type:"error",shape:"circle",size:"xsmall","data-toggle":"tooltip",title:t.$t("删除"),icon:"iconfont icon-shanchu"}})],1)],2)],1)])})],2)])])},staticRenderFns:[]};e.a=s},1204:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"main-layout-box"},[n("m-secondary-menu",{attrs:{type:"security"}}),t._v(" "),[n("m-list-construction",{attrs:{title:t.$t("用户管理")}},[n("template",{slot:"conditions"},[n("m-conditions",{on:{"on-conditions":t._onConditions}},[n("template",{slot:"button-group"},[n("x-button",{attrs:{type:"ghost",size:"small"},on:{click:function(e){return t._create("")}}},[t._v(t._s(t.$t("创建用户")))])],1)],2)],1),t._v(" "),n("template",{slot:"content"},[t.userList.length?[n("m-list",{attrs:{"user-list":t.userList,"page-no":t.pageNo,"page-size":t.pageSize}}),t._v(" "),n("div",{staticClass:"page-box"},[n("x-page",{attrs:{current:t.pageNo,total:t.total,"show-elevator":""},on:{"on-change":t._page}})],1)]:t._e(),t._v(" "),t.userList.length?t._e():[n("m-no-data")],t._v(" "),n("m-spin",{attrs:{"is-spin":t.isLoading}})],2)],2)]],2)},staticRenderFns:[]};e.a=s},630:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(1069),i=n.n(s);for(var a in s)"default"!==a&&function(t){n.d(e,t,function(){return s[t]})}(a);var r=n(1204),o=n(27)(i.a,r.a,!1,null,null,null);e.default=o.exports},639:function(t,e,n){"use strict";e.__esModule=!0,e.default={name:"spin",data:function(){return{}},props:{isSpin:{type:Boolean,default:!0},isLeft:{type:Boolean,default:!0}}}},640:function(t,e,n){"use strict";e.__esModule=!0,e.default={name:"list-construction",data:function(){return{}},props:{title:String}}},641:function(t,e,n){"use strict";e.__esModule=!0;var s,i=n(659),a=(s=i)&&s.__esModule?s:{default:s};e.default={name:"secondary-menu",data:function(){return{menuList:(0,a.default)(this.type),index:0,id:this.$route.params.id,isTogHide:!1}},props:{type:String,className:String},watch:{isTogHide:function(t){var e=$(".main-layout-box");t?e.addClass("toggle"):e.removeClass("toggle")}},methods:{_toggleSubMenu:function(t){t.isOpen=!t.isOpen},_toggleMenu:function(){this.isTogHide=!this.isTogHide}},mounted:function(){}}},643:function(t,e,n){"use strict";e.__esModule=!0,e.default={name:"no-data",props:{msg:String}}},645:function(t,e,n){var s;s=function(){"use strict";var t="millisecond",e="second",n="minute",s="hour",i="day",a="week",r="month",o="quarter",u="year",c=/^(\d{4})-?(\d{1,2})-?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d{1,3})?$/,l=/\[([^\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d=function(t,e,n){var s=String(t);return!s||s.length>=e?t:""+Array(e+1-s.length).join(n)+t},f={s:d,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),s=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+d(s,2,"0")+":"+d(i,2,"0")},m:function(t,e){var n=12*(e.year()-t.year())+(e.month()-t.month()),s=t.clone().add(n,r),i=e-s<0,a=t.clone().add(n+(i?-1:1),r);return Number(-(n+(e-s)/(i?s-a:a-s))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(c){return{M:r,y:u,w:a,d:i,h:s,m:n,s:e,ms:t,Q:o}[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},h="en",m={};m[h]=p;var v=function(t){return t instanceof $},g=function(t,e,n){var s;if(!t)return null;if("string"==typeof t)m[t]&&(s=t),e&&(m[t]=e,s=t);else{var i=t.name;m[i]=t,s=i}return n||(h=s),s},_=function(t,e,n){if(v(t))return t.clone();var s=e?"string"==typeof e?{format:e,pl:n}:e:{};return s.date=t,new $(s)},x=f;x.l=g,x.i=v,x.w=function(t,e){return _(t,{locale:e.$L,utc:e.$u})};var $=function(){function d(t){this.$L=this.$L||g(t.locale,null,!0)||h,this.parse(t)}var f=d.prototype;return f.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(x.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var s=e.match(c);if(s)return n?new Date(Date.UTC(s[1],s[2]-1,s[3]||1,s[4]||0,s[5]||0,s[6]||0,s[7]||0)):new Date(s[1],s[2]-1,s[3]||1,s[4]||0,s[5]||0,s[6]||0,s[7]||0)}return new Date(e)}(t),this.init()},f.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},f.$utils=function(){return x},f.isValid=function(){return!("Invalid Date"===this.$d.toString())},f.isSame=function(t,e){var n=_(t);return this.startOf(e)<=n&&n<=this.endOf(e)},f.isAfter=function(t,e){return _(t).secondary-menu-model{left:-200px}.secondary-menu-model{position:fixed;left:0;top:0;width:200px;background:#41444c;height:100%;padding-top:80px}.secondary-menu-model .toogle-box{position:absolute;right:-1px;top:calc(50% - 50px)}.secondary-menu-model .toogle-box .tog-close{width:12px;height:102px;background:url("+s(n(657))+") no-repeat;display:inline-block}.secondary-menu-model .toogle-box .tog-open{width:12px;height:102px;background:url("+s(n(658))+") no-repeat;display:inline-block;position:absolute;right:-12px;top:0}.secondary-menu-model .leven-1 .name a{height:40px;line-height:40px;display:block;position:relative;padding-left:12px}.secondary-menu-model .leven-1 .name a>.icon{vertical-align:middle;font-size:15px;width:20px;text-align:center;color:#fff}.secondary-menu-model .leven-1 .name a>span{vertical-align:middle;padding-left:2px;font-size:14px;color:#fff}.secondary-menu-model .leven-1 .name a>.angle{position:absolute;right:12px;top:14px}.secondary-menu-model .leven-1 ul li{height:36px;line-height:36px;cursor:pointer;padding-left:39px;color:#fff}.secondary-menu-model .leven-1 ul li a{font-size:14px}.secondary-menu-model .leven-1 ul li.active{border-right:2px solid #2d8cf0;background:#2c2f39}.secondary-menu-model .leven-1 ul li.active span{font-weight:700;color:#2d8cf0}.secondary-menu-model .leven-1 .router-link-active,.secondary-menu-model .leven-1>.router-link-exact-active{background:#f0f6fb}.secondary-menu-model .leven-1 .router-link-active .name,.secondary-menu-model .leven-1>.router-link-exact-active .name{border-right:2px solid #2d8cf0;background:#2b2e38}.secondary-menu-model .leven-1 .router-link-active .name a span,.secondary-menu-model .leven-1>.router-link-exact-active .name a span{color:#2d8cf0;font-weight:700}.secondary-menu-model .leven-1 .router-link-active .name a .fa,.secondary-menu-model .leven-1>.router-link-exact-active .name a .fa{color:#2d8cf0}",""])},657:function(t,e,n){t.exports=n.p+"images/close.png?02806e641df25c1b4dbff4cb0af3984d"},658:function(t,e,n){t.exports=n.p+"images/open.png?97ec0726c7acab8a2a48282d68cea631"},659:function(t,e,n){"use strict";e.__esModule=!0;var s,i=n(36),a=(s=i)&&s.__esModule?s:{default:s};var r={projects:[{name:""+a.default.$t("项目首页"),id:1,path:"projects-index",isOpen:!0,icon:"fa-home",children:[]},{name:""+a.default.$t("工作流"),id:2,path:"",isOpen:!0,icon:"fa-gear",children:[{name:""+a.default.$t("工作流定义"),path:"definition",id:1},{name:""+a.default.$t("工作流实例"),path:"instance",id:2},{name:""+a.default.$t("任务实例"),path:"task-instance-list",id:3}]}],security:[{name:""+a.default.$t("租户管理"),id:1,path:"tenement-manage",isOpen:!0,icon:"fa-users",children:[]},{name:""+a.default.$t("用户管理"),id:1,path:"users-manage",isOpen:!0,icon:"fa-user-circle",children:[]},{name:""+a.default.$t("告警组管理"),id:1,path:"warning-groups-manage",isOpen:!0,icon:"fa-warning",children:[]},{name:""+a.default.$t("队列管理"),id:1,path:"queue-manage",isOpen:!0,icon:"fa-recycle",children:[]},{name:""+a.default.$t("服务管理"),id:1,path:"",isOpen:!0,icon:"fa-server",children:[{name:"master",path:"servers-master",id:1},{name:"worker",path:"servers-worker",id:2}]}],resource:[{name:""+a.default.$t("文件管理"),id:1,path:"file",isOpen:!0,icon:"fa-files-o",children:[],disabled:!1},{name:""+a.default.$t("UDF管理"),id:1,path:"",isOpen:!0,icon:"fa-file-text",disabled:!1,children:[{name:""+a.default.$t("资源管理"),path:"resource-udf-resource",id:1},{name:""+a.default.$t("函数管理"),path:"resource-udf-function",id:2}]}],user:[{name:""+a.default.$t("用户信息"),id:1,path:"account",isOpen:!0,icon:"fa-user",children:[],disabled:!1},{name:""+a.default.$t("修改密码"),id:1,path:"password",isOpen:!0,icon:"fa-key",children:[],disabled:!1}]};e.default=function(t){return r[t]}},660:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"secondary-menu-model",class:t.className},[n("div",{staticClass:"toogle-box"},[t.isTogHide?t._e():n("a",{staticClass:"tog-close",attrs:{href:"javascript:"},on:{click:t._toggleMenu}}),t._v(" "),t.isTogHide?n("a",{staticClass:"tog-open",attrs:{href:"javascript:"},on:{click:t._toggleMenu}}):t._e()]),t._v(" "),t._l(t.menuList,function(e,s){return n("div",{staticClass:"leven-1"},[e.path?[n("router-link",{attrs:{to:{name:e.path}}},[n("div",{staticClass:"name",on:{click:function(n){return t._toggleSubMenu(e)}}},[n("a",{attrs:{href:"javascript:"}},[n("i",{staticClass:"fa icon",class:e.icon}),t._v(" "),n("span",[t._v(t._s(e.name))]),t._v(" "),e.children.length?n("i",{staticClass:"fa angle",class:e.isOpen?"fa-angle-down":"fa-angle-right"}):t._e()])])])]:t._e(),t._v(" "),e.path?t._e():[n("div",{staticClass:"name",on:{click:function(n){return t._toggleSubMenu(e)}}},[n("a",{attrs:{href:"javascript:"}},[n("i",{staticClass:"fa icon",class:e.icon}),t._v(" "),n("span",[t._v(t._s(e.name))]),t._v(" "),e.children.length?n("i",{staticClass:"fa angle",class:e.isOpen?"fa-angle-down":"fa-angle-right"}):t._e()])])],t._v(" "),e.isOpen&&e.children.length?n("ul",t._l(e.children,function(e,s){return n("router-link",{attrs:{to:{name:e.path},tag:"li","active-class":"active"}},[n("span",[t._v(t._s(e.name))])])}),1):t._e()],2)})],2)},staticRenderFns:[]};e.a=s},661:function(t,e,n){"use strict";e.__esModule=!0,e.formatDate=void 0;var s,i=n(645),a=(s=i)&&s.__esModule?s:{default:s};e.formatDate=function(t,e){return e=e||"YYYY-MM-DD HH:mm:ss",(0,a.default)(t).format(e)}},662:function(t,e,n){"use strict";e.__esModule=!0;var s,i=n(28),a=(s=i)&&s.__esModule?s:{default:s};e.default={name:"conditions",data:function(){return{searchVal:""}},props:{operation:Array},methods:{_ckQuery:function(){this.$emit("on-conditions",{searchVal:a.default.trim(this.searchVal)})}},computed:{isShow:function(){return this.$slots["search-group"]}},components:{}}},663:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(643),i=n.n(s);for(var a in s)"default"!==a&&function(t){n.d(e,t,function(){return s[t]})}(a);var r=n(666);var o=function(t){n(664)},u=n(27)(i.a,r.a,!1,o,null,null);e.default=u.exports},664:function(t,e,n){var s=n(665);"string"==typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);n(35)("3cb222d8",s,!0,{})},665:function(t,e,n){(t.exports=n(34)(!1)).push([t.i,".no-data-model{position:relative;width:100%;height:calc(100vh - 200px)}.no-data-model .no-data-box{width:210px;height:210px;position:absolute;left:50%;top:50%;margin-left:-105px;margin-top:-105px;text-align:center}.no-data-model .no-data-box .text{padding-top:10px;color:#666}",""])},666:function(t,e,n){"use strict";var s={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"no-data-model"},[e("div",{staticClass:"no-data-box"},[this._m(0),this._v(" "),e("div",{staticClass:"text"},[this._v(this._s(this.msg||this.$t("查询无数据")))])])])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"img"},[e("img",{attrs:{src:n(667),alt:""}})])}]};e.a=s},667:function(t,e,n){t.exports=n.p+"images/errorTip.png?a7b20f0ca8727f22f405c2a34d1363a0"},668:function(t,e,n){"use strict";var s,i=n(29),a=(s=i)&&s.__esModule?s:{default:s},r=n(661);a.default.filter("formatDate",r.formatDate)},670:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(662),i=n.n(s);for(var a in s)"default"!==a&&function(t){n.d(e,t,function(){return s[t]})}(a);var r=n(671),o=n(27)(i.a,r.a,!1,null,null,null);e.default=o.exports},671:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"conditions-model"},[n("div",{staticClass:"left"},[t._t("button-group")],2),t._v(" "),n("div",{staticClass:"right"},[n("div",{staticClass:"from-box"},[t.isShow?t._t("search-group"):t._e(),t._v(" "),t.isShow?t._e():[n("div",{staticClass:"list"},[n("x-button",{attrs:{type:"ghost",size:"small",icon:"fa fa-search"},on:{click:t._ckQuery}})],1),t._v(" "),n("div",{staticClass:"list"},[n("x-input",{staticStyle:{width:"180px"},attrs:{size:"small",placeholder:t.$t("请输入关键词"),type:"text"},on:{"on-enterkey":t._ckQuery},model:{value:t.searchVal,callback:function(e){t.searchVal=e},expression:"searchVal"}})],1)]],2)])])},staticRenderFns:[]};e.a=s},985:function(t,e,n){"use strict";e.__esModule=!0;var s=r(n(28)),i=r(n(223)),a=r(n(224));function r(t){return t&&t.__esModule?t:{default:t}}e.default={name:"transfer",data:function(){return{sourceList:this.sourceListPrs,targetList:this.targetListPrs,cacheSourceList:this.sourceListPrs,cacheTargetList:this.targetListPrs,searchSourceVal:"",searchTargetVal:""}},props:{sourceListPrs:Array,targetListPrs:Array,type:Object},methods:{_ok:function(){var t=this;this.$refs.popup.spinnerLoading=!0,setTimeout(function(){t.$refs.popup.spinnerLoading=!1,t.$emit("onUpdate",s.default.map(t.targetList,function(t){return t.id}).join(","))},800)},_sourceQuery:function(){var t=this;this.sourceList=this.sourceList.filter(function(e){return e.name.indexOf(t.searchSourceVal)>-1})},_targetQuery:function(){var t=this;this.targetList=this.targetList.filter(function(e){return e.name.indexOf(t.searchTargetVal)>-1})},_ckSource:function(t){this.targetList=this.cacheTargetList,this.targetList.unshift(t),this.searchTargetVal="";var e=s.default.findIndex(this.sourceList,function(e){return t.id===e.id});this.sourceList.splice(e,1);var n=s.default.findIndex(this.cacheSourceList,function(e){return t.id===e.id});-1!==n&&this.cacheSourceList.splice(n,1)},_ckTarget:function(t){this.sourceList=this.cacheSourceList,this.sourceList.unshift(t),this.searchSourceVal="";var e=s.default.findIndex(this.targetList,function(e){return t.id===e.id});this.targetList.splice(e,1);var n=s.default.findIndex(this.cacheTargetList,function(e){return t.id===e.id});-1!==n&&this.cacheTargetList.splice(n,1)}},watch:{searchSourceVal:function(t){t?this._sourceQuery():this.sourceList=s.default.cloneDeep(this.cacheSourceList)},searchTargetVal:function(t){t?this._targetQuery():this.targetList=s.default.cloneDeep(this.cacheTargetList)}},components:{mPopup:i.default,mListBoxF:a.default}}},986:function(t,e,n){"use strict";e.__esModule=!0;var s=c(n(28)),i=c(n(36)),a=c(n(91)),r=c(n(222)),o=c(n(223)),u=c(n(224));function c(t){return t&&t.__esModule?t:{default:t}}e.default={name:"create-user",data:function(){return{store:a.default,router:r.default,userName:"",userPassword:"",tenantId:{},email:"",phone:"",tenantList:[],isADMIN:"ADMIN_USER"===a.default.state.user.userInfo.userType&&"account"!==r.default.history.current.name}},props:{item:Object},methods:{_ok:function(){var t=this;if(this._verification()){if(this.item&&this.item.groupName===this.groupName)return void this._submit();this.store.dispatch("security/verifyName",{type:"user",userName:this.userName}).then(function(e){t._submit()}).catch(function(e){t.$message.error(e.msg||"")})}},_verification:function(){return this.userName?this.userPassword||this.item?this.email?/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/.test(this.email)?!(this.phone&&!/(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/.test(this.phone))||(this.$message.warning(""+i.default.$t("请输入正确的手机格式")),!1):(this.$message.warning(""+i.default.$t("请输入正确的邮箱格式")),!1):(this.$message.warning(""+i.default.$t("请输入邮箱")),!1):(this.$message.warning(""+i.default.$t("请输入密码")),!1):(this.$message.warning(""+i.default.$t("请输入用户名")),!1)},_getTenantList:function(){var t=this;return new Promise(function(e,n){t.store.dispatch("security/getTenantList").then(function(n){t.tenantList=s.default.map(n,function(t){return{id:t.id,code:t.tenantName}}),t.$nextTick(function(){t.tenantId=t.tenantList[0]}),e()})})},_submit:function(){var t=this;this.$refs.popup.spinnerLoading=!0;var e={userName:this.userName,userPassword:this.userPassword,tenantId:this.tenantId.id,email:this.email,phone:this.phone};this.item&&(e.id=this.item.id),this.store.dispatch("security/"+(this.item?"updateUser":"createUser"),e).then(function(n){setTimeout(function(){t.$refs.popup.spinnerLoading=!1},800),t.$emit("onUpdate",e),t.$message.success(n.msg)}).catch(function(e){t.$message.error(e.msg||""),t.$refs.popup.spinnerLoading=!1})}},watch:{},created:function(){var t=this;this.isADMIN?this._getTenantList().then(function(e){t.item&&(t.userName=t.item.userName,t.userPassword="",t.email=t.item.email,t.phone=t.item.phone,t.tenantId=s.default.filter(t.tenantList,function(e){return e.id===t.item.tenantId})[0])}):this.item&&(this.userName=this.item.userName,this.userPassword="",this.email=this.item.email,this.phone=this.item.phone,this.tenantId.id=this.item.tenantId)},mounted:function(){},components:{mPopup:o.default,mListBoxF:u.default}}}}); +//# sourceMappingURL=9.8d22246.js.map \ No newline at end of file diff --git a/escheduler-ui/dist/js/9.8d22246.js.map b/escheduler-ui/dist/js/9.8d22246.js.map new file mode 100644 index 0000000000..fbd1c3d669 --- /dev/null +++ b/escheduler-ui/dist/js/9.8d22246.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///./src/js/module/components/transfer/transfer.vue","webpack:///./src/js/module/components/transfer/transfer.vue?8a16","webpack:///./src/js/module/components/transfer/transfer.vue?aa69","webpack:///./src/js/module/components/transfer/transfer.vue?0602","webpack:///./src/js/conf/home/pages/security/pages/users/_source/createUser.vue","webpack:///./src/js/conf/home/pages/security/pages/users/_source/createUser.vue?9431","webpack:///src/js/conf/home/pages/security/pages/users/index.vue","webpack:///src/js/conf/home/pages/security/pages/users/_source/list.vue","webpack:///./src/js/conf/home/pages/security/pages/users/_source/list.vue","webpack:///./src/js/conf/home/pages/security/pages/users/_source/list.vue?2233","webpack:///./src/js/conf/home/pages/security/pages/users/_source/list.vue?f284","webpack:///./src/js/conf/home/pages/security/pages/users/_source/list.vue?d686","webpack:///./src/js/conf/home/pages/security/pages/users/index.vue?84a1","webpack:///./src/js/conf/home/pages/security/pages/users/index.vue","webpack:///src/js/module/components/spin/spin.vue","webpack:///src/js/module/components/listConstruction/listConstruction.vue","webpack:///src/js/module/components/secondaryMenu/secondaryMenu.vue","webpack:///src/js/module/components/noData/noData.vue","webpack:///./node_modules/dayjs/dayjs.min.js","webpack:///./src/js/module/components/spin/spin.vue","webpack:///./src/js/module/components/spin/spin.vue?542d","webpack:///./src/js/module/components/spin/spin.vue?9371","webpack:///./src/js/module/components/spin/spin.vue?87eb","webpack:///./src/js/module/components/listConstruction/listConstruction.vue","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?b527","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?50be","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?6117","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?c652","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?7693","webpack:///./src/js/module/components/secondaryMenu/close.png","webpack:///./src/js/module/components/secondaryMenu/open.png","webpack:///./src/js/module/components/secondaryMenu/menu.js","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?048e","webpack:///./src/js/module/filter/filter.js","webpack:///src/js/module/components/conditions/conditions.vue","webpack:///./src/js/module/components/noData/noData.vue","webpack:///./src/js/module/components/noData/noData.vue?93a9","webpack:///./src/js/module/components/noData/noData.vue?86e8","webpack:///./src/js/module/components/noData/noData.vue?5a51","webpack:///./src/js/module/components/noData/images/errorTip.png","webpack:///./src/js/module/filter/formatDate.js","webpack:///./src/js/module/components/conditions/conditions.vue","webpack:///./src/js/module/components/conditions/conditions.vue?8ed7","webpack:///src/js/module/components/transfer/transfer.vue","webpack:///src/js/conf/home/pages/security/pages/users/_source/createUser.vue"],"names":["Object","defineProperty","__webpack_exports__","value","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_transfer_vue__","__webpack_require__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_transfer_vue___default","n","__WEBPACK_IMPORT_KEY__","key","d","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_5d5d2e6e_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_transfer_vue__","__vue_styles__","ssrContext","Component","normalizeComponent","a","content","module","i","locals","exports","push","esExports","render","_vm","this","_h","$createElement","_c","_self","ref","attrs","ok-text","$t","nameText","type","name","on","ok","_ok","slot","staticClass","_v","_s","cacheSourceList","length","_l","item","$index","id","click","$event","_ckSource","href","cacheTargetList","_ckTarget","staticRenderFns","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_createUser_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_createUser_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_6b4c1568_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_createUser_vue__","placeholder","model","callback","$$v","userName","expression","router","history","current","userPassword","_e","tenantId","city","label","code","email","phone","data","pageSize","pageNo","total","searchVal","isLoading","userList","props","methods","assign","_vuex","mapActions","_onConditions","o","_getUsersListP","_page","val","_create","self","modal","$modal","dialog","closable","showMask","escClose","className","transitionName","h","_createUser2","default","onUpdate","remove","close","flag","_this","getUsersList","then","res","totalList","catch","e","watch","created","mounted","components","mSecondaryMenu","_secondaryMenu2","mList","_list2","mListConstruction","_listConstruction2","mConditions","_conditions2","mSpin","_spin2","mNoData","_noData2","_util","list","Array","Number","_closeDelete","$refs","doClose","_delete","deleteUser","splice","$message","success","msg","error","_edit","findComponentDownward","$root","_authProject","_this2","getAuthList","category","sourceListPrs","_lodash2","map","v","targetListPrs","_transfer2","projectIds","_grantAuthorization","userId","_i18n2","_authFile","_this3","resourceIds","_authDataSource","_this4","datasourceIds","_authUdfFunc","_this5","funcName","udfIds","api","param","_this6","grantAuthorization","_this7","setTimeout","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_6db4109e_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue__","width","parseInt","tenantName","_f","createTime","updateTime","refInFor","popper-class","placement","shape","size","data-toggle","title","icon","staticStyle","text-align","margin","padding-top","on-conditions","user-list","page-no","page-size","show-elevator","on-change","is-spin","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_index_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_index_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_4baadd49_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_index_vue__","isSpin","Boolean","isLeft","String","menuList","_menu2","index","$route","params","isTogHide","is","layoutBox","$","addClass","removeClass","_toggleSubMenu","isOpen","_toggleMenu","t","r","s","u","f","c","join","z","utcOffset","Math","abs","floor","m","year","month","clone","add","ceil","p","M","y","w","ms","Q","toLowerCase","replace","weekdays","split","months","l","S","g","format","pl","date","D","locale","$L","utc","$u","parse","prototype","$d","Date","NaN","test","match","UTC","init","$y","getFullYear","$M","getMonth","$D","getDate","$W","getDay","$H","getHours","$m","getMinutes","$s","getSeconds","$ms","getMilliseconds","$utils","isValid","toString","isSame","startOf","endOf","isAfter","isBefore","$g","set","day","hour","minute","second","millisecond","unix","valueOf","getTime","toDate","apply","slice","$locale","weekStart","$set","min","daysInMonth","get","setDate","subtract","substr","YY","YYYY","MM","MMM","monthsShort","MMMM","DD","dd","weekdaysMin","ddd","weekdaysShort","dddd","H","HH","hh","A","mm","ss","SSS","Z","round","getTimezoneOffset","diff","toJSON","toISOString","toUTCString","extend","isDayjs","en","Ls","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_16cfa774_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_spin_vue__","class","background","height","xmlns","xmlns:xlink","viewBox","preserveAspectRatio","transform","attributeName","values","keyTimes","dur","begin","repeatCount","fill","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_listConstruction_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_listConstruction_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_eae3645c_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_listConstruction_vue__","_t","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_secondaryMenu_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_secondaryMenu_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_f72bdd3a_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_secondaryMenu_vue__","escape","_i18n","menu","projects","i18n","path","children","security","resource","disabled","user","to","el","tag","active-class","_dayjs","formatDate","fmt","_dayjs2","operation","_ckQuery","$emit","trim","computed","isShow","$slots","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noData_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noData_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_2d3808af_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_noData_vue__","_m","src","alt","_vue","_filter","Vue","filter","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_conditions_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_conditions_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_a4fced1a_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_conditions_vue__","on-enterkey","sourceList","targetList","searchSourceVal","searchTargetVal","spinnerLoading","_sourceQuery","indexOf","_targetQuery","unshift","i1","findIndex","i2","cloneDeep","mPopup","_popup2","mListBoxF","_listBoxF2","store","_store2","_router2","tenantList","isADMIN","state","userInfo","userType","_verification","groupName","_submit","dispatch","warning","_getTenantList","Promise","resolve","reject","$nextTick"],"mappings":"oDAAAA,OAAAC,eAAAC,EAAA,cAAAC,OAAA,QAAAC,EAAAC,EAAA,KAAAC,EAAAD,EAAAE,EAAAH,GAAA,QAAAI,KAAAJ,EAAA,YAAAI,GAAA,SAAAC,GAAAJ,EAAAK,EAAAR,EAAAO,EAAA,kBAAAL,EAAAK,KAAA,CAAAD,GAAA,IAAAG,EAAAN,EAAA,MAGA,IASAO,EAZA,SAAAC,GACER,EAAQ,OAgBVS,EAdyBT,EAAQ,GAcjCU,CACET,EAAAU,EACAL,EAAA,GATF,EAWAC,EAPA,KAEA,MAUeV,EAAA,QAAAY,EAAiB,8BCvBhC,IAAAG,EAAcZ,EAAQ,MACtB,iBAAAY,QAA4CC,EAAAC,EAASF,EAAA,MACrDA,EAAAG,SAAAF,EAAAG,QAAAJ,EAAAG,QAEaf,EAAQ,GAARA,CAAsG,WAAAY,GAAA,6BCPnHC,EAAAG,QAA2BhB,EA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AAmD,MAAAnD,KAAAsB,KAAA6B,MACAnD,KAAA8C,SAAAtB,GAAAxB,KAAAsB,KAAAwB,WAIAiD,QAxIA,aA0IAC,YAAAwT,OAAAC,EAAAxU,QAAAyU,UAAAC,EAAA1U","file":"js/9.8d22246.js","sourcesContent":["function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-5d5d2e6e\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./transfer.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./transfer.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./transfer.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-5d5d2e6e\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./transfer.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/transfer/transfer.vue\n// module id = 1006\n// module chunks = 9 10","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/security/pages/users/_source/list.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-6db4109e\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./list.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./list.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./list.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-6db4109e\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./list.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/security/pages/users/_source/list.vue\n// module id = 1200\n// module chunks = 9","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/transfer/transfer.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/security/pages/users/_source/createUser.vue"],"sourceRoot":""} \ No newline at end of file diff --git a/escheduler-ui/dist/js/9.ecd9c2a.js b/escheduler-ui/dist/js/9.ecd9c2a.js deleted file mode 100644 index 55e78df0a4..0000000000 --- a/escheduler-ui/dist/js/9.ecd9c2a.js +++ /dev/null @@ -1,2 +0,0 @@ -webpackJsonp([9],{1006:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(985),i=n.n(s);for(var a in s)"default"!==a&&function(t){n.d(e,t,function(){return s[t]})}(a);var r=n(1009);var o=function(t){n(1007)},u=n(27)(i.a,r.a,!1,o,null,null);e.default=u.exports},1007:function(t,e,n){var s=n(1008);"string"==typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);n(35)("246f52bc",s,!0,{})},1008:function(t,e,n){(t.exports=n(34)(!1)).push([t.i,".transfer-model{padding:0 20px}.transfer-model .select-list-box{width:220px;float:left;border:1px solid #dcdee2;border-radius:3px}.transfer-model .select-list-box .tf-header{height:36px;line-height:36px;background:#f9fafc;position:relative;border-bottom:1px solid #dcdee2;margin-bottom:8px}.transfer-model .select-list-box .tf-header .title{position:absolute;left:8px;top:0}.transfer-model .select-list-box .tf-header .count{position:absolute;right:8px;top:0;font-size:12px}.transfer-model .select-list-box .tf-search{background:#fff;padding:8px}.transfer-model .select-list-box .tf-search .fa-search{color:#999}.transfer-model .select-list-box .tf-content{height:280px}.transfer-model .select-list-box .tf-content ul li{height:28px;line-height:28px;cursor:pointer}.transfer-model .select-list-box .tf-content ul li span{padding-left:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:210px;display:inline-block}.transfer-model .select-list-box .tf-content ul li:hover{background:#f6faff}.transfer-model .select-oper-box{width:20px;float:left}",""])},1009:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("m-popup",{ref:"popup",attrs:{"ok-text":t.$t("确认提交"),nameText:t.type.name+t.$t("授权")},on:{ok:t._ok}},[n("template",{slot:"content"},[n("div",{staticClass:"clearfix transfer-model"},[n("div",{staticClass:"select-list-box"},[n("div",{staticClass:"tf-header"},[n("div",{staticClass:"title"},[t._v(t._s(t.type.name)+t._s(t.$t("列表")))]),t._v(" "),n("div",{staticClass:"count"},[t._v("("+t._s(t.cacheSourceList.length)+")")])]),t._v(" "),n("div",{staticClass:"scrollbar tf-content"},[n("ul",t._l(t.sourceList,function(e,s){return n("li",{key:e.id,on:{click:function(n){return t._ckSource(e)}}},[n("span",[t._v(t._s(e.name))]),t._v(" "),n("a",{attrs:{href:"javascript:"}})])}),0)])]),t._v(" "),n("div",{staticClass:"select-oper-box"},[t._v(" ")]),t._v(" "),n("div",{staticClass:"select-list-box"},[n("div",{staticClass:"tf-header"},[n("div",{staticClass:"title"},[t._v(t._s(t.$t("已选"))+t._s(t.type.name))]),t._v(" "),n("div",{staticClass:"count"},[t._v("("+t._s(t.cacheTargetList.length)+")")])]),t._v(" "),n("div",{staticClass:"scrollbar tf-content"},[n("ul",t._l(t.targetList,function(e,s){return n("li",{key:e.id,on:{click:function(n){return t._ckTarget(e)}}},[n("span",[t._v(t._s(e.name))])])}),0)])])])])],2)},staticRenderFns:[]};e.a=s},1010:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(986),i=n.n(s);for(var a in s)"default"!==a&&function(t){n.d(e,t,function(){return s[t]})}(a);var r=n(1011),o=n(27)(i.a,r.a,!1,null,null,null);e.default=o.exports},1011:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("m-popup",{ref:"popup",attrs:{"ok-text":t.item?t.$t("确认编辑"):t.$t("确认提交"),nameText:t.item?t.$t("编辑用户"):t.$t("创建用户")},on:{ok:t._ok}},[n("template",{slot:"content"},[n("div",{staticClass:"create-user-model"},[n("m-list-box-f",[n("template",{slot:"name"},[n("b",[t._v("*")]),t._v(t._s(t.$t("用户名称")))]),t._v(" "),n("template",{slot:"content"},[n("x-input",{attrs:{type:"input",placeholder:t.$t("请输入用户名称")},model:{value:t.userName,callback:function(e){t.userName=e},expression:"userName"}})],1)],2),t._v(" "),"account"!==t.router.history.current.name?n("m-list-box-f",[n("template",{slot:"name"},[n("b",[t._v("*")]),t._v(t._s(t.$t("密码")))]),t._v(" "),n("template",{slot:"content"},[n("x-input",{attrs:{type:"input",placeholder:t.$t("请输入密码")},model:{value:t.userPassword,callback:function(e){t.userPassword=e},expression:"userPassword"}})],1)],2):t._e(),t._v(" "),t.isADMIN?n("m-list-box-f",[n("template",{slot:"name"},[n("b",[t._v("*")]),t._v(t._s(t.$t("租户")))]),t._v(" "),n("template",{slot:"content"},[n("x-select",{model:{value:t.tenantId,callback:function(e){t.tenantId=e},expression:"tenantId"}},t._l(t.tenantList,function(t){return n("x-option",{key:t.id,attrs:{value:t,label:t.code}})}),1)],1)],2):t._e(),t._v(" "),n("m-list-box-f",[n("template",{slot:"name"},[n("b",[t._v("*")]),t._v(t._s(t.$t("邮件")))]),t._v(" "),n("template",{slot:"content"},[n("x-input",{attrs:{type:"input",placeholder:t.$t("请输入邮件")},model:{value:t.email,callback:function(e){t.email=e},expression:"email"}})],1)],2),t._v(" "),n("m-list-box-f",[n("template",{slot:"name"},[t._v(t._s(t.$t("手机")))]),t._v(" "),n("template",{slot:"content"},[n("x-input",{attrs:{type:"input",placeholder:t.$t("请输入手机")},model:{value:t.phone,callback:function(e){t.phone=e},expression:"phone"}})],1)],2)],1)])],2)},staticRenderFns:[]};e.a=s},1069:function(t,e,n){"use strict";e.__esModule=!0;var s=n(123),i=d(n(1202)),a=d(n(1010)),r=d(n(646)),o=d(n(663)),u=d(n(670)),c=d(n(654)),l=d(n(650));function d(t){return t&&t.__esModule?t:{default:t}}e.default={name:"users-index",data:function(){return{pageSize:10,pageNo:1,total:null,searchVal:"",isLoading:!0,userList:[]}},props:{},methods:Object.assign({},(0,s.mapActions)("security",["getUsersListP"]),{_onConditions:function(t){this.searchVal=t.searchVal,this.pageNo=1,this._getUsersListP()},_page:function(t){this.pageNo=t,this._getUsersListP()},_create:function(t){var e=this,n=this.$modal.dialog({closable:!1,showMask:!0,escClose:!0,className:"v-modal-custom",transitionName:"opacityp",render:function(s){return s(a.default,{on:{onUpdate:function(){e._getUsersListP("false"),n.remove()},close:function(){n.remove()}},props:{item:t}})}})},_getUsersListP:function(t){var e=this;this.isLoading=!t,this.getUsersListP({pageSize:this.pageSize,pageNo:this.pageNo,searchVal:this.searchVal}).then(function(t){e.userList=t.totalList,e.total=t.total,e.isLoading=!1}).catch(function(t){e.isLoading=!1})}}),watch:{},created:function(){this._getUsersListP()},mounted:function(){},components:{mSecondaryMenu:c.default,mList:i.default,mListConstruction:l.default,mConditions:u.default,mSpin:r.default,mNoData:o.default}}},1070:function(t,e,n){"use strict";e.__esModule=!0;var s=u(n(28)),i=u(n(36)),a=n(123);n(668);var r=n(125),o=u(n(1006));function u(t){return t&&t.__esModule?t:{default:t}}e.default={name:"user-list",data:function(){return{list:[]}},props:{userList:Array,pageNo:Number,pageSize:Number},methods:Object.assign({},(0,a.mapActions)("security",["deleteUser","getAuthList","grantAuthorization"]),{_closeDelete:function(t){this.$refs["poptip-delete-"+t][0].doClose()},_delete:function(t,e){var n=this;this.deleteUser({id:t.id}).then(function(t){n.$refs["poptip-delete-"+e][0].doClose(),n.list.splice(e,1),n.$message.success(t.msg)}).catch(function(t){n.$refs["poptip-delete-"+e][0].doClose(),n.$message.error(t.msg||"")})},_edit:function(t){(0,r.findComponentDownward)(this.$root,"users-index")._create(t)},_authProject:function(t,e){var n=this;this.$refs["poptip-auth-"+e][0].doClose(),this.getAuthList({id:t.id,type:"project",category:"projects"}).then(function(e){var a=s.default.map(e[0],function(t){return{id:t.id,name:t.name}}),r=s.default.map(e[1],function(t){return{id:t.id,name:t.name}}),u=n,c=n.$modal.dialog({closable:!1,showMask:!0,escClose:!0,className:"v-modal-custom",transitionName:"opacityp",render:function(e){return e(o.default,{on:{onUpdate:function(e){u._grantAuthorization("users/grant-project",{userId:t.id,projectIds:e}),c.remove()},close:function(){c.remove()}},props:{sourceListPrs:a,targetListPrs:r,type:{name:""+i.default.$t("项目")}}})}})})},_authFile:function(t,e){var n=this;this.$refs["poptip-auth-"+e][0].doClose(),this.getAuthList({id:t.id,type:"file",category:"resources"}).then(function(e){var a=s.default.map(e[0],function(t){return{id:t.id,name:t.name}}),r=s.default.map(e[1],function(t){return{id:t.id,name:t.name}}),u=n,c=n.$modal.dialog({closable:!1,showMask:!0,escClose:!0,className:"v-modal-custom",transitionName:"opacityp",render:function(e){return e(o.default,{on:{onUpdate:function(e){u._grantAuthorization("users/grant-file",{userId:t.id,resourceIds:e}),c.remove()},close:function(){c.remove()}},props:{sourceListPrs:a,targetListPrs:r,type:{name:""+i.default.$t("资源")}}})}})})},_authDataSource:function(t,e){var n=this;this.$refs["poptip-auth-"+e][0].doClose(),this.getAuthList({id:t.id,type:"datasource",category:"datasources"}).then(function(e){var a=s.default.map(e[0],function(t){return{id:t.id,name:t.name}}),r=s.default.map(e[1],function(t){return{id:t.id,name:t.name}}),u=n,c=n.$modal.dialog({closable:!1,showMask:!0,escClose:!0,className:"v-modal-custom",transitionName:"opacityp",render:function(e){return e(o.default,{on:{onUpdate:function(e){u._grantAuthorization("users/grant-datasource",{userId:t.id,datasourceIds:e}),c.remove()},close:function(){c.remove()}},props:{sourceListPrs:a,targetListPrs:r,type:{name:""+i.default.$t("数据源")}}})}})})},_authUdfFunc:function(t,e){var n=this;this.$refs["poptip-auth-"+e][0].doClose(),this.getAuthList({id:t.id,type:"udf-func",category:"resources"}).then(function(e){var i=s.default.map(e[0],function(t){return{id:t.id,name:t.funcName}}),a=s.default.map(e[1],function(t){return{id:t.id,name:t.funcName}}),r=n,u=n.$modal.dialog({closable:!1,showMask:!0,escClose:!0,className:"v-modal-custom",transitionName:"opacityp",render:function(e){return e(o.default,{on:{onUpdate:function(e){r._grantAuthorization("users/grant-udf-func",{userId:t.id,udfIds:e}),u.remove()},close:function(){u.remove()}},props:{sourceListPrs:i,targetListPrs:a,type:{name:"UDF函数"}}})}})})},_grantAuthorization:function(t,e){var n=this;this.grantAuthorization({api:t,param:e}).then(function(t){n.$message.success(t.msg)}).catch(function(t){n.$message.error(t.msg||"")})}}),watch:{userList:function(t){var e=this;this.list=[],setTimeout(function(){e.list=t})}},created:function(){this.list=this.userList},mounted:function(){},components:{}}},1202:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(1070),i=n.n(s);for(var a in s)"default"!==a&&function(t){n.d(e,t,function(){return s[t]})}(a);var r=n(1205);var o=function(t){n(1203)},u=n(27)(i.a,r.a,!1,o,null,null);e.default=u.exports},1203:function(t,e,n){var s=n(1204);"string"==typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);n(35)("0e7bd02e",s,!0,{})},1204:function(t,e,n){(t.exports=n(34)(!1)).push([t.i,".user-list-model .user-list-poptip{min-width:90px!important}.user-list-model .user-list-poptip .auth-select-box a{font-size:14px;height:28px;line-height:28px;display:block}",""])},1205:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"list-model user-list-model"},[n("div",{staticClass:"table-box"},[n("table",[n("tr",[n("th",[n("span",[t._v(t._s(t.$t("编号")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("用户名称")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("租户")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("邮箱")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("手机")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("创建时间")))])]),t._v(" "),n("th",[n("span",[t._v(t._s(t.$t("更新时间")))])]),t._v(" "),n("th",{attrs:{width:"120"}},[n("span",[t._v(t._s(t.$t("操作")))])])]),t._v(" "),t._l(t.list,function(e,s){return n("tr",{key:e.id},[n("td",[n("span",[t._v(t._s(parseInt(1===t.pageNo?s+1:s+1+t.pageSize*(t.pageNo-1))))])]),t._v(" "),n("td",[n("span",[n("a",{staticClass:"links",attrs:{href:"javascript:"}},[t._v(t._s(e.userName||"-"))])])]),t._v(" "),n("td",[n("span",[t._v(t._s(e.tenantName||"-"))])]),t._v(" "),n("td",[n("span",[t._v(t._s(e.email||"-"))])]),t._v(" "),n("td",[n("span",[t._v(t._s(e.phone||"-"))])]),t._v(" "),n("td",[n("span",[t._v(t._s(t._f("formatDate")(e.createTime)))])]),t._v(" "),n("td",[n("span",[t._v(t._s(t._f("formatDate")(e.updateTime)))])]),t._v(" "),n("td",[n("x-poptip",{ref:"poptip-auth-"+s,refInFor:!0,attrs:{"popper-class":"user-list-poptip",placement:"bottom-end"}},[n("div",{staticClass:"auth-select-box"},[n("a",{attrs:{href:"javascript:"},on:{click:function(n){return t._authProject(e,s)}}},[t._v(t._s(t.$t("项目")))]),t._v(" "),n("a",{attrs:{href:"javascript:"},on:{click:function(n){return t._authFile(e,s)}}},[t._v(t._s(t.$t("资源")))]),t._v(" "),n("a",{attrs:{href:"javascript:"},on:{click:function(n){return t._authDataSource(e,s)}}},[t._v(t._s(t.$t("数据源")))]),t._v(" "),n("a",{attrs:{href:"javascript:"},on:{click:function(n){return t._authUdfFunc(e,s)}}},[t._v(t._s(t.$t("UDF函数")))])]),t._v(" "),n("template",{slot:"reference"},[n("x-button",{attrs:{type:"warning",shape:"circle",size:"xsmall","data-toggle":"tooltip",title:t.$t("授权"),icon:"iconfont icon-yonghu1"}})],1)],2),t._v(" "),n("x-button",{attrs:{type:"info",shape:"circle",size:"xsmall","data-toggle":"tooltip",icon:"iconfont icon-bianjixiugai",title:t.$t("编辑")},on:{click:function(n){return t._edit(e)}}}),t._v(" "),n("x-poptip",{ref:"poptip-delete-"+s,refInFor:!0,attrs:{placement:"bottom-end",width:"90"}},[n("p",[t._v(t._s(t.$t("确定删除吗?")))]),t._v(" "),n("div",{staticStyle:{"text-align":"right",margin:"0","padding-top":"4px"}},[n("x-button",{attrs:{type:"text",size:"xsmall",shape:"circle"},on:{click:function(e){return t._closeDelete(s)}}},[t._v(t._s(t.$t("取消")))]),t._v(" "),n("x-button",{attrs:{type:"primary",size:"xsmall",shape:"circle"},on:{click:function(n){return t._delete(e,s)}}},[t._v(t._s(t.$t("确定")))])],1),t._v(" "),n("template",{slot:"reference"},[n("x-button",{attrs:{type:"error",shape:"circle",size:"xsmall","data-toggle":"tooltip",title:t.$t("删除"),icon:"iconfont icon-shanchu"}})],1)],2)],1)])})],2)])])},staticRenderFns:[]};e.a=s},1206:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"main-layout-box"},[n("m-secondary-menu",{attrs:{type:"security"}}),t._v(" "),[n("m-list-construction",{attrs:{title:t.$t("用户管理")}},[n("template",{slot:"conditions"},[n("m-conditions",{on:{"on-conditions":t._onConditions}},[n("template",{slot:"button-group"},[n("x-button",{attrs:{type:"ghost",size:"small"},on:{click:function(e){return t._create("")}}},[t._v(t._s(t.$t("创建用户")))])],1)],2)],1),t._v(" "),n("template",{slot:"content"},[t.userList.length?[n("m-list",{attrs:{"user-list":t.userList,"page-no":t.pageNo,"page-size":t.pageSize}}),t._v(" "),n("div",{staticClass:"page-box"},[n("x-page",{attrs:{current:t.pageNo,total:t.total,"show-elevator":""},on:{"on-change":t._page}})],1)]:t._e(),t._v(" "),t.userList.length?t._e():[n("m-no-data")],t._v(" "),n("m-spin",{attrs:{"is-spin":t.isLoading}})],2)],2)]],2)},staticRenderFns:[]};e.a=s},630:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(1069),i=n.n(s);for(var a in s)"default"!==a&&function(t){n.d(e,t,function(){return s[t]})}(a);var r=n(1206),o=n(27)(i.a,r.a,!1,null,null,null);e.default=o.exports},639:function(t,e,n){"use strict";e.__esModule=!0,e.default={name:"spin",data:function(){return{}},props:{isSpin:{type:Boolean,default:!0},isLeft:{type:Boolean,default:!0}}}},640:function(t,e,n){"use strict";e.__esModule=!0,e.default={name:"list-construction",data:function(){return{}},props:{title:String}}},641:function(t,e,n){"use strict";e.__esModule=!0;var s,i=n(659),a=(s=i)&&s.__esModule?s:{default:s};e.default={name:"secondary-menu",data:function(){return{menuList:(0,a.default)(this.type),index:0,id:this.$route.params.id,isTogHide:!1}},props:{type:String,className:String},watch:{isTogHide:function(t){var e=$(".main-layout-box");t?e.addClass("toggle"):e.removeClass("toggle")}},methods:{_toggleSubMenu:function(t){t.isOpen=!t.isOpen},_toggleMenu:function(){this.isTogHide=!this.isTogHide}},mounted:function(){}}},643:function(t,e,n){"use strict";e.__esModule=!0,e.default={name:"no-data",props:{msg:String}}},645:function(t,e,n){var s;s=function(){"use strict";var t="millisecond",e="second",n="minute",s="hour",i="day",a="week",r="month",o="quarter",u="year",c=/^(\d{4})-?(\d{1,2})-?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d{1,3})?$/,l=/\[([^\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d=function(t,e,n){var s=String(t);return!s||s.length>=e?t:""+Array(e+1-s.length).join(n)+t},f={s:d,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),s=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+d(s,2,"0")+":"+d(i,2,"0")},m:function(t,e){var n=12*(e.year()-t.year())+(e.month()-t.month()),s=t.clone().add(n,r),i=e-s<0,a=t.clone().add(n+(i?-1:1),r);return Number(-(n+(e-s)/(i?s-a:a-s))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(c){return{M:r,y:u,w:a,d:i,h:s,m:n,s:e,ms:t,Q:o}[c]||String(c||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},h="en",m={};m[h]=p;var v=function(t){return t instanceof $},g=function(t,e,n){var s;if(!t)return null;if("string"==typeof t)m[t]&&(s=t),e&&(m[t]=e,s=t);else{var i=t.name;m[i]=t,s=i}return n||(h=s),s},_=function(t,e,n){if(v(t))return t.clone();var s=e?"string"==typeof e?{format:e,pl:n}:e:{};return s.date=t,new $(s)},x=f;x.l=g,x.i=v,x.w=function(t,e){return _(t,{locale:e.$L,utc:e.$u})};var $=function(){function d(t){this.$L=this.$L||g(t.locale,null,!0)||h,this.parse(t)}var f=d.prototype;return f.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(x.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var s=e.match(c);if(s)return n?new Date(Date.UTC(s[1],s[2]-1,s[3]||1,s[4]||0,s[5]||0,s[6]||0,s[7]||0)):new Date(s[1],s[2]-1,s[3]||1,s[4]||0,s[5]||0,s[6]||0,s[7]||0)}return new Date(e)}(t),this.init()},f.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},f.$utils=function(){return x},f.isValid=function(){return!("Invalid Date"===this.$d.toString())},f.isSame=function(t,e){var n=_(t);return this.startOf(e)<=n&&n<=this.endOf(e)},f.isAfter=function(t,e){return _(t).secondary-menu-model{left:-200px}.secondary-menu-model{position:fixed;left:0;top:0;width:200px;background:#41444c;height:100%;padding-top:80px}.secondary-menu-model .toogle-box{position:absolute;right:-1px;top:calc(50% - 50px)}.secondary-menu-model .toogle-box .tog-close{width:12px;height:102px;background:url("+s(n(657))+") no-repeat;display:inline-block}.secondary-menu-model .toogle-box .tog-open{width:12px;height:102px;background:url("+s(n(658))+") no-repeat;display:inline-block;position:absolute;right:-12px;top:0}.secondary-menu-model .leven-1 .name a{height:40px;line-height:40px;display:block;position:relative;padding-left:12px}.secondary-menu-model .leven-1 .name a>.icon{vertical-align:middle;font-size:15px;width:20px;text-align:center;color:#fff}.secondary-menu-model .leven-1 .name a>span{vertical-align:middle;padding-left:2px;font-size:14px;color:#fff}.secondary-menu-model .leven-1 .name a>.angle{position:absolute;right:12px;top:14px}.secondary-menu-model .leven-1 ul li{height:36px;line-height:36px;cursor:pointer;padding-left:39px;color:#fff}.secondary-menu-model .leven-1 ul li a{font-size:14px}.secondary-menu-model .leven-1 ul li.active{border-right:2px solid #2d8cf0;background:#2c2f39}.secondary-menu-model .leven-1 ul li.active span{font-weight:700;color:#2d8cf0}.secondary-menu-model .leven-1 .router-link-active,.secondary-menu-model .leven-1>.router-link-exact-active{background:#f0f6fb}.secondary-menu-model .leven-1 .router-link-active .name,.secondary-menu-model .leven-1>.router-link-exact-active .name{border-right:2px solid #2d8cf0;background:#2b2e38}.secondary-menu-model .leven-1 .router-link-active .name a span,.secondary-menu-model .leven-1>.router-link-exact-active .name a span{color:#2d8cf0;font-weight:700}.secondary-menu-model .leven-1 .router-link-active .name a .fa,.secondary-menu-model .leven-1>.router-link-exact-active .name a .fa{color:#2d8cf0}",""])},657:function(t,e,n){t.exports=n.p+"images/close.png?02806e641df25c1b4dbff4cb0af3984d"},658:function(t,e,n){t.exports=n.p+"images/open.png?97ec0726c7acab8a2a48282d68cea631"},659:function(t,e,n){"use strict";e.__esModule=!0;var s,i=n(36),a=(s=i)&&s.__esModule?s:{default:s};var r={projects:[{name:""+a.default.$t("项目首页"),id:1,path:"projects-index",isOpen:!0,icon:"fa-home",children:[]},{name:""+a.default.$t("工作流"),id:2,path:"",isOpen:!0,icon:"fa-gear",children:[{name:""+a.default.$t("工作流定义"),path:"definition",id:1},{name:""+a.default.$t("工作流实例"),path:"instance",id:2},{name:""+a.default.$t("任务实例"),path:"task-instance-list",id:3}]}],security:[{name:""+a.default.$t("租户管理"),id:1,path:"tenement-manage",isOpen:!0,icon:"fa-users",children:[]},{name:""+a.default.$t("用户管理"),id:1,path:"users-manage",isOpen:!0,icon:"fa-user-circle",children:[]},{name:""+a.default.$t("告警组管理"),id:1,path:"warning-groups-manage",isOpen:!0,icon:"fa-warning",children:[]},{name:""+a.default.$t("队列管理"),id:1,path:"queue-manage",isOpen:!0,icon:"fa-warning",children:[]},{name:""+a.default.$t("服务管理"),id:1,path:"",isOpen:!0,icon:"fa-server",children:[{name:"master",path:"servers-master",id:1},{name:"worker",path:"servers-worker",id:2}]}],resource:[{name:""+a.default.$t("文件管理"),id:1,path:"file",isOpen:!0,icon:"fa-files-o",children:[],disabled:!1},{name:""+a.default.$t("UDF管理"),id:1,path:"",isOpen:!0,icon:"fa-file-text",disabled:!1,children:[{name:""+a.default.$t("资源管理"),path:"resource-udf-resource",id:1},{name:""+a.default.$t("函数管理"),path:"resource-udf-function",id:2}]}],user:[{name:""+a.default.$t("用户信息"),id:1,path:"account",isOpen:!0,icon:"fa-user",children:[],disabled:!1},{name:""+a.default.$t("修改密码"),id:1,path:"password",isOpen:!0,icon:"fa-key",children:[],disabled:!1}]};e.default=function(t){return r[t]}},660:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"secondary-menu-model",class:t.className},[n("div",{staticClass:"toogle-box"},[t.isTogHide?t._e():n("a",{staticClass:"tog-close",attrs:{href:"javascript:"},on:{click:t._toggleMenu}}),t._v(" "),t.isTogHide?n("a",{staticClass:"tog-open",attrs:{href:"javascript:"},on:{click:t._toggleMenu}}):t._e()]),t._v(" "),t._l(t.menuList,function(e,s){return n("div",{staticClass:"leven-1"},[e.path?[n("router-link",{attrs:{to:{name:e.path}}},[n("div",{staticClass:"name",on:{click:function(n){return t._toggleSubMenu(e)}}},[n("a",{attrs:{href:"javascript:"}},[n("i",{staticClass:"fa icon",class:e.icon}),t._v(" "),n("span",[t._v(t._s(e.name))]),t._v(" "),e.children.length?n("i",{staticClass:"fa angle",class:e.isOpen?"fa-angle-down":"fa-angle-right"}):t._e()])])])]:t._e(),t._v(" "),e.path?t._e():[n("div",{staticClass:"name",on:{click:function(n){return t._toggleSubMenu(e)}}},[n("a",{attrs:{href:"javascript:"}},[n("i",{staticClass:"fa icon",class:e.icon}),t._v(" "),n("span",[t._v(t._s(e.name))]),t._v(" "),e.children.length?n("i",{staticClass:"fa angle",class:e.isOpen?"fa-angle-down":"fa-angle-right"}):t._e()])])],t._v(" "),e.isOpen&&e.children.length?n("ul",t._l(e.children,function(e,s){return n("router-link",{attrs:{to:{name:e.path},tag:"li","active-class":"active"}},[n("span",[t._v(t._s(e.name))])])}),1):t._e()],2)})],2)},staticRenderFns:[]};e.a=s},661:function(t,e,n){"use strict";e.__esModule=!0,e.formatDate=void 0;var s,i=n(645),a=(s=i)&&s.__esModule?s:{default:s};e.formatDate=function(t,e){return e=e||"YYYY-MM-DD HH:mm:ss",(0,a.default)(t).format(e)}},662:function(t,e,n){"use strict";e.__esModule=!0;var s,i=n(28),a=(s=i)&&s.__esModule?s:{default:s};e.default={name:"conditions",data:function(){return{searchVal:""}},props:{operation:Array},methods:{_ckQuery:function(){this.$emit("on-conditions",{searchVal:a.default.trim(this.searchVal)})}},computed:{isShow:function(){return this.$slots["search-group"]}},components:{}}},663:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(643),i=n.n(s);for(var a in s)"default"!==a&&function(t){n.d(e,t,function(){return s[t]})}(a);var r=n(666);var o=function(t){n(664)},u=n(27)(i.a,r.a,!1,o,null,null);e.default=u.exports},664:function(t,e,n){var s=n(665);"string"==typeof s&&(s=[[t.i,s,""]]),s.locals&&(t.exports=s.locals);n(35)("3cb222d8",s,!0,{})},665:function(t,e,n){(t.exports=n(34)(!1)).push([t.i,".no-data-model{position:relative;width:100%;height:calc(100vh - 200px)}.no-data-model .no-data-box{width:210px;height:210px;position:absolute;left:50%;top:50%;margin-left:-105px;margin-top:-105px;text-align:center}.no-data-model .no-data-box .text{padding-top:10px;color:#666}",""])},666:function(t,e,n){"use strict";var s={render:function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"no-data-model"},[e("div",{staticClass:"no-data-box"},[this._m(0),this._v(" "),e("div",{staticClass:"text"},[this._v(this._s(this.msg||this.$t("查询无数据")))])])])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"img"},[e("img",{attrs:{src:n(667),alt:""}})])}]};e.a=s},667:function(t,e,n){t.exports=n.p+"images/errorTip.png?a7b20f0ca8727f22f405c2a34d1363a0"},668:function(t,e,n){"use strict";var s,i=n(29),a=(s=i)&&s.__esModule?s:{default:s},r=n(661);a.default.filter("formatDate",r.formatDate)},670:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=n(662),i=n.n(s);for(var a in s)"default"!==a&&function(t){n.d(e,t,function(){return s[t]})}(a);var r=n(671),o=n(27)(i.a,r.a,!1,null,null,null);e.default=o.exports},671:function(t,e,n){"use strict";var s={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"conditions-model"},[n("div",{staticClass:"left"},[t._t("button-group")],2),t._v(" "),n("div",{staticClass:"right"},[n("div",{staticClass:"from-box"},[t.isShow?t._t("search-group"):t._e(),t._v(" "),t.isShow?t._e():[n("div",{staticClass:"list"},[n("x-button",{attrs:{type:"ghost",size:"small",icon:"fa fa-search"},on:{click:t._ckQuery}})],1),t._v(" "),n("div",{staticClass:"list"},[n("x-input",{staticStyle:{width:"180px"},attrs:{size:"small",placeholder:t.$t("请输入关键词"),type:"text"},on:{"on-enterkey":t._ckQuery},model:{value:t.searchVal,callback:function(e){t.searchVal=e},expression:"searchVal"}})],1)]],2)])])},staticRenderFns:[]};e.a=s},985:function(t,e,n){"use strict";e.__esModule=!0;var s=r(n(28)),i=r(n(223)),a=r(n(224));function r(t){return t&&t.__esModule?t:{default:t}}e.default={name:"transfer",data:function(){return{sourceList:this.sourceListPrs,targetList:this.targetListPrs,cacheSourceList:this.sourceListPrs,cacheTargetList:this.targetListPrs,searchSourceVal:"",searchTargetVal:""}},props:{sourceListPrs:Array,targetListPrs:Array,type:Object},methods:{_ok:function(){var t=this;this.$refs.popup.spinnerLoading=!0,setTimeout(function(){t.$refs.popup.spinnerLoading=!1,t.$emit("onUpdate",s.default.map(t.targetList,function(t){return t.id}).join(","))},800)},_sourceQuery:function(){var t=this;this.sourceList=this.sourceList.filter(function(e){return e.name.indexOf(t.searchSourceVal)>-1})},_targetQuery:function(){var t=this;this.targetList=this.targetList.filter(function(e){return e.name.indexOf(t.searchTargetVal)>-1})},_ckSource:function(t){this.targetList=this.cacheTargetList,this.targetList.unshift(t),this.searchTargetVal="";var e=s.default.findIndex(this.sourceList,function(e){return t.id===e.id});this.sourceList.splice(e,1);var n=s.default.findIndex(this.cacheSourceList,function(e){return t.id===e.id});-1!==n&&this.cacheSourceList.splice(n,1)},_ckTarget:function(t){this.sourceList=this.cacheSourceList,this.sourceList.unshift(t),this.searchSourceVal="";var e=s.default.findIndex(this.targetList,function(e){return t.id===e.id});this.targetList.splice(e,1);var n=s.default.findIndex(this.cacheTargetList,function(e){return t.id===e.id});-1!==n&&this.cacheTargetList.splice(n,1)}},watch:{searchSourceVal:function(t){t?this._sourceQuery():this.sourceList=s.default.cloneDeep(this.cacheSourceList)},searchTargetVal:function(t){t?this._targetQuery():this.targetList=s.default.cloneDeep(this.cacheTargetList)}},components:{mPopup:i.default,mListBoxF:a.default}}},986:function(t,e,n){"use strict";e.__esModule=!0;var s=c(n(28)),i=c(n(36)),a=c(n(91)),r=c(n(222)),o=c(n(223)),u=c(n(224));function c(t){return t&&t.__esModule?t:{default:t}}e.default={name:"create-user",data:function(){return{store:a.default,router:r.default,userName:"",userPassword:"",tenantId:{},email:"",phone:"",tenantList:[],isADMIN:"ADMIN_USER"===a.default.state.user.userInfo.userType&&"account"!==r.default.history.current.name}},props:{item:Object},methods:{_ok:function(){var t=this;if(this._verification()){if(this.item&&this.item.groupName===this.groupName)return void this._submit();this.store.dispatch("security/verifyName",{type:"user",userName:this.userName}).then(function(e){t._submit()}).catch(function(e){t.$message.error(e.msg||"")})}},_verification:function(){return this.userName?this.userPassword||this.item?this.email?/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/.test(this.email)?!(this.phone&&!/(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/.test(this.phone))||(this.$message.warning(""+i.default.$t("请输入正确的手机格式")),!1):(this.$message.warning(""+i.default.$t("请输入正确的邮箱格式")),!1):(this.$message.warning(""+i.default.$t("请输入邮箱")),!1):(this.$message.warning(""+i.default.$t("请输入密码")),!1):(this.$message.warning(""+i.default.$t("请输入用户名")),!1)},_getTenantList:function(){var t=this;return new Promise(function(e,n){t.store.dispatch("security/getTenantList").then(function(n){t.tenantList=s.default.map(n,function(t){return{id:t.id,code:t.tenantName}}),t.$nextTick(function(){t.tenantId=t.tenantList[0]}),e()})})},_submit:function(){var t=this;this.$refs.popup.spinnerLoading=!0;var e={userName:this.userName,userPassword:this.userPassword,tenantId:this.tenantId.id,email:this.email,phone:this.phone};this.item&&(e.id=this.item.id),this.store.dispatch("security/"+(this.item?"updateUser":"createUser"),e).then(function(n){setTimeout(function(){t.$refs.popup.spinnerLoading=!1},800),t.$emit("onUpdate",e),t.$message.success(n.msg)}).catch(function(e){t.$message.error(e.msg||""),t.$refs.popup.spinnerLoading=!1})}},watch:{},created:function(){var t=this;this.isADMIN?this._getTenantList().then(function(e){t.item&&(t.userName=t.item.userName,t.userPassword="",t.email=t.item.email,t.phone=t.item.phone,t.tenantId=s.default.filter(t.tenantList,function(e){return e.id===t.item.tenantId})[0])}):this.item&&(this.userName=this.item.userName,this.userPassword="",this.email=this.item.email,this.phone=this.item.phone,this.tenantId.id=this.item.tenantId)},mounted:function(){},components:{mPopup:o.default,mListBoxF:u.default}}}}); -//# sourceMappingURL=9.ecd9c2a.js.map \ No newline at end of file diff --git a/escheduler-ui/dist/js/9.ecd9c2a.js.map b/escheduler-ui/dist/js/9.ecd9c2a.js.map deleted file mode 100644 index 6e50b06c35..0000000000 --- a/escheduler-ui/dist/js/9.ecd9c2a.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["webpack:///./src/js/module/components/transfer/transfer.vue","webpack:///./src/js/module/components/transfer/transfer.vue?8a16","webpack:///./src/js/module/components/transfer/transfer.vue?aa69","webpack:///./src/js/module/components/transfer/transfer.vue?0602","webpack:///./src/js/conf/home/pages/security/pages/users/_source/createUser.vue","webpack:///./src/js/conf/home/pages/security/pages/users/_source/createUser.vue?9431","webpack:///src/js/conf/home/pages/security/pages/users/index.vue","webpack:///src/js/conf/home/pages/security/pages/users/_source/list.vue","webpack:///./src/js/conf/home/pages/security/pages/users/_source/list.vue","webpack:///./src/js/conf/home/pages/security/pages/users/_source/list.vue?2233","webpack:///./src/js/conf/home/pages/security/pages/users/_source/list.vue?f284","webpack:///./src/js/conf/home/pages/security/pages/users/_source/list.vue?d686","webpack:///./src/js/conf/home/pages/security/pages/users/index.vue?1142","webpack:///./src/js/conf/home/pages/security/pages/users/index.vue","webpack:///src/js/module/components/spin/spin.vue","webpack:///src/js/module/components/listConstruction/listConstruction.vue","webpack:///src/js/module/components/secondaryMenu/secondaryMenu.vue","webpack:///src/js/module/components/noData/noData.vue","webpack:///./node_modules/dayjs/dayjs.min.js","webpack:///./src/js/module/components/spin/spin.vue","webpack:///./src/js/module/components/spin/spin.vue?542d","webpack:///./src/js/module/components/spin/spin.vue?9371","webpack:///./src/js/module/components/spin/spin.vue?87eb","webpack:///./src/js/module/components/listConstruction/listConstruction.vue","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?b527","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?50be","webpack:///./src/js/module/components/listConstruction/listConstruction.vue?6117","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?c652","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?7693","webpack:///./src/js/module/components/secondaryMenu/close.png","webpack:///./src/js/module/components/secondaryMenu/open.png","webpack:///./src/js/module/components/secondaryMenu/menu.js","webpack:///./src/js/module/components/secondaryMenu/secondaryMenu.vue?048e","webpack:///./src/js/module/filter/filter.js","webpack:///src/js/module/components/conditions/conditions.vue","webpack:///./src/js/module/components/noData/noData.vue","webpack:///./src/js/module/components/noData/noData.vue?93a9","webpack:///./src/js/module/components/noData/noData.vue?86e8","webpack:///./src/js/module/components/noData/noData.vue?5a51","webpack:///./src/js/module/components/noData/images/errorTip.png","webpack:///./src/js/module/filter/formatDate.js","webpack:///./src/js/module/components/conditions/conditions.vue","webpack:///./src/js/module/components/conditions/conditions.vue?8ed7","webpack:///src/js/module/components/transfer/transfer.vue","webpack:///src/js/conf/home/pages/security/pages/users/_source/createUser.vue"],"names":["Object","defineProperty","__webpack_exports__","value","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_transfer_vue__","__webpack_require__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_transfer_vue___default","n","__WEBPACK_IMPORT_KEY__","key","d","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_5d5d2e6e_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_transfer_vue__","__vue_styles__","ssrContext","Component","normalizeComponent","a","content","module","i","locals","exports","push","esExports","render","_vm","this","_h","$createElement","_c","_self","ref","attrs","ok-text","$t","nameText","type","name","on","ok","_ok","slot","staticClass","_v","_s","cacheSourceList","length","_l","item","$index","id","click","$event","_ckSource","href","cacheTargetList","_ckTarget","staticRenderFns","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_createUser_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_createUser_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_6b4c1568_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_createUser_vue__","placeholder","model","callback","$$v","userName","expression","router","history","current","userPassword","_e","tenantId","city","label","code","email","phone","data","pageSize","pageNo","total","searchVal","isLoading","userList","props","methods","assign","_vuex","mapActions","_onConditions","o","_getUsersListP","_page","val","_create","self","modal","$modal","dialog","closable","showMask","escClose","className","transitionName","h","_createUser2","default","onUpdate","remove","close","flag","_this","getUsersListP","then","res","totalList","catch","e","watch","created","mounted","components","mSecondaryMenu","_secondaryMenu2","mList","_list2","mListConstruction","_listConstruction2","mConditions","_conditions2","mSpin","_spin2","mNoData","_noData2","_util","list","Array","Number","_closeDelete","$refs","doClose","_delete","deleteUser","splice","$message","success","msg","error","_edit","findComponentDownward","$root","_authProject","_this2","getAuthList","category","sourceListPrs","_lodash2","map","v","targetListPrs","_transfer2","projectIds","_grantAuthorization","userId","_i18n2","_authFile","_this3","resourceIds","_authDataSource","_this4","datasourceIds","_authUdfFunc","_this5","funcName","udfIds","api","param","_this6","grantAuthorization","_this7","setTimeout","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_list_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_6db4109e_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_list_vue__","width","parseInt","tenantName","_f","createTime","updateTime","refInFor","popper-class","placement","shape","size","data-toggle","title","icon","staticStyle","text-align","margin","padding-top","on-conditions","user-list","page-no","page-size","show-elevator","on-change","is-spin","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_index_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_index_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_5de17812_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_index_vue__","isSpin","Boolean","isLeft","String","menuList","_menu2","index","$route","params","isTogHide","is","layoutBox","$","addClass","removeClass","_toggleSubMenu","isOpen","_toggleMenu","t","r","s","u","f","c","join","z","utcOffset","Math","abs","floor","m","year","month","clone","add","ceil","p","M","y","w","ms","Q","toLowerCase","replace","weekdays","split","months","l","S","g","format","pl","date","D","locale","$L","utc","$u","parse","prototype","$d","Date","NaN","test","match","UTC","init","$y","getFullYear","$M","getMonth","$D","getDate","$W","getDay","$H","getHours","$m","getMinutes","$s","getSeconds","$ms","getMilliseconds","$utils","isValid","toString","isSame","startOf","endOf","isAfter","isBefore","$g","set","day","hour","minute","second","millisecond","unix","valueOf","getTime","toDate","apply","slice","$locale","weekStart","$set","min","daysInMonth","get","setDate","subtract","substr","YY","YYYY","MM","MMM","monthsShort","MMMM","DD","dd","weekdaysMin","ddd","weekdaysShort","dddd","H","HH","hh","A","mm","ss","SSS","Z","round","getTimezoneOffset","diff","toJSON","toISOString","toUTCString","extend","isDayjs","en","Ls","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_spin_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_16cfa774_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_spin_vue__","class","background","height","xmlns","xmlns:xlink","viewBox","preserveAspectRatio","transform","attributeName","values","keyTimes","dur","begin","repeatCount","fill","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_listConstruction_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_listConstruction_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_eae3645c_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_listConstruction_vue__","_t","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_secondaryMenu_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_secondaryMenu_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_f72bdd3a_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_secondaryMenu_vue__","escape","_i18n","menu","projects","i18n","path","children","security","resource","disabled","user","to","el","tag","active-class","_dayjs","formatDate","fmt","_dayjs2","operation","_ckQuery","$emit","trim","computed","isShow","$slots","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noData_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_noData_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_2d3808af_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_noData_vue__","_m","src","alt","_vue","_filter","Vue","filter","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_conditions_vue__","__WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_conditions_vue___default","__WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_a4fced1a_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_conditions_vue__","on-enterkey","sourceList","targetList","searchSourceVal","searchTargetVal","spinnerLoading","_sourceQuery","indexOf","_targetQuery","unshift","i1","findIndex","i2","cloneDeep","mPopup","_popup2","mListBoxF","_listBoxF2","store","_store2","_router2","tenantList","isADMIN","state","userInfo","userType","_verification","groupName","_submit","dispatch","warning","_getTenantList","Promise","resolve","reject","$nextTick"],"mappings":"oDAAAA,OAAAC,eAAAC,EAAA,cAAAC,OAAA,QAAAC,EAAAC,EAAA,KAAAC,EAAAD,EAAAE,EAAAH,GAAA,QAAAI,KAAAJ,EAAA,YAAAI,GAAA,SAAAC,GAAAJ,EAAAK,EAAAR,EAAAO,EAAA,kBAAAL,EAAAK,KAAA,CAAAD,GAAA,IAAAG,EAAAN,EAAA,MAGA,IASAO,EAZA,SAAAC,GACER,EAAQ,OAgBVS,EAdyBT,EAAQ,GAcjCU,CACET,EAAAU,EACAL,EAAA,GATF,EAWAC,EAPA,KAEA,MAUeV,EAAA,QAAAY,EAAiB,8BCvBhC,IAAAG,EAAcZ,EAAQ,MACtB,iBAAAY,QAA4CC,EAAAC,EAASF,EAAA,MACrDA,EAAAG,SAAAF,EAAAG,QAAAJ,EAAAG,QAEaf,EAAQ,GAARA,CAAsG,WAAAY,GAAA,6BCPnHC,EAAAG,QAA2BhB,EAAQ,GAARA,EAAgE,IAK3FiB,MAAcJ,EAAAC,EAAS,wiCAAwiC,wCCL/jC,IAEAI,GAAiBC,OAFjB,WAA0B,IAAAC,EAAAC,KAAaC,EAAAF,EAAAG,eAA0BC,EAAAJ,EAAAK,MAAAD,IAAAF,EAAwB,O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function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-5d5d2e6e\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./transfer.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./transfer.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./transfer.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-5d5d2e6e\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./transfer.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/transfer/transfer.vue\n// module id = 1006\n// module chunks = 9 10","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/security/pages/users/_source/list.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-6db4109e\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./list.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./list.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./list.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-6db4109e\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./list.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/pages/security/pages/users/_source/list.vue\n// module id = 1202\n// module chunks = 9","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/spin/spin.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listConstruction/listConstruction.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/secondaryMenu/secondaryMenu.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/noData/noData.vue","!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):t.dayjs=n()}(this,function(){\"use strict\";var t=\"millisecond\",n=\"second\",e=\"minute\",i=\"hour\",r=\"day\",s=\"week\",u=\"month\",a=\"quarter\",o=\"year\",h=/^(\\d{4})-?(\\d{1,2})-?(\\d{0,2})[^0-9]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?.?(\\d{1,3})?$/,f=/\\[([^\\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,c=function(t,n,e){var i=String(t);return!i||i.length>=n?t:\"\"+Array(n+1-i.length).join(e)+t},d={s:c,z:function(t){var n=-t.utcOffset(),e=Math.abs(n),i=Math.floor(e/60),r=e%60;return(n<=0?\"+\":\"-\")+c(i,2,\"0\")+\":\"+c(r,2,\"0\")},m:function(t,n){var e=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(e,u),r=n-i<0,s=t.clone().add(e+(r?-1:1),u);return Number(-(e+(n-i)/(r?i-s:s-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return{M:u,y:o,w:s,d:r,h:i,m:e,s:n,ms:t,Q:a}[h]||String(h||\"\").toLowerCase().replace(/s$/,\"\")},u:function(t){return void 0===t}},$={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\")},l=\"en\",m={};m[l]=$;var y=function(t){return t instanceof S},M=function(t,n,e){var i;if(!t)return null;if(\"string\"==typeof t)m[t]&&(i=t),n&&(m[t]=n,i=t);else{var r=t.name;m[r]=t,i=r}return e||(l=i),i},g=function(t,n,e){if(y(t))return t.clone();var i=n?\"string\"==typeof n?{format:n,pl:e}:n:{};return i.date=t,new S(i)},D=d;D.l=M,D.i=y,D.w=function(t,n){return g(t,{locale:n.$L,utc:n.$u})};var S=function(){function c(t){this.$L=this.$L||M(t.locale,null,!0)||l,this.parse(t)}var d=c.prototype;return d.parse=function(t){this.$d=function(t){var n=t.date,e=t.utc;if(null===n)return new Date(NaN);if(D.u(n))return new Date;if(n instanceof Date)return new Date(n);if(\"string\"==typeof n&&!/Z$/i.test(n)){var i=n.match(h);if(i)return e?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(n)}(t),this.init()},d.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},d.$utils=function(){return D},d.isValid=function(){return!(\"Invalid Date\"===this.$d.toString())},d.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},d.isAfter=function(t,n){return g(t) tag\n\n// load the styles\nvar content = require(\"!!../../../../../node_modules/css-loader/index.js?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index.js?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-16cfa774\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!../../../../../node_modules/sass-loader/lib/loader.js!../../../../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./spin.vue\");\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar update = require(\"!../../../../../node_modules/vue-loader/node_modules/vue-style-loader/lib/addStylesClient.js\")(\"3d76622a\", content, true, {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 647\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","exports = module.exports = require(\"../../../../../node_modules/css-loader/lib/css-base.js\")(false);\n// imports\n\n\n// module\nexports.push([module.id, \"#spin-model{position:fixed;left:20px;top:80px;background:#fff;z-index:99;border-radius:3px}#spin-model .svg-box{width:100px;height:66px;position:absolute;left:50%;top:50%;margin-left:-50px;margin-top:-33px;text-align:center}#spin-model .svg-box .sp1{display:block;font-size:12px;color:#999;padding-top:4px}#spin-model.spin-sp1{width:calc(100% - 40px);height:calc(100% - 100px)}#spin-model.spin-sp2{width:calc(100% - 240px);height:calc(100% - 100px);left:220px}\", \"\"]);\n\n// exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{\"vue\":true,\"id\":\"data-v-16cfa774\",\"scoped\":false,\"hasInlineConfig\":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/js/module/components/spin/spin.vue\n// module id = 648\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isSpin)?_c('div',{class:_vm.isLeft ? 'spin-sp2' : 'spin-sp1',attrs:{\"id\":\"spin-model\"}},[_c('div',{staticClass:\"svg-box\"},[_c('svg',{staticClass:\"lds-gears\",staticStyle:{\"background\":\"none\"},attrs:{\"width\":\"54px\",\"height\":\"54px\",\"xmlns\":\"http://www.w3.org/2000/svg\",\"xmlns:xlink\":\"http://www.w3.org/1999/xlink\",\"viewBox\":\"0 0 100 100\",\"preserveAspectRatio\":\"xMidYMid\"}},[_c('g',{attrs:{\"transform\":\"translate(50 50)\"}},[_c('g',{attrs:{\"transform\":\"translate(-19 -19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(107.866)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"0;360\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"0s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#0097e0\"}})],1)]),_vm._v(\" \"),_c('g',{attrs:{\"transform\":\"translate(19 19) scale(0.6)\"}},[_c('g',{attrs:{\"transform\":\"rotate(229.634)\"}},[_c('animateTransform',{attrs:{\"attributeName\":\"transform\",\"type\":\"rotate\",\"values\":\"360;0\",\"keyTimes\":\"0;1\",\"dur\":\"1s\",\"begin\":\"-0.0625s\",\"repeatCount\":\"indefinite\"}}),_c('path',{attrs:{\"d\":\"M37.3496987939662 -7 L47.3496987939662 -7 L47.3496987939662 7 L37.3496987939662 7 A38 38 0 0 1 31.359972760794346 21.46047782418268 L31.359972760794346 21.46047782418268 L38.431040572659825 28.531545636048154 L28.531545636048154 38.431040572659825 L21.46047782418268 31.359972760794346 A38 38 0 0 1 7.0000000000000036 37.3496987939662 L7.0000000000000036 37.3496987939662 L7.000000000000004 47.3496987939662 L-6.999999999999999 47.3496987939662 L-7 37.3496987939662 A38 38 0 0 1 -21.46047782418268 31.35997276079435 L-21.46047782418268 31.35997276079435 L-28.531545636048154 38.431040572659825 L-38.43104057265982 28.531545636048158 L-31.359972760794346 21.460477824182682 A38 38 0 0 1 -37.3496987939662 7.000000000000007 L-37.3496987939662 7.000000000000007 L-47.3496987939662 7.000000000000008 L-47.3496987939662 -6.9999999999999964 L-37.3496987939662 -6.999999999999997 A38 38 0 0 1 -31.35997276079435 -21.460477824182675 L-31.35997276079435 -21.460477824182675 L-38.431040572659825 -28.531545636048147 L-28.53154563604818 -38.4310405726598 L-21.4604778241827 -31.35997276079433 A38 38 0 0 1 -6.999999999999992 -37.3496987939662 L-6.999999999999992 -37.3496987939662 L-6.999999999999994 -47.3496987939662 L6.999999999999977 -47.3496987939662 L6.999999999999979 -37.3496987939662 A38 38 0 0 1 21.460477824182686 -31.359972760794342 L21.460477824182686 -31.359972760794342 L28.531545636048158 -38.43104057265982 L38.4310405726598 -28.53154563604818 L31.35997276079433 -21.4604778241827 A38 38 0 0 1 37.3496987939662 -6.999999999999995 M0 -23A23 23 0 1 0 0 23 A23 23 0 1 0 0 -23\",\"fill\":\"#7f8b95\"}})],1)])])]),_vm._v(\" \"),_c('span',{staticClass:\"sp1\"},[_vm._v(_vm._s(_vm.$t('正在努力加载中...')))])])]):_vm._e()}\nvar staticRenderFns = []\nvar esExports = { render: render, staticRenderFns: staticRenderFns }\nexport default esExports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/vue-loader/lib/template-compiler?{\"id\":\"data-v-16cfa774\",\"hasScoped\":false,\"buble\":{\"transforms\":{}}}!./node_modules/vue-loader/lib/selector.js?type=template&index=0!./src/js/module/components/spin/spin.vue\n// module id = 649\n// module chunks = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listConstruction.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listConstruction.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-eae3645c\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listConstruction.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listConstruction/listConstruction.vue\n// module id = 650\n// module chunks = 0 1 2 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/transfer/transfer.vue","\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/pages/security/pages/users/_source/createUser.vue"],"sourceRoot":""} \ No newline at end of file diff --git a/escheduler-ui/dist/js/common.3789e85.js b/escheduler-ui/dist/js/common.804ec41.js similarity index 99% rename from escheduler-ui/dist/js/common.3789e85.js rename to escheduler-ui/dist/js/common.804ec41.js index e67ad7441a..e87abb74b6 100644 --- a/escheduler-ui/dist/js/common.3789e85.js +++ b/escheduler-ui/dist/js/common.804ec41.js @@ -1,4 +1,4 @@ -!function(e){var t=window.webpackJsonp;window.webpackJsonp=function(n,o,a){for(var s,l,u,c=0,d=[];c1?t-1:0),i=1;i=0&&i.test(e.charAt(r));)--r;return e.substring(n,r+1)},o=function(e,t,n){if(n=n||{},void 0!==t){if(n=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}(n),null===t&&(t="",n.expires=-1),"number"==typeof n.expires){var o=n.expires,a=n.expires=new Date;a.setTime(a.getTime()+864e5*o)}var s=function(e){try{return n.raw?e:encodeURIComponent(e)}catch(e){}return e};return r.cookie=[s(e),"=",s(t),n.expires?"; expires="+n.expires.toUTCString():"",n.path?"; path="+n.path:"",n.domain?"; domain="+n.domain:"",n.secure?"; secure":""].join("")}for(var l=null,u=r.cookie,c=u?u.split("; "):[],d=-1,f=c.length,h=e.length+1;++d=o)return e;switch(e){case"%s":return String(t[r++]);case"%d":return Number(t[r++]);case"%j":try{return JSON.stringify(t[r++])}catch(e){return"[Circular]"}break;default:return e}}),l=t[r];r=t?e:""+Array(t+1-r.length).join(n)+e},f={padStart:d,padZoneStr:function(e){var t=Math.abs(e),n=Math.floor(t/60),r=t%60;return(e<=0?"+":"-")+d(n,2,"0")+":"+d(r,2,"0")},monthDiff:function(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),r=e.clone().add(n,"months"),i=t-r<0,o=e.clone().add(n+(i?-1:1),"months");return Number(-(n+(t-r)/(i?r-o:o-r)))},absFloor:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},prettyUnit:function(l){return{M:a,y:s,w:o,d:i,h:r,m:n,s:t,ms:e}[l]||String(l||"").toLowerCase().replace(/s$/,"")},isUndefined:function(e){return void 0===e}},h="en",p={};p[h]=c;var m=function(e){return e instanceof x},v=function(e,t,n){var r;if(!e)return null;if("string"==typeof e)p[e]&&(r=e),t&&(p[e]=t,r=e);else{var i=e.name;p[i]=e,r=i}return n||(h=r),r},g=function(e,t){if(m(e))return e.clone();var n=t||{};return n.date=e,new x(n)},b=function(e,t){return g(e,{locale:t.$L})},y=f;y.parseLocale=v,y.isDayjs=m,y.wrapper=b;var x=function(){function c(e){this.parse(e)}var d=c.prototype;return d.parse=function(e){var t,n;this.$d=null===(t=e.date)?new Date(NaN):y.isUndefined(t)?new Date:t instanceof Date?t:"string"==typeof t&&/.*[^Z]$/i.test(t)&&(n=t.match(l))?new Date(n[1],n[2]-1,n[3]||1,n[5]||0,n[6]||0,n[7]||0,n[8]||0):new Date(t),this.init(e)},d.init=function(e){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds(),this.$L=this.$L||v(e.locale,null,!0)||h},d.$utils=function(){return y},d.isValid=function(){return!("Invalid Date"===this.$d.toString())},d.isSame=function(e,t){var n=g(e);return this.startOf(t)<=n&&n<=this.endOf(t)},d.isAfter=function(e,t){return g(e)-1?e.replace(/\[|\]/g,""):{YY:String(t.$y).slice(-2),YYYY:String(t.$y),M:String(t.$M+1),MM:y.padStart(t.$M+1,2,"0"),MMM:s(i.monthsShort,t.$M,a,3),MMMM:a[t.$M],D:String(t.$D),DD:y.padStart(t.$D,2,"0"),d:String(t.$W),dd:s(i.weekdaysMin,t.$W,o,2),ddd:s(i.weekdaysShort,t.$W,o,3),dddd:o[t.$W],H:String(t.$H),HH:y.padStart(t.$H,2,"0"),h:l(e),hh:l(e),a:t.$H<12?"am":"pm",A:t.$H<12?"AM":"PM",m:String(t.$m),mm:y.padStart(t.$m,2,"0"),s:String(t.$s),ss:y.padStart(t.$s,2,"0"),SSS:y.padStart(t.$ms,3,"0"),Z:r}[e]||r.replace(":","")})},d.diff=function(e,l,u){var c,d=y.prettyUnit(l),f=g(e),h=this-f,p=y.monthDiff(this,f);return p=(c={},c[s]=p/12,c[a]=p,c.quarter=p/3,c[o]=h/6048e5,c[i]=h/864e5,c[r]=h/36e5,c[n]=h/6e4,c[t]=h/1e3,c)[d]||h,u?p:y.absFloor(p)},d.daysInMonth=function(){return this.endOf(a).$D},d.$locale=function(){return p[this.$L]},d.locale=function(e,t){var n=this.clone();return n.$L=v(e,t,!0),n},d.clone=function(){return b(this.toDate(),this)},d.toDate=function(){return new Date(this.$d)},d.toArray=function(){return[this.$y,this.$M,this.$D,this.$H,this.$m,this.$s,this.$ms]},d.toJSON=function(){return this.toISOString()},d.toISOString=function(){return this.$d.toISOString()},d.toObject=function(){return{years:this.$y,months:this.$M,date:this.$D,hours:this.$H,minutes:this.$m,seconds:this.$s,milliseconds:this.$ms}},d.toString=function(){return this.$d.toUTCString()},c}();return g.extend=function(e,t){return e(t,x,g),g},g.locale=v,g.isDayjs=m,g.unix=function(e){return g(1e3*e)},g.en=p[h],g},e.exports=r()},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t,n){t.__esModule=!0;var r,i=(r=n(6))&&r.__esModule?r:{default:r};t.default=function(e){return(0,i.default)(e).isValid()}},function(e,t,n){var r=n(11),i=n(23);e.exports=n(12)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(22),i=n(143),o=n(36),a=Object.defineProperty;t.f=n(12)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){e.exports=!n(19)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(146),i=n(37);e.exports=function(e){return r(i(e))}},function(e,t,n){var r=n(40)("wks"),i=n(26),o=n(7).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t,n){t.__esModule=!0,t.LIB_NAME="ans",t.ANIMATION_PREFIX="x-ani-"},function(e,t,n){t.__esModule=!0,t.xInput=void 0;var r,i=(r=n(219))&&r.__esModule?r:{default:r};t.xInput=i.default},function(e,t){var n=e.exports={version:"2.6.0"};"number"==typeof __e&&(__e=n)},function(e,t){e.exports=function(e){return"object"==(void 0===e?"undefined":s(e))?null!==e:"function"==typeof e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){t.__esModule=!0,t.xPoptip=void 0;var r=o(n(261)),i=o(n(264));function o(e){return e&&e.__esModule?e:{default:e}}r.default.directive=i.default,r.default.install=function(e){e.directive("poptip",i.default)},t.xPoptip=r.default},function(e,t,n){t.__esModule=!0,t.default=function(e){return/[HhmsS]/.test(e)?"second":/[Hhm]/.test(e)?"minute":!!/[Hh]/.test(e)&&"hour"}},function(e,t,n){var r=n(18);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(145),i=n(41);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t){e.exports=!0},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){t.__esModule=!0;var r=a(n(331)),i=a(n(343)),o="function"==typeof i.default&&"symbol"==s(r.default)?function(e){return void 0===e?"undefined":s(e)}:function(e){return e&&"function"==typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":void 0===e?"undefined":s(e)};function a(e){return e&&e.__esModule?e:{default:e}}t.default="function"==typeof i.default&&"symbol"===o(r.default)?function(e){return void 0===e?"undefined":o(e)}:function(e){return e&&"function"==typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":void 0===e?"undefined":o(e)}},function(e,t,n){t.__esModule=!0;var r=o(n(5)),i=o(n(183));function o(e){return e&&e.__esModule?e:{default:e}}i.default.newInstance=function(e){var t=e||{},n=new r.default({data:t,render:function(e){return e(i.default,{props:t})}}),o=n.$mount();document.body.appendChild(o.$el);var a=n.$children[0];return{notice:function(e){a.add(e)},remove:function(e){a.close(e)},component:a,destroy:function(e){a.closeAll(),setTimeout(function(){document.body.removeChild(document.getElementsByClassName(e)[0])},500)}}},t.default=i.default},function(e,t,n){t.__esModule=!0,t.xButtonGroup=t.xButton=void 0;var r=o(n(53)),i=o(n(192));function o(e){return e&&e.__esModule?e:{default:e}}t.xButton=r.default,t.xButtonGroup=i.default},function(e,t,n){t.__esModule=!0,t.xCheckboxGroup=t.xCheckbox=void 0;var r=o(n(203)),i=o(n(206));function o(e){return e&&e.__esModule?e:{default:e}}t.xCheckbox=r.default,t.xCheckboxGroup=i.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(210),i=n(66);for(var o in i)"default"!==o&&function(e){n.d(t,e,function(){return i[e]})}(o);var a=n(1),s=Object(a.a)(i.default,r.a,r.b,!1,null,null,null);s.options.__file="Spin.vue",t.default=s.exports},function(e,t,n){t.__esModule=!0,t.default=function(e){return Object.prototype.toString.call(e).match(/\[object (.*?)\]/)[1].toLowerCase()}},function(e,t,n){t.__esModule=!0,t.default={name:"CellRenderer",functional:!0,props:{expand:{type:Boolean,default:!1},header:{type:Boolean,default:!1},render:Function,row:Object,column:Object,content:[String,Number,Object],rIndex:Number,cIndex:Number},render:function(e,t){var n;return n=t.props.expand?{row:t.props.row,$index:t.props.rIndex}:t.props.header?{column:t.props.column,$index:t.props.cIndex}:{row:t.props.row,column:t.props.column,content:t.props.content,$rowIndex:t.props.rIndex,$columnIndex:t.props.cIndex},t.props.render(e,n)}}},function(e,t,n){var r=n(7),i=n(17),o=n(325),a=n(10),s=n(8),l=function e(t,n,l){var u,c,d,f=t&e.F,h=t&e.G,p=t&e.S,m=t&e.P,v=t&e.B,g=t&e.W,b=h?i:i[n]||(i[n]={}),y=b.prototype,x=h?r:p?r[n]:(r[n]||{}).prototype;for(u in h&&(l=n),l)(c=!f&&x&&void 0!==x[u])&&s(b,u)||(d=c?x[u]:l[u],b[u]=h&&"function"!=typeof x[u]?l[u]:v&&c?o(d,r):g&&x[u]==d?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(d):m&&"function"==typeof d?o(Function.call,d):d,m&&((b.virtual||(b.virtual={}))[u]=d,t&e.R&&y&&!y[u]&&a(y,u,d)))};l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,l.U=64,l.R=128,e.exports=l},function(e,t,n){var r=n(18);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(40)("keys"),i=n(26);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t,n){var r=n(17),i=n(7),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:r.version,mode:n(25)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t){e.exports={}},function(e,t,n){var r=n(11).f,i=n(8),o=n(14)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){t.f=n(14)},function(e,t,n){var r=n(7),i=n(17),o=n(25),a=n(45),s=n(11).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t,n){t.__esModule=!0,t.xNotice=t.xModal=t.xMessage=void 0;var r=a(n(155)),i=a(n(189)),o=a(n(195));function a(e){return e&&e.__esModule?e:{default:e}}t.xMessage=r.default,t.xModal=i.default,t.xNotice=o.default},function(e,t,n){t.__esModule=!0,t.on=function(e,t,n){e&&t&&n&&e.addEventListener(t,n,!1)},t.off=function(e,t,n){e&&t&&n&&e.removeEventListener(t,n,!1)}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(50),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r,i=n(0),o=(r=n(186))&&r.__esModule?r:{default:r},a=i.LIB_NAME+"-layer",s=0,l=Date.now();t.default={name:"xBoxManager",components:{Box:o.default},props:{prefixCls:{type:String,default:a},styles:{type:Object,default:function(){return{top:"65px",left:"50%"}}},className:{type:String}},data:function(){return{boxs:[]}},computed:{classes:function(){var e;return[""+this.prefixCls,this.prefixCls+"-wrapper",(e={},e[""+this.className]=!!this.className,e)]}},methods:{onrender:function(){},add:function(e){var t=e.name||i.LIB_NAME+"-Box_"+l+"_"+s++,n=Object.assign({styles:{right:"50%"},content:"",duration:1.5,closable:!1,name:t},e);n.$onRender=n.$onRender?n.$onRender:function(){},this.boxs.push(n)},close:function(e){for(var t=this.boxs,n=0;n0;e--){var t=this.buttons[e];if(t.visible)return t}return null}},methods:{initComponents:function(){var e=this;this.buttons=this.$children.filter(function(e){return"xButton"===e.$options.name}),this.buttons.sort(function(e,t){return Array.prototype.indexOf.call(e.$el.parentNode.children,e.$el)-Array.prototype.indexOf.call(t.$el.parentNode.children,t.$el)}),this.handleButtonVisible(),this.buttons.forEach(function(t){t._$bind||(t._$bind=!0,t.$on("click",e.handleChange.bind(e,t))),t.checked=void 0!==t.value&&""!==t.value&&t.value===e.value}),this.$nextTick(function(){e.updateModel()})},updateModel:function(){var e=this.activeClass;this.buttons.forEach(function(t){var n=(0,i.hasClass)(t.$el,e);t.checked?n||(0,i.addClass)(t.$el,e):n&&(0,i.removeClass)(t.$el,e)})},handleChange:function(e){var t=this;if(!(1===this.buttons.length&&this.buttons[0].checked||e.checked)){var n=this.buttons.find(function(t){return t.checked&&t!==e});n&&(n.checked=!1),e.checked=!0,this.checkedList=this.buttons.filter(function(e){return e.checked}).map(function(e){return e.value}),this.$emit("input",this.checkedList[0],function(){return t.updateModel()}),this.updateModel()}},handleButtonVisible:function(){this.buttons.length&&this.broadcast("xButton","checkPosition",{first:this.firstVisibleChild,last:this.lastVisibleChild})}},created:function(){this.checkedList=[this.value],this.$on("buttonVisibleChanged",this.handleButtonVisible)},mounted:function(){this.initComponents()},updated:function(){this.initComponents()}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(59),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r=n(0),i=r.LIB_NAME+"-radio";t.default={name:"xRadio",mixins:[r.emitter],props:{value:{type:[String,Number,Boolean],default:!1},trueValue:{type:[String,Number,Boolean],default:!0},falseValue:{type:[String,Number,Boolean],default:!1},label:{type:[String,Number]},disabled:{type:Boolean,default:!1},name:{type:String},size:{type:String,validator:function(e){return["small","default","large"].includes(e)}}},data:function(){return{currentValue:this.value,group:!1,parent:(0,r.findComponentUpward)(this,"xRadioGroup")}},computed:{sizeType:function(){return this.size?this.size:this.parent&&this.parent.size?this.parent.size:"default"},myName:function(){return this.name?this.name:this.parent&&this.parent.name?this.parent.name:""},wrapClasses:function(){var e;return[i+"-wrapper",(e={},e[i+"-wrapper__"+this.sizeType]=!!this.sizeType,e[i+"-group-item"]=this.group,e[i+"-wrapper-checked"]=this.currentValue,e[i+"-wrapper-disabled"]=this.disabled,e)]},radioClasses:function(){var e;return[""+i,(e={},e[i+"-checked"]=this.currentValue,e[i+"-disabled"]=this.disabled,e)]},innerClasses:function(){return i+"-inner"},inputClasses:function(){return i+"-input"}},mounted:function(){this.parent&&(this.group=!0),this.group?this.parent.updateValue():this.updateValue()},methods:{change:function(e){if(this.disabled)return!1;var t=e.target.checked;this.currentValue=t;var n=t?this.trueValue:this.falseValue;this.$emit("input",n),this.group&&void 0!==this.label&&this.parent.change({value:this.label,checked:this.value}),this.group||(this.$emit("on-change",n),this.dispatch("xFormItem","on-form-change",n))},updateValue:function(){this.currentValue=this.value===this.trueValue}},watch:{value:function(e){if(e!==this.trueValue&&e!==this.falseValue)throw new Error("Value should be true-value or false-value.");this.updateValue()}}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(61),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r=n(0),i=r.LIB_NAME+"-radio-group";t.default={name:"xRadioGroup",mixins:[r.emitter],props:{value:{type:[String,Number],default:""},size:{validator:function(e){return["small","default","large"].includes(e)}},name:String,vertical:Boolean},data:function(){return{currentValue:this.value,childrens:[]}},computed:{classes:function(){var e;return[""+i,(e={},e[i+"-"+this.size]=!!this.size,e[i+"-vertical"]=this.vertical,e)]}},mounted:function(){this.updateValue()},methods:{updateValue:function(){var e=this.value;this.childrens=(0,r.findComponentsDownward)(this,"xRadio"),this.childrens&&this.childrens.forEach(function(t){t.currentValue=e===t.label,t.group=!0})},change:function(e){this.currentValue=e.value,this.updateValue(),this.$emit("input",e.value),this.$emit("on-change",e.value),this.dispatch("xFormItem","on-form-change",e.value)}},watch:{value:function(){this.updateValue()}}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(63),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r=n(0),i=n(15).LIB_NAME+"-checkbox";t.default={name:"xCheckbox",mixins:[r.emitter],data:function(){return{prefixCls:i,currentValue:this.value===this.trueValue,group:!1,model:[],showSlot:!0}},props:{label:{type:[String,Number,Boolean],default:""},value:[String,Number,Boolean],disabled:{type:Boolean,default:!1},trueValue:{type:[Boolean,String,Number],default:!0},falseValue:{type:[Boolean,String,Number],default:!1}},computed:{className:function(){var e;return[(e={},e[i+"-wrapper"]=!0,e[i+"-wrapper-checked"]=!!this.currentValue,e[i+"-wrapper-disabled"]=!!this.disabled,e)]},checkedClass:function(){var e;return[(e={},e[""+i]=!0,e[i+"-checked"]=!!this.currentValue,e)]}},mounted:function(){this.parent=(0,r.findComponentUpward)(this,"xCheckboxGroup"),this.parent&&(this.group=!0),this.group?this.parent.updateModel(!0):this.updateModel(),this.showSlot=void 0!==this.$slots.default},methods:{change:function(e){if(!this.disabled){var t=e.target.checked;this.currentValue=t;var n=t?this.trueValue:this.falseValue;this.$emit("input",n),this.group?this.$parent.change(this.model):(this.$emit("on-change",n),this.dispatch("xFormItem","on-form-change",n))}},updateModel:function(){this.currentValue=this.value===this.trueValue}},watch:{value:function(){this.updateModel()}}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(65),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r=n(0),i=n(15).LIB_NAME+"-checkbox-group";t.default={name:"xCheckboxGroup",mixins:[r.emitter],props:{value:{type:Array,default:function(){return[]}}},data:function(){return{currentValue:this.value,childrens:[]}},computed:{classes:function(){return""+i}},mounted:function(){this.updateModel(!0)},methods:{updateModel:function(e){var t=this.value;this.childrens=(0,r.findComponentsDownward)(this,"xCheckbox"),this.childrens&&this.childrens.forEach(function(n){n.model=t,e&&(n.currentValue=t.indexOf(n.label)>=0,n.group=!0)})},change:function(e){this.currentValue=e,this.$emit("input",e),this.$emit("on-change",e),this.dispatch("xFormItem","on-form-change",e)}},watch:{value:function(){this.updateModel(!0)}}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(67),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r=n(0);t.default={name:"xSpin",data:function(){return{wrapperClass:r.LIB_NAME+"-spin",transitionName:r.ANIMATION_PREFIX+"fade",visible:!1,fullscreen:!0,text:null,background:null,iconClass:"",customClass:"",onAfterLeave:function(){}}},methods:{handleAfterLeave:function(){this.onAfterLeave(),this.$emit("after-leave")},setText:function(e){this.text=e}}}},function(e,t,n){t.__esModule=!0;var r=n(0),i=s(n(5)),o=s(n(32)),a=n(69);function s(e){return e&&e.__esModule?e:{default:e}}var l=i.default.extend(o.default);function u(e,t){if(t.value){if(t.modifiers.fullscreen)e.originalPosition=(0,r.getStyle)(document.body,"position"),c(document.body,e,t);else if(t.modifiers.body){e.originalPosition=(0,r.getStyle)(document.body,"position");var n=e.spin.$el.style;["top","left"].forEach(function(t){var i="top"===t?"scrollTop":"scrollLeft";n[t]=e.getBoundingClientRect()[t]+document.body[i]+document.documentElement[i]-parseInt((0,r.getStyle)(document.body,"margin-"+t),10)+"px"}),["height","width"].forEach(function(t){n[t]=e.getBoundingClientRect()[t]+"px"}),c(document.body,e,t)}else e.originalPosition=(0,r.getStyle)(e,"position"),c(e,e,t);e.spin.visible=!0}else e.spin.visible=!1}function c(e,t,n){t.domVisible||"none"===(0,r.getStyle)(t,"display")||"hidden"===(0,r.getStyle)(t,"visibility")||("absolute"!==t.originalPosition&&"fixed"!==t.originalPosition&&(0,r.addClass)(e,"spin-relative-parent"),n.modifiers.fullscreen&&n.modifiers.lock&&(0,r.addClass)(e,"spin-lock-overflow"),t.domVisible=!0,e.appendChild(t.spin.$el),t.domAppended=!0)}t.default={bind:function(e,t){var n=e.getAttribute("spin-text")||a.defaults.text,i=e.getAttribute("spin-background")||a.defaults.background,o=e.getAttribute("spin-icon-class")||a.defaults.iconClass,s=e.getAttribute("spin-custom-class")||a.defaults.customClass,c=new l({el:document.createElement("div"),data:{text:n,background:i,iconClass:o,customClass:s,fullscreen:!!t.modifiers.fullscreen,onAfterLeave:function(){e.domVisible=!1;var n=t.modifiers.fullscreen||t.modifiers.body?document.body:e;(0,r.removeClass)(n,"spin-relative-parent"),(0,r.removeClass)(n,"spin-lock-overflow")}}});e.spin=c,t.value&&u(e,t)},update:function(e,t){var n=e.getAttribute("spin-text");null===n&&(n=a.defaults.text),e.spin.setText(n),t.oldValue!==t.value&&u(e,t)},unbind:function(e,t){e.domAppended&&(e.spin&&e.spin.$el.parentNode&&e.spin.$el.parentNode.removeChild(e.spin.$el),u(e,{value:!1,modifiers:t.modifiers}))}}},function(e,t,n){t.__esModule=!0,t.defaults=t.init=void 0;var r=n(0),i=a(n(5)),o=a(n(32));function a(e){return e&&e.__esModule?e:{default:e}}var s=i.default.extend(o.default),l={body:!1,fullscreen:!0,lock:!1,text:null,background:null,iconClass:"",customClass:""},u=void 0;s.prototype.originalPosition="",s.prototype.close=function(){this.fullscreen&&(u=void 0),this.visible=!1},t.init=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof(e=Object.assign({},l,e)).target&&(e.target=document.querySelector(e.target)),e.target=e.target||document.body,e.target!==document.body?e.fullscreen=!1:e.body=!0,e.fullscreen&&u)return u;var t=e.body?document.body:e.target,n=new s({el:document.createElement("div"),data:e});return e.onAfterLeave=function(){(0,r.removeClass)(t,"spin-relative-parent"),(0,r.removeClass)(t,"spin-lock-overflow"),t.removeChild(n.$el),n.$destroy()},function(e,t,n){if(e.fullscreen)n.originalPosition=(0,r.getStyle)(document.body,"position");else if(e.body){n.originalPosition=(0,r.getStyle)(document.body,"position");var i=n.$el.style;["top","left"].forEach(function(t){var n="top"===t?"scrollTop":"scrollLeft";i[t]=e.target.getBoundingClientRect()[t]+document.body[n]+document.documentElement[n]-parseInt((0,r.getStyle)(document.body,"margin-"+t),10)+"px"}),["height","width"].forEach(function(t){i[t]=e.target.getBoundingClientRect()[t]+"px"})}else n.originalPosition=(0,r.getStyle)(t,"position")}(e,t,n),"absolute"!==n.originalPosition&&"fixed"!==n.originalPosition&&(0,r.addClass)(t,"spin-relative-parent"),e.fullscreen&&e.lock&&(0,r.addClass)(t,"spin-lock-overflow"),t.appendChild(n.$el),i.default.nextTick(function(){n.visible=!0}),e.fullscreen&&(u=n),n},t.defaults=l},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(71),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r=n(0),i=n(72),o=r.LIB_NAME+"-page";t.default={name:"xPage",components:{xSelect:i.xSelect,xOption:i.xOption},mixins:[r.Locale],props:{current:{type:Number,default:1},total:{type:Number,default:0},pageSize:{type:Number,default:10},pageSizeOptions:{type:Array,default:function(){return[10,20,30,40,50]}},pagerCount:{type:Number,default:7,validator:function(e){return e%2==1}},showTotal:{type:Boolean,default:!1},showElevator:{type:Boolean,default:!1},showSizer:{type:Boolean,default:!1},simple:{type:Boolean,default:!1},small:{type:Boolean,default:!1}},data:function(){return{currentPage:this.current,currentPageSize:this.pageSize,quickPrevIconClass:"ans-icon-more",quickNextIconClass:"ans-icon-more",sizerDropdownVisible:!1}},computed:{lastPage:function(){var e=Math.ceil(this.total/this.currentPageSize);return 0===e?1:e},showPrevMore:function(){var e=this.pagerCount,t=this.currentPage;return this.lastPage>e&&t>e-(e-1)/2},showNextMore:function(){var e=this.pagerCount,t=this.currentPage,n=this.lastPage;return n>e&&tthis.lastPage&&this.changePage(this.lastPage)},showPrevMore:function(e){e||(this.quickPrevIconClass="ans-icon-more")},showNextMore:function(e){e||(this.quickNextIconClass="ans-icon-more")}},methods:{handleSizerDropdown:function(e){this.sizerDropdownVisible=e},getKey:function(){return Math.random()},changePage:function(e){this.currentPage!==e&&(this.currentPage=e,this.$emit("on-change",e))},prevPage:function(){var e=this.currentPage;e<=1||this.changePage(e-1)},nextPage:function(){var e=this.currentPage;e>=this.lastPage||this.changePage(e+1)},fastPrev:function(){var e=this.currentPage-5;e>0?this.changePage(e):this.changePage(1)},fastNext:function(){var e=this.currentPage+5;e>this.lastPage?this.changePage(this.lastPage):this.changePage(e)},keyDown:function(e){var t=e.keyCode;t>=48&&t<=57||t>=96&&t<=105||8===t||e.preventDefault()},keyUp:function(e){var t=e.keyCode,n=parseInt(e.target.value);if(37===t||38===t)this.prevPage();else if(39===t||40===t)this.nextPage();else if(13===t){var r;r=n>this.lastPage?this.lastPage:n<=0||!n?1:n,e.target.value=r,this.changePage(r)}},jumpPage:function(e){var t=parseInt(e.target.value.trim()),n=0;t&&t!==this.currentPage&&(n=t>this.lastPage?this.lastPage:t,e.target.value="",this.changePage(n))},onMouseenter:function(e){"left"===e?this.quickPrevIconClass="ans-icon-arrow-to-left":this.quickNextIconClass="ans-icon-arrow-to-right"},cleanSpace:function(){document.querySelectorAll("."+o+" ul").forEach(function(e){!function(e){for(var t=e.childNodes,n=0;n0:void 0!==e&&null!==e&&""!==e;return this.clearable&&!this.disabled&&this.inputHovering&&t},showNoMatchText:function(){return 0!==this.options.length&&this.options.every(function(e){return!e.visible})},navigatable:function(){return this.options.some(function(e){return!e.disabled&&e.visible})}},watch:{keyword:function(e){this.search(e)},value:function(e,t){this.dispatch("xFormItem","on-form-change",e),this.setSelected(e)},currentLabel:function(e){this.addTitle&&!this.multiple&&this.$refs.input&&this.$refs.input.$el&&this.$refs.input.$el.setAttribute("title",e)},focusIndex:function(e){if(e>-1&&e0?this.focusIndex=Math.min.apply(null,this.selectedOptions.map(function(t){return e.options.indexOf(t)})):this.focusIndex=-1:this.focusIndex=this.options.indexOf(this.lastOption)},navigateOptions:function(e){var t=this;if(this.visible){"next"===e?(this.focusIndex++,this.focusIndex>=this.options.length&&(this.focusIndex=0)):"prev"===e&&(this.focusIndex--,this.focusIndex<0&&(this.focusIndex=this.options.length-1));var n=this._getOptionByElIndex(this.focusIndex);if(n.disabled||!n.visible)return this.navigateOptions(e);this.$nextTick(function(){return t.$refs.dropdown.scrollToTarget(n)})}else this.toggleDropdown()},_getOptionByElIndex:function(e){if(this.options.length){var t=Array.from(this.options[0].$el.parentNode.children).filter(function(e){return!(0,o.hasClass)("invisible-option")});return t.length=n.length)break;s=n[a++]}else{if((a=n.next()).done)break;s=a.value}var l=s;if(t&&(0,o.getValueByPath)(l.value,this.valueKey)===e||l.value===e)return l.selected=!0,l}return{value:e,label:"object"===(void 0===e?"undefined":i(e))?"":e}},onOptionDestroy:function(e){e>-1&&this.options.splice(e,1),this.focusIndex=-1},setInputHeight:function(){var e=this;this.$refs.input&&this.$nextTick(function(){var t=e.$refs.multiple.clientHeight+4;e.$refs.input.$refs.input.style.height=Math.max(32,t)+"px"})},registerOption:function(e){this.options.push(e),this.focusIndex=-1,this.setSelected(this.value),this.$refs.dropdown&&this.$refs.dropdown.checkScrollable()},handleUpdateWidth:function(e){this.panelStyles={width:e}}},created:function(){this.$on("click-option",this.handleSelect)},mounted:function(){var e=this;this.hasEmptySlot=void 0!==this.$slots.empty,this.setSelected(this.value),this.$refs.input&&(this.inputWidth=this.$refs.input.$el.clientWidth),this.$scopedSlots.header&&(this.panelHeader=function(t,n){return e.$scopedSlots.header(n)}),this.$scopedSlots.footer&&(this.panelFooter=function(t,n){return e.$scopedSlots.footer(n)})}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(76),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r,i=n(0),o=(r=n(222))&&r.__esModule?r:{default:r},a=n(4),s=i.LIB_NAME+"-input";t.default={name:"xInput",mixins:[i.emitter],data:function(){return{wrapperClass:s,currentValue:this.value,textareaCalcStyle:{},prefixStyles:{},suffixStyles:{},hovering:!1,focused:!1,isOnComposition:!1}},props:{type:{default:"text"},size:{validator:function(e){return["small","default","large"].includes(e)},default:"default"},value:[String,Number],clearable:{type:Boolean,default:!1},suffixIcon:String,prefixIcon:String,label:String,noBorder:{type:Boolean,default:!1},name:String,placeholder:{type:String,default:function(){return(0,a.t)("ans.input.placeholder")}},disabled:Boolean,readonly:Boolean,autofocus:Boolean,autocomplete:{type:String,default:"off"},maxlength:Number,tabindex:Number,resize:String,rows:{type:Number,default:2},autosize:{type:[Boolean,Object],default:!1},minlength:Number},computed:{textareaStyle:function(){return Object.assign({},this.textareaCalcStyle,{resize:this.resize})},showClear:function(){return!this.disabled&&this.clearable&&this.currentValue&&(this.focused||this.hovering)},hasPrefix:function(){return this.prefixIcon||this.$slots.prefix},hasSuffix:function(){return this.suffixIcon||this.clearable||this.$slots.suffix},isNotTextarea:function(){return"textarea"!==this.type}},methods:{handleComposition:function(e){"compositionend"===e.type?this.isOnComposition=!1:this.isOnComposition=!0},handleEnter:function(e){this.$emit("on-enterkey",e)},handleClick:function(e){this.$emit("on-click",e)},handleBlur:function(e){this.focused=!1,this.$emit("on-blur",e),(0,i.findComponentUpward)(this,["xDatepicker","xTimePicker","xCascader","xSelect"])||this.dispatch("xFormItem","on-form-blur",this.currentValue)},handleFocus:function(e){this.focused=!0,this.$emit("on-focus",e)},hanldleInput:function(e){this.isOnComposition||this.$emit("input",e.target.value)},handleChange:function(e){this.$emit("on-change",e.target.value)},handleIconClick:function(e){this.showClear&&(this.clear(),this.$emit("on-clear")),this.$emit("on-click-icon",e)},focus:function(){(this.$refs.input||this.$refs.textarea).focus()},blur:function(){(this.$refs.input||this.$refs.textarea).blur()},clear:function(){this.setCurrentValue(""),this.focus()},resizeTextarea:function(){var e=this.autosize;if(!this.isNotTextarea)if(e){var t=e.minRows,n=e.maxRows;this.textareaCalcStyle=(0,o.default)(this.$refs.textarea,t,n)}else this.textareaCalcStyle={height:"auto",minHeight:(0,o.default)(this.$refs.textarea).minHeight}},setCurrentValue:function(e){var t=this;e!==this.currentValue&&(this.$nextTick(function(e){t.resizeTextarea()}),this.currentValue=e)}},watch:{value:function(e,t){this.setCurrentValue(e)},currentValue:function(){this.resizeTextarea()}},mounted:function(){if(this.autofocus&&this.focus(),this.resizeTextarea(),this.hasPrefix){var e=this.$slots.prepend?this.$refs.prepend.clientWidth+10+"px":"10px";this.prefixStyles={left:e}}if(this.hasSuffix){var t=this.$slots.append?this.$refs.append.clientWidth+10+"px":"10px";this.suffixStyles={right:t}}}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(78),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r=n(0),i=n(79);t.default={name:"xSelectDropdown",components:{xCuctomRender:r.xCuctomRender,xScroller:i.xScroller},mixins:[r.Popper],props:{width:[String,Number],height:[String,Number],maxHeight:[String,Number],hasArrow:Boolean,customHeader:Function,customFooter:Function,scrollbarClass:String},data:function(){return{arrowClass:r.LIB_NAME+"-popper-arrow",wrapperStyles:{},innerStyles:{}}},computed:{transitionName:function(){return this.$parent.dropAnimation||r.ANIMATION_PREFIX+"drop"},wrapperClasses:function(){return[r.LIB_NAME+"-select-dropdown",{light:this.hasArrow},{"no-box-shadow":this.noBoxShadow}]}},methods:{toggle:function(){this.visible?this.hide():this.show()},show:function(){var e=(0,r.formatSize)(this.width)||this.$parent.$el.clientWidth+"px";this.$emit("on-update-width",e),this.wrapperStyles={width:e},this.innerStyles={height:(0,r.formatSize)(this.height),maxHeight:(0,r.formatSize)(this.maxHeight)},this.visible=!0},hide:function(){this.visible=!1},beforeEnter:function(){this.checkScrollable()},checkScrollable:function(){var e=this;this.$nextTick(function(){e.$refs.scroller.checkScrollable()})},updateLayout:function(){this.$refs.scroller.stickToBoundary(!0,!0,!1),this.updateElementHandler()},scrollToTarget:function(e){e&&e.$el&&this.$refs.scroller.scrollToTarget(e.$el)}},mounted:function(){this.$refs.reference=this.$parent.$el},beforeDestroy:function(){this.destroyPopper()}}},function(e,t,n){t.__esModule=!0,t.xScroller=void 0;var r,i=(r=n(226))&&r.__esModule?r:{default:r};t.xScroller=i.default},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(81),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r="function"==typeof Symbol&&"symbol"==s(Symbol.iterator)?function(e){return void 0===e?"undefined":s(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":s(e)},i=n(0),o=l(n(229)),a=l(n(232));function l(e){return e&&e.__esModule?e:{default:e}}t.default={name:"xScroller",components:{xVerticalScrollbar:o.default,xHorizontalScrollbar:a.default},directives:{mousewheel:i.mousewheel},props:{width:[String,Number],maxWidth:[String,Number],height:[String,Number],maxHeight:[String,Number],scrollbarClass:String,reverseScrollY:{type:Boolean,default:!1},showScrollbar:{type:[Boolean,String],default:!0},checkOnMounted:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},barOffsetLeft:{type:Number,default:0},barOffsetRight:{type:Number,default:0},barOffsetTop:{type:Number,default:0},barOffsetBottom:{type:Number,default:0}},data:function(){return{wrapperClass:i.LIB_NAME+"-scroller",contentWidth:0,contentHeight:0,wrapperWidth:0,wrapperHeight:0,scrollX:!1,scrollY:!1,barDragging:!1,bodyDragging:!1,currentTop:0,currentLeft:0,startClientX:null,startClientY:null,startTop:null,startLeft:null,moving:!1,hoveringBar:!1,resetMovingTimer:null}},computed:{wrapperStyles:function(){return{width:(0,i.formatSize)(this.width),"max-width":(0,i.formatSize)(this.maxWidth),height:(0,i.formatSize)(this.height),"max-height":(0,i.formatSize)(this.maxHeight)}},minLeft:function(){return this.wrapperWidth-this.contentWidth},minTop:function(){return this.wrapperHeight-this.contentHeight},dragging:function(){return this.bodyDragging||this.barDragging},showWhenActive:function(){return"active"===this.showScrollbar},activeBar:function(){return"boolean"===r(this.showScrollbar)?this.showScrollbar:this.showWhenActive&&(this.moving||this.hoveringBar)}},watch:{width:function(){this.checkScrollable()},maxWidth:function(){this.checkScrollable()},height:function(){this.checkScrollable()},maxHeight:function(){this.checkScrollable()}},methods:{checkScrollable:function(){var e=this.$refs.content,t=this.$el;if(this.wrapperWidth=t.clientWidth,this.wrapperHeight=t.clientHeight,this.contentWidth=e.offsetWidth,this.contentHeight=e.offsetHeight,!(this.wrapperWidth&&this.contentWidth&&this.wrapperHeight&&this.contentHeight))return this.scrollX=!1,void(this.scrollY=!1);this.scrollX=this.contentWidth-this.wrapperWidth>1,this.scrollY=this.contentHeight-this.wrapperHeight>1},handleMouseWheel:function(e,t){if(this.disabled)e.preventDefault();else{var n=e.shiftKey,r=this.$refs.content,i=this.reverseScrollY||n?-t.pixelY:-t.pixelX,o=n?-t.pixelX:-t.pixelY;if(this.scrollX&&i){var a=this.currentLeft,s=this.getValidNumber(a+i,this.minLeft,0);s!==a&&(this.currentLeft=s,r.style.left=s+"px",this.$refs.horizontal&&this.$refs.horizontal.setLeft(s),this.emitEvent(s,!1),e.preventDefault())}else if(this.scrollY&&o){var l=this.currentTop,u=this.getValidNumber(l+o,this.minTop,0);u!==l&&(this.currentTop=u,r.style.top=u+"px",this.$refs.vertical&&this.$refs.vertical.setTop(u),this.emitEvent(u,!0),e.preventDefault())}this.handleAction()}},getValidNumber:function(e,t,n){return e=Math.round(e),Math.max(t,Math.min(n,e))},handleStartDragBar:function(e){this.barDragging=!0,this.$emit("on-start-drag-bar",e)},handleEndDragBar:function(e){this.barDragging=!1,this.$emit("on-end-drag-bar",e)},handleVerticalDrag:function(e){var t=this.$refs.content,n=this.getValidNumber(-e*this.contentHeight,this.minTop,0);n!==this.currentTop&&(this.currentTop=n,t.style.top=n+"px",this.emitEvent(n,!0)),this.handleAction()},handleHorizontalDrag:function(e){var t=this.$refs.content,n=this.getValidNumber(-e*this.contentWidth,this.minLeft,0);n!==this.currentLeft&&(this.currentLeft=n,t.style.left=n+"px",this.emitEvent(n,!1)),this.handleAction()},startDrag:function(e){e.preventDefault(),this.disabled||(e=e.changedTouches[0],this.startTop=this.currentTop,this.startLeft=this.currentLeft,this.startClientX=e.clientX,this.startClientY=e.clientY,this.bodyDragging=!0)},onDrag:function(e){if(this.bodyDragging){var t=this.$refs.content,n=e.changedTouches[0];if(this.scrollX){var r=this.getValidNumber(this.startLeft+n.clientX-this.startClientX,this.minLeft,0);r!==this.currentLeft&&(this.currentLeft=r,t.style.left=r+"px",this.$refs.horizontal&&this.$refs.horizontal.setLeft(r),this.emitEvent(r,!1),e.preventDefault())}if(this.scrollY){var i=this.getValidNumber(this.startTop+n.clientY-this.startClientY,this.minTop,0);i!==this.currentTop&&(this.currentTop=i,t.style.top=i+"px",this.$refs.vertical&&this.$refs.vertical.setTop(i),this.emitEvent(i,!0),e.preventDefault())}this.handleAction()}},endDrag:function(e){this.bodyDragging&&(this.bodyDragging=!1)},emitEvent:function(e,t){var n=this;t?(0===e?this.$nextTick(function(){return n.$emit("on-y-start")}):e===this.minTop&&this.$nextTick(function(){return n.$emit("on-y-end")}),this.$emit("on-scroll-y",e)):(0===e?this.$nextTick(function(){return n.$emit("on-x-start")}):e===this.minLeft&&this.$nextTick(function(){return n.$emit("on-x-end")}),this.$emit("on-scroll-x",e))},forceCheck:function(){this.checkScrollable(),this.contentWidth&&this.contentHeight||i.limitedLoop.nextTick(this.forceCheck,this)},setContentLeft:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.currentLeft!==e&&(this.currentLeft=e,n||(this.bodyDragging=!0,setTimeout(function(){t.bodyDragging=!1},500)),this.$refs.content.style.left=e+"px",this.$refs.horizontal&&this.$refs.horizontal.setLeft(e),this.handleAction())},setContentTop:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.currentTop!==e&&(this.currentTop=e,n||(this.bodyDragging=!0,setTimeout(function(){t.bodyDragging=!1},500)),this.$refs.content.style.top=e+"px",this.$refs.vertical&&this.$refs.vertical.setTop(e),this.handleAction())},stickToBoundary:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];this.checkScrollable();var i=this.$refs.content;r||(this.bodyDragging=!0,setTimeout(function(){t.bodyDragging=!1},500)),e?(this.currentTop=n?0:this.minTop,i.style.top=n?0:this.minTop+"px",this.$refs.vertical&&this.$refs.vertical.setTop(this.currentTop)):(this.currentLeft=n?0:this.minLeft,i.style.left=n?0:this.minLeft+"px",this.$refs.horizontal&&this.$refs.horizontal.setLeft(this.currentLeft)),this.handleAction()},handleAction:function(){this.showWhenActive&&(this.moving=!0,this.resetMovingTimer&&clearTimeout(this.resetMovingTimer),this.resetMovingTimer=setTimeout(this.resetMoving,1e3))},resetMoving:function(){this.moving=!1},scrollToTarget:function(e){var t=this.$el,n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=r.top-n.top,o=n.top+t.offsetHeight-r.top-e.offsetHeight,a=r.left-n.left,s=n.left+t.offsetWidth-r.left-e.offsetWidth;i<0?this.setContentTop(this.currentTop-i):o<0&&this.setContentTop(o+this.currentTop),a<0?this.setContentLeft(this.currentLeft-a):s<0&&this.setContentLeft(s+this.currentLeft)}},mounted:function(){var e=this;this.checkOnMounted&&this.$nextTick(function(){e.forceCheck()})}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(83),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r=n(0);t.default={name:"xVerticalScrollbar",props:{viewHeight:Number,offsetTop:Number,offsetBottom:Number,contentHeight:Number,dragging:Boolean,disabled:Boolean,active:Boolean},data:function(){return{wrapperClass:r.LIB_NAME+"-v-scrollbar",transitionName:r.ANIMATION_PREFIX+"fade",top:0,barDragging:!1,startClientY:null,startTop:null}},computed:{wrapperStyles:function(){var e={};return this.offsetTop&&(e.top=this.offsetTop+"px"),(this.offsetTop||this.offsetBottom)&&(e.height=this.wrapperHeight+"px"),e},wrapperHeight:function(){return this.viewHeight-this.offsetTop-this.offsetBottom},height:function(){return this.viewHeight*this.wrapperHeight/this.contentHeight},maxTop:function(){return this.viewHeight-this.height}},methods:{setTop:function(e){this.contentHeight&&(this.top=-e*this.wrapperHeight/this.contentHeight)},startDrag:function(e){this.disabled||(this.barDragging=!0,document.onselectstart=function(){return!1},document.ondragstart=function(){return!1},e=e.changedTouches?e.changedTouches[0]:e,this.startTop=this.top,this.startClientY=e.clientY,this.$emit("on-start-drag",!0))},onDrag:function(e){if(!this.disabled&&this.barDragging){var t=(e=e.changedTouches?e.changedTouches[0]:e).clientY-this.startClientY,n=this.startTop+t;n=Math.min(this.maxTop,Math.max(n,0)),this.top=n,this.$emit("on-vertical-drag",n/this.wrapperHeight)}},endDrag:function(e){this.barDragging&&(this.barDragging=!1,document.onselectstart=null,document.ondragstart=null,this.$emit("on-end-drag",!0))},jump:function(e){if(!this.disabled&&e.target===this.$el){var t=e.clientY-this.$refs.bar.getBoundingClientRect().top-.5*this.height,n=this.top+t;n=Math.min(this.maxTop,Math.max(n,0)),this.top=n,this.$emit("on-vertical-drag",n/this.wrapperHeight)}}},mounted:function(){document.addEventListener("mousemove",this.onDrag),document.addEventListener("touchmove",this.onDrag),document.addEventListener("mouseup",this.endDrag),document.addEventListener("touchend",this.endDrag)},beforeDestroy:function(){document.removeEventListener("mousemove",this.onDrag),document.removeEventListener("touchmove",this.onDrag),document.removeEventListener("mouseup",this.endDrag),document.removeEventListener("touchend",this.endDrag)}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(85),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r=n(0);t.default={name:"xHorizontalScrollbar",props:{viewWidth:Number,offsetLeft:Number,offsetRight:Number,contentWidth:Number,dragging:Boolean,disabled:Boolean,active:Boolean},data:function(){return{wrapperClass:r.LIB_NAME+"-h-scrollbar",transitionName:r.ANIMATION_PREFIX+"fade",left:0,barDragging:!1,startClientX:null,startLeft:null}},computed:{wrapperStyles:function(){var e={};return this.offsetLeft&&(e.left=this.offsetLeft+"px"),(this.offsetLeft||this.offsetRight)&&(e.width=this.wrapperWidth+"px"),e},wrapperWidth:function(){return this.viewWidth-this.offsetLeft-this.offsetRight},width:function(){return this.viewWidth*this.wrapperWidth/this.contentWidth},maxLeft:function(){return this.wrapperWidth-this.width}},methods:{setLeft:function(e){this.contentWidth&&(this.left=-e*this.wrapperWidth/this.contentWidth)},startDrag:function(e){this.disabled||(this.barDragging=!0,document.onselectstart=function(){return!1},document.ondragstart=function(){return!1},e=e.changedTouches?e.changedTouches[0]:e,this.startLeft=this.left,this.startClientX=e.clientX,this.$emit("on-start-drag",!1))},onDrag:function(e){if(!this.disabled&&this.barDragging){var t=(e=e.changedTouches?e.changedTouches[0]:e).clientX-this.startClientX,n=this.startLeft+t;n=Math.min(this.maxLeft,Math.max(n,0)),this.left=n,this.$emit("on-horizontal-drag",n/this.wrapperWidth)}},endDrag:function(e){this.barDragging&&(this.barDragging=!1,document.onselectstart=null,document.ondragstart=null,this.$emit("on-end-drag",!1))},jump:function(e){if(!this.disabled&&e.target===this.$el){var t=e.clientX-this.$refs.bar.getBoundingClientRect().left-.5*this.width,n=this.left+t;n=Math.min(this.maxLeft,Math.max(n,0)),this.left=n,this.$emit("on-horizontal-drag",n/this.wrapperWidth)}}},mounted:function(){document.addEventListener("mousemove",this.onDrag),document.addEventListener("touchmove",this.onDrag),document.addEventListener("mouseup",this.endDrag),document.addEventListener("touchend",this.endDrag)},beforeDestroy:function(){document.removeEventListener("mousemove",this.onDrag),document.removeEventListener("touchmove",this.onDrag),document.removeEventListener("mouseup",this.endDrag),document.removeEventListener("touchend",this.endDrag)}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(87),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r="function"==typeof Symbol&&"symbol"==s(Symbol.iterator)?function(e){return void 0===e?"undefined":s(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":s(e)},i=n(0);t.default={name:"xOption",mixins:[i.emitter],inject:["select"],data:function(){return{wrapperClass:i.LIB_NAME+"-option",selected:!1,visible:!0,focused:!1}},props:{value:{required:!0},label:{type:[String,Number],required:!0},disabled:Boolean,clickHandler:Function},computed:{multiple:function(){return this.select&&this.select.multiple},displayText:function(){return this.visible&&this.select&&this.select.filterable&&this.select.highlightMatchedText&&this.select.keyword?this.label.replace(this.select.keyword,''+this.select.keyword+""):this.label}},methods:{hoverItem:function(){this.disabled||(this.select.focusIndex=this.select.options.indexOf(this))},handleClick:function(){this.clickHandler&&"function"==typeof this.clickHandler?this.clickHandler(this.value,this.label):this.defalutHandleClick()},defalutHandleClick:function(){this.disabled||this.dispatch("xSelect","click-option",this)},handleKeywordChange:function(e){!e||this.match(e)?this.visible=!0:this.visible=!1},match:function(e){var t=this.select.filterProps;if(t&&t.length&&"object"===r(this.value)){var n=this.value,i=!1,o=t,a=Array.isArray(o),s=0;for(o=a?o:o[Symbol.iterator]();;){var l;if(a){if(s>=o.length)break;l=o[s++]}else{if((s=o.next()).done)break;l=s.value}var u=l;if(n&&n[u]&&n[u].toString().includes(e)){i=!0;break}}return i}return this.label.toString().includes(e)}},created:function(){this.select.registerOption(this),this.$on("keywordChange",this.handleKeywordChange)},mounted:function(){this.select.addTitle&&this.$el.setAttribute("title",this.label)},beforeDestroy:function(){this.select.onOptionDestroy(this.select.options.indexOf(this))}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(89),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r=n(0);t.default={name:"xOptionGroup",data:function(){return{wrapperClass:r.LIB_NAME+"-option-group",visible:!0}},props:{label:String},methods:{handleKeywordChange:function(e){this.visible=!this.$children.every(function(e){return!e.visible})}},created:function(){this.$on("keywordChange",this.handleKeywordChange)}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(242),i=n(91);for(var o in i)"default"!==o&&function(e){n.d(t,e,function(){return i[e]})}(o);var a=n(1),s=Object(a.a)(i.default,r.a,r.b,!1,null,null,null);s.options.__file="Tooltip.vue",t.default=s.exports},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(92),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r=n(0);t.default={name:"xTooltip",mixins:[r.Popper],data:function(){return{wrapperClass:r.LIB_NAME+"-tooltip",arrowClass:r.LIB_NAME+"-popper-arrow",transitionName:r.ANIMATION_PREFIX+"fade"}},props:{content:String,theme:String,maxWidth:String},computed:{contentStyles:function(){return{maxWidth:this.maxWidth}}},methods:{show:function(){this.visible=!0},hide:function(){this.visible=!1},update:function(e){this.content=e.text,this.theme=e.theme,this.maxWidth=e.maxWidth,this.visible&&this.updateElementHandler()}},beforeDestroy:function(){this.destroyPopper()}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(94),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r,i=n(0),o=n(16),a=(r=n(250))&&r.__esModule?r:{default:r},s=n(4),l=Object.assign({},i.Popper,{props:{placement:{type:String,default:"bottom-start"},reference:HTMLElement,distance:{type:Number,default:1},appendToBody:{type:Boolean,default:!1},positionFixed:{type:Boolean,default:!1},viewport:{type:Boolean,default:!1},popperOptions:Object}});t.default={name:"xCascader",components:{xInput:o.xInput,Caspanel:a.default},mixins:[l,i.emitter],directives:{clickOutside:i.clickOutside},data:function(){return{prefixCls:i.LIB_NAME+"-cascader",scrollbar:i.LIB_NAME+"-scrollbar",queryStr:"",tmpSelected:[],selected:[],currentValue:[],updatingValue:!1,list:[],childrenKey:"children",transitionName:i.ANIMATION_PREFIX+"drop",selectedOptions:[],inputWidth:0}},props:{options:{type:Array,default:function(){return[]}},prop:{type:Object,default:function(){return{children:"children",label:"label",value:"value",disabled:"disabled"}}},expandTrigger:{validator:function(e){return["click","hover"].indexOf(e)>-1},default:"click"},clearable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:function(){return(0,s.t)("ans.cascader.placeholder")}},filterable:Boolean,noDataText:{type:String,default:function(){return(0,s.t)("ans.cascader.noData")}},noMatchText:{type:String,default:function(){return(0,s.t)("ans.cascader.noMatch")}},changeOnSelect:Boolean,value:{type:Array,default:function(){return[]}},separator:{type:String,default:"/"},popperClass:String,multiple:Boolean},watch:{value:{deep:!0,immediate:!0,handler:function(e,t){JSON.stringify(e)!==JSON.stringify(t)&&(this.currentValue=e,e.length||(this.selected=[]))}},currentValue:function(e,t){if(JSON.stringify(e)!==t){if(this.$emit("input",this.currentValue),this.updatingValue)return void(this.updatingValue=!1);this.updateSelected(!0)}},options:{deep:!0,immediate:!0,handler:function(e){this.list=this.handlerData(e)}},visible:function(e){this.broadcast("Caspanel","on-visible-change",e)}},computed:{showFilterList:function(){return this.filterable&&""!==this.queryStr},showClear:function(){return this.currentValue&&this.currentValue.length&&this.clearable&&!this.disabled},displayRender:function(){for(var e=[],t=0;t-1}).map(function(t){return t.display=t.display.replace(new RegExp(e.queryStr,"g"),""+e.queryStr+""),t})}},methods:{toggle:function(){this.disabled||(this.visible=!this.visible,this.$refs.input.focus())},handleClear:function(){var e=JSON.stringify(this.currentValue);this.currentValue=this.selected=this.selectedOptions=this.tmpSelected=[],this.handleClose(),this.emitValue(this.currentValue,e),this.broadcast("Caspanel","on-clear",!0),this.setInputHeight()},updateResult:function(e){this.tmpSelected=e},emitValue:function(e,t){JSON.stringify(e)!==t&&this.$emit("on-change",this.currentValue,JSON.parse(JSON.stringify(this.selected)))},updateSelected:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.changeOnSelect&&!e||this.broadcast("Caspanel","on-find-selected",{value:this.currentValue})},handleClose:function(){this.visible=!1},handleQuery:function(){this.visible=!0,this.queryStr=this.$refs.input.currentValue.trim(),this.updateElementHandler()},handleSelectItem:function(e){this.queryStr="",this.$refs.input.currentValue="";var t=JSON.stringify(this.currentValue);this.currentValue=e.value.split(","),this.emitValue(this.currentValue,t),this.handleClose()},handlerData:function(e){var t=this,n=JSON.parse(JSON.stringify(e));return n.forEach(function(e){Object.keys(t.prop).forEach(function(n){if(!e[n]){var r=e[t.prop[n]];e[n]=n===t.childrenKey&&r?t.handlerData(r):r}})}),n},getCls:function(e){return this.prefixCls+"-"+e},handleRemoveTag:function(e,t){var n=this;e&&e.forEach(function(r,i){if(r.value===t.value)return e.splice(i,1),n.setInputHeight(),n.updateValue(e),!1;n.isArray(r)&&n.handleRemoveTag(r,t)})},isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},setInputHeight:function(){var e=this,t=this.$refs,n=t.input,r=t.multiple;n&&r&&this.$nextTick(function(){var t=r.clientHeight+4;n.$refs.input.style.height=Math.max(32,t)+"px",e.updateElementHandler()})},getNewVal:function(e){var t=this,n=[];return e.forEach(function(e){if(t.isArray(e)){var r=[];t.selectedOptions=e,e.forEach(function(e){r.push(e.value)}),n.push(r)}else n.push(e.value)}),n},updateValue:function(e){this.updatingValue=!0;var t=this.currentValue;this.currentValue=e,this.emitValue(this.currentValue,t)},onResultChange:function(){var e=this;this.$on("on-result-change",function(t){var n=t.lastValue,r=t.changeOnSelect,i=t.formInit;!e.multiple&&n&&!i&&e.handleClose();var o=[];(n||r)&&(e.selected=e.tmpSelected,o=e.getNewVal(e.selected)),i||(e.setInputHeight(),e.updateValue(o))})}},created:function(){this.onResultChange()},mounted:function(){this.updateSelected(!0),this.$refs.reference=this.$el,this.$refs.input&&(this.inputWidth=this.$refs.input.$el.clientWidth)},beforeDestroy:function(){this.$off("on-result-change")}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(96),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r="function"==typeof Symbol&&"symbol"==s(Symbol.iterator)?function(e){return void 0===e?"undefined":s(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":s(e)},i=n(0);t.default={name:"Caspanel",mixins:[i.emitter],data:function(){return{subList:[],curItem:[]}},watch:{data:function(){this.subList=[],this.curItem=[]}},props:{data:{type:Array,default:function(){return[]}},trigger:{validator:function(e){return["click","hover"].indexOf(e)>-1},default:"click"},changeOnSelect:Boolean,prefixCls:String,multiple:Boolean},methods:{getCurItem:function(e,t){var n=this,r=this.getBaseItem(e);if(t)this.curItem.push(r);else if(this.multiple){var i=this.inTmp(r);~i?this.curItem.splice(i,1):(this.hasChildren(e)&&(this.curItem=[]),this.curItem.forEach(function(e,t){~n.data.findIndex(function(t){return t.value===e.value&&n.hasChildren(t)})&&n.curItem.splice(t,1)}),this.curItem.push(r))}else this.curItem=[r]},handleTriggerItem:function(e,t){e.disabled||(this.subList=[],this.hasChildren(e)&&(this.subList=e.children),this.getCurItem(e,t),this.emitUpdate(this.curItem),this.dispatch("xCascader","on-result-change",{lastValue:!this.hasChildren(e),changeOnSelect:this.changeOnSelect,fromInit:t}))},handleClickItem:function(e){"click"!==this.trigger&&this.hasChildren(e)||this.handleTriggerItem(e)},handleHoverItem:function(e){"hover"===this.trigger&&this.hasChildren(e)&&this.handleTriggerItem(e)},getBaseItem:function(e){var t=Object.assign({},e);return t.children&&delete t.children,t},updateResult:function(e){this.emitUpdate(this.result=this.curItem.concat(e))},emitUpdate:function(e){this.$parent.updateResult(e[0]&&void 0!=e[0].__label?[e]:e)},inTmp:function(e){return this.curItem.findIndex(function(t){return t.value===e.value&&t.label===e.label})},itemClass:function(e){return[this.prefixCls+"__list",{active:~this.inTmp(e),disabled:e.disabled}]},iconClass:function(e){return[{"selected-mark":!this.hasChildren(e)&&this.multiple,"ans-icon-arrow-right":this.hasChildren(e)}]},hasChildren:function(e){return e&&e.children&&e.children.length},onFindSelected:function(){var e=this;this.$on("on-find-selected",function(t){for(var n=t.value,i=[].concat(n),o=function(t){for(var n=function(n){if("object"===r(i[t]))i[t].forEach(function(r){if(r===e.data[n].value)return i[t].splice(0,1),e.handleTriggerItem(e.data[n],!0),e.$nextTick(function(){e.broadcast("Caspanel","on-find-selected",{value:i})}),!1});else if(i[t]===e.data[n].value)return i.splice(0,1),e.handleTriggerItem(e.data[n],!0),e.$nextTick(function(){e.broadcast("Caspanel","on-find-selected",{value:i})}),{v:{v:!1}}},o=0;o0&&void 0!==arguments[0]&&arguments[0];if(e.sublist=[],e.curItem=[],t){var n=(0,i.findComponentDownward)(e,"Caspanel");n&&n.$emit("on-clear",!0)}})},onVisibleChange:function(){var e=this,t=this;t.$on("on-visible-change",function(n){n&&t.$nextTick(function(){for(var t=document.getElementsByClassName("ans-cascader-drop__list active"),r=0;r-1}},placement:{validator:function(e){return["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"].indexOf(e)>-1},default:"top"},title:String,content:String,disabled:Boolean,width:Number,visibleArrow:{default:!0},confirm:Boolean,cancelText:{type:String,default:function(){return(0,o.t)("ans.poptip.cancel")}},okText:{type:String,default:function(){return(0,o.t)("ans.poptip.confirm")}},value:Boolean,distance:{type:Number,default:5},popperClass:String},computed:{wrapperClass:function(){var e;return[""+a,this.popperClass,(e={light:this.visibleArrow},e[a+"--plain"]=this.content,e)]},tooltipId:function(){return a+"-"+(0,r.uuid)()},hidden:function(){return this.disabled||!this.visible}},watch:{value:{immediate:!0,handler:function(e){this.$emit("input",this.visible=e)}},visible:function(e){this.disabled||(e?this.$emit("on-show"):this.$emit("on-hide"),this.$emit("input",e))}},mounted:function(){var e=this.getReference(),t=this.popper||this.$refs.popper;e&&((0,r.addClass)(e,a+"__reference"),e.setAttribute("aria-describedby",this.tooltipId),e.setAttribute("tabindex",this.tabIndex),"click"!==this.trigger&&((0,r.on)(e,"focusin",this.handleFocus),(0,r.on)(t,"focusin",this.handleFocus),(0,r.on)(e,"focusout",this.handleBlur),(0,r.on)(t,"focusout",this.handleBlur)),(0,r.on)(e,"keydown",this.handleKeydown),(0,r.on)(e,"click",this.handleClick),"click"===this.trigger?((0,r.on)(e,"click",this.doToggle),(0,r.on)(document,"click",this.handleDocumentClick)):"hover"===this.trigger?((0,r.on)(e,"mouseenter",this.handleMouseEnter),(0,r.on)(t,"mouseenter",this.handleMouseEnter),(0,r.on)(e,"mouseleave",this.handleMouseLeave),(0,r.on)(t,"mouseleave",this.handleMouseLeave)):"focus"===this.trigger&&this.isInput(e)&&((0,r.on)(e,"mousedown",this.doShow),(0,r.on)(e,"mouseup",this.doClose)))},methods:{getReference:function(){var e=this.referenceEl=this.reference||this.$refs.reference;return!e&&this.$slots.reference&&this.$slots.reference[0]&&(e=this.referenceEl=this.$slots.reference[0].elm),e},doToggle:function(){this.visible=!this.visible},doShow:function(){this.visible=!0},doClose:function(){this.visible=!1},handleMouseEnter:function(){this.timer&&clearTimeout(this.timer),this.doShow()},handleMouseLeave:function(){var e=this;this.timer&&clearTimeout(this.timer),this.timer=setTimeout(function(){e.doClose()},100)},handleFocus:function(){(0,r.addClass)(this.referenceEl,"focusing"),"manual"!==this.trigger&&(this.visible=!0)},handleClick:function(){(0,r.removeClass)(this.referenceEl,"focusing")},handleBlur:function(){(0,r.removeClass)(this.referenceEl,"focusing"),"manual"!==this.trigger&&(this.visible=!1)},handleKeydown:function(e){27===e.keyCode&&"manual"!==this.trigger&&this.doClose()},handleDocumentClick:function(e){var t=this.getReference(),n=this.popper||this.$refs.popper;this.$el&&t&&!this.$el.contains(e.target)&&!t.contains(e.target)&&n&&!n.contains(e.target)&&(this.visible=!1)},onOk:function(){this.doClose(),this.$emit("on-ok")},onCancel:function(){this.doClose(),this.$emit("on-cancel")},isInput:function(e){return!e.querySelector("input, textarea")&&"INPUT"!==e.nodeName&&"TEXTAREA"!==e.nodeName}},destroyed:function(){var e=this.getReference();(0,r.off)(e,"click",this.doToggle),(0,r.off)(e,"mouseup",this.doClose),(0,r.off)(e,"mousedown",this.doShow),(0,r.off)(e,"focusin",this.doShow),(0,r.off)(e,"focusout",this.doClose),(0,r.off)(e,"mouseleave",this.handleMouseLeave),(0,r.off)(e,"mouseenter",this.handleMouseEnter),(0,r.off)(document,"click",this.handleDocumentClick),this.timer&&clearTimeout(this.timer)}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(104),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r=s(n(105)),i=s(n(111)),o=s(n(21)),a=s(n(9));function s(e){return e&&e.__esModule?e:{default:e}}t.default={name:"panelDate",components:{day:r.default,confirm:i.default},data:function(){return{selectedDate:null,isTimesShow:!1}},props:{value:{type:[Array],default:function(){return null}},format:String,disabledDate:{type:Function,default:null},confirm:{type:[Number,Boolean],default:0},options:{type:[Array,Object],default:null}},mounted:function(){this.init()},methods:{init:function(e){var t=e||this.value;t&&t.length?(this.selectedDate=t,(0,a.default)(t[0])&&(this.$refs.vDate.toDate=t[0])):this.selectedDate=[],this.$refs.vDate.init(this.selectedDate),this.timeInit()},timeInit:function(){this.isTimes()&&this.$refs.confirm.timsInit(this.selectedDate[this.selectedDate.length-1])},dayChange:function(e){this.selectedDate=[e],this.timeInit(),this.$emit("change",this.selectedDate)},timeChange:function(e){this.selectedDate=[e],this.$emit("change",this.selectedDate)},isTimes:function(){return(0,o.default)(this.format)},isConfirm:function(){return!(!this.confirm&&!this.isTimes())}}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(268),i=n(106);for(var o in i)"default"!==o&&function(e){n.d(t,e,function(){return i[e]})}(o);var a=n(1),s=Object(a.a)(i.default,r.a,r.b,!1,null,null,null);s.options.__file="day.vue",t.default=s.exports},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(107),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r=u(n(6)),i=u(n(270)),o=u(n(9)),a=u(n(108)),s=n(0),l=n(4);function u(e){return e&&e.__esModule?e:{default:e}}for(var c=(0,i.default)(),d=["#0098e1","#ffcf3d","#7281c2","#f2ac6f","#f07d7d","#e84d80","#a463b0","#7a56b8","#625ad1","#8ba8d6"],f=10;f<100;f++)d[f]="#"+Math.floor(16777215*Math.random()).toString(16);var h=["sun","mon","tue","wed","thu","fri","sat"].map(function(e){return(0,l.t)("ans.datepicker.weeks."+e)});t.default={components:{ym:a.default},data:function(){return{week:h,weeks:0,days:0,year:0,month:0,toDate:new Date,ymShow:!1}},mixins:[s.Locale],props:{type:{type:String,default:"date"},format:{type:String,default:"YYYY/MM/DD"},selectedDate:{type:[Array],default:function(){return null}},isHover:{type:[Number,String,Boolean],default:!1},hoverStartDate:{type:[Array],default:null},hoverEndDate:{type:[Array],default:null},disabledDate:{type:Function}},methods:{init:function(e){var t=this.thisDate(),n=t.year,r=t.month,i=t.week,o=t.day;this.year=n,this.month=r,this.weeks=i,this.days=o},thisDate:function(){var e=(0,r.default)(new Date(this.toDate)).toDate(),t=e.getFullYear(),n=e.getMonth()+1;return{year:t,month:n,day:new Date(t,n,0).getDate(),week:new Date(t,n-1,1).getDay(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds()}},dateFmt:function(e,t){return(0,r.default)(e).format(t)},today:function(e){return new Date(this.year,this.month,e).getTime()===new Date(c.year,c.month,c.today).getTime()},hoverDate:function(e){return{toDate:(0,r.default)(new Date(this.year,this.month-1,e)).format("YYYYMMDD"),hStart:this.hoverStartDate,hEnd:this.hoverEndDate}},selectDay:function(e){var t=this.selectedDate;if(!t||"date"!==this.type)return!1;if(t.length>0){for(var n=(0,r.default)(new Date(this.year,this.month-1,e)).format("YYYYMMDD"),i=0,a=t.length;i=c&&o<=f&&(h?(p.style.background=n[l]||"#0098e1",e.appendChild(p)):e.style.background=n[l]||"#0098e1",e.setAttribute("data-hover","true"),e.setAttribute("data-hover-"+l,"true"))}}}}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(271),i=n(109);for(var o in i)"default"!==o&&function(e){n.d(t,e,function(){return i[e]})}(o);var a=n(1),s=Object(a.a)(i.default,r.a,r.b,!1,null,null,null);s.options.__file="years.vue",t.default=s.exports},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(110),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r,i=(r=n(6))&&r.__esModule?r:{default:r},o=n(0);t.default={data:function(){return{date:null,year:0,month:0,type:"y",yearList:[]}},mixins:[o.Locale],props:{types:String},methods:{init:function(e,t){this.date=e,this.type=t,this.year=(0,i.default)(e).format("YYYY")-0,this.setYearList()},setYearList:function(){for(var e=[],t=this.year;t<=this.year-0+10;t++)e.push(t);this.yearList=e},isYear:function(e){return e===(0,i.default)(this.date).format("YYYY")-0},isMonth:function(e){return this.year===(0,i.default)(this.date).format("YYYY")-0&&e===(0,i.default)(this.date).format("M")-0},selectYear:function(e){if(this.year=e,"year"===this.types){var t=new Date(this.year,0,1);return this.date=t,void this.$emit("change",t)}this.type="m"},selectMonth:function(e){this.month=e;var t=new Date(this.year,this.month-1,1);this.$emit("change",t),this.date=t},selectText:function(){"y"===this.type?this.$emit("hide"):(this.type="y",this.year=(0,i.default)(this.date).format("YYYY"))},switchYear:function(e){"left"===e?"y"===this.type?(this.year=this.year-10,this.setYearList()):this.year=this.year-1:"y"===this.type?(this.year=this.year-0+10,this.setYearList()):this.year=this.year+1}}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(273),i=n(112);for(var o in i)"default"!==o&&function(e){n.d(t,e,function(){return i[e]})}(o);var a=n(1),s=Object(a.a)(i.default,r.a,r.b,!1,null,null,null);s.options.__file="confirm.vue",t.default=s.exports},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(113),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r=u(n(21)),i=n(20),o=u(n(114)),a=u(n(9)),s=n(0),l=n(4);function u(e){return e&&e.__esModule?e:{default:e}}t.default={components:{xPoptip:i.xPoptip,confirm:confirm,times:o.default},mixins:[s.Locale],data:function(){return{text:(0,l.t)("ans.datepicker.selectTime"),isTime:!1}},props:{format:String,type:String},methods:{ishms:function(){return(0,r.default)(this.format)},timsInit:function(e,t){e&&(0,a.default)(e)?(this.isTime=!0,this.$refs.times.init(e,t)):(this.$refs.poptipTime.doClose(),this.isTime=!1)},timeChange:function(e){this.$emit("time-change",e)},cancel:function(){this.isTime=!1,this.$emit("cancel")},tipShow:function(){this.$refs.times.setScrollTop()}}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(275),i=n(115);for(var o in i)"default"!==o&&function(e){n.d(t,e,function(){return i[e]})}(o);var a=n(1),s=Object(a.a)(i.default,r.a,r.b,!1,null,null,null);s.options.__file="time.vue",t.default=s.exports},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(116),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r,i=(r=n(6))&&r.__esModule?r:{default:r},o=n(0);t.default={data:function(){return{hours:null,minute:null,second:null,hours1:null,minute1:null,second1:null}},props:{format:String,type:String},mixins:[o.Locale],methods:{init:function(e,t){this.setDate(e,t),e?(this.hours=(0,i.default)(new Date(e)).format("H"),this.minute=(0,i.default)(new Date(e)).format("m"),this.second=(0,i.default)(new Date(e)).format("s")):(this.hours=null,this.minute=null,this.second=null),t?(this.hours1=(0,i.default)(new Date(t)).format("H"),this.minute1=(0,i.default)(new Date(t)).format("m"),this.second1=(0,i.default)(new Date(t)).format("s")):(this.hours1=null,this.minute1=null,this.second1=null)},setScrollTop:function(){var e=this;setTimeout(function(){e.$refs.hours.scrollTop=25*e.hours,e.$refs.minute.scrollTop=25*e.minute,e.$refs.second.scrollTop=25*e.second,e.$refs.hours1&&(e.$refs.hours1.scrollTop=25*e.hours1),e.$refs.minute1&&(e.$refs.minute1.scrollTop=25*e.minute1),e.$refs.second1&&(e.$refs.second1.scrollTop=25*e.second1)},10)},setDate:function(e,t){var n=new Date(e||new Date);this.year=n.getFullYear(),this.month=n.getMonth(),this.day=n.getDate();var r=new Date(t||new Date);this.year1=r.getFullYear(),this.month1=r.getMonth(),this.day1=r.getDate()},setHms:function(e,t){var n=this;this[t]=e,this.$refs[t].scrollTop=25*e,["hours","minute","second","hours1","minute1","second1"].forEach(function(e){null===n[e]&&(n[e]=0)})},change:function(e,t){this.setHms(e,t),this.year===this.year1&&this.month===this.month1&&this.day===this.day1&&("hours"===t&&(this.hours1<=e&&this.minute>this.minute1&&(this.minute1=this.minute,this.$refs.minute1.scrollTop=25*this.minute),this.hours1e)return;if("minute1"===t&&this.hours1===this.hours&&this.minute>e)return;if("second1"===t&&this.hours1===this.hours&&this.minute1===this.minute&&this.second>e)return}this.setHms(e,t),this.onChange()},onChange:function(){"date"===this.type?this.$emit("change",new Date(this.year,this.month,this.day,this.hours,this.minute,this.second)):this.$emit("change",[new Date(this.year,this.month,this.day,this.hours,this.minute,this.second),new Date(this.year1,this.month1,this.day1,this.hours1,this.minute1,this.second1)])},numLen:function(e){return 1===e.toString().length?"0"+e:e},getType:function(){var e=this.format;return/H|h/.test(e)&&/m/.test(e)&&/s/.test(e)?"hms":/H|h/.test(e)&&/m/.test(e)?"hm":/H|h/.test(e)?"h":void 0}}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(118),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r=u(n(105)),i=u(n(111)),o=u(n(21)),a=u(n(9)),s=u(n(33)),l=u(n(6));function u(e){return e&&e.__esModule?e:{default:e}}t.default={name:"Daterange",components:{day:r.default,confirm:i.default},data:function(){return{selectedDate:[],hoverStartDate:[],hoverEndDate:[],isHover:!1,arrDate:[]}},props:{value:{type:[Array],default:function(){return null}},format:String,disabledDate:{type:Function},confirm:{type:[Number,Boolean],default:0},options:{type:[Array,Object],default:null},optionsWidth:Number,panelNum:{type:Number,default:2},multiple:0,selectIndex:{type:Number,default:-1}},mounted:function(){this.init()},methods:{init:function(e,t){var n=this,r=(0,l.default)(new Date).subtract(this.panelNum-1,"M"),i=[];this.hoverStartDate=[],this.hoverEndDate=[],this.arrDate=[],this.isHover=!1;var o=e||this.value;o&&(i=function e(t){var n;return(n=[]).concat.apply(n,t.map(function(t){return Array.isArray(t)?e(t):t}))}(this.value),this.selectedDate=o,"array"===(0,s.default)(o[0])&&(0,a.default)(o[0][0])&&(r=(0,l.default)(o[0][0]).subtract(this.panelNum-2,"M")),o.forEach(function(e,t){if(2===e.length)n.hoverStartDate.push(e[0]),n.hoverEndDate.push(e[1]);else{var r=n.options;if(r&&r.length)for(var i=0;i0&&void 0!==arguments[0])||arguments[0];if((0,o.default)(this.format)){var t=this.selectedDate,n=t.length;if(n){var r=t[n-1];2===r.length&&e?this.$refs.confirm.timsInit(r[0],r[1]):this.$refs.confirm.timsInit()}}},switchPanel:function(e,t){for(var n=0;nt[0].getTime()?this.hoverClass([t[0],e]):this.hoverClass([e,t[0]])},radio:function(e){if(0===this.arrDate.length)this.selectedDate=[[e]],this.hoverStartDate=[e],this.hoverEndDate=[],this.arrDate.push(e),this.isHover=!0;else{if(e.getTime()>this.selectedDate[0][0].getTime())this.selectedDate[0].push(e),this.hoverEndDate=[e];else{var t=this.selectedDate[0][0];this.selectedDate=[],this.hoverStartDate=[],this.selectedDate=[[e,t]],this.hoverStartDate=[e],this.hoverEndDate=[t]}this.isHover=!1,this.arrDate=[],this.change()}this.timeInit()},multiSel:function(e){var t=this;this.getMultipleFn(function(){var n=t.arrDate,r=t.selectIndex;0===n.length?(-1===r?t.hoverStartDate.push(e):t.hoverStartDate[r]=e,n.push(e),t.isHover=!0,t.timeInit(!1)):(e.getTime()>n[0].getTime()?-1===r?(t.selectedDate.push([n[0],e]),t.hoverEndDate.push(e)):(t.$set(t.selectedDate,r,[n[0],e]),t.hoverEndDate[r]=e):-1===r?(t.hoverStartDate.pop(),t.selectedDate.push([e,n[0]]),t.hoverStartDate.push(e),t.hoverEndDate.push(n[0])):(t.$set(t.selectedDate,r,[e,n[0]]),t.hoverStartDate[r]=e,t.hoverEndDate[r]=n[0]),t.isHover=!1,t.arrDate=[],t.change(),t.timeInit())})},isConfirm:function(){return!(!this.confirm&&!(0,o.default)(this.format))},switchDatePanel:function(e,t){if("add"===e)for(var n=0;na&&o=0;s--){var u=this.$refs["dateRange"+s][0];i=(0,l.default)(i).subtract(1,"M"),u.toDate=i,u.init()}},reset:function(){this.isHover=!1,this.arrDate=[],this.hoverClass([])},cancel:function(){this.$emit("cancel"),this.reset()},timeChange:function(e){this.selectedDate[this.selectedDate.length-1]=e,this.change()},change:function(e){var t=[].concat(this.selectedDate);t.forEach(function(e){2===e.length&&(e[0]=new Date(e[0]),e[1]=new Date(e[1]))}),this.$emit("change",t,e)}}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(120),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r,i=(r=n(108))&&r.__esModule?r:{default:r};t.default={components:{years:i.default},data:function(){return{}},props:{type:{type:String,default:"year"},value:Array},mounted:function(){var e="year"===this.type?"y":"m",t=this.value&&this.value.length?this.value[0]:new Date;this.$refs.years.init(t,e)},methods:{change:function(e){this.$emit("change",[e])}}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(122),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r=n(0),i=d(n(114)),o=n(16),a=n(20),s=d(n(9)),l=d(n(33)),u=d(n(6)),c=n(4);function d(e){return e&&e.__esModule?e:{default:e}}t.default={name:"xTimepicker",components:{xTime:i.default,xInput:o.xInput,xPoptip:a.xPoptip},mixins:[r.Locale],props:{type:{type:String,default:"time"},value:{type:[Date,String,Number,Array],default:""},format:{type:String,default:"HH:mm:ss"},placement:{type:String,default:"bottom-start"},placeholder:{type:String,default:function(){return(0,c.t)("ans.timepicker.placeholder")}},confirm:{type:[Number,Boolean],default:0},size:{type:String,default:"default"},readonly:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},appendToBody:{type:Boolean,default:!1},positionFixed:Boolean,viewport:Boolean,popperOptions:{type:Object,default:function(){return{}}},suffixIcon:{type:String,default:"ans-icon-calendar"},prefixIcon:{type:String,default:""}},data:function(){return{text:"",timeType:"",dateValue:null,dateValueBar:"",startDate:null,endDate:null}},created:function(){this.timeType="timerange"===this.type?"daterange":"date"},mounted:function(){this.init()},methods:{init:function(){this.setDate(),this.setText(),this.$refs.xTime.init(this.startDate,this.endDate)},setDate:function(e){var t=e||this.value;"array"===(0,l.default)(t)?(t[0]&&(0,s.default)(t[0])&&(this.startDate=t[0]),t[1]&&(0,s.default)(t[1])&&(this.endDate=t[1])):(0,s.default)(t)&&(this.startDate=t)},dateFormat:function(e){return(0,u.default)(e).format(this.format)},setText:function(){this.startDate&&this.endDate?this.text=this.dateFormat(this.startDate)+" - "+this.dateFormat(this.endDate):this.startDate&&(this.text=this.dateFormat(this.startDate))},timeChange:function(e){this.dateValue=e,this.setDate(e),this.setText()},poperShow:function(){this.$emit("on-show"),this.$refs.xTime.setScrollTop()},poperHide:function(){this.change(),this.$emit("on-hide")},poperDoClose:function(){this.$refs.timepickerPoptip.doClose()},empty:function(){this.poperDoClose(),this.text="",this.startDate=null,this.endDate=null,this.dateValue=null,this.$refs.xTime.init(this.startDate,this.endDate),this.$emit("on-clear")},fmtDateValue:function(){var e=this,t=[];return"array"===(0,l.default)(this.dateValue)?this.dateValue.forEach(function(n){t.push(e.dateFormat(n))}):t=this.dateFormat(this.dateValue),t},change:function(){this.dateValue&&this.dateValue.toString()!==this.dateValueBar.toString()&&(this.$emit("on-change",this.fmtDateValue(),this.dateValue),this.dateValueBar=this.dateValue)}}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(124),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r=n(0);t.default={name:"xProgress",data:function(){return{wrapperClass:r.LIB_NAME+"-progress"}},props:{percentage:{type:Number,default:0,required:!0,validator:function(e){return e>=0&&e<=100}},type:{type:String,default:"line",validator:function(e){return["line","circle"].includes(e)}},strokeWidth:{type:Number,default:8},status:{type:String,validator:function(e){return["success","exception"].includes(e)}},color:String,width:{type:Number,default:100},showInlineText:{type:Boolean,default:!1},showOutsideText:{type:Boolean,default:!0},showCircleText:{type:Boolean,default:!0}},computed:{lineType:function(){return"line"===this.type},graphStyles:function(){var e=this.strokeWidth+"px";if(this.lineType)return{height:e,"border-radius":e};var t=this.width+"px";return{width:t,height:t}},percentageStyles:function(){if(this.lineType){var e={width:this.percentage+"%","border-radius":this.strokeWidth+"px"};return this.color&&(e.background=this.color),e}var t=2*Math.PI*this.radius,n={"stroke-dasharray":t+"px","stroke-dashoffset":t*(1-.01*this.percentage)+"px"};return this.color&&(n.stroke=this.color),n},halfWidth:function(){return this.width?.5*this.width:0},radius:function(){return this.halfWidth-.5*this.strokeWidth},percentagePath:function(){var e=this.halfWidth,t=this.radius;return"M "+e+","+e+" m 0,"+-t+" a "+t+" "+t+" 0 1 1 0 "+2*t+" a "+t+" "+t+" 0 1 1 0 "+-2*t}}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(126),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r="function"==typeof Symbol&&"symbol"==s(Symbol.iterator)?function(e){return void 0===e?"undefined":s(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":s(e)},i=n(0),o=p(n(68)),a=n(79),l=p(n(297)),u=p(n(298)),c=p(n(299)),d=p(n(305)),f=p(n(5)),h=n(4);function p(e){return e&&e.__esModule?e:{default:e}}f.default.directive("spin",o.default);var m=1;t.default={name:"xTable",components:{xTableBody:c.default,xTableHeader:d.default,xScroller:a.xScroller},data:function(){var e=new l.default(this);return{store:e,layout:new u.default({store:e,table:this,fit:this.fit,showHeader:this.showHeader}),multiLayerHeader:!1,resizeState:{width:null,height:null},activeAffix:!1,defaultAffixDistance:0,affixHeaderWidth:"",isScrollXStart:!0,isScrollXEnd:!1,expendRender:null,resizeProxyVisible:!1,windowScrolled:!1,scrollerDisabled:!1}},props:{data:{type:Array,default:function(){return[]}},defaultColumnWidth:{type:Number,default:80},fit:{type:Boolean,default:!0},stripe:Boolean,border:Boolean,height:[String,Number],restrict:{type:Boolean,default:!1},affix:[Boolean,Number],emptyText:{tepe:String,default:function(){return(0,h.t)("ans.table.emptyText")}},defaultSort:Object,defaultSortOrders:Array,defaultExpandAll:{type:Boolean,default:!1},expandRowKeys:Array,cellSpanMethod:Function,rowKey:String,reserveStates:{type:Boolean,default:!1},childrenProp:{type:String,default:"children"},defaultUnfoldChildren:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!0},internalPaging:{type:Boolean,default:!1},rowLimit:{type:Number,default:100},pagingActiveDistance:{type:Number,default:300},reverseScrollY:{type:Boolean,default:!1},scrollBarClass:String},computed:{hasBorder:function(){return this.border||this.multiLayerHeader},wrapperClasses:function(){var e;return[i.LIB_NAME+"-table",(e={},e[i.LIB_NAME+"-table--border"]=this.hasBorder,e),{"scrollable-x":this.layout.scrollX},{"scrollable-y":this.layout.scrollY},{"affix-table-header":this.affix}]},bodyHeight:function(){return this.height||this.restrict?{height:this.layout.bodyHeight?this.layout.bodyHeight+"px":""}:{}},fixedBodyHeight:function(){if(this.height||this.restrict){var e=this.layout.bodyHeight;return{height:e?e+"px":""}}return{}},fixedLeftHeaderStyles:function(){return this.activeAffix?{width:this.layout.fixedLeftWidth+"px",position:"fixed",top:this.affixDistance+"px"}:null},fixedRightHeaderStyles:function(){return this.activeAffix?{width:this.layout.fixedRightWidth+"px",position:"fixed",top:this.affixDistance+"px"}:null},bodyWidth:function(){var e=this.layout.bodyWidth;return e?e+"px":""},shouldUpdateHeight:function(){return this.height||this.restrict||this.fixedLeftColumns.length>0||this.fixedRightColumns.length>0},affixDistance:function(){return"number"==typeof this.affix?this.affix:this.defaultAffixDistance},bodyTopMargin:function(){return this.showHeader&&this.activeAffix?this.$refs.headerWrapper.offsetHeight+"px":0},fixedLeftColumns:function(){return this.store.states.fixedLeftColumns},fixedRightColumns:function(){return this.store.states.fixedRightColumns},bodyScrollbarClass:function(){return this.scrollBarClass?this.scrollBarClass+" table-body-scroller":"table-body-scroller"}},watch:{data:{immediate:!0,handler:function(e){var t=this;this.store.setData(e),this.$ready&&this.$nextTick(function(){t.doLayout()})}},expandRowKeys:{immediate:!0,handler:function(e){e&&this.store.setExpandRowKeys(e)}},height:{immediate:!0,handler:function(e){this.layout.setHeight(e)}},multiLayerHeader:function(){var e=this;this.$nextTick(function(){return e.doLayout()})}},methods:{setScrollPosition:function(e){["left","right"].includes(e)&&!this.layout.scrollX?e="left":["top","bottom"].includes(e)&&!this.layout.scrollY&&(e="top"),"left"===e?(this.$refs.headerScroller&&this.$refs.headerScroller.stickToBoundary(!1,!0,!1),this.$refs.scroller.stickToBoundary(!1,!0,!1),this.isScrollXStart=!0,this.isScrollXEnd=!1):"right"===e?(this.$refs.headerScroller&&this.$refs.headerScroller.stickToBoundary(!1,!1,!1),this.$refs.scroller.stickToBoundary(!1,!1,!1),this.isScrollXStart=!1,this.isScrollXEnd=!0):"top"===e?(this.$refs.fixedLeftScroller&&this.$refs.fixedLeftScroller.stickToBoundary(!0,!0,!1),this.$refs.fixedRightScroller&&this.$refs.fixedRightScroller.stickToBoundary(!0,!0,!1),this.$refs.scroller.stickToBoundary(!0,!0,!1)):"bottom"===e&&(this.$refs.fixedLeftScroller&&this.$refs.fixedLeftScroller.stickToBoundary(!0,!1,!1),this.$refs.fixedRightScroller&&this.$refs.fixedRightScroller.stickToBoundary(!0,!1,!1),this.$refs.scroller.stickToBoundary(!0,!1,!1))},toggleAllSelection:function(){this.store.toggleAllSelection()},toggleRowSelection:function(e,t){this.store.toggleRowSelection(e,t)},clearSelection:function(){this.store.clearSelection()},toggleRowExpansion:function(e,t){this.store.toggleRowExpansion(e,t)},toggleRowUnfolding:function(e,t){this.store.toggleRowUnfolding(e,t)},clearSort:function(){this.store.clearSort()},sort:function(e,t){this.store.sort(e,t)},bindEvent:function(){(this.affix||this.internalPaging)&&window.addEventListener("scroll",this.windowScrollListener),this.fit&&window.addEventListener("resize",this.resizeListener)},handleStartDragBar:function(e){e?(this.$refs.fixedLeftScroller&&(this.$refs.fixedLeftScroller.bodyDragging=!0),this.$refs.fixedRightScroller&&(this.$refs.fixedRightScroller.bodyDragging=!0)):this.$refs.headerScroller.bodyDragging=!0},handleEndDragBar:function(e){e?(this.$refs.fixedLeftScroller&&(this.$refs.fixedLeftScroller.bodyDragging=!1),this.$refs.fixedRightScroller&&(this.$refs.fixedRightScroller.bodyDragging=!1)):this.$refs.headerScroller.bodyDragging=!1},handleHeaderScrollX:function(e){this.isScrollXStart=!1,this.isScrollXEnd=!1,this.layout.scrollX&&this.$refs.scroller.setContentLeft(e)},handleFixedScrollY:function(e){this.$refs.scroller.setContentTop(e),this.$refs.fixedLeftScroller&&this.$refs.fixedLeftScroller.setContentTop(e),this.$refs.fixedRightScroller&&this.$refs.fixedRightScroller.setContentTop(e)},windowScrollListener:function(){if(this.affix){var e=this.$el.getBoundingClientRect();this.activeAffix=e.topthis.$refs.headerWrapper.offsetHeight,this.updateAffixHeaderWidth()}if(this.windowScrolled&&!this.layout.scrollY&&this.store.states.paging){var t=this.$refs.bodyWrapper,n=t.getBoundingClientRect().top;n+t.clientHeight-this.pagingActiveDistance&&(this.layout.slicing||this.store.prevPage())}this.windowScrolled=!0},handleBodyScrollX:function(e){this.isScrollXStart=!1,this.isScrollXEnd=!1,this.showHeader&&this.$refs.headerScroller.setContentLeft(e)},handleBodyScrollY:function(e){this.$refs.fixedLeftScroller&&this.$refs.fixedLeftScroller.setContentTop(e),this.$refs.fixedRightScroller&&this.$refs.fixedRightScroller.setContentTop(e)},handleBodyScrollXStart:function(){this.isScrollXStart=!0,this.$emit("on-hit","left")},handleBodyScrollXEnd:function(){this.isScrollXEnd=!0,this.$emit("on-hit","right")},handleBodyScrollYStart:function(){this.store.states.paging&&(this.layout.slicing||this.store.prevPage()),this.$emit("on-hit","top")},handleBodyScrollYEnd:function(){this.store.states.paging&&(this.layout.slicing||this.store.nextPage()),this.$emit("on-hit","bottom")},resizeListener:function(){if(this.$ready){var e=!1,t=this.$el,n=this.resizeState,r=n.width,i=n.height,o=t.offsetWidth;r!==o&&(e=!0);var a=t.offsetHeight;(this.height||this.shouldUpdateHeight)&&i!==a&&(e=!0),e&&(this.resizeState.width=o,this.resizeState.height=a,this.doLayout())}},doLayout:function(e){this.layout.updateColumnsWidth(),this.affix&&this.updateAffixHeaderWidth(),(e||this.shouldUpdateHeight)&&this.layout.updateElsHeight()},updateAffixHeaderWidth:function(){this.affixHeaderWidth=this.activeAffix?this.$el.clientWidth+"px":""},checkScrollPosition:function(){var e=this;this.store.states.hasFixedTable&&this.isScrollXEnd&&this.$nextTick(function(){e.$refs.headerScroller.stickToBoundary(!1,!1,!1),e.$refs.scroller.stickToBoundary(!1,!1,!1)})},checkScrollable:function(){this.$refs.scroller&&this.$refs.scroller.checkScrollable(),this.$refs.headerScroller&&this.$refs.headerScroller.checkScrollable(),this.$refs.fixedLeftScroller&&this.$refs.fixedLeftScroller.checkScrollable(),this.$refs.fixedRightScroller&&this.$refs.fixedRightScroller.checkScrollable()},moveBodyTopByDiff:function(e){var t=this.$refs.scroller.currentTop-e;this.setBodyTop(t)},setBodyTop:function(e){this.$refs.scroller.setContentTop(e,!1),this.$refs.fixedLeftScroller&&this.$refs.fixedLeftScroller.setContentTop(e,!1),this.$refs.fixedRightScroller&&this.$refs.fixedRightScroller.setContentTop(e,!1)},windowLoadListener:function(){this.doLayout()}},created:function(){if(this.tableId=i.LIB_NAME+"-table_"+m++,this.internalPaging&&!this.rowKey)throw new Error("Table: Prop row-key should not be empty when internal-paging enabled.");window.addEventListener("load",this.windowLoadListener)},mounted:function(){var e=this;this.resizeState={width:this.$el.offsetWidth,height:this.$el.offsetHeight},this.$nextTick(function(){e.$ready=!0,e.store.updateColumns(),e.doLayout(!0),e.defaultSort&&"object"===r(e.defaultSort)&&e.sort(e.defaultSort.prop,e.defaultSort.order),e.bindEvent()})},destroyed:function(){window.removeEventListener("load",this.windowLoadListener),window.removeEventListener("scroll",this.windowScrollListener),window.removeEventListener("resize",this.resizeListener)}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(128),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r=n(0),i=s(n(302)),o=s(n(34)),a=s(n(131));function s(e){return e&&e.__esModule?e:{default:e}}t.default={name:"xTableBody",components:{xTableTd:i.default,xCellRenderer:o.default},mixins:[a.default],data:function(){return{wrapperClass:r.LIB_NAME+"-table-body"}},computed:{table:function(){return this.store.table},data:function(){return this.store.states.data},columns:function(){return this.store.states.columns},leafColumns:function(){return this.store.states.leafColumns},colColumns:function(){return this.table.multiLayerHeader?this.leafColumns:this.columns},firstTextColumnIndex:function(){return this.colColumns.findIndex(function(e){return"default"===e.type})},expandable:function(){return this.store.states.expandable},expandRows:function(){return this.store.states.expandRows}},props:{store:{required:!0},stripe:Boolean,border:Boolean,fixed:String},watch:{"store.states.hoverRowIndex":function(e,t){if(this.store.states.hasFixedTable){var n=this.$el;if(n){var i=n.querySelectorAll(".table-row"),o=i[t],a=i[e];o&&(0,r.removeClass)(o,"hover-state"),a&&(0,r.addClass)(a,"hover-state")}}}},methods:{getRowKey:function(e,t){if(!t)throw new Error("Table Body: Find invalid row!");var n=this.table.rowKey;return n?(0,r.getValueByPath)(t,n):e},getRowClasses:function(e){var t=[];return this.stripe&&t.push(e%2==1?"striped-row":"no-striped-row"),t},getCellClasses:function(e){return{"right-border":this.border,"bottom-border":this.border||!this.stripe,"transparent-border":this.fixed&&e}},handleMouseEnter:function(e){this.store.commit("setHoverRowIndex",e)},handleMouseLeave:function(){this.store.commit("setHoverRowIndex",null)}}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(130),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r,i="function"==typeof Symbol&&"symbol"==s(Symbol.iterator)?function(e){return void 0===e?"undefined":s(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":s(e)},o=n(31),a=(r=n(34))&&r.__esModule?r:{default:r},l=n(0);t.default={name:"xTableTd",components:{xCheckbox:o.xCheckbox,xCellRenderer:a.default},props:{store:{required:!0},row:{required:!0},column:{required:!0},rowIndex:{required:!0},columnIndex:{required:!0},first:Boolean,fixed:String},data:function(){return{rowspan:1,colspan:1}},computed:{table:function(){return this.store.table},visible:function(){return this.rowspan||this.colspan},selection:function(){return this.store.states.selection},expandRows:function(){return this.store.states.expandRows},showUnfoldIcon:function(){return this.store.states.treeType&&this.store.states.parentRows.includes(this.row)&&this.first},unfold:function(){return this.store.states.unfoldedRows.includes(this.row)},sortingColumn:function(){return this.store.states.sortingColumn},contentClasses:function(){var e="align-"+this.column.align;return this.store.states.treeType&&this.first&&(e+=" row-level-"+this.row.__level),e}},methods:{getCellContent:function(){var e=this.row,t=this.column,n=this.rowIndex,r=this.columnIndex,i=(0,l.getValueByPath)(e,t.prop);return t.formatter?t.formatter(e,t,i,n,r):i}},created:function(){var e=this.table.cellSpanMethod,t=this.row,n=this.column,r=this.rowIndex,o=this.columnIndex;if(e){var a=e({row:t,column:n,rowIndex:r,columnIndex:o}),s=void 0,l=void 0;Array.isArray(a)?(s=a[0],l=a[1]):"object"===(void 0===a?"undefined":i(a))&&(s=a.rowspan,l=a.colspan),this.colspan=l,this.rowspan=s}}}},function(e,t,n){t.__esModule=!0,t.default={created:function(){this.tableLayout.addObserver(this)},destroyed:function(){this.tableLayout.removeObserver(this)},computed:{tableLayout:function(){var e=this.layout;if(!e&&this.table&&(e=this.table.layout),!e)throw new Error("Layout Observer: Can't find table layout.");return e}},methods:{onColumnsChange:function(){var e=this.$el.querySelectorAll("colgroup > col");if(e.length){var t={};this.store.states.leafColumns.forEach(function(e){t[e.id]=e});for(var n=0,r=e.length;n1,this.table.multiLayerHeader=this.multiLayer}}},methods:{getCellClasses:function(e){return{"right-border":this.border,"bottom-border":this.border,"transparent-border":this.fixed&&e}}}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(135),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r,i=n(31),o=(r=n(34))&&r.__esModule?r:{default:r};t.default={name:"xTableTh",components:{xCheckbox:i.xCheckbox,xCellRenderer:o.default},props:{store:{required:!0},column:{required:!0},columnIndex:{required:!0},border:Boolean,rowspan:Number,colspan:Number,fixed:String},computed:{table:function(){return this.store.table},sortingColumn:function(){return this.store.states.sortingColumn},sortOrder:function(){return this.store.states.sortOrder},dragging:function(){return this.store.states.dragging},draggingColumn:function(){return this.store.states.draggingColumn},currentDragModel:function(){return this.store.states.dragModel},alignClass:function(){return"align-"+this.column.headerAlign}},methods:{handleMouseDown:function(e,t){var n=this;if(!(t.children&&t.children.length>0)&&this.draggingColumn&&this.border){var r=this.table,i=this.store;i.commit("setDraggingState",!0),r.resizeProxyVisible=!0;var o=r.$el.getBoundingClientRect().left,a=this.$el.getBoundingClientRect(),s=a.left-o+t.minWidth,l={startMouseLeft:e.clientX,startLeft:e.clientX-o,startColumnLeft:a.left-o};i.commit("setDragModel",l);var u=r.$refs.resizeProxy;u.style.left=l.startLeft+"px",document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};var c=function(e){var t=e.clientX-n.currentDragModel.startMouseLeft,r=n.currentDragModel.startLeft+t;u.style.left=Math.max(s,r)+"px"};document.addEventListener("mousemove",c),document.addEventListener("mouseup",function e(){if(n.dragging){var o=n.currentDragModel.startColumnLeft,a=parseInt(u.style.left,10)-o;t.width=t.currentWidth=a,r.doLayout(),document.body.style.cursor="",i.commit("setDraggingState",!1),i.commit("setDraggingColumn",null),i.commit("setDragModel",{}),r.resizeProxyVisible=!1,r.checkScrollPosition()}document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",e),document.onselectstart=null,document.ondragstart=null})}},handleMouseMove:function(e,t){if(!(t.children&&t.children.length>0)&&t&&t.resizable){var n=this.$el;if(!this.dragging&&this.border){var r=n.getBoundingClientRect(),i=document.body.style;r.right-e.pageX<8?(i.cursor="col-resize",this.store.commit("setDraggingColumn",t)):this.dragging||(i.cursor="",this.store.commit("setDraggingColumn",null))}}},handleMouseOut:function(){this.dragging||(document.body.style.cursor="")}}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(137),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r=1,i={default:{order:""},selection:{width:38,minWidth:38},expand:{width:38,minWidth:38}};t.default={name:"xTableColumn",props:{type:{type:String,default:"default"},label:String,prop:String,width:[Number,String],fixed:[Boolean,String],sortable:{type:[String,Boolean],default:!1},sortMethod:Function,sortOrders:Array,resizable:{type:Boolean,default:!0},formatter:Function,align:{type:String,validator:function(e){return["left","center","right"].includes(e)},default:"left"},headerAlign:{type:String,validator:function(e){return["left","center","right"].includes(e)},default:"left"}},computed:{owner:function(){for(var e=this.$parent;e&&!e.tableId;)e=e.$parent;return e},columnOrTableParent:function(){for(var e=this.$parent;e&&!e.tableId&&!e.columnId;)e=e.$parent;return e}},watch:{label:function(e){this.columnConfig&&(this.columnConfig.label=e)},prop:function(e){this.columnConfig&&(this.columnConfig.prop=e)},width:function(e){this.columnConfig&&(this.columnConfig.width="string"==typeof e?parseInt(e):e,this.owner.doLayout())},fixed:function(e){this.columnConfig&&(this.columnConfig.fixed=e,this.owner.store.updateColumns(),this.owner.doLayout())},sortable:function(e){this.columnConfig&&(this.columnConfig.sortable=e)}},created:function(){var e=this.owner,t=this.columnOrTableParent;this.isSubColumn=e!==t,this.columnId=(t.tableId||t.columnId)+"_column_"+r++,i.default.minWidth=this.owner.defaultColumnWidth,this.columnConfig=function(e,t){var n=Object.assign({},i[e||"default"]);for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];void 0!==o&&(n[r]=o)}return void 0!==n.width&&(n.width=parseInt(n.width)),n.currentWidth=n.width||n.minWidth,n}(this.type,{id:this.columnId,type:this.type,label:this.label,prop:this.prop,width:this.width,fixed:this.fixed,sortable:""===this.sortable||this.sortable,sortMethod:this.sortMethod,sortOrders:this.sortOrders,resizable:this.resizable,formatter:this.formatter,align:this.align,headerAlign:this.headerAlign})},mounted:function(){var e,t=this.owner,n=this.columnOrTableParent,r=this.isSubColumn,i=this.type,o=this.columnConfig,a=this.$el,s=this.$scopedSlots;if(e=r?[].indexOf.call(n.$el.children,a):[].indexOf.call(n.$refs.hiddenContent.children,a),s.header){if("selection"===i)throw new Error("Table Column: Selection column doesn't allow to set scoped-slot header.");o.customHeader=function(e,t){return s.header(t)}}s.content&&(o.customRender=function(e,t){return s.content(t)}),s.expand&&(t.expendRender=function(e,t){return s.expand(t)}),s.prepend&&(o.prependHeader=function(e,t){return s.prepend(t)}),s.append&&(o.appendHeader=function(e,t){return s.append(t)}),s.headerText&&(o.headerText=function(e,t){return s.headerText(t)}),t.store.commit("insertColumn",o,e,r?n.columnConfig:null)},destroyed:function(){if(this.$parent){var e=this.$parent;this.owner.store.commit("removeColumn",this.columnConfig,this.isSubColumn?e.columnConfig:null)}}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(139),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r=n(0).LIB_NAME+"-form";t.default={name:"xForm",props:{model:{type:Object},rules:{type:Object},labelWidth:{type:[Number,String]},labelHeight:{type:[Number,String]}},provide:function(){return{form:this}},data:function(){return{fields:[]}},computed:{wrapClasses:function(){return[""+r]}},methods:{resetFields:function(){this.fields.forEach(function(e){e.resetField()})},validate:function(e){var t=this;return new Promise(function(n){var r=!0,i=0;t.fields.forEach(function(o){o.validate("",function(o){o&&(r=!1),++i===t.fields.length&&(n(r),"function"==typeof e&&e(r))})})})},validateField:function(e,t){var n=this.fields.filter(function(t){return t.prop===e})[0];if(!n)throw new Error("请校验有效的prop");n.validate("",t)}},created:function(){var e=this;this.$on("on-form-item-add",function(t){t&&e.fields.push(t)}),this.$on("on-form-item-remove",function(t){t.prop&&e.fields.splice(e.fields.indexOf(t),1)})}}},function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(141),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);t.default=i.a},function(e,t,n){t.__esModule=!0;var r,i=n(0),o=(r=n(321))&&r.__esModule?r:{default:r},a=i.LIB_NAME+"-form-item";function s(e,t){for(var n=e,r=(t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split("."),i=0,o=r.length;i1&&void 0!==arguments[1]?arguments[1]:function(){},r=this.getFilteredRule(e);if(!r||!r.length){if(!this.required)return n(),!0;r=[{required:!0}]}this.validateState="validating";var i={};i[this.prop]=r;var a=new o.default(i),s={};s[this.prop]=this.fieldValue,a.validate(s,{firstFields:!0},function(e){t.validateState=e?"error":"success",t.validateMessage=e?e[0].message:"",n(t.validateMessage)}),this.validateDisabled=!1},onFieldBlur:function(){this.validate("blur")},onFieldChange:function(){this.validateDisabled?this.validateDisabled=!1:this.validate("change")},resetField:function(){this.validateState="",this.validateMessage="";var e=this.form.model,t=this.fieldValue,n=this.prop;~n.indexOf(":")&&(n=n.replace(/:/,"."));var r=s(e,n);this.validateDisabled=!0,Array.isArray(t)?r.o[r.k]=[].concat(this.initialValue):r.o[r.k]=this.initialValue}},mounted:function(){if(this.prop){this.dispatch("xForm","on-form-item-add",this);var e=this.fieldValue;Array.isArray(e)&&(e=[].concat(e)),Object.defineProperty(this,"initialValue",{value:e}),(this.getRules().length||void 0!==this.required)&&(this.$on("on-form-blur",this.onFieldBlur),this.$on("on-form-change",this.onFieldChange),this.$slots.input&&this.$slots.input[0].elm.addEventListener("blur",this.onFieldBlur),this.$slots.select&&this.$slots.select[0].elm.addEventListener("blur",this.onFieldBlur),this.$slots.select&&this.$slots.select[0].elm.addEventListener("change",this.onFieldChange))}},beforeDestroy:function(){this.dispatch("xForm","on-form-item-remove",this)}}},function(e,t,n){t.__esModule=!0;var r,i=(r=n(322))&&r.__esModule?r:{default:r};t.default=i.default||function(e){for(var t=1;tl;)r(s,n=t[l++])&&(~o(u,n)||u.push(n));return u}},function(e,t,n){var r=n(147);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(37);e.exports=function(e){return Object(r(e))}},function(e,t,n){var r=n(25),i=n(35),o=n(150),a=n(10),s=n(43),l=n(335),u=n(44),c=n(338),d=n(14)("iterator"),f=!([].keys&&"next"in[].keys()),h=function(){return this};e.exports=function(e,t,n,p,m,v,g){l(n,t,p);var b,y,x,w=function(e){if(!f&&e in k)return k[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},_=t+" Iterator",C="values"==m,S=!1,k=e.prototype,D=k[d]||k["@@iterator"]||m&&k[m],O=D||w(m),M=m?C?w("entries"):O:void 0,T="Array"==t&&k.entries||D;if(T&&(x=c(T.call(new e)))!==Object.prototype&&x.next&&(u(x,_,!0),r||"function"==typeof x[d]||a(x,d,h)),C&&D&&"values"!==D.name&&(S=!0,O=function(){return D.call(this)}),r&&!g||!f&&!S&&k[d]||a(k,d,O),s[t]=O,s[_]=h,m)if(b={values:C?O:w("values"),keys:v?O:w("keys"),entries:M},g)for(y in b)y in k||o(k,y,b[y]);else i(i.P+i.F*(f||S),t,b);return b}},function(e,t,n){e.exports=n(10)},function(e,t,n){var r=n(22),i=n(336),o=n(41),a=n(39)("IE_PROTO"),s=function(){},l=function(){var e,t=n(144)("iframe"),r=o.length;for(t.style.display="none",n(337).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("\n\n\n\n// WEBPACK FOOTER //\n// src/js/conf/home/App.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/layout/layout.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/nav/nav.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/fileUpdate/fileUpdate.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/popup/popup.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listBoxF/listBoxF.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-b411cdf2\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./progressBar.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./progressBar.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./progressBar.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-b411cdf2\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./progressBar.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/progressBar/progressBar.vue\n// module id = 136\n// module chunks = 39","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/progressBar/progressBar.vue","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _echarts = require(\"./lib/echarts\");\n\n(function () {\n for (var key in _echarts) {\n if (_echarts == null || !_echarts.hasOwnProperty(key) || key === 'default' || key === '__esModule') return;\n exports[key] = _echarts[key];\n }\n})();\n\nvar _export = require(\"./lib/export\");\n\n(function () {\n for (var key in _export) {\n if (_export == null || !_export.hasOwnProperty(key) || key === 'default' || key === '__esModule') return;\n exports[key] = _export[key];\n }\n})();\n\nrequire(\"./lib/component/dataset\");\n\nrequire(\"./lib/chart/line\");\n\nrequire(\"./lib/chart/bar\");\n\nrequire(\"./lib/chart/pie\");\n\nrequire(\"./lib/chart/scatter\");\n\nrequire(\"./lib/chart/radar\");\n\nrequire(\"./lib/chart/map\");\n\nrequire(\"./lib/chart/tree\");\n\nrequire(\"./lib/chart/treemap\");\n\nrequire(\"./lib/chart/graph\");\n\nrequire(\"./lib/chart/gauge\");\n\nrequire(\"./lib/chart/funnel\");\n\nrequire(\"./lib/chart/parallel\");\n\nrequire(\"./lib/chart/sankey\");\n\nrequire(\"./lib/chart/boxplot\");\n\nrequire(\"./lib/chart/candlestick\");\n\nrequire(\"./lib/chart/effectScatter\");\n\nrequire(\"./lib/chart/lines\");\n\nrequire(\"./lib/chart/heatmap\");\n\nrequire(\"./lib/chart/pictorialBar\");\n\nrequire(\"./lib/chart/themeRiver\");\n\nrequire(\"./lib/chart/sunburst\");\n\nrequire(\"./lib/chart/custom\");\n\nrequire(\"./lib/component/graphic\");\n\nrequire(\"./lib/component/grid\");\n\nrequire(\"./lib/component/legendScroll\");\n\nrequire(\"./lib/component/tooltip\");\n\nrequire(\"./lib/component/axisPointer\");\n\nrequire(\"./lib/component/polar\");\n\nrequire(\"./lib/component/geo\");\n\nrequire(\"./lib/component/parallel\");\n\nrequire(\"./lib/component/singleAxis\");\n\nrequire(\"./lib/component/brush\");\n\nrequire(\"./lib/component/calendar\");\n\nrequire(\"./lib/component/title\");\n\nrequire(\"./lib/component/dataZoom\");\n\nrequire(\"./lib/component/visualMap\");\n\nrequire(\"./lib/component/markPoint\");\n\nrequire(\"./lib/component/markLine\");\n\nrequire(\"./lib/component/markArea\");\n\nrequire(\"./lib/component/timeline\");\n\nrequire(\"./lib/component/toolbox\");\n\nrequire(\"zrender/lib/vml/vml\");\n\nrequire(\"zrender/lib/svg/svg\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/index.js\n// module id = 138\n// module chunks = 39","/**\n * zrender: 生成唯一id\n *\n * @author errorrik (errorrik@gmail.com)\n */\nvar idStart = 0x0907;\n\nfunction _default() {\n return idStart++;\n}\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/core/guid.js\n// module id = 139\n// module chunks = 39","var guid = require(\"./core/guid\");\n\nvar Eventful = require(\"./mixin/Eventful\");\n\nvar Transformable = require(\"./mixin/Transformable\");\n\nvar Animatable = require(\"./mixin/Animatable\");\n\nvar zrUtil = require(\"./core/util\");\n\n/**\n * @alias module:zrender/Element\n * @constructor\n * @extends {module:zrender/mixin/Animatable}\n * @extends {module:zrender/mixin/Transformable}\n * @extends {module:zrender/mixin/Eventful}\n */\nvar Element = function (opts) {\n // jshint ignore:line\n Transformable.call(this, opts);\n Eventful.call(this, opts);\n Animatable.call(this, opts);\n /**\n * 画布元素ID\n * @type {string}\n */\n\n this.id = opts.id || guid();\n};\n\nElement.prototype = {\n /**\n * 元素类型\n * Element type\n * @type {string}\n */\n type: 'element',\n\n /**\n * 元素名字\n * Element name\n * @type {string}\n */\n name: '',\n\n /**\n * ZRender 实例对象,会在 element 添加到 zrender 实例中后自动赋值\n * ZRender instance will be assigned when element is associated with zrender\n * @name module:/zrender/Element#__zr\n * @type {module:zrender/ZRender}\n */\n __zr: null,\n\n /**\n * 图形是否忽略,为true时忽略图形的绘制以及事件触发\n * If ignore drawing and events of the element object\n * @name module:/zrender/Element#ignore\n * @type {boolean}\n * @default false\n */\n ignore: false,\n\n /**\n * 用于裁剪的路径(shape),所有 Group 内的路径在绘制时都会被这个路径裁剪\n * 该路径会继承被裁减对象的变换\n * @type {module:zrender/graphic/Path}\n * @see http://www.w3.org/TR/2dcontext/#clipping-region\n * @readOnly\n */\n clipPath: null,\n\n /**\n * 是否是 Group\n * @type {boolean}\n */\n isGroup: false,\n\n /**\n * Drift element\n * @param {number} dx dx on the global space\n * @param {number} dy dy on the global space\n */\n drift: function (dx, dy) {\n switch (this.draggable) {\n case 'horizontal':\n dy = 0;\n break;\n\n case 'vertical':\n dx = 0;\n break;\n }\n\n var m = this.transform;\n\n if (!m) {\n m = this.transform = [1, 0, 0, 1, 0, 0];\n }\n\n m[4] += dx;\n m[5] += dy;\n this.decomposeTransform();\n this.dirty(false);\n },\n\n /**\n * Hook before update\n */\n beforeUpdate: function () {},\n\n /**\n * Hook after update\n */\n afterUpdate: function () {},\n\n /**\n * Update each frame\n */\n update: function () {\n this.updateTransform();\n },\n\n /**\n * @param {Function} cb\n * @param {} context\n */\n traverse: function (cb, context) {},\n\n /**\n * @protected\n */\n attrKV: function (key, value) {\n if (key === 'position' || key === 'scale' || key === 'origin') {\n // Copy the array\n if (value) {\n var target = this[key];\n\n if (!target) {\n target = this[key] = [];\n }\n\n target[0] = value[0];\n target[1] = value[1];\n }\n } else {\n this[key] = value;\n }\n },\n\n /**\n * Hide the element\n */\n hide: function () {\n this.ignore = true;\n this.__zr && this.__zr.refresh();\n },\n\n /**\n * Show the element\n */\n show: function () {\n this.ignore = false;\n this.__zr && this.__zr.refresh();\n },\n\n /**\n * @param {string|Object} key\n * @param {*} value\n */\n attr: function (key, value) {\n if (typeof key === 'string') {\n this.attrKV(key, value);\n } else if (zrUtil.isObject(key)) {\n for (var name in key) {\n if (key.hasOwnProperty(name)) {\n this.attrKV(name, key[name]);\n }\n }\n }\n\n this.dirty(false);\n return this;\n },\n\n /**\n * @param {module:zrender/graphic/Path} clipPath\n */\n setClipPath: function (clipPath) {\n var zr = this.__zr;\n\n if (zr) {\n clipPath.addSelfToZr(zr);\n } // Remove previous clip path\n\n\n if (this.clipPath && this.clipPath !== clipPath) {\n this.removeClipPath();\n }\n\n this.clipPath = clipPath;\n clipPath.__zr = zr;\n clipPath.__clipTarget = this;\n this.dirty(false);\n },\n\n /**\n */\n removeClipPath: function () {\n var clipPath = this.clipPath;\n\n if (clipPath) {\n if (clipPath.__zr) {\n clipPath.removeSelfFromZr(clipPath.__zr);\n }\n\n clipPath.__zr = null;\n clipPath.__clipTarget = null;\n this.clipPath = null;\n this.dirty(false);\n }\n },\n\n /**\n * Add self from zrender instance.\n * Not recursively because it will be invoked when element added to storage.\n * @param {module:zrender/ZRender} zr\n */\n addSelfToZr: function (zr) {\n this.__zr = zr; // 添加动画\n\n var animators = this.animators;\n\n if (animators) {\n for (var i = 0; i < animators.length; i++) {\n zr.animation.addAnimator(animators[i]);\n }\n }\n\n if (this.clipPath) {\n this.clipPath.addSelfToZr(zr);\n }\n },\n\n /**\n * Remove self from zrender instance.\n * Not recursively because it will be invoked when element added to storage.\n * @param {module:zrender/ZRender} zr\n */\n removeSelfFromZr: function (zr) {\n this.__zr = null; // 移除动画\n\n var animators = this.animators;\n\n if (animators) {\n for (var i = 0; i < animators.length; i++) {\n zr.animation.removeAnimator(animators[i]);\n }\n }\n\n if (this.clipPath) {\n this.clipPath.removeSelfFromZr(zr);\n }\n }\n};\nzrUtil.mixin(Element, Animatable);\nzrUtil.mixin(Element, Transformable);\nzrUtil.mixin(Element, Eventful);\nvar _default = Element;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/Element.js\n// module id = 140\n// module chunks = 39","var Clip = require(\"./Clip\");\n\nvar color = require(\"../tool/color\");\n\nvar _util = require(\"../core/util\");\n\nvar isArrayLike = _util.isArrayLike;\n\n/**\n * @module echarts/animation/Animator\n */\nvar arraySlice = Array.prototype.slice;\n\nfunction defaultGetter(target, key) {\n return target[key];\n}\n\nfunction defaultSetter(target, key, value) {\n target[key] = value;\n}\n/**\n * @param {number} p0\n * @param {number} p1\n * @param {number} percent\n * @return {number}\n */\n\n\nfunction interpolateNumber(p0, p1, percent) {\n return (p1 - p0) * percent + p0;\n}\n/**\n * @param {string} p0\n * @param {string} p1\n * @param {number} percent\n * @return {string}\n */\n\n\nfunction interpolateString(p0, p1, percent) {\n return percent > 0.5 ? p1 : p0;\n}\n/**\n * @param {Array} p0\n * @param {Array} p1\n * @param {number} percent\n * @param {Array} out\n * @param {number} arrDim\n */\n\n\nfunction interpolateArray(p0, p1, percent, out, arrDim) {\n var len = p0.length;\n\n if (arrDim === 1) {\n for (var i = 0; i < len; i++) {\n out[i] = interpolateNumber(p0[i], p1[i], percent);\n }\n } else {\n var len2 = len && p0[0].length;\n\n for (var i = 0; i < len; i++) {\n for (var j = 0; j < len2; j++) {\n out[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent);\n }\n }\n }\n} // arr0 is source array, arr1 is target array.\n// Do some preprocess to avoid error happened when interpolating from arr0 to arr1\n\n\nfunction fillArr(arr0, arr1, arrDim) {\n var arr0Len = arr0.length;\n var arr1Len = arr1.length;\n\n if (arr0Len !== arr1Len) {\n // FIXME Not work for TypedArray\n var isPreviousLarger = arr0Len > arr1Len;\n\n if (isPreviousLarger) {\n // Cut the previous\n arr0.length = arr1Len;\n } else {\n // Fill the previous\n for (var i = arr0Len; i < arr1Len; i++) {\n arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i]));\n }\n }\n } // Handling NaN value\n\n\n var len2 = arr0[0] && arr0[0].length;\n\n for (var i = 0; i < arr0.length; i++) {\n if (arrDim === 1) {\n if (isNaN(arr0[i])) {\n arr0[i] = arr1[i];\n }\n } else {\n for (var j = 0; j < len2; j++) {\n if (isNaN(arr0[i][j])) {\n arr0[i][j] = arr1[i][j];\n }\n }\n }\n }\n}\n/**\n * @param {Array} arr0\n * @param {Array} arr1\n * @param {number} arrDim\n * @return {boolean}\n */\n\n\nfunction isArraySame(arr0, arr1, arrDim) {\n if (arr0 === arr1) {\n return true;\n }\n\n var len = arr0.length;\n\n if (len !== arr1.length) {\n return false;\n }\n\n if (arrDim === 1) {\n for (var i = 0; i < len; i++) {\n if (arr0[i] !== arr1[i]) {\n return false;\n }\n }\n } else {\n var len2 = arr0[0].length;\n\n for (var i = 0; i < len; i++) {\n for (var j = 0; j < len2; j++) {\n if (arr0[i][j] !== arr1[i][j]) {\n return false;\n }\n }\n }\n }\n\n return true;\n}\n/**\n * Catmull Rom interpolate array\n * @param {Array} p0\n * @param {Array} p1\n * @param {Array} p2\n * @param {Array} p3\n * @param {number} t\n * @param {number} t2\n * @param {number} t3\n * @param {Array} out\n * @param {number} arrDim\n */\n\n\nfunction catmullRomInterpolateArray(p0, p1, p2, p3, t, t2, t3, out, arrDim) {\n var len = p0.length;\n\n if (arrDim === 1) {\n for (var i = 0; i < len; i++) {\n out[i] = catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3);\n }\n } else {\n var len2 = p0[0].length;\n\n for (var i = 0; i < len; i++) {\n for (var j = 0; j < len2; j++) {\n out[i][j] = catmullRomInterpolate(p0[i][j], p1[i][j], p2[i][j], p3[i][j], t, t2, t3);\n }\n }\n }\n}\n/**\n * Catmull Rom interpolate number\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} p3\n * @param {number} t\n * @param {number} t2\n * @param {number} t3\n * @return {number}\n */\n\n\nfunction catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {\n var v0 = (p2 - p0) * 0.5;\n var v1 = (p3 - p1) * 0.5;\n return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1;\n}\n\nfunction cloneValue(value) {\n if (isArrayLike(value)) {\n var len = value.length;\n\n if (isArrayLike(value[0])) {\n var ret = [];\n\n for (var i = 0; i < len; i++) {\n ret.push(arraySlice.call(value[i]));\n }\n\n return ret;\n }\n\n return arraySlice.call(value);\n }\n\n return value;\n}\n\nfunction rgba2String(rgba) {\n rgba[0] = Math.floor(rgba[0]);\n rgba[1] = Math.floor(rgba[1]);\n rgba[2] = Math.floor(rgba[2]);\n return 'rgba(' + rgba.join(',') + ')';\n}\n\nfunction getArrayDim(keyframes) {\n var lastValue = keyframes[keyframes.length - 1].value;\n return isArrayLike(lastValue && lastValue[0]) ? 2 : 1;\n}\n\nfunction createTrackClip(animator, easing, oneTrackDone, keyframes, propName, forceAnimate) {\n var getter = animator._getter;\n var setter = animator._setter;\n var useSpline = easing === 'spline';\n var trackLen = keyframes.length;\n\n if (!trackLen) {\n return;\n } // Guess data type\n\n\n var firstVal = keyframes[0].value;\n var isValueArray = isArrayLike(firstVal);\n var isValueColor = false;\n var isValueString = false; // For vertices morphing\n\n var arrDim = isValueArray ? getArrayDim(keyframes) : 0;\n var trackMaxTime; // Sort keyframe as ascending\n\n keyframes.sort(function (a, b) {\n return a.time - b.time;\n });\n trackMaxTime = keyframes[trackLen - 1].time; // Percents of each keyframe\n\n var kfPercents = []; // Value of each keyframe\n\n var kfValues = [];\n var prevValue = keyframes[0].value;\n var isAllValueEqual = true;\n\n for (var i = 0; i < trackLen; i++) {\n kfPercents.push(keyframes[i].time / trackMaxTime); // Assume value is a color when it is a string\n\n var value = keyframes[i].value; // Check if value is equal, deep check if value is array\n\n if (!(isValueArray && isArraySame(value, prevValue, arrDim) || !isValueArray && value === prevValue)) {\n isAllValueEqual = false;\n }\n\n prevValue = value; // Try converting a string to a color array\n\n if (typeof value === 'string') {\n var colorArray = color.parse(value);\n\n if (colorArray) {\n value = colorArray;\n isValueColor = true;\n } else {\n isValueString = true;\n }\n }\n\n kfValues.push(value);\n }\n\n if (!forceAnimate && isAllValueEqual) {\n return;\n }\n\n var lastValue = kfValues[trackLen - 1]; // Polyfill array and NaN value\n\n for (var i = 0; i < trackLen - 1; i++) {\n if (isValueArray) {\n fillArr(kfValues[i], lastValue, arrDim);\n } else {\n if (isNaN(kfValues[i]) && !isNaN(lastValue) && !isValueString && !isValueColor) {\n kfValues[i] = lastValue;\n }\n }\n }\n\n isValueArray && fillArr(getter(animator._target, propName), lastValue, arrDim); // Cache the key of last frame to speed up when\n // animation playback is sequency\n\n var lastFrame = 0;\n var lastFramePercent = 0;\n var start;\n var w;\n var p0;\n var p1;\n var p2;\n var p3;\n\n if (isValueColor) {\n var rgba = [0, 0, 0, 0];\n }\n\n var onframe = function (target, percent) {\n // Find the range keyframes\n // kf1-----kf2---------current--------kf3\n // find kf2 and kf3 and do interpolation\n var frame; // In the easing function like elasticOut, percent may less than 0\n\n if (percent < 0) {\n frame = 0;\n } else if (percent < lastFramePercent) {\n // Start from next key\n // PENDING start from lastFrame ?\n start = Math.min(lastFrame + 1, trackLen - 1);\n\n for (frame = start; frame >= 0; frame--) {\n if (kfPercents[frame] <= percent) {\n break;\n }\n } // PENDING really need to do this ?\n\n\n frame = Math.min(frame, trackLen - 2);\n } else {\n for (frame = lastFrame; frame < trackLen; frame++) {\n if (kfPercents[frame] > percent) {\n break;\n }\n }\n\n frame = Math.min(frame - 1, trackLen - 2);\n }\n\n lastFrame = frame;\n lastFramePercent = percent;\n var range = kfPercents[frame + 1] - kfPercents[frame];\n\n if (range === 0) {\n return;\n } else {\n w = (percent - kfPercents[frame]) / range;\n }\n\n if (useSpline) {\n p1 = kfValues[frame];\n p0 = kfValues[frame === 0 ? frame : frame - 1];\n p2 = kfValues[frame > trackLen - 2 ? trackLen - 1 : frame + 1];\n p3 = kfValues[frame > trackLen - 3 ? trackLen - 1 : frame + 2];\n\n if (isValueArray) {\n catmullRomInterpolateArray(p0, p1, p2, p3, w, w * w, w * w * w, getter(target, propName), arrDim);\n } else {\n var value;\n\n if (isValueColor) {\n value = catmullRomInterpolateArray(p0, p1, p2, p3, w, w * w, w * w * w, rgba, 1);\n value = rgba2String(rgba);\n } else if (isValueString) {\n // String is step(0.5)\n return interpolateString(p1, p2, w);\n } else {\n value = catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w);\n }\n\n setter(target, propName, value);\n }\n } else {\n if (isValueArray) {\n interpolateArray(kfValues[frame], kfValues[frame + 1], w, getter(target, propName), arrDim);\n } else {\n var value;\n\n if (isValueColor) {\n interpolateArray(kfValues[frame], kfValues[frame + 1], w, rgba, 1);\n value = rgba2String(rgba);\n } else if (isValueString) {\n // String is step(0.5)\n return interpolateString(kfValues[frame], kfValues[frame + 1], w);\n } else {\n value = interpolateNumber(kfValues[frame], kfValues[frame + 1], w);\n }\n\n setter(target, propName, value);\n }\n }\n };\n\n var clip = new Clip({\n target: animator._target,\n life: trackMaxTime,\n loop: animator._loop,\n delay: animator._delay,\n onframe: onframe,\n ondestroy: oneTrackDone\n });\n\n if (easing && easing !== 'spline') {\n clip.easing = easing;\n }\n\n return clip;\n}\n/**\n * @alias module:zrender/animation/Animator\n * @constructor\n * @param {Object} target\n * @param {boolean} loop\n * @param {Function} getter\n * @param {Function} setter\n */\n\n\nvar Animator = function (target, loop, getter, setter) {\n this._tracks = {};\n this._target = target;\n this._loop = loop || false;\n this._getter = getter || defaultGetter;\n this._setter = setter || defaultSetter;\n this._clipCount = 0;\n this._delay = 0;\n this._doneList = [];\n this._onframeList = [];\n this._clipList = [];\n};\n\nAnimator.prototype = {\n /**\n * 设置动画关键帧\n * @param {number} time 关键帧时间,单位是ms\n * @param {Object} props 关键帧的属性值,key-value表示\n * @return {module:zrender/animation/Animator}\n */\n when: function (time\n /* ms */\n , props) {\n var tracks = this._tracks;\n\n for (var propName in props) {\n if (!props.hasOwnProperty(propName)) {\n continue;\n }\n\n if (!tracks[propName]) {\n tracks[propName] = []; // Invalid value\n\n var value = this._getter(this._target, propName);\n\n if (value == null) {\n // zrLog('Invalid property ' + propName);\n continue;\n } // If time is 0\n // Then props is given initialize value\n // Else\n // Initialize value from current prop value\n\n\n if (time !== 0) {\n tracks[propName].push({\n time: 0,\n value: cloneValue(value)\n });\n }\n }\n\n tracks[propName].push({\n time: time,\n value: props[propName]\n });\n }\n\n return this;\n },\n\n /**\n * 添加动画每一帧的回调函数\n * @param {Function} callback\n * @return {module:zrender/animation/Animator}\n */\n during: function (callback) {\n this._onframeList.push(callback);\n\n return this;\n },\n pause: function () {\n for (var i = 0; i < this._clipList.length; i++) {\n this._clipList[i].pause();\n }\n\n this._paused = true;\n },\n resume: function () {\n for (var i = 0; i < this._clipList.length; i++) {\n this._clipList[i].resume();\n }\n\n this._paused = false;\n },\n isPaused: function () {\n return !!this._paused;\n },\n _doneCallback: function () {\n // Clear all tracks\n this._tracks = {}; // Clear all clips\n\n this._clipList.length = 0;\n var doneList = this._doneList;\n var len = doneList.length;\n\n for (var i = 0; i < len; i++) {\n doneList[i].call(this);\n }\n },\n\n /**\n * 开始执行动画\n * @param {string|Function} [easing]\n * 动画缓动函数,详见{@link module:zrender/animation/easing}\n * @param {boolean} forceAnimate\n * @return {module:zrender/animation/Animator}\n */\n start: function (easing, forceAnimate) {\n var self = this;\n var clipCount = 0;\n\n var oneTrackDone = function () {\n clipCount--;\n\n if (!clipCount) {\n self._doneCallback();\n }\n };\n\n var lastClip;\n\n for (var propName in this._tracks) {\n if (!this._tracks.hasOwnProperty(propName)) {\n continue;\n }\n\n var clip = createTrackClip(this, easing, oneTrackDone, this._tracks[propName], propName, forceAnimate);\n\n if (clip) {\n this._clipList.push(clip);\n\n clipCount++; // If start after added to animation\n\n if (this.animation) {\n this.animation.addClip(clip);\n }\n\n lastClip = clip;\n }\n } // Add during callback on the last clip\n\n\n if (lastClip) {\n var oldOnFrame = lastClip.onframe;\n\n lastClip.onframe = function (target, percent) {\n oldOnFrame(target, percent);\n\n for (var i = 0; i < self._onframeList.length; i++) {\n self._onframeList[i](target, percent);\n }\n };\n } // This optimization will help the case that in the upper application\n // the view may be refreshed frequently, where animation will be\n // called repeatly but nothing changed.\n\n\n if (!clipCount) {\n this._doneCallback();\n }\n\n return this;\n },\n\n /**\n * 停止动画\n * @param {boolean} forwardToLast If move to last frame before stop\n */\n stop: function (forwardToLast) {\n var clipList = this._clipList;\n var animation = this.animation;\n\n for (var i = 0; i < clipList.length; i++) {\n var clip = clipList[i];\n\n if (forwardToLast) {\n // Move to last frame before stop\n clip.onframe(this._target, 1);\n }\n\n animation && animation.removeClip(clip);\n }\n\n clipList.length = 0;\n },\n\n /**\n * 设置动画延迟开始的时间\n * @param {number} time 单位ms\n * @return {module:zrender/animation/Animator}\n */\n delay: function (time) {\n this._delay = time;\n return this;\n },\n\n /**\n * 添加动画结束的回调\n * @param {Function} cb\n * @return {module:zrender/animation/Animator}\n */\n done: function (cb) {\n if (cb) {\n this._doneList.push(cb);\n }\n\n return this;\n },\n\n /**\n * @return {Array.}\n */\n getClips: function () {\n return this._clipList;\n }\n};\nvar _default = Animator;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/animation/Animator.js\n// module id = 141\n// module chunks = 39","// Simple LRU cache use doubly linked list\n// @module zrender/core/LRU\n\n/**\n * Simple double linked list. Compared with array, it has O(1) remove operation.\n * @constructor\n */\nvar LinkedList = function () {\n /**\n * @type {module:zrender/core/LRU~Entry}\n */\n this.head = null;\n /**\n * @type {module:zrender/core/LRU~Entry}\n */\n\n this.tail = null;\n this._len = 0;\n};\n\nvar linkedListProto = LinkedList.prototype;\n/**\n * Insert a new value at the tail\n * @param {} val\n * @return {module:zrender/core/LRU~Entry}\n */\n\nlinkedListProto.insert = function (val) {\n var entry = new Entry(val);\n this.insertEntry(entry);\n return entry;\n};\n/**\n * Insert an entry at the tail\n * @param {module:zrender/core/LRU~Entry} entry\n */\n\n\nlinkedListProto.insertEntry = function (entry) {\n if (!this.head) {\n this.head = this.tail = entry;\n } else {\n this.tail.next = entry;\n entry.prev = this.tail;\n entry.next = null;\n this.tail = entry;\n }\n\n this._len++;\n};\n/**\n * Remove entry.\n * @param {module:zrender/core/LRU~Entry} entry\n */\n\n\nlinkedListProto.remove = function (entry) {\n var prev = entry.prev;\n var next = entry.next;\n\n if (prev) {\n prev.next = next;\n } else {\n // Is head\n this.head = next;\n }\n\n if (next) {\n next.prev = prev;\n } else {\n // Is tail\n this.tail = prev;\n }\n\n entry.next = entry.prev = null;\n this._len--;\n};\n/**\n * @return {number}\n */\n\n\nlinkedListProto.len = function () {\n return this._len;\n};\n/**\n * Clear list\n */\n\n\nlinkedListProto.clear = function () {\n this.head = this.tail = null;\n this._len = 0;\n};\n/**\n * @constructor\n * @param {} val\n */\n\n\nvar Entry = function (val) {\n /**\n * @type {}\n */\n this.value = val;\n /**\n * @type {module:zrender/core/LRU~Entry}\n */\n\n this.next;\n /**\n * @type {module:zrender/core/LRU~Entry}\n */\n\n this.prev;\n};\n/**\n * LRU Cache\n * @constructor\n * @alias module:zrender/core/LRU\n */\n\n\nvar LRU = function (maxSize) {\n this._list = new LinkedList();\n this._map = {};\n this._maxSize = maxSize || 10;\n this._lastRemovedEntry = null;\n};\n\nvar LRUProto = LRU.prototype;\n/**\n * @param {string} key\n * @param {} value\n * @return {} Removed value\n */\n\nLRUProto.put = function (key, value) {\n var list = this._list;\n var map = this._map;\n var removed = null;\n\n if (map[key] == null) {\n var len = list.len(); // Reuse last removed entry\n\n var entry = this._lastRemovedEntry;\n\n if (len >= this._maxSize && len > 0) {\n // Remove the least recently used\n var leastUsedEntry = list.head;\n list.remove(leastUsedEntry);\n delete map[leastUsedEntry.key];\n removed = leastUsedEntry.value;\n this._lastRemovedEntry = leastUsedEntry;\n }\n\n if (entry) {\n entry.value = value;\n } else {\n entry = new Entry(value);\n }\n\n entry.key = key;\n list.insertEntry(entry);\n map[key] = entry;\n }\n\n return removed;\n};\n/**\n * @param {string} key\n * @return {}\n */\n\n\nLRUProto.get = function (key) {\n var entry = this._map[key];\n var list = this._list;\n\n if (entry != null) {\n // Put the latest used entry in the tail\n if (entry !== list.tail) {\n list.remove(entry);\n list.insertEntry(entry);\n }\n\n return entry.value;\n }\n};\n/**\n * Clear the cache\n */\n\n\nLRUProto.clear = function () {\n this._list.clear();\n\n this._map = {};\n};\n\nvar _default = LRU;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/core/LRU.js\n// module id = 142\n// module chunks = 39","var SHADOW_PROPS = {\n 'shadowBlur': 1,\n 'shadowOffsetX': 1,\n 'shadowOffsetY': 1,\n 'textShadowBlur': 1,\n 'textShadowOffsetX': 1,\n 'textShadowOffsetY': 1,\n 'textBoxShadowBlur': 1,\n 'textBoxShadowOffsetX': 1,\n 'textBoxShadowOffsetY': 1\n};\n\nfunction _default(ctx, propName, value) {\n if (SHADOW_PROPS.hasOwnProperty(propName)) {\n return value *= ctx.dpr;\n }\n\n return value;\n}\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/helper/fixShadow.js\n// module id = 143\n// module chunks = 39","var Pattern = function (image, repeat) {\n // Should do nothing more in this constructor. Because gradient can be\n // declard by `color: {image: ...}`, where this constructor will not be called.\n this.image = image;\n this.repeat = repeat; // Can be cloned\n\n this.type = 'pattern';\n};\n\nPattern.prototype.getCanvasPattern = function (ctx) {\n return ctx.createPattern(this.image, this.repeat || 'repeat');\n};\n\nvar _default = Pattern;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/Pattern.js\n// module id = 144\n// module chunks = 39","var _default = typeof window !== 'undefined' && (window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || // https://github.com/ecomfe/zrender/issues/189#issuecomment-224919809\nwindow.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window) || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame) || function (func) {\n setTimeout(func, 16);\n};\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/animation/requestAnimationFrame.js\n// module id = 145\n// module chunks = 39","var textHelper = require(\"../helper/text\");\n\nvar BoundingRect = require(\"../../core/BoundingRect\");\n\nvar _constant = require(\"../constant\");\n\nvar WILL_BE_RESTORED = _constant.WILL_BE_RESTORED;\n\n/**\n * Mixin for drawing text in a element bounding rect\n * @module zrender/mixin/RectText\n */\nvar tmpRect = new BoundingRect();\n\nvar RectText = function () {};\n\nRectText.prototype = {\n constructor: RectText,\n\n /**\n * Draw text in a rect with specified position.\n * @param {CanvasRenderingContext2D} ctx\n * @param {Object} rect Displayable rect\n */\n drawRectText: function (ctx, rect) {\n var style = this.style;\n rect = style.textRect || rect; // Optimize, avoid normalize every time.\n\n this.__dirty && textHelper.normalizeTextStyle(style, true);\n var text = style.text; // Convert to string\n\n text != null && (text += '');\n\n if (!textHelper.needDrawText(text, style)) {\n return;\n } // FIXME\n // Do not provide prevEl to `textHelper.renderText` for ctx prop cache,\n // but use `ctx.save()` and `ctx.restore()`. Because the cache for rect\n // text propably break the cache for its host elements.\n\n\n ctx.save(); // Transform rect to view space\n\n var transform = this.transform;\n\n if (!style.transformText) {\n if (transform) {\n tmpRect.copy(rect);\n tmpRect.applyTransform(transform);\n rect = tmpRect;\n }\n } else {\n this.setTransform(ctx);\n } // transformText and textRotation can not be used at the same time.\n\n\n textHelper.renderText(this, ctx, text, style, rect, WILL_BE_RESTORED);\n ctx.restore();\n }\n};\nvar _default = RectText;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/mixin/RectText.js\n// module id = 146\n// module chunks = 39","/**\n * @param {Object} ctx\n * @param {Object} shape\n * @param {number} shape.x\n * @param {number} shape.y\n * @param {number} shape.width\n * @param {number} shape.height\n * @param {number} shape.r\n */\nfunction buildPath(ctx, shape) {\n var x = shape.x;\n var y = shape.y;\n var width = shape.width;\n var height = shape.height;\n var r = shape.r;\n var r1;\n var r2;\n var r3;\n var r4; // Convert width and height to positive for better borderRadius\n\n if (width < 0) {\n x = x + width;\n width = -width;\n }\n\n if (height < 0) {\n y = y + height;\n height = -height;\n }\n\n if (typeof r === 'number') {\n r1 = r2 = r3 = r4 = r;\n } else if (r instanceof Array) {\n if (r.length === 1) {\n r1 = r2 = r3 = r4 = r[0];\n } else if (r.length === 2) {\n r1 = r3 = r[0];\n r2 = r4 = r[1];\n } else if (r.length === 3) {\n r1 = r[0];\n r2 = r4 = r[1];\n r3 = r[2];\n } else {\n r1 = r[0];\n r2 = r[1];\n r3 = r[2];\n r4 = r[3];\n }\n } else {\n r1 = r2 = r3 = r4 = 0;\n }\n\n var total;\n\n if (r1 + r2 > width) {\n total = r1 + r2;\n r1 *= width / total;\n r2 *= width / total;\n }\n\n if (r3 + r4 > width) {\n total = r3 + r4;\n r3 *= width / total;\n r4 *= width / total;\n }\n\n if (r2 + r3 > height) {\n total = r2 + r3;\n r2 *= height / total;\n r3 *= height / total;\n }\n\n if (r1 + r4 > height) {\n total = r1 + r4;\n r1 *= height / total;\n r4 *= height / total;\n }\n\n ctx.moveTo(x + r1, y);\n ctx.lineTo(x + width - r2, y);\n r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0);\n ctx.lineTo(x + width, y + height - r3);\n r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2);\n ctx.lineTo(x + r4, y + height);\n r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI);\n ctx.lineTo(x, y + r1);\n r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5);\n}\n\nexports.buildPath = buildPath;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/helper/roundRect.js\n// module id = 147\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _config = require(\"../config\");\n\nvar __DEV__ = _config.__DEV__;\n\nvar _util = require(\"zrender/lib/core/util\");\n\nvar each = _util.each;\nvar filter = _util.filter;\nvar map = _util.map;\nvar isArray = _util.isArray;\nvar indexOf = _util.indexOf;\nvar isObject = _util.isObject;\nvar isString = _util.isString;\nvar createHashMap = _util.createHashMap;\nvar assert = _util.assert;\nvar clone = _util.clone;\nvar merge = _util.merge;\nvar extend = _util.extend;\nvar mixin = _util.mixin;\n\nvar modelUtil = require(\"../util/model\");\n\nvar Model = require(\"./Model\");\n\nvar ComponentModel = require(\"./Component\");\n\nvar globalDefault = require(\"./globalDefault\");\n\nvar colorPaletteMixin = require(\"./mixin/colorPalette\");\n\nvar _sourceHelper = require(\"../data/helper/sourceHelper\");\n\nvar resetSourceDefaulter = _sourceHelper.resetSourceDefaulter;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * ECharts global model\n *\n * @module {echarts/model/Global}\n */\n\n/**\n * Caution: If the mechanism should be changed some day, these cases\n * should be considered:\n *\n * (1) In `merge option` mode, if using the same option to call `setOption`\n * many times, the result should be the same (try our best to ensure that).\n * (2) In `merge option` mode, if a component has no id/name specified, it\n * will be merged by index, and the result sequence of the components is\n * consistent to the original sequence.\n * (3) `reset` feature (in toolbox). Find detailed info in comments about\n * `mergeOption` in module:echarts/model/OptionManager.\n */\nvar OPTION_INNER_KEY = '\\0_ec_inner';\n/**\n * @alias module:echarts/model/Global\n *\n * @param {Object} option\n * @param {module:echarts/model/Model} parentModel\n * @param {Object} theme\n */\n\nvar GlobalModel = Model.extend({\n init: function (option, parentModel, theme, optionManager) {\n theme = theme || {};\n this.option = null; // Mark as not initialized.\n\n /**\n * @type {module:echarts/model/Model}\n * @private\n */\n\n this._theme = new Model(theme);\n /**\n * @type {module:echarts/model/OptionManager}\n */\n\n this._optionManager = optionManager;\n },\n setOption: function (option, optionPreprocessorFuncs) {\n assert(!(OPTION_INNER_KEY in option), 'please use chart.getOption()');\n\n this._optionManager.setOption(option, optionPreprocessorFuncs);\n\n this.resetOption(null);\n },\n\n /**\n * @param {string} type null/undefined: reset all.\n * 'recreate': force recreate all.\n * 'timeline': only reset timeline option\n * 'media': only reset media query option\n * @return {boolean} Whether option changed.\n */\n resetOption: function (type) {\n var optionChanged = false;\n var optionManager = this._optionManager;\n\n if (!type || type === 'recreate') {\n var baseOption = optionManager.mountOption(type === 'recreate');\n\n if (!this.option || type === 'recreate') {\n initBase.call(this, baseOption);\n } else {\n this.restoreData();\n this.mergeOption(baseOption);\n }\n\n optionChanged = true;\n }\n\n if (type === 'timeline' || type === 'media') {\n this.restoreData();\n }\n\n if (!type || type === 'recreate' || type === 'timeline') {\n var timelineOption = optionManager.getTimelineOption(this);\n timelineOption && (this.mergeOption(timelineOption), optionChanged = true);\n }\n\n if (!type || type === 'recreate' || type === 'media') {\n var mediaOptions = optionManager.getMediaOption(this, this._api);\n\n if (mediaOptions.length) {\n each(mediaOptions, function (mediaOption) {\n this.mergeOption(mediaOption, optionChanged = true);\n }, this);\n }\n }\n\n return optionChanged;\n },\n\n /**\n * @protected\n */\n mergeOption: function (newOption) {\n var option = this.option;\n var componentsMap = this._componentsMap;\n var newCptTypes = [];\n resetSourceDefaulter(this); // If no component class, merge directly.\n // For example: color, animaiton options, etc.\n\n each(newOption, function (componentOption, mainType) {\n if (componentOption == null) {\n return;\n }\n\n if (!ComponentModel.hasClass(mainType)) {\n // globalSettingTask.dirty();\n option[mainType] = option[mainType] == null ? clone(componentOption) : merge(option[mainType], componentOption, true);\n } else if (mainType) {\n newCptTypes.push(mainType);\n }\n });\n ComponentModel.topologicalTravel(newCptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this);\n\n function visitComponent(mainType, dependencies) {\n var newCptOptionList = modelUtil.normalizeToArray(newOption[mainType]);\n var mapResult = modelUtil.mappingToExists(componentsMap.get(mainType), newCptOptionList);\n modelUtil.makeIdAndName(mapResult); // Set mainType and complete subType.\n\n each(mapResult, function (item, index) {\n var opt = item.option;\n\n if (isObject(opt)) {\n item.keyInfo.mainType = mainType;\n item.keyInfo.subType = determineSubType(mainType, opt, item.exist);\n }\n });\n var dependentModels = getComponentsByTypes(componentsMap, dependencies);\n option[mainType] = [];\n componentsMap.set(mainType, []);\n each(mapResult, function (resultItem, index) {\n var componentModel = resultItem.exist;\n var newCptOption = resultItem.option;\n assert(isObject(newCptOption) || componentModel, 'Empty component definition'); // Consider where is no new option and should be merged using {},\n // see removeEdgeAndAdd in topologicalTravel and\n // ComponentModel.getAllClassMainTypes.\n\n if (!newCptOption) {\n componentModel.mergeOption({}, this);\n componentModel.optionUpdated({}, false);\n } else {\n var ComponentModelClass = ComponentModel.getClass(mainType, resultItem.keyInfo.subType, true);\n\n if (componentModel && componentModel instanceof ComponentModelClass) {\n componentModel.name = resultItem.keyInfo.name; // componentModel.settingTask && componentModel.settingTask.dirty();\n\n componentModel.mergeOption(newCptOption, this);\n componentModel.optionUpdated(newCptOption, false);\n } else {\n // PENDING Global as parent ?\n var extraOpt = extend({\n dependentModels: dependentModels,\n componentIndex: index\n }, resultItem.keyInfo);\n componentModel = new ComponentModelClass(newCptOption, this, this, extraOpt);\n extend(componentModel, extraOpt);\n componentModel.init(newCptOption, this, this, extraOpt); // Call optionUpdated after init.\n // newCptOption has been used as componentModel.option\n // and may be merged with theme and default, so pass null\n // to avoid confusion.\n\n componentModel.optionUpdated(null, true);\n }\n }\n\n componentsMap.get(mainType)[index] = componentModel;\n option[mainType][index] = componentModel.option;\n }, this); // Backup series for filtering.\n\n if (mainType === 'series') {\n createSeriesIndices(this, componentsMap.get('series'));\n }\n }\n\n this._seriesIndicesMap = createHashMap(this._seriesIndices = this._seriesIndices || []);\n },\n\n /**\n * Get option for output (cloned option and inner info removed)\n * @public\n * @return {Object}\n */\n getOption: function () {\n var option = clone(this.option);\n each(option, function (opts, mainType) {\n if (ComponentModel.hasClass(mainType)) {\n var opts = modelUtil.normalizeToArray(opts);\n\n for (var i = opts.length - 1; i >= 0; i--) {\n // Remove options with inner id.\n if (modelUtil.isIdInner(opts[i])) {\n opts.splice(i, 1);\n }\n }\n\n option[mainType] = opts;\n }\n });\n delete option[OPTION_INNER_KEY];\n return option;\n },\n\n /**\n * @return {module:echarts/model/Model}\n */\n getTheme: function () {\n return this._theme;\n },\n\n /**\n * @param {string} mainType\n * @param {number} [idx=0]\n * @return {module:echarts/model/Component}\n */\n getComponent: function (mainType, idx) {\n var list = this._componentsMap.get(mainType);\n\n if (list) {\n return list[idx || 0];\n }\n },\n\n /**\n * If none of index and id and name used, return all components with mainType.\n * @param {Object} condition\n * @param {string} condition.mainType\n * @param {string} [condition.subType] If ignore, only query by mainType\n * @param {number|Array.} [condition.index] Either input index or id or name.\n * @param {string|Array.} [condition.id] Either input index or id or name.\n * @param {string|Array.} [condition.name] Either input index or id or name.\n * @return {Array.}\n */\n queryComponents: function (condition) {\n var mainType = condition.mainType;\n\n if (!mainType) {\n return [];\n }\n\n var index = condition.index;\n var id = condition.id;\n var name = condition.name;\n\n var cpts = this._componentsMap.get(mainType);\n\n if (!cpts || !cpts.length) {\n return [];\n }\n\n var result;\n\n if (index != null) {\n if (!isArray(index)) {\n index = [index];\n }\n\n result = filter(map(index, function (idx) {\n return cpts[idx];\n }), function (val) {\n return !!val;\n });\n } else if (id != null) {\n var isIdArray = isArray(id);\n result = filter(cpts, function (cpt) {\n return isIdArray && indexOf(id, cpt.id) >= 0 || !isIdArray && cpt.id === id;\n });\n } else if (name != null) {\n var isNameArray = isArray(name);\n result = filter(cpts, function (cpt) {\n return isNameArray && indexOf(name, cpt.name) >= 0 || !isNameArray && cpt.name === name;\n });\n } else {\n // Return all components with mainType\n result = cpts.slice();\n }\n\n return filterBySubType(result, condition);\n },\n\n /**\n * The interface is different from queryComponents,\n * which is convenient for inner usage.\n *\n * @usage\n * var result = findComponents(\n * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}}\n * );\n * var result = findComponents(\n * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}}\n * );\n * var result = findComponents(\n * {mainType: 'series'},\n * function (model, index) {...}\n * );\n * // result like [component0, componnet1, ...]\n *\n * @param {Object} condition\n * @param {string} condition.mainType Mandatory.\n * @param {string} [condition.subType] Optional.\n * @param {Object} [condition.query] like {xxxIndex, xxxId, xxxName},\n * where xxx is mainType.\n * If query attribute is null/undefined or has no index/id/name,\n * do not filtering by query conditions, which is convenient for\n * no-payload situations or when target of action is global.\n * @param {Function} [condition.filter] parameter: component, return boolean.\n * @return {Array.}\n */\n findComponents: function (condition) {\n var query = condition.query;\n var mainType = condition.mainType;\n var queryCond = getQueryCond(query);\n var result = queryCond ? this.queryComponents(queryCond) : this._componentsMap.get(mainType);\n return doFilter(filterBySubType(result, condition));\n\n function getQueryCond(q) {\n var indexAttr = mainType + 'Index';\n var idAttr = mainType + 'Id';\n var nameAttr = mainType + 'Name';\n return q && (q[indexAttr] != null || q[idAttr] != null || q[nameAttr] != null) ? {\n mainType: mainType,\n // subType will be filtered finally.\n index: q[indexAttr],\n id: q[idAttr],\n name: q[nameAttr]\n } : null;\n }\n\n function doFilter(res) {\n return condition.filter ? filter(res, condition.filter) : res;\n }\n },\n\n /**\n * @usage\n * eachComponent('legend', function (legendModel, index) {\n * ...\n * });\n * eachComponent(function (componentType, model, index) {\n * // componentType does not include subType\n * // (componentType is 'xxx' but not 'xxx.aa')\n * });\n * eachComponent(\n * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}},\n * function (model, index) {...}\n * );\n * eachComponent(\n * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}},\n * function (model, index) {...}\n * );\n *\n * @param {string|Object=} mainType When mainType is object, the definition\n * is the same as the method 'findComponents'.\n * @param {Function} cb\n * @param {*} context\n */\n eachComponent: function (mainType, cb, context) {\n var componentsMap = this._componentsMap;\n\n if (typeof mainType === 'function') {\n context = cb;\n cb = mainType;\n componentsMap.each(function (components, componentType) {\n each(components, function (component, index) {\n cb.call(context, componentType, component, index);\n });\n });\n } else if (isString(mainType)) {\n each(componentsMap.get(mainType), cb, context);\n } else if (isObject(mainType)) {\n var queryResult = this.findComponents(mainType);\n each(queryResult, cb, context);\n }\n },\n\n /**\n * @param {string} name\n * @return {Array.}\n */\n getSeriesByName: function (name) {\n var series = this._componentsMap.get('series');\n\n return filter(series, function (oneSeries) {\n return oneSeries.name === name;\n });\n },\n\n /**\n * @param {number} seriesIndex\n * @return {module:echarts/model/Series}\n */\n getSeriesByIndex: function (seriesIndex) {\n return this._componentsMap.get('series')[seriesIndex];\n },\n\n /**\n * Get series list before filtered by type.\n * FIXME: rename to getRawSeriesByType?\n *\n * @param {string} subType\n * @return {Array.}\n */\n getSeriesByType: function (subType) {\n var series = this._componentsMap.get('series');\n\n return filter(series, function (oneSeries) {\n return oneSeries.subType === subType;\n });\n },\n\n /**\n * @return {Array.}\n */\n getSeries: function () {\n return this._componentsMap.get('series').slice();\n },\n\n /**\n * @return {number}\n */\n getSeriesCount: function () {\n return this._componentsMap.get('series').length;\n },\n\n /**\n * After filtering, series may be different\n * frome raw series.\n *\n * @param {Function} cb\n * @param {*} context\n */\n eachSeries: function (cb, context) {\n assertSeriesInitialized(this);\n each(this._seriesIndices, function (rawSeriesIndex) {\n var series = this._componentsMap.get('series')[rawSeriesIndex];\n\n cb.call(context, series, rawSeriesIndex);\n }, this);\n },\n\n /**\n * Iterate raw series before filtered.\n *\n * @param {Function} cb\n * @param {*} context\n */\n eachRawSeries: function (cb, context) {\n each(this._componentsMap.get('series'), cb, context);\n },\n\n /**\n * After filtering, series may be different.\n * frome raw series.\n *\n * @parma {string} subType\n * @param {Function} cb\n * @param {*} context\n */\n eachSeriesByType: function (subType, cb, context) {\n assertSeriesInitialized(this);\n each(this._seriesIndices, function (rawSeriesIndex) {\n var series = this._componentsMap.get('series')[rawSeriesIndex];\n\n if (series.subType === subType) {\n cb.call(context, series, rawSeriesIndex);\n }\n }, this);\n },\n\n /**\n * Iterate raw series before filtered of given type.\n *\n * @parma {string} subType\n * @param {Function} cb\n * @param {*} context\n */\n eachRawSeriesByType: function (subType, cb, context) {\n return each(this.getSeriesByType(subType), cb, context);\n },\n\n /**\n * @param {module:echarts/model/Series} seriesModel\n */\n isSeriesFiltered: function (seriesModel) {\n assertSeriesInitialized(this);\n return this._seriesIndicesMap.get(seriesModel.componentIndex) == null;\n },\n\n /**\n * @return {Array.}\n */\n getCurrentSeriesIndices: function () {\n return (this._seriesIndices || []).slice();\n },\n\n /**\n * @param {Function} cb\n * @param {*} context\n */\n filterSeries: function (cb, context) {\n assertSeriesInitialized(this);\n var filteredSeries = filter(this._componentsMap.get('series'), cb, context);\n createSeriesIndices(this, filteredSeries);\n },\n restoreData: function (payload) {\n var componentsMap = this._componentsMap;\n createSeriesIndices(this, componentsMap.get('series'));\n var componentTypes = [];\n componentsMap.each(function (components, componentType) {\n componentTypes.push(componentType);\n });\n ComponentModel.topologicalTravel(componentTypes, ComponentModel.getAllClassMainTypes(), function (componentType, dependencies) {\n each(componentsMap.get(componentType), function (component) {\n (componentType !== 'series' || !isNotTargetSeries(component, payload)) && component.restoreData();\n });\n });\n }\n});\n\nfunction isNotTargetSeries(seriesModel, payload) {\n if (payload) {\n var index = payload.seiresIndex;\n var id = payload.seriesId;\n var name = payload.seriesName;\n return index != null && seriesModel.componentIndex !== index || id != null && seriesModel.id !== id || name != null && seriesModel.name !== name;\n }\n}\n/**\n * @inner\n */\n\n\nfunction mergeTheme(option, theme) {\n // PENDING\n // NOT use `colorLayer` in theme if option has `color`\n var notMergeColorLayer = option.color && !option.colorLayer;\n each(theme, function (themeItem, name) {\n if (name === 'colorLayer' && notMergeColorLayer) {\n return;\n } // 如果有 component model 则把具体的 merge 逻辑交给该 model 处理\n\n\n if (!ComponentModel.hasClass(name)) {\n if (typeof themeItem === 'object') {\n option[name] = !option[name] ? clone(themeItem) : merge(option[name], themeItem, false);\n } else {\n if (option[name] == null) {\n option[name] = themeItem;\n }\n }\n }\n });\n}\n\nfunction initBase(baseOption) {\n baseOption = baseOption; // Using OPTION_INNER_KEY to mark that this option can not be used outside,\n // i.e. `chart.setOption(chart.getModel().option);` is forbiden.\n\n this.option = {};\n this.option[OPTION_INNER_KEY] = 1;\n /**\n * Init with series: [], in case of calling findSeries method\n * before series initialized.\n * @type {Object.>}\n * @private\n */\n\n this._componentsMap = createHashMap({\n series: []\n });\n /**\n * Mapping between filtered series list and raw series list.\n * key: filtered series indices, value: raw series indices.\n * @type {Array.}\n * @private\n */\n\n this._seriesIndices;\n this._seriesIndicesMap;\n mergeTheme(baseOption, this._theme.option); // TODO Needs clone when merging to the unexisted property\n\n merge(baseOption, globalDefault, false);\n this.mergeOption(baseOption);\n}\n/**\n * @inner\n * @param {Array.|string} types model types\n * @return {Object} key: {string} type, value: {Array.} models\n */\n\n\nfunction getComponentsByTypes(componentsMap, types) {\n if (!isArray(types)) {\n types = types ? [types] : [];\n }\n\n var ret = {};\n each(types, function (type) {\n ret[type] = (componentsMap.get(type) || []).slice();\n });\n return ret;\n}\n/**\n * @inner\n */\n\n\nfunction determineSubType(mainType, newCptOption, existComponent) {\n var subType = newCptOption.type ? newCptOption.type : existComponent ? existComponent.subType // Use determineSubType only when there is no existComponent.\n : ComponentModel.determineSubType(mainType, newCptOption); // tooltip, markline, markpoint may always has no subType\n\n return subType;\n}\n/**\n * @inner\n */\n\n\nfunction createSeriesIndices(ecModel, seriesModels) {\n ecModel._seriesIndicesMap = createHashMap(ecModel._seriesIndices = map(seriesModels, function (series) {\n return series.componentIndex;\n }) || []);\n}\n/**\n * @inner\n */\n\n\nfunction filterBySubType(components, condition) {\n // Using hasOwnProperty for restrict. Consider\n // subType is undefined in user payload.\n return condition.hasOwnProperty('subType') ? filter(components, function (cpt) {\n return cpt.subType === condition.subType;\n }) : components;\n}\n/**\n * @inner\n */\n\n\nfunction assertSeriesInitialized(ecModel) {}\n\nmixin(GlobalModel, colorPaletteMixin);\nvar _default = GlobalModel;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/model/Global.js\n// module id = 148\n// module chunks = 39","var Path = require(\"../graphic/Path\");\n\nvar PathProxy = require(\"../core/PathProxy\");\n\nvar transformPath = require(\"./transformPath\");\n\n// command chars\n// var cc = [\n// 'm', 'M', 'l', 'L', 'v', 'V', 'h', 'H', 'z', 'Z',\n// 'c', 'C', 'q', 'Q', 't', 'T', 's', 'S', 'a', 'A'\n// ];\nvar mathSqrt = Math.sqrt;\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar PI = Math.PI;\n\nvar vMag = function (v) {\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\n};\n\nvar vRatio = function (u, v) {\n return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\n};\n\nvar vAngle = function (u, v) {\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v));\n};\n\nfunction processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) {\n var psi = psiDeg * (PI / 180.0);\n var xp = mathCos(psi) * (x1 - x2) / 2.0 + mathSin(psi) * (y1 - y2) / 2.0;\n var yp = -1 * mathSin(psi) * (x1 - x2) / 2.0 + mathCos(psi) * (y1 - y2) / 2.0;\n var lambda = xp * xp / (rx * rx) + yp * yp / (ry * ry);\n\n if (lambda > 1) {\n rx *= mathSqrt(lambda);\n ry *= mathSqrt(lambda);\n }\n\n var f = (fa === fs ? -1 : 1) * mathSqrt((rx * rx * (ry * ry) - rx * rx * (yp * yp) - ry * ry * (xp * xp)) / (rx * rx * (yp * yp) + ry * ry * (xp * xp))) || 0;\n var cxp = f * rx * yp / ry;\n var cyp = f * -ry * xp / rx;\n var cx = (x1 + x2) / 2.0 + mathCos(psi) * cxp - mathSin(psi) * cyp;\n var cy = (y1 + y2) / 2.0 + mathSin(psi) * cxp + mathCos(psi) * cyp;\n var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);\n var u = [(xp - cxp) / rx, (yp - cyp) / ry];\n var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\n var dTheta = vAngle(u, v);\n\n if (vRatio(u, v) <= -1) {\n dTheta = PI;\n }\n\n if (vRatio(u, v) >= 1) {\n dTheta = 0;\n }\n\n if (fs === 0 && dTheta > 0) {\n dTheta = dTheta - 2 * PI;\n }\n\n if (fs === 1 && dTheta < 0) {\n dTheta = dTheta + 2 * PI;\n }\n\n path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs);\n}\n\nvar commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig; // Consider case:\n// (1) delimiter can be comma or space, where continuous commas\n// or spaces should be seen as one comma.\n// (2) value can be like:\n// '2e-4', 'l.5.9' (ignore 0), 'M-10-10', 'l-2.43e-1,34.9983',\n// 'l-.5E1,54', '121-23-44-11' (no delimiter)\n\nvar numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g; // var valueSplitReg = /[\\s,]+/;\n\nfunction createPathProxyFromString(data) {\n if (!data) {\n return new PathProxy();\n } // var data = data.replace(/-/g, ' -')\n // .replace(/ /g, ' ')\n // .replace(/ /g, ',')\n // .replace(/,,/g, ',');\n // var n;\n // create pipes so that we can split the data\n // for (n = 0; n < cc.length; n++) {\n // cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]);\n // }\n // data = data.replace(/-/g, ',-');\n // create array\n // var arr = cs.split('|');\n // init context point\n\n\n var cpx = 0;\n var cpy = 0;\n var subpathX = cpx;\n var subpathY = cpy;\n var prevCmd;\n var path = new PathProxy();\n var CMD = PathProxy.CMD; // commandReg.lastIndex = 0;\n // var cmdResult;\n // while ((cmdResult = commandReg.exec(data)) != null) {\n // var cmdStr = cmdResult[1];\n // var cmdContent = cmdResult[2];\n\n var cmdList = data.match(commandReg);\n\n for (var l = 0; l < cmdList.length; l++) {\n var cmdText = cmdList[l];\n var cmdStr = cmdText.charAt(0);\n var cmd; // String#split is faster a little bit than String#replace or RegExp#exec.\n // var p = cmdContent.split(valueSplitReg);\n // var pLen = 0;\n // for (var i = 0; i < p.length; i++) {\n // // '' and other invalid str => NaN\n // var val = parseFloat(p[i]);\n // !isNaN(val) && (p[pLen++] = val);\n // }\n\n var p = cmdText.match(numberReg) || [];\n var pLen = p.length;\n\n for (var i = 0; i < pLen; i++) {\n p[i] = parseFloat(p[i]);\n }\n\n var off = 0;\n\n while (off < pLen) {\n var ctlPtx;\n var ctlPty;\n var rx;\n var ry;\n var psi;\n var fa;\n var fs;\n var x1 = cpx;\n var y1 = cpy; // convert l, H, h, V, and v to L\n\n switch (cmdStr) {\n case 'l':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'L':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'm':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'l';\n break;\n\n case 'M':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'L';\n break;\n\n case 'h':\n cpx += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'H':\n cpx = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'v':\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'V':\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'C':\n cmd = CMD.C;\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\n cpx = p[off - 2];\n cpy = p[off - 1];\n break;\n\n case 'c':\n cmd = CMD.C;\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\n cpx += p[off - 2];\n cpy += p[off - 1];\n break;\n\n case 'S':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 's':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = cpx + p[off++];\n y1 = cpy + p[off++];\n cpx += p[off++];\n cpy += p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 'Q':\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'q':\n x1 = p[off++] + cpx;\n y1 = p[off++] + cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'T':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 't':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 'A':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n\n case 'a':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n }\n }\n\n if (cmdStr === 'z' || cmdStr === 'Z') {\n cmd = CMD.Z;\n path.addData(cmd); // z may be in the middle of the path.\n\n cpx = subpathX;\n cpy = subpathY;\n }\n\n prevCmd = cmd;\n }\n\n path.toStatic();\n return path;\n} // TODO Optimize double memory cost problem\n\n\nfunction createPathOptions(str, opts) {\n var pathProxy = createPathProxyFromString(str);\n opts = opts || {};\n\n opts.buildPath = function (path) {\n if (path.setData) {\n path.setData(pathProxy.data); // Svg and vml renderer don't have context\n\n var ctx = path.getContext();\n\n if (ctx) {\n path.rebuildPath(ctx);\n }\n } else {\n var ctx = path;\n pathProxy.rebuildPath(ctx);\n }\n };\n\n opts.applyTransform = function (m) {\n transformPath(pathProxy, m);\n this.dirty(true);\n };\n\n return opts;\n}\n/**\n * Create a Path object from path string data\n * http://www.w3.org/TR/SVG/paths.html#PathData\n * @param {Object} opts Other options\n */\n\n\nfunction createFromString(str, opts) {\n return new Path(createPathOptions(str, opts));\n}\n/**\n * Create a Path class from path string data\n * @param {string} str\n * @param {Object} opts Other options\n */\n\n\nfunction extendFromString(str, opts) {\n return Path.extend(createPathOptions(str, opts));\n}\n/**\n * Merge multiple paths\n */\n// TODO Apply transform\n// TODO stroke dash\n// TODO Optimize double memory cost problem\n\n\nfunction mergePath(pathEls, opts) {\n var pathList = [];\n var len = pathEls.length;\n\n for (var i = 0; i < len; i++) {\n var pathEl = pathEls[i];\n\n if (!pathEl.path) {\n pathEl.createPathProxy();\n }\n\n if (pathEl.__dirtyPath) {\n pathEl.buildPath(pathEl.path, pathEl.shape, true);\n }\n\n pathList.push(pathEl.path);\n }\n\n var pathBundle = new Path(opts); // Need path proxy.\n\n pathBundle.createPathProxy();\n\n pathBundle.buildPath = function (path) {\n path.appendPath(pathList); // Svg and vml renderer don't have context\n\n var ctx = path.getContext();\n\n if (ctx) {\n path.rebuildPath(ctx);\n }\n };\n\n return pathBundle;\n}\n\nexports.createFromString = createFromString;\nexports.extendFromString = extendFromString;\nexports.mergePath = mergePath;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/tool/path.js\n// module id = 149\n// module chunks = 39","/**\n * 线段包含判断\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {number} lineWidth\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\nfunction containStroke(x0, y0, x1, y1, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n\n var _l = lineWidth;\n var _a = 0;\n var _b = x0; // Quick reject\n\n if (y > y0 + _l && y > y1 + _l || y < y0 - _l && y < y1 - _l || x > x0 + _l && x > x1 + _l || x < x0 - _l && x < x1 - _l) {\n return false;\n }\n\n if (x0 !== x1) {\n _a = (y0 - y1) / (x0 - x1);\n _b = (x0 * y1 - x1 * y0) / (x0 - x1);\n } else {\n return Math.abs(x - x0) <= _l / 2;\n }\n\n var tmp = _a * x - y + _b;\n\n var _s = tmp * tmp / (_a * _a + 1);\n\n return _s <= _l / 2 * _l / 2;\n}\n\nexports.containStroke = containStroke;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/contain/line.js\n// module id = 150\n// module chunks = 39","var _curve = require(\"../core/curve\");\n\nvar quadraticProjectPoint = _curve.quadraticProjectPoint;\n\n/**\n * 二次贝塞尔曲线描边包含判断\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @param {number} lineWidth\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\nfunction containStroke(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n\n var _l = lineWidth; // Quick reject\n\n if (y > y0 + _l && y > y1 + _l && y > y2 + _l || y < y0 - _l && y < y1 - _l && y < y2 - _l || x > x0 + _l && x > x1 + _l && x > x2 + _l || x < x0 - _l && x < x1 - _l && x < x2 - _l) {\n return false;\n }\n\n var d = quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);\n return d <= _l / 2;\n}\n\nexports.containStroke = containStroke;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/contain/quadratic.js\n// module id = 151\n// module chunks = 39","var PI2 = Math.PI * 2;\n\nfunction normalizeRadian(angle) {\n angle %= PI2;\n\n if (angle < 0) {\n angle += PI2;\n }\n\n return angle;\n}\n\nexports.normalizeRadian = normalizeRadian;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/contain/util.js\n// module id = 152\n// module chunks = 39","function windingLine(x0, y0, x1, y1, x, y) {\n if (y > y0 && y > y1 || y < y0 && y < y1) {\n return 0;\n } // Ignore horizontal line\n\n\n if (y1 === y0) {\n return 0;\n }\n\n var dir = y1 < y0 ? 1 : -1;\n var t = (y - y0) / (y1 - y0); // Avoid winding error when intersection point is the connect point of two line of polygon\n\n if (t === 1 || t === 0) {\n dir = y1 < y0 ? 0.5 : -0.5;\n }\n\n var x_ = t * (x1 - x0) + x0; // If (x, y) on the line, considered as \"contain\".\n\n return x_ === x ? Infinity : x_ > x ? dir : 0;\n}\n\nmodule.exports = windingLine;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/contain/windingLine.js\n// module id = 153\n// module chunks = 39","var Path = require(\"../Path\");\n\n/**\n * 圆形\n * @module zrender/shape/Circle\n */\nvar _default = Path.extend({\n type: 'circle',\n shape: {\n cx: 0,\n cy: 0,\n r: 0\n },\n buildPath: function (ctx, shape, inBundle) {\n // Better stroking in ShapeBundle\n // Always do it may have performence issue ( fill may be 2x more cost)\n if (inBundle) {\n ctx.moveTo(shape.cx + shape.r, shape.cy);\n } // else {\n // if (ctx.allocate && !ctx.data.length) {\n // ctx.allocate(ctx.CMD_MEM_SIZE.A);\n // }\n // }\n // Better stroking in ShapeBundle\n // ctx.moveTo(shape.cx + shape.r, shape.cy);\n\n\n ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2, true);\n }\n});\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/shape/Circle.js\n// module id = 154\n// module chunks = 39","var env = require(\"../../core/env\");\n\n// Fix weird bug in some version of IE11 (like 11.0.9600.178**),\n// where exception \"unexpected call to method or property access\"\n// might be thrown when calling ctx.fill or ctx.stroke after a path\n// whose area size is zero is drawn and ctx.clip() is called and\n// shadowBlur is set. See #4572, #3112, #5777.\n// (e.g.,\n// ctx.moveTo(10, 10);\n// ctx.lineTo(20, 10);\n// ctx.closePath();\n// ctx.clip();\n// ctx.shadowBlur = 10;\n// ...\n// ctx.fill();\n// )\nvar shadowTemp = [['shadowBlur', 0], ['shadowColor', '#000'], ['shadowOffsetX', 0], ['shadowOffsetY', 0]];\n\nfunction _default(orignalBrush) {\n // version string can be: '11.0'\n return env.browser.ie && env.browser.version >= 11 ? function () {\n var clipPaths = this.__clipPaths;\n var style = this.style;\n var modified;\n\n if (clipPaths) {\n for (var i = 0; i < clipPaths.length; i++) {\n var clipPath = clipPaths[i];\n var shape = clipPath && clipPath.shape;\n var type = clipPath && clipPath.type;\n\n if (shape && (type === 'sector' && shape.startAngle === shape.endAngle || type === 'rect' && (!shape.width || !shape.height))) {\n for (var j = 0; j < shadowTemp.length; j++) {\n // It is save to put shadowTemp static, because shadowTemp\n // will be all modified each item brush called.\n shadowTemp[j][2] = style[shadowTemp[j][0]];\n style[shadowTemp[j][0]] = shadowTemp[j][1];\n }\n\n modified = true;\n break;\n }\n }\n }\n\n orignalBrush.apply(this, arguments);\n\n if (modified) {\n for (var j = 0; j < shadowTemp.length; j++) {\n style[shadowTemp[j][0]] = shadowTemp[j][2];\n }\n }\n } : orignalBrush;\n}\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/helper/fixClipWithShadow.js\n// module id = 155\n// module chunks = 39","var Path = require(\"../Path\");\n\nvar polyHelper = require(\"../helper/poly\");\n\n/**\n * 多边形\n * @module zrender/shape/Polygon\n */\nvar _default = Path.extend({\n type: 'polygon',\n shape: {\n points: null,\n smooth: false,\n smoothConstraint: null\n },\n buildPath: function (ctx, shape) {\n polyHelper.buildPath(ctx, shape, true);\n }\n});\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/shape/Polygon.js\n// module id = 156\n// module chunks = 39","var smoothSpline = require(\"./smoothSpline\");\n\nvar smoothBezier = require(\"./smoothBezier\");\n\nfunction buildPath(ctx, shape, closePath) {\n var points = shape.points;\n var smooth = shape.smooth;\n\n if (points && points.length >= 2) {\n if (smooth && smooth !== 'spline') {\n var controlPoints = smoothBezier(points, smooth, closePath, shape.smoothConstraint);\n ctx.moveTo(points[0][0], points[0][1]);\n var len = points.length;\n\n for (var i = 0; i < (closePath ? len : len - 1); i++) {\n var cp1 = controlPoints[i * 2];\n var cp2 = controlPoints[i * 2 + 1];\n var p = points[(i + 1) % len];\n ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);\n }\n } else {\n if (smooth === 'spline') {\n points = smoothSpline(points, closePath);\n }\n\n ctx.moveTo(points[0][0], points[0][1]);\n\n for (var i = 1, l = points.length; i < l; i++) {\n ctx.lineTo(points[i][0], points[i][1]);\n }\n }\n\n closePath && ctx.closePath();\n }\n}\n\nexports.buildPath = buildPath;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/helper/poly.js\n// module id = 157\n// module chunks = 39","var Path = require(\"../Path\");\n\nvar polyHelper = require(\"../helper/poly\");\n\n/**\n * @module zrender/graphic/shape/Polyline\n */\nvar _default = Path.extend({\n type: 'polyline',\n shape: {\n points: null,\n smooth: false,\n smoothConstraint: null\n },\n style: {\n stroke: '#000',\n fill: null\n },\n buildPath: function (ctx, shape) {\n polyHelper.buildPath(ctx, shape, false);\n }\n});\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/shape/Polyline.js\n// module id = 158\n// module chunks = 39","/**\n * Sub-pixel optimize for canvas rendering, prevent from blur\n * when rendering a thin vertical/horizontal line.\n */\nvar round = Math.round;\n/**\n * Sub pixel optimize line for canvas\n *\n * @param {Object} outputShape The modification will be performed on `outputShape`.\n * `outputShape` and `inputShape` can be the same object.\n * `outputShape` object can be used repeatly, because all of\n * the `x1`, `x2`, `y1`, `y2` will be assigned in this method.\n * @param {Object} [inputShape]\n * @param {number} [inputShape.x1]\n * @param {number} [inputShape.y1]\n * @param {number} [inputShape.x2]\n * @param {number} [inputShape.y2]\n * @param {Object} [style]\n * @param {number} [style.lineWidth]\n */\n\nfunction subPixelOptimizeLine(outputShape, inputShape, style) {\n var lineWidth = style && style.lineWidth;\n\n if (!inputShape || !lineWidth) {\n return;\n }\n\n var x1 = inputShape.x1;\n var x2 = inputShape.x2;\n var y1 = inputShape.y1;\n var y2 = inputShape.y2;\n\n if (round(x1 * 2) === round(x2 * 2)) {\n outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\n } else {\n outputShape.x1 = x1;\n outputShape.x2 = x2;\n }\n\n if (round(y1 * 2) === round(y2 * 2)) {\n outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\n } else {\n outputShape.y1 = y1;\n outputShape.y2 = y2;\n }\n}\n/**\n * Sub pixel optimize rect for canvas\n *\n * @param {Object} outputShape The modification will be performed on `outputShape`.\n * `outputShape` and `inputShape` can be the same object.\n * `outputShape` object can be used repeatly, because all of\n * the `x`, `y`, `width`, `height` will be assigned in this method.\n * @param {Object} [inputShape]\n * @param {number} [inputShape.x]\n * @param {number} [inputShape.y]\n * @param {number} [inputShape.width]\n * @param {number} [inputShape.height]\n * @param {Object} [style]\n * @param {number} [style.lineWidth]\n */\n\n\nfunction subPixelOptimizeRect(outputShape, inputShape, style) {\n var lineWidth = style && style.lineWidth;\n\n if (!inputShape || !lineWidth) {\n return;\n }\n\n var originX = inputShape.x;\n var originY = inputShape.y;\n var originWidth = inputShape.width;\n var originHeight = inputShape.height;\n outputShape.x = subPixelOptimize(originX, lineWidth, true);\n outputShape.y = subPixelOptimize(originY, lineWidth, true);\n outputShape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - outputShape.x, originWidth === 0 ? 0 : 1);\n outputShape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - outputShape.y, originHeight === 0 ? 0 : 1);\n}\n/**\n * Sub pixel optimize for canvas\n *\n * @param {number} position Coordinate, such as x, y\n * @param {number} lineWidth Should be nonnegative integer.\n * @param {boolean=} positiveOrNegative Default false (negative).\n * @return {number} Optimized position.\n */\n\n\nfunction subPixelOptimize(position, lineWidth, positiveOrNegative) {\n // Assure that (position + lineWidth / 2) is near integer edge,\n // otherwise line will be fuzzy in canvas.\n var doubledPosition = round(position * 2);\n return (doubledPosition + round(lineWidth)) % 2 === 0 ? doubledPosition / 2 : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\n}\n\nexports.subPixelOptimizeLine = subPixelOptimizeLine;\nexports.subPixelOptimizeRect = subPixelOptimizeRect;\nexports.subPixelOptimize = subPixelOptimize;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js\n// module id = 159\n// module chunks = 39","var Path = require(\"../Path\");\n\nvar _subPixelOptimize = require(\"../helper/subPixelOptimize\");\n\nvar subPixelOptimizeLine = _subPixelOptimize.subPixelOptimizeLine;\n\n/**\n * 直线\n * @module zrender/graphic/shape/Line\n */\n// Avoid create repeatly.\nvar subPixelOptimizeOutputShape = {};\n\nvar _default = Path.extend({\n type: 'line',\n shape: {\n // Start point\n x1: 0,\n y1: 0,\n // End point\n x2: 0,\n y2: 0,\n percent: 1\n },\n style: {\n stroke: '#000',\n fill: null\n },\n buildPath: function (ctx, shape) {\n var x1;\n var y1;\n var x2;\n var y2;\n\n if (this.subPixelOptimize) {\n subPixelOptimizeLine(subPixelOptimizeOutputShape, shape, this.style);\n x1 = subPixelOptimizeOutputShape.x1;\n y1 = subPixelOptimizeOutputShape.y1;\n x2 = subPixelOptimizeOutputShape.x2;\n y2 = subPixelOptimizeOutputShape.y2;\n } else {\n x1 = shape.x1;\n y1 = shape.y1;\n x2 = shape.x2;\n y2 = shape.y2;\n }\n\n var percent = shape.percent;\n\n if (percent === 0) {\n return;\n }\n\n ctx.moveTo(x1, y1);\n\n if (percent < 1) {\n x2 = x1 * (1 - percent) + x2 * percent;\n y2 = y1 * (1 - percent) + y2 * percent;\n }\n\n ctx.lineTo(x2, y2);\n },\n\n /**\n * Get point at percent\n * @param {number} percent\n * @return {Array.}\n */\n pointAt: function (p) {\n var shape = this.shape;\n return [shape.x1 * (1 - p) + shape.x2 * p, shape.y1 * (1 - p) + shape.y2 * p];\n }\n});\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/shape/Line.js\n// module id = 160\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _model = require(\"../../util/model\");\n\nvar makeInner = _model.makeInner;\nvar normalizeToArray = _model.normalizeToArray;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar inner = makeInner();\n\nfunction getNearestColorPalette(colors, requestColorNum) {\n var paletteNum = colors.length; // TODO colors must be in order\n\n for (var i = 0; i < paletteNum; i++) {\n if (colors[i].length > requestColorNum) {\n return colors[i];\n }\n }\n\n return colors[paletteNum - 1];\n}\n\nvar _default = {\n clearColorPalette: function () {\n inner(this).colorIdx = 0;\n inner(this).colorNameMap = {};\n },\n\n /**\n * @param {string} name MUST NOT be null/undefined. Otherwise call this function\n * twise with the same parameters will get different result.\n * @param {Object} [scope=this]\n * @param {Object} [requestColorNum]\n * @return {string} color string.\n */\n getColorFromPalette: function (name, scope, requestColorNum) {\n scope = scope || this;\n var scopeFields = inner(scope);\n var colorIdx = scopeFields.colorIdx || 0;\n var colorNameMap = scopeFields.colorNameMap = scopeFields.colorNameMap || {}; // Use `hasOwnProperty` to avoid conflict with Object.prototype.\n\n if (colorNameMap.hasOwnProperty(name)) {\n return colorNameMap[name];\n }\n\n var defaultColorPalette = normalizeToArray(this.get('color', true));\n var layeredColorPalette = this.get('colorLayer', true);\n var colorPalette = requestColorNum == null || !layeredColorPalette ? defaultColorPalette : getNearestColorPalette(layeredColorPalette, requestColorNum); // In case can't find in layered color palette.\n\n colorPalette = colorPalette || defaultColorPalette;\n\n if (!colorPalette || !colorPalette.length) {\n return;\n }\n\n var color = colorPalette[colorIdx];\n\n if (name) {\n colorNameMap[name] = color;\n }\n\n scopeFields.colorIdx = (colorIdx + 1) % colorPalette.length;\n return color;\n }\n};\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/model/mixin/colorPalette.js\n// module id = 161\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _config = require(\"../config\");\n\nvar __DEV__ = _config.__DEV__;\n\nvar _util = require(\"zrender/lib/core/util\");\n\nvar createHashMap = _util.createHashMap;\nvar retrieve = _util.retrieve;\nvar each = _util.each;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Helper for model references.\n * There are many manners to refer axis/coordSys.\n */\n// TODO\n// merge relevant logic to this file?\n// check: \"modelHelper\" of tooltip and \"BrushTargetManager\".\n\n/**\n * @return {Object} For example:\n * {\n * coordSysName: 'cartesian2d',\n * coordSysDims: ['x', 'y', ...],\n * axisMap: HashMap({\n * x: xAxisModel,\n * y: yAxisModel\n * }),\n * categoryAxisMap: HashMap({\n * x: xAxisModel,\n * y: undefined\n * }),\n * // It also indicate that whether there is category axis.\n * firstCategoryDimIndex: 1,\n * // To replace user specified encode.\n * }\n */\nfunction getCoordSysDefineBySeries(seriesModel) {\n var coordSysName = seriesModel.get('coordinateSystem');\n var result = {\n coordSysName: coordSysName,\n coordSysDims: [],\n axisMap: createHashMap(),\n categoryAxisMap: createHashMap()\n };\n var fetch = fetchers[coordSysName];\n\n if (fetch) {\n fetch(seriesModel, result, result.axisMap, result.categoryAxisMap);\n return result;\n }\n}\n\nvar fetchers = {\n cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) {\n var xAxisModel = seriesModel.getReferringComponents('xAxis')[0];\n var yAxisModel = seriesModel.getReferringComponents('yAxis')[0];\n result.coordSysDims = ['x', 'y'];\n axisMap.set('x', xAxisModel);\n axisMap.set('y', yAxisModel);\n\n if (isCategory(xAxisModel)) {\n categoryAxisMap.set('x', xAxisModel);\n result.firstCategoryDimIndex = 0;\n }\n\n if (isCategory(yAxisModel)) {\n categoryAxisMap.set('y', yAxisModel);\n result.firstCategoryDimIndex = 1;\n }\n },\n singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) {\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis')[0];\n result.coordSysDims = ['single'];\n axisMap.set('single', singleAxisModel);\n\n if (isCategory(singleAxisModel)) {\n categoryAxisMap.set('single', singleAxisModel);\n result.firstCategoryDimIndex = 0;\n }\n },\n polar: function (seriesModel, result, axisMap, categoryAxisMap) {\n var polarModel = seriesModel.getReferringComponents('polar')[0];\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\n result.coordSysDims = ['radius', 'angle'];\n axisMap.set('radius', radiusAxisModel);\n axisMap.set('angle', angleAxisModel);\n\n if (isCategory(radiusAxisModel)) {\n categoryAxisMap.set('radius', radiusAxisModel);\n result.firstCategoryDimIndex = 0;\n }\n\n if (isCategory(angleAxisModel)) {\n categoryAxisMap.set('angle', angleAxisModel);\n result.firstCategoryDimIndex = 1;\n }\n },\n geo: function (seriesModel, result, axisMap, categoryAxisMap) {\n result.coordSysDims = ['lng', 'lat'];\n },\n parallel: function (seriesModel, result, axisMap, categoryAxisMap) {\n var ecModel = seriesModel.ecModel;\n var parallelModel = ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\n var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice();\n each(parallelModel.parallelAxisIndex, function (axisIndex, index) {\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\n var axisDim = coordSysDims[index];\n axisMap.set(axisDim, axisModel);\n\n if (isCategory(axisModel) && result.firstCategoryDimIndex == null) {\n categoryAxisMap.set(axisDim, axisModel);\n result.firstCategoryDimIndex = index;\n }\n });\n }\n};\n\nfunction isCategory(axisModel) {\n return axisModel.get('type') === 'category';\n}\n\nexports.getCoordSysDefineBySeries = getCoordSysDefineBySeries;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/model/referHelper.js\n// module id = 162\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar echartsAPIList = ['getDom', 'getZr', 'getWidth', 'getHeight', 'getDevicePixelRatio', 'dispatchAction', 'isDisposed', 'on', 'off', 'getDataURL', 'getConnectedDataURL', 'getModel', 'getOption', 'getViewOfComponentModel', 'getViewOfSeriesModel']; // And `getCoordinateSystems` and `getComponentByElement` will be injected in echarts.js\n\nfunction ExtensionAPI(chartInstance) {\n zrUtil.each(echartsAPIList, function (name) {\n this[name] = zrUtil.bind(chartInstance[name], chartInstance);\n }, this);\n}\n\nvar _default = ExtensionAPI;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/ExtensionAPI.js\n// module id = 163\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar ComponentModel = require(\"../model/Component\");\n\nvar ComponentView = require(\"../view/Component\");\n\nvar _sourceHelper = require(\"../data/helper/sourceHelper\");\n\nvar detectSourceFormat = _sourceHelper.detectSourceFormat;\n\nvar _sourceType = require(\"../data/helper/sourceType\");\n\nvar SERIES_LAYOUT_BY_COLUMN = _sourceType.SERIES_LAYOUT_BY_COLUMN;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * This module is imported by echarts directly.\n *\n * Notice:\n * Always keep this file exists for backward compatibility.\n * Because before 4.1.0, dataset is an optional component,\n * some users may import this module manually.\n */\nComponentModel.extend({\n type: 'dataset',\n\n /**\n * @protected\n */\n defaultOption: {\n // 'row', 'column'\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\n // null/'auto': auto detect header, see \"module:echarts/data/helper/sourceHelper\"\n sourceHeader: null,\n dimensions: null,\n source: null\n },\n optionUpdated: function () {\n detectSourceFormat(this);\n }\n});\nComponentView.extend({\n type: 'dataset'\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/dataset.js\n// module id = 164\n// module chunks = 39","var Group = require(\"../container/Group\");\n\nvar ZImage = require(\"../graphic/Image\");\n\nvar Text = require(\"../graphic/Text\");\n\nvar Circle = require(\"../graphic/shape/Circle\");\n\nvar Rect = require(\"../graphic/shape/Rect\");\n\nvar Ellipse = require(\"../graphic/shape/Ellipse\");\n\nvar Line = require(\"../graphic/shape/Line\");\n\nvar Path = require(\"../graphic/Path\");\n\nvar Polygon = require(\"../graphic/shape/Polygon\");\n\nvar Polyline = require(\"../graphic/shape/Polyline\");\n\nvar LinearGradient = require(\"../graphic/LinearGradient\");\n\nvar Style = require(\"../graphic/Style\");\n\nvar matrix = require(\"../core/matrix\");\n\nvar _path = require(\"./path\");\n\nvar createFromString = _path.createFromString;\n\nvar _util = require(\"../core/util\");\n\nvar isString = _util.isString;\nvar extend = _util.extend;\nvar defaults = _util.defaults;\nvar trim = _util.trim;\nvar each = _util.each;\n// import RadialGradient from '../graphic/RadialGradient';\n// import Pattern from '../graphic/Pattern';\n// import * as vector from '../core/vector';\n// Most of the values can be separated by comma and/or white space.\nvar DILIMITER_REG = /[\\s,]+/;\n/**\n * For big svg string, this method might be time consuming.\n *\n * @param {string} svg xml string\n * @return {Object} xml root.\n */\n\nfunction parseXML(svg) {\n if (isString(svg)) {\n var parser = new DOMParser();\n svg = parser.parseFromString(svg, 'text/xml');\n } // Document node. If using $.get, doc node may be input.\n\n\n if (svg.nodeType === 9) {\n svg = svg.firstChild;\n } // nodeName of is also 'svg'.\n\n\n while (svg.nodeName.toLowerCase() !== 'svg' || svg.nodeType !== 1) {\n svg = svg.nextSibling;\n }\n\n return svg;\n}\n\nfunction SVGParser() {\n this._defs = {};\n this._root = null;\n this._isDefine = false;\n this._isText = false;\n}\n\nSVGParser.prototype.parse = function (xml, opt) {\n opt = opt || {};\n var svg = parseXML(xml);\n\n if (!svg) {\n throw new Error('Illegal svg');\n }\n\n var root = new Group();\n this._root = root; // parse view port\n\n var viewBox = svg.getAttribute('viewBox') || ''; // If width/height not specified, means \"100%\" of `opt.width/height`.\n // TODO: Other percent value not supported yet.\n\n var width = parseFloat(svg.getAttribute('width') || opt.width);\n var height = parseFloat(svg.getAttribute('height') || opt.height); // If width/height not specified, set as null for output.\n\n isNaN(width) && (width = null);\n isNaN(height) && (height = null); // Apply inline style on svg element.\n\n parseAttributes(svg, root, null, true);\n var child = svg.firstChild;\n\n while (child) {\n this._parseNode(child, root);\n\n child = child.nextSibling;\n }\n\n var viewBoxRect;\n var viewBoxTransform;\n\n if (viewBox) {\n var viewBoxArr = trim(viewBox).split(DILIMITER_REG); // Some invalid case like viewBox: 'none'.\n\n if (viewBoxArr.length >= 4) {\n viewBoxRect = {\n x: parseFloat(viewBoxArr[0] || 0),\n y: parseFloat(viewBoxArr[1] || 0),\n width: parseFloat(viewBoxArr[2]),\n height: parseFloat(viewBoxArr[3])\n };\n }\n }\n\n if (viewBoxRect && width != null && height != null) {\n viewBoxTransform = makeViewBoxTransform(viewBoxRect, width, height);\n\n if (!opt.ignoreViewBox) {\n // If set transform on the output group, it probably bring trouble when\n // some users only intend to show the clipped content inside the viewBox,\n // but not intend to transform the output group. So we keep the output\n // group no transform. If the user intend to use the viewBox as a\n // camera, just set `opt.ignoreViewBox` as `true` and set transfrom\n // manually according to the viewBox info in the output of this method.\n var elRoot = root;\n root = new Group();\n root.add(elRoot);\n elRoot.scale = viewBoxTransform.scale.slice();\n elRoot.position = viewBoxTransform.position.slice();\n }\n } // Some shapes might be overflow the viewport, which should be\n // clipped despite whether the viewBox is used, as the SVG does.\n\n\n if (!opt.ignoreRootClip && width != null && height != null) {\n root.setClipPath(new Rect({\n shape: {\n x: 0,\n y: 0,\n width: width,\n height: height\n }\n }));\n } // Set width/height on group just for output the viewport size.\n\n\n return {\n root: root,\n width: width,\n height: height,\n viewBoxRect: viewBoxRect,\n viewBoxTransform: viewBoxTransform\n };\n};\n\nSVGParser.prototype._parseNode = function (xmlNode, parentGroup) {\n var nodeName = xmlNode.nodeName.toLowerCase(); // TODO\n // support in svg, where nodeName is 'style',\n // CSS classes is defined globally wherever the style tags are declared.\n\n if (nodeName === 'defs') {\n // define flag\n this._isDefine = true;\n } else if (nodeName === 'text') {\n this._isText = true;\n }\n\n var el;\n\n if (this._isDefine) {\n var parser = defineParsers[nodeName];\n\n if (parser) {\n var def = parser.call(this, xmlNode);\n var id = xmlNode.getAttribute('id');\n\n if (id) {\n this._defs[id] = def;\n }\n }\n } else {\n var parser = nodeParsers[nodeName];\n\n if (parser) {\n el = parser.call(this, xmlNode, parentGroup);\n parentGroup.add(el);\n }\n }\n\n var child = xmlNode.firstChild;\n\n while (child) {\n if (child.nodeType === 1) {\n this._parseNode(child, el);\n } // Is text\n\n\n if (child.nodeType === 3 && this._isText) {\n this._parseText(child, el);\n }\n\n child = child.nextSibling;\n } // Quit define\n\n\n if (nodeName === 'defs') {\n this._isDefine = false;\n } else if (nodeName === 'text') {\n this._isText = false;\n }\n};\n\nSVGParser.prototype._parseText = function (xmlNode, parentGroup) {\n if (xmlNode.nodeType === 1) {\n var dx = xmlNode.getAttribute('dx') || 0;\n var dy = xmlNode.getAttribute('dy') || 0;\n this._textX += parseFloat(dx);\n this._textY += parseFloat(dy);\n }\n\n var text = new Text({\n style: {\n text: xmlNode.textContent,\n transformText: true\n },\n position: [this._textX || 0, this._textY || 0]\n });\n inheritStyle(parentGroup, text);\n parseAttributes(xmlNode, text, this._defs);\n var fontSize = text.style.fontSize;\n\n if (fontSize && fontSize < 9) {\n // PENDING\n text.style.fontSize = 9;\n text.scale = text.scale || [1, 1];\n text.scale[0] *= fontSize / 9;\n text.scale[1] *= fontSize / 9;\n }\n\n var rect = text.getBoundingRect();\n this._textX += rect.width;\n parentGroup.add(text);\n return text;\n};\n\nvar nodeParsers = {\n 'g': function (xmlNode, parentGroup) {\n var g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defs);\n return g;\n },\n 'rect': function (xmlNode, parentGroup) {\n var rect = new Rect();\n inheritStyle(parentGroup, rect);\n parseAttributes(xmlNode, rect, this._defs);\n rect.setShape({\n x: parseFloat(xmlNode.getAttribute('x') || 0),\n y: parseFloat(xmlNode.getAttribute('y') || 0),\n width: parseFloat(xmlNode.getAttribute('width') || 0),\n height: parseFloat(xmlNode.getAttribute('height') || 0)\n }); // console.log(xmlNode.getAttribute('transform'));\n // console.log(rect.transform);\n\n return rect;\n },\n 'circle': function (xmlNode, parentGroup) {\n var circle = new Circle();\n inheritStyle(parentGroup, circle);\n parseAttributes(xmlNode, circle, this._defs);\n circle.setShape({\n cx: parseFloat(xmlNode.getAttribute('cx') || 0),\n cy: parseFloat(xmlNode.getAttribute('cy') || 0),\n r: parseFloat(xmlNode.getAttribute('r') || 0)\n });\n return circle;\n },\n 'line': function (xmlNode, parentGroup) {\n var line = new Line();\n inheritStyle(parentGroup, line);\n parseAttributes(xmlNode, line, this._defs);\n line.setShape({\n x1: parseFloat(xmlNode.getAttribute('x1') || 0),\n y1: parseFloat(xmlNode.getAttribute('y1') || 0),\n x2: parseFloat(xmlNode.getAttribute('x2') || 0),\n y2: parseFloat(xmlNode.getAttribute('y2') || 0)\n });\n return line;\n },\n 'ellipse': function (xmlNode, parentGroup) {\n var ellipse = new Ellipse();\n inheritStyle(parentGroup, ellipse);\n parseAttributes(xmlNode, ellipse, this._defs);\n ellipse.setShape({\n cx: parseFloat(xmlNode.getAttribute('cx') || 0),\n cy: parseFloat(xmlNode.getAttribute('cy') || 0),\n rx: parseFloat(xmlNode.getAttribute('rx') || 0),\n ry: parseFloat(xmlNode.getAttribute('ry') || 0)\n });\n return ellipse;\n },\n 'polygon': function (xmlNode, parentGroup) {\n var points = xmlNode.getAttribute('points');\n\n if (points) {\n points = parsePoints(points);\n }\n\n var polygon = new Polygon({\n shape: {\n points: points || []\n }\n });\n inheritStyle(parentGroup, polygon);\n parseAttributes(xmlNode, polygon, this._defs);\n return polygon;\n },\n 'polyline': function (xmlNode, parentGroup) {\n var path = new Path();\n inheritStyle(parentGroup, path);\n parseAttributes(xmlNode, path, this._defs);\n var points = xmlNode.getAttribute('points');\n\n if (points) {\n points = parsePoints(points);\n }\n\n var polyline = new Polyline({\n shape: {\n points: points || []\n }\n });\n return polyline;\n },\n 'image': function (xmlNode, parentGroup) {\n var img = new ZImage();\n inheritStyle(parentGroup, img);\n parseAttributes(xmlNode, img, this._defs);\n img.setStyle({\n image: xmlNode.getAttribute('xlink:href'),\n x: xmlNode.getAttribute('x'),\n y: xmlNode.getAttribute('y'),\n width: xmlNode.getAttribute('width'),\n height: xmlNode.getAttribute('height')\n });\n return img;\n },\n 'text': function (xmlNode, parentGroup) {\n var x = xmlNode.getAttribute('x') || 0;\n var y = xmlNode.getAttribute('y') || 0;\n var dx = xmlNode.getAttribute('dx') || 0;\n var dy = xmlNode.getAttribute('dy') || 0;\n this._textX = parseFloat(x) + parseFloat(dx);\n this._textY = parseFloat(y) + parseFloat(dy);\n var g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defs);\n return g;\n },\n 'tspan': function (xmlNode, parentGroup) {\n var x = xmlNode.getAttribute('x');\n var y = xmlNode.getAttribute('y');\n\n if (x != null) {\n // new offset x\n this._textX = parseFloat(x);\n }\n\n if (y != null) {\n // new offset y\n this._textY = parseFloat(y);\n }\n\n var dx = xmlNode.getAttribute('dx') || 0;\n var dy = xmlNode.getAttribute('dy') || 0;\n var g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defs);\n this._textX += dx;\n this._textY += dy;\n return g;\n },\n 'path': function (xmlNode, parentGroup) {\n // TODO svg fill rule\n // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule\n // path.style.globalCompositeOperation = 'xor';\n var d = xmlNode.getAttribute('d') || ''; // Performance sensitive.\n\n var path = createFromString(d);\n inheritStyle(parentGroup, path);\n parseAttributes(xmlNode, path, this._defs);\n return path;\n }\n};\nvar defineParsers = {\n 'lineargradient': function (xmlNode) {\n var x1 = parseInt(xmlNode.getAttribute('x1') || 0, 10);\n var y1 = parseInt(xmlNode.getAttribute('y1') || 0, 10);\n var x2 = parseInt(xmlNode.getAttribute('x2') || 10, 10);\n var y2 = parseInt(xmlNode.getAttribute('y2') || 0, 10);\n var gradient = new LinearGradient(x1, y1, x2, y2);\n\n _parseGradientColorStops(xmlNode, gradient);\n\n return gradient;\n },\n 'radialgradient': function (xmlNode) {}\n};\n\nfunction _parseGradientColorStops(xmlNode, gradient) {\n var stop = xmlNode.firstChild;\n\n while (stop) {\n if (stop.nodeType === 1) {\n var offset = stop.getAttribute('offset');\n\n if (offset.indexOf('%') > 0) {\n // percentage\n offset = parseInt(offset, 10) / 100;\n } else if (offset) {\n // number from 0 to 1\n offset = parseFloat(offset);\n } else {\n offset = 0;\n }\n\n var stopColor = stop.getAttribute('stop-color') || '#000000';\n gradient.addColorStop(offset, stopColor);\n }\n\n stop = stop.nextSibling;\n }\n}\n\nfunction inheritStyle(parent, child) {\n if (parent && parent.__inheritedStyle) {\n if (!child.__inheritedStyle) {\n child.__inheritedStyle = {};\n }\n\n defaults(child.__inheritedStyle, parent.__inheritedStyle);\n }\n}\n\nfunction parsePoints(pointsString) {\n var list = trim(pointsString).split(DILIMITER_REG);\n var points = [];\n\n for (var i = 0; i < list.length; i += 2) {\n var x = parseFloat(list[i]);\n var y = parseFloat(list[i + 1]);\n points.push([x, y]);\n }\n\n return points;\n}\n\nvar attributesMap = {\n 'fill': 'fill',\n 'stroke': 'stroke',\n 'stroke-width': 'lineWidth',\n 'opacity': 'opacity',\n 'fill-opacity': 'fillOpacity',\n 'stroke-opacity': 'strokeOpacity',\n 'stroke-dasharray': 'lineDash',\n 'stroke-dashoffset': 'lineDashOffset',\n 'stroke-linecap': 'lineCap',\n 'stroke-linejoin': 'lineJoin',\n 'stroke-miterlimit': 'miterLimit',\n 'font-family': 'fontFamily',\n 'font-size': 'fontSize',\n 'font-style': 'fontStyle',\n 'font-weight': 'fontWeight',\n 'text-align': 'textAlign',\n 'alignment-baseline': 'textBaseline'\n};\n\nfunction parseAttributes(xmlNode, el, defs, onlyInlineStyle) {\n var zrStyle = el.__inheritedStyle || {};\n var isTextEl = el.type === 'text'; // TODO Shadow\n\n if (xmlNode.nodeType === 1) {\n parseTransformAttribute(xmlNode, el);\n extend(zrStyle, parseStyleAttribute(xmlNode));\n\n if (!onlyInlineStyle) {\n for (var svgAttrName in attributesMap) {\n if (attributesMap.hasOwnProperty(svgAttrName)) {\n var attrValue = xmlNode.getAttribute(svgAttrName);\n\n if (attrValue != null) {\n zrStyle[attributesMap[svgAttrName]] = attrValue;\n }\n }\n }\n }\n }\n\n var elFillProp = isTextEl ? 'textFill' : 'fill';\n var elStrokeProp = isTextEl ? 'textStroke' : 'stroke';\n el.style = el.style || new Style();\n var elStyle = el.style;\n zrStyle.fill != null && elStyle.set(elFillProp, getPaint(zrStyle.fill, defs));\n zrStyle.stroke != null && elStyle.set(elStrokeProp, getPaint(zrStyle.stroke, defs));\n each(['lineWidth', 'opacity', 'fillOpacity', 'strokeOpacity', 'miterLimit', 'fontSize'], function (propName) {\n var elPropName = propName === 'lineWidth' && isTextEl ? 'textStrokeWidth' : propName;\n zrStyle[propName] != null && elStyle.set(elPropName, parseFloat(zrStyle[propName]));\n });\n\n if (!zrStyle.textBaseline || zrStyle.textBaseline === 'auto') {\n zrStyle.textBaseline = 'alphabetic';\n }\n\n if (zrStyle.textBaseline === 'alphabetic') {\n zrStyle.textBaseline = 'bottom';\n }\n\n if (zrStyle.textAlign === 'start') {\n zrStyle.textAlign = 'left';\n }\n\n if (zrStyle.textAlign === 'end') {\n zrStyle.textAlign = 'right';\n }\n\n each(['lineDashOffset', 'lineCap', 'lineJoin', 'fontWeight', 'fontFamily', 'fontStyle', 'textAlign', 'textBaseline'], function (propName) {\n zrStyle[propName] != null && elStyle.set(propName, zrStyle[propName]);\n });\n\n if (zrStyle.lineDash) {\n el.style.lineDash = trim(zrStyle.lineDash).split(DILIMITER_REG);\n }\n\n if (elStyle[elStrokeProp] && elStyle[elStrokeProp] !== 'none') {\n // enable stroke\n el[elStrokeProp] = true;\n }\n\n el.__inheritedStyle = zrStyle;\n}\n\nvar urlRegex = /url\\(\\s*#(.*?)\\)/;\n\nfunction getPaint(str, defs) {\n // if (str === 'none') {\n // return;\n // }\n var urlMatch = defs && str && str.match(urlRegex);\n\n if (urlMatch) {\n var url = trim(urlMatch[1]);\n var def = defs[url];\n return def;\n }\n\n return str;\n}\n\nvar transformRegex = /(translate|scale|rotate|skewX|skewY|matrix)\\(([\\-\\s0-9\\.e,]*)\\)/g;\n\nfunction parseTransformAttribute(xmlNode, node) {\n var transform = xmlNode.getAttribute('transform');\n\n if (transform) {\n transform = transform.replace(/,/g, ' ');\n var m = null;\n var transformOps = [];\n transform.replace(transformRegex, function (str, type, value) {\n transformOps.push(type, value);\n });\n\n for (var i = transformOps.length - 1; i > 0; i -= 2) {\n var value = transformOps[i];\n var type = transformOps[i - 1];\n m = m || matrix.create();\n\n switch (type) {\n case 'translate':\n value = trim(value).split(DILIMITER_REG);\n matrix.translate(m, m, [parseFloat(value[0]), parseFloat(value[1] || 0)]);\n break;\n\n case 'scale':\n value = trim(value).split(DILIMITER_REG);\n matrix.scale(m, m, [parseFloat(value[0]), parseFloat(value[1] || value[0])]);\n break;\n\n case 'rotate':\n value = trim(value).split(DILIMITER_REG);\n matrix.rotate(m, m, parseFloat(value[0]));\n break;\n\n case 'skew':\n value = trim(value).split(DILIMITER_REG);\n console.warn('Skew transform is not supported yet');\n break;\n\n case 'matrix':\n var value = trim(value).split(DILIMITER_REG);\n m[0] = parseFloat(value[0]);\n m[1] = parseFloat(value[1]);\n m[2] = parseFloat(value[2]);\n m[3] = parseFloat(value[3]);\n m[4] = parseFloat(value[4]);\n m[5] = parseFloat(value[5]);\n break;\n }\n }\n\n node.setLocalTransform(m);\n }\n} // Value may contain space.\n\n\nvar styleRegex = /([^\\s:;]+)\\s*:\\s*([^:;]+)/g;\n\nfunction parseStyleAttribute(xmlNode) {\n var style = xmlNode.getAttribute('style');\n var result = {};\n\n if (!style) {\n return result;\n }\n\n var styleList = {};\n styleRegex.lastIndex = 0;\n var styleRegResult;\n\n while ((styleRegResult = styleRegex.exec(style)) != null) {\n styleList[styleRegResult[1]] = styleRegResult[2];\n }\n\n for (var svgAttrName in attributesMap) {\n if (attributesMap.hasOwnProperty(svgAttrName) && styleList[svgAttrName] != null) {\n result[attributesMap[svgAttrName]] = styleList[svgAttrName];\n }\n }\n\n return result;\n}\n/**\n * @param {Array.} viewBoxRect\n * @param {number} width\n * @param {number} height\n * @return {Object} {scale, position}\n */\n\n\nfunction makeViewBoxTransform(viewBoxRect, width, height) {\n var scaleX = width / viewBoxRect.width;\n var scaleY = height / viewBoxRect.height;\n var scale = Math.min(scaleX, scaleY); // preserveAspectRatio 'xMidYMid'\n\n var viewBoxScale = [scale, scale];\n var viewBoxPosition = [-(viewBoxRect.x + viewBoxRect.width / 2) * scale + width / 2, -(viewBoxRect.y + viewBoxRect.height / 2) * scale + height / 2];\n return {\n scale: viewBoxScale,\n position: viewBoxPosition\n };\n}\n/**\n * @param {string|XMLElement} xml\n * @param {Object} [opt]\n * @param {number} [opt.width] Default width if svg width not specified or is a percent value.\n * @param {number} [opt.height] Default height if svg height not specified or is a percent value.\n * @param {boolean} [opt.ignoreViewBox]\n * @param {boolean} [opt.ignoreRootClip]\n * @return {Object} result:\n * {\n * root: Group, The root of the the result tree of zrender shapes,\n * width: number, the viewport width of the SVG,\n * height: number, the viewport height of the SVG,\n * viewBoxRect: {x, y, width, height}, the declared viewBox rect of the SVG, if exists,\n * viewBoxTransform: the {scale, position} calculated by viewBox and viewport, is exists.\n * }\n */\n\n\nfunction parseSVG(xml, opt) {\n var parser = new SVGParser();\n return parser.parse(xml, opt);\n}\n\nexports.parseXML = parseXML;\nexports.makeViewBoxTransform = makeViewBoxTransform;\nexports.parseSVG = parseSVG;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/tool/parseSVG.js\n// module id = 165\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrender = require(\"zrender/lib/zrender\");\n\nexports.zrender = zrender;\n\nvar matrix = require(\"zrender/lib/core/matrix\");\n\nexports.matrix = matrix;\n\nvar vector = require(\"zrender/lib/core/vector\");\n\nexports.vector = vector;\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar colorTool = require(\"zrender/lib/tool/color\");\n\nexports.color = colorTool;\n\nvar graphicUtil = require(\"./util/graphic\");\n\nvar numberUtil = require(\"./util/number\");\n\nexports.number = numberUtil;\n\nvar formatUtil = require(\"./util/format\");\n\nexports.format = formatUtil;\n\nvar _throttle = require(\"./util/throttle\");\n\nvar throttle = _throttle.throttle;\nexports.throttle = _throttle.throttle;\n\nvar ecHelper = require(\"./helper\");\n\nexports.helper = ecHelper;\n\nvar parseGeoJSON = require(\"./coord/geo/parseGeoJson\");\n\nexports.parseGeoJSON = parseGeoJSON;\n\nvar _List = require(\"./data/List\");\n\nexports.List = _List;\n\nvar _Model = require(\"./model/Model\");\n\nexports.Model = _Model;\n\nvar _Axis = require(\"./coord/Axis\");\n\nexports.Axis = _Axis;\n\nvar _env = require(\"zrender/lib/core/env\");\n\nexports.env = _env;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Do not mount those modules on 'src/echarts' for better tree shaking.\n */\nvar parseGeoJson = parseGeoJSON;\nvar ecUtil = {};\nzrUtil.each(['map', 'each', 'filter', 'indexOf', 'inherits', 'reduce', 'filter', 'bind', 'curry', 'isArray', 'isString', 'isObject', 'isFunction', 'extend', 'defaults', 'clone', 'merge'], function (name) {\n ecUtil[name] = zrUtil[name];\n});\nvar graphic = {};\nzrUtil.each(['extendShape', 'extendPath', 'makePath', 'makeImage', 'mergePath', 'resizePath', 'createIcon', 'setHoverStyle', 'setLabelStyle', 'setTextStyle', 'setText', 'getFont', 'updateProps', 'initProps', 'getTransform', 'clipPointsByRect', 'clipRectByRect', 'Group', 'Image', 'Text', 'Circle', 'Sector', 'Ring', 'Polygon', 'Polyline', 'Rect', 'Line', 'BezierCurve', 'Arc', 'IncrementalDisplayable', 'CompoundPath', 'LinearGradient', 'RadialGradient', 'BoundingRect'], function (name) {\n graphic[name] = graphicUtil[name];\n});\nexports.parseGeoJson = parseGeoJson;\nexports.util = ecUtil;\nexports.graphic = graphic;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/export.js\n// module id = 166\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _util = require(\"zrender/lib/core/util\");\n\nvar createHashMap = _util.createHashMap;\nvar each = _util.each;\nvar isString = _util.isString;\nvar defaults = _util.defaults;\nvar extend = _util.extend;\nvar isObject = _util.isObject;\nvar clone = _util.clone;\n\nvar _model = require(\"../../util/model\");\n\nvar normalizeToArray = _model.normalizeToArray;\n\nvar _sourceHelper = require(\"./sourceHelper\");\n\nvar guessOrdinal = _sourceHelper.guessOrdinal;\n\nvar Source = require(\"../Source\");\n\nvar _dimensionHelper = require(\"./dimensionHelper\");\n\nvar OTHER_DIMENSIONS = _dimensionHelper.OTHER_DIMENSIONS;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @deprecated\n * Use `echarts/data/helper/createDimensions` instead.\n */\n\n/**\n * @see {module:echarts/test/ut/spec/data/completeDimensions}\n *\n * Complete the dimensions array, by user defined `dimension` and `encode`,\n * and guessing from the data structure.\n * If no 'value' dimension specified, the first no-named dimension will be\n * named as 'value'.\n *\n * @param {Array.} sysDims Necessary dimensions, like ['x', 'y'], which\n * provides not only dim template, but also default order.\n * properties: 'name', 'type', 'displayName'.\n * `name` of each item provides default coord name.\n * [{dimsDef: [string|Object, ...]}, ...] dimsDef of sysDim item provides default dim name, and\n * provide dims count that the sysDim required.\n * [{ordinalMeta}] can be specified.\n * @param {module:echarts/data/Source|Array|Object} source or data (for compatibal with pervious)\n * @param {Object} [opt]\n * @param {Array.} [opt.dimsDef] option.series.dimensions User defined dimensions\n * For example: ['asdf', {name, type}, ...].\n * @param {Object|HashMap} [opt.encodeDef] option.series.encode {x: 2, y: [3, 1], tooltip: [1, 2], label: 3}\n * @param {string} [opt.generateCoord] Generate coord dim with the given name.\n * If not specified, extra dim names will be:\n * 'value', 'value0', 'value1', ...\n * @param {number} [opt.generateCoordCount] By default, the generated dim name is `generateCoord`.\n * If `generateCoordCount` specified, the generated dim names will be:\n * `generateCoord` + 0, `generateCoord` + 1, ...\n * can be Infinity, indicate that use all of the remain columns.\n * @param {number} [opt.dimCount] If not specified, guess by the first data item.\n * @param {number} [opt.encodeDefaulter] If not specified, auto find the next available data dim.\n * @return {Array.} [{\n * name: string mandatory,\n * displayName: string, the origin name in dimsDef, see source helper.\n * If displayName given, the tooltip will displayed vertically.\n * coordDim: string mandatory,\n * coordDimIndex: number mandatory,\n * type: string optional,\n * otherDims: { never null/undefined\n * tooltip: number optional,\n * label: number optional,\n * itemName: number optional,\n * seriesName: number optional,\n * },\n * isExtraCoord: boolean true if coord is generated\n * (not specified in encode and not series specified)\n * other props ...\n * }]\n */\nfunction completeDimensions(sysDims, source, opt) {\n if (!Source.isInstance(source)) {\n source = Source.seriesDataToSource(source);\n }\n\n opt = opt || {};\n sysDims = (sysDims || []).slice();\n var dimsDef = (opt.dimsDef || []).slice();\n var encodeDef = createHashMap(opt.encodeDef);\n var dataDimNameMap = createHashMap();\n var coordDimNameMap = createHashMap(); // var valueCandidate;\n\n var result = [];\n var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimCount); // Apply user defined dims (`name` and `type`) and init result.\n\n for (var i = 0; i < dimCount; i++) {\n var dimDefItem = dimsDef[i] = extend({}, isObject(dimsDef[i]) ? dimsDef[i] : {\n name: dimsDef[i]\n });\n var userDimName = dimDefItem.name;\n var resultItem = result[i] = {\n otherDims: {}\n }; // Name will be applied later for avoiding duplication.\n\n if (userDimName != null && dataDimNameMap.get(userDimName) == null) {\n // Only if `series.dimensions` is defined in option\n // displayName, will be set, and dimension will be diplayed vertically in\n // tooltip by default.\n resultItem.name = resultItem.displayName = userDimName;\n dataDimNameMap.set(userDimName, i);\n }\n\n dimDefItem.type != null && (resultItem.type = dimDefItem.type);\n dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);\n } // Set `coordDim` and `coordDimIndex` by `encodeDef` and normalize `encodeDef`.\n\n\n encodeDef.each(function (dataDims, coordDim) {\n dataDims = normalizeToArray(dataDims).slice(); // Note: It is allowed that `dataDims.length` is `0`, e.g., options is\n // `{encode: {x: -1, y: 1}}`. Should not filter anything in\n // this case.\n\n if (dataDims.length === 1 && dataDims[0] < 0) {\n encodeDef.set(coordDim, false);\n return;\n }\n\n var validDataDims = encodeDef.set(coordDim, []);\n each(dataDims, function (resultDimIdx, idx) {\n // The input resultDimIdx can be dim name or index.\n isString(resultDimIdx) && (resultDimIdx = dataDimNameMap.get(resultDimIdx));\n\n if (resultDimIdx != null && resultDimIdx < dimCount) {\n validDataDims[idx] = resultDimIdx;\n applyDim(result[resultDimIdx], coordDim, idx);\n }\n });\n }); // Apply templetes and default order from `sysDims`.\n\n var availDimIdx = 0;\n each(sysDims, function (sysDimItem, sysDimIndex) {\n var coordDim;\n var sysDimItem;\n var sysDimItemDimsDef;\n var sysDimItemOtherDims;\n\n if (isString(sysDimItem)) {\n coordDim = sysDimItem;\n sysDimItem = {};\n } else {\n coordDim = sysDimItem.name;\n var ordinalMeta = sysDimItem.ordinalMeta;\n sysDimItem.ordinalMeta = null;\n sysDimItem = clone(sysDimItem);\n sysDimItem.ordinalMeta = ordinalMeta; // `coordDimIndex` should not be set directly.\n\n sysDimItemDimsDef = sysDimItem.dimsDef;\n sysDimItemOtherDims = sysDimItem.otherDims;\n sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex = sysDimItem.dimsDef = sysDimItem.otherDims = null;\n }\n\n var dataDims = encodeDef.get(coordDim); // negative resultDimIdx means no need to mapping.\n\n if (dataDims === false) {\n return;\n }\n\n var dataDims = normalizeToArray(dataDims); // dimensions provides default dim sequences.\n\n if (!dataDims.length) {\n for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) {\n while (availDimIdx < result.length && result[availDimIdx].coordDim != null) {\n availDimIdx++;\n }\n\n availDimIdx < result.length && dataDims.push(availDimIdx++);\n }\n } // Apply templates.\n\n\n each(dataDims, function (resultDimIdx, coordDimIndex) {\n var resultItem = result[resultDimIdx];\n applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);\n\n if (resultItem.name == null && sysDimItemDimsDef) {\n var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex];\n !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = {\n name: sysDimItemDimsDefItem\n });\n resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name;\n resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip;\n } // FIXME refactor, currently only used in case: {otherDims: {tooltip: false}}\n\n\n sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims);\n });\n });\n\n function applyDim(resultItem, coordDim, coordDimIndex) {\n if (OTHER_DIMENSIONS.get(coordDim) != null) {\n resultItem.otherDims[coordDim] = coordDimIndex;\n } else {\n resultItem.coordDim = coordDim;\n resultItem.coordDimIndex = coordDimIndex;\n coordDimNameMap.set(coordDim, true);\n }\n } // Make sure the first extra dim is 'value'.\n\n\n var generateCoord = opt.generateCoord;\n var generateCoordCount = opt.generateCoordCount;\n var fromZero = generateCoordCount != null;\n generateCoordCount = generateCoord ? generateCoordCount || 1 : 0;\n var extra = generateCoord || 'value'; // Set dim `name` and other `coordDim` and other props.\n\n for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {\n var resultItem = result[resultDimIdx] = result[resultDimIdx] || {};\n var coordDim = resultItem.coordDim;\n\n if (coordDim == null) {\n resultItem.coordDim = genName(extra, coordDimNameMap, fromZero);\n resultItem.coordDimIndex = 0;\n\n if (!generateCoord || generateCoordCount <= 0) {\n resultItem.isExtraCoord = true;\n }\n\n generateCoordCount--;\n }\n\n resultItem.name == null && (resultItem.name = genName(resultItem.coordDim, dataDimNameMap));\n\n if (resultItem.type == null && guessOrdinal(source, resultDimIdx, resultItem.name)) {\n resultItem.type = 'ordinal';\n }\n }\n\n return result;\n} // ??? TODO\n// Originally detect dimCount by data[0]. Should we\n// optimize it to only by sysDims and dimensions and encode.\n// So only necessary dims will be initialized.\n// But\n// (1) custom series should be considered. where other dims\n// may be visited.\n// (2) sometimes user need to calcualte bubble size or use visualMap\n// on other dimensions besides coordSys needed.\n// So, dims that is not used by system, should be shared in storage?\n\n\nfunction getDimCount(source, sysDims, dimsDef, optDimCount) {\n // Note that the result dimCount should not small than columns count\n // of data, otherwise `dataDimNameMap` checking will be incorrect.\n var dimCount = Math.max(source.dimensionsDetectCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);\n each(sysDims, function (sysDimItem) {\n var sysDimItemDimsDef = sysDimItem.dimsDef;\n sysDimItemDimsDef && (dimCount = Math.max(dimCount, sysDimItemDimsDef.length));\n });\n return dimCount;\n}\n\nfunction genName(name, map, fromZero) {\n if (fromZero || map.get(name) != null) {\n var i = 0;\n\n while (map.get(name + i) != null) {\n i++;\n }\n\n name += i;\n }\n\n map.set(name, true);\n return name;\n}\n\nvar _default = completeDimensions;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/data/helper/completeDimensions.js\n// module id = 167\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _util = require(\"zrender/lib/core/util\");\n\nvar createHashMap = _util.createHashMap;\nvar isObject = _util.isObject;\nvar map = _util.map;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @constructor\n * @param {Object} [opt]\n * @param {Object} [opt.categories=[]]\n * @param {Object} [opt.needCollect=false]\n * @param {Object} [opt.deduplication=false]\n */\nfunction OrdinalMeta(opt) {\n /**\n * @readOnly\n * @type {Array.}\n */\n this.categories = opt.categories || [];\n /**\n * @private\n * @type {boolean}\n */\n\n this._needCollect = opt.needCollect;\n /**\n * @private\n * @type {boolean}\n */\n\n this._deduplication = opt.deduplication;\n /**\n * @private\n * @type {boolean}\n */\n\n this._map;\n}\n/**\n * @param {module:echarts/model/Model} axisModel\n * @return {module:echarts/data/OrdinalMeta}\n */\n\n\nOrdinalMeta.createByAxisModel = function (axisModel) {\n var option = axisModel.option;\n var data = option.data;\n var categories = data && map(data, getName);\n return new OrdinalMeta({\n categories: categories,\n needCollect: !categories,\n // deduplication is default in axis.\n deduplication: option.dedplication !== false\n });\n};\n\nvar proto = OrdinalMeta.prototype;\n/**\n * @param {string} category\n * @return {number} ordinal\n */\n\nproto.getOrdinal = function (category) {\n return getOrCreateMap(this).get(category);\n};\n/**\n * @param {*} category\n * @return {number} The ordinal. If not found, return NaN.\n */\n\n\nproto.parseAndCollect = function (category) {\n var index;\n var needCollect = this._needCollect; // The value of category dim can be the index of the given category set.\n // This feature is only supported when !needCollect, because we should\n // consider a common case: a value is 2017, which is a number but is\n // expected to be tread as a category. This case usually happen in dataset,\n // where it happent to be no need of the index feature.\n\n if (typeof category !== 'string' && !needCollect) {\n return category;\n } // Optimize for the scenario:\n // category is ['2012-01-01', '2012-01-02', ...], where the input\n // data has been ensured not duplicate and is large data.\n // Notice, if a dataset dimension provide categroies, usually echarts\n // should remove duplication except user tell echarts dont do that\n // (set axis.deduplication = false), because echarts do not know whether\n // the values in the category dimension has duplication (consider the\n // parallel-aqi example)\n\n\n if (needCollect && !this._deduplication) {\n index = this.categories.length;\n this.categories[index] = category;\n return index;\n }\n\n var map = getOrCreateMap(this);\n index = map.get(category);\n\n if (index == null) {\n if (needCollect) {\n index = this.categories.length;\n this.categories[index] = category;\n map.set(category, index);\n } else {\n index = NaN;\n }\n }\n\n return index;\n}; // Consider big data, do not create map until needed.\n\n\nfunction getOrCreateMap(ordinalMeta) {\n return ordinalMeta._map || (ordinalMeta._map = createHashMap(ordinalMeta.categories));\n}\n\nfunction getName(obj) {\n if (isObject(obj) && obj.value != null) {\n return obj.value;\n } else {\n return obj + '';\n }\n}\n\nvar _default = OrdinalMeta;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/data/OrdinalMeta.js\n// module id = 168\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar numberUtil = require(\"../util/number\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * For testable.\n */\nvar roundNumber = numberUtil.round;\n/**\n * @param {Array.} extent Both extent[0] and extent[1] should be valid number.\n * Should be extent[0] < extent[1].\n * @param {number} splitNumber splitNumber should be >= 1.\n * @param {number} [minInterval]\n * @param {number} [maxInterval]\n * @return {Object} {interval, intervalPrecision, niceTickExtent}\n */\n\nfunction intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval) {\n var result = {};\n var span = extent[1] - extent[0];\n var interval = result.interval = numberUtil.nice(span / splitNumber, true);\n\n if (minInterval != null && interval < minInterval) {\n interval = result.interval = minInterval;\n }\n\n if (maxInterval != null && interval > maxInterval) {\n interval = result.interval = maxInterval;\n } // Tow more digital for tick.\n\n\n var precision = result.intervalPrecision = getIntervalPrecision(interval); // Niced extent inside original extent\n\n var niceTickExtent = result.niceTickExtent = [roundNumber(Math.ceil(extent[0] / interval) * interval, precision), roundNumber(Math.floor(extent[1] / interval) * interval, precision)];\n fixExtent(niceTickExtent, extent);\n return result;\n}\n/**\n * @param {number} interval\n * @return {number} interval precision\n */\n\n\nfunction getIntervalPrecision(interval) {\n // Tow more digital for tick.\n return numberUtil.getPrecisionSafe(interval) + 2;\n}\n\nfunction clamp(niceTickExtent, idx, extent) {\n niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]);\n} // In some cases (e.g., splitNumber is 1), niceTickExtent may be out of extent.\n\n\nfunction fixExtent(niceTickExtent, extent) {\n !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]);\n !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]);\n clamp(niceTickExtent, 0, extent);\n clamp(niceTickExtent, 1, extent);\n\n if (niceTickExtent[0] > niceTickExtent[1]) {\n niceTickExtent[0] = niceTickExtent[1];\n }\n}\n\nfunction intervalScaleGetTicks(interval, extent, niceTickExtent, intervalPrecision) {\n var ticks = []; // If interval is 0, return [];\n\n if (!interval) {\n return ticks;\n } // Consider this case: using dataZoom toolbox, zoom and zoom.\n\n\n var safeLimit = 10000;\n\n if (extent[0] < niceTickExtent[0]) {\n ticks.push(extent[0]);\n }\n\n var tick = niceTickExtent[0];\n\n while (tick <= niceTickExtent[1]) {\n ticks.push(tick); // Avoid rounding error\n\n tick = roundNumber(tick + interval, intervalPrecision);\n\n if (tick === ticks[ticks.length - 1]) {\n // Consider out of safe float point, e.g.,\n // -3711126.9907707 + 2e-10 === -3711126.9907707\n break;\n }\n\n if (ticks.length > safeLimit) {\n return [];\n }\n } // Consider this case: the last item of ticks is smaller\n // than niceTickExtent[1] and niceTickExtent[1] === extent[1].\n\n\n if (extent[1] > (ticks.length ? ticks[ticks.length - 1] : niceTickExtent[1])) {\n ticks.push(extent[1]);\n }\n\n return ticks;\n}\n\nexports.intervalScaleNiceTicks = intervalScaleNiceTicks;\nexports.getIntervalPrecision = getIntervalPrecision;\nexports.fixExtent = fixExtent;\nexports.intervalScaleGetTicks = intervalScaleGetTicks;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/scale/helper.js\n// module id = 169\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar Region = require(\"./Region\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Parse and decode geo json\n * @module echarts/coord/geo/parseGeoJson\n */\nfunction decode(json) {\n if (!json.UTF8Encoding) {\n return json;\n }\n\n var encodeScale = json.UTF8Scale;\n\n if (encodeScale == null) {\n encodeScale = 1024;\n }\n\n var features = json.features;\n\n for (var f = 0; f < features.length; f++) {\n var feature = features[f];\n var geometry = feature.geometry;\n var coordinates = geometry.coordinates;\n var encodeOffsets = geometry.encodeOffsets;\n\n for (var c = 0; c < coordinates.length; c++) {\n var coordinate = coordinates[c];\n\n if (geometry.type === 'Polygon') {\n coordinates[c] = decodePolygon(coordinate, encodeOffsets[c], encodeScale);\n } else if (geometry.type === 'MultiPolygon') {\n for (var c2 = 0; c2 < coordinate.length; c2++) {\n var polygon = coordinate[c2];\n coordinate[c2] = decodePolygon(polygon, encodeOffsets[c][c2], encodeScale);\n }\n }\n }\n } // Has been decoded\n\n\n json.UTF8Encoding = false;\n return json;\n}\n\nfunction decodePolygon(coordinate, encodeOffsets, encodeScale) {\n var result = [];\n var prevX = encodeOffsets[0];\n var prevY = encodeOffsets[1];\n\n for (var i = 0; i < coordinate.length; i += 2) {\n var x = coordinate.charCodeAt(i) - 64;\n var y = coordinate.charCodeAt(i + 1) - 64; // ZigZag decoding\n\n x = x >> 1 ^ -(x & 1);\n y = y >> 1 ^ -(y & 1); // Delta deocding\n\n x += prevX;\n y += prevY;\n prevX = x;\n prevY = y; // Dequantize\n\n result.push([x / encodeScale, y / encodeScale]);\n }\n\n return result;\n}\n/**\n * @alias module:echarts/coord/geo/parseGeoJson\n * @param {Object} geoJson\n * @return {module:zrender/container/Group}\n */\n\n\nfunction _default(geoJson) {\n decode(geoJson);\n return zrUtil.map(zrUtil.filter(geoJson.features, function (featureObj) {\n // Output of mapshaper may have geometry null\n return featureObj.geometry && featureObj.properties && featureObj.geometry.coordinates.length > 0;\n }), function (featureObj) {\n var properties = featureObj.properties;\n var geo = featureObj.geometry;\n var coordinates = geo.coordinates;\n var geometries = [];\n\n if (geo.type === 'Polygon') {\n geometries.push({\n type: 'polygon',\n // According to the GeoJSON specification.\n // First must be exterior, and the rest are all interior(holes).\n exterior: coordinates[0],\n interiors: coordinates.slice(1)\n });\n }\n\n if (geo.type === 'MultiPolygon') {\n zrUtil.each(coordinates, function (item) {\n if (item[0]) {\n geometries.push({\n type: 'polygon',\n exterior: item[0],\n interiors: item.slice(1)\n });\n }\n });\n }\n\n var region = new Region(properties.name, geometries, properties.cp);\n region.properties = properties;\n return region;\n });\n}\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/coord/geo/parseGeoJson.js\n// module id = 170\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar BoundingRect = require(\"zrender/lib/core/BoundingRect\");\n\nvar bbox = require(\"zrender/lib/core/bbox\");\n\nvar vec2 = require(\"zrender/lib/core/vector\");\n\nvar polygonContain = require(\"zrender/lib/contain/polygon\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @module echarts/coord/geo/Region\n */\n\n/**\n * @param {string|Region} name\n * @param {Array} geometries\n * @param {Array.} cp\n */\nfunction Region(name, geometries, cp) {\n /**\n * @type {string}\n * @readOnly\n */\n this.name = name;\n /**\n * @type {Array.}\n * @readOnly\n */\n\n this.geometries = geometries;\n\n if (!cp) {\n var rect = this.getBoundingRect();\n cp = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n } else {\n cp = [cp[0], cp[1]];\n }\n /**\n * @type {Array.}\n */\n\n\n this.center = cp;\n}\n\nRegion.prototype = {\n constructor: Region,\n properties: null,\n\n /**\n * @return {module:zrender/core/BoundingRect}\n */\n getBoundingRect: function () {\n var rect = this._rect;\n\n if (rect) {\n return rect;\n }\n\n var MAX_NUMBER = Number.MAX_VALUE;\n var min = [MAX_NUMBER, MAX_NUMBER];\n var max = [-MAX_NUMBER, -MAX_NUMBER];\n var min2 = [];\n var max2 = [];\n var geometries = this.geometries;\n\n for (var i = 0; i < geometries.length; i++) {\n // Only support polygon\n if (geometries[i].type !== 'polygon') {\n continue;\n } // Doesn't consider hole\n\n\n var exterior = geometries[i].exterior;\n bbox.fromPoints(exterior, min2, max2);\n vec2.min(min, min, min2);\n vec2.max(max, max, max2);\n } // No data\n\n\n if (i === 0) {\n min[0] = min[1] = max[0] = max[1] = 0;\n }\n\n return this._rect = new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n },\n\n /**\n * @param {} coord\n * @return {boolean}\n */\n contain: function (coord) {\n var rect = this.getBoundingRect();\n var geometries = this.geometries;\n\n if (!rect.contain(coord[0], coord[1])) {\n return false;\n }\n\n loopGeo: for (var i = 0, len = geometries.length; i < len; i++) {\n // Only support polygon.\n if (geometries[i].type !== 'polygon') {\n continue;\n }\n\n var exterior = geometries[i].exterior;\n var interiors = geometries[i].interiors;\n\n if (polygonContain.contain(exterior, coord[0], coord[1])) {\n // Not in the region if point is in the hole.\n for (var k = 0; k < (interiors ? interiors.length : 0); k++) {\n if (polygonContain.contain(interiors[k])) {\n continue loopGeo;\n }\n }\n\n return true;\n }\n }\n\n return false;\n },\n transformTo: function (x, y, width, height) {\n var rect = this.getBoundingRect();\n var aspect = rect.width / rect.height;\n\n if (!width) {\n width = aspect * height;\n } else if (!height) {\n height = width / aspect;\n }\n\n var target = new BoundingRect(x, y, width, height);\n var transform = rect.calculateTransform(target);\n var geometries = this.geometries;\n\n for (var i = 0; i < geometries.length; i++) {\n // Only support polygon.\n if (geometries[i].type !== 'polygon') {\n continue;\n }\n\n var exterior = geometries[i].exterior;\n var interiors = geometries[i].interiors;\n\n for (var p = 0; p < exterior.length; p++) {\n vec2.applyTransform(exterior[p], exterior[p], transform);\n }\n\n for (var h = 0; h < (interiors ? interiors.length : 0); h++) {\n for (var p = 0; p < interiors[h].length; p++) {\n vec2.applyTransform(interiors[h][p], interiors[h][p], transform);\n }\n }\n }\n\n rect = this._rect;\n rect.copy(target); // Update center\n\n this.center = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n },\n cloneShallow: function (name) {\n name == null && (name = this.name);\n var newRegion = new Region(name, this.geometries, this.center);\n newRegion._rect = this._rect;\n newRegion.transformTo = null; // Simply avoid to be called.\n\n return newRegion;\n }\n};\nvar _default = Region;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/coord/geo/Region.js\n// module id = 171\n// module chunks = 39","var windingLine = require(\"./windingLine\");\n\nvar EPSILON = 1e-8;\n\nfunction isAroundEqual(a, b) {\n return Math.abs(a - b) < EPSILON;\n}\n\nfunction contain(points, x, y) {\n var w = 0;\n var p = points[0];\n\n if (!p) {\n return false;\n }\n\n for (var i = 1; i < points.length; i++) {\n var p2 = points[i];\n w += windingLine(p[0], p[1], p2[0], p2[1], x, y);\n p = p2;\n } // Close polygon\n\n\n var p0 = points[0];\n\n if (!isAroundEqual(p[0], p0[0]) || !isAroundEqual(p[1], p0[1])) {\n w += windingLine(p[0], p[1], p0[0], p0[1], x, y);\n }\n\n return w !== 0;\n}\n\nexports.contain = contain;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/contain/polygon.js\n// module id = 172\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _dataStackHelper = require(\"../../data/helper/dataStackHelper\");\n\nvar isDimensionStacked = _dataStackHelper.isDimensionStacked;\n\nvar _util = require(\"zrender/lib/core/util\");\n\nvar map = _util.map;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @param {Object} coordSys\n * @param {module:echarts/data/List} data\n * @param {string} valueOrigin lineSeries.option.areaStyle.origin\n */\nfunction prepareDataCoordInfo(coordSys, data, valueOrigin) {\n var baseAxis = coordSys.getBaseAxis();\n var valueAxis = coordSys.getOtherAxis(baseAxis);\n var valueStart = getValueStart(valueAxis, valueOrigin);\n var baseAxisDim = baseAxis.dim;\n var valueAxisDim = valueAxis.dim;\n var valueDim = data.mapDimension(valueAxisDim);\n var baseDim = data.mapDimension(baseAxisDim);\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\n var dims = map(coordSys.dimensions, function (coordDim) {\n return data.mapDimension(coordDim);\n });\n var stacked;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n\n if (stacked |= isDimensionStacked(data, dims[0]\n /*, dims[1]*/\n )) {\n // jshint ignore:line\n dims[0] = stackResultDim;\n }\n\n if (stacked |= isDimensionStacked(data, dims[1]\n /*, dims[0]*/\n )) {\n // jshint ignore:line\n dims[1] = stackResultDim;\n }\n\n return {\n dataDimsForPoint: dims,\n valueStart: valueStart,\n valueAxisDim: valueAxisDim,\n baseAxisDim: baseAxisDim,\n stacked: !!stacked,\n valueDim: valueDim,\n baseDim: baseDim,\n baseDataOffset: baseDataOffset,\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension')\n };\n}\n\nfunction getValueStart(valueAxis, valueOrigin) {\n var valueStart = 0;\n var extent = valueAxis.scale.getExtent();\n\n if (valueOrigin === 'start') {\n valueStart = extent[0];\n } else if (valueOrigin === 'end') {\n valueStart = extent[1];\n } // auto\n else {\n // Both positive\n if (extent[0] > 0) {\n valueStart = extent[0];\n } // Both negative\n else if (extent[1] < 0) {\n valueStart = extent[1];\n } // If is one positive, and one negative, onZero shall be true\n\n }\n\n return valueStart;\n}\n\nfunction getStackedOnPoint(dataCoordInfo, coordSys, data, idx) {\n var value = NaN;\n\n if (dataCoordInfo.stacked) {\n value = data.get(data.getCalculationInfo('stackedOverDimension'), idx);\n }\n\n if (isNaN(value)) {\n value = dataCoordInfo.valueStart;\n }\n\n var baseDataOffset = dataCoordInfo.baseDataOffset;\n var stackedData = [];\n stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx);\n stackedData[1 - baseDataOffset] = value;\n return coordSys.dataToPoint(stackedData);\n}\n\nexports.prepareDataCoordInfo = prepareDataCoordInfo;\nexports.getStackedOnPoint = getStackedOnPoint;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/line/helper.js\n// module id = 173\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar Path = require(\"zrender/lib/graphic/Path\");\n\nvar vec2 = require(\"zrender/lib/core/vector\");\n\nvar fixClipWithShadow = require(\"zrender/lib/graphic/helper/fixClipWithShadow\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Poly path support NaN point\nvar vec2Min = vec2.min;\nvar vec2Max = vec2.max;\nvar scaleAndAdd = vec2.scaleAndAdd;\nvar v2Copy = vec2.copy; // Temporary variable\n\nvar v = [];\nvar cp0 = [];\nvar cp1 = [];\n\nfunction isPointNull(p) {\n return isNaN(p[0]) || isNaN(p[1]);\n}\n\nfunction drawSegment(ctx, points, start, segLen, allLen, dir, smoothMin, smoothMax, smooth, smoothMonotone, connectNulls) {\n // if (smoothMonotone == null) {\n // if (isMono(points, 'x')) {\n // return drawMono(ctx, points, start, segLen, allLen,\n // dir, smoothMin, smoothMax, smooth, 'x', connectNulls);\n // }\n // else if (isMono(points, 'y')) {\n // return drawMono(ctx, points, start, segLen, allLen,\n // dir, smoothMin, smoothMax, smooth, 'y', connectNulls);\n // }\n // else {\n // return drawNonMono.apply(this, arguments);\n // }\n // }\n // else if (smoothMonotone !== 'none' && isMono(points, smoothMonotone)) {\n // return drawMono.apply(this, arguments);\n // }\n // else {\n // return drawNonMono.apply(this, arguments);\n // }\n if (smoothMonotone === 'none' || !smoothMonotone) {\n return drawNonMono.apply(this, arguments);\n } else {\n return drawMono.apply(this, arguments);\n }\n}\n/**\n * Check if points is in monotone.\n *\n * @param {number[][]} points Array of points which is in [x, y] form\n * @param {string} smoothMonotone 'x', 'y', or 'none', stating for which\n * dimension that is checking.\n * If is 'none', `drawNonMono` should be\n * called.\n * If is undefined, either being monotone\n * in 'x' or 'y' will call `drawMono`.\n */\n// function isMono(points, smoothMonotone) {\n// if (points.length <= 1) {\n// return true;\n// }\n// var dim = smoothMonotone === 'x' ? 0 : 1;\n// var last = points[0][dim];\n// var lastDiff = 0;\n// for (var i = 1; i < points.length; ++i) {\n// var diff = points[i][dim] - last;\n// if (!isNaN(diff) && !isNaN(lastDiff)\n// && diff !== 0 && lastDiff !== 0\n// && ((diff >= 0) !== (lastDiff >= 0))\n// ) {\n// return false;\n// }\n// if (!isNaN(diff) && diff !== 0) {\n// lastDiff = diff;\n// last = points[i][dim];\n// }\n// }\n// return true;\n// }\n\n/**\n * Draw smoothed line in monotone, in which only vertical or horizontal bezier\n * control points will be used. This should be used when points are monotone\n * either in x or y dimension.\n */\n\n\nfunction drawMono(ctx, points, start, segLen, allLen, dir, smoothMin, smoothMax, smooth, smoothMonotone, connectNulls) {\n var prevIdx = 0;\n var idx = start;\n\n for (var k = 0; k < segLen; k++) {\n var p = points[idx];\n\n if (idx >= allLen || idx < 0) {\n break;\n }\n\n if (isPointNull(p)) {\n if (connectNulls) {\n idx += dir;\n continue;\n }\n\n break;\n }\n\n if (idx === start) {\n ctx[dir > 0 ? 'moveTo' : 'lineTo'](p[0], p[1]);\n } else {\n if (smooth > 0) {\n var prevP = points[prevIdx];\n var dim = smoothMonotone === 'y' ? 1 : 0; // Length of control point to p, either in x or y, but not both\n\n var ctrlLen = (p[dim] - prevP[dim]) * smooth;\n v2Copy(cp0, prevP);\n cp0[dim] = prevP[dim] + ctrlLen;\n v2Copy(cp1, p);\n cp1[dim] = p[dim] - ctrlLen;\n ctx.bezierCurveTo(cp0[0], cp0[1], cp1[0], cp1[1], p[0], p[1]);\n } else {\n ctx.lineTo(p[0], p[1]);\n }\n }\n\n prevIdx = idx;\n idx += dir;\n }\n\n return k;\n}\n/**\n * Draw smoothed line in non-monotone, in may cause undesired curve in extreme\n * situations. This should be used when points are non-monotone neither in x or\n * y dimension.\n */\n\n\nfunction drawNonMono(ctx, points, start, segLen, allLen, dir, smoothMin, smoothMax, smooth, smoothMonotone, connectNulls) {\n var prevIdx = 0;\n var idx = start;\n\n for (var k = 0; k < segLen; k++) {\n var p = points[idx];\n\n if (idx >= allLen || idx < 0) {\n break;\n }\n\n if (isPointNull(p)) {\n if (connectNulls) {\n idx += dir;\n continue;\n }\n\n break;\n }\n\n if (idx === start) {\n ctx[dir > 0 ? 'moveTo' : 'lineTo'](p[0], p[1]);\n v2Copy(cp0, p);\n } else {\n if (smooth > 0) {\n var nextIdx = idx + dir;\n var nextP = points[nextIdx];\n\n if (connectNulls) {\n // Find next point not null\n while (nextP && isPointNull(points[nextIdx])) {\n nextIdx += dir;\n nextP = points[nextIdx];\n }\n }\n\n var ratioNextSeg = 0.5;\n var prevP = points[prevIdx];\n var nextP = points[nextIdx]; // Last point\n\n if (!nextP || isPointNull(nextP)) {\n v2Copy(cp1, p);\n } else {\n // If next data is null in not connect case\n if (isPointNull(nextP) && !connectNulls) {\n nextP = p;\n }\n\n vec2.sub(v, nextP, prevP);\n var lenPrevSeg;\n var lenNextSeg;\n\n if (smoothMonotone === 'x' || smoothMonotone === 'y') {\n var dim = smoothMonotone === 'x' ? 0 : 1;\n lenPrevSeg = Math.abs(p[dim] - prevP[dim]);\n lenNextSeg = Math.abs(p[dim] - nextP[dim]);\n } else {\n lenPrevSeg = vec2.dist(p, prevP);\n lenNextSeg = vec2.dist(p, nextP);\n } // Use ratio of seg length\n\n\n ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);\n scaleAndAdd(cp1, p, v, -smooth * (1 - ratioNextSeg));\n } // Smooth constraint\n\n\n vec2Min(cp0, cp0, smoothMax);\n vec2Max(cp0, cp0, smoothMin);\n vec2Min(cp1, cp1, smoothMax);\n vec2Max(cp1, cp1, smoothMin);\n ctx.bezierCurveTo(cp0[0], cp0[1], cp1[0], cp1[1], p[0], p[1]); // cp0 of next segment\n\n scaleAndAdd(cp0, p, v, smooth * ratioNextSeg);\n } else {\n ctx.lineTo(p[0], p[1]);\n }\n }\n\n prevIdx = idx;\n idx += dir;\n }\n\n return k;\n}\n\nfunction getBoundingBox(points, smoothConstraint) {\n var ptMin = [Infinity, Infinity];\n var ptMax = [-Infinity, -Infinity];\n\n if (smoothConstraint) {\n for (var i = 0; i < points.length; i++) {\n var pt = points[i];\n\n if (pt[0] < ptMin[0]) {\n ptMin[0] = pt[0];\n }\n\n if (pt[1] < ptMin[1]) {\n ptMin[1] = pt[1];\n }\n\n if (pt[0] > ptMax[0]) {\n ptMax[0] = pt[0];\n }\n\n if (pt[1] > ptMax[1]) {\n ptMax[1] = pt[1];\n }\n }\n }\n\n return {\n min: smoothConstraint ? ptMin : ptMax,\n max: smoothConstraint ? ptMax : ptMin\n };\n}\n\nvar Polyline = Path.extend({\n type: 'ec-polyline',\n shape: {\n points: [],\n smooth: 0,\n smoothConstraint: true,\n smoothMonotone: null,\n connectNulls: false\n },\n style: {\n fill: null,\n stroke: '#000'\n },\n brush: fixClipWithShadow(Path.prototype.brush),\n buildPath: function (ctx, shape) {\n var points = shape.points;\n var i = 0;\n var len = points.length;\n var result = getBoundingBox(points, shape.smoothConstraint);\n\n if (shape.connectNulls) {\n // Must remove first and last null values avoid draw error in polygon\n for (; len > 0; len--) {\n if (!isPointNull(points[len - 1])) {\n break;\n }\n }\n\n for (; i < len; i++) {\n if (!isPointNull(points[i])) {\n break;\n }\n }\n }\n\n while (i < len) {\n i += drawSegment(ctx, points, i, len, len, 1, result.min, result.max, shape.smooth, shape.smoothMonotone, shape.connectNulls) + 1;\n }\n }\n});\nvar Polygon = Path.extend({\n type: 'ec-polygon',\n shape: {\n points: [],\n // Offset between stacked base points and points\n stackedOnPoints: [],\n smooth: 0,\n stackedOnSmooth: 0,\n smoothConstraint: true,\n smoothMonotone: null,\n connectNulls: false\n },\n brush: fixClipWithShadow(Path.prototype.brush),\n buildPath: function (ctx, shape) {\n var points = shape.points;\n var stackedOnPoints = shape.stackedOnPoints;\n var i = 0;\n var len = points.length;\n var smoothMonotone = shape.smoothMonotone;\n var bbox = getBoundingBox(points, shape.smoothConstraint);\n var stackedOnBBox = getBoundingBox(stackedOnPoints, shape.smoothConstraint);\n\n if (shape.connectNulls) {\n // Must remove first and last null values avoid draw error in polygon\n for (; len > 0; len--) {\n if (!isPointNull(points[len - 1])) {\n break;\n }\n }\n\n for (; i < len; i++) {\n if (!isPointNull(points[i])) {\n break;\n }\n }\n }\n\n while (i < len) {\n var k = drawSegment(ctx, points, i, len, len, 1, bbox.min, bbox.max, shape.smooth, smoothMonotone, shape.connectNulls);\n drawSegment(ctx, stackedOnPoints, i + k - 1, k, len, -1, stackedOnBBox.min, stackedOnBBox.max, shape.stackedOnSmooth, smoothMonotone, shape.connectNulls);\n i += k + 1;\n ctx.closePath();\n }\n }\n});\nexports.Polyline = Polyline;\nexports.Polygon = Polygon;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/line/poly.js\n// module id = 174\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar ComponentModel = require(\"../../model/Component\");\n\nvar axisModelCreator = require(\"../axisModelCreator\");\n\nvar axisModelCommonMixin = require(\"../axisModelCommonMixin\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar AxisModel = ComponentModel.extend({\n type: 'cartesian2dAxis',\n\n /**\n * @type {module:echarts/coord/cartesian/Axis2D}\n */\n axis: null,\n\n /**\n * @override\n */\n init: function () {\n AxisModel.superApply(this, 'init', arguments);\n this.resetRange();\n },\n\n /**\n * @override\n */\n mergeOption: function () {\n AxisModel.superApply(this, 'mergeOption', arguments);\n this.resetRange();\n },\n\n /**\n * @override\n */\n restoreData: function () {\n AxisModel.superApply(this, 'restoreData', arguments);\n this.resetRange();\n },\n\n /**\n * @override\n * @return {module:echarts/model/Component}\n */\n getCoordSysModel: function () {\n return this.ecModel.queryComponents({\n mainType: 'grid',\n index: this.option.gridIndex,\n id: this.option.gridId\n })[0];\n }\n});\n\nfunction getAxisType(axisDim, option) {\n // Default axis with data is category axis\n return option.type || (option.data ? 'category' : 'value');\n}\n\nzrUtil.merge(AxisModel.prototype, axisModelCommonMixin);\nvar extraOption = {\n // gridIndex: 0,\n // gridId: '',\n // Offset is for multiple axis on the same position\n offset: 0\n};\naxisModelCreator('x', AxisModel, getAxisType, extraOption);\naxisModelCreator('y', AxisModel, getAxisType, extraOption);\nvar _default = AxisModel;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/coord/cartesian/AxisModel.js\n// module id = 175\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar defaultOption = {\n show: true,\n zlevel: 0,\n z: 0,\n // Inverse the axis.\n inverse: false,\n // Axis name displayed.\n name: '',\n // 'start' | 'middle' | 'end'\n nameLocation: 'end',\n // By degree. By defualt auto rotate by nameLocation.\n nameRotate: null,\n nameTruncate: {\n maxWidth: null,\n ellipsis: '...',\n placeholder: '.'\n },\n // Use global text style by default.\n nameTextStyle: {},\n // The gap between axisName and axisLine.\n nameGap: 15,\n // Default `false` to support tooltip.\n silent: false,\n // Default `false` to avoid legacy user event listener fail.\n triggerEvent: false,\n tooltip: {\n show: false\n },\n axisPointer: {},\n axisLine: {\n show: true,\n onZero: true,\n onZeroAxisIndex: null,\n lineStyle: {\n color: '#333',\n width: 1,\n type: 'solid'\n },\n // The arrow at both ends the the axis.\n symbol: ['none', 'none'],\n symbolSize: [10, 15]\n },\n axisTick: {\n show: true,\n // Whether axisTick is inside the grid or outside the grid.\n inside: false,\n // The length of axisTick.\n length: 5,\n lineStyle: {\n width: 1\n }\n },\n axisLabel: {\n show: true,\n // Whether axisLabel is inside the grid or outside the grid.\n inside: false,\n rotate: 0,\n // true | false | null/undefined (auto)\n showMinLabel: null,\n // true | false | null/undefined (auto)\n showMaxLabel: null,\n margin: 8,\n // formatter: null,\n fontSize: 12\n },\n splitLine: {\n show: true,\n lineStyle: {\n color: ['#ccc'],\n width: 1,\n type: 'solid'\n }\n },\n splitArea: {\n show: false,\n areaStyle: {\n color: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)']\n }\n }\n};\nvar axisDefault = {};\naxisDefault.categoryAxis = zrUtil.merge({\n // The gap at both ends of the axis. For categoryAxis, boolean.\n boundaryGap: true,\n // Set false to faster category collection.\n // Only usefull in the case like: category is\n // ['2012-01-01', '2012-01-02', ...], where the input\n // data has been ensured not duplicate and is large data.\n // null means \"auto\":\n // if axis.data provided, do not deduplication,\n // else do deduplication.\n deduplication: null,\n // splitArea: {\n // show: false\n // },\n splitLine: {\n show: false\n },\n axisTick: {\n // If tick is align with label when boundaryGap is true\n alignWithLabel: false,\n interval: 'auto'\n },\n axisLabel: {\n interval: 'auto'\n }\n}, defaultOption);\naxisDefault.valueAxis = zrUtil.merge({\n // The gap at both ends of the axis. For value axis, [GAP, GAP], where\n // `GAP` can be an absolute pixel number (like `35`), or percent (like `'30%'`)\n boundaryGap: [0, 0],\n // TODO\n // min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60]\n // Min value of the axis. can be:\n // + a number\n // + 'dataMin': use the min value in data.\n // + null/undefined: auto decide min value (consider pretty look and boundaryGap).\n // min: null,\n // Max value of the axis. can be:\n // + a number\n // + 'dataMax': use the max value in data.\n // + null/undefined: auto decide max value (consider pretty look and boundaryGap).\n // max: null,\n // Readonly prop, specifies start value of the range when using data zoom.\n // rangeStart: null\n // Readonly prop, specifies end value of the range when using data zoom.\n // rangeEnd: null\n // Optional value can be:\n // + `false`: always include value 0.\n // + `true`: the extent do not consider value 0.\n // scale: false,\n // AxisTick and axisLabel and splitLine are caculated based on splitNumber.\n splitNumber: 5 // Interval specifies the span of the ticks is mandatorily.\n // interval: null\n // Specify min interval when auto calculate tick interval.\n // minInterval: null\n // Specify max interval when auto calculate tick interval.\n // maxInterval: null\n\n}, defaultOption);\naxisDefault.timeAxis = zrUtil.defaults({\n scale: true,\n min: 'dataMin',\n max: 'dataMax'\n}, axisDefault.valueAxis);\naxisDefault.logAxis = zrUtil.defaults({\n scale: true,\n logBase: 10\n}, axisDefault.valueAxis);\nvar _default = axisDefault;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/coord/axisDefault.js\n// module id = 176\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Can only be called after coordinate system creation stage.\n * (Can be called before coordinate system update stage).\n *\n * @param {Object} opt {labelInside}\n * @return {Object} {\n * position, rotation, labelDirection, labelOffset,\n * tickDirection, labelRotate, z2\n * }\n */\nfunction layout(gridModel, axisModel, opt) {\n opt = opt || {};\n var grid = gridModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\n var rawAxisPosition = axis.position;\n var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\n var axisDim = axis.dim;\n var rect = grid.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var idx = {\n left: 0,\n right: 1,\n top: 0,\n bottom: 1,\n onZero: 2\n };\n var axisOffset = axisModel.get('offset') || 0;\n var posBound = axisDim === 'x' ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\n\n if (otherAxisOnZeroOf) {\n var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\n } // Axis position\n\n\n layout.position = [axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0], axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]]; // Axis rotation\n\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1); // Tick and label direction, x y is axisDim\n\n var dirMap = {\n top: -1,\n bottom: 1,\n left: -1,\n right: 1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\n\n if (axisModel.get('axisTick.inside')) {\n layout.tickDirection = -layout.tickDirection;\n }\n\n if (zrUtil.retrieve(opt.labelInside, axisModel.get('axisLabel.inside'))) {\n layout.labelDirection = -layout.labelDirection;\n } // Special label rotation\n\n\n var labelRotate = axisModel.get('axisLabel.rotate');\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate; // Over splitLine and splitArea\n\n layout.z2 = 1;\n return layout;\n}\n\nexports.layout = layout;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/coord/cartesian/cartesianAxisHelper.js\n// module id = 177\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar SeriesModel = require(\"../../model/Series\");\n\nvar createListFromArray = require(\"../helper/createListFromArray\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar _default = SeriesModel.extend({\n type: 'series.__base_bar__',\n getInitialData: function (option, ecModel) {\n return createListFromArray(this.getSource(), this);\n },\n getMarkerPosition: function (value) {\n var coordSys = this.coordinateSystem;\n\n if (coordSys) {\n // PENDING if clamp ?\n var pt = coordSys.dataToPoint(coordSys.clampData(value));\n var data = this.getData();\n var offset = data.getLayout('offset');\n var size = data.getLayout('size');\n var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1;\n pt[offsetIndex] += offset + size / 2;\n return pt;\n }\n\n return [NaN, NaN];\n },\n defaultOption: {\n zlevel: 0,\n // 一级层叠\n z: 2,\n // 二级层叠\n coordinateSystem: 'cartesian2d',\n legendHoverLink: true,\n // stack: null\n // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // 最小高度改为0\n barMinHeight: 0,\n // 最小角度为0,仅对极坐标系下的柱状图有效\n barMinAngle: 0,\n // cursor: null,\n large: false,\n largeThreshold: 400,\n progressive: 3e3,\n progressiveChunkMode: 'mod',\n // barMaxWidth: null,\n // 默认自适应\n // barWidth: null,\n // 柱间距离,默认为柱形宽度的30%,可设固定值\n // barGap: '30%',\n // 类目间柱形距离,默认为类目间距的20%,可设固定值\n // barCategoryGap: '20%',\n // label: {\n // show: false\n // },\n itemStyle: {},\n emphasis: {}\n }\n});\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/bar/BaseBarSeries.js\n// module id = 178\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar graphic = require(\"../../util/graphic\");\n\nvar _labelHelper = require(\"../helper/labelHelper\");\n\nvar getDefaultLabel = _labelHelper.getDefaultLabel;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction setLabel(normalStyle, hoverStyle, itemModel, color, seriesModel, dataIndex, labelPositionOutside) {\n var labelModel = itemModel.getModel('label');\n var hoverLabelModel = itemModel.getModel('emphasis.label');\n graphic.setLabelStyle(normalStyle, hoverStyle, labelModel, hoverLabelModel, {\n labelFetcher: seriesModel,\n labelDataIndex: dataIndex,\n defaultText: getDefaultLabel(seriesModel.getData(), dataIndex),\n isRectText: true,\n autoColor: color\n });\n fixPosition(normalStyle);\n fixPosition(hoverStyle);\n}\n\nfunction fixPosition(style, labelPositionOutside) {\n if (style.textPosition === 'outside') {\n style.textPosition = labelPositionOutside;\n }\n}\n\nexports.setLabel = setLabel;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/bar/helper.js\n// module id = 179\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../echarts\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction _default(seriesType, actionInfos) {\n zrUtil.each(actionInfos, function (actionInfo) {\n actionInfo.update = 'updateView';\n /**\n * @payload\n * @property {string} seriesName\n * @property {string} name\n */\n\n echarts.registerAction(actionInfo, function (payload, ecModel) {\n var selected = {};\n ecModel.eachComponent({\n mainType: 'series',\n subType: seriesType,\n query: payload\n }, function (seriesModel) {\n if (seriesModel[actionInfo.method]) {\n seriesModel[actionInfo.method](payload.name, payload.dataIndex);\n }\n\n var data = seriesModel.getData(); // Create selected map\n\n data.each(function (idx) {\n var name = data.getName(idx);\n selected[name] = seriesModel.isSelected(name) || false;\n });\n });\n return {\n name: payload.name,\n selected: selected\n };\n });\n });\n}\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/action/createDataSelectAction.js\n// module id = 180\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar RoamController = require(\"./RoamController\");\n\nvar roamHelper = require(\"../../component/helper/roamHelper\");\n\nvar _cursorHelper = require(\"../../component/helper/cursorHelper\");\n\nvar onIrrelevantElement = _cursorHelper.onIrrelevantElement;\n\nvar graphic = require(\"../../util/graphic\");\n\nvar geoSourceManager = require(\"../../coord/geo/geoSourceManager\");\n\nvar _component = require(\"../../util/component\");\n\nvar getUID = _component.getUID;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction getFixedItemStyle(model, scale) {\n var itemStyle = model.getItemStyle();\n var areaColor = model.get('areaColor'); // If user want the color not to be changed when hover,\n // they should both set areaColor and color to be null.\n\n if (areaColor != null) {\n itemStyle.fill = areaColor;\n }\n\n return itemStyle;\n}\n\nfunction updateMapSelectHandler(mapDraw, mapOrGeoModel, regionsGroup, api, fromView) {\n regionsGroup.off('click');\n regionsGroup.off('mousedown');\n\n if (mapOrGeoModel.get('selectedMode')) {\n regionsGroup.on('mousedown', function () {\n mapDraw._mouseDownFlag = true;\n });\n regionsGroup.on('click', function (e) {\n if (!mapDraw._mouseDownFlag) {\n return;\n }\n\n mapDraw._mouseDownFlag = false;\n var el = e.target;\n\n while (!el.__regions) {\n el = el.parent;\n }\n\n if (!el) {\n return;\n }\n\n var action = {\n type: (mapOrGeoModel.mainType === 'geo' ? 'geo' : 'map') + 'ToggleSelect',\n batch: zrUtil.map(el.__regions, function (region) {\n return {\n name: region.name,\n from: fromView.uid\n };\n })\n };\n action[mapOrGeoModel.mainType + 'Id'] = mapOrGeoModel.id;\n api.dispatchAction(action);\n updateMapSelected(mapOrGeoModel, regionsGroup);\n });\n }\n}\n\nfunction updateMapSelected(mapOrGeoModel, regionsGroup) {\n // FIXME\n regionsGroup.eachChild(function (otherRegionEl) {\n zrUtil.each(otherRegionEl.__regions, function (region) {\n otherRegionEl.trigger(mapOrGeoModel.isSelected(region.name) ? 'emphasis' : 'normal');\n });\n });\n}\n/**\n * @alias module:echarts/component/helper/MapDraw\n * @param {module:echarts/ExtensionAPI} api\n * @param {boolean} updateGroup\n */\n\n\nfunction MapDraw(api, updateGroup) {\n var group = new graphic.Group();\n /**\n * @type {string}\n * @private\n */\n\n this.uid = getUID('ec_map_draw');\n /**\n * @type {module:echarts/component/helper/RoamController}\n * @private\n */\n\n this._controller = new RoamController(api.getZr());\n /**\n * @type {Object} {target, zoom, zoomLimit}\n * @private\n */\n\n this._controllerHost = {\n target: updateGroup ? group : null\n };\n /**\n * @type {module:zrender/container/Group}\n * @readOnly\n */\n\n this.group = group;\n /**\n * @type {boolean}\n * @private\n */\n\n this._updateGroup = updateGroup;\n /**\n * This flag is used to make sure that only one among\n * `pan`, `zoom`, `click` can occurs, otherwise 'selected'\n * action may be triggered when `pan`, which is unexpected.\n * @type {booelan}\n */\n\n this._mouseDownFlag;\n /**\n * @type {string}\n */\n\n this._mapName;\n /**\n * @type {boolean}\n */\n\n this._initialized;\n /**\n * @type {module:zrender/container/Group}\n */\n\n group.add(this._regionsGroup = new graphic.Group());\n /**\n * @type {module:zrender/container/Group}\n */\n\n group.add(this._backgroundGroup = new graphic.Group());\n}\n\nMapDraw.prototype = {\n constructor: MapDraw,\n draw: function (mapOrGeoModel, ecModel, api, fromView, payload) {\n var isGeo = mapOrGeoModel.mainType === 'geo'; // Map series has data. GEO model that controlled by map series\n // will be assigned with map data. Other GEO model has no data.\n\n var data = mapOrGeoModel.getData && mapOrGeoModel.getData();\n isGeo && ecModel.eachComponent({\n mainType: 'series',\n subType: 'map'\n }, function (mapSeries) {\n if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) {\n data = mapSeries.getData();\n }\n });\n var geo = mapOrGeoModel.coordinateSystem;\n\n this._updateBackground(geo);\n\n var regionsGroup = this._regionsGroup;\n var group = this.group;\n var scale = geo.scale;\n var transform = {\n position: geo.position,\n scale: scale\n }; // No animation when first draw or in action\n\n if (!regionsGroup.childAt(0) || payload) {\n group.attr(transform);\n } else {\n graphic.updateProps(group, transform, mapOrGeoModel);\n }\n\n regionsGroup.removeAll();\n var itemStyleAccessPath = ['itemStyle'];\n var hoverItemStyleAccessPath = ['emphasis', 'itemStyle'];\n var labelAccessPath = ['label'];\n var hoverLabelAccessPath = ['emphasis', 'label'];\n var nameMap = zrUtil.createHashMap();\n zrUtil.each(geo.regions, function (region) {\n // Consider in GeoJson properties.name may be duplicated, for example,\n // there is multiple region named \"United Kindom\" or \"France\" (so many\n // colonies). And it is not appropriate to merge them in geo, which\n // will make them share the same label and bring trouble in label\n // location calculation.\n var regionGroup = nameMap.get(region.name) || nameMap.set(region.name, new graphic.Group());\n var compoundPath = new graphic.CompoundPath({\n shape: {\n paths: []\n }\n });\n regionGroup.add(compoundPath);\n var regionModel = mapOrGeoModel.getRegionModel(region.name) || mapOrGeoModel;\n var itemStyleModel = regionModel.getModel(itemStyleAccessPath);\n var hoverItemStyleModel = regionModel.getModel(hoverItemStyleAccessPath);\n var itemStyle = getFixedItemStyle(itemStyleModel, scale);\n var hoverItemStyle = getFixedItemStyle(hoverItemStyleModel, scale);\n var labelModel = regionModel.getModel(labelAccessPath);\n var hoverLabelModel = regionModel.getModel(hoverLabelAccessPath);\n var dataIdx; // Use the itemStyle in data if has data\n\n if (data) {\n dataIdx = data.indexOfName(region.name); // Only visual color of each item will be used. It can be encoded by dataRange\n // But visual color of series is used in symbol drawing\n //\n // Visual color for each series is for the symbol draw\n\n var visualColor = data.getItemVisual(dataIdx, 'color', true);\n\n if (visualColor) {\n itemStyle.fill = visualColor;\n }\n }\n\n zrUtil.each(region.geometries, function (geometry) {\n if (geometry.type !== 'polygon') {\n return;\n }\n\n compoundPath.shape.paths.push(new graphic.Polygon({\n shape: {\n points: geometry.exterior\n }\n }));\n\n for (var i = 0; i < (geometry.interiors ? geometry.interiors.length : 0); i++) {\n compoundPath.shape.paths.push(new graphic.Polygon({\n shape: {\n points: geometry.interiors[i]\n }\n }));\n }\n });\n compoundPath.setStyle(itemStyle);\n compoundPath.style.strokeNoScale = true;\n compoundPath.culling = true; // Label\n\n var showLabel = labelModel.get('show');\n var hoverShowLabel = hoverLabelModel.get('show');\n var isDataNaN = data && isNaN(data.get(data.mapDimension('value'), dataIdx));\n var itemLayout = data && data.getItemLayout(dataIdx); // In the following cases label will be drawn\n // 1. In map series and data value is NaN\n // 2. In geo component\n // 4. Region has no series legendSymbol, which will be add a showLabel flag in mapSymbolLayout\n\n if (isGeo || isDataNaN && (showLabel || hoverShowLabel) || itemLayout && itemLayout.showLabel) {\n var query = !isGeo ? dataIdx : region.name;\n var labelFetcher; // Consider dataIdx not found.\n\n if (!data || dataIdx >= 0) {\n labelFetcher = mapOrGeoModel;\n }\n\n var textEl = new graphic.Text({\n position: region.center.slice(),\n // FIXME\n // label rotation is not support yet in geo or regions of series-map\n // that has no data. The rotation will be effected by this `scale`.\n // So needed to change to RectText?\n scale: [1 / scale[0], 1 / scale[1]],\n z2: 10,\n silent: true\n });\n graphic.setLabelStyle(textEl.style, textEl.hoverStyle = {}, labelModel, hoverLabelModel, {\n labelFetcher: labelFetcher,\n labelDataIndex: query,\n defaultText: region.name,\n useInsideStyle: false\n }, {\n textAlign: 'center',\n textVerticalAlign: 'middle'\n });\n regionGroup.add(textEl);\n } // setItemGraphicEl, setHoverStyle after all polygons and labels\n // are added to the rigionGroup\n\n\n if (data) {\n data.setItemGraphicEl(dataIdx, regionGroup);\n } else {\n var regionModel = mapOrGeoModel.getRegionModel(region.name); // Package custom mouse event for geo component\n\n compoundPath.eventData = {\n componentType: 'geo',\n componentIndex: mapOrGeoModel.componentIndex,\n geoIndex: mapOrGeoModel.componentIndex,\n name: region.name,\n region: regionModel && regionModel.option || {}\n };\n }\n\n var groupRegions = regionGroup.__regions || (regionGroup.__regions = []);\n groupRegions.push(region);\n graphic.setHoverStyle(regionGroup, hoverItemStyle, {\n hoverSilentOnTouch: !!mapOrGeoModel.get('selectedMode')\n });\n regionsGroup.add(regionGroup);\n });\n\n this._updateController(mapOrGeoModel, ecModel, api);\n\n updateMapSelectHandler(this, mapOrGeoModel, regionsGroup, api, fromView);\n updateMapSelected(mapOrGeoModel, regionsGroup);\n },\n remove: function () {\n this._regionsGroup.removeAll();\n\n this._backgroundGroup.removeAll();\n\n this._controller.dispose();\n\n this._mapName && geoSourceManager.removeGraphic(this._mapName, this.uid);\n this._mapName = null;\n this._controllerHost = {};\n },\n _updateBackground: function (geo) {\n var mapName = geo.map;\n\n if (this._mapName !== mapName) {\n zrUtil.each(geoSourceManager.makeGraphic(mapName, this.uid), function (root) {\n this._backgroundGroup.add(root);\n }, this);\n }\n\n this._mapName = mapName;\n },\n _updateController: function (mapOrGeoModel, ecModel, api) {\n var geo = mapOrGeoModel.coordinateSystem;\n var controller = this._controller;\n var controllerHost = this._controllerHost;\n controllerHost.zoomLimit = mapOrGeoModel.get('scaleLimit');\n controllerHost.zoom = geo.getZoom(); // roamType is will be set default true if it is null\n\n controller.enable(mapOrGeoModel.get('roam') || false);\n var mainType = mapOrGeoModel.mainType;\n\n function makeActionBase() {\n var action = {\n type: 'geoRoam',\n componentType: mainType\n };\n action[mainType + 'Id'] = mapOrGeoModel.id;\n return action;\n }\n\n controller.off('pan').on('pan', function (e) {\n this._mouseDownFlag = false;\n roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy);\n api.dispatchAction(zrUtil.extend(makeActionBase(), {\n dx: e.dx,\n dy: e.dy\n }));\n }, this);\n controller.off('zoom').on('zoom', function (e) {\n this._mouseDownFlag = false;\n roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\n api.dispatchAction(zrUtil.extend(makeActionBase(), {\n zoom: e.scale,\n originX: e.originX,\n originY: e.originY\n }));\n\n if (this._updateGroup) {\n var scale = this.group.scale;\n\n this._regionsGroup.traverse(function (el) {\n if (el.type === 'text') {\n el.attr('scale', [1 / scale[0], 1 / scale[1]]);\n }\n });\n }\n }, this);\n controller.setPointerChecker(function (e, x, y) {\n return geo.getViewRectAfterRoam().contain(x, y) && !onIrrelevantElement(e, api, mapOrGeoModel);\n });\n }\n};\nvar _default = MapDraw;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/helper/MapDraw.js\n// module id = 181\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../../echarts\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar ATTR = '\\0_ec_interaction_mutex';\n\nfunction take(zr, resourceKey, userKey) {\n var store = getStore(zr);\n store[resourceKey] = userKey;\n}\n\nfunction release(zr, resourceKey, userKey) {\n var store = getStore(zr);\n var uKey = store[resourceKey];\n\n if (uKey === userKey) {\n store[resourceKey] = null;\n }\n}\n\nfunction isTaken(zr, resourceKey) {\n return !!getStore(zr)[resourceKey];\n}\n\nfunction getStore(zr) {\n return zr[ATTR] || (zr[ATTR] = {});\n}\n/**\n * payload: {\n * type: 'takeGlobalCursor',\n * key: 'dataZoomSelect', or 'brush', or ...,\n * If no userKey, release global cursor.\n * }\n */\n\n\necharts.registerAction({\n type: 'takeGlobalCursor',\n event: 'globalCursorTaken',\n update: 'update'\n}, function () {});\nexports.take = take;\nexports.release = release;\nexports.isTaken = isTaken;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/helper/interactionMutex.js\n// module id = 182\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../echarts\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar _roamHelper = require(\"./roamHelper\");\n\nvar updateCenterAndZoom = _roamHelper.updateCenterAndZoom;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @payload\n * @property {string} [componentType=series]\n * @property {number} [dx]\n * @property {number} [dy]\n * @property {number} [zoom]\n * @property {number} [originX]\n * @property {number} [originY]\n */\necharts.registerAction({\n type: 'geoRoam',\n event: 'geoRoam',\n update: 'updateTransform'\n}, function (payload, ecModel) {\n var componentType = payload.componentType || 'series';\n ecModel.eachComponent({\n mainType: componentType,\n query: payload\n }, function (componentModel) {\n var geo = componentModel.coordinateSystem;\n\n if (geo.type !== 'geo') {\n return;\n }\n\n var res = updateCenterAndZoom(geo, payload, componentModel.get('scaleLimit'));\n componentModel.setCenter && componentModel.setCenter(res.center);\n componentModel.setZoom && componentModel.setZoom(res.zoom); // All map series with same `map` use the same geo coordinate system\n // So the center and zoom must be in sync. Include the series not selected by legend\n\n if (componentType === 'series') {\n zrUtil.each(componentModel.seriesGroup, function (seriesModel) {\n seriesModel.setCenter(res.center);\n seriesModel.setZoom(res.zoom);\n });\n }\n });\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/action/geoRoam.js\n// module id = 183\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Link lists and struct (graph or tree)\n */\nvar each = zrUtil.each;\nvar DATAS = '\\0__link_datas';\nvar MAIN_DATA = '\\0__link_mainData'; // Caution:\n// In most case, either list or its shallow clones (see list.cloneShallow)\n// is active in echarts process. So considering heap memory consumption,\n// we do not clone tree or graph, but share them among list and its shallow clones.\n// But in some rare case, we have to keep old list (like do animation in chart). So\n// please take care that both the old list and the new list share the same tree/graph.\n\n/**\n * @param {Object} opt\n * @param {module:echarts/data/List} opt.mainData\n * @param {Object} [opt.struct] For example, instance of Graph or Tree.\n * @param {string} [opt.structAttr] designation: list[structAttr] = struct;\n * @param {Object} [opt.datas] {dataType: data},\n * like: {node: nodeList, edge: edgeList}.\n * Should contain mainData.\n * @param {Object} [opt.datasAttr] {dataType: attr},\n * designation: struct[datasAttr[dataType]] = list;\n */\n\nfunction linkList(opt) {\n var mainData = opt.mainData;\n var datas = opt.datas;\n\n if (!datas) {\n datas = {\n main: mainData\n };\n opt.datasAttr = {\n main: 'data'\n };\n }\n\n opt.datas = opt.mainData = null;\n linkAll(mainData, datas, opt); // Porxy data original methods.\n\n each(datas, function (data) {\n each(mainData.TRANSFERABLE_METHODS, function (methodName) {\n data.wrapMethod(methodName, zrUtil.curry(transferInjection, opt));\n });\n }); // Beyond transfer, additional features should be added to `cloneShallow`.\n\n mainData.wrapMethod('cloneShallow', zrUtil.curry(cloneShallowInjection, opt)); // Only mainData trigger change, because struct.update may trigger\n // another changable methods, which may bring about dead lock.\n\n each(mainData.CHANGABLE_METHODS, function (methodName) {\n mainData.wrapMethod(methodName, zrUtil.curry(changeInjection, opt));\n }); // Make sure datas contains mainData.\n\n zrUtil.assert(datas[mainData.dataType] === mainData);\n}\n\nfunction transferInjection(opt, res) {\n if (isMainData(this)) {\n // Transfer datas to new main data.\n var datas = zrUtil.extend({}, this[DATAS]);\n datas[this.dataType] = res;\n linkAll(res, datas, opt);\n } else {\n // Modify the reference in main data to point newData.\n linkSingle(res, this.dataType, this[MAIN_DATA], opt);\n }\n\n return res;\n}\n\nfunction changeInjection(opt, res) {\n opt.struct && opt.struct.update(this);\n return res;\n}\n\nfunction cloneShallowInjection(opt, res) {\n // cloneShallow, which brings about some fragilities, may be inappropriate\n // to be exposed as an API. So for implementation simplicity we can make\n // the restriction that cloneShallow of not-mainData should not be invoked\n // outside, but only be invoked here.\n each(res[DATAS], function (data, dataType) {\n data !== res && linkSingle(data.cloneShallow(), dataType, res, opt);\n });\n return res;\n}\n/**\n * Supplement method to List.\n *\n * @public\n * @param {string} [dataType] If not specified, return mainData.\n * @return {module:echarts/data/List}\n */\n\n\nfunction getLinkedData(dataType) {\n var mainData = this[MAIN_DATA];\n return dataType == null || mainData == null ? mainData : mainData[DATAS][dataType];\n}\n\nfunction isMainData(data) {\n return data[MAIN_DATA] === data;\n}\n\nfunction linkAll(mainData, datas, opt) {\n mainData[DATAS] = {};\n each(datas, function (data, dataType) {\n linkSingle(data, dataType, mainData, opt);\n });\n}\n\nfunction linkSingle(data, dataType, mainData, opt) {\n mainData[DATAS][dataType] = data;\n data[MAIN_DATA] = mainData;\n data.dataType = dataType;\n\n if (opt.struct) {\n data[opt.structAttr] = opt.struct;\n opt.struct[opt.datasAttr[dataType]] = data;\n } // Supplement method.\n\n\n data.getLinkedData = getLinkedData;\n}\n\nvar _default = linkList;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/data/helper/linkList.js\n// module id = 184\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar layout = require(\"../../util/layout\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/*\n* A third-party license is embeded for some of the code in this file:\n* The tree layoutHelper implementation was originally copied from\n* \"d3.js\"(https://github.com/d3/d3-hierarchy) with\n* some modifications made for this project.\n* (see more details in the comment of the specific method below.)\n* The use of the source code of this file is also subject to the terms\n* and consitions of the licence of \"d3.js\" (BSD-3Clause, see\n* ).\n*/\n\n/**\n * @file The layout algorithm of node-link tree diagrams. Here we using Reingold-Tilford algorithm to drawing\n * the tree.\n */\n\n/**\n * Initialize all computational message for following algorithm.\n *\n * @param {module:echarts/data/Tree~TreeNode} root The virtual root of the tree.\n */\nfunction init(root) {\n root.hierNode = {\n defaultAncestor: null,\n ancestor: root,\n prelim: 0,\n modifier: 0,\n change: 0,\n shift: 0,\n i: 0,\n thread: null\n };\n var nodes = [root];\n var node;\n var children;\n\n while (node = nodes.pop()) {\n // jshint ignore:line\n children = node.children;\n\n if (node.isExpand && children.length) {\n var n = children.length;\n\n for (var i = n - 1; i >= 0; i--) {\n var child = children[i];\n child.hierNode = {\n defaultAncestor: null,\n ancestor: child,\n prelim: 0,\n modifier: 0,\n change: 0,\n shift: 0,\n i: i,\n thread: null\n };\n nodes.push(child);\n }\n }\n }\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * Computes a preliminary x coordinate for node. Before that, this function is\n * applied recursively to the children of node, as well as the function\n * apportion(). After spacing out the children by calling executeShifts(), the\n * node is placed to the midpoint of its outermost children.\n *\n * @param {module:echarts/data/Tree~TreeNode} node\n * @param {Function} separation\n */\n\n\nfunction firstWalk(node, separation) {\n var children = node.isExpand ? node.children : [];\n var siblings = node.parentNode.children;\n var subtreeW = node.hierNode.i ? siblings[node.hierNode.i - 1] : null;\n\n if (children.length) {\n executeShifts(node);\n var midPoint = (children[0].hierNode.prelim + children[children.length - 1].hierNode.prelim) / 2;\n\n if (subtreeW) {\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\n node.hierNode.modifier = node.hierNode.prelim - midPoint;\n } else {\n node.hierNode.prelim = midPoint;\n }\n } else if (subtreeW) {\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\n }\n\n node.parentNode.hierNode.defaultAncestor = apportion(node, subtreeW, node.parentNode.hierNode.defaultAncestor || siblings[0], separation);\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * Computes all real x-coordinates by summing up the modifiers recursively.\n *\n * @param {module:echarts/data/Tree~TreeNode} node\n */\n\n\nfunction secondWalk(node) {\n var nodeX = node.hierNode.prelim + node.parentNode.hierNode.modifier;\n node.setLayout({\n x: nodeX\n }, true);\n node.hierNode.modifier += node.parentNode.hierNode.modifier;\n}\n\nfunction separation(cb) {\n return arguments.length ? cb : defaultSeparation;\n}\n/**\n * Transform the common coordinate to radial coordinate.\n *\n * @param {number} x\n * @param {number} y\n * @return {Object}\n */\n\n\nfunction radialCoordinate(x, y) {\n var radialCoor = {};\n x -= Math.PI / 2;\n radialCoor.x = y * Math.cos(x);\n radialCoor.y = y * Math.sin(x);\n return radialCoor;\n}\n/**\n * Get the layout position of the whole view.\n *\n * @param {module:echarts/model/Series} seriesModel the model object of sankey series\n * @param {module:echarts/ExtensionAPI} api provide the API list that the developer can call\n * @return {module:zrender/core/BoundingRect} size of rect to draw the sankey view\n */\n\n\nfunction getViewRect(seriesModel, api) {\n return layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\n/**\n * All other shifts, applied to the smaller subtrees between w- and w+, are\n * performed by this function.\n *\n * The implementation of this function was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * @param {module:echarts/data/Tree~TreeNode} node\n */\n\n\nfunction executeShifts(node) {\n var children = node.children;\n var n = children.length;\n var shift = 0;\n var change = 0;\n\n while (--n >= 0) {\n var child = children[n];\n child.hierNode.prelim += shift;\n child.hierNode.modifier += shift;\n change += child.hierNode.change;\n shift += child.hierNode.shift + change;\n }\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * The core of the algorithm. Here, a new subtree is combined with the\n * previous subtrees. Threads are used to traverse the inside and outside\n * contours of the left and right subtree up to the highest common level.\n * Whenever two nodes of the inside contours conflict, we compute the left\n * one of the greatest uncommon ancestors using the function nextAncestor()\n * and call moveSubtree() to shift the subtree and prepare the shifts of\n * smaller subtrees. Finally, we add a new thread (if necessary).\n *\n * @param {module:echarts/data/Tree~TreeNode} subtreeV\n * @param {module:echarts/data/Tree~TreeNode} subtreeW\n * @param {module:echarts/data/Tree~TreeNode} ancestor\n * @param {Function} separation\n * @return {module:echarts/data/Tree~TreeNode}\n */\n\n\nfunction apportion(subtreeV, subtreeW, ancestor, separation) {\n if (subtreeW) {\n var nodeOutRight = subtreeV;\n var nodeInRight = subtreeV;\n var nodeOutLeft = nodeInRight.parentNode.children[0];\n var nodeInLeft = subtreeW;\n var sumOutRight = nodeOutRight.hierNode.modifier;\n var sumInRight = nodeInRight.hierNode.modifier;\n var sumOutLeft = nodeOutLeft.hierNode.modifier;\n var sumInLeft = nodeInLeft.hierNode.modifier;\n\n while (nodeInLeft = nextRight(nodeInLeft), nodeInRight = nextLeft(nodeInRight), nodeInLeft && nodeInRight) {\n nodeOutRight = nextRight(nodeOutRight);\n nodeOutLeft = nextLeft(nodeOutLeft);\n nodeOutRight.hierNode.ancestor = subtreeV;\n var shift = nodeInLeft.hierNode.prelim + sumInLeft - nodeInRight.hierNode.prelim - sumInRight + separation(nodeInLeft, nodeInRight);\n\n if (shift > 0) {\n moveSubtree(nextAncestor(nodeInLeft, subtreeV, ancestor), subtreeV, shift);\n sumInRight += shift;\n sumOutRight += shift;\n }\n\n sumInLeft += nodeInLeft.hierNode.modifier;\n sumInRight += nodeInRight.hierNode.modifier;\n sumOutRight += nodeOutRight.hierNode.modifier;\n sumOutLeft += nodeOutLeft.hierNode.modifier;\n }\n\n if (nodeInLeft && !nextRight(nodeOutRight)) {\n nodeOutRight.hierNode.thread = nodeInLeft;\n nodeOutRight.hierNode.modifier += sumInLeft - sumOutRight;\n }\n\n if (nodeInRight && !nextLeft(nodeOutLeft)) {\n nodeOutLeft.hierNode.thread = nodeInRight;\n nodeOutLeft.hierNode.modifier += sumInRight - sumOutLeft;\n ancestor = subtreeV;\n }\n }\n\n return ancestor;\n}\n/**\n * This function is used to traverse the right contour of a subtree.\n * It returns the rightmost child of node or the thread of node. The function\n * returns null if and only if node is on the highest depth of its subtree.\n *\n * @param {module:echarts/data/Tree~TreeNode} node\n * @return {module:echarts/data/Tree~TreeNode}\n */\n\n\nfunction nextRight(node) {\n var children = node.children;\n return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread;\n}\n/**\n * This function is used to traverse the left contour of a subtree (or a subforest).\n * It returns the leftmost child of node or the thread of node. The function\n * returns null if and only if node is on the highest depth of its subtree.\n *\n * @param {module:echarts/data/Tree~TreeNode} node\n * @return {module:echarts/data/Tree~TreeNode}\n */\n\n\nfunction nextLeft(node) {\n var children = node.children;\n return children.length && node.isExpand ? children[0] : node.hierNode.thread;\n}\n/**\n * If nodeInLeft’s ancestor is a sibling of node, returns nodeInLeft’s ancestor.\n * Otherwise, returns the specified ancestor.\n *\n * @param {module:echarts/data/Tree~TreeNode} nodeInLeft\n * @param {module:echarts/data/Tree~TreeNode} node\n * @param {module:echarts/data/Tree~TreeNode} ancestor\n * @return {module:echarts/data/Tree~TreeNode}\n */\n\n\nfunction nextAncestor(nodeInLeft, node, ancestor) {\n return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode ? nodeInLeft.hierNode.ancestor : ancestor;\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * Shifts the current subtree rooted at wr.\n * This is done by increasing prelim(w+) and modifier(w+) by shift.\n *\n * @param {module:echarts/data/Tree~TreeNode} wl\n * @param {module:echarts/data/Tree~TreeNode} wr\n * @param {number} shift [description]\n */\n\n\nfunction moveSubtree(wl, wr, shift) {\n var change = shift / (wr.hierNode.i - wl.hierNode.i);\n wr.hierNode.change -= change;\n wr.hierNode.shift += shift;\n wr.hierNode.modifier += shift;\n wr.hierNode.prelim += shift;\n wl.hierNode.change += change;\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n */\n\n\nfunction defaultSeparation(node1, node2) {\n return node1.parentNode === node2.parentNode ? 1 : 2;\n}\n\nexports.init = init;\nexports.firstWalk = firstWalk;\nexports.secondWalk = secondWalk;\nexports.separation = separation;\nexports.radialCoordinate = radialCoordinate;\nexports.getViewRect = getViewRect;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/tree/layoutHelper.js\n// module id = 185\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar List = require(\"../../data/List\");\n\nvar Graph = require(\"../../data/Graph\");\n\nvar linkList = require(\"../../data/helper/linkList\");\n\nvar createDimensions = require(\"../../data/helper/createDimensions\");\n\nvar CoordinateSystem = require(\"../../CoordinateSystem\");\n\nvar createListFromArray = require(\"./createListFromArray\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction _default(nodes, edges, seriesModel, directed, beforeLink) {\n // ??? TODO\n // support dataset?\n var graph = new Graph(directed);\n\n for (var i = 0; i < nodes.length; i++) {\n graph.addNode(zrUtil.retrieve( // Id, name, dataIndex\n nodes[i].id, nodes[i].name, i), i);\n }\n\n var linkNameList = [];\n var validEdges = [];\n var linkCount = 0;\n\n for (var i = 0; i < edges.length; i++) {\n var link = edges[i];\n var source = link.source;\n var target = link.target; // addEdge may fail when source or target not exists\n\n if (graph.addEdge(source, target, linkCount)) {\n validEdges.push(link);\n linkNameList.push(zrUtil.retrieve(link.id, source + ' > ' + target));\n linkCount++;\n }\n }\n\n var coordSys = seriesModel.get('coordinateSystem');\n var nodeData;\n\n if (coordSys === 'cartesian2d' || coordSys === 'polar') {\n nodeData = createListFromArray(nodes, seriesModel);\n } else {\n var coordSysCtor = CoordinateSystem.get(coordSys);\n var coordDimensions = coordSysCtor && coordSysCtor.type !== 'view' ? coordSysCtor.dimensions || [] : []; // FIXME: Some geo do not need `value` dimenson, whereas `calendar` needs\n // `value` dimension, but graph need `value` dimension. It's better to\n // uniform this behavior.\n\n if (zrUtil.indexOf(coordDimensions, 'value') < 0) {\n coordDimensions.concat(['value']);\n }\n\n var dimensionNames = createDimensions(nodes, {\n coordDimensions: coordDimensions\n });\n nodeData = new List(dimensionNames, seriesModel);\n nodeData.initData(nodes);\n }\n\n var edgeData = new List(['value'], seriesModel);\n edgeData.initData(validEdges, linkNameList);\n beforeLink && beforeLink(nodeData, edgeData);\n linkList({\n mainData: nodeData,\n struct: graph,\n structAttr: 'graph',\n datas: {\n node: nodeData,\n edge: edgeData\n },\n datasAttr: {\n node: 'data',\n edge: 'edgeData'\n }\n }); // Update dataIndex of nodes and edges because invalid edge may be removed\n\n graph.update();\n return graph;\n}\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/helper/createGraphFromNodeEdge.js\n// module id = 186\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../../echarts\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @payload\n * @property {number} [seriesIndex]\n * @property {string} [seriesId]\n * @property {string} [seriesName]\n * @property {number} [dataIndex]\n */\necharts.registerAction({\n type: 'focusNodeAdjacency',\n event: 'focusNodeAdjacency',\n update: 'series:focusNodeAdjacency'\n}, function () {});\n/**\n * @payload\n * @property {number} [seriesIndex]\n * @property {string} [seriesId]\n * @property {string} [seriesName]\n */\n\necharts.registerAction({\n type: 'unfocusNodeAdjacency',\n event: 'unfocusNodeAdjacency',\n update: 'series:unfocusNodeAdjacency'\n}, function () {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/helper/focusNodeAdjacencyAction.js\n// module id = 187\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar vec2 = require(\"zrender/lib/core/vector\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction simpleLayout(seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n return;\n }\n\n var graph = seriesModel.getGraph();\n graph.eachNode(function (node) {\n var model = node.getModel();\n node.setLayout([+model.get('x'), +model.get('y')]);\n });\n simpleLayoutEdge(graph);\n}\n\nfunction simpleLayoutEdge(graph) {\n graph.eachEdge(function (edge) {\n var curveness = edge.getModel().get('lineStyle.curveness') || 0;\n var p1 = vec2.clone(edge.node1.getLayout());\n var p2 = vec2.clone(edge.node2.getLayout());\n var points = [p1, p2];\n\n if (+curveness) {\n points.push([(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness]);\n }\n\n edge.setLayout(points);\n });\n}\n\nexports.simpleLayout = simpleLayout;\nexports.simpleLayoutEdge = simpleLayoutEdge;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/graph/simpleLayoutHelper.js\n// module id = 188\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar vec2 = require(\"zrender/lib/core/vector\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction circularLayout(seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n return;\n }\n\n var rect = coordSys.getBoundingRect();\n var nodeData = seriesModel.getData();\n var graph = nodeData.graph;\n var angle = 0;\n var sum = nodeData.getSum('value');\n var unitAngle = Math.PI * 2 / (sum || nodeData.count());\n var cx = rect.width / 2 + rect.x;\n var cy = rect.height / 2 + rect.y;\n var r = Math.min(rect.width, rect.height) / 2;\n graph.eachNode(function (node) {\n var value = node.getValue('value');\n angle += unitAngle * (sum ? value : 1) / 2;\n node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]);\n angle += unitAngle * (sum ? value : 1) / 2;\n });\n nodeData.setLayout({\n cx: cx,\n cy: cy\n });\n graph.eachEdge(function (edge) {\n var curveness = edge.getModel().get('lineStyle.curveness') || 0;\n var p1 = vec2.clone(edge.node1.getLayout());\n var p2 = vec2.clone(edge.node2.getLayout());\n var cp1;\n var x12 = (p1[0] + p2[0]) / 2;\n var y12 = (p1[1] + p2[1]) / 2;\n\n if (+curveness) {\n curveness *= 3;\n cp1 = [cx * curveness + x12 * (1 - curveness), cy * curveness + y12 * (1 - curveness)];\n }\n\n edge.setLayout([p1, p2, cp1]);\n });\n}\n\nexports.circularLayout = circularLayout;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/graph/circularLayoutHelper.js\n// module id = 189\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../echarts\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar throttleUtil = require(\"../util/throttle\");\n\nvar parallelPreprocessor = require(\"../coord/parallel/parallelPreprocessor\");\n\nrequire(\"../coord/parallel/parallelCreator\");\n\nrequire(\"../coord/parallel/ParallelModel\");\n\nrequire(\"./parallelAxis\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar CLICK_THRESHOLD = 5; // > 4\n// Parallel view\n\necharts.extendComponentView({\n type: 'parallel',\n render: function (parallelModel, ecModel, api) {\n this._model = parallelModel;\n this._api = api;\n\n if (!this._handlers) {\n this._handlers = {};\n zrUtil.each(handlers, function (handler, eventName) {\n api.getZr().on(eventName, this._handlers[eventName] = zrUtil.bind(handler, this));\n }, this);\n }\n\n throttleUtil.createOrUpdate(this, '_throttledDispatchExpand', parallelModel.get('axisExpandRate'), 'fixRate');\n },\n dispose: function (ecModel, api) {\n zrUtil.each(this._handlers, function (handler, eventName) {\n api.getZr().off(eventName, handler);\n });\n this._handlers = null;\n },\n\n /**\n * @param {Object} [opt] If null, cancle the last action triggering for debounce.\n */\n _throttledDispatchExpand: function (opt) {\n this._dispatchExpand(opt);\n },\n _dispatchExpand: function (opt) {\n opt && this._api.dispatchAction(zrUtil.extend({\n type: 'parallelAxisExpand'\n }, opt));\n }\n});\nvar handlers = {\n mousedown: function (e) {\n if (checkTrigger(this, 'click')) {\n this._mouseDownPoint = [e.offsetX, e.offsetY];\n }\n },\n mouseup: function (e) {\n var mouseDownPoint = this._mouseDownPoint;\n\n if (checkTrigger(this, 'click') && mouseDownPoint) {\n var point = [e.offsetX, e.offsetY];\n var dist = Math.pow(mouseDownPoint[0] - point[0], 2) + Math.pow(mouseDownPoint[1] - point[1], 2);\n\n if (dist > CLICK_THRESHOLD) {\n return;\n }\n\n var result = this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\n\n result.behavior !== 'none' && this._dispatchExpand({\n axisExpandWindow: result.axisExpandWindow\n });\n }\n\n this._mouseDownPoint = null;\n },\n mousemove: function (e) {\n // Should do nothing when brushing.\n if (this._mouseDownPoint || !checkTrigger(this, 'mousemove')) {\n return;\n }\n\n var model = this._model;\n var result = model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\n var behavior = result.behavior;\n behavior === 'jump' && this._throttledDispatchExpand.debounceNextCall(model.get('axisExpandDebounce'));\n\n this._throttledDispatchExpand(behavior === 'none' ? null // Cancle the last trigger, in case that mouse slide out of the area quickly.\n : {\n axisExpandWindow: result.axisExpandWindow,\n // Jumping uses animation, and sliding suppresses animation.\n animation: behavior === 'jump' ? null : false\n });\n }\n};\n\nfunction checkTrigger(view, triggerOn) {\n var model = view._model;\n return model.get('axisExpandable') && model.get('axisExpandTriggerOn') === triggerOn;\n}\n\necharts.registerPreprocessor(parallelPreprocessor);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/parallel.js\n// module id = 190\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar Parallel = require(\"./Parallel\");\n\nvar CoordinateSystem = require(\"../../CoordinateSystem\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Parallel coordinate system creater.\n */\nfunction create(ecModel, api) {\n var coordSysList = [];\n ecModel.eachComponent('parallel', function (parallelModel, idx) {\n var coordSys = new Parallel(parallelModel, ecModel, api);\n coordSys.name = 'parallel_' + idx;\n coordSys.resize(parallelModel, api);\n parallelModel.coordinateSystem = coordSys;\n coordSys.model = parallelModel;\n coordSysList.push(coordSys);\n }); // Inject the coordinateSystems into seriesModel\n\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'parallel') {\n var parallelModel = ecModel.queryComponents({\n mainType: 'parallel',\n index: seriesModel.get('parallelIndex'),\n id: seriesModel.get('parallelId')\n })[0];\n seriesModel.coordinateSystem = parallelModel.coordinateSystem;\n }\n });\n return coordSysList;\n}\n\nCoordinateSystem.register('parallel', {\n create: create\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/coord/parallel/parallelCreator.js\n// module id = 191\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar BoundingRect = require(\"zrender/lib/core/BoundingRect\");\n\nvar _cursorHelper = require(\"./cursorHelper\");\n\nvar onIrrelevantElement = _cursorHelper.onIrrelevantElement;\n\nvar graphicUtil = require(\"../../util/graphic\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction makeRectPanelClipPath(rect) {\n rect = normalizeRect(rect);\n return function (localPoints, transform) {\n return graphicUtil.clipPointsByRect(localPoints, rect);\n };\n}\n\nfunction makeLinearBrushOtherExtent(rect, specifiedXYIndex) {\n rect = normalizeRect(rect);\n return function (xyIndex) {\n var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex;\n var brushWidth = idx ? rect.width : rect.height;\n var base = idx ? rect.x : rect.y;\n return [base, base + (brushWidth || 0)];\n };\n}\n\nfunction makeRectIsTargetByCursor(rect, api, targetModel) {\n rect = normalizeRect(rect);\n return function (e, localCursorPoint, transform) {\n return rect.contain(localCursorPoint[0], localCursorPoint[1]) && !onIrrelevantElement(e, api, targetModel);\n };\n} // Consider width/height is negative.\n\n\nfunction normalizeRect(rect) {\n return BoundingRect.create(rect);\n}\n\nexports.makeRectPanelClipPath = makeRectPanelClipPath;\nexports.makeLinearBrushOtherExtent = makeLinearBrushOtherExtent;\nexports.makeRectIsTargetByCursor = makeRectIsTargetByCursor;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/helper/brushHelper.js\n// module id = 192\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar createListSimply = require(\"../helper/createListSimply\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar _dimensionHelper = require(\"../../data/helper/dimensionHelper\");\n\nvar getDimensionTypeByAxis = _dimensionHelper.getDimensionTypeByAxis;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar seriesModelMixin = {\n /**\n * @private\n * @type {string}\n */\n _baseAxisDim: null,\n\n /**\n * @override\n */\n getInitialData: function (option, ecModel) {\n // When both types of xAxis and yAxis are 'value', layout is\n // needed to be specified by user. Otherwise, layout can be\n // judged by which axis is category.\n var ordinalMeta;\n var xAxisModel = ecModel.getComponent('xAxis', this.get('xAxisIndex'));\n var yAxisModel = ecModel.getComponent('yAxis', this.get('yAxisIndex'));\n var xAxisType = xAxisModel.get('type');\n var yAxisType = yAxisModel.get('type');\n var addOrdinal; // FIXME\n // 考虑时间轴\n\n if (xAxisType === 'category') {\n option.layout = 'horizontal';\n ordinalMeta = xAxisModel.getOrdinalMeta();\n addOrdinal = true;\n } else if (yAxisType === 'category') {\n option.layout = 'vertical';\n ordinalMeta = yAxisModel.getOrdinalMeta();\n addOrdinal = true;\n } else {\n option.layout = option.layout || 'horizontal';\n }\n\n var coordDims = ['x', 'y'];\n var baseAxisDimIndex = option.layout === 'horizontal' ? 0 : 1;\n var baseAxisDim = this._baseAxisDim = coordDims[baseAxisDimIndex];\n var otherAxisDim = coordDims[1 - baseAxisDimIndex];\n var axisModels = [xAxisModel, yAxisModel];\n var baseAxisType = axisModels[baseAxisDimIndex].get('type');\n var otherAxisType = axisModels[1 - baseAxisDimIndex].get('type');\n var data = option.data; // ??? FIXME make a stage to perform data transfrom.\n // MUST create a new data, consider setOption({}) again.\n\n if (data && addOrdinal) {\n var newOptionData = [];\n zrUtil.each(data, function (item, index) {\n var newItem;\n\n if (item.value && zrUtil.isArray(item.value)) {\n newItem = item.value.slice();\n item.value.unshift(index);\n } else if (zrUtil.isArray(item)) {\n newItem = item.slice();\n item.unshift(index);\n } else {\n newItem = item;\n }\n\n newOptionData.push(newItem);\n });\n option.data = newOptionData;\n }\n\n var defaultValueDimensions = this.defaultValueDimensions;\n return createListSimply(this, {\n coordDimensions: [{\n name: baseAxisDim,\n type: getDimensionTypeByAxis(baseAxisType),\n ordinalMeta: ordinalMeta,\n otherDims: {\n tooltip: false,\n itemName: 0\n },\n dimsDef: ['base']\n }, {\n name: otherAxisDim,\n type: getDimensionTypeByAxis(otherAxisType),\n dimsDef: defaultValueDimensions.slice()\n }],\n dimensionsCount: defaultValueDimensions.length + 1\n });\n },\n\n /**\n * If horizontal, base axis is x, otherwise y.\n * @override\n */\n getBaseAxis: function () {\n var dim = this._baseAxisDim;\n return this.ecModel.getComponent(dim + 'Axis', this.get(dim + 'AxisIndex')).axis;\n }\n};\nexports.seriesModelMixin = seriesModelMixin;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/helper/whiskerBoxCommon.js\n// module id = 193\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar graphic = require(\"../../util/graphic\");\n\nvar Line = require(\"./Line\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar _symbol = require(\"../../util/symbol\");\n\nvar createSymbol = _symbol.createSymbol;\n\nvar vec2 = require(\"zrender/lib/core/vector\");\n\nvar curveUtil = require(\"zrender/lib/core/curve\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Provide effect for line\n * @module echarts/chart/helper/EffectLine\n */\n\n/**\n * @constructor\n * @extends {module:zrender/graphic/Group}\n * @alias {module:echarts/chart/helper/Line}\n */\nfunction EffectLine(lineData, idx, seriesScope) {\n graphic.Group.call(this);\n this.add(this.createLine(lineData, idx, seriesScope));\n\n this._updateEffectSymbol(lineData, idx);\n}\n\nvar effectLineProto = EffectLine.prototype;\n\neffectLineProto.createLine = function (lineData, idx, seriesScope) {\n return new Line(lineData, idx, seriesScope);\n};\n\neffectLineProto._updateEffectSymbol = function (lineData, idx) {\n var itemModel = lineData.getItemModel(idx);\n var effectModel = itemModel.getModel('effect');\n var size = effectModel.get('symbolSize');\n var symbolType = effectModel.get('symbol');\n\n if (!zrUtil.isArray(size)) {\n size = [size, size];\n }\n\n var color = effectModel.get('color') || lineData.getItemVisual(idx, 'color');\n var symbol = this.childAt(1);\n\n if (this._symbolType !== symbolType) {\n // Remove previous\n this.remove(symbol);\n symbol = createSymbol(symbolType, -0.5, -0.5, 1, 1, color);\n symbol.z2 = 100;\n symbol.culling = true;\n this.add(symbol);\n } // Symbol may be removed if loop is false\n\n\n if (!symbol) {\n return;\n } // Shadow color is same with color in default\n\n\n symbol.setStyle('shadowColor', color);\n symbol.setStyle(effectModel.getItemStyle(['color']));\n symbol.attr('scale', size);\n symbol.setColor(color);\n symbol.attr('scale', size);\n this._symbolType = symbolType;\n\n this._updateEffectAnimation(lineData, effectModel, idx);\n};\n\neffectLineProto._updateEffectAnimation = function (lineData, effectModel, idx) {\n var symbol = this.childAt(1);\n\n if (!symbol) {\n return;\n }\n\n var self = this;\n var points = lineData.getItemLayout(idx);\n var period = effectModel.get('period') * 1000;\n var loop = effectModel.get('loop');\n var constantSpeed = effectModel.get('constantSpeed');\n var delayExpr = zrUtil.retrieve(effectModel.get('delay'), function (idx) {\n return idx / lineData.count() * period / 3;\n });\n var isDelayFunc = typeof delayExpr === 'function'; // Ignore when updating\n\n symbol.ignore = true;\n this.updateAnimationPoints(symbol, points);\n\n if (constantSpeed > 0) {\n period = this.getLineLength(symbol) / constantSpeed * 1000;\n }\n\n if (period !== this._period || loop !== this._loop) {\n symbol.stopAnimation();\n var delay = delayExpr;\n\n if (isDelayFunc) {\n delay = delayExpr(idx);\n }\n\n if (symbol.__t > 0) {\n delay = -period * symbol.__t;\n }\n\n symbol.__t = 0;\n var animator = symbol.animate('', loop).when(period, {\n __t: 1\n }).delay(delay).during(function () {\n self.updateSymbolPosition(symbol);\n });\n\n if (!loop) {\n animator.done(function () {\n self.remove(symbol);\n });\n }\n\n animator.start();\n }\n\n this._period = period;\n this._loop = loop;\n};\n\neffectLineProto.getLineLength = function (symbol) {\n // Not so accurate\n return vec2.dist(symbol.__p1, symbol.__cp1) + vec2.dist(symbol.__cp1, symbol.__p2);\n};\n\neffectLineProto.updateAnimationPoints = function (symbol, points) {\n symbol.__p1 = points[0];\n symbol.__p2 = points[1];\n symbol.__cp1 = points[2] || [(points[0][0] + points[1][0]) / 2, (points[0][1] + points[1][1]) / 2];\n};\n\neffectLineProto.updateData = function (lineData, idx, seriesScope) {\n this.childAt(0).updateData(lineData, idx, seriesScope);\n\n this._updateEffectSymbol(lineData, idx);\n};\n\neffectLineProto.updateSymbolPosition = function (symbol) {\n var p1 = symbol.__p1;\n var p2 = symbol.__p2;\n var cp1 = symbol.__cp1;\n var t = symbol.__t;\n var pos = symbol.position;\n var quadraticAt = curveUtil.quadraticAt;\n var quadraticDerivativeAt = curveUtil.quadraticDerivativeAt;\n pos[0] = quadraticAt(p1[0], cp1[0], p2[0], t);\n pos[1] = quadraticAt(p1[1], cp1[1], p2[1], t); // Tangent\n\n var tx = quadraticDerivativeAt(p1[0], cp1[0], p2[0], t);\n var ty = quadraticDerivativeAt(p1[1], cp1[1], p2[1], t);\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;\n symbol.ignore = false;\n};\n\neffectLineProto.updateLayout = function (lineData, idx) {\n this.childAt(0).updateLayout(lineData, idx);\n var effectModel = lineData.getItemModel(idx).getModel('effect');\n\n this._updateEffectAnimation(lineData, effectModel, idx);\n};\n\nzrUtil.inherits(EffectLine, graphic.Group);\nvar _default = EffectLine;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/helper/EffectLine.js\n// module id = 194\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar graphic = require(\"../../util/graphic\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @module echarts/chart/helper/Line\n */\n\n/**\n * @constructor\n * @extends {module:zrender/graphic/Group}\n * @alias {module:echarts/chart/helper/Polyline}\n */\nfunction Polyline(lineData, idx, seriesScope) {\n graphic.Group.call(this);\n\n this._createPolyline(lineData, idx, seriesScope);\n}\n\nvar polylineProto = Polyline.prototype;\n\npolylineProto._createPolyline = function (lineData, idx, seriesScope) {\n // var seriesModel = lineData.hostModel;\n var points = lineData.getItemLayout(idx);\n var line = new graphic.Polyline({\n shape: {\n points: points\n }\n });\n this.add(line);\n\n this._updateCommonStl(lineData, idx, seriesScope);\n};\n\npolylineProto.updateData = function (lineData, idx, seriesScope) {\n var seriesModel = lineData.hostModel;\n var line = this.childAt(0);\n var target = {\n shape: {\n points: lineData.getItemLayout(idx)\n }\n };\n graphic.updateProps(line, target, seriesModel, idx);\n\n this._updateCommonStl(lineData, idx, seriesScope);\n};\n\npolylineProto._updateCommonStl = function (lineData, idx, seriesScope) {\n var line = this.childAt(0);\n var itemModel = lineData.getItemModel(idx);\n var visualColor = lineData.getItemVisual(idx, 'color');\n var lineStyle = seriesScope && seriesScope.lineStyle;\n var hoverLineStyle = seriesScope && seriesScope.hoverLineStyle;\n\n if (!seriesScope || lineData.hasItemOption) {\n lineStyle = itemModel.getModel('lineStyle').getLineStyle();\n hoverLineStyle = itemModel.getModel('emphasis.lineStyle').getLineStyle();\n }\n\n line.useStyle(zrUtil.defaults({\n strokeNoScale: true,\n fill: 'none',\n stroke: visualColor\n }, lineStyle));\n line.hoverStyle = hoverLineStyle;\n graphic.setHoverStyle(this);\n};\n\npolylineProto.updateLayout = function (lineData, idx) {\n var polyline = this.childAt(0);\n polyline.setShape('points', lineData.getItemLayout(idx));\n};\n\nzrUtil.inherits(Polyline, graphic.Group);\nvar _default = Polyline;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/helper/Polyline.js\n// module id = 195\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar createRenderPlanner = require(\"../helper/createRenderPlanner\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/* global Float32Array */\nvar _default = {\n seriesType: 'lines',\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var isPolyline = seriesModel.get('polyline');\n var isLarge = seriesModel.pipelineContext.large;\n\n function progress(params, lineData) {\n var lineCoords = [];\n\n if (isLarge) {\n var points;\n var segCount = params.end - params.start;\n\n if (isPolyline) {\n var totalCoordsCount = 0;\n\n for (var i = params.start; i < params.end; i++) {\n totalCoordsCount += seriesModel.getLineCoordsCount(i);\n }\n\n points = new Float32Array(segCount + totalCoordsCount * 2);\n } else {\n points = new Float32Array(segCount * 4);\n }\n\n var offset = 0;\n var pt = [];\n\n for (var i = params.start; i < params.end; i++) {\n var len = seriesModel.getLineCoords(i, lineCoords);\n\n if (isPolyline) {\n points[offset++] = len;\n }\n\n for (var k = 0; k < len; k++) {\n pt = coordSys.dataToPoint(lineCoords[k], false, pt);\n points[offset++] = pt[0];\n points[offset++] = pt[1];\n }\n }\n\n lineData.setLayout('linesPoints', points);\n } else {\n for (var i = params.start; i < params.end; i++) {\n var itemModel = lineData.getItemModel(i);\n var len = seriesModel.getLineCoords(i, lineCoords);\n var pts = [];\n\n if (isPolyline) {\n for (var j = 0; j < len; j++) {\n pts.push(coordSys.dataToPoint(lineCoords[j]));\n }\n } else {\n pts[0] = coordSys.dataToPoint(lineCoords[0]);\n pts[1] = coordSys.dataToPoint(lineCoords[1]);\n var curveness = itemModel.get('lineStyle.curveness');\n\n if (+curveness) {\n pts[2] = [(pts[0][0] + pts[1][0]) / 2 - (pts[0][1] - pts[1][1]) * curveness, (pts[0][1] + pts[1][1]) / 2 - (pts[1][0] - pts[0][0]) * curveness];\n }\n }\n\n lineData.setItemLayout(i, pts);\n }\n }\n }\n\n return {\n progress: progress\n };\n }\n};\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/lines/linesLayout.js\n// module id = 196\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../echarts\");\n\nrequire(\"../coord/single/singleCreator\");\n\nrequire(\"./axis/SingleAxisView\");\n\nrequire(\"../coord/single/AxisModel\");\n\nrequire(\"./axisPointer\");\n\nrequire(\"./axisPointer/SingleAxisPointer\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\necharts.extendComponentView({\n type: 'single'\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/singleAxis.js\n// module id = 197\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @param {Object} opt {labelInside}\n * @return {Object} {\n * position, rotation, labelDirection, labelOffset,\n * tickDirection, labelRotate, z2\n * }\n */\nfunction layout(axisModel, opt) {\n opt = opt || {};\n var single = axisModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var axisPosition = axis.position;\n var orient = axis.orient;\n var rect = single.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var positionMap = {\n horizontal: {\n top: rectBound[2],\n bottom: rectBound[3]\n },\n vertical: {\n left: rectBound[0],\n right: rectBound[1]\n }\n };\n layout.position = [orient === 'vertical' ? positionMap.vertical[axisPosition] : rectBound[0], orient === 'horizontal' ? positionMap.horizontal[axisPosition] : rectBound[3]];\n var r = {\n horizontal: 0,\n vertical: 1\n };\n layout.rotation = Math.PI / 2 * r[orient];\n var directionMap = {\n top: -1,\n bottom: 1,\n right: 1,\n left: -1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = directionMap[axisPosition];\n\n if (axisModel.get('axisTick.inside')) {\n layout.tickDirection = -layout.tickDirection;\n }\n\n if (zrUtil.retrieve(opt.labelInside, axisModel.get('axisLabel.inside'))) {\n layout.labelDirection = -layout.labelDirection;\n }\n\n var labelRotation = opt.rotate;\n labelRotation == null && (labelRotation = axisModel.get('axisLabel.rotate'));\n layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation;\n layout.z2 = 1;\n return layout;\n}\n\nexports.layout = layout;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/coord/single/singleAxisHelper.js\n// module id = 198\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar modelUtil = require(\"../../util/model\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @param {Object} finder contains {seriesIndex, dataIndex, dataIndexInside}\n * @param {module:echarts/model/Global} ecModel\n * @return {Object} {point: [x, y], el: ...} point Will not be null.\n */\nfunction _default(finder, ecModel) {\n var point = [];\n var seriesIndex = finder.seriesIndex;\n var seriesModel;\n\n if (seriesIndex == null || !(seriesModel = ecModel.getSeriesByIndex(seriesIndex))) {\n return {\n point: []\n };\n }\n\n var data = seriesModel.getData();\n var dataIndex = modelUtil.queryDataIndex(data, finder);\n\n if (dataIndex == null || dataIndex < 0 || zrUtil.isArray(dataIndex)) {\n return {\n point: []\n };\n }\n\n var el = data.getItemGraphicEl(dataIndex);\n var coordSys = seriesModel.coordinateSystem;\n\n if (seriesModel.getTooltipPosition) {\n point = seriesModel.getTooltipPosition(dataIndex) || [];\n } else if (coordSys && coordSys.dataToPoint) {\n point = coordSys.dataToPoint(data.getValues(zrUtil.map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }), dataIndex, true)) || [];\n } else if (el) {\n // Use graphic bounding rect\n var rect = el.getBoundingRect().clone();\n rect.applyTransform(el.transform);\n point = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n }\n\n return {\n point: point,\n el: el\n };\n}\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/axisPointer/findPointFromSeries.js\n// module id = 199\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar env = require(\"zrender/lib/core/env\");\n\nvar _model = require(\"../../util/model\");\n\nvar makeInner = _model.makeInner;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar inner = makeInner();\nvar each = zrUtil.each;\n/**\n * @param {string} key\n * @param {module:echarts/ExtensionAPI} api\n * @param {Function} handler\n * param: {string} currTrigger\n * param: {Array.} point\n */\n\nfunction register(key, api, handler) {\n if (env.node) {\n return;\n }\n\n var zr = api.getZr();\n inner(zr).records || (inner(zr).records = {});\n initGlobalListeners(zr, api);\n var record = inner(zr).records[key] || (inner(zr).records[key] = {});\n record.handler = handler;\n}\n\nfunction initGlobalListeners(zr, api) {\n if (inner(zr).initialized) {\n return;\n }\n\n inner(zr).initialized = true;\n useHandler('click', zrUtil.curry(doEnter, 'click'));\n useHandler('mousemove', zrUtil.curry(doEnter, 'mousemove')); // useHandler('mouseout', onLeave);\n\n useHandler('globalout', onLeave);\n\n function useHandler(eventType, cb) {\n zr.on(eventType, function (e) {\n var dis = makeDispatchAction(api);\n each(inner(zr).records, function (record) {\n record && cb(record, e, dis.dispatchAction);\n });\n dispatchTooltipFinally(dis.pendings, api);\n });\n }\n}\n\nfunction dispatchTooltipFinally(pendings, api) {\n var showLen = pendings.showTip.length;\n var hideLen = pendings.hideTip.length;\n var actuallyPayload;\n\n if (showLen) {\n actuallyPayload = pendings.showTip[showLen - 1];\n } else if (hideLen) {\n actuallyPayload = pendings.hideTip[hideLen - 1];\n }\n\n if (actuallyPayload) {\n actuallyPayload.dispatchAction = null;\n api.dispatchAction(actuallyPayload);\n }\n}\n\nfunction onLeave(record, e, dispatchAction) {\n record.handler('leave', null, dispatchAction);\n}\n\nfunction doEnter(currTrigger, record, e, dispatchAction) {\n record.handler(currTrigger, e, dispatchAction);\n}\n\nfunction makeDispatchAction(api) {\n var pendings = {\n showTip: [],\n hideTip: []\n }; // FIXME\n // better approach?\n // 'showTip' and 'hideTip' can be triggered by axisPointer and tooltip,\n // which may be conflict, (axisPointer call showTip but tooltip call hideTip);\n // So we have to add \"final stage\" to merge those dispatched actions.\n\n var dispatchAction = function (payload) {\n var pendingList = pendings[payload.type];\n\n if (pendingList) {\n pendingList.push(payload);\n } else {\n payload.dispatchAction = dispatchAction;\n api.dispatchAction(payload);\n }\n };\n\n return {\n dispatchAction: dispatchAction,\n pendings: pendings\n };\n}\n/**\n * @param {string} key\n * @param {module:echarts/ExtensionAPI} api\n */\n\n\nfunction unregister(key, api) {\n if (env.node) {\n return;\n }\n\n var zr = api.getZr();\n var record = (inner(zr).records || {})[key];\n\n if (record) {\n inner(zr).records[key] = null;\n }\n}\n\nexports.register = register;\nexports.unregister = unregister;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/axisPointer/globalListener.js\n// module id = 200\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar graphic = require(\"../../util/graphic\");\n\nvar BaseAxisPointer = require(\"./BaseAxisPointer\");\n\nvar viewHelper = require(\"./viewHelper\");\n\nvar cartesianAxisHelper = require(\"../../coord/cartesian/cartesianAxisHelper\");\n\nvar AxisView = require(\"../axis/AxisView\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar CartesianAxisPointer = BaseAxisPointer.extend({\n /**\n * @override\n */\n makeElOption: function (elOption, value, axisModel, axisPointerModel, api) {\n var axis = axisModel.axis;\n var grid = axis.grid;\n var axisPointerType = axisPointerModel.get('type');\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\n var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true));\n\n if (axisPointerType && axisPointerType !== 'none') {\n var elStyle = viewHelper.buildElStyle(axisPointerModel);\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent, elStyle);\n pointerOption.style = elStyle;\n elOption.graphicKey = pointerOption.type;\n elOption.pointer = pointerOption;\n }\n\n var layoutInfo = cartesianAxisHelper.layout(grid.model, axisModel);\n viewHelper.buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api);\n },\n\n /**\n * @override\n */\n getHandleTransform: function (value, axisModel, axisPointerModel) {\n var layoutInfo = cartesianAxisHelper.layout(axisModel.axis.grid.model, axisModel, {\n labelInside: false\n });\n layoutInfo.labelMargin = axisPointerModel.get('handle.margin');\n return {\n position: viewHelper.getTransformedPosition(axisModel.axis, value, layoutInfo),\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\n };\n },\n\n /**\n * @override\n */\n updateHandleTransform: function (transform, delta, axisModel, axisPointerModel) {\n var axis = axisModel.axis;\n var grid = axis.grid;\n var axisExtent = axis.getGlobalExtent(true);\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\n var dimIndex = axis.dim === 'x' ? 0 : 1;\n var currPosition = transform.position;\n currPosition[dimIndex] += delta[dimIndex];\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\n cursorPoint[dimIndex] = currPosition[dimIndex]; // Make tooltip do not overlap axisPointer and in the middle of the grid.\n\n var tooltipOptions = [{\n verticalAlign: 'middle'\n }, {\n align: 'center'\n }];\n return {\n position: currPosition,\n rotation: transform.rotation,\n cursorPoint: cursorPoint,\n tooltipOption: tooltipOptions[dimIndex]\n };\n }\n});\n\nfunction getCartesian(grid, axis) {\n var opt = {};\n opt[axis.dim + 'AxisIndex'] = axis.index;\n return grid.getCartesian(opt);\n}\n\nvar pointerShapeBuilder = {\n line: function (axis, pixelValue, otherExtent, elStyle) {\n var targetShape = viewHelper.makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis));\n graphic.subPixelOptimizeLine({\n shape: targetShape,\n style: elStyle\n });\n return {\n type: 'Line',\n shape: targetShape\n };\n },\n shadow: function (axis, pixelValue, otherExtent, elStyle) {\n var bandWidth = Math.max(1, axis.getBandWidth());\n var span = otherExtent[1] - otherExtent[0];\n return {\n type: 'Rect',\n shape: viewHelper.makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis))\n };\n }\n};\n\nfunction getAxisDimIndex(axis) {\n return axis.dim === 'x' ? 0 : 1;\n}\n\nAxisView.registerAxisPointerClass('CartesianAxisPointer', CartesianAxisPointer);\nvar _default = CartesianAxisPointer;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/axisPointer/CartesianAxisPointer.js\n// module id = 201\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../../echarts\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar Model = require(\"../../model/Model\");\n\nvar _model = require(\"../../util/model\");\n\nvar isNameSpecified = _model.isNameSpecified;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar LegendModel = echarts.extendComponentModel({\n type: 'legend.plain',\n dependencies: ['series'],\n layoutMode: {\n type: 'box',\n // legend.width/height are maxWidth/maxHeight actually,\n // whereas realy width/height is calculated by its content.\n // (Setting {left: 10, right: 10} does not make sense).\n // So consider the case:\n // `setOption({legend: {left: 10});`\n // then `setOption({legend: {right: 10});`\n // The previous `left` should be cleared by setting `ignoreSize`.\n ignoreSize: true\n },\n init: function (option, parentModel, ecModel) {\n this.mergeDefaultAndTheme(option, ecModel);\n option.selected = option.selected || {};\n },\n mergeOption: function (option) {\n LegendModel.superCall(this, 'mergeOption', option);\n },\n optionUpdated: function () {\n this._updateData(this.ecModel);\n\n var legendData = this._data; // If selectedMode is single, try to select one\n\n if (legendData[0] && this.get('selectedMode') === 'single') {\n var hasSelected = false; // If has any selected in option.selected\n\n for (var i = 0; i < legendData.length; i++) {\n var name = legendData[i].get('name');\n\n if (this.isSelected(name)) {\n // Force to unselect others\n this.select(name);\n hasSelected = true;\n break;\n }\n } // Try select the first if selectedMode is single\n\n\n !hasSelected && this.select(legendData[0].get('name'));\n }\n },\n _updateData: function (ecModel) {\n var potentialData = [];\n var availableNames = [];\n ecModel.eachRawSeries(function (seriesModel) {\n var seriesName = seriesModel.name;\n availableNames.push(seriesName);\n var isPotential;\n\n if (seriesModel.legendDataProvider) {\n var data = seriesModel.legendDataProvider();\n var names = data.mapArray(data.getName);\n\n if (!ecModel.isSeriesFiltered(seriesModel)) {\n availableNames = availableNames.concat(names);\n }\n\n if (names.length) {\n potentialData = potentialData.concat(names);\n } else {\n isPotential = true;\n }\n } else {\n isPotential = true;\n }\n\n if (isPotential && isNameSpecified(seriesModel)) {\n potentialData.push(seriesModel.name);\n }\n });\n /**\n * @type {Array.}\n * @private\n */\n\n this._availableNames = availableNames; // If legend.data not specified in option, use availableNames as data,\n // which is convinient for user preparing option.\n\n var rawData = this.get('data') || potentialData;\n var legendData = zrUtil.map(rawData, function (dataItem) {\n // Can be string or number\n if (typeof dataItem === 'string' || typeof dataItem === 'number') {\n dataItem = {\n name: dataItem\n };\n }\n\n return new Model(dataItem, this, this.ecModel);\n }, this);\n /**\n * @type {Array.}\n * @private\n */\n\n this._data = legendData;\n },\n\n /**\n * @return {Array.}\n */\n getData: function () {\n return this._data;\n },\n\n /**\n * @param {string} name\n */\n select: function (name) {\n var selected = this.option.selected;\n var selectedMode = this.get('selectedMode');\n\n if (selectedMode === 'single') {\n var data = this._data;\n zrUtil.each(data, function (dataItem) {\n selected[dataItem.get('name')] = false;\n });\n }\n\n selected[name] = true;\n },\n\n /**\n * @param {string} name\n */\n unSelect: function (name) {\n if (this.get('selectedMode') !== 'single') {\n this.option.selected[name] = false;\n }\n },\n\n /**\n * @param {string} name\n */\n toggleSelected: function (name) {\n var selected = this.option.selected; // Default is true\n\n if (!selected.hasOwnProperty(name)) {\n selected[name] = true;\n }\n\n this[selected[name] ? 'unSelect' : 'select'](name);\n },\n\n /**\n * @param {string} name\n */\n isSelected: function (name) {\n var selected = this.option.selected;\n return !(selected.hasOwnProperty(name) && !selected[name]) && zrUtil.indexOf(this._availableNames, name) >= 0;\n },\n defaultOption: {\n // 一级层叠\n zlevel: 0,\n // 二级层叠\n z: 4,\n show: true,\n // 布局方式,默认为水平布局,可选为:\n // 'horizontal' | 'vertical'\n orient: 'horizontal',\n left: 'center',\n // right: 'center',\n top: 0,\n // bottom: null,\n // 水平对齐\n // 'auto' | 'left' | 'right'\n // 默认为 'auto', 根据 x 的位置判断是左对齐还是右对齐\n align: 'auto',\n backgroundColor: 'rgba(0,0,0,0)',\n // 图例边框颜色\n borderColor: '#ccc',\n borderRadius: 0,\n // 图例边框线宽,单位px,默认为0(无边框)\n borderWidth: 0,\n // 图例内边距,单位px,默认各方向内边距为5,\n // 接受数组分别设定上右下左边距,同css\n padding: 5,\n // 各个item之间的间隔,单位px,默认为10,\n // 横向布局时为水平间隔,纵向布局时为纵向间隔\n itemGap: 10,\n // 图例图形宽度\n itemWidth: 25,\n // 图例图形高度\n itemHeight: 14,\n // 图例关闭时候的颜色\n inactiveColor: '#ccc',\n textStyle: {\n // 图例文字颜色\n color: '#333'\n },\n // formatter: '',\n // 选择模式,默认开启图例开关\n selectedMode: true,\n // 配置默认选中状态,可配合LEGEND.SELECTED事件做动态数据载入\n // selected: null,\n // 图例内容(详见legend.data,数组中每一项代表一个item\n // data: [],\n // Tooltip 相关配置\n tooltip: {\n show: false\n }\n }\n});\nvar _default = LegendModel;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/legend/LegendModel.js\n// module id = 202\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _config = require(\"../../config\");\n\nvar __DEV__ = _config.__DEV__;\n\nvar echarts = require(\"../../echarts\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar _symbol = require(\"../../util/symbol\");\n\nvar createSymbol = _symbol.createSymbol;\n\nvar graphic = require(\"../../util/graphic\");\n\nvar _listComponent = require(\"../helper/listComponent\");\n\nvar makeBackground = _listComponent.makeBackground;\n\nvar layoutUtil = require(\"../../util/layout\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar curry = zrUtil.curry;\nvar each = zrUtil.each;\nvar Group = graphic.Group;\n\nvar _default = echarts.extendComponentView({\n type: 'legend.plain',\n newlineDisabled: false,\n\n /**\n * @override\n */\n init: function () {\n /**\n * @private\n * @type {module:zrender/container/Group}\n */\n this.group.add(this._contentGroup = new Group());\n /**\n * @private\n * @type {module:zrender/Element}\n */\n\n this._backgroundEl;\n /**\n * If first rendering, `contentGroup.position` is [0, 0], which\n * does not make sense and may cause unexepcted animation if adopted.\n * @private\n * @type {boolean}\n */\n\n this._isFirstRender = true;\n },\n\n /**\n * @protected\n */\n getContentGroup: function () {\n return this._contentGroup;\n },\n\n /**\n * @override\n */\n render: function (legendModel, ecModel, api) {\n var isFirstRender = this._isFirstRender;\n this._isFirstRender = false;\n this.resetInner();\n\n if (!legendModel.get('show', true)) {\n return;\n }\n\n var itemAlign = legendModel.get('align');\n\n if (!itemAlign || itemAlign === 'auto') {\n itemAlign = legendModel.get('left') === 'right' && legendModel.get('orient') === 'vertical' ? 'right' : 'left';\n }\n\n this.renderInner(itemAlign, legendModel, ecModel, api); // Perform layout.\n\n var positionInfo = legendModel.getBoxLayoutParams();\n var viewportSize = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var padding = legendModel.get('padding');\n var maxSize = layoutUtil.getLayoutRect(positionInfo, viewportSize, padding);\n var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender); // Place mainGroup, based on the calculated `mainRect`.\n\n var layoutRect = layoutUtil.getLayoutRect(zrUtil.defaults({\n width: mainRect.width,\n height: mainRect.height\n }, positionInfo), viewportSize, padding);\n this.group.attr('position', [layoutRect.x - mainRect.x, layoutRect.y - mainRect.y]); // Render background after group is layout.\n\n this.group.add(this._backgroundEl = makeBackground(mainRect, legendModel));\n },\n\n /**\n * @protected\n */\n resetInner: function () {\n this.getContentGroup().removeAll();\n this._backgroundEl && this.group.remove(this._backgroundEl);\n },\n\n /**\n * @protected\n */\n renderInner: function (itemAlign, legendModel, ecModel, api) {\n var contentGroup = this.getContentGroup();\n var legendDrawnMap = zrUtil.createHashMap();\n var selectMode = legendModel.get('selectedMode');\n var excludeSeriesId = [];\n ecModel.eachRawSeries(function (seriesModel) {\n !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id);\n });\n each(legendModel.getData(), function (itemModel, dataIndex) {\n var name = itemModel.get('name'); // Use empty string or \\n as a newline string\n\n if (!this.newlineDisabled && (name === '' || name === '\\n')) {\n contentGroup.add(new Group({\n newline: true\n }));\n return;\n } // Representitive series.\n\n\n var seriesModel = ecModel.getSeriesByName(name)[0];\n\n if (legendDrawnMap.get(name)) {\n // Have been drawed\n return;\n } // Series legend\n\n\n if (seriesModel) {\n var data = seriesModel.getData();\n var color = data.getVisual('color'); // If color is a callback function\n\n if (typeof color === 'function') {\n // Use the first data\n color = color(seriesModel.getDataParams(0));\n } // Using rect symbol defaultly\n\n\n var legendSymbolType = data.getVisual('legendSymbol') || 'roundRect';\n var symbolType = data.getVisual('symbol');\n\n var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, symbolType, itemAlign, color, selectMode);\n\n itemGroup.on('click', curry(dispatchSelectAction, name, api)).on('mouseover', curry(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));\n legendDrawnMap.set(name, true);\n } else {\n // Data legend of pie, funnel\n ecModel.eachRawSeries(function (seriesModel) {\n // In case multiple series has same data name\n if (legendDrawnMap.get(name)) {\n return;\n }\n\n if (seriesModel.legendDataProvider) {\n var data = seriesModel.legendDataProvider();\n var idx = data.indexOfName(name);\n\n if (idx < 0) {\n return;\n }\n\n var color = data.getItemVisual(idx, 'color');\n var legendSymbolType = 'roundRect';\n\n var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, null, itemAlign, color, selectMode); // FIXME: consider different series has items with the same name.\n\n\n itemGroup.on('click', curry(dispatchSelectAction, name, api)) // Should not specify the series name, consider legend controls\n // more than one pie series.\n .on('mouseover', curry(dispatchHighlightAction, null, name, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, null, name, api, excludeSeriesId));\n legendDrawnMap.set(name, true);\n }\n }, this);\n }\n }, this);\n },\n _createItem: function (name, dataIndex, itemModel, legendModel, legendSymbolType, symbolType, itemAlign, color, selectMode) {\n var itemWidth = legendModel.get('itemWidth');\n var itemHeight = legendModel.get('itemHeight');\n var inactiveColor = legendModel.get('inactiveColor');\n var symbolKeepAspect = legendModel.get('symbolKeepAspect');\n var isSelected = legendModel.isSelected(name);\n var itemGroup = new Group();\n var textStyleModel = itemModel.getModel('textStyle');\n var itemIcon = itemModel.get('icon');\n var tooltipModel = itemModel.getModel('tooltip');\n var legendGlobalTooltipModel = tooltipModel.parentModel; // Use user given icon first\n\n legendSymbolType = itemIcon || legendSymbolType;\n itemGroup.add(createSymbol(legendSymbolType, 0, 0, itemWidth, itemHeight, isSelected ? color : inactiveColor, // symbolKeepAspect default true for legend\n symbolKeepAspect == null ? true : symbolKeepAspect)); // Compose symbols\n // PENDING\n\n if (!itemIcon && symbolType // At least show one symbol, can't be all none\n && (symbolType !== legendSymbolType || symbolType === 'none')) {\n var size = itemHeight * 0.8;\n\n if (symbolType === 'none') {\n symbolType = 'circle';\n } // Put symbol in the center\n\n\n itemGroup.add(createSymbol(symbolType, (itemWidth - size) / 2, (itemHeight - size) / 2, size, size, isSelected ? color : inactiveColor, // symbolKeepAspect default true for legend\n symbolKeepAspect == null ? true : symbolKeepAspect));\n }\n\n var textX = itemAlign === 'left' ? itemWidth + 5 : -5;\n var textAlign = itemAlign;\n var formatter = legendModel.get('formatter');\n var content = name;\n\n if (typeof formatter === 'string' && formatter) {\n content = formatter.replace('{name}', name != null ? name : '');\n } else if (typeof formatter === 'function') {\n content = formatter(name);\n }\n\n itemGroup.add(new graphic.Text({\n style: graphic.setTextStyle({}, textStyleModel, {\n text: content,\n x: textX,\n y: itemHeight / 2,\n textFill: isSelected ? textStyleModel.getTextColor() : inactiveColor,\n textAlign: textAlign,\n textVerticalAlign: 'middle'\n })\n })); // Add a invisible rect to increase the area of mouse hover\n\n var hitRect = new graphic.Rect({\n shape: itemGroup.getBoundingRect(),\n invisible: true,\n tooltip: tooltipModel.get('show') ? zrUtil.extend({\n content: name,\n // Defaul formatter\n formatter: legendGlobalTooltipModel.get('formatter', true) || function () {\n return name;\n },\n formatterParams: {\n componentType: 'legend',\n legendIndex: legendModel.componentIndex,\n name: name,\n $vars: ['name']\n }\n }, tooltipModel.option) : null\n });\n itemGroup.add(hitRect);\n itemGroup.eachChild(function (child) {\n child.silent = true;\n });\n hitRect.silent = !selectMode;\n this.getContentGroup().add(itemGroup);\n graphic.setHoverStyle(itemGroup);\n itemGroup.__legendDataIndex = dataIndex;\n return itemGroup;\n },\n\n /**\n * @protected\n */\n layoutInner: function (legendModel, itemAlign, maxSize) {\n var contentGroup = this.getContentGroup(); // Place items in contentGroup.\n\n layoutUtil.box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), maxSize.width, maxSize.height);\n var contentRect = contentGroup.getBoundingRect();\n contentGroup.attr('position', [-contentRect.x, -contentRect.y]);\n return this.group.getBoundingRect();\n },\n\n /**\n * @protected\n */\n remove: function () {\n this.getContentGroup().removeAll();\n this._isFirstRender = true;\n }\n});\n\nfunction dispatchSelectAction(name, api) {\n api.dispatchAction({\n type: 'legendToggleSelect',\n name: name\n });\n}\n\nfunction dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {\n // If element hover will move to a hoverLayer.\n var el = api.getZr().storage.getDisplayList()[0];\n\n if (!(el && el.useHoverLayer)) {\n api.dispatchAction({\n type: 'highlight',\n seriesName: seriesName,\n name: dataName,\n excludeSeriesId: excludeSeriesId\n });\n }\n}\n\nfunction dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId) {\n // If element hover will move to a hoverLayer.\n var el = api.getZr().storage.getDisplayList()[0];\n\n if (!(el && el.useHoverLayer)) {\n api.dispatchAction({\n type: 'downplay',\n seriesName: seriesName,\n name: dataName,\n excludeSeriesId: excludeSeriesId\n });\n }\n}\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/legend/LegendView.js\n// module id = 203\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _layout = require(\"../../util/layout\");\n\nvar getLayoutRect = _layout.getLayoutRect;\nvar layoutBox = _layout.box;\nvar positionElement = _layout.positionElement;\n\nvar formatUtil = require(\"../../util/format\");\n\nvar graphic = require(\"../../util/graphic\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Layout list like component.\n * It will box layout each items in group of component and then position the whole group in the viewport\n * @param {module:zrender/group/Group} group\n * @param {module:echarts/model/Component} componentModel\n * @param {module:echarts/ExtensionAPI}\n */\nfunction layout(group, componentModel, api) {\n var boxLayoutParams = componentModel.getBoxLayoutParams();\n var padding = componentModel.get('padding');\n var viewportSize = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var rect = getLayoutRect(boxLayoutParams, viewportSize, padding);\n layoutBox(componentModel.get('orient'), group, componentModel.get('itemGap'), rect.width, rect.height);\n positionElement(group, boxLayoutParams, viewportSize, padding);\n}\n\nfunction makeBackground(rect, componentModel) {\n var padding = formatUtil.normalizeCssArray(componentModel.get('padding'));\n var style = componentModel.getItemStyle(['color', 'opacity']);\n style.fill = componentModel.get('backgroundColor');\n var rect = new graphic.Rect({\n shape: {\n x: rect.x - padding[3],\n y: rect.y - padding[0],\n width: rect.width + padding[1] + padding[3],\n height: rect.height + padding[0] + padding[2],\n r: componentModel.get('borderRadius')\n },\n style: style,\n silent: true,\n z2: -1\n }); // FIXME\n // `subPixelOptimizeRect` may bring some gap between edge of viewpart\n // and background rect when setting like `left: 0`, `top: 0`.\n // graphic.subPixelOptimizeRect(rect);\n\n return rect;\n}\n\nexports.layout = layout;\nexports.makeBackground = makeBackground;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/helper/listComponent.js\n// module id = 204\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _config = require(\"../../config\");\n\nvar __DEV__ = _config.__DEV__;\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar graphic = require(\"../../util/graphic\");\n\nvar modelUtil = require(\"../../util/model\");\n\nvar brushHelper = require(\"./brushHelper\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar each = zrUtil.each;\nvar indexOf = zrUtil.indexOf;\nvar curry = zrUtil.curry;\nvar COORD_CONVERTS = ['dataToPoint', 'pointToData']; // FIXME\n// how to genarialize to more coordinate systems.\n\nvar INCLUDE_FINDER_MAIN_TYPES = ['grid', 'xAxis', 'yAxis', 'geo', 'graph', 'polar', 'radiusAxis', 'angleAxis', 'bmap'];\n/**\n * [option in constructor]:\n * {\n * Index/Id/Name of geo, xAxis, yAxis, grid: See util/model#parseFinder.\n * }\n *\n *\n * [targetInfo]:\n *\n * There can be multiple axes in a single targetInfo. Consider the case\n * of `grid` component, a targetInfo represents a grid which contains one or more\n * cartesian and one or more axes. And consider the case of parallel system,\n * which has multiple axes in a coordinate system.\n * Can be {\n * panelId: ...,\n * coordSys: ,\n * coordSyses: all cartesians.\n * gridModel: \n * xAxes: correspond to coordSyses on index\n * yAxes: correspond to coordSyses on index\n * }\n * or {\n * panelId: ...,\n * coordSys: \n * coordSyses: []\n * geoModel: \n * }\n *\n *\n * [panelOpt]:\n *\n * Make from targetInfo. Input to BrushController.\n * {\n * panelId: ...,\n * rect: ...\n * }\n *\n *\n * [area]:\n *\n * Generated by BrushController or user input.\n * {\n * panelId: Used to locate coordInfo directly. If user inpput, no panelId.\n * brushType: determine how to convert to/from coord('rect' or 'polygon' or 'lineX/Y').\n * Index/Id/Name of geo, xAxis, yAxis, grid: See util/model#parseFinder.\n * range: pixel range.\n * coordRange: representitive coord range (the first one of coordRanges).\n * coordRanges: coord ranges, used in multiple cartesian in one grid.\n * }\n */\n\n/**\n * @param {Object} option contains Index/Id/Name of xAxis/yAxis/geo/grid\n * Each can be {number|Array.}. like: {xAxisIndex: [3, 4]}\n * @param {module:echarts/model/Global} ecModel\n * @param {Object} [opt]\n * @param {Array.} [opt.include] include coordinate system types.\n */\n\nfunction BrushTargetManager(option, ecModel, opt) {\n /**\n * @private\n * @type {Array.}\n */\n var targetInfoList = this._targetInfoList = [];\n var info = {};\n var foundCpts = parseFinder(ecModel, option);\n each(targetInfoBuilders, function (builder, type) {\n if (!opt || !opt.include || indexOf(opt.include, type) >= 0) {\n builder(foundCpts, targetInfoList, info);\n }\n });\n}\n\nvar proto = BrushTargetManager.prototype;\n\nproto.setOutputRanges = function (areas, ecModel) {\n this.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\n (area.coordRanges || (area.coordRanges = [])).push(coordRange); // area.coordRange is the first of area.coordRanges\n\n if (!area.coordRange) {\n area.coordRange = coordRange; // In 'category' axis, coord to pixel is not reversible, so we can not\n // rebuild range by coordRange accrately, which may bring trouble when\n // brushing only one item. So we use __rangeOffset to rebuilding range\n // by coordRange. And this it only used in brush component so it is no\n // need to be adapted to coordRanges.\n\n var result = coordConvert[area.brushType](0, coordSys, coordRange);\n area.__rangeOffset = {\n offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]),\n xyMinMax: result.xyMinMax\n };\n }\n });\n};\n\nproto.matchOutputRanges = function (areas, ecModel, cb) {\n each(areas, function (area) {\n var targetInfo = this.findTargetInfo(area, ecModel);\n\n if (targetInfo && targetInfo !== true) {\n zrUtil.each(targetInfo.coordSyses, function (coordSys) {\n var result = coordConvert[area.brushType](1, coordSys, area.range);\n cb(area, result.values, coordSys, ecModel);\n });\n }\n }, this);\n};\n\nproto.setInputRanges = function (areas, ecModel) {\n each(areas, function (area) {\n var targetInfo = this.findTargetInfo(area, ecModel);\n area.range = area.range || []; // convert coordRange to global range and set panelId.\n\n if (targetInfo && targetInfo !== true) {\n area.panelId = targetInfo.panelId; // (1) area.range shoule always be calculate from coordRange but does\n // not keep its original value, for the sake of the dataZoom scenario,\n // where area.coordRange remains unchanged but area.range may be changed.\n // (2) Only support converting one coordRange to pixel range in brush\n // component. So do not consider `coordRanges`.\n // (3) About __rangeOffset, see comment above.\n\n var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange);\n var rangeOffset = area.__rangeOffset;\n area.range = rangeOffset ? diffProcessor[area.brushType](result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax)) : result.values;\n }\n }, this);\n};\n\nproto.makePanelOpts = function (api, getDefaultBrushType) {\n return zrUtil.map(this._targetInfoList, function (targetInfo) {\n var rect = targetInfo.getPanelRect();\n return {\n panelId: targetInfo.panelId,\n defaultBrushType: getDefaultBrushType && getDefaultBrushType(targetInfo),\n clipPath: brushHelper.makeRectPanelClipPath(rect),\n isTargetByCursor: brushHelper.makeRectIsTargetByCursor(rect, api, targetInfo.coordSysModel),\n getLinearBrushOtherExtent: brushHelper.makeLinearBrushOtherExtent(rect)\n };\n });\n};\n\nproto.controlSeries = function (area, seriesModel, ecModel) {\n // Check whether area is bound in coord, and series do not belong to that coord.\n // If do not do this check, some brush (like lineX) will controll all axes.\n var targetInfo = this.findTargetInfo(area, ecModel);\n return targetInfo === true || targetInfo && indexOf(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0;\n};\n/**\n * If return Object, a coord found.\n * If reutrn true, global found.\n * Otherwise nothing found.\n *\n * @param {Object} area\n * @param {Array} targetInfoList\n * @return {Object|boolean}\n */\n\n\nproto.findTargetInfo = function (area, ecModel) {\n var targetInfoList = this._targetInfoList;\n var foundCpts = parseFinder(ecModel, area);\n\n for (var i = 0; i < targetInfoList.length; i++) {\n var targetInfo = targetInfoList[i];\n var areaPanelId = area.panelId;\n\n if (areaPanelId) {\n if (targetInfo.panelId === areaPanelId) {\n return targetInfo;\n }\n } else {\n for (var i = 0; i < targetInfoMatchers.length; i++) {\n if (targetInfoMatchers[i](foundCpts, targetInfo)) {\n return targetInfo;\n }\n }\n }\n }\n\n return true;\n};\n\nfunction formatMinMax(minMax) {\n minMax[0] > minMax[1] && minMax.reverse();\n return minMax;\n}\n\nfunction parseFinder(ecModel, option) {\n return modelUtil.parseFinder(ecModel, option, {\n includeMainTypes: INCLUDE_FINDER_MAIN_TYPES\n });\n}\n\nvar targetInfoBuilders = {\n grid: function (foundCpts, targetInfoList) {\n var xAxisModels = foundCpts.xAxisModels;\n var yAxisModels = foundCpts.yAxisModels;\n var gridModels = foundCpts.gridModels; // Remove duplicated.\n\n var gridModelMap = zrUtil.createHashMap();\n var xAxesHas = {};\n var yAxesHas = {};\n\n if (!xAxisModels && !yAxisModels && !gridModels) {\n return;\n }\n\n each(xAxisModels, function (axisModel) {\n var gridModel = axisModel.axis.grid.model;\n gridModelMap.set(gridModel.id, gridModel);\n xAxesHas[gridModel.id] = true;\n });\n each(yAxisModels, function (axisModel) {\n var gridModel = axisModel.axis.grid.model;\n gridModelMap.set(gridModel.id, gridModel);\n yAxesHas[gridModel.id] = true;\n });\n each(gridModels, function (gridModel) {\n gridModelMap.set(gridModel.id, gridModel);\n xAxesHas[gridModel.id] = true;\n yAxesHas[gridModel.id] = true;\n });\n gridModelMap.each(function (gridModel) {\n var grid = gridModel.coordinateSystem;\n var cartesians = [];\n each(grid.getCartesians(), function (cartesian, index) {\n if (indexOf(xAxisModels, cartesian.getAxis('x').model) >= 0 || indexOf(yAxisModels, cartesian.getAxis('y').model) >= 0) {\n cartesians.push(cartesian);\n }\n });\n targetInfoList.push({\n panelId: 'grid--' + gridModel.id,\n gridModel: gridModel,\n coordSysModel: gridModel,\n // Use the first one as the representitive coordSys.\n coordSys: cartesians[0],\n coordSyses: cartesians,\n getPanelRect: panelRectBuilder.grid,\n xAxisDeclared: xAxesHas[gridModel.id],\n yAxisDeclared: yAxesHas[gridModel.id]\n });\n });\n },\n geo: function (foundCpts, targetInfoList) {\n each(foundCpts.geoModels, function (geoModel) {\n var coordSys = geoModel.coordinateSystem;\n targetInfoList.push({\n panelId: 'geo--' + geoModel.id,\n geoModel: geoModel,\n coordSysModel: geoModel,\n coordSys: coordSys,\n coordSyses: [coordSys],\n getPanelRect: panelRectBuilder.geo\n });\n });\n }\n};\nvar targetInfoMatchers = [// grid\nfunction (foundCpts, targetInfo) {\n var xAxisModel = foundCpts.xAxisModel;\n var yAxisModel = foundCpts.yAxisModel;\n var gridModel = foundCpts.gridModel;\n !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model);\n !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model);\n return gridModel && gridModel === targetInfo.gridModel;\n}, // geo\nfunction (foundCpts, targetInfo) {\n var geoModel = foundCpts.geoModel;\n return geoModel && geoModel === targetInfo.geoModel;\n}];\nvar panelRectBuilder = {\n grid: function () {\n // grid is not Transformable.\n return this.coordSys.grid.getRect().clone();\n },\n geo: function () {\n var coordSys = this.coordSys;\n var rect = coordSys.getBoundingRect().clone(); // geo roam and zoom transform\n\n rect.applyTransform(graphic.getTransform(coordSys));\n return rect;\n }\n};\nvar coordConvert = {\n lineX: curry(axisConvert, 0),\n lineY: curry(axisConvert, 1),\n rect: function (to, coordSys, rangeOrCoordRange) {\n var xminymin = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]]);\n var xmaxymax = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]]);\n var values = [formatMinMax([xminymin[0], xmaxymax[0]]), formatMinMax([xminymin[1], xmaxymax[1]])];\n return {\n values: values,\n xyMinMax: values\n };\n },\n polygon: function (to, coordSys, rangeOrCoordRange) {\n var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]];\n var values = zrUtil.map(rangeOrCoordRange, function (item) {\n var p = coordSys[COORD_CONVERTS[to]](item);\n xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]);\n xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]);\n xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]);\n xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]);\n return p;\n });\n return {\n values: values,\n xyMinMax: xyMinMax\n };\n }\n};\n\nfunction axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) {\n var axis = coordSys.getAxis(['x', 'y'][axisNameIndex]);\n var values = formatMinMax(zrUtil.map([0, 1], function (i) {\n return to ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i])) : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i]));\n }));\n var xyMinMax = [];\n xyMinMax[axisNameIndex] = values;\n xyMinMax[1 - axisNameIndex] = [NaN, NaN];\n return {\n values: values,\n xyMinMax: xyMinMax\n };\n}\n\nvar diffProcessor = {\n lineX: curry(axisDiffProcessor, 0),\n lineY: curry(axisDiffProcessor, 1),\n rect: function (values, refer, scales) {\n return [[values[0][0] - scales[0] * refer[0][0], values[0][1] - scales[0] * refer[0][1]], [values[1][0] - scales[1] * refer[1][0], values[1][1] - scales[1] * refer[1][1]]];\n },\n polygon: function (values, refer, scales) {\n return zrUtil.map(values, function (item, idx) {\n return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]];\n });\n }\n};\n\nfunction axisDiffProcessor(axisNameIndex, values, refer, scales) {\n return [values[0] - scales[axisNameIndex] * refer[0], values[1] - scales[axisNameIndex] * refer[1]];\n} // We have to process scale caused by dataZoom manually,\n// although it might be not accurate.\n\n\nfunction getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n}\n\nfunction getSize(xyMinMax) {\n return xyMinMax ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]] : [NaN, NaN];\n}\n\nvar _default = BrushTargetManager;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/helper/BrushTargetManager.js\n// module id = 205\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar Component = require(\"../../model/Component\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nComponent.registerSubTypeDefaulter('dataZoom', function () {\n // Default 'slider' when no type specified.\n return 'slider';\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/dataZoom/typeDefaulter.js\n// module id = 206\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../../echarts\");\n\nvar _util = require(\"zrender/lib/core/util\");\n\nvar createHashMap = _util.createHashMap;\nvar each = _util.each;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\necharts.registerProcessor({\n // `dataZoomProcessor` will only be performed in needed series. Consider if\n // there is a line series and a pie series, it is better not to update the\n // line series if only pie series is needed to be updated.\n getTargetSeries: function (ecModel) {\n var seriesModelMap = createHashMap();\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\n dataZoomModel.eachTargetAxis(function (dimNames, axisIndex, dataZoomModel) {\n var axisProxy = dataZoomModel.getAxisProxy(dimNames.name, axisIndex);\n each(axisProxy.getTargetSeriesModels(), function (seriesModel) {\n seriesModelMap.set(seriesModel.uid, seriesModel);\n });\n });\n });\n return seriesModelMap;\n },\n modifyOutputEnd: true,\n // Consider appendData, where filter should be performed. Because data process is\n // in block mode currently, it is not need to worry about that the overallProgress\n // execute every frame.\n overallReset: function (ecModel, api) {\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\n // We calculate window and reset axis here but not in model\n // init stage and not after action dispatch handler, because\n // reset should be called after seriesData.restoreData.\n dataZoomModel.eachTargetAxis(function (dimNames, axisIndex, dataZoomModel) {\n dataZoomModel.getAxisProxy(dimNames.name, axisIndex).reset(dataZoomModel, api);\n }); // Caution: data zoom filtering is order sensitive when using\n // percent range and no min/max/scale set on axis.\n // For example, we have dataZoom definition:\n // [\n // {xAxisIndex: 0, start: 30, end: 70},\n // {yAxisIndex: 0, start: 20, end: 80}\n // ]\n // In this case, [20, 80] of y-dataZoom should be based on data\n // that have filtered by x-dataZoom using range of [30, 70],\n // but should not be based on full raw data. Thus sliding\n // x-dataZoom will change both ranges of xAxis and yAxis,\n // while sliding y-dataZoom will only change the range of yAxis.\n // So we should filter x-axis after reset x-axis immediately,\n // and then reset y-axis and filter y-axis.\n\n dataZoomModel.eachTargetAxis(function (dimNames, axisIndex, dataZoomModel) {\n dataZoomModel.getAxisProxy(dimNames.name, axisIndex).filterData(dataZoomModel, api);\n });\n });\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\n // Fullfill all of the range props so that user\n // is able to get them from chart.getOption().\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\n var percentRange = axisProxy.getDataPercentWindow();\n var valueRange = axisProxy.getDataValueWindow();\n dataZoomModel.setRawRange({\n start: percentRange[0],\n end: percentRange[1],\n startValue: valueRange[0],\n endValue: valueRange[1]\n }, true);\n });\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/dataZoom/dataZoomProcessor.js\n// module id = 207\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../../echarts\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar helper = require(\"./helper\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\necharts.registerAction('dataZoom', function (payload, ecModel) {\n var linkedNodesFinder = helper.createLinkedNodesFinder(zrUtil.bind(ecModel.eachComponent, ecModel, 'dataZoom'), helper.eachAxisDim, function (model, dimNames) {\n return model.get(dimNames.axisIndex);\n });\n var effectedModels = [];\n ecModel.eachComponent({\n mainType: 'dataZoom',\n query: payload\n }, function (model, index) {\n effectedModels.push.apply(effectedModels, linkedNodesFinder(model).nodes);\n });\n zrUtil.each(effectedModels, function (dataZoomModel, index) {\n dataZoomModel.setRawRange({\n start: payload.start,\n end: payload.end,\n startValue: payload.startValue,\n endValue: payload.endValue\n });\n });\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/dataZoom/dataZoomAction.js\n// module id = 208\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar each = zrUtil.each;\n\nfunction _default(option) {\n var visualMap = option && option.visualMap;\n\n if (!zrUtil.isArray(visualMap)) {\n visualMap = visualMap ? [visualMap] : [];\n }\n\n each(visualMap, function (opt) {\n if (!opt) {\n return;\n } // rename splitList to pieces\n\n\n if (has(opt, 'splitList') && !has(opt, 'pieces')) {\n opt.pieces = opt.splitList;\n delete opt.splitList;\n }\n\n var pieces = opt.pieces;\n\n if (pieces && zrUtil.isArray(pieces)) {\n each(pieces, function (piece) {\n if (zrUtil.isObject(piece)) {\n if (has(piece, 'start') && !has(piece, 'min')) {\n piece.min = piece.start;\n }\n\n if (has(piece, 'end') && !has(piece, 'max')) {\n piece.max = piece.end;\n }\n }\n });\n }\n });\n}\n\nfunction has(obj, name) {\n return obj && obj.hasOwnProperty && obj.hasOwnProperty(name);\n}\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/visualMap/preprocessor.js\n// module id = 209\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar Component = require(\"../../model/Component\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nComponent.registerSubTypeDefaulter('visualMap', function (option) {\n // Compatible with ec2, when splitNumber === 0, continuous visualMap will be used.\n return !option.categories && (!(option.pieces ? option.pieces.length > 0 : option.splitNumber > 0) || option.calculable) ? 'continuous' : 'piecewise';\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/visualMap/typeDefaulter.js\n// module id = 210\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../../echarts\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar visualSolution = require(\"../../visual/visualSolution\");\n\nvar VisualMapping = require(\"../../visual/VisualMapping\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar VISUAL_PRIORITY = echarts.PRIORITY.VISUAL.COMPONENT;\necharts.registerVisual(VISUAL_PRIORITY, {\n createOnAllSeries: true,\n reset: function (seriesModel, ecModel) {\n var resetDefines = [];\n ecModel.eachComponent('visualMap', function (visualMapModel) {\n var pipelineContext = seriesModel.pipelineContext;\n\n if (!visualMapModel.isTargetSeries(seriesModel) || pipelineContext && pipelineContext.large) {\n return;\n }\n\n resetDefines.push(visualSolution.incrementalApplyVisual(visualMapModel.stateList, visualMapModel.targetVisuals, zrUtil.bind(visualMapModel.getValueState, visualMapModel), visualMapModel.getDataDimension(seriesModel.getData())));\n });\n return resetDefines;\n }\n}); // Only support color.\n\necharts.registerVisual(VISUAL_PRIORITY, {\n createOnAllSeries: true,\n reset: function (seriesModel, ecModel) {\n var data = seriesModel.getData();\n var visualMetaList = [];\n ecModel.eachComponent('visualMap', function (visualMapModel) {\n if (visualMapModel.isTargetSeries(seriesModel)) {\n var visualMeta = visualMapModel.getVisualMeta(zrUtil.bind(getColorVisual, null, seriesModel, visualMapModel)) || {\n stops: [],\n outerColors: []\n };\n var concreteDim = visualMapModel.getDataDimension(data);\n var dimInfo = data.getDimensionInfo(concreteDim);\n\n if (dimInfo != null) {\n // visualMeta.dimension should be dimension index, but not concrete dimension.\n visualMeta.dimension = dimInfo.index;\n visualMetaList.push(visualMeta);\n }\n }\n }); // console.log(JSON.stringify(visualMetaList.map(a => a.stops)));\n\n seriesModel.getData().setVisual('visualMeta', visualMetaList);\n }\n}); // FIXME\n// performance and export for heatmap?\n// value can be Infinity or -Infinity\n\nfunction getColorVisual(seriesModel, visualMapModel, value, valueState) {\n var mappings = visualMapModel.targetVisuals[valueState];\n var visualTypes = VisualMapping.prepareVisualTypes(mappings);\n var resultVisual = {\n color: seriesModel.getData().getVisual('color') // default color.\n\n };\n\n for (var i = 0, len = visualTypes.length; i < len; i++) {\n var type = visualTypes[i];\n var mapping = mappings[type === 'opacity' ? '__alphaForOpacity' : type];\n mapping && mapping.applyVisual(value, getVisual, setVisual);\n }\n\n return resultVisual.color;\n\n function getVisual(key) {\n return resultVisual[key];\n }\n\n function setVisual(key, value) {\n resultVisual[key] = value;\n }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/visualMap/visualEncoding.js\n// module id = 211\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../../echarts\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar env = require(\"zrender/lib/core/env\");\n\nvar visualDefault = require(\"../../visual/visualDefault\");\n\nvar VisualMapping = require(\"../../visual/VisualMapping\");\n\nvar visualSolution = require(\"../../visual/visualSolution\");\n\nvar modelUtil = require(\"../../util/model\");\n\nvar numberUtil = require(\"../../util/number\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar mapVisual = VisualMapping.mapVisual;\nvar eachVisual = VisualMapping.eachVisual;\nvar isArray = zrUtil.isArray;\nvar each = zrUtil.each;\nvar asc = numberUtil.asc;\nvar linearMap = numberUtil.linearMap;\nvar noop = zrUtil.noop;\nvar VisualMapModel = echarts.extendComponentModel({\n type: 'visualMap',\n dependencies: ['series'],\n\n /**\n * @readOnly\n * @type {Array.}\n */\n stateList: ['inRange', 'outOfRange'],\n\n /**\n * @readOnly\n * @type {Array.}\n */\n replacableOptionKeys: ['inRange', 'outOfRange', 'target', 'controller', 'color'],\n\n /**\n * [lowerBound, upperBound]\n *\n * @readOnly\n * @type {Array.}\n */\n dataBound: [-Infinity, Infinity],\n\n /**\n * @readOnly\n * @type {string|Object}\n */\n layoutMode: {\n type: 'box',\n ignoreSize: true\n },\n\n /**\n * @protected\n */\n defaultOption: {\n show: true,\n zlevel: 0,\n z: 4,\n seriesIndex: 'all',\n // 'all' or null/undefined: all series.\n // A number or an array of number: the specified series.\n // set min: 0, max: 200, only for campatible with ec2.\n // In fact min max should not have default value.\n min: 0,\n // min value, must specified if pieces is not specified.\n max: 200,\n // max value, must specified if pieces is not specified.\n dimension: null,\n inRange: null,\n // 'color', 'colorHue', 'colorSaturation', 'colorLightness', 'colorAlpha',\n // 'symbol', 'symbolSize'\n outOfRange: null,\n // 'color', 'colorHue', 'colorSaturation',\n // 'colorLightness', 'colorAlpha',\n // 'symbol', 'symbolSize'\n left: 0,\n // 'center' ¦ 'left' ¦ 'right' ¦ {number} (px)\n right: null,\n // The same as left.\n top: null,\n // 'top' ¦ 'bottom' ¦ 'center' ¦ {number} (px)\n bottom: 0,\n // The same as top.\n itemWidth: null,\n itemHeight: null,\n inverse: false,\n orient: 'vertical',\n // 'horizontal' ¦ 'vertical'\n backgroundColor: 'rgba(0,0,0,0)',\n borderColor: '#ccc',\n // 值域边框颜色\n contentColor: '#5793f3',\n inactiveColor: '#aaa',\n borderWidth: 0,\n // 值域边框线宽,单位px,默认为0(无边框)\n padding: 5,\n // 值域内边距,单位px,默认各方向内边距为5,\n // 接受数组分别设定上右下左边距,同css\n textGap: 10,\n //\n precision: 0,\n // 小数精度,默认为0,无小数点\n color: null,\n //颜色(deprecated,兼容ec2,顺序同pieces,不同于inRange/outOfRange)\n formatter: null,\n text: null,\n // 文本,如['高', '低'],兼容ec2,text[0]对应高值,text[1]对应低值\n textStyle: {\n color: '#333' // 值域文字颜色\n\n }\n },\n\n /**\n * @protected\n */\n init: function (option, parentModel, ecModel) {\n /**\n * @private\n * @type {Array.}\n */\n this._dataExtent;\n /**\n * @readOnly\n */\n\n this.targetVisuals = {};\n /**\n * @readOnly\n */\n\n this.controllerVisuals = {};\n /**\n * @readOnly\n */\n\n this.textStyleModel;\n /**\n * [width, height]\n * @readOnly\n * @type {Array.}\n */\n\n this.itemSize;\n this.mergeDefaultAndTheme(option, ecModel);\n },\n\n /**\n * @protected\n */\n optionUpdated: function (newOption, isInit) {\n var thisOption = this.option; // FIXME\n // necessary?\n // Disable realtime view update if canvas is not supported.\n\n if (!env.canvasSupported) {\n thisOption.realtime = false;\n }\n\n !isInit && visualSolution.replaceVisualOption(thisOption, newOption, this.replacableOptionKeys);\n this.textStyleModel = this.getModel('textStyle');\n this.resetItemSize();\n this.completeVisualOption();\n },\n\n /**\n * @protected\n */\n resetVisual: function (supplementVisualOption) {\n var stateList = this.stateList;\n supplementVisualOption = zrUtil.bind(supplementVisualOption, this);\n this.controllerVisuals = visualSolution.createVisualMappings(this.option.controller, stateList, supplementVisualOption);\n this.targetVisuals = visualSolution.createVisualMappings(this.option.target, stateList, supplementVisualOption);\n },\n\n /**\n * @protected\n * @return {Array.} An array of series indices.\n */\n getTargetSeriesIndices: function () {\n var optionSeriesIndex = this.option.seriesIndex;\n var seriesIndices = [];\n\n if (optionSeriesIndex == null || optionSeriesIndex === 'all') {\n this.ecModel.eachSeries(function (seriesModel, index) {\n seriesIndices.push(index);\n });\n } else {\n seriesIndices = modelUtil.normalizeToArray(optionSeriesIndex);\n }\n\n return seriesIndices;\n },\n\n /**\n * @public\n */\n eachTargetSeries: function (callback, context) {\n zrUtil.each(this.getTargetSeriesIndices(), function (seriesIndex) {\n callback.call(context, this.ecModel.getSeriesByIndex(seriesIndex));\n }, this);\n },\n\n /**\n * @pubilc\n */\n isTargetSeries: function (seriesModel) {\n var is = false;\n this.eachTargetSeries(function (model) {\n model === seriesModel && (is = true);\n });\n return is;\n },\n\n /**\n * @example\n * this.formatValueText(someVal); // format single numeric value to text.\n * this.formatValueText(someVal, true); // format single category value to text.\n * this.formatValueText([min, max]); // format numeric min-max to text.\n * this.formatValueText([this.dataBound[0], max]); // using data lower bound.\n * this.formatValueText([min, this.dataBound[1]]); // using data upper bound.\n *\n * @param {number|Array.} value Real value, or this.dataBound[0 or 1].\n * @param {boolean} [isCategory=false] Only available when value is number.\n * @param {Array.} edgeSymbols Open-close symbol when value is interval.\n * @return {string}\n * @protected\n */\n formatValueText: function (value, isCategory, edgeSymbols) {\n var option = this.option;\n var precision = option.precision;\n var dataBound = this.dataBound;\n var formatter = option.formatter;\n var isMinMax;\n var textValue;\n edgeSymbols = edgeSymbols || ['<', '>'];\n\n if (zrUtil.isArray(value)) {\n value = value.slice();\n isMinMax = true;\n }\n\n textValue = isCategory ? value : isMinMax ? [toFixed(value[0]), toFixed(value[1])] : toFixed(value);\n\n if (zrUtil.isString(formatter)) {\n return formatter.replace('{value}', isMinMax ? textValue[0] : textValue).replace('{value2}', isMinMax ? textValue[1] : textValue);\n } else if (zrUtil.isFunction(formatter)) {\n return isMinMax ? formatter(value[0], value[1]) : formatter(value);\n }\n\n if (isMinMax) {\n if (value[0] === dataBound[0]) {\n return edgeSymbols[0] + ' ' + textValue[1];\n } else if (value[1] === dataBound[1]) {\n return edgeSymbols[1] + ' ' + textValue[0];\n } else {\n return textValue[0] + ' - ' + textValue[1];\n }\n } else {\n // Format single value (includes category case).\n return textValue;\n }\n\n function toFixed(val) {\n return val === dataBound[0] ? 'min' : val === dataBound[1] ? 'max' : (+val).toFixed(Math.min(precision, 20));\n }\n },\n\n /**\n * @protected\n */\n resetExtent: function () {\n var thisOption = this.option; // Can not calculate data extent by data here.\n // Because series and data may be modified in processing stage.\n // So we do not support the feature \"auto min/max\".\n\n var extent = asc([thisOption.min, thisOption.max]);\n this._dataExtent = extent;\n },\n\n /**\n * @public\n * @param {module:echarts/data/List} list\n * @return {string} Concrete dimention. If return null/undefined,\n * no dimension used.\n */\n getDataDimension: function (list) {\n var optDim = this.option.dimension;\n var listDimensions = list.dimensions;\n\n if (optDim == null && !listDimensions.length) {\n return;\n }\n\n if (optDim != null) {\n return list.getDimension(optDim);\n }\n\n var dimNames = list.dimensions;\n\n for (var i = dimNames.length - 1; i >= 0; i--) {\n var dimName = dimNames[i];\n var dimInfo = list.getDimensionInfo(dimName);\n\n if (!dimInfo.isCalculationCoord) {\n return dimName;\n }\n }\n },\n\n /**\n * @public\n * @override\n */\n getExtent: function () {\n return this._dataExtent.slice();\n },\n\n /**\n * @protected\n */\n completeVisualOption: function () {\n var ecModel = this.ecModel;\n var thisOption = this.option;\n var base = {\n inRange: thisOption.inRange,\n outOfRange: thisOption.outOfRange\n };\n var target = thisOption.target || (thisOption.target = {});\n var controller = thisOption.controller || (thisOption.controller = {});\n zrUtil.merge(target, base); // Do not override\n\n zrUtil.merge(controller, base); // Do not override\n\n var isCategory = this.isCategory();\n completeSingle.call(this, target);\n completeSingle.call(this, controller);\n completeInactive.call(this, target, 'inRange', 'outOfRange'); // completeInactive.call(this, target, 'outOfRange', 'inRange');\n\n completeController.call(this, controller);\n\n function completeSingle(base) {\n // Compatible with ec2 dataRange.color.\n // The mapping order of dataRange.color is: [high value, ..., low value]\n // whereas inRange.color and outOfRange.color is [low value, ..., high value]\n // Notice: ec2 has no inverse.\n if (isArray(thisOption.color) // If there has been inRange: {symbol: ...}, adding color is a mistake.\n // So adding color only when no inRange defined.\n && !base.inRange) {\n base.inRange = {\n color: thisOption.color.slice().reverse()\n };\n } // Compatible with previous logic, always give a defautl color, otherwise\n // simple config with no inRange and outOfRange will not work.\n // Originally we use visualMap.color as the default color, but setOption at\n // the second time the default color will be erased. So we change to use\n // constant DEFAULT_COLOR.\n // If user do not want the defualt color, set inRange: {color: null}.\n\n\n base.inRange = base.inRange || {\n color: ecModel.get('gradientColor')\n }; // If using shortcut like: {inRange: 'symbol'}, complete default value.\n\n each(this.stateList, function (state) {\n var visualType = base[state];\n\n if (zrUtil.isString(visualType)) {\n var defa = visualDefault.get(visualType, 'active', isCategory);\n\n if (defa) {\n base[state] = {};\n base[state][visualType] = defa;\n } else {\n // Mark as not specified.\n delete base[state];\n }\n }\n }, this);\n }\n\n function completeInactive(base, stateExist, stateAbsent) {\n var optExist = base[stateExist];\n var optAbsent = base[stateAbsent];\n\n if (optExist && !optAbsent) {\n optAbsent = base[stateAbsent] = {};\n each(optExist, function (visualData, visualType) {\n if (!VisualMapping.isValidType(visualType)) {\n return;\n }\n\n var defa = visualDefault.get(visualType, 'inactive', isCategory);\n\n if (defa != null) {\n optAbsent[visualType] = defa; // Compatibable with ec2:\n // Only inactive color to rgba(0,0,0,0) can not\n // make label transparent, so use opacity also.\n\n if (visualType === 'color' && !optAbsent.hasOwnProperty('opacity') && !optAbsent.hasOwnProperty('colorAlpha')) {\n optAbsent.opacity = [0, 0];\n }\n }\n });\n }\n }\n\n function completeController(controller) {\n var symbolExists = (controller.inRange || {}).symbol || (controller.outOfRange || {}).symbol;\n var symbolSizeExists = (controller.inRange || {}).symbolSize || (controller.outOfRange || {}).symbolSize;\n var inactiveColor = this.get('inactiveColor');\n each(this.stateList, function (state) {\n var itemSize = this.itemSize;\n var visuals = controller[state]; // Set inactive color for controller if no other color\n // attr (like colorAlpha) specified.\n\n if (!visuals) {\n visuals = controller[state] = {\n color: isCategory ? inactiveColor : [inactiveColor]\n };\n } // Consistent symbol and symbolSize if not specified.\n\n\n if (visuals.symbol == null) {\n visuals.symbol = symbolExists && zrUtil.clone(symbolExists) || (isCategory ? 'roundRect' : ['roundRect']);\n }\n\n if (visuals.symbolSize == null) {\n visuals.symbolSize = symbolSizeExists && zrUtil.clone(symbolSizeExists) || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]);\n } // Filter square and none.\n\n\n visuals.symbol = mapVisual(visuals.symbol, function (symbol) {\n return symbol === 'none' || symbol === 'square' ? 'roundRect' : symbol;\n }); // Normalize symbolSize\n\n var symbolSize = visuals.symbolSize;\n\n if (symbolSize != null) {\n var max = -Infinity; // symbolSize can be object when categories defined.\n\n eachVisual(symbolSize, function (value) {\n value > max && (max = value);\n });\n visuals.symbolSize = mapVisual(symbolSize, function (value) {\n return linearMap(value, [0, max], [0, itemSize[0]], true);\n });\n }\n }, this);\n }\n },\n\n /**\n * @protected\n */\n resetItemSize: function () {\n this.itemSize = [parseFloat(this.get('itemWidth')), parseFloat(this.get('itemHeight'))];\n },\n\n /**\n * @public\n */\n isCategory: function () {\n return !!this.option.categories;\n },\n\n /**\n * @public\n * @abstract\n */\n setSelected: noop,\n\n /**\n * @public\n * @abstract\n * @param {*|module:echarts/data/List} valueOrData\n * @param {number} dataIndex\n * @return {string} state See this.stateList\n */\n getValueState: noop,\n\n /**\n * FIXME\n * Do not publish to thirt-part-dev temporarily\n * util the interface is stable. (Should it return\n * a function but not visual meta?)\n *\n * @pubilc\n * @abstract\n * @param {Function} getColorVisual\n * params: value, valueState\n * return: color\n * @return {Object} visualMeta\n * should includes {stops, outerColors}\n * outerColor means [colorBeyondMinValue, colorBeyondMaxValue]\n */\n getVisualMeta: noop\n});\nvar _default = VisualMapModel;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/visualMap/VisualMapModel.js\n// module id = 212\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @file Visual mapping.\n */\nvar visualDefault = {\n /**\n * @public\n */\n get: function (visualType, key, isCategory) {\n var value = zrUtil.clone((defaultOption[visualType] || {})[key]);\n return isCategory ? zrUtil.isArray(value) ? value[value.length - 1] : value : value;\n }\n};\nvar defaultOption = {\n color: {\n active: ['#006edd', '#e0ffff'],\n inactive: ['rgba(0,0,0,0)']\n },\n colorHue: {\n active: [0, 360],\n inactive: [0, 0]\n },\n colorSaturation: {\n active: [0.3, 1],\n inactive: [0, 0]\n },\n colorLightness: {\n active: [0.9, 0.5],\n inactive: [0, 0]\n },\n colorAlpha: {\n active: [0.3, 1],\n inactive: [0, 0]\n },\n opacity: {\n active: [0.3, 1],\n inactive: [0, 0]\n },\n symbol: {\n active: ['circle', 'roundRect', 'diamond'],\n inactive: ['none']\n },\n symbolSize: {\n active: [10, 50],\n inactive: [0, 0]\n }\n};\nvar _default = visualDefault;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/visual/visualDefault.js\n// module id = 213\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../../echarts\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar graphic = require(\"../../util/graphic\");\n\nvar formatUtil = require(\"../../util/format\");\n\nvar layout = require(\"../../util/layout\");\n\nvar VisualMapping = require(\"../../visual/VisualMapping\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar _default = echarts.extendComponentView({\n type: 'visualMap',\n\n /**\n * @readOnly\n * @type {Object}\n */\n autoPositionValues: {\n left: 1,\n right: 1,\n top: 1,\n bottom: 1\n },\n init: function (ecModel, api) {\n /**\n * @readOnly\n * @type {module:echarts/model/Global}\n */\n this.ecModel = ecModel;\n /**\n * @readOnly\n * @type {module:echarts/ExtensionAPI}\n */\n\n this.api = api;\n /**\n * @readOnly\n * @type {module:echarts/component/visualMap/visualMapModel}\n */\n\n this.visualMapModel;\n },\n\n /**\n * @protected\n */\n render: function (visualMapModel, ecModel, api, payload) {\n this.visualMapModel = visualMapModel;\n\n if (visualMapModel.get('show') === false) {\n this.group.removeAll();\n return;\n }\n\n this.doRender.apply(this, arguments);\n },\n\n /**\n * @protected\n */\n renderBackground: function (group) {\n var visualMapModel = this.visualMapModel;\n var padding = formatUtil.normalizeCssArray(visualMapModel.get('padding') || 0);\n var rect = group.getBoundingRect();\n group.add(new graphic.Rect({\n z2: -1,\n // Lay background rect on the lowest layer.\n silent: true,\n shape: {\n x: rect.x - padding[3],\n y: rect.y - padding[0],\n width: rect.width + padding[3] + padding[1],\n height: rect.height + padding[0] + padding[2]\n },\n style: {\n fill: visualMapModel.get('backgroundColor'),\n stroke: visualMapModel.get('borderColor'),\n lineWidth: visualMapModel.get('borderWidth')\n }\n }));\n },\n\n /**\n * @protected\n * @param {number} targetValue can be Infinity or -Infinity\n * @param {string=} visualCluster Only can be 'color' 'opacity' 'symbol' 'symbolSize'\n * @param {Object} [opts]\n * @param {string=} [opts.forceState] Specify state, instead of using getValueState method.\n * @param {string=} [opts.convertOpacityToAlpha=false] For color gradient in controller widget.\n * @return {*} Visual value.\n */\n getControllerVisual: function (targetValue, visualCluster, opts) {\n opts = opts || {};\n var forceState = opts.forceState;\n var visualMapModel = this.visualMapModel;\n var visualObj = {}; // Default values.\n\n if (visualCluster === 'symbol') {\n visualObj.symbol = visualMapModel.get('itemSymbol');\n }\n\n if (visualCluster === 'color') {\n var defaultColor = visualMapModel.get('contentColor');\n visualObj.color = defaultColor;\n }\n\n function getter(key) {\n return visualObj[key];\n }\n\n function setter(key, value) {\n visualObj[key] = value;\n }\n\n var mappings = visualMapModel.controllerVisuals[forceState || visualMapModel.getValueState(targetValue)];\n var visualTypes = VisualMapping.prepareVisualTypes(mappings);\n zrUtil.each(visualTypes, function (type) {\n var visualMapping = mappings[type];\n\n if (opts.convertOpacityToAlpha && type === 'opacity') {\n type = 'colorAlpha';\n visualMapping = mappings.__alphaForOpacity;\n }\n\n if (VisualMapping.dependsOn(type, visualCluster)) {\n visualMapping && visualMapping.applyVisual(targetValue, getter, setter);\n }\n });\n return visualObj[visualCluster];\n },\n\n /**\n * @protected\n */\n positionGroup: function (group) {\n var model = this.visualMapModel;\n var api = this.api;\n layout.positionElement(group, model.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n },\n\n /**\n * @protected\n * @abstract\n */\n doRender: zrUtil.noop\n});\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/visualMap/VisualMapView.js\n// module id = 214\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar _layout = require(\"../../util/layout\");\n\nvar getLayoutRect = _layout.getLayoutRect;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @param {module:echarts/component/visualMap/VisualMapModel} visualMapModel\\\n * @param {module:echarts/ExtensionAPI} api\n * @param {Array.} itemSize always [short, long]\n * @return {string} 'left' or 'right' or 'top' or 'bottom'\n */\nfunction getItemAlign(visualMapModel, api, itemSize) {\n var modelOption = visualMapModel.option;\n var itemAlign = modelOption.align;\n\n if (itemAlign != null && itemAlign !== 'auto') {\n return itemAlign;\n } // Auto decision align.\n\n\n var ecSize = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var realIndex = modelOption.orient === 'horizontal' ? 1 : 0;\n var paramsSet = [['left', 'right', 'width'], ['top', 'bottom', 'height']];\n var reals = paramsSet[realIndex];\n var fakeValue = [0, null, 10];\n var layoutInput = {};\n\n for (var i = 0; i < 3; i++) {\n layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i];\n layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]];\n }\n\n var rParam = [['x', 'width', 3], ['y', 'height', 0]][realIndex];\n var rect = getLayoutRect(layoutInput, ecSize, modelOption.padding);\n return reals[(rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5 < ecSize[rParam[1]] * 0.5 ? 0 : 1];\n}\n/**\n * Prepare dataIndex for outside usage, where dataIndex means rawIndex, and\n * dataIndexInside means filtered index.\n */\n\n\nfunction convertDataIndex(batch) {\n zrUtil.each(batch || [], function (batchItem) {\n if (batch.dataIndex != null) {\n batch.dataIndexInside = batch.dataIndex;\n batch.dataIndex = null;\n }\n });\n return batch;\n}\n\nexports.getItemAlign = getItemAlign;\nexports.convertDataIndex = convertDataIndex;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/visualMap/helper.js\n// module id = 215\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../../echarts\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar actionInfo = {\n type: 'selectDataRange',\n event: 'dataRangeSelected',\n // FIXME use updateView appears wrong\n update: 'update'\n};\necharts.registerAction(actionInfo, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'visualMap',\n query: payload\n }, function (model) {\n model.setSelected(payload.selected);\n });\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/visualMap/visualMapAction.js\n// module id = 216\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar each = zrUtil.each;\nvar ATTR = '\\0_ec_hist_store';\n/**\n * @param {module:echarts/model/Global} ecModel\n * @param {Object} newSnapshot {dataZoomId, batch: [payloadInfo, ...]}\n */\n\nfunction push(ecModel, newSnapshot) {\n var store = giveStore(ecModel); // If previous dataZoom can not be found,\n // complete an range with current range.\n\n each(newSnapshot, function (batchItem, dataZoomId) {\n var i = store.length - 1;\n\n for (; i >= 0; i--) {\n var snapshot = store[i];\n\n if (snapshot[dataZoomId]) {\n break;\n }\n }\n\n if (i < 0) {\n // No origin range set, create one by current range.\n var dataZoomModel = ecModel.queryComponents({\n mainType: 'dataZoom',\n subType: 'select',\n id: dataZoomId\n })[0];\n\n if (dataZoomModel) {\n var percentRange = dataZoomModel.getPercentRange();\n store[0][dataZoomId] = {\n dataZoomId: dataZoomId,\n start: percentRange[0],\n end: percentRange[1]\n };\n }\n }\n });\n store.push(newSnapshot);\n}\n/**\n * @param {module:echarts/model/Global} ecModel\n * @return {Object} snapshot\n */\n\n\nfunction pop(ecModel) {\n var store = giveStore(ecModel);\n var head = store[store.length - 1];\n store.length > 1 && store.pop(); // Find top for all dataZoom.\n\n var snapshot = {};\n each(head, function (batchItem, dataZoomId) {\n for (var i = store.length - 1; i >= 0; i--) {\n var batchItem = store[i][dataZoomId];\n\n if (batchItem) {\n snapshot[dataZoomId] = batchItem;\n break;\n }\n }\n });\n return snapshot;\n}\n/**\n * @param {module:echarts/model/Global} ecModel\n */\n\n\nfunction clear(ecModel) {\n ecModel[ATTR] = null;\n}\n/**\n * @param {module:echarts/model/Global} ecModel\n * @return {number} records. always >= 1.\n */\n\n\nfunction count(ecModel) {\n return giveStore(ecModel).length;\n}\n/**\n * [{key: dataZoomId, value: {dataZoomId, range}}, ...]\n * History length of each dataZoom may be different.\n * this._history[0] is used to store origin range.\n * @type {Array.}\n */\n\n\nfunction giveStore(ecModel) {\n var store = ecModel[ATTR];\n\n if (!store) {\n store = ecModel[ATTR] = [{}];\n }\n\n return store;\n}\n\nexports.push = push;\nexports.pop = pop;\nexports.clear = clear;\nexports.count = count;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/dataZoom/history.js\n// module id = 217\n// module chunks = 39","var env = require(\"../core/env\");\n\nvar urn = 'urn:schemas-microsoft-com:vml';\nvar win = typeof window === 'undefined' ? null : window;\nvar vmlInited = false;\nvar doc = win && win.document;\n\nfunction createNode(tagName) {\n return doCreateNode(tagName);\n} // Avoid assign to an exported variable, for transforming to cjs.\n\n\nvar doCreateNode;\n\nif (doc && !env.canvasSupported) {\n try {\n !doc.namespaces.zrvml && doc.namespaces.add('zrvml', urn);\n\n doCreateNode = function (tagName) {\n return doc.createElement('');\n };\n } catch (e) {\n doCreateNode = function (tagName) {\n return doc.createElement('<' + tagName + ' xmlns=\"' + urn + '\" class=\"zrvml\">');\n };\n }\n} // From raphael\n\n\nfunction initVML() {\n if (vmlInited || !doc) {\n return;\n }\n\n vmlInited = true;\n var styleSheets = doc.styleSheets;\n\n if (styleSheets.length < 31) {\n doc.createStyleSheet().addRule('.zrvml', 'behavior:url(#default#VML)');\n } else {\n // http://msdn.microsoft.com/en-us/library/ms531194%28VS.85%29.aspx\n styleSheets[0].addRule('.zrvml', 'behavior:url(#default#VML)');\n }\n}\n\nexports.doc = doc;\nexports.createNode = createNode;\nexports.initVML = initVML;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/vml/core.js\n// module id = 218\n// module chunks = 39","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Vue from 'vue'\nimport i18n from '@/module/i18n/index.js'\nimport Router from 'vue-router'\n\nVue.use(Router)\n\nconst router = new Router({\n routes: [\n {\n path: '/',\n name: 'index',\n redirect: {\n name: 'home'\n }\n },\n {\n path: '/home',\n name: 'home',\n component: resolve => require(['../pages/home/index'], resolve),\n meta: {\n title: `${i18n.$t('首页')} - EasyScheduler`\n }\n },\n {\n path: '/projects',\n name: 'projects',\n component: resolve => require(['../pages/projects/index'], resolve),\n meta: {\n title: `${i18n.$t('项目管理')}`\n },\n redirect: {\n name: 'projects-list'\n },\n children: [\n {\n path: '/projects/index',\n name: 'projects-index',\n component: resolve => require(['../pages/projects/pages/index/index'], resolve),\n meta: {\n title: `${i18n.$t('项目首页')}`\n }\n },\n {\n path: '/projects/list',\n name: 'projects-list',\n component: resolve => require(['../pages/projects/pages/list/index'], resolve),\n meta: {\n title: `${i18n.$t('项目')}`\n }\n },\n {\n path: '/projects/definition',\n name: 'definition',\n component: resolve => require(['../pages/projects/pages/definition/index'], resolve),\n meta: {\n title: `${i18n.$t('工作流定义')}`\n },\n redirect: {\n name: 'projects-definition-list'\n },\n children: [\n {\n path: '/projects/definition/list',\n name: 'projects-definition-list',\n component: resolve => require(['../pages/projects/pages/definition/pages/list/index'], resolve),\n meta: {\n title: `${i18n.$t('工作流定义')}`\n }\n },\n {\n path: '/projects/definition/list/:id',\n name: 'projects-definition-details',\n component: resolve => require(['../pages/projects/pages/definition/pages/details/index'], resolve),\n meta: {\n title: `${i18n.$t('流程定义详情')}`\n }\n },\n {\n path: '/projects/definition/create',\n name: 'definition-create',\n component: resolve => require(['../pages/projects/pages/definition/pages/create/index'], resolve),\n meta: {\n title: `${i18n.$t('创建流程定义')}`\n }\n },\n {\n path: '/projects/definition/tree/:id',\n name: 'definition-tree-view-index',\n component: resolve => require(['../pages/projects/pages/definition/pages/tree/index'], resolve),\n meta: {\n title: `${i18n.$t('树形图')}`\n }\n },\n {\n path: '/projects/definition/list/timing/:id',\n name: 'definition-timing-details',\n component: resolve => require(['../pages/projects/pages/definition/timing/index'], resolve),\n meta: {\n title: `${i18n.$t('定时任务列表')}`\n }\n }\n ]\n },\n {\n path: '/projects/instance',\n name: 'instance',\n component: resolve => require(['../pages/projects/pages/instance/index'], resolve),\n meta: {\n title: `${i18n.$t('工作流实例')}`\n },\n redirect: {\n name: 'projects-instance-list'\n },\n children: [\n {\n path: '/projects/instance/list',\n name: 'projects-instance-list',\n component: resolve => require(['../pages/projects/pages/instance/pages/list/index'], resolve),\n meta: {\n title: `${i18n.$t('工作流实例')}`\n }\n },\n {\n path: '/projects/instance/list/:id',\n name: 'projects-instance-details',\n component: resolve => require(['../pages/projects/pages/instance/pages/details/index'], resolve),\n meta: {\n title: `${i18n.$t('流程实例详情')}`\n }\n },\n {\n path: '/projects/instance/gantt/:id',\n name: 'instance-gantt-index',\n component: resolve => require(['../pages/projects/pages/instance/pages/gantt/index'], resolve),\n meta: {\n title: `${i18n.$t('甘特图')}`\n }\n }\n ]\n },\n {\n path: '/projects/task-instance',\n name: 'task-instance-index',\n component: resolve => require(['../pages/projects/pages/taskInstance'], resolve),\n meta: {\n title: `${i18n.$t('任务实例')}`\n },\n redirect: {\n name: 'task-instance-list'\n },\n children: [\n {\n path: '/projects/task-instance/list',\n name: 'task-instance-list',\n component: resolve => require(['../pages/projects/pages/taskInstance/pages/list/index'], resolve),\n meta: {\n title: `${i18n.$t('任务实例')}`\n }\n }\n ]\n },\n {\n path: '/projects/task-record',\n name: 'task-record-index',\n component: resolve => require(['../pages/projects/pages/taskRecord'], resolve),\n meta: {\n title: `${i18n.$t('任务记录')}`\n },\n redirect: {\n name: 'task-record-list'\n },\n children: [\n {\n path: '/projects/task-record/list',\n name: 'task-record-list',\n component: resolve => require(['../pages/projects/pages/taskRecord/pages/list/index'], resolve),\n meta: {\n title: `${i18n.$t('任务记录')}`\n }\n }\n ]\n }\n ]\n },\n {\n path: '/resource',\n name: 'resource',\n component: resolve => require(['../pages/resource/index'], resolve),\n redirect: {\n name: 'file'\n },\n meta: {\n title: `${i18n.$t('资源中心')}`\n },\n children: [\n {\n path: '/resource/file',\n name: 'file',\n component: resolve => require(['../pages/resource/pages/file/pages/list/index'], resolve),\n meta: {\n title: `${i18n.$t('文件管理')}`\n }\n },\n {\n path: '/resource/file/create',\n name: 'resource-file-create',\n component: resolve => require(['../pages/resource/pages/file/pages/create/index'], resolve),\n meta: {\n title: `${i18n.$t('创建资源')}`\n }\n },\n {\n path: '/resource/file/list/:id',\n name: 'resource-file-details',\n component: resolve => require(['../pages/resource/pages/file/pages/details/index'], resolve),\n meta: {\n title: `${i18n.$t('文件详情')}`\n }\n },\n {\n path: '/resource/file/edit/:id',\n name: 'resource-file-edit',\n component: resolve => require(['../pages/resource/pages/file/pages/edit/index'], resolve),\n meta: {\n title: `${i18n.$t('文件详情')}`\n }\n },\n {\n path: '/resource/udf',\n name: 'udf',\n component: resolve => require(['../pages/resource/pages/udf/index'], resolve),\n meta: {\n title: `${i18n.$t('UDF管理')}`\n },\n children: [\n {\n path: '/resource/udf/resource',\n name: 'resource-udf-resource',\n component: resolve => require(['../pages/resource/pages/udf/pages/resource/index'], resolve),\n meta: {\n title: `${i18n.$t('UDF资源管理')}`\n }\n },\n {\n path: '/resource/udf/function',\n name: 'resource-udf-function',\n component: resolve => require(['../pages/resource/pages/udf/pages/function/index'], resolve),\n meta: {\n title: `${i18n.$t('UDF函数管理')}`\n }\n }\n ]\n }\n ]\n },\n {\n path: '/datasource',\n name: 'datasource',\n component: resolve => require(['../pages/datasource/index'], resolve),\n meta: {\n title: `${i18n.$t('数据源中心')}`\n },\n redirect: {\n name: 'datasource-list'\n },\n children: [\n {\n path: '/datasource/list',\n name: 'datasource-list',\n component: resolve => require(['../pages/datasource/pages/list/index'], resolve),\n meta: {\n title: `${i18n.$t('数据源中心')}`\n }\n }\n ]\n },\n {\n path: '/security',\n name: 'security',\n component: resolve => require(['../pages/security/index'], resolve),\n meta: {\n title: `${i18n.$t('安全中心')}`\n },\n redirect: {\n name: 'tenement-manage'\n },\n children: [\n {\n path: '/security/tenant',\n name: 'tenement-manage',\n component: resolve => require(['../pages/security/pages/tenement/index'], resolve),\n meta: {\n title: `${i18n.$t('租户管理')}`\n }\n },\n {\n path: '/security/users',\n name: 'users-manage',\n component: resolve => require(['../pages/security/pages/users/index'], resolve),\n meta: {\n title: `${i18n.$t('用户管理')}`\n }\n },\n {\n path: '/security/warning-groups',\n name: 'warning-groups-manage',\n component: resolve => require(['../pages/security/pages/warningGroups/index'], resolve),\n meta: {\n title: `${i18n.$t('告警组管理')}`\n }\n },\n {\n path: '/security/queue',\n name: 'queue-manage',\n component: resolve => require(['../pages/security/pages/queue/index'], resolve),\n meta: {\n title: `${i18n.$t('队列管理')}`\n }\n },\n {\n path: '/security/servers',\n name: 'servers-manage',\n component: resolve => require(['../pages/security/pages/servers/index'], resolve),\n meta: {\n title: `${i18n.$t('服务管理')}`\n },\n redirect: {\n name: 'servers-master'\n },\n children: [\n {\n path: '/security/servers/master',\n name: 'servers-master',\n component: resolve => require(['../pages/security/pages/servers/pages/master/index'], resolve),\n meta: {\n title: `${i18n.$t('服务管理-Master')}`\n }\n },\n {\n path: '/security/servers/worker',\n name: 'servers-worker',\n component: resolve => require(['../pages/security/pages/servers/pages/worker/index'], resolve),\n meta: {\n title: `${i18n.$t('服务管理-Worker')}`\n }\n }\n ]\n }\n ]\n },\n {\n path: '/user',\n name: 'user',\n component: resolve => require(['../pages/user/index'], resolve),\n meta: {\n title: `${i18n.$t('用户中心')}`\n },\n redirect: {\n name: 'account'\n },\n children: [\n {\n path: '/user/account',\n name: 'account',\n component: resolve => require(['../pages/user/pages/account/index'], resolve),\n meta: {\n title: `${i18n.$t('用户信息')}`\n }\n },\n {\n path: '/user/password',\n name: 'password',\n component: resolve => require(['../pages/user/pages/password/index'], resolve),\n meta: {\n title: `${i18n.$t('修改密码')}`\n }\n }\n ]\n }\n ]\n})\n\nrouter.beforeEach((to, from, next) => {\n let $body = $('body')\n $body.find('.tooltip.fade.top.in').remove()\n if (to.meta.title) {\n document.title = `${to.meta.title} - EasyScheduler`\n }\n next()\n})\n\nexport default router\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/router/index.js","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-6759b734\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./popup.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./popup.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./popup.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-6759b734\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./popup.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/popup/popup.vue\n// module id = 223\n// module chunks = 39","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-8ef2e8b0\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listBoxF.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listBoxF.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listBoxF.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-8ef2e8b0\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listBoxF.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listBoxF/listBoxF.vue\n// module id = 224\n// module chunks = 39","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport i18n from '@/module/i18n'\nimport Permissions from '@/module/permissions'\n\n/**\n * Operation bar config\n * @code code\n * @icon icon\n * @disable disable\n * @desc tooltip\n */\nconst toolOper = (dagThis) => {\n let disabled = Permissions.getAuth() === false ? false : !dagThis.$store.state.dag.isDetails\n return [\n {\n code: 'pointer',\n icon: '',\n disable: disabled,\n desc: `${i18n.$t('拖动节点和选中项')}`\n },\n {\n code: 'line',\n icon: '',\n disable: disabled,\n desc: `${i18n.$t('选择线条连接')}`\n },\n {\n code: 'remove',\n icon: '',\n disable: disabled,\n desc: `${i18n.$t('删除选中的线或节点')}`\n },\n {\n code: 'download',\n icon: '',\n disable: !!dagThis.type,\n desc: `${i18n.$t('下载')}`\n },\n {\n code: 'screen',\n icon: '',\n disable: disabled,\n desc: `${i18n.$t('全屏')}`\n }\n ]\n}\n\n/**\n * Post status\n * @id Front end definition id\n * @desc tooltip\n * @code Backend definition identifier\n */\nlet publishStatus = [\n {\n id: 0,\n desc: `${i18n.$t('未发布')}`,\n code: 'NOT_RELEASE'\n },\n {\n id: 1,\n desc: `${i18n.$t('上线')}`,\n code: 'ONLINE'\n },\n {\n id: 2,\n desc: `${i18n.$t('下线')}`,\n code: 'OFFLINE'\n }\n]\n\n/**\n * Operation type\n * @desc tooltip\n * @code identifier\n */\nlet runningType = [\n {\n desc: `${i18n.$t('启动工作流')}`,\n code: 'START_PROCESS'\n },\n {\n desc: `${i18n.$t('从当前节点开始执行')}`,\n code: 'START_CURRENT_TASK_PROCESS'\n },\n {\n desc: `${i18n.$t('恢复被容错的工作流')}`,\n code: 'RECOVER_TOLERANCE_FAULT_PROCESS'\n },\n {\n desc: `${i18n.$t('恢复暂停流程')}`,\n code: 'RECOVER_SUSPENDED_PROCESS'\n },\n {\n desc: `${i18n.$t('从失败节点开始执行')}`,\n code: 'START_FAILURE_TASK_PROCESS'\n },\n {\n desc: `${i18n.$t('补数')}`,\n code: 'COMPLEMENT_DATA'\n },\n {\n desc: `${i18n.$t('调度执行')}`,\n code: 'SCHEDULER'\n },\n {\n desc: `${i18n.$t('重跑')}`,\n code: 'REPEAT_RUNNING'\n },\n {\n desc: `${i18n.$t('暂停')}`,\n code: 'PAUSE'\n },\n {\n desc: `${i18n.$t('停止')}`,\n code: 'STOP'\n },\n {\n desc: `${i18n.$t('恢复等待线程')}`,\n code: 'RECOVER_WAITTING_THREAD'\n }\n]\n\n/**\n * Task status\n * @key key\n * @id id\n * @desc tooltip\n * @color color\n * @icoUnicode iconfont\n * @isSpin is loading (Need to execute the code block to write if judgment)\n */\nlet tasksState = {\n 'SUBMITTED_SUCCESS': {\n id: 0,\n desc: `${i18n.$t('提交成功')}`,\n color: '#A9A9A9',\n icoUnicode: '',\n isSpin: false\n },\n 'RUNNING_EXEUTION': {\n id: 1,\n desc: `${i18n.$t('正在执行')}`,\n color: '#0097e0',\n icoUnicode: '',\n isSpin: true\n },\n 'READY_PAUSE': {\n id: 2,\n desc: `${i18n.$t('准备暂停')}`,\n color: '#07b1a3',\n icoUnicode: '',\n isSpin: false\n },\n 'PAUSE': {\n id: 3,\n desc: `${i18n.$t('暂停')}`,\n color: '#057c72',\n icoUnicode: '',\n isSpin: false\n },\n 'READY_STOP': {\n id: 4,\n desc: `${i18n.$t('准备停止')}`,\n color: '#FE0402',\n icoUnicode: '',\n isSpin: false\n },\n 'STOP': {\n id: 5,\n desc: `${i18n.$t('停止')}`,\n color: '#e90101',\n icoUnicode: '',\n isSpin: false\n },\n 'FAILURE': {\n id: 6,\n desc: `${i18n.$t('失败')}`,\n color: '#000000',\n icoUnicode: '',\n isSpin: false\n },\n 'SUCCESS': {\n id: 7,\n desc: `${i18n.$t('成功')}`,\n color: '#33cc00',\n icoUnicode: '',\n isSpin: false\n },\n 'NEED_FAULT_TOLERANCE': {\n id: 8,\n desc: `${i18n.$t('需要容错')}`,\n color: '#FF8C00',\n icoUnicode: '',\n isSpin: false\n },\n 'KILL': {\n id: 9,\n desc: `${i18n.$t('kill')}`,\n color: '#a70202',\n icoUnicode: '',\n isSpin: false\n },\n 'WAITTING_THREAD': {\n id: 10,\n desc: `${i18n.$t('等待线程')}`,\n color: '#912eed',\n icoUnicode: '',\n isSpin: false\n },\n 'WAITTING_DEPEND': {\n id: 11,\n desc: `${i18n.$t('等待依赖')}`,\n color: '#5101be',\n icoUnicode: '',\n isSpin: false\n }\n}\n\n/**\n * Node type\n * @key key\n * @desc tooltip\n * @color color (tree and gantt)\n */\nlet tasksType = {\n 'SHELL': {\n desc: 'SHELL',\n color: '#646464'\n },\n 'SUB_PROCESS': {\n desc: 'SUB_PROCESS',\n color: '#0097e0'\n },\n 'PROCEDURE': {\n desc: 'PROCEDURE',\n color: '#525CCD'\n },\n 'SQL': {\n desc: 'SQL',\n color: '#7A98A1'\n },\n 'SPARK': {\n desc: 'SPARK',\n color: '#E46F13'\n },\n 'MR': {\n desc: 'MapReduce',\n color: '#A0A5CC'\n },\n 'PYTHON': {\n desc: 'PYTHON',\n color: '#FED52D'\n },\n 'DEPENDENT': {\n desc: 'DEPENDENT',\n color: '#2FBFD8'\n }\n}\n\n\nexport {\n toolOper,\n publishStatus,\n runningType,\n tasksState,\n tasksType\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/config.js","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nif (typeof window === 'undefined') {\n throw new Error('For browser use only.')\n}\n\nconst root = window\nconst storage = root.localStorage\n\nconst localStorage = {\n setItem: function (skey, sval) {\n try {\n return storage.setItem(skey, sval)\n } catch (e) {\n console.info(e)\n }\n },\n getItem: function (skey) {\n try {\n return storage.getItem(skey)\n } catch (e) {\n console.info(e)\n return null\n }\n },\n removeItem: function (skey) {\n try {\n return storage.removeItem(skey)\n } catch (e) {\n console.info(e)\n return null\n }\n },\n getJSON: function (skey, p) {\n try {\n var d = storage.getItem(skey)\n if (d) {\n d = JSON.parse(d)\n return d[p]\n }\n } catch (e) {\n console.info(e)\n }\n },\n setJSON: function (skey, p, val) {\n try {\n var f = storage.getItem(skey)\n f = f ? JSON.parse(f) : {}\n f[p] = val\n storage.setItem(skey, JSON.stringify(f))\n } catch (e) {\n console.info(e)\n }\n },\n removeJSON: function (skey, p) {\n try {\n var d = storage.getItem(skey)\n if (d) {\n d = JSON.parse(d)\n delete d[p]\n storage.setItem(skey, JSON.stringify(d))\n }\n } catch (e) {\n console.info(e)\n }\n }\n}\n\nexport default localStorage\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/module/util/localStorage.js","!function(e,t){if(\"object\"==typeof exports&&\"object\"==typeof module)module.exports=t(require(\"echarts\"));else if(\"function\"==typeof define&&define.amd)define([\"echarts\"],t);else{var n=\"object\"==typeof exports?t(require(\"echarts\")):t(e.echarts);for(var i in n)(\"object\"==typeof exports?exports:e)[i]=n[i]}}(\"undefined\"!=typeof self?self:this,function(e){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=4)}([function(e,t,n){\"use strict\";t.__esModule=!0;t.init=function(e,t,n,i){var r=function(e){if(!e)return;if(\"string\"==typeof e)if(e.startsWith(\"#\"))e=document.getElementById(e.slice(1));else{if(!e.startsWith(\".\"))return;e=document.getElementsByClassName(e.slice(1))}if(!e)throw new Error(\"找不到对应的dom对象!\");var t=void 0;t=HTMLElement.prototype.isPrototypeOf(e)?new Array(e):Array.from(e);if(!t)throw new Error(\"未找到对应的dom对象!\");return t}(t),a=Object.assign({},{data:n},i),o=r.map(function(t){return new e(t,a)});return 1===o.length?o[0]:o};t.checkKeyInModel=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i=r.length)break;s=r[o++]}else{if((o=r.next()).done)break;s=o.value}var l=s;if(!e.hasOwnProperty(l))throw new Error(\"数据格式错误!未找到指定属性:\"+l)}}},function(e,t,n){\"use strict\";t.__esModule=!0;var i=a(n(3)),r=a(n(2));function a(e){return e&&e.__esModule?e:{default:e}}var o=function(){function e(t,n){var a=this;!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),this.settings=n;var o=this.transform();o&&(this.options=o,n.theme?this.echart=i.default.init(t,n.theme):r.default.settings.defaultTheme?this.echart=i.default.init(t,r.default.settings.defaultTheme):this.echart=i.default.init(t),window.addEventListener(\"resize\",function(){return a.echart.resize()}),this.apply())}return e.prototype.setData=function(e){e&&0!==e.length&&(this.settings.data=e,this.options=this.transform(),this.apply())},e.prototype.injectDataIntoSeries=function(e,t){return e.forEach(function(e){if(\"all\"===e.index)delete e.index,t=t.map(function(t){return Object.assign({},t,e)});else if(\"start\"===e.index)delete e.index,t[0]=Object.assign({},t[0],e);else if(\"end\"===e.index)delete e.index,t[t.length-1]=Object.assign({},t[t.length-1],e);else if(Array.isArray(e.index)){var n=e.index,i=Array.isArray(n),r=0;for(n=i?n:n[Symbol.iterator]();;){var a;if(i){if(r>=n.length)break;a=n[r++]}else{if((r=n.next()).done)break;a=r.value}var o=a;t[o]&&(t[o]=Object.assign({},t[o],e))}}}),t},e}();t.default=o},function(e,t,n){\"use strict\";t.__esModule=!0,t.Scatter=t.Funnel=t.Radar=t.Pie=t.Bar=t.Line=void 0;var i=c(n(3)),r=c(n(5)),a=c(n(6)),o=c(n(7)),s=c(n(8)),l=c(n(9)),u=c(n(10)),f=n(0);function c(e){return e&&e.__esModule?e:{default:e}}var p={Line:r.default,Bar:a.default,Pie:o.default,Radar:s.default,Funnel:l.default,Scatter:u.default},d={settings:{},config:function(e){var t=e.theme;t&&((0,f.checkKeyInModel)(t,\"name\",\"data\"),i.default.registerTheme(t.name,t.data),t.default&&(d.settings.defaultTheme=t.name))}},h=function(e){p.hasOwnProperty(e)&&(d[e.toLowerCase()]=function(t,n,i){return(0,f.init)(p[e],t,n,i)})};for(var y in p)h(y);t.Line=r.default,t.Bar=a.default,t.Pie=o.default,t.Radar=s.default,t.Funnel=l.default,t.Scatter=u.default,t.default=d,\"undefined\"!=typeof window&&(window.Chart=d)},function(t,n){t.exports=e},function(e,t,n){e.exports=n(2)},function(e,t,n){\"use strict\";t.__esModule=!0;var i,r=n(1),a=(i=r)&&i.__esModule?i:{default:i},o=n(0);var s=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,e.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,e),t.init=function(e,n,i){return(0,o.init)(t,e,n,i)},t.prototype.transform=function(){var e=this.settings.data,t=void 0===e?[]:e;if(0===t.length)throw new Error(\"数据源为空!\");return Object.keys(t[0]).length>2?this.setMultipleLines():(this.simple=!0,this.setSingleLine())},t.prototype.setSingleLine=function(){var e=this.settings,t=e.data,n=void 0===t?[]:t,i=e.keyMap,r=void 0===i?{xAxisKey:\"key\",dataKey:\"value\"}:i,a=e.title,s=void 0===a?\"单条折线图\":a,l=r.xAxisKey,u=r.dataKey;(0,o.checkKeyInModel)(n[0],l,u);for(var f=[{type:\"line\",data:[]}],c={type:\"category\",data:[]},p=0;p2?this.setMultipleBars():(this.simple=!0,this.setSingleBar())},t.prototype.setSingleBar=function(){var e=this.settings,t=e.data,n=void 0===t?[]:t,i=e.keyMap,r=void 0===i?{xAxisKey:\"key\",dataKey:\"value\"}:i,a=e.title,s=void 0===a?\"单条柱状图\":a,l=r.xAxisKey,u=r.dataKey;(0,o.checkKeyInModel)(n[0],l,u);for(var f=[{type:\"bar\",data:[]}],c={type:\"category\",data:[]},p=0;p=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}var 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,e.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,e),t.init=function(e,n,i){return(0,o.init)(t,e,n,i)},t.prototype.transform=function(){var e=this.settings,t=e.data,n=void 0===t?[]:t,i=e.title,r=void 0===i?\"饼图\":i,a=e.ring,l=void 0!==a&&a,u=e.keyMap,f=void 0===u?{textKey:\"key\",dataKey:\"value\"}:u;if(0===n.length)throw new Error(\"数据源为空!\");var c=f.textKey,p=f.dataKey;(0,o.checkKeyInModel)(n[0],c,p);for(var d=[{radius:l?[\"50%\",\"70%\"]:\"60%\",center:r?[\"50%\",\"60%\"]:[\"50%\",\"50%\"],type:\"pie\",data:[]}],h=0;h=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}var 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,e.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,e),t.init=function(e,n,i){return(0,o.init)(t,e,n,i)},t.prototype.transform=function(){var e=this.settings,t=e.data,n=void 0===t?[]:t,i=e.title,r=void 0===i?\"漏斗图\":i,a=e.keyMap,l=void 0===a?{textKey:\"key\",dataKey:\"value\"}:a;if(0===n.length)throw new Error(\"数据源为空!\");var u=l.textKey,f=l.dataKey;(0,o.checkKeyInModel)(n[0],u,f);for(var c=[{type:\"funnel\",left:\"10%\",top:60,bottom:60,width:\"80%\",min:0,max:100,minSize:\"0%\",maxSize:\"100%\",sort:\"descending\",gap:2,label:{normal:{show:!0,position:\"inside\"},emphasis:{textStyle:{fontSize:20}}},labelLine:{normal:{length:10,lineStyle:{width:1,type:\"solid\"}}},itemStyle:{normal:{borderColor:\"#fff\",borderWidth:1}},data:[]}],p=0;p{b} : {c}%\"},legend:{data:i},series:a},!0)},t}(a.default);t.default=l},function(e,t,n){\"use strict\";t.__esModule=!0;var i,r=n(1),a=(i=r)&&i.__esModule?i:{default:i},o=n(0);var s=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,e.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,e),t.init=function(e,n,i){return(0,o.init)(t,e,n,i)},t.prototype.transform=function(){var e=this.settings,t=e.data,n=void 0===t?[]:t,i=e.title,r=void 0===i?\"气泡图\":i,a=e.keyMap,s=void 0===a?{xKey:\"x\",yKey:\"y\",sizeKey:\"size\",textKey:\"text\",legendKey:\"typeName\"}:a;if(0===n.length)throw new Error(\"数据源为空!\");var l=[],u=[],f=s.xKey,c=s.yKey,p=s.sizeKey,d=s.textKey,h=s.legendKey;(0,o.checkKeyInModel)(n[0],f,c,p,d,h);for(var y=function(e){var t=n[e],i=t[h],r=t[f],a=t[c],o=t[p],s=t[d],y=function(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}(t,[h,f,c,p,d]);l.includes(i)||l.push(i);var v=u.find(function(e){return e.name===i});v||(v={type:\"scatter\",name:i,data:[],symbolSize:function(e){return Math.sqrt(e[2])},label:{emphasis:{show:!0,formatter:function(e){return e.data[3]},position:\"top\"}}},u.push(v)),v.data.push(Object.assign({value:[r,a,o,s]},y,{_raw:n[e]}))},v=0;v {\n // instance\n new Vue({\n el: '#app',\n router,\n store,\n render: h => h(App),\n mounted () {\n document.addEventListener('click', (e) => {\n $('#contextmenu').css('visibility', 'hidden')\n })\n },\n methods: {\n initApp () {\n $('.global-loading').hide()\n let bootstrapTooltip = $.fn.tooltip.noConflict()\n $.fn.tooltip = bootstrapTooltip\n $('body').tooltip({\n selector: '[data-toggle=\"tooltip\"]',\n trigger: 'hover'\n })\n // init\n i18n.init()\n }\n },\n created () {\n this.initApp()\n }\n })\n})\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/index.js","var normalizeComponent = require(\"!../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./App.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./App.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-4b1359b5\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./App.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/App.vue\n// module id = 229\n// module chunks = 39","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-50c6fe8a\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./layout.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./layout.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./layout.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-50c6fe8a\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./layout.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/layout/layout.vue\n// module id = 230\n// module chunks = 39","// style-loader: Adds some css to the DOM by adding a \n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/layout/layout.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/nav/nav.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/fileUpdate/fileUpdate.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/popup/popup.vue","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/listBoxF/listBoxF.vue","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-b411cdf2\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./progressBar.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./progressBar.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./progressBar.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-b411cdf2\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./progressBar.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/progressBar/progressBar.vue\n// module id = 136\n// module chunks = 39","\n\n\n\n\n\n\n// WEBPACK FOOTER //\n// src/js/module/components/progressBar/progressBar.vue","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _echarts = require(\"./lib/echarts\");\n\n(function () {\n for (var key in _echarts) {\n if (_echarts == null || !_echarts.hasOwnProperty(key) || key === 'default' || key === '__esModule') return;\n exports[key] = _echarts[key];\n }\n})();\n\nvar _export = require(\"./lib/export\");\n\n(function () {\n for (var key in _export) {\n if (_export == null || !_export.hasOwnProperty(key) || key === 'default' || key === '__esModule') return;\n exports[key] = _export[key];\n }\n})();\n\nrequire(\"./lib/component/dataset\");\n\nrequire(\"./lib/chart/line\");\n\nrequire(\"./lib/chart/bar\");\n\nrequire(\"./lib/chart/pie\");\n\nrequire(\"./lib/chart/scatter\");\n\nrequire(\"./lib/chart/radar\");\n\nrequire(\"./lib/chart/map\");\n\nrequire(\"./lib/chart/tree\");\n\nrequire(\"./lib/chart/treemap\");\n\nrequire(\"./lib/chart/graph\");\n\nrequire(\"./lib/chart/gauge\");\n\nrequire(\"./lib/chart/funnel\");\n\nrequire(\"./lib/chart/parallel\");\n\nrequire(\"./lib/chart/sankey\");\n\nrequire(\"./lib/chart/boxplot\");\n\nrequire(\"./lib/chart/candlestick\");\n\nrequire(\"./lib/chart/effectScatter\");\n\nrequire(\"./lib/chart/lines\");\n\nrequire(\"./lib/chart/heatmap\");\n\nrequire(\"./lib/chart/pictorialBar\");\n\nrequire(\"./lib/chart/themeRiver\");\n\nrequire(\"./lib/chart/sunburst\");\n\nrequire(\"./lib/chart/custom\");\n\nrequire(\"./lib/component/graphic\");\n\nrequire(\"./lib/component/grid\");\n\nrequire(\"./lib/component/legendScroll\");\n\nrequire(\"./lib/component/tooltip\");\n\nrequire(\"./lib/component/axisPointer\");\n\nrequire(\"./lib/component/polar\");\n\nrequire(\"./lib/component/geo\");\n\nrequire(\"./lib/component/parallel\");\n\nrequire(\"./lib/component/singleAxis\");\n\nrequire(\"./lib/component/brush\");\n\nrequire(\"./lib/component/calendar\");\n\nrequire(\"./lib/component/title\");\n\nrequire(\"./lib/component/dataZoom\");\n\nrequire(\"./lib/component/visualMap\");\n\nrequire(\"./lib/component/markPoint\");\n\nrequire(\"./lib/component/markLine\");\n\nrequire(\"./lib/component/markArea\");\n\nrequire(\"./lib/component/timeline\");\n\nrequire(\"./lib/component/toolbox\");\n\nrequire(\"zrender/lib/vml/vml\");\n\nrequire(\"zrender/lib/svg/svg\");\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/index.js\n// module id = 138\n// module chunks = 39","/**\n * zrender: 生成唯一id\n *\n * @author errorrik (errorrik@gmail.com)\n */\nvar idStart = 0x0907;\n\nfunction _default() {\n return idStart++;\n}\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/core/guid.js\n// module id = 139\n// module chunks = 39","var guid = require(\"./core/guid\");\n\nvar Eventful = require(\"./mixin/Eventful\");\n\nvar Transformable = require(\"./mixin/Transformable\");\n\nvar Animatable = require(\"./mixin/Animatable\");\n\nvar zrUtil = require(\"./core/util\");\n\n/**\n * @alias module:zrender/Element\n * @constructor\n * @extends {module:zrender/mixin/Animatable}\n * @extends {module:zrender/mixin/Transformable}\n * @extends {module:zrender/mixin/Eventful}\n */\nvar Element = function (opts) {\n // jshint ignore:line\n Transformable.call(this, opts);\n Eventful.call(this, opts);\n Animatable.call(this, opts);\n /**\n * 画布元素ID\n * @type {string}\n */\n\n this.id = opts.id || guid();\n};\n\nElement.prototype = {\n /**\n * 元素类型\n * Element type\n * @type {string}\n */\n type: 'element',\n\n /**\n * 元素名字\n * Element name\n * @type {string}\n */\n name: '',\n\n /**\n * ZRender 实例对象,会在 element 添加到 zrender 实例中后自动赋值\n * ZRender instance will be assigned when element is associated with zrender\n * @name module:/zrender/Element#__zr\n * @type {module:zrender/ZRender}\n */\n __zr: null,\n\n /**\n * 图形是否忽略,为true时忽略图形的绘制以及事件触发\n * If ignore drawing and events of the element object\n * @name module:/zrender/Element#ignore\n * @type {boolean}\n * @default false\n */\n ignore: false,\n\n /**\n * 用于裁剪的路径(shape),所有 Group 内的路径在绘制时都会被这个路径裁剪\n * 该路径会继承被裁减对象的变换\n * @type {module:zrender/graphic/Path}\n * @see http://www.w3.org/TR/2dcontext/#clipping-region\n * @readOnly\n */\n clipPath: null,\n\n /**\n * 是否是 Group\n * @type {boolean}\n */\n isGroup: false,\n\n /**\n * Drift element\n * @param {number} dx dx on the global space\n * @param {number} dy dy on the global space\n */\n drift: function (dx, dy) {\n switch (this.draggable) {\n case 'horizontal':\n dy = 0;\n break;\n\n case 'vertical':\n dx = 0;\n break;\n }\n\n var m = this.transform;\n\n if (!m) {\n m = this.transform = [1, 0, 0, 1, 0, 0];\n }\n\n m[4] += dx;\n m[5] += dy;\n this.decomposeTransform();\n this.dirty(false);\n },\n\n /**\n * Hook before update\n */\n beforeUpdate: function () {},\n\n /**\n * Hook after update\n */\n afterUpdate: function () {},\n\n /**\n * Update each frame\n */\n update: function () {\n this.updateTransform();\n },\n\n /**\n * @param {Function} cb\n * @param {} context\n */\n traverse: function (cb, context) {},\n\n /**\n * @protected\n */\n attrKV: function (key, value) {\n if (key === 'position' || key === 'scale' || key === 'origin') {\n // Copy the array\n if (value) {\n var target = this[key];\n\n if (!target) {\n target = this[key] = [];\n }\n\n target[0] = value[0];\n target[1] = value[1];\n }\n } else {\n this[key] = value;\n }\n },\n\n /**\n * Hide the element\n */\n hide: function () {\n this.ignore = true;\n this.__zr && this.__zr.refresh();\n },\n\n /**\n * Show the element\n */\n show: function () {\n this.ignore = false;\n this.__zr && this.__zr.refresh();\n },\n\n /**\n * @param {string|Object} key\n * @param {*} value\n */\n attr: function (key, value) {\n if (typeof key === 'string') {\n this.attrKV(key, value);\n } else if (zrUtil.isObject(key)) {\n for (var name in key) {\n if (key.hasOwnProperty(name)) {\n this.attrKV(name, key[name]);\n }\n }\n }\n\n this.dirty(false);\n return this;\n },\n\n /**\n * @param {module:zrender/graphic/Path} clipPath\n */\n setClipPath: function (clipPath) {\n var zr = this.__zr;\n\n if (zr) {\n clipPath.addSelfToZr(zr);\n } // Remove previous clip path\n\n\n if (this.clipPath && this.clipPath !== clipPath) {\n this.removeClipPath();\n }\n\n this.clipPath = clipPath;\n clipPath.__zr = zr;\n clipPath.__clipTarget = this;\n this.dirty(false);\n },\n\n /**\n */\n removeClipPath: function () {\n var clipPath = this.clipPath;\n\n if (clipPath) {\n if (clipPath.__zr) {\n clipPath.removeSelfFromZr(clipPath.__zr);\n }\n\n clipPath.__zr = null;\n clipPath.__clipTarget = null;\n this.clipPath = null;\n this.dirty(false);\n }\n },\n\n /**\n * Add self from zrender instance.\n * Not recursively because it will be invoked when element added to storage.\n * @param {module:zrender/ZRender} zr\n */\n addSelfToZr: function (zr) {\n this.__zr = zr; // 添加动画\n\n var animators = this.animators;\n\n if (animators) {\n for (var i = 0; i < animators.length; i++) {\n zr.animation.addAnimator(animators[i]);\n }\n }\n\n if (this.clipPath) {\n this.clipPath.addSelfToZr(zr);\n }\n },\n\n /**\n * Remove self from zrender instance.\n * Not recursively because it will be invoked when element added to storage.\n * @param {module:zrender/ZRender} zr\n */\n removeSelfFromZr: function (zr) {\n this.__zr = null; // 移除动画\n\n var animators = this.animators;\n\n if (animators) {\n for (var i = 0; i < animators.length; i++) {\n zr.animation.removeAnimator(animators[i]);\n }\n }\n\n if (this.clipPath) {\n this.clipPath.removeSelfFromZr(zr);\n }\n }\n};\nzrUtil.mixin(Element, Animatable);\nzrUtil.mixin(Element, Transformable);\nzrUtil.mixin(Element, Eventful);\nvar _default = Element;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/Element.js\n// module id = 140\n// module chunks = 39","var Clip = require(\"./Clip\");\n\nvar color = require(\"../tool/color\");\n\nvar _util = require(\"../core/util\");\n\nvar isArrayLike = _util.isArrayLike;\n\n/**\n * @module echarts/animation/Animator\n */\nvar arraySlice = Array.prototype.slice;\n\nfunction defaultGetter(target, key) {\n return target[key];\n}\n\nfunction defaultSetter(target, key, value) {\n target[key] = value;\n}\n/**\n * @param {number} p0\n * @param {number} p1\n * @param {number} percent\n * @return {number}\n */\n\n\nfunction interpolateNumber(p0, p1, percent) {\n return (p1 - p0) * percent + p0;\n}\n/**\n * @param {string} p0\n * @param {string} p1\n * @param {number} percent\n * @return {string}\n */\n\n\nfunction interpolateString(p0, p1, percent) {\n return percent > 0.5 ? p1 : p0;\n}\n/**\n * @param {Array} p0\n * @param {Array} p1\n * @param {number} percent\n * @param {Array} out\n * @param {number} arrDim\n */\n\n\nfunction interpolateArray(p0, p1, percent, out, arrDim) {\n var len = p0.length;\n\n if (arrDim === 1) {\n for (var i = 0; i < len; i++) {\n out[i] = interpolateNumber(p0[i], p1[i], percent);\n }\n } else {\n var len2 = len && p0[0].length;\n\n for (var i = 0; i < len; i++) {\n for (var j = 0; j < len2; j++) {\n out[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent);\n }\n }\n }\n} // arr0 is source array, arr1 is target array.\n// Do some preprocess to avoid error happened when interpolating from arr0 to arr1\n\n\nfunction fillArr(arr0, arr1, arrDim) {\n var arr0Len = arr0.length;\n var arr1Len = arr1.length;\n\n if (arr0Len !== arr1Len) {\n // FIXME Not work for TypedArray\n var isPreviousLarger = arr0Len > arr1Len;\n\n if (isPreviousLarger) {\n // Cut the previous\n arr0.length = arr1Len;\n } else {\n // Fill the previous\n for (var i = arr0Len; i < arr1Len; i++) {\n arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i]));\n }\n }\n } // Handling NaN value\n\n\n var len2 = arr0[0] && arr0[0].length;\n\n for (var i = 0; i < arr0.length; i++) {\n if (arrDim === 1) {\n if (isNaN(arr0[i])) {\n arr0[i] = arr1[i];\n }\n } else {\n for (var j = 0; j < len2; j++) {\n if (isNaN(arr0[i][j])) {\n arr0[i][j] = arr1[i][j];\n }\n }\n }\n }\n}\n/**\n * @param {Array} arr0\n * @param {Array} arr1\n * @param {number} arrDim\n * @return {boolean}\n */\n\n\nfunction isArraySame(arr0, arr1, arrDim) {\n if (arr0 === arr1) {\n return true;\n }\n\n var len = arr0.length;\n\n if (len !== arr1.length) {\n return false;\n }\n\n if (arrDim === 1) {\n for (var i = 0; i < len; i++) {\n if (arr0[i] !== arr1[i]) {\n return false;\n }\n }\n } else {\n var len2 = arr0[0].length;\n\n for (var i = 0; i < len; i++) {\n for (var j = 0; j < len2; j++) {\n if (arr0[i][j] !== arr1[i][j]) {\n return false;\n }\n }\n }\n }\n\n return true;\n}\n/**\n * Catmull Rom interpolate array\n * @param {Array} p0\n * @param {Array} p1\n * @param {Array} p2\n * @param {Array} p3\n * @param {number} t\n * @param {number} t2\n * @param {number} t3\n * @param {Array} out\n * @param {number} arrDim\n */\n\n\nfunction catmullRomInterpolateArray(p0, p1, p2, p3, t, t2, t3, out, arrDim) {\n var len = p0.length;\n\n if (arrDim === 1) {\n for (var i = 0; i < len; i++) {\n out[i] = catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3);\n }\n } else {\n var len2 = p0[0].length;\n\n for (var i = 0; i < len; i++) {\n for (var j = 0; j < len2; j++) {\n out[i][j] = catmullRomInterpolate(p0[i][j], p1[i][j], p2[i][j], p3[i][j], t, t2, t3);\n }\n }\n }\n}\n/**\n * Catmull Rom interpolate number\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} p3\n * @param {number} t\n * @param {number} t2\n * @param {number} t3\n * @return {number}\n */\n\n\nfunction catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {\n var v0 = (p2 - p0) * 0.5;\n var v1 = (p3 - p1) * 0.5;\n return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1;\n}\n\nfunction cloneValue(value) {\n if (isArrayLike(value)) {\n var len = value.length;\n\n if (isArrayLike(value[0])) {\n var ret = [];\n\n for (var i = 0; i < len; i++) {\n ret.push(arraySlice.call(value[i]));\n }\n\n return ret;\n }\n\n return arraySlice.call(value);\n }\n\n return value;\n}\n\nfunction rgba2String(rgba) {\n rgba[0] = Math.floor(rgba[0]);\n rgba[1] = Math.floor(rgba[1]);\n rgba[2] = Math.floor(rgba[2]);\n return 'rgba(' + rgba.join(',') + ')';\n}\n\nfunction getArrayDim(keyframes) {\n var lastValue = keyframes[keyframes.length - 1].value;\n return isArrayLike(lastValue && lastValue[0]) ? 2 : 1;\n}\n\nfunction createTrackClip(animator, easing, oneTrackDone, keyframes, propName, forceAnimate) {\n var getter = animator._getter;\n var setter = animator._setter;\n var useSpline = easing === 'spline';\n var trackLen = keyframes.length;\n\n if (!trackLen) {\n return;\n } // Guess data type\n\n\n var firstVal = keyframes[0].value;\n var isValueArray = isArrayLike(firstVal);\n var isValueColor = false;\n var isValueString = false; // For vertices morphing\n\n var arrDim = isValueArray ? getArrayDim(keyframes) : 0;\n var trackMaxTime; // Sort keyframe as ascending\n\n keyframes.sort(function (a, b) {\n return a.time - b.time;\n });\n trackMaxTime = keyframes[trackLen - 1].time; // Percents of each keyframe\n\n var kfPercents = []; // Value of each keyframe\n\n var kfValues = [];\n var prevValue = keyframes[0].value;\n var isAllValueEqual = true;\n\n for (var i = 0; i < trackLen; i++) {\n kfPercents.push(keyframes[i].time / trackMaxTime); // Assume value is a color when it is a string\n\n var value = keyframes[i].value; // Check if value is equal, deep check if value is array\n\n if (!(isValueArray && isArraySame(value, prevValue, arrDim) || !isValueArray && value === prevValue)) {\n isAllValueEqual = false;\n }\n\n prevValue = value; // Try converting a string to a color array\n\n if (typeof value === 'string') {\n var colorArray = color.parse(value);\n\n if (colorArray) {\n value = colorArray;\n isValueColor = true;\n } else {\n isValueString = true;\n }\n }\n\n kfValues.push(value);\n }\n\n if (!forceAnimate && isAllValueEqual) {\n return;\n }\n\n var lastValue = kfValues[trackLen - 1]; // Polyfill array and NaN value\n\n for (var i = 0; i < trackLen - 1; i++) {\n if (isValueArray) {\n fillArr(kfValues[i], lastValue, arrDim);\n } else {\n if (isNaN(kfValues[i]) && !isNaN(lastValue) && !isValueString && !isValueColor) {\n kfValues[i] = lastValue;\n }\n }\n }\n\n isValueArray && fillArr(getter(animator._target, propName), lastValue, arrDim); // Cache the key of last frame to speed up when\n // animation playback is sequency\n\n var lastFrame = 0;\n var lastFramePercent = 0;\n var start;\n var w;\n var p0;\n var p1;\n var p2;\n var p3;\n\n if (isValueColor) {\n var rgba = [0, 0, 0, 0];\n }\n\n var onframe = function (target, percent) {\n // Find the range keyframes\n // kf1-----kf2---------current--------kf3\n // find kf2 and kf3 and do interpolation\n var frame; // In the easing function like elasticOut, percent may less than 0\n\n if (percent < 0) {\n frame = 0;\n } else if (percent < lastFramePercent) {\n // Start from next key\n // PENDING start from lastFrame ?\n start = Math.min(lastFrame + 1, trackLen - 1);\n\n for (frame = start; frame >= 0; frame--) {\n if (kfPercents[frame] <= percent) {\n break;\n }\n } // PENDING really need to do this ?\n\n\n frame = Math.min(frame, trackLen - 2);\n } else {\n for (frame = lastFrame; frame < trackLen; frame++) {\n if (kfPercents[frame] > percent) {\n break;\n }\n }\n\n frame = Math.min(frame - 1, trackLen - 2);\n }\n\n lastFrame = frame;\n lastFramePercent = percent;\n var range = kfPercents[frame + 1] - kfPercents[frame];\n\n if (range === 0) {\n return;\n } else {\n w = (percent - kfPercents[frame]) / range;\n }\n\n if (useSpline) {\n p1 = kfValues[frame];\n p0 = kfValues[frame === 0 ? frame : frame - 1];\n p2 = kfValues[frame > trackLen - 2 ? trackLen - 1 : frame + 1];\n p3 = kfValues[frame > trackLen - 3 ? trackLen - 1 : frame + 2];\n\n if (isValueArray) {\n catmullRomInterpolateArray(p0, p1, p2, p3, w, w * w, w * w * w, getter(target, propName), arrDim);\n } else {\n var value;\n\n if (isValueColor) {\n value = catmullRomInterpolateArray(p0, p1, p2, p3, w, w * w, w * w * w, rgba, 1);\n value = rgba2String(rgba);\n } else if (isValueString) {\n // String is step(0.5)\n return interpolateString(p1, p2, w);\n } else {\n value = catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w);\n }\n\n setter(target, propName, value);\n }\n } else {\n if (isValueArray) {\n interpolateArray(kfValues[frame], kfValues[frame + 1], w, getter(target, propName), arrDim);\n } else {\n var value;\n\n if (isValueColor) {\n interpolateArray(kfValues[frame], kfValues[frame + 1], w, rgba, 1);\n value = rgba2String(rgba);\n } else if (isValueString) {\n // String is step(0.5)\n return interpolateString(kfValues[frame], kfValues[frame + 1], w);\n } else {\n value = interpolateNumber(kfValues[frame], kfValues[frame + 1], w);\n }\n\n setter(target, propName, value);\n }\n }\n };\n\n var clip = new Clip({\n target: animator._target,\n life: trackMaxTime,\n loop: animator._loop,\n delay: animator._delay,\n onframe: onframe,\n ondestroy: oneTrackDone\n });\n\n if (easing && easing !== 'spline') {\n clip.easing = easing;\n }\n\n return clip;\n}\n/**\n * @alias module:zrender/animation/Animator\n * @constructor\n * @param {Object} target\n * @param {boolean} loop\n * @param {Function} getter\n * @param {Function} setter\n */\n\n\nvar Animator = function (target, loop, getter, setter) {\n this._tracks = {};\n this._target = target;\n this._loop = loop || false;\n this._getter = getter || defaultGetter;\n this._setter = setter || defaultSetter;\n this._clipCount = 0;\n this._delay = 0;\n this._doneList = [];\n this._onframeList = [];\n this._clipList = [];\n};\n\nAnimator.prototype = {\n /**\n * 设置动画关键帧\n * @param {number} time 关键帧时间,单位是ms\n * @param {Object} props 关键帧的属性值,key-value表示\n * @return {module:zrender/animation/Animator}\n */\n when: function (time\n /* ms */\n , props) {\n var tracks = this._tracks;\n\n for (var propName in props) {\n if (!props.hasOwnProperty(propName)) {\n continue;\n }\n\n if (!tracks[propName]) {\n tracks[propName] = []; // Invalid value\n\n var value = this._getter(this._target, propName);\n\n if (value == null) {\n // zrLog('Invalid property ' + propName);\n continue;\n } // If time is 0\n // Then props is given initialize value\n // Else\n // Initialize value from current prop value\n\n\n if (time !== 0) {\n tracks[propName].push({\n time: 0,\n value: cloneValue(value)\n });\n }\n }\n\n tracks[propName].push({\n time: time,\n value: props[propName]\n });\n }\n\n return this;\n },\n\n /**\n * 添加动画每一帧的回调函数\n * @param {Function} callback\n * @return {module:zrender/animation/Animator}\n */\n during: function (callback) {\n this._onframeList.push(callback);\n\n return this;\n },\n pause: function () {\n for (var i = 0; i < this._clipList.length; i++) {\n this._clipList[i].pause();\n }\n\n this._paused = true;\n },\n resume: function () {\n for (var i = 0; i < this._clipList.length; i++) {\n this._clipList[i].resume();\n }\n\n this._paused = false;\n },\n isPaused: function () {\n return !!this._paused;\n },\n _doneCallback: function () {\n // Clear all tracks\n this._tracks = {}; // Clear all clips\n\n this._clipList.length = 0;\n var doneList = this._doneList;\n var len = doneList.length;\n\n for (var i = 0; i < len; i++) {\n doneList[i].call(this);\n }\n },\n\n /**\n * 开始执行动画\n * @param {string|Function} [easing]\n * 动画缓动函数,详见{@link module:zrender/animation/easing}\n * @param {boolean} forceAnimate\n * @return {module:zrender/animation/Animator}\n */\n start: function (easing, forceAnimate) {\n var self = this;\n var clipCount = 0;\n\n var oneTrackDone = function () {\n clipCount--;\n\n if (!clipCount) {\n self._doneCallback();\n }\n };\n\n var lastClip;\n\n for (var propName in this._tracks) {\n if (!this._tracks.hasOwnProperty(propName)) {\n continue;\n }\n\n var clip = createTrackClip(this, easing, oneTrackDone, this._tracks[propName], propName, forceAnimate);\n\n if (clip) {\n this._clipList.push(clip);\n\n clipCount++; // If start after added to animation\n\n if (this.animation) {\n this.animation.addClip(clip);\n }\n\n lastClip = clip;\n }\n } // Add during callback on the last clip\n\n\n if (lastClip) {\n var oldOnFrame = lastClip.onframe;\n\n lastClip.onframe = function (target, percent) {\n oldOnFrame(target, percent);\n\n for (var i = 0; i < self._onframeList.length; i++) {\n self._onframeList[i](target, percent);\n }\n };\n } // This optimization will help the case that in the upper application\n // the view may be refreshed frequently, where animation will be\n // called repeatly but nothing changed.\n\n\n if (!clipCount) {\n this._doneCallback();\n }\n\n return this;\n },\n\n /**\n * 停止动画\n * @param {boolean} forwardToLast If move to last frame before stop\n */\n stop: function (forwardToLast) {\n var clipList = this._clipList;\n var animation = this.animation;\n\n for (var i = 0; i < clipList.length; i++) {\n var clip = clipList[i];\n\n if (forwardToLast) {\n // Move to last frame before stop\n clip.onframe(this._target, 1);\n }\n\n animation && animation.removeClip(clip);\n }\n\n clipList.length = 0;\n },\n\n /**\n * 设置动画延迟开始的时间\n * @param {number} time 单位ms\n * @return {module:zrender/animation/Animator}\n */\n delay: function (time) {\n this._delay = time;\n return this;\n },\n\n /**\n * 添加动画结束的回调\n * @param {Function} cb\n * @return {module:zrender/animation/Animator}\n */\n done: function (cb) {\n if (cb) {\n this._doneList.push(cb);\n }\n\n return this;\n },\n\n /**\n * @return {Array.}\n */\n getClips: function () {\n return this._clipList;\n }\n};\nvar _default = Animator;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/animation/Animator.js\n// module id = 141\n// module chunks = 39","// Simple LRU cache use doubly linked list\n// @module zrender/core/LRU\n\n/**\n * Simple double linked list. Compared with array, it has O(1) remove operation.\n * @constructor\n */\nvar LinkedList = function () {\n /**\n * @type {module:zrender/core/LRU~Entry}\n */\n this.head = null;\n /**\n * @type {module:zrender/core/LRU~Entry}\n */\n\n this.tail = null;\n this._len = 0;\n};\n\nvar linkedListProto = LinkedList.prototype;\n/**\n * Insert a new value at the tail\n * @param {} val\n * @return {module:zrender/core/LRU~Entry}\n */\n\nlinkedListProto.insert = function (val) {\n var entry = new Entry(val);\n this.insertEntry(entry);\n return entry;\n};\n/**\n * Insert an entry at the tail\n * @param {module:zrender/core/LRU~Entry} entry\n */\n\n\nlinkedListProto.insertEntry = function (entry) {\n if (!this.head) {\n this.head = this.tail = entry;\n } else {\n this.tail.next = entry;\n entry.prev = this.tail;\n entry.next = null;\n this.tail = entry;\n }\n\n this._len++;\n};\n/**\n * Remove entry.\n * @param {module:zrender/core/LRU~Entry} entry\n */\n\n\nlinkedListProto.remove = function (entry) {\n var prev = entry.prev;\n var next = entry.next;\n\n if (prev) {\n prev.next = next;\n } else {\n // Is head\n this.head = next;\n }\n\n if (next) {\n next.prev = prev;\n } else {\n // Is tail\n this.tail = prev;\n }\n\n entry.next = entry.prev = null;\n this._len--;\n};\n/**\n * @return {number}\n */\n\n\nlinkedListProto.len = function () {\n return this._len;\n};\n/**\n * Clear list\n */\n\n\nlinkedListProto.clear = function () {\n this.head = this.tail = null;\n this._len = 0;\n};\n/**\n * @constructor\n * @param {} val\n */\n\n\nvar Entry = function (val) {\n /**\n * @type {}\n */\n this.value = val;\n /**\n * @type {module:zrender/core/LRU~Entry}\n */\n\n this.next;\n /**\n * @type {module:zrender/core/LRU~Entry}\n */\n\n this.prev;\n};\n/**\n * LRU Cache\n * @constructor\n * @alias module:zrender/core/LRU\n */\n\n\nvar LRU = function (maxSize) {\n this._list = new LinkedList();\n this._map = {};\n this._maxSize = maxSize || 10;\n this._lastRemovedEntry = null;\n};\n\nvar LRUProto = LRU.prototype;\n/**\n * @param {string} key\n * @param {} value\n * @return {} Removed value\n */\n\nLRUProto.put = function (key, value) {\n var list = this._list;\n var map = this._map;\n var removed = null;\n\n if (map[key] == null) {\n var len = list.len(); // Reuse last removed entry\n\n var entry = this._lastRemovedEntry;\n\n if (len >= this._maxSize && len > 0) {\n // Remove the least recently used\n var leastUsedEntry = list.head;\n list.remove(leastUsedEntry);\n delete map[leastUsedEntry.key];\n removed = leastUsedEntry.value;\n this._lastRemovedEntry = leastUsedEntry;\n }\n\n if (entry) {\n entry.value = value;\n } else {\n entry = new Entry(value);\n }\n\n entry.key = key;\n list.insertEntry(entry);\n map[key] = entry;\n }\n\n return removed;\n};\n/**\n * @param {string} key\n * @return {}\n */\n\n\nLRUProto.get = function (key) {\n var entry = this._map[key];\n var list = this._list;\n\n if (entry != null) {\n // Put the latest used entry in the tail\n if (entry !== list.tail) {\n list.remove(entry);\n list.insertEntry(entry);\n }\n\n return entry.value;\n }\n};\n/**\n * Clear the cache\n */\n\n\nLRUProto.clear = function () {\n this._list.clear();\n\n this._map = {};\n};\n\nvar _default = LRU;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/core/LRU.js\n// module id = 142\n// module chunks = 39","var SHADOW_PROPS = {\n 'shadowBlur': 1,\n 'shadowOffsetX': 1,\n 'shadowOffsetY': 1,\n 'textShadowBlur': 1,\n 'textShadowOffsetX': 1,\n 'textShadowOffsetY': 1,\n 'textBoxShadowBlur': 1,\n 'textBoxShadowOffsetX': 1,\n 'textBoxShadowOffsetY': 1\n};\n\nfunction _default(ctx, propName, value) {\n if (SHADOW_PROPS.hasOwnProperty(propName)) {\n return value *= ctx.dpr;\n }\n\n return value;\n}\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/helper/fixShadow.js\n// module id = 143\n// module chunks = 39","var Pattern = function (image, repeat) {\n // Should do nothing more in this constructor. Because gradient can be\n // declard by `color: {image: ...}`, where this constructor will not be called.\n this.image = image;\n this.repeat = repeat; // Can be cloned\n\n this.type = 'pattern';\n};\n\nPattern.prototype.getCanvasPattern = function (ctx) {\n return ctx.createPattern(this.image, this.repeat || 'repeat');\n};\n\nvar _default = Pattern;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/Pattern.js\n// module id = 144\n// module chunks = 39","var _default = typeof window !== 'undefined' && (window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || // https://github.com/ecomfe/zrender/issues/189#issuecomment-224919809\nwindow.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window) || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame) || function (func) {\n setTimeout(func, 16);\n};\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/animation/requestAnimationFrame.js\n// module id = 145\n// module chunks = 39","var textHelper = require(\"../helper/text\");\n\nvar BoundingRect = require(\"../../core/BoundingRect\");\n\nvar _constant = require(\"../constant\");\n\nvar WILL_BE_RESTORED = _constant.WILL_BE_RESTORED;\n\n/**\n * Mixin for drawing text in a element bounding rect\n * @module zrender/mixin/RectText\n */\nvar tmpRect = new BoundingRect();\n\nvar RectText = function () {};\n\nRectText.prototype = {\n constructor: RectText,\n\n /**\n * Draw text in a rect with specified position.\n * @param {CanvasRenderingContext2D} ctx\n * @param {Object} rect Displayable rect\n */\n drawRectText: function (ctx, rect) {\n var style = this.style;\n rect = style.textRect || rect; // Optimize, avoid normalize every time.\n\n this.__dirty && textHelper.normalizeTextStyle(style, true);\n var text = style.text; // Convert to string\n\n text != null && (text += '');\n\n if (!textHelper.needDrawText(text, style)) {\n return;\n } // FIXME\n // Do not provide prevEl to `textHelper.renderText` for ctx prop cache,\n // but use `ctx.save()` and `ctx.restore()`. Because the cache for rect\n // text propably break the cache for its host elements.\n\n\n ctx.save(); // Transform rect to view space\n\n var transform = this.transform;\n\n if (!style.transformText) {\n if (transform) {\n tmpRect.copy(rect);\n tmpRect.applyTransform(transform);\n rect = tmpRect;\n }\n } else {\n this.setTransform(ctx);\n } // transformText and textRotation can not be used at the same time.\n\n\n textHelper.renderText(this, ctx, text, style, rect, WILL_BE_RESTORED);\n ctx.restore();\n }\n};\nvar _default = RectText;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/mixin/RectText.js\n// module id = 146\n// module chunks = 39","/**\n * @param {Object} ctx\n * @param {Object} shape\n * @param {number} shape.x\n * @param {number} shape.y\n * @param {number} shape.width\n * @param {number} shape.height\n * @param {number} shape.r\n */\nfunction buildPath(ctx, shape) {\n var x = shape.x;\n var y = shape.y;\n var width = shape.width;\n var height = shape.height;\n var r = shape.r;\n var r1;\n var r2;\n var r3;\n var r4; // Convert width and height to positive for better borderRadius\n\n if (width < 0) {\n x = x + width;\n width = -width;\n }\n\n if (height < 0) {\n y = y + height;\n height = -height;\n }\n\n if (typeof r === 'number') {\n r1 = r2 = r3 = r4 = r;\n } else if (r instanceof Array) {\n if (r.length === 1) {\n r1 = r2 = r3 = r4 = r[0];\n } else if (r.length === 2) {\n r1 = r3 = r[0];\n r2 = r4 = r[1];\n } else if (r.length === 3) {\n r1 = r[0];\n r2 = r4 = r[1];\n r3 = r[2];\n } else {\n r1 = r[0];\n r2 = r[1];\n r3 = r[2];\n r4 = r[3];\n }\n } else {\n r1 = r2 = r3 = r4 = 0;\n }\n\n var total;\n\n if (r1 + r2 > width) {\n total = r1 + r2;\n r1 *= width / total;\n r2 *= width / total;\n }\n\n if (r3 + r4 > width) {\n total = r3 + r4;\n r3 *= width / total;\n r4 *= width / total;\n }\n\n if (r2 + r3 > height) {\n total = r2 + r3;\n r2 *= height / total;\n r3 *= height / total;\n }\n\n if (r1 + r4 > height) {\n total = r1 + r4;\n r1 *= height / total;\n r4 *= height / total;\n }\n\n ctx.moveTo(x + r1, y);\n ctx.lineTo(x + width - r2, y);\n r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0);\n ctx.lineTo(x + width, y + height - r3);\n r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2);\n ctx.lineTo(x + r4, y + height);\n r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI);\n ctx.lineTo(x, y + r1);\n r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5);\n}\n\nexports.buildPath = buildPath;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/helper/roundRect.js\n// module id = 147\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _config = require(\"../config\");\n\nvar __DEV__ = _config.__DEV__;\n\nvar _util = require(\"zrender/lib/core/util\");\n\nvar each = _util.each;\nvar filter = _util.filter;\nvar map = _util.map;\nvar isArray = _util.isArray;\nvar indexOf = _util.indexOf;\nvar isObject = _util.isObject;\nvar isString = _util.isString;\nvar createHashMap = _util.createHashMap;\nvar assert = _util.assert;\nvar clone = _util.clone;\nvar merge = _util.merge;\nvar extend = _util.extend;\nvar mixin = _util.mixin;\n\nvar modelUtil = require(\"../util/model\");\n\nvar Model = require(\"./Model\");\n\nvar ComponentModel = require(\"./Component\");\n\nvar globalDefault = require(\"./globalDefault\");\n\nvar colorPaletteMixin = require(\"./mixin/colorPalette\");\n\nvar _sourceHelper = require(\"../data/helper/sourceHelper\");\n\nvar resetSourceDefaulter = _sourceHelper.resetSourceDefaulter;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * ECharts global model\n *\n * @module {echarts/model/Global}\n */\n\n/**\n * Caution: If the mechanism should be changed some day, these cases\n * should be considered:\n *\n * (1) In `merge option` mode, if using the same option to call `setOption`\n * many times, the result should be the same (try our best to ensure that).\n * (2) In `merge option` mode, if a component has no id/name specified, it\n * will be merged by index, and the result sequence of the components is\n * consistent to the original sequence.\n * (3) `reset` feature (in toolbox). Find detailed info in comments about\n * `mergeOption` in module:echarts/model/OptionManager.\n */\nvar OPTION_INNER_KEY = '\\0_ec_inner';\n/**\n * @alias module:echarts/model/Global\n *\n * @param {Object} option\n * @param {module:echarts/model/Model} parentModel\n * @param {Object} theme\n */\n\nvar GlobalModel = Model.extend({\n init: function (option, parentModel, theme, optionManager) {\n theme = theme || {};\n this.option = null; // Mark as not initialized.\n\n /**\n * @type {module:echarts/model/Model}\n * @private\n */\n\n this._theme = new Model(theme);\n /**\n * @type {module:echarts/model/OptionManager}\n */\n\n this._optionManager = optionManager;\n },\n setOption: function (option, optionPreprocessorFuncs) {\n assert(!(OPTION_INNER_KEY in option), 'please use chart.getOption()');\n\n this._optionManager.setOption(option, optionPreprocessorFuncs);\n\n this.resetOption(null);\n },\n\n /**\n * @param {string} type null/undefined: reset all.\n * 'recreate': force recreate all.\n * 'timeline': only reset timeline option\n * 'media': only reset media query option\n * @return {boolean} Whether option changed.\n */\n resetOption: function (type) {\n var optionChanged = false;\n var optionManager = this._optionManager;\n\n if (!type || type === 'recreate') {\n var baseOption = optionManager.mountOption(type === 'recreate');\n\n if (!this.option || type === 'recreate') {\n initBase.call(this, baseOption);\n } else {\n this.restoreData();\n this.mergeOption(baseOption);\n }\n\n optionChanged = true;\n }\n\n if (type === 'timeline' || type === 'media') {\n this.restoreData();\n }\n\n if (!type || type === 'recreate' || type === 'timeline') {\n var timelineOption = optionManager.getTimelineOption(this);\n timelineOption && (this.mergeOption(timelineOption), optionChanged = true);\n }\n\n if (!type || type === 'recreate' || type === 'media') {\n var mediaOptions = optionManager.getMediaOption(this, this._api);\n\n if (mediaOptions.length) {\n each(mediaOptions, function (mediaOption) {\n this.mergeOption(mediaOption, optionChanged = true);\n }, this);\n }\n }\n\n return optionChanged;\n },\n\n /**\n * @protected\n */\n mergeOption: function (newOption) {\n var option = this.option;\n var componentsMap = this._componentsMap;\n var newCptTypes = [];\n resetSourceDefaulter(this); // If no component class, merge directly.\n // For example: color, animaiton options, etc.\n\n each(newOption, function (componentOption, mainType) {\n if (componentOption == null) {\n return;\n }\n\n if (!ComponentModel.hasClass(mainType)) {\n // globalSettingTask.dirty();\n option[mainType] = option[mainType] == null ? clone(componentOption) : merge(option[mainType], componentOption, true);\n } else if (mainType) {\n newCptTypes.push(mainType);\n }\n });\n ComponentModel.topologicalTravel(newCptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this);\n\n function visitComponent(mainType, dependencies) {\n var newCptOptionList = modelUtil.normalizeToArray(newOption[mainType]);\n var mapResult = modelUtil.mappingToExists(componentsMap.get(mainType), newCptOptionList);\n modelUtil.makeIdAndName(mapResult); // Set mainType and complete subType.\n\n each(mapResult, function (item, index) {\n var opt = item.option;\n\n if (isObject(opt)) {\n item.keyInfo.mainType = mainType;\n item.keyInfo.subType = determineSubType(mainType, opt, item.exist);\n }\n });\n var dependentModels = getComponentsByTypes(componentsMap, dependencies);\n option[mainType] = [];\n componentsMap.set(mainType, []);\n each(mapResult, function (resultItem, index) {\n var componentModel = resultItem.exist;\n var newCptOption = resultItem.option;\n assert(isObject(newCptOption) || componentModel, 'Empty component definition'); // Consider where is no new option and should be merged using {},\n // see removeEdgeAndAdd in topologicalTravel and\n // ComponentModel.getAllClassMainTypes.\n\n if (!newCptOption) {\n componentModel.mergeOption({}, this);\n componentModel.optionUpdated({}, false);\n } else {\n var ComponentModelClass = ComponentModel.getClass(mainType, resultItem.keyInfo.subType, true);\n\n if (componentModel && componentModel instanceof ComponentModelClass) {\n componentModel.name = resultItem.keyInfo.name; // componentModel.settingTask && componentModel.settingTask.dirty();\n\n componentModel.mergeOption(newCptOption, this);\n componentModel.optionUpdated(newCptOption, false);\n } else {\n // PENDING Global as parent ?\n var extraOpt = extend({\n dependentModels: dependentModels,\n componentIndex: index\n }, resultItem.keyInfo);\n componentModel = new ComponentModelClass(newCptOption, this, this, extraOpt);\n extend(componentModel, extraOpt);\n componentModel.init(newCptOption, this, this, extraOpt); // Call optionUpdated after init.\n // newCptOption has been used as componentModel.option\n // and may be merged with theme and default, so pass null\n // to avoid confusion.\n\n componentModel.optionUpdated(null, true);\n }\n }\n\n componentsMap.get(mainType)[index] = componentModel;\n option[mainType][index] = componentModel.option;\n }, this); // Backup series for filtering.\n\n if (mainType === 'series') {\n createSeriesIndices(this, componentsMap.get('series'));\n }\n }\n\n this._seriesIndicesMap = createHashMap(this._seriesIndices = this._seriesIndices || []);\n },\n\n /**\n * Get option for output (cloned option and inner info removed)\n * @public\n * @return {Object}\n */\n getOption: function () {\n var option = clone(this.option);\n each(option, function (opts, mainType) {\n if (ComponentModel.hasClass(mainType)) {\n var opts = modelUtil.normalizeToArray(opts);\n\n for (var i = opts.length - 1; i >= 0; i--) {\n // Remove options with inner id.\n if (modelUtil.isIdInner(opts[i])) {\n opts.splice(i, 1);\n }\n }\n\n option[mainType] = opts;\n }\n });\n delete option[OPTION_INNER_KEY];\n return option;\n },\n\n /**\n * @return {module:echarts/model/Model}\n */\n getTheme: function () {\n return this._theme;\n },\n\n /**\n * @param {string} mainType\n * @param {number} [idx=0]\n * @return {module:echarts/model/Component}\n */\n getComponent: function (mainType, idx) {\n var list = this._componentsMap.get(mainType);\n\n if (list) {\n return list[idx || 0];\n }\n },\n\n /**\n * If none of index and id and name used, return all components with mainType.\n * @param {Object} condition\n * @param {string} condition.mainType\n * @param {string} [condition.subType] If ignore, only query by mainType\n * @param {number|Array.} [condition.index] Either input index or id or name.\n * @param {string|Array.} [condition.id] Either input index or id or name.\n * @param {string|Array.} [condition.name] Either input index or id or name.\n * @return {Array.}\n */\n queryComponents: function (condition) {\n var mainType = condition.mainType;\n\n if (!mainType) {\n return [];\n }\n\n var index = condition.index;\n var id = condition.id;\n var name = condition.name;\n\n var cpts = this._componentsMap.get(mainType);\n\n if (!cpts || !cpts.length) {\n return [];\n }\n\n var result;\n\n if (index != null) {\n if (!isArray(index)) {\n index = [index];\n }\n\n result = filter(map(index, function (idx) {\n return cpts[idx];\n }), function (val) {\n return !!val;\n });\n } else if (id != null) {\n var isIdArray = isArray(id);\n result = filter(cpts, function (cpt) {\n return isIdArray && indexOf(id, cpt.id) >= 0 || !isIdArray && cpt.id === id;\n });\n } else if (name != null) {\n var isNameArray = isArray(name);\n result = filter(cpts, function (cpt) {\n return isNameArray && indexOf(name, cpt.name) >= 0 || !isNameArray && cpt.name === name;\n });\n } else {\n // Return all components with mainType\n result = cpts.slice();\n }\n\n return filterBySubType(result, condition);\n },\n\n /**\n * The interface is different from queryComponents,\n * which is convenient for inner usage.\n *\n * @usage\n * var result = findComponents(\n * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}}\n * );\n * var result = findComponents(\n * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}}\n * );\n * var result = findComponents(\n * {mainType: 'series'},\n * function (model, index) {...}\n * );\n * // result like [component0, componnet1, ...]\n *\n * @param {Object} condition\n * @param {string} condition.mainType Mandatory.\n * @param {string} [condition.subType] Optional.\n * @param {Object} [condition.query] like {xxxIndex, xxxId, xxxName},\n * where xxx is mainType.\n * If query attribute is null/undefined or has no index/id/name,\n * do not filtering by query conditions, which is convenient for\n * no-payload situations or when target of action is global.\n * @param {Function} [condition.filter] parameter: component, return boolean.\n * @return {Array.}\n */\n findComponents: function (condition) {\n var query = condition.query;\n var mainType = condition.mainType;\n var queryCond = getQueryCond(query);\n var result = queryCond ? this.queryComponents(queryCond) : this._componentsMap.get(mainType);\n return doFilter(filterBySubType(result, condition));\n\n function getQueryCond(q) {\n var indexAttr = mainType + 'Index';\n var idAttr = mainType + 'Id';\n var nameAttr = mainType + 'Name';\n return q && (q[indexAttr] != null || q[idAttr] != null || q[nameAttr] != null) ? {\n mainType: mainType,\n // subType will be filtered finally.\n index: q[indexAttr],\n id: q[idAttr],\n name: q[nameAttr]\n } : null;\n }\n\n function doFilter(res) {\n return condition.filter ? filter(res, condition.filter) : res;\n }\n },\n\n /**\n * @usage\n * eachComponent('legend', function (legendModel, index) {\n * ...\n * });\n * eachComponent(function (componentType, model, index) {\n * // componentType does not include subType\n * // (componentType is 'xxx' but not 'xxx.aa')\n * });\n * eachComponent(\n * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}},\n * function (model, index) {...}\n * );\n * eachComponent(\n * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}},\n * function (model, index) {...}\n * );\n *\n * @param {string|Object=} mainType When mainType is object, the definition\n * is the same as the method 'findComponents'.\n * @param {Function} cb\n * @param {*} context\n */\n eachComponent: function (mainType, cb, context) {\n var componentsMap = this._componentsMap;\n\n if (typeof mainType === 'function') {\n context = cb;\n cb = mainType;\n componentsMap.each(function (components, componentType) {\n each(components, function (component, index) {\n cb.call(context, componentType, component, index);\n });\n });\n } else if (isString(mainType)) {\n each(componentsMap.get(mainType), cb, context);\n } else if (isObject(mainType)) {\n var queryResult = this.findComponents(mainType);\n each(queryResult, cb, context);\n }\n },\n\n /**\n * @param {string} name\n * @return {Array.}\n */\n getSeriesByName: function (name) {\n var series = this._componentsMap.get('series');\n\n return filter(series, function (oneSeries) {\n return oneSeries.name === name;\n });\n },\n\n /**\n * @param {number} seriesIndex\n * @return {module:echarts/model/Series}\n */\n getSeriesByIndex: function (seriesIndex) {\n return this._componentsMap.get('series')[seriesIndex];\n },\n\n /**\n * Get series list before filtered by type.\n * FIXME: rename to getRawSeriesByType?\n *\n * @param {string} subType\n * @return {Array.}\n */\n getSeriesByType: function (subType) {\n var series = this._componentsMap.get('series');\n\n return filter(series, function (oneSeries) {\n return oneSeries.subType === subType;\n });\n },\n\n /**\n * @return {Array.}\n */\n getSeries: function () {\n return this._componentsMap.get('series').slice();\n },\n\n /**\n * @return {number}\n */\n getSeriesCount: function () {\n return this._componentsMap.get('series').length;\n },\n\n /**\n * After filtering, series may be different\n * frome raw series.\n *\n * @param {Function} cb\n * @param {*} context\n */\n eachSeries: function (cb, context) {\n assertSeriesInitialized(this);\n each(this._seriesIndices, function (rawSeriesIndex) {\n var series = this._componentsMap.get('series')[rawSeriesIndex];\n\n cb.call(context, series, rawSeriesIndex);\n }, this);\n },\n\n /**\n * Iterate raw series before filtered.\n *\n * @param {Function} cb\n * @param {*} context\n */\n eachRawSeries: function (cb, context) {\n each(this._componentsMap.get('series'), cb, context);\n },\n\n /**\n * After filtering, series may be different.\n * frome raw series.\n *\n * @parma {string} subType\n * @param {Function} cb\n * @param {*} context\n */\n eachSeriesByType: function (subType, cb, context) {\n assertSeriesInitialized(this);\n each(this._seriesIndices, function (rawSeriesIndex) {\n var series = this._componentsMap.get('series')[rawSeriesIndex];\n\n if (series.subType === subType) {\n cb.call(context, series, rawSeriesIndex);\n }\n }, this);\n },\n\n /**\n * Iterate raw series before filtered of given type.\n *\n * @parma {string} subType\n * @param {Function} cb\n * @param {*} context\n */\n eachRawSeriesByType: function (subType, cb, context) {\n return each(this.getSeriesByType(subType), cb, context);\n },\n\n /**\n * @param {module:echarts/model/Series} seriesModel\n */\n isSeriesFiltered: function (seriesModel) {\n assertSeriesInitialized(this);\n return this._seriesIndicesMap.get(seriesModel.componentIndex) == null;\n },\n\n /**\n * @return {Array.}\n */\n getCurrentSeriesIndices: function () {\n return (this._seriesIndices || []).slice();\n },\n\n /**\n * @param {Function} cb\n * @param {*} context\n */\n filterSeries: function (cb, context) {\n assertSeriesInitialized(this);\n var filteredSeries = filter(this._componentsMap.get('series'), cb, context);\n createSeriesIndices(this, filteredSeries);\n },\n restoreData: function (payload) {\n var componentsMap = this._componentsMap;\n createSeriesIndices(this, componentsMap.get('series'));\n var componentTypes = [];\n componentsMap.each(function (components, componentType) {\n componentTypes.push(componentType);\n });\n ComponentModel.topologicalTravel(componentTypes, ComponentModel.getAllClassMainTypes(), function (componentType, dependencies) {\n each(componentsMap.get(componentType), function (component) {\n (componentType !== 'series' || !isNotTargetSeries(component, payload)) && component.restoreData();\n });\n });\n }\n});\n\nfunction isNotTargetSeries(seriesModel, payload) {\n if (payload) {\n var index = payload.seiresIndex;\n var id = payload.seriesId;\n var name = payload.seriesName;\n return index != null && seriesModel.componentIndex !== index || id != null && seriesModel.id !== id || name != null && seriesModel.name !== name;\n }\n}\n/**\n * @inner\n */\n\n\nfunction mergeTheme(option, theme) {\n // PENDING\n // NOT use `colorLayer` in theme if option has `color`\n var notMergeColorLayer = option.color && !option.colorLayer;\n each(theme, function (themeItem, name) {\n if (name === 'colorLayer' && notMergeColorLayer) {\n return;\n } // 如果有 component model 则把具体的 merge 逻辑交给该 model 处理\n\n\n if (!ComponentModel.hasClass(name)) {\n if (typeof themeItem === 'object') {\n option[name] = !option[name] ? clone(themeItem) : merge(option[name], themeItem, false);\n } else {\n if (option[name] == null) {\n option[name] = themeItem;\n }\n }\n }\n });\n}\n\nfunction initBase(baseOption) {\n baseOption = baseOption; // Using OPTION_INNER_KEY to mark that this option can not be used outside,\n // i.e. `chart.setOption(chart.getModel().option);` is forbiden.\n\n this.option = {};\n this.option[OPTION_INNER_KEY] = 1;\n /**\n * Init with series: [], in case of calling findSeries method\n * before series initialized.\n * @type {Object.>}\n * @private\n */\n\n this._componentsMap = createHashMap({\n series: []\n });\n /**\n * Mapping between filtered series list and raw series list.\n * key: filtered series indices, value: raw series indices.\n * @type {Array.}\n * @private\n */\n\n this._seriesIndices;\n this._seriesIndicesMap;\n mergeTheme(baseOption, this._theme.option); // TODO Needs clone when merging to the unexisted property\n\n merge(baseOption, globalDefault, false);\n this.mergeOption(baseOption);\n}\n/**\n * @inner\n * @param {Array.|string} types model types\n * @return {Object} key: {string} type, value: {Array.} models\n */\n\n\nfunction getComponentsByTypes(componentsMap, types) {\n if (!isArray(types)) {\n types = types ? [types] : [];\n }\n\n var ret = {};\n each(types, function (type) {\n ret[type] = (componentsMap.get(type) || []).slice();\n });\n return ret;\n}\n/**\n * @inner\n */\n\n\nfunction determineSubType(mainType, newCptOption, existComponent) {\n var subType = newCptOption.type ? newCptOption.type : existComponent ? existComponent.subType // Use determineSubType only when there is no existComponent.\n : ComponentModel.determineSubType(mainType, newCptOption); // tooltip, markline, markpoint may always has no subType\n\n return subType;\n}\n/**\n * @inner\n */\n\n\nfunction createSeriesIndices(ecModel, seriesModels) {\n ecModel._seriesIndicesMap = createHashMap(ecModel._seriesIndices = map(seriesModels, function (series) {\n return series.componentIndex;\n }) || []);\n}\n/**\n * @inner\n */\n\n\nfunction filterBySubType(components, condition) {\n // Using hasOwnProperty for restrict. Consider\n // subType is undefined in user payload.\n return condition.hasOwnProperty('subType') ? filter(components, function (cpt) {\n return cpt.subType === condition.subType;\n }) : components;\n}\n/**\n * @inner\n */\n\n\nfunction assertSeriesInitialized(ecModel) {}\n\nmixin(GlobalModel, colorPaletteMixin);\nvar _default = GlobalModel;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/model/Global.js\n// module id = 148\n// module chunks = 39","var Path = require(\"../graphic/Path\");\n\nvar PathProxy = require(\"../core/PathProxy\");\n\nvar transformPath = require(\"./transformPath\");\n\n// command chars\n// var cc = [\n// 'm', 'M', 'l', 'L', 'v', 'V', 'h', 'H', 'z', 'Z',\n// 'c', 'C', 'q', 'Q', 't', 'T', 's', 'S', 'a', 'A'\n// ];\nvar mathSqrt = Math.sqrt;\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar PI = Math.PI;\n\nvar vMag = function (v) {\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\n};\n\nvar vRatio = function (u, v) {\n return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\n};\n\nvar vAngle = function (u, v) {\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v));\n};\n\nfunction processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) {\n var psi = psiDeg * (PI / 180.0);\n var xp = mathCos(psi) * (x1 - x2) / 2.0 + mathSin(psi) * (y1 - y2) / 2.0;\n var yp = -1 * mathSin(psi) * (x1 - x2) / 2.0 + mathCos(psi) * (y1 - y2) / 2.0;\n var lambda = xp * xp / (rx * rx) + yp * yp / (ry * ry);\n\n if (lambda > 1) {\n rx *= mathSqrt(lambda);\n ry *= mathSqrt(lambda);\n }\n\n var f = (fa === fs ? -1 : 1) * mathSqrt((rx * rx * (ry * ry) - rx * rx * (yp * yp) - ry * ry * (xp * xp)) / (rx * rx * (yp * yp) + ry * ry * (xp * xp))) || 0;\n var cxp = f * rx * yp / ry;\n var cyp = f * -ry * xp / rx;\n var cx = (x1 + x2) / 2.0 + mathCos(psi) * cxp - mathSin(psi) * cyp;\n var cy = (y1 + y2) / 2.0 + mathSin(psi) * cxp + mathCos(psi) * cyp;\n var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);\n var u = [(xp - cxp) / rx, (yp - cyp) / ry];\n var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\n var dTheta = vAngle(u, v);\n\n if (vRatio(u, v) <= -1) {\n dTheta = PI;\n }\n\n if (vRatio(u, v) >= 1) {\n dTheta = 0;\n }\n\n if (fs === 0 && dTheta > 0) {\n dTheta = dTheta - 2 * PI;\n }\n\n if (fs === 1 && dTheta < 0) {\n dTheta = dTheta + 2 * PI;\n }\n\n path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs);\n}\n\nvar commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig; // Consider case:\n// (1) delimiter can be comma or space, where continuous commas\n// or spaces should be seen as one comma.\n// (2) value can be like:\n// '2e-4', 'l.5.9' (ignore 0), 'M-10-10', 'l-2.43e-1,34.9983',\n// 'l-.5E1,54', '121-23-44-11' (no delimiter)\n\nvar numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g; // var valueSplitReg = /[\\s,]+/;\n\nfunction createPathProxyFromString(data) {\n if (!data) {\n return new PathProxy();\n } // var data = data.replace(/-/g, ' -')\n // .replace(/ /g, ' ')\n // .replace(/ /g, ',')\n // .replace(/,,/g, ',');\n // var n;\n // create pipes so that we can split the data\n // for (n = 0; n < cc.length; n++) {\n // cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]);\n // }\n // data = data.replace(/-/g, ',-');\n // create array\n // var arr = cs.split('|');\n // init context point\n\n\n var cpx = 0;\n var cpy = 0;\n var subpathX = cpx;\n var subpathY = cpy;\n var prevCmd;\n var path = new PathProxy();\n var CMD = PathProxy.CMD; // commandReg.lastIndex = 0;\n // var cmdResult;\n // while ((cmdResult = commandReg.exec(data)) != null) {\n // var cmdStr = cmdResult[1];\n // var cmdContent = cmdResult[2];\n\n var cmdList = data.match(commandReg);\n\n for (var l = 0; l < cmdList.length; l++) {\n var cmdText = cmdList[l];\n var cmdStr = cmdText.charAt(0);\n var cmd; // String#split is faster a little bit than String#replace or RegExp#exec.\n // var p = cmdContent.split(valueSplitReg);\n // var pLen = 0;\n // for (var i = 0; i < p.length; i++) {\n // // '' and other invalid str => NaN\n // var val = parseFloat(p[i]);\n // !isNaN(val) && (p[pLen++] = val);\n // }\n\n var p = cmdText.match(numberReg) || [];\n var pLen = p.length;\n\n for (var i = 0; i < pLen; i++) {\n p[i] = parseFloat(p[i]);\n }\n\n var off = 0;\n\n while (off < pLen) {\n var ctlPtx;\n var ctlPty;\n var rx;\n var ry;\n var psi;\n var fa;\n var fs;\n var x1 = cpx;\n var y1 = cpy; // convert l, H, h, V, and v to L\n\n switch (cmdStr) {\n case 'l':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'L':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'm':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'l';\n break;\n\n case 'M':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'L';\n break;\n\n case 'h':\n cpx += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'H':\n cpx = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'v':\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'V':\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'C':\n cmd = CMD.C;\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\n cpx = p[off - 2];\n cpy = p[off - 1];\n break;\n\n case 'c':\n cmd = CMD.C;\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\n cpx += p[off - 2];\n cpy += p[off - 1];\n break;\n\n case 'S':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 's':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = cpx + p[off++];\n y1 = cpy + p[off++];\n cpx += p[off++];\n cpy += p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 'Q':\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'q':\n x1 = p[off++] + cpx;\n y1 = p[off++] + cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'T':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 't':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 'A':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n\n case 'a':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n }\n }\n\n if (cmdStr === 'z' || cmdStr === 'Z') {\n cmd = CMD.Z;\n path.addData(cmd); // z may be in the middle of the path.\n\n cpx = subpathX;\n cpy = subpathY;\n }\n\n prevCmd = cmd;\n }\n\n path.toStatic();\n return path;\n} // TODO Optimize double memory cost problem\n\n\nfunction createPathOptions(str, opts) {\n var pathProxy = createPathProxyFromString(str);\n opts = opts || {};\n\n opts.buildPath = function (path) {\n if (path.setData) {\n path.setData(pathProxy.data); // Svg and vml renderer don't have context\n\n var ctx = path.getContext();\n\n if (ctx) {\n path.rebuildPath(ctx);\n }\n } else {\n var ctx = path;\n pathProxy.rebuildPath(ctx);\n }\n };\n\n opts.applyTransform = function (m) {\n transformPath(pathProxy, m);\n this.dirty(true);\n };\n\n return opts;\n}\n/**\n * Create a Path object from path string data\n * http://www.w3.org/TR/SVG/paths.html#PathData\n * @param {Object} opts Other options\n */\n\n\nfunction createFromString(str, opts) {\n return new Path(createPathOptions(str, opts));\n}\n/**\n * Create a Path class from path string data\n * @param {string} str\n * @param {Object} opts Other options\n */\n\n\nfunction extendFromString(str, opts) {\n return Path.extend(createPathOptions(str, opts));\n}\n/**\n * Merge multiple paths\n */\n// TODO Apply transform\n// TODO stroke dash\n// TODO Optimize double memory cost problem\n\n\nfunction mergePath(pathEls, opts) {\n var pathList = [];\n var len = pathEls.length;\n\n for (var i = 0; i < len; i++) {\n var pathEl = pathEls[i];\n\n if (!pathEl.path) {\n pathEl.createPathProxy();\n }\n\n if (pathEl.__dirtyPath) {\n pathEl.buildPath(pathEl.path, pathEl.shape, true);\n }\n\n pathList.push(pathEl.path);\n }\n\n var pathBundle = new Path(opts); // Need path proxy.\n\n pathBundle.createPathProxy();\n\n pathBundle.buildPath = function (path) {\n path.appendPath(pathList); // Svg and vml renderer don't have context\n\n var ctx = path.getContext();\n\n if (ctx) {\n path.rebuildPath(ctx);\n }\n };\n\n return pathBundle;\n}\n\nexports.createFromString = createFromString;\nexports.extendFromString = extendFromString;\nexports.mergePath = mergePath;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/tool/path.js\n// module id = 149\n// module chunks = 39","/**\n * 线段包含判断\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {number} lineWidth\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\nfunction containStroke(x0, y0, x1, y1, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n\n var _l = lineWidth;\n var _a = 0;\n var _b = x0; // Quick reject\n\n if (y > y0 + _l && y > y1 + _l || y < y0 - _l && y < y1 - _l || x > x0 + _l && x > x1 + _l || x < x0 - _l && x < x1 - _l) {\n return false;\n }\n\n if (x0 !== x1) {\n _a = (y0 - y1) / (x0 - x1);\n _b = (x0 * y1 - x1 * y0) / (x0 - x1);\n } else {\n return Math.abs(x - x0) <= _l / 2;\n }\n\n var tmp = _a * x - y + _b;\n\n var _s = tmp * tmp / (_a * _a + 1);\n\n return _s <= _l / 2 * _l / 2;\n}\n\nexports.containStroke = containStroke;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/contain/line.js\n// module id = 150\n// module chunks = 39","var _curve = require(\"../core/curve\");\n\nvar quadraticProjectPoint = _curve.quadraticProjectPoint;\n\n/**\n * 二次贝塞尔曲线描边包含判断\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @param {number} lineWidth\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\nfunction containStroke(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n\n var _l = lineWidth; // Quick reject\n\n if (y > y0 + _l && y > y1 + _l && y > y2 + _l || y < y0 - _l && y < y1 - _l && y < y2 - _l || x > x0 + _l && x > x1 + _l && x > x2 + _l || x < x0 - _l && x < x1 - _l && x < x2 - _l) {\n return false;\n }\n\n var d = quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);\n return d <= _l / 2;\n}\n\nexports.containStroke = containStroke;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/contain/quadratic.js\n// module id = 151\n// module chunks = 39","var PI2 = Math.PI * 2;\n\nfunction normalizeRadian(angle) {\n angle %= PI2;\n\n if (angle < 0) {\n angle += PI2;\n }\n\n return angle;\n}\n\nexports.normalizeRadian = normalizeRadian;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/contain/util.js\n// module id = 152\n// module chunks = 39","function windingLine(x0, y0, x1, y1, x, y) {\n if (y > y0 && y > y1 || y < y0 && y < y1) {\n return 0;\n } // Ignore horizontal line\n\n\n if (y1 === y0) {\n return 0;\n }\n\n var dir = y1 < y0 ? 1 : -1;\n var t = (y - y0) / (y1 - y0); // Avoid winding error when intersection point is the connect point of two line of polygon\n\n if (t === 1 || t === 0) {\n dir = y1 < y0 ? 0.5 : -0.5;\n }\n\n var x_ = t * (x1 - x0) + x0; // If (x, y) on the line, considered as \"contain\".\n\n return x_ === x ? Infinity : x_ > x ? dir : 0;\n}\n\nmodule.exports = windingLine;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/contain/windingLine.js\n// module id = 153\n// module chunks = 39","var Path = require(\"../Path\");\n\n/**\n * 圆形\n * @module zrender/shape/Circle\n */\nvar _default = Path.extend({\n type: 'circle',\n shape: {\n cx: 0,\n cy: 0,\n r: 0\n },\n buildPath: function (ctx, shape, inBundle) {\n // Better stroking in ShapeBundle\n // Always do it may have performence issue ( fill may be 2x more cost)\n if (inBundle) {\n ctx.moveTo(shape.cx + shape.r, shape.cy);\n } // else {\n // if (ctx.allocate && !ctx.data.length) {\n // ctx.allocate(ctx.CMD_MEM_SIZE.A);\n // }\n // }\n // Better stroking in ShapeBundle\n // ctx.moveTo(shape.cx + shape.r, shape.cy);\n\n\n ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2, true);\n }\n});\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/shape/Circle.js\n// module id = 154\n// module chunks = 39","var env = require(\"../../core/env\");\n\n// Fix weird bug in some version of IE11 (like 11.0.9600.178**),\n// where exception \"unexpected call to method or property access\"\n// might be thrown when calling ctx.fill or ctx.stroke after a path\n// whose area size is zero is drawn and ctx.clip() is called and\n// shadowBlur is set. See #4572, #3112, #5777.\n// (e.g.,\n// ctx.moveTo(10, 10);\n// ctx.lineTo(20, 10);\n// ctx.closePath();\n// ctx.clip();\n// ctx.shadowBlur = 10;\n// ...\n// ctx.fill();\n// )\nvar shadowTemp = [['shadowBlur', 0], ['shadowColor', '#000'], ['shadowOffsetX', 0], ['shadowOffsetY', 0]];\n\nfunction _default(orignalBrush) {\n // version string can be: '11.0'\n return env.browser.ie && env.browser.version >= 11 ? function () {\n var clipPaths = this.__clipPaths;\n var style = this.style;\n var modified;\n\n if (clipPaths) {\n for (var i = 0; i < clipPaths.length; i++) {\n var clipPath = clipPaths[i];\n var shape = clipPath && clipPath.shape;\n var type = clipPath && clipPath.type;\n\n if (shape && (type === 'sector' && shape.startAngle === shape.endAngle || type === 'rect' && (!shape.width || !shape.height))) {\n for (var j = 0; j < shadowTemp.length; j++) {\n // It is save to put shadowTemp static, because shadowTemp\n // will be all modified each item brush called.\n shadowTemp[j][2] = style[shadowTemp[j][0]];\n style[shadowTemp[j][0]] = shadowTemp[j][1];\n }\n\n modified = true;\n break;\n }\n }\n }\n\n orignalBrush.apply(this, arguments);\n\n if (modified) {\n for (var j = 0; j < shadowTemp.length; j++) {\n style[shadowTemp[j][0]] = shadowTemp[j][2];\n }\n }\n } : orignalBrush;\n}\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/helper/fixClipWithShadow.js\n// module id = 155\n// module chunks = 39","var Path = require(\"../Path\");\n\nvar polyHelper = require(\"../helper/poly\");\n\n/**\n * 多边形\n * @module zrender/shape/Polygon\n */\nvar _default = Path.extend({\n type: 'polygon',\n shape: {\n points: null,\n smooth: false,\n smoothConstraint: null\n },\n buildPath: function (ctx, shape) {\n polyHelper.buildPath(ctx, shape, true);\n }\n});\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/shape/Polygon.js\n// module id = 156\n// module chunks = 39","var smoothSpline = require(\"./smoothSpline\");\n\nvar smoothBezier = require(\"./smoothBezier\");\n\nfunction buildPath(ctx, shape, closePath) {\n var points = shape.points;\n var smooth = shape.smooth;\n\n if (points && points.length >= 2) {\n if (smooth && smooth !== 'spline') {\n var controlPoints = smoothBezier(points, smooth, closePath, shape.smoothConstraint);\n ctx.moveTo(points[0][0], points[0][1]);\n var len = points.length;\n\n for (var i = 0; i < (closePath ? len : len - 1); i++) {\n var cp1 = controlPoints[i * 2];\n var cp2 = controlPoints[i * 2 + 1];\n var p = points[(i + 1) % len];\n ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);\n }\n } else {\n if (smooth === 'spline') {\n points = smoothSpline(points, closePath);\n }\n\n ctx.moveTo(points[0][0], points[0][1]);\n\n for (var i = 1, l = points.length; i < l; i++) {\n ctx.lineTo(points[i][0], points[i][1]);\n }\n }\n\n closePath && ctx.closePath();\n }\n}\n\nexports.buildPath = buildPath;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/helper/poly.js\n// module id = 157\n// module chunks = 39","var Path = require(\"../Path\");\n\nvar polyHelper = require(\"../helper/poly\");\n\n/**\n * @module zrender/graphic/shape/Polyline\n */\nvar _default = Path.extend({\n type: 'polyline',\n shape: {\n points: null,\n smooth: false,\n smoothConstraint: null\n },\n style: {\n stroke: '#000',\n fill: null\n },\n buildPath: function (ctx, shape) {\n polyHelper.buildPath(ctx, shape, false);\n }\n});\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/shape/Polyline.js\n// module id = 158\n// module chunks = 39","/**\n * Sub-pixel optimize for canvas rendering, prevent from blur\n * when rendering a thin vertical/horizontal line.\n */\nvar round = Math.round;\n/**\n * Sub pixel optimize line for canvas\n *\n * @param {Object} outputShape The modification will be performed on `outputShape`.\n * `outputShape` and `inputShape` can be the same object.\n * `outputShape` object can be used repeatly, because all of\n * the `x1`, `x2`, `y1`, `y2` will be assigned in this method.\n * @param {Object} [inputShape]\n * @param {number} [inputShape.x1]\n * @param {number} [inputShape.y1]\n * @param {number} [inputShape.x2]\n * @param {number} [inputShape.y2]\n * @param {Object} [style]\n * @param {number} [style.lineWidth]\n */\n\nfunction subPixelOptimizeLine(outputShape, inputShape, style) {\n var lineWidth = style && style.lineWidth;\n\n if (!inputShape || !lineWidth) {\n return;\n }\n\n var x1 = inputShape.x1;\n var x2 = inputShape.x2;\n var y1 = inputShape.y1;\n var y2 = inputShape.y2;\n\n if (round(x1 * 2) === round(x2 * 2)) {\n outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\n } else {\n outputShape.x1 = x1;\n outputShape.x2 = x2;\n }\n\n if (round(y1 * 2) === round(y2 * 2)) {\n outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\n } else {\n outputShape.y1 = y1;\n outputShape.y2 = y2;\n }\n}\n/**\n * Sub pixel optimize rect for canvas\n *\n * @param {Object} outputShape The modification will be performed on `outputShape`.\n * `outputShape` and `inputShape` can be the same object.\n * `outputShape` object can be used repeatly, because all of\n * the `x`, `y`, `width`, `height` will be assigned in this method.\n * @param {Object} [inputShape]\n * @param {number} [inputShape.x]\n * @param {number} [inputShape.y]\n * @param {number} [inputShape.width]\n * @param {number} [inputShape.height]\n * @param {Object} [style]\n * @param {number} [style.lineWidth]\n */\n\n\nfunction subPixelOptimizeRect(outputShape, inputShape, style) {\n var lineWidth = style && style.lineWidth;\n\n if (!inputShape || !lineWidth) {\n return;\n }\n\n var originX = inputShape.x;\n var originY = inputShape.y;\n var originWidth = inputShape.width;\n var originHeight = inputShape.height;\n outputShape.x = subPixelOptimize(originX, lineWidth, true);\n outputShape.y = subPixelOptimize(originY, lineWidth, true);\n outputShape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - outputShape.x, originWidth === 0 ? 0 : 1);\n outputShape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - outputShape.y, originHeight === 0 ? 0 : 1);\n}\n/**\n * Sub pixel optimize for canvas\n *\n * @param {number} position Coordinate, such as x, y\n * @param {number} lineWidth Should be nonnegative integer.\n * @param {boolean=} positiveOrNegative Default false (negative).\n * @return {number} Optimized position.\n */\n\n\nfunction subPixelOptimize(position, lineWidth, positiveOrNegative) {\n // Assure that (position + lineWidth / 2) is near integer edge,\n // otherwise line will be fuzzy in canvas.\n var doubledPosition = round(position * 2);\n return (doubledPosition + round(lineWidth)) % 2 === 0 ? doubledPosition / 2 : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\n}\n\nexports.subPixelOptimizeLine = subPixelOptimizeLine;\nexports.subPixelOptimizeRect = subPixelOptimizeRect;\nexports.subPixelOptimize = subPixelOptimize;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js\n// module id = 159\n// module chunks = 39","var Path = require(\"../Path\");\n\nvar _subPixelOptimize = require(\"../helper/subPixelOptimize\");\n\nvar subPixelOptimizeLine = _subPixelOptimize.subPixelOptimizeLine;\n\n/**\n * 直线\n * @module zrender/graphic/shape/Line\n */\n// Avoid create repeatly.\nvar subPixelOptimizeOutputShape = {};\n\nvar _default = Path.extend({\n type: 'line',\n shape: {\n // Start point\n x1: 0,\n y1: 0,\n // End point\n x2: 0,\n y2: 0,\n percent: 1\n },\n style: {\n stroke: '#000',\n fill: null\n },\n buildPath: function (ctx, shape) {\n var x1;\n var y1;\n var x2;\n var y2;\n\n if (this.subPixelOptimize) {\n subPixelOptimizeLine(subPixelOptimizeOutputShape, shape, this.style);\n x1 = subPixelOptimizeOutputShape.x1;\n y1 = subPixelOptimizeOutputShape.y1;\n x2 = subPixelOptimizeOutputShape.x2;\n y2 = subPixelOptimizeOutputShape.y2;\n } else {\n x1 = shape.x1;\n y1 = shape.y1;\n x2 = shape.x2;\n y2 = shape.y2;\n }\n\n var percent = shape.percent;\n\n if (percent === 0) {\n return;\n }\n\n ctx.moveTo(x1, y1);\n\n if (percent < 1) {\n x2 = x1 * (1 - percent) + x2 * percent;\n y2 = y1 * (1 - percent) + y2 * percent;\n }\n\n ctx.lineTo(x2, y2);\n },\n\n /**\n * Get point at percent\n * @param {number} percent\n * @return {Array.}\n */\n pointAt: function (p) {\n var shape = this.shape;\n return [shape.x1 * (1 - p) + shape.x2 * p, shape.y1 * (1 - p) + shape.y2 * p];\n }\n});\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/graphic/shape/Line.js\n// module id = 160\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _model = require(\"../../util/model\");\n\nvar makeInner = _model.makeInner;\nvar normalizeToArray = _model.normalizeToArray;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar inner = makeInner();\n\nfunction getNearestColorPalette(colors, requestColorNum) {\n var paletteNum = colors.length; // TODO colors must be in order\n\n for (var i = 0; i < paletteNum; i++) {\n if (colors[i].length > requestColorNum) {\n return colors[i];\n }\n }\n\n return colors[paletteNum - 1];\n}\n\nvar _default = {\n clearColorPalette: function () {\n inner(this).colorIdx = 0;\n inner(this).colorNameMap = {};\n },\n\n /**\n * @param {string} name MUST NOT be null/undefined. Otherwise call this function\n * twise with the same parameters will get different result.\n * @param {Object} [scope=this]\n * @param {Object} [requestColorNum]\n * @return {string} color string.\n */\n getColorFromPalette: function (name, scope, requestColorNum) {\n scope = scope || this;\n var scopeFields = inner(scope);\n var colorIdx = scopeFields.colorIdx || 0;\n var colorNameMap = scopeFields.colorNameMap = scopeFields.colorNameMap || {}; // Use `hasOwnProperty` to avoid conflict with Object.prototype.\n\n if (colorNameMap.hasOwnProperty(name)) {\n return colorNameMap[name];\n }\n\n var defaultColorPalette = normalizeToArray(this.get('color', true));\n var layeredColorPalette = this.get('colorLayer', true);\n var colorPalette = requestColorNum == null || !layeredColorPalette ? defaultColorPalette : getNearestColorPalette(layeredColorPalette, requestColorNum); // In case can't find in layered color palette.\n\n colorPalette = colorPalette || defaultColorPalette;\n\n if (!colorPalette || !colorPalette.length) {\n return;\n }\n\n var color = colorPalette[colorIdx];\n\n if (name) {\n colorNameMap[name] = color;\n }\n\n scopeFields.colorIdx = (colorIdx + 1) % colorPalette.length;\n return color;\n }\n};\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/model/mixin/colorPalette.js\n// module id = 161\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _config = require(\"../config\");\n\nvar __DEV__ = _config.__DEV__;\n\nvar _util = require(\"zrender/lib/core/util\");\n\nvar createHashMap = _util.createHashMap;\nvar retrieve = _util.retrieve;\nvar each = _util.each;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Helper for model references.\n * There are many manners to refer axis/coordSys.\n */\n// TODO\n// merge relevant logic to this file?\n// check: \"modelHelper\" of tooltip and \"BrushTargetManager\".\n\n/**\n * @return {Object} For example:\n * {\n * coordSysName: 'cartesian2d',\n * coordSysDims: ['x', 'y', ...],\n * axisMap: HashMap({\n * x: xAxisModel,\n * y: yAxisModel\n * }),\n * categoryAxisMap: HashMap({\n * x: xAxisModel,\n * y: undefined\n * }),\n * // It also indicate that whether there is category axis.\n * firstCategoryDimIndex: 1,\n * // To replace user specified encode.\n * }\n */\nfunction getCoordSysDefineBySeries(seriesModel) {\n var coordSysName = seriesModel.get('coordinateSystem');\n var result = {\n coordSysName: coordSysName,\n coordSysDims: [],\n axisMap: createHashMap(),\n categoryAxisMap: createHashMap()\n };\n var fetch = fetchers[coordSysName];\n\n if (fetch) {\n fetch(seriesModel, result, result.axisMap, result.categoryAxisMap);\n return result;\n }\n}\n\nvar fetchers = {\n cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) {\n var xAxisModel = seriesModel.getReferringComponents('xAxis')[0];\n var yAxisModel = seriesModel.getReferringComponents('yAxis')[0];\n result.coordSysDims = ['x', 'y'];\n axisMap.set('x', xAxisModel);\n axisMap.set('y', yAxisModel);\n\n if (isCategory(xAxisModel)) {\n categoryAxisMap.set('x', xAxisModel);\n result.firstCategoryDimIndex = 0;\n }\n\n if (isCategory(yAxisModel)) {\n categoryAxisMap.set('y', yAxisModel);\n result.firstCategoryDimIndex = 1;\n }\n },\n singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) {\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis')[0];\n result.coordSysDims = ['single'];\n axisMap.set('single', singleAxisModel);\n\n if (isCategory(singleAxisModel)) {\n categoryAxisMap.set('single', singleAxisModel);\n result.firstCategoryDimIndex = 0;\n }\n },\n polar: function (seriesModel, result, axisMap, categoryAxisMap) {\n var polarModel = seriesModel.getReferringComponents('polar')[0];\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\n result.coordSysDims = ['radius', 'angle'];\n axisMap.set('radius', radiusAxisModel);\n axisMap.set('angle', angleAxisModel);\n\n if (isCategory(radiusAxisModel)) {\n categoryAxisMap.set('radius', radiusAxisModel);\n result.firstCategoryDimIndex = 0;\n }\n\n if (isCategory(angleAxisModel)) {\n categoryAxisMap.set('angle', angleAxisModel);\n result.firstCategoryDimIndex = 1;\n }\n },\n geo: function (seriesModel, result, axisMap, categoryAxisMap) {\n result.coordSysDims = ['lng', 'lat'];\n },\n parallel: function (seriesModel, result, axisMap, categoryAxisMap) {\n var ecModel = seriesModel.ecModel;\n var parallelModel = ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\n var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice();\n each(parallelModel.parallelAxisIndex, function (axisIndex, index) {\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\n var axisDim = coordSysDims[index];\n axisMap.set(axisDim, axisModel);\n\n if (isCategory(axisModel) && result.firstCategoryDimIndex == null) {\n categoryAxisMap.set(axisDim, axisModel);\n result.firstCategoryDimIndex = index;\n }\n });\n }\n};\n\nfunction isCategory(axisModel) {\n return axisModel.get('type') === 'category';\n}\n\nexports.getCoordSysDefineBySeries = getCoordSysDefineBySeries;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/model/referHelper.js\n// module id = 162\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar echartsAPIList = ['getDom', 'getZr', 'getWidth', 'getHeight', 'getDevicePixelRatio', 'dispatchAction', 'isDisposed', 'on', 'off', 'getDataURL', 'getConnectedDataURL', 'getModel', 'getOption', 'getViewOfComponentModel', 'getViewOfSeriesModel']; // And `getCoordinateSystems` and `getComponentByElement` will be injected in echarts.js\n\nfunction ExtensionAPI(chartInstance) {\n zrUtil.each(echartsAPIList, function (name) {\n this[name] = zrUtil.bind(chartInstance[name], chartInstance);\n }, this);\n}\n\nvar _default = ExtensionAPI;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/ExtensionAPI.js\n// module id = 163\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar ComponentModel = require(\"../model/Component\");\n\nvar ComponentView = require(\"../view/Component\");\n\nvar _sourceHelper = require(\"../data/helper/sourceHelper\");\n\nvar detectSourceFormat = _sourceHelper.detectSourceFormat;\n\nvar _sourceType = require(\"../data/helper/sourceType\");\n\nvar SERIES_LAYOUT_BY_COLUMN = _sourceType.SERIES_LAYOUT_BY_COLUMN;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * This module is imported by echarts directly.\n *\n * Notice:\n * Always keep this file exists for backward compatibility.\n * Because before 4.1.0, dataset is an optional component,\n * some users may import this module manually.\n */\nComponentModel.extend({\n type: 'dataset',\n\n /**\n * @protected\n */\n defaultOption: {\n // 'row', 'column'\n seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN,\n // null/'auto': auto detect header, see \"module:echarts/data/helper/sourceHelper\"\n sourceHeader: null,\n dimensions: null,\n source: null\n },\n optionUpdated: function () {\n detectSourceFormat(this);\n }\n});\nComponentView.extend({\n type: 'dataset'\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/dataset.js\n// module id = 164\n// module chunks = 39","var Group = require(\"../container/Group\");\n\nvar ZImage = require(\"../graphic/Image\");\n\nvar Text = require(\"../graphic/Text\");\n\nvar Circle = require(\"../graphic/shape/Circle\");\n\nvar Rect = require(\"../graphic/shape/Rect\");\n\nvar Ellipse = require(\"../graphic/shape/Ellipse\");\n\nvar Line = require(\"../graphic/shape/Line\");\n\nvar Path = require(\"../graphic/Path\");\n\nvar Polygon = require(\"../graphic/shape/Polygon\");\n\nvar Polyline = require(\"../graphic/shape/Polyline\");\n\nvar LinearGradient = require(\"../graphic/LinearGradient\");\n\nvar Style = require(\"../graphic/Style\");\n\nvar matrix = require(\"../core/matrix\");\n\nvar _path = require(\"./path\");\n\nvar createFromString = _path.createFromString;\n\nvar _util = require(\"../core/util\");\n\nvar isString = _util.isString;\nvar extend = _util.extend;\nvar defaults = _util.defaults;\nvar trim = _util.trim;\nvar each = _util.each;\n// import RadialGradient from '../graphic/RadialGradient';\n// import Pattern from '../graphic/Pattern';\n// import * as vector from '../core/vector';\n// Most of the values can be separated by comma and/or white space.\nvar DILIMITER_REG = /[\\s,]+/;\n/**\n * For big svg string, this method might be time consuming.\n *\n * @param {string} svg xml string\n * @return {Object} xml root.\n */\n\nfunction parseXML(svg) {\n if (isString(svg)) {\n var parser = new DOMParser();\n svg = parser.parseFromString(svg, 'text/xml');\n } // Document node. If using $.get, doc node may be input.\n\n\n if (svg.nodeType === 9) {\n svg = svg.firstChild;\n } // nodeName of is also 'svg'.\n\n\n while (svg.nodeName.toLowerCase() !== 'svg' || svg.nodeType !== 1) {\n svg = svg.nextSibling;\n }\n\n return svg;\n}\n\nfunction SVGParser() {\n this._defs = {};\n this._root = null;\n this._isDefine = false;\n this._isText = false;\n}\n\nSVGParser.prototype.parse = function (xml, opt) {\n opt = opt || {};\n var svg = parseXML(xml);\n\n if (!svg) {\n throw new Error('Illegal svg');\n }\n\n var root = new Group();\n this._root = root; // parse view port\n\n var viewBox = svg.getAttribute('viewBox') || ''; // If width/height not specified, means \"100%\" of `opt.width/height`.\n // TODO: Other percent value not supported yet.\n\n var width = parseFloat(svg.getAttribute('width') || opt.width);\n var height = parseFloat(svg.getAttribute('height') || opt.height); // If width/height not specified, set as null for output.\n\n isNaN(width) && (width = null);\n isNaN(height) && (height = null); // Apply inline style on svg element.\n\n parseAttributes(svg, root, null, true);\n var child = svg.firstChild;\n\n while (child) {\n this._parseNode(child, root);\n\n child = child.nextSibling;\n }\n\n var viewBoxRect;\n var viewBoxTransform;\n\n if (viewBox) {\n var viewBoxArr = trim(viewBox).split(DILIMITER_REG); // Some invalid case like viewBox: 'none'.\n\n if (viewBoxArr.length >= 4) {\n viewBoxRect = {\n x: parseFloat(viewBoxArr[0] || 0),\n y: parseFloat(viewBoxArr[1] || 0),\n width: parseFloat(viewBoxArr[2]),\n height: parseFloat(viewBoxArr[3])\n };\n }\n }\n\n if (viewBoxRect && width != null && height != null) {\n viewBoxTransform = makeViewBoxTransform(viewBoxRect, width, height);\n\n if (!opt.ignoreViewBox) {\n // If set transform on the output group, it probably bring trouble when\n // some users only intend to show the clipped content inside the viewBox,\n // but not intend to transform the output group. So we keep the output\n // group no transform. If the user intend to use the viewBox as a\n // camera, just set `opt.ignoreViewBox` as `true` and set transfrom\n // manually according to the viewBox info in the output of this method.\n var elRoot = root;\n root = new Group();\n root.add(elRoot);\n elRoot.scale = viewBoxTransform.scale.slice();\n elRoot.position = viewBoxTransform.position.slice();\n }\n } // Some shapes might be overflow the viewport, which should be\n // clipped despite whether the viewBox is used, as the SVG does.\n\n\n if (!opt.ignoreRootClip && width != null && height != null) {\n root.setClipPath(new Rect({\n shape: {\n x: 0,\n y: 0,\n width: width,\n height: height\n }\n }));\n } // Set width/height on group just for output the viewport size.\n\n\n return {\n root: root,\n width: width,\n height: height,\n viewBoxRect: viewBoxRect,\n viewBoxTransform: viewBoxTransform\n };\n};\n\nSVGParser.prototype._parseNode = function (xmlNode, parentGroup) {\n var nodeName = xmlNode.nodeName.toLowerCase(); // TODO\n // support in svg, where nodeName is 'style',\n // CSS classes is defined globally wherever the style tags are declared.\n\n if (nodeName === 'defs') {\n // define flag\n this._isDefine = true;\n } else if (nodeName === 'text') {\n this._isText = true;\n }\n\n var el;\n\n if (this._isDefine) {\n var parser = defineParsers[nodeName];\n\n if (parser) {\n var def = parser.call(this, xmlNode);\n var id = xmlNode.getAttribute('id');\n\n if (id) {\n this._defs[id] = def;\n }\n }\n } else {\n var parser = nodeParsers[nodeName];\n\n if (parser) {\n el = parser.call(this, xmlNode, parentGroup);\n parentGroup.add(el);\n }\n }\n\n var child = xmlNode.firstChild;\n\n while (child) {\n if (child.nodeType === 1) {\n this._parseNode(child, el);\n } // Is text\n\n\n if (child.nodeType === 3 && this._isText) {\n this._parseText(child, el);\n }\n\n child = child.nextSibling;\n } // Quit define\n\n\n if (nodeName === 'defs') {\n this._isDefine = false;\n } else if (nodeName === 'text') {\n this._isText = false;\n }\n};\n\nSVGParser.prototype._parseText = function (xmlNode, parentGroup) {\n if (xmlNode.nodeType === 1) {\n var dx = xmlNode.getAttribute('dx') || 0;\n var dy = xmlNode.getAttribute('dy') || 0;\n this._textX += parseFloat(dx);\n this._textY += parseFloat(dy);\n }\n\n var text = new Text({\n style: {\n text: xmlNode.textContent,\n transformText: true\n },\n position: [this._textX || 0, this._textY || 0]\n });\n inheritStyle(parentGroup, text);\n parseAttributes(xmlNode, text, this._defs);\n var fontSize = text.style.fontSize;\n\n if (fontSize && fontSize < 9) {\n // PENDING\n text.style.fontSize = 9;\n text.scale = text.scale || [1, 1];\n text.scale[0] *= fontSize / 9;\n text.scale[1] *= fontSize / 9;\n }\n\n var rect = text.getBoundingRect();\n this._textX += rect.width;\n parentGroup.add(text);\n return text;\n};\n\nvar nodeParsers = {\n 'g': function (xmlNode, parentGroup) {\n var g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defs);\n return g;\n },\n 'rect': function (xmlNode, parentGroup) {\n var rect = new Rect();\n inheritStyle(parentGroup, rect);\n parseAttributes(xmlNode, rect, this._defs);\n rect.setShape({\n x: parseFloat(xmlNode.getAttribute('x') || 0),\n y: parseFloat(xmlNode.getAttribute('y') || 0),\n width: parseFloat(xmlNode.getAttribute('width') || 0),\n height: parseFloat(xmlNode.getAttribute('height') || 0)\n }); // console.log(xmlNode.getAttribute('transform'));\n // console.log(rect.transform);\n\n return rect;\n },\n 'circle': function (xmlNode, parentGroup) {\n var circle = new Circle();\n inheritStyle(parentGroup, circle);\n parseAttributes(xmlNode, circle, this._defs);\n circle.setShape({\n cx: parseFloat(xmlNode.getAttribute('cx') || 0),\n cy: parseFloat(xmlNode.getAttribute('cy') || 0),\n r: parseFloat(xmlNode.getAttribute('r') || 0)\n });\n return circle;\n },\n 'line': function (xmlNode, parentGroup) {\n var line = new Line();\n inheritStyle(parentGroup, line);\n parseAttributes(xmlNode, line, this._defs);\n line.setShape({\n x1: parseFloat(xmlNode.getAttribute('x1') || 0),\n y1: parseFloat(xmlNode.getAttribute('y1') || 0),\n x2: parseFloat(xmlNode.getAttribute('x2') || 0),\n y2: parseFloat(xmlNode.getAttribute('y2') || 0)\n });\n return line;\n },\n 'ellipse': function (xmlNode, parentGroup) {\n var ellipse = new Ellipse();\n inheritStyle(parentGroup, ellipse);\n parseAttributes(xmlNode, ellipse, this._defs);\n ellipse.setShape({\n cx: parseFloat(xmlNode.getAttribute('cx') || 0),\n cy: parseFloat(xmlNode.getAttribute('cy') || 0),\n rx: parseFloat(xmlNode.getAttribute('rx') || 0),\n ry: parseFloat(xmlNode.getAttribute('ry') || 0)\n });\n return ellipse;\n },\n 'polygon': function (xmlNode, parentGroup) {\n var points = xmlNode.getAttribute('points');\n\n if (points) {\n points = parsePoints(points);\n }\n\n var polygon = new Polygon({\n shape: {\n points: points || []\n }\n });\n inheritStyle(parentGroup, polygon);\n parseAttributes(xmlNode, polygon, this._defs);\n return polygon;\n },\n 'polyline': function (xmlNode, parentGroup) {\n var path = new Path();\n inheritStyle(parentGroup, path);\n parseAttributes(xmlNode, path, this._defs);\n var points = xmlNode.getAttribute('points');\n\n if (points) {\n points = parsePoints(points);\n }\n\n var polyline = new Polyline({\n shape: {\n points: points || []\n }\n });\n return polyline;\n },\n 'image': function (xmlNode, parentGroup) {\n var img = new ZImage();\n inheritStyle(parentGroup, img);\n parseAttributes(xmlNode, img, this._defs);\n img.setStyle({\n image: xmlNode.getAttribute('xlink:href'),\n x: xmlNode.getAttribute('x'),\n y: xmlNode.getAttribute('y'),\n width: xmlNode.getAttribute('width'),\n height: xmlNode.getAttribute('height')\n });\n return img;\n },\n 'text': function (xmlNode, parentGroup) {\n var x = xmlNode.getAttribute('x') || 0;\n var y = xmlNode.getAttribute('y') || 0;\n var dx = xmlNode.getAttribute('dx') || 0;\n var dy = xmlNode.getAttribute('dy') || 0;\n this._textX = parseFloat(x) + parseFloat(dx);\n this._textY = parseFloat(y) + parseFloat(dy);\n var g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defs);\n return g;\n },\n 'tspan': function (xmlNode, parentGroup) {\n var x = xmlNode.getAttribute('x');\n var y = xmlNode.getAttribute('y');\n\n if (x != null) {\n // new offset x\n this._textX = parseFloat(x);\n }\n\n if (y != null) {\n // new offset y\n this._textY = parseFloat(y);\n }\n\n var dx = xmlNode.getAttribute('dx') || 0;\n var dy = xmlNode.getAttribute('dy') || 0;\n var g = new Group();\n inheritStyle(parentGroup, g);\n parseAttributes(xmlNode, g, this._defs);\n this._textX += dx;\n this._textY += dy;\n return g;\n },\n 'path': function (xmlNode, parentGroup) {\n // TODO svg fill rule\n // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule\n // path.style.globalCompositeOperation = 'xor';\n var d = xmlNode.getAttribute('d') || ''; // Performance sensitive.\n\n var path = createFromString(d);\n inheritStyle(parentGroup, path);\n parseAttributes(xmlNode, path, this._defs);\n return path;\n }\n};\nvar defineParsers = {\n 'lineargradient': function (xmlNode) {\n var x1 = parseInt(xmlNode.getAttribute('x1') || 0, 10);\n var y1 = parseInt(xmlNode.getAttribute('y1') || 0, 10);\n var x2 = parseInt(xmlNode.getAttribute('x2') || 10, 10);\n var y2 = parseInt(xmlNode.getAttribute('y2') || 0, 10);\n var gradient = new LinearGradient(x1, y1, x2, y2);\n\n _parseGradientColorStops(xmlNode, gradient);\n\n return gradient;\n },\n 'radialgradient': function (xmlNode) {}\n};\n\nfunction _parseGradientColorStops(xmlNode, gradient) {\n var stop = xmlNode.firstChild;\n\n while (stop) {\n if (stop.nodeType === 1) {\n var offset = stop.getAttribute('offset');\n\n if (offset.indexOf('%') > 0) {\n // percentage\n offset = parseInt(offset, 10) / 100;\n } else if (offset) {\n // number from 0 to 1\n offset = parseFloat(offset);\n } else {\n offset = 0;\n }\n\n var stopColor = stop.getAttribute('stop-color') || '#000000';\n gradient.addColorStop(offset, stopColor);\n }\n\n stop = stop.nextSibling;\n }\n}\n\nfunction inheritStyle(parent, child) {\n if (parent && parent.__inheritedStyle) {\n if (!child.__inheritedStyle) {\n child.__inheritedStyle = {};\n }\n\n defaults(child.__inheritedStyle, parent.__inheritedStyle);\n }\n}\n\nfunction parsePoints(pointsString) {\n var list = trim(pointsString).split(DILIMITER_REG);\n var points = [];\n\n for (var i = 0; i < list.length; i += 2) {\n var x = parseFloat(list[i]);\n var y = parseFloat(list[i + 1]);\n points.push([x, y]);\n }\n\n return points;\n}\n\nvar attributesMap = {\n 'fill': 'fill',\n 'stroke': 'stroke',\n 'stroke-width': 'lineWidth',\n 'opacity': 'opacity',\n 'fill-opacity': 'fillOpacity',\n 'stroke-opacity': 'strokeOpacity',\n 'stroke-dasharray': 'lineDash',\n 'stroke-dashoffset': 'lineDashOffset',\n 'stroke-linecap': 'lineCap',\n 'stroke-linejoin': 'lineJoin',\n 'stroke-miterlimit': 'miterLimit',\n 'font-family': 'fontFamily',\n 'font-size': 'fontSize',\n 'font-style': 'fontStyle',\n 'font-weight': 'fontWeight',\n 'text-align': 'textAlign',\n 'alignment-baseline': 'textBaseline'\n};\n\nfunction parseAttributes(xmlNode, el, defs, onlyInlineStyle) {\n var zrStyle = el.__inheritedStyle || {};\n var isTextEl = el.type === 'text'; // TODO Shadow\n\n if (xmlNode.nodeType === 1) {\n parseTransformAttribute(xmlNode, el);\n extend(zrStyle, parseStyleAttribute(xmlNode));\n\n if (!onlyInlineStyle) {\n for (var svgAttrName in attributesMap) {\n if (attributesMap.hasOwnProperty(svgAttrName)) {\n var attrValue = xmlNode.getAttribute(svgAttrName);\n\n if (attrValue != null) {\n zrStyle[attributesMap[svgAttrName]] = attrValue;\n }\n }\n }\n }\n }\n\n var elFillProp = isTextEl ? 'textFill' : 'fill';\n var elStrokeProp = isTextEl ? 'textStroke' : 'stroke';\n el.style = el.style || new Style();\n var elStyle = el.style;\n zrStyle.fill != null && elStyle.set(elFillProp, getPaint(zrStyle.fill, defs));\n zrStyle.stroke != null && elStyle.set(elStrokeProp, getPaint(zrStyle.stroke, defs));\n each(['lineWidth', 'opacity', 'fillOpacity', 'strokeOpacity', 'miterLimit', 'fontSize'], function (propName) {\n var elPropName = propName === 'lineWidth' && isTextEl ? 'textStrokeWidth' : propName;\n zrStyle[propName] != null && elStyle.set(elPropName, parseFloat(zrStyle[propName]));\n });\n\n if (!zrStyle.textBaseline || zrStyle.textBaseline === 'auto') {\n zrStyle.textBaseline = 'alphabetic';\n }\n\n if (zrStyle.textBaseline === 'alphabetic') {\n zrStyle.textBaseline = 'bottom';\n }\n\n if (zrStyle.textAlign === 'start') {\n zrStyle.textAlign = 'left';\n }\n\n if (zrStyle.textAlign === 'end') {\n zrStyle.textAlign = 'right';\n }\n\n each(['lineDashOffset', 'lineCap', 'lineJoin', 'fontWeight', 'fontFamily', 'fontStyle', 'textAlign', 'textBaseline'], function (propName) {\n zrStyle[propName] != null && elStyle.set(propName, zrStyle[propName]);\n });\n\n if (zrStyle.lineDash) {\n el.style.lineDash = trim(zrStyle.lineDash).split(DILIMITER_REG);\n }\n\n if (elStyle[elStrokeProp] && elStyle[elStrokeProp] !== 'none') {\n // enable stroke\n el[elStrokeProp] = true;\n }\n\n el.__inheritedStyle = zrStyle;\n}\n\nvar urlRegex = /url\\(\\s*#(.*?)\\)/;\n\nfunction getPaint(str, defs) {\n // if (str === 'none') {\n // return;\n // }\n var urlMatch = defs && str && str.match(urlRegex);\n\n if (urlMatch) {\n var url = trim(urlMatch[1]);\n var def = defs[url];\n return def;\n }\n\n return str;\n}\n\nvar transformRegex = /(translate|scale|rotate|skewX|skewY|matrix)\\(([\\-\\s0-9\\.e,]*)\\)/g;\n\nfunction parseTransformAttribute(xmlNode, node) {\n var transform = xmlNode.getAttribute('transform');\n\n if (transform) {\n transform = transform.replace(/,/g, ' ');\n var m = null;\n var transformOps = [];\n transform.replace(transformRegex, function (str, type, value) {\n transformOps.push(type, value);\n });\n\n for (var i = transformOps.length - 1; i > 0; i -= 2) {\n var value = transformOps[i];\n var type = transformOps[i - 1];\n m = m || matrix.create();\n\n switch (type) {\n case 'translate':\n value = trim(value).split(DILIMITER_REG);\n matrix.translate(m, m, [parseFloat(value[0]), parseFloat(value[1] || 0)]);\n break;\n\n case 'scale':\n value = trim(value).split(DILIMITER_REG);\n matrix.scale(m, m, [parseFloat(value[0]), parseFloat(value[1] || value[0])]);\n break;\n\n case 'rotate':\n value = trim(value).split(DILIMITER_REG);\n matrix.rotate(m, m, parseFloat(value[0]));\n break;\n\n case 'skew':\n value = trim(value).split(DILIMITER_REG);\n console.warn('Skew transform is not supported yet');\n break;\n\n case 'matrix':\n var value = trim(value).split(DILIMITER_REG);\n m[0] = parseFloat(value[0]);\n m[1] = parseFloat(value[1]);\n m[2] = parseFloat(value[2]);\n m[3] = parseFloat(value[3]);\n m[4] = parseFloat(value[4]);\n m[5] = parseFloat(value[5]);\n break;\n }\n }\n\n node.setLocalTransform(m);\n }\n} // Value may contain space.\n\n\nvar styleRegex = /([^\\s:;]+)\\s*:\\s*([^:;]+)/g;\n\nfunction parseStyleAttribute(xmlNode) {\n var style = xmlNode.getAttribute('style');\n var result = {};\n\n if (!style) {\n return result;\n }\n\n var styleList = {};\n styleRegex.lastIndex = 0;\n var styleRegResult;\n\n while ((styleRegResult = styleRegex.exec(style)) != null) {\n styleList[styleRegResult[1]] = styleRegResult[2];\n }\n\n for (var svgAttrName in attributesMap) {\n if (attributesMap.hasOwnProperty(svgAttrName) && styleList[svgAttrName] != null) {\n result[attributesMap[svgAttrName]] = styleList[svgAttrName];\n }\n }\n\n return result;\n}\n/**\n * @param {Array.} viewBoxRect\n * @param {number} width\n * @param {number} height\n * @return {Object} {scale, position}\n */\n\n\nfunction makeViewBoxTransform(viewBoxRect, width, height) {\n var scaleX = width / viewBoxRect.width;\n var scaleY = height / viewBoxRect.height;\n var scale = Math.min(scaleX, scaleY); // preserveAspectRatio 'xMidYMid'\n\n var viewBoxScale = [scale, scale];\n var viewBoxPosition = [-(viewBoxRect.x + viewBoxRect.width / 2) * scale + width / 2, -(viewBoxRect.y + viewBoxRect.height / 2) * scale + height / 2];\n return {\n scale: viewBoxScale,\n position: viewBoxPosition\n };\n}\n/**\n * @param {string|XMLElement} xml\n * @param {Object} [opt]\n * @param {number} [opt.width] Default width if svg width not specified or is a percent value.\n * @param {number} [opt.height] Default height if svg height not specified or is a percent value.\n * @param {boolean} [opt.ignoreViewBox]\n * @param {boolean} [opt.ignoreRootClip]\n * @return {Object} result:\n * {\n * root: Group, The root of the the result tree of zrender shapes,\n * width: number, the viewport width of the SVG,\n * height: number, the viewport height of the SVG,\n * viewBoxRect: {x, y, width, height}, the declared viewBox rect of the SVG, if exists,\n * viewBoxTransform: the {scale, position} calculated by viewBox and viewport, is exists.\n * }\n */\n\n\nfunction parseSVG(xml, opt) {\n var parser = new SVGParser();\n return parser.parse(xml, opt);\n}\n\nexports.parseXML = parseXML;\nexports.makeViewBoxTransform = makeViewBoxTransform;\nexports.parseSVG = parseSVG;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/tool/parseSVG.js\n// module id = 165\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrender = require(\"zrender/lib/zrender\");\n\nexports.zrender = zrender;\n\nvar matrix = require(\"zrender/lib/core/matrix\");\n\nexports.matrix = matrix;\n\nvar vector = require(\"zrender/lib/core/vector\");\n\nexports.vector = vector;\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar colorTool = require(\"zrender/lib/tool/color\");\n\nexports.color = colorTool;\n\nvar graphicUtil = require(\"./util/graphic\");\n\nvar numberUtil = require(\"./util/number\");\n\nexports.number = numberUtil;\n\nvar formatUtil = require(\"./util/format\");\n\nexports.format = formatUtil;\n\nvar _throttle = require(\"./util/throttle\");\n\nvar throttle = _throttle.throttle;\nexports.throttle = _throttle.throttle;\n\nvar ecHelper = require(\"./helper\");\n\nexports.helper = ecHelper;\n\nvar parseGeoJSON = require(\"./coord/geo/parseGeoJson\");\n\nexports.parseGeoJSON = parseGeoJSON;\n\nvar _List = require(\"./data/List\");\n\nexports.List = _List;\n\nvar _Model = require(\"./model/Model\");\n\nexports.Model = _Model;\n\nvar _Axis = require(\"./coord/Axis\");\n\nexports.Axis = _Axis;\n\nvar _env = require(\"zrender/lib/core/env\");\n\nexports.env = _env;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Do not mount those modules on 'src/echarts' for better tree shaking.\n */\nvar parseGeoJson = parseGeoJSON;\nvar ecUtil = {};\nzrUtil.each(['map', 'each', 'filter', 'indexOf', 'inherits', 'reduce', 'filter', 'bind', 'curry', 'isArray', 'isString', 'isObject', 'isFunction', 'extend', 'defaults', 'clone', 'merge'], function (name) {\n ecUtil[name] = zrUtil[name];\n});\nvar graphic = {};\nzrUtil.each(['extendShape', 'extendPath', 'makePath', 'makeImage', 'mergePath', 'resizePath', 'createIcon', 'setHoverStyle', 'setLabelStyle', 'setTextStyle', 'setText', 'getFont', 'updateProps', 'initProps', 'getTransform', 'clipPointsByRect', 'clipRectByRect', 'Group', 'Image', 'Text', 'Circle', 'Sector', 'Ring', 'Polygon', 'Polyline', 'Rect', 'Line', 'BezierCurve', 'Arc', 'IncrementalDisplayable', 'CompoundPath', 'LinearGradient', 'RadialGradient', 'BoundingRect'], function (name) {\n graphic[name] = graphicUtil[name];\n});\nexports.parseGeoJson = parseGeoJson;\nexports.util = ecUtil;\nexports.graphic = graphic;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/export.js\n// module id = 166\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _util = require(\"zrender/lib/core/util\");\n\nvar createHashMap = _util.createHashMap;\nvar each = _util.each;\nvar isString = _util.isString;\nvar defaults = _util.defaults;\nvar extend = _util.extend;\nvar isObject = _util.isObject;\nvar clone = _util.clone;\n\nvar _model = require(\"../../util/model\");\n\nvar normalizeToArray = _model.normalizeToArray;\n\nvar _sourceHelper = require(\"./sourceHelper\");\n\nvar guessOrdinal = _sourceHelper.guessOrdinal;\n\nvar Source = require(\"../Source\");\n\nvar _dimensionHelper = require(\"./dimensionHelper\");\n\nvar OTHER_DIMENSIONS = _dimensionHelper.OTHER_DIMENSIONS;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @deprecated\n * Use `echarts/data/helper/createDimensions` instead.\n */\n\n/**\n * @see {module:echarts/test/ut/spec/data/completeDimensions}\n *\n * Complete the dimensions array, by user defined `dimension` and `encode`,\n * and guessing from the data structure.\n * If no 'value' dimension specified, the first no-named dimension will be\n * named as 'value'.\n *\n * @param {Array.} sysDims Necessary dimensions, like ['x', 'y'], which\n * provides not only dim template, but also default order.\n * properties: 'name', 'type', 'displayName'.\n * `name` of each item provides default coord name.\n * [{dimsDef: [string|Object, ...]}, ...] dimsDef of sysDim item provides default dim name, and\n * provide dims count that the sysDim required.\n * [{ordinalMeta}] can be specified.\n * @param {module:echarts/data/Source|Array|Object} source or data (for compatibal with pervious)\n * @param {Object} [opt]\n * @param {Array.} [opt.dimsDef] option.series.dimensions User defined dimensions\n * For example: ['asdf', {name, type}, ...].\n * @param {Object|HashMap} [opt.encodeDef] option.series.encode {x: 2, y: [3, 1], tooltip: [1, 2], label: 3}\n * @param {string} [opt.generateCoord] Generate coord dim with the given name.\n * If not specified, extra dim names will be:\n * 'value', 'value0', 'value1', ...\n * @param {number} [opt.generateCoordCount] By default, the generated dim name is `generateCoord`.\n * If `generateCoordCount` specified, the generated dim names will be:\n * `generateCoord` + 0, `generateCoord` + 1, ...\n * can be Infinity, indicate that use all of the remain columns.\n * @param {number} [opt.dimCount] If not specified, guess by the first data item.\n * @param {number} [opt.encodeDefaulter] If not specified, auto find the next available data dim.\n * @return {Array.} [{\n * name: string mandatory,\n * displayName: string, the origin name in dimsDef, see source helper.\n * If displayName given, the tooltip will displayed vertically.\n * coordDim: string mandatory,\n * coordDimIndex: number mandatory,\n * type: string optional,\n * otherDims: { never null/undefined\n * tooltip: number optional,\n * label: number optional,\n * itemName: number optional,\n * seriesName: number optional,\n * },\n * isExtraCoord: boolean true if coord is generated\n * (not specified in encode and not series specified)\n * other props ...\n * }]\n */\nfunction completeDimensions(sysDims, source, opt) {\n if (!Source.isInstance(source)) {\n source = Source.seriesDataToSource(source);\n }\n\n opt = opt || {};\n sysDims = (sysDims || []).slice();\n var dimsDef = (opt.dimsDef || []).slice();\n var encodeDef = createHashMap(opt.encodeDef);\n var dataDimNameMap = createHashMap();\n var coordDimNameMap = createHashMap(); // var valueCandidate;\n\n var result = [];\n var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimCount); // Apply user defined dims (`name` and `type`) and init result.\n\n for (var i = 0; i < dimCount; i++) {\n var dimDefItem = dimsDef[i] = extend({}, isObject(dimsDef[i]) ? dimsDef[i] : {\n name: dimsDef[i]\n });\n var userDimName = dimDefItem.name;\n var resultItem = result[i] = {\n otherDims: {}\n }; // Name will be applied later for avoiding duplication.\n\n if (userDimName != null && dataDimNameMap.get(userDimName) == null) {\n // Only if `series.dimensions` is defined in option\n // displayName, will be set, and dimension will be diplayed vertically in\n // tooltip by default.\n resultItem.name = resultItem.displayName = userDimName;\n dataDimNameMap.set(userDimName, i);\n }\n\n dimDefItem.type != null && (resultItem.type = dimDefItem.type);\n dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);\n } // Set `coordDim` and `coordDimIndex` by `encodeDef` and normalize `encodeDef`.\n\n\n encodeDef.each(function (dataDims, coordDim) {\n dataDims = normalizeToArray(dataDims).slice(); // Note: It is allowed that `dataDims.length` is `0`, e.g., options is\n // `{encode: {x: -1, y: 1}}`. Should not filter anything in\n // this case.\n\n if (dataDims.length === 1 && dataDims[0] < 0) {\n encodeDef.set(coordDim, false);\n return;\n }\n\n var validDataDims = encodeDef.set(coordDim, []);\n each(dataDims, function (resultDimIdx, idx) {\n // The input resultDimIdx can be dim name or index.\n isString(resultDimIdx) && (resultDimIdx = dataDimNameMap.get(resultDimIdx));\n\n if (resultDimIdx != null && resultDimIdx < dimCount) {\n validDataDims[idx] = resultDimIdx;\n applyDim(result[resultDimIdx], coordDim, idx);\n }\n });\n }); // Apply templetes and default order from `sysDims`.\n\n var availDimIdx = 0;\n each(sysDims, function (sysDimItem, sysDimIndex) {\n var coordDim;\n var sysDimItem;\n var sysDimItemDimsDef;\n var sysDimItemOtherDims;\n\n if (isString(sysDimItem)) {\n coordDim = sysDimItem;\n sysDimItem = {};\n } else {\n coordDim = sysDimItem.name;\n var ordinalMeta = sysDimItem.ordinalMeta;\n sysDimItem.ordinalMeta = null;\n sysDimItem = clone(sysDimItem);\n sysDimItem.ordinalMeta = ordinalMeta; // `coordDimIndex` should not be set directly.\n\n sysDimItemDimsDef = sysDimItem.dimsDef;\n sysDimItemOtherDims = sysDimItem.otherDims;\n sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex = sysDimItem.dimsDef = sysDimItem.otherDims = null;\n }\n\n var dataDims = encodeDef.get(coordDim); // negative resultDimIdx means no need to mapping.\n\n if (dataDims === false) {\n return;\n }\n\n var dataDims = normalizeToArray(dataDims); // dimensions provides default dim sequences.\n\n if (!dataDims.length) {\n for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) {\n while (availDimIdx < result.length && result[availDimIdx].coordDim != null) {\n availDimIdx++;\n }\n\n availDimIdx < result.length && dataDims.push(availDimIdx++);\n }\n } // Apply templates.\n\n\n each(dataDims, function (resultDimIdx, coordDimIndex) {\n var resultItem = result[resultDimIdx];\n applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);\n\n if (resultItem.name == null && sysDimItemDimsDef) {\n var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex];\n !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = {\n name: sysDimItemDimsDefItem\n });\n resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name;\n resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip;\n } // FIXME refactor, currently only used in case: {otherDims: {tooltip: false}}\n\n\n sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims);\n });\n });\n\n function applyDim(resultItem, coordDim, coordDimIndex) {\n if (OTHER_DIMENSIONS.get(coordDim) != null) {\n resultItem.otherDims[coordDim] = coordDimIndex;\n } else {\n resultItem.coordDim = coordDim;\n resultItem.coordDimIndex = coordDimIndex;\n coordDimNameMap.set(coordDim, true);\n }\n } // Make sure the first extra dim is 'value'.\n\n\n var generateCoord = opt.generateCoord;\n var generateCoordCount = opt.generateCoordCount;\n var fromZero = generateCoordCount != null;\n generateCoordCount = generateCoord ? generateCoordCount || 1 : 0;\n var extra = generateCoord || 'value'; // Set dim `name` and other `coordDim` and other props.\n\n for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {\n var resultItem = result[resultDimIdx] = result[resultDimIdx] || {};\n var coordDim = resultItem.coordDim;\n\n if (coordDim == null) {\n resultItem.coordDim = genName(extra, coordDimNameMap, fromZero);\n resultItem.coordDimIndex = 0;\n\n if (!generateCoord || generateCoordCount <= 0) {\n resultItem.isExtraCoord = true;\n }\n\n generateCoordCount--;\n }\n\n resultItem.name == null && (resultItem.name = genName(resultItem.coordDim, dataDimNameMap));\n\n if (resultItem.type == null && guessOrdinal(source, resultDimIdx, resultItem.name)) {\n resultItem.type = 'ordinal';\n }\n }\n\n return result;\n} // ??? TODO\n// Originally detect dimCount by data[0]. Should we\n// optimize it to only by sysDims and dimensions and encode.\n// So only necessary dims will be initialized.\n// But\n// (1) custom series should be considered. where other dims\n// may be visited.\n// (2) sometimes user need to calcualte bubble size or use visualMap\n// on other dimensions besides coordSys needed.\n// So, dims that is not used by system, should be shared in storage?\n\n\nfunction getDimCount(source, sysDims, dimsDef, optDimCount) {\n // Note that the result dimCount should not small than columns count\n // of data, otherwise `dataDimNameMap` checking will be incorrect.\n var dimCount = Math.max(source.dimensionsDetectCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);\n each(sysDims, function (sysDimItem) {\n var sysDimItemDimsDef = sysDimItem.dimsDef;\n sysDimItemDimsDef && (dimCount = Math.max(dimCount, sysDimItemDimsDef.length));\n });\n return dimCount;\n}\n\nfunction genName(name, map, fromZero) {\n if (fromZero || map.get(name) != null) {\n var i = 0;\n\n while (map.get(name + i) != null) {\n i++;\n }\n\n name += i;\n }\n\n map.set(name, true);\n return name;\n}\n\nvar _default = completeDimensions;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/data/helper/completeDimensions.js\n// module id = 167\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _util = require(\"zrender/lib/core/util\");\n\nvar createHashMap = _util.createHashMap;\nvar isObject = _util.isObject;\nvar map = _util.map;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @constructor\n * @param {Object} [opt]\n * @param {Object} [opt.categories=[]]\n * @param {Object} [opt.needCollect=false]\n * @param {Object} [opt.deduplication=false]\n */\nfunction OrdinalMeta(opt) {\n /**\n * @readOnly\n * @type {Array.}\n */\n this.categories = opt.categories || [];\n /**\n * @private\n * @type {boolean}\n */\n\n this._needCollect = opt.needCollect;\n /**\n * @private\n * @type {boolean}\n */\n\n this._deduplication = opt.deduplication;\n /**\n * @private\n * @type {boolean}\n */\n\n this._map;\n}\n/**\n * @param {module:echarts/model/Model} axisModel\n * @return {module:echarts/data/OrdinalMeta}\n */\n\n\nOrdinalMeta.createByAxisModel = function (axisModel) {\n var option = axisModel.option;\n var data = option.data;\n var categories = data && map(data, getName);\n return new OrdinalMeta({\n categories: categories,\n needCollect: !categories,\n // deduplication is default in axis.\n deduplication: option.dedplication !== false\n });\n};\n\nvar proto = OrdinalMeta.prototype;\n/**\n * @param {string} category\n * @return {number} ordinal\n */\n\nproto.getOrdinal = function (category) {\n return getOrCreateMap(this).get(category);\n};\n/**\n * @param {*} category\n * @return {number} The ordinal. If not found, return NaN.\n */\n\n\nproto.parseAndCollect = function (category) {\n var index;\n var needCollect = this._needCollect; // The value of category dim can be the index of the given category set.\n // This feature is only supported when !needCollect, because we should\n // consider a common case: a value is 2017, which is a number but is\n // expected to be tread as a category. This case usually happen in dataset,\n // where it happent to be no need of the index feature.\n\n if (typeof category !== 'string' && !needCollect) {\n return category;\n } // Optimize for the scenario:\n // category is ['2012-01-01', '2012-01-02', ...], where the input\n // data has been ensured not duplicate and is large data.\n // Notice, if a dataset dimension provide categroies, usually echarts\n // should remove duplication except user tell echarts dont do that\n // (set axis.deduplication = false), because echarts do not know whether\n // the values in the category dimension has duplication (consider the\n // parallel-aqi example)\n\n\n if (needCollect && !this._deduplication) {\n index = this.categories.length;\n this.categories[index] = category;\n return index;\n }\n\n var map = getOrCreateMap(this);\n index = map.get(category);\n\n if (index == null) {\n if (needCollect) {\n index = this.categories.length;\n this.categories[index] = category;\n map.set(category, index);\n } else {\n index = NaN;\n }\n }\n\n return index;\n}; // Consider big data, do not create map until needed.\n\n\nfunction getOrCreateMap(ordinalMeta) {\n return ordinalMeta._map || (ordinalMeta._map = createHashMap(ordinalMeta.categories));\n}\n\nfunction getName(obj) {\n if (isObject(obj) && obj.value != null) {\n return obj.value;\n } else {\n return obj + '';\n }\n}\n\nvar _default = OrdinalMeta;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/data/OrdinalMeta.js\n// module id = 168\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar numberUtil = require(\"../util/number\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * For testable.\n */\nvar roundNumber = numberUtil.round;\n/**\n * @param {Array.} extent Both extent[0] and extent[1] should be valid number.\n * Should be extent[0] < extent[1].\n * @param {number} splitNumber splitNumber should be >= 1.\n * @param {number} [minInterval]\n * @param {number} [maxInterval]\n * @return {Object} {interval, intervalPrecision, niceTickExtent}\n */\n\nfunction intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval) {\n var result = {};\n var span = extent[1] - extent[0];\n var interval = result.interval = numberUtil.nice(span / splitNumber, true);\n\n if (minInterval != null && interval < minInterval) {\n interval = result.interval = minInterval;\n }\n\n if (maxInterval != null && interval > maxInterval) {\n interval = result.interval = maxInterval;\n } // Tow more digital for tick.\n\n\n var precision = result.intervalPrecision = getIntervalPrecision(interval); // Niced extent inside original extent\n\n var niceTickExtent = result.niceTickExtent = [roundNumber(Math.ceil(extent[0] / interval) * interval, precision), roundNumber(Math.floor(extent[1] / interval) * interval, precision)];\n fixExtent(niceTickExtent, extent);\n return result;\n}\n/**\n * @param {number} interval\n * @return {number} interval precision\n */\n\n\nfunction getIntervalPrecision(interval) {\n // Tow more digital for tick.\n return numberUtil.getPrecisionSafe(interval) + 2;\n}\n\nfunction clamp(niceTickExtent, idx, extent) {\n niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]);\n} // In some cases (e.g., splitNumber is 1), niceTickExtent may be out of extent.\n\n\nfunction fixExtent(niceTickExtent, extent) {\n !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]);\n !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]);\n clamp(niceTickExtent, 0, extent);\n clamp(niceTickExtent, 1, extent);\n\n if (niceTickExtent[0] > niceTickExtent[1]) {\n niceTickExtent[0] = niceTickExtent[1];\n }\n}\n\nfunction intervalScaleGetTicks(interval, extent, niceTickExtent, intervalPrecision) {\n var ticks = []; // If interval is 0, return [];\n\n if (!interval) {\n return ticks;\n } // Consider this case: using dataZoom toolbox, zoom and zoom.\n\n\n var safeLimit = 10000;\n\n if (extent[0] < niceTickExtent[0]) {\n ticks.push(extent[0]);\n }\n\n var tick = niceTickExtent[0];\n\n while (tick <= niceTickExtent[1]) {\n ticks.push(tick); // Avoid rounding error\n\n tick = roundNumber(tick + interval, intervalPrecision);\n\n if (tick === ticks[ticks.length - 1]) {\n // Consider out of safe float point, e.g.,\n // -3711126.9907707 + 2e-10 === -3711126.9907707\n break;\n }\n\n if (ticks.length > safeLimit) {\n return [];\n }\n } // Consider this case: the last item of ticks is smaller\n // than niceTickExtent[1] and niceTickExtent[1] === extent[1].\n\n\n if (extent[1] > (ticks.length ? ticks[ticks.length - 1] : niceTickExtent[1])) {\n ticks.push(extent[1]);\n }\n\n return ticks;\n}\n\nexports.intervalScaleNiceTicks = intervalScaleNiceTicks;\nexports.getIntervalPrecision = getIntervalPrecision;\nexports.fixExtent = fixExtent;\nexports.intervalScaleGetTicks = intervalScaleGetTicks;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/scale/helper.js\n// module id = 169\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar Region = require(\"./Region\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Parse and decode geo json\n * @module echarts/coord/geo/parseGeoJson\n */\nfunction decode(json) {\n if (!json.UTF8Encoding) {\n return json;\n }\n\n var encodeScale = json.UTF8Scale;\n\n if (encodeScale == null) {\n encodeScale = 1024;\n }\n\n var features = json.features;\n\n for (var f = 0; f < features.length; f++) {\n var feature = features[f];\n var geometry = feature.geometry;\n var coordinates = geometry.coordinates;\n var encodeOffsets = geometry.encodeOffsets;\n\n for (var c = 0; c < coordinates.length; c++) {\n var coordinate = coordinates[c];\n\n if (geometry.type === 'Polygon') {\n coordinates[c] = decodePolygon(coordinate, encodeOffsets[c], encodeScale);\n } else if (geometry.type === 'MultiPolygon') {\n for (var c2 = 0; c2 < coordinate.length; c2++) {\n var polygon = coordinate[c2];\n coordinate[c2] = decodePolygon(polygon, encodeOffsets[c][c2], encodeScale);\n }\n }\n }\n } // Has been decoded\n\n\n json.UTF8Encoding = false;\n return json;\n}\n\nfunction decodePolygon(coordinate, encodeOffsets, encodeScale) {\n var result = [];\n var prevX = encodeOffsets[0];\n var prevY = encodeOffsets[1];\n\n for (var i = 0; i < coordinate.length; i += 2) {\n var x = coordinate.charCodeAt(i) - 64;\n var y = coordinate.charCodeAt(i + 1) - 64; // ZigZag decoding\n\n x = x >> 1 ^ -(x & 1);\n y = y >> 1 ^ -(y & 1); // Delta deocding\n\n x += prevX;\n y += prevY;\n prevX = x;\n prevY = y; // Dequantize\n\n result.push([x / encodeScale, y / encodeScale]);\n }\n\n return result;\n}\n/**\n * @alias module:echarts/coord/geo/parseGeoJson\n * @param {Object} geoJson\n * @return {module:zrender/container/Group}\n */\n\n\nfunction _default(geoJson) {\n decode(geoJson);\n return zrUtil.map(zrUtil.filter(geoJson.features, function (featureObj) {\n // Output of mapshaper may have geometry null\n return featureObj.geometry && featureObj.properties && featureObj.geometry.coordinates.length > 0;\n }), function (featureObj) {\n var properties = featureObj.properties;\n var geo = featureObj.geometry;\n var coordinates = geo.coordinates;\n var geometries = [];\n\n if (geo.type === 'Polygon') {\n geometries.push({\n type: 'polygon',\n // According to the GeoJSON specification.\n // First must be exterior, and the rest are all interior(holes).\n exterior: coordinates[0],\n interiors: coordinates.slice(1)\n });\n }\n\n if (geo.type === 'MultiPolygon') {\n zrUtil.each(coordinates, function (item) {\n if (item[0]) {\n geometries.push({\n type: 'polygon',\n exterior: item[0],\n interiors: item.slice(1)\n });\n }\n });\n }\n\n var region = new Region(properties.name, geometries, properties.cp);\n region.properties = properties;\n return region;\n });\n}\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/coord/geo/parseGeoJson.js\n// module id = 170\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar BoundingRect = require(\"zrender/lib/core/BoundingRect\");\n\nvar bbox = require(\"zrender/lib/core/bbox\");\n\nvar vec2 = require(\"zrender/lib/core/vector\");\n\nvar polygonContain = require(\"zrender/lib/contain/polygon\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @module echarts/coord/geo/Region\n */\n\n/**\n * @param {string|Region} name\n * @param {Array} geometries\n * @param {Array.} cp\n */\nfunction Region(name, geometries, cp) {\n /**\n * @type {string}\n * @readOnly\n */\n this.name = name;\n /**\n * @type {Array.}\n * @readOnly\n */\n\n this.geometries = geometries;\n\n if (!cp) {\n var rect = this.getBoundingRect();\n cp = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n } else {\n cp = [cp[0], cp[1]];\n }\n /**\n * @type {Array.}\n */\n\n\n this.center = cp;\n}\n\nRegion.prototype = {\n constructor: Region,\n properties: null,\n\n /**\n * @return {module:zrender/core/BoundingRect}\n */\n getBoundingRect: function () {\n var rect = this._rect;\n\n if (rect) {\n return rect;\n }\n\n var MAX_NUMBER = Number.MAX_VALUE;\n var min = [MAX_NUMBER, MAX_NUMBER];\n var max = [-MAX_NUMBER, -MAX_NUMBER];\n var min2 = [];\n var max2 = [];\n var geometries = this.geometries;\n\n for (var i = 0; i < geometries.length; i++) {\n // Only support polygon\n if (geometries[i].type !== 'polygon') {\n continue;\n } // Doesn't consider hole\n\n\n var exterior = geometries[i].exterior;\n bbox.fromPoints(exterior, min2, max2);\n vec2.min(min, min, min2);\n vec2.max(max, max, max2);\n } // No data\n\n\n if (i === 0) {\n min[0] = min[1] = max[0] = max[1] = 0;\n }\n\n return this._rect = new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n },\n\n /**\n * @param {} coord\n * @return {boolean}\n */\n contain: function (coord) {\n var rect = this.getBoundingRect();\n var geometries = this.geometries;\n\n if (!rect.contain(coord[0], coord[1])) {\n return false;\n }\n\n loopGeo: for (var i = 0, len = geometries.length; i < len; i++) {\n // Only support polygon.\n if (geometries[i].type !== 'polygon') {\n continue;\n }\n\n var exterior = geometries[i].exterior;\n var interiors = geometries[i].interiors;\n\n if (polygonContain.contain(exterior, coord[0], coord[1])) {\n // Not in the region if point is in the hole.\n for (var k = 0; k < (interiors ? interiors.length : 0); k++) {\n if (polygonContain.contain(interiors[k])) {\n continue loopGeo;\n }\n }\n\n return true;\n }\n }\n\n return false;\n },\n transformTo: function (x, y, width, height) {\n var rect = this.getBoundingRect();\n var aspect = rect.width / rect.height;\n\n if (!width) {\n width = aspect * height;\n } else if (!height) {\n height = width / aspect;\n }\n\n var target = new BoundingRect(x, y, width, height);\n var transform = rect.calculateTransform(target);\n var geometries = this.geometries;\n\n for (var i = 0; i < geometries.length; i++) {\n // Only support polygon.\n if (geometries[i].type !== 'polygon') {\n continue;\n }\n\n var exterior = geometries[i].exterior;\n var interiors = geometries[i].interiors;\n\n for (var p = 0; p < exterior.length; p++) {\n vec2.applyTransform(exterior[p], exterior[p], transform);\n }\n\n for (var h = 0; h < (interiors ? interiors.length : 0); h++) {\n for (var p = 0; p < interiors[h].length; p++) {\n vec2.applyTransform(interiors[h][p], interiors[h][p], transform);\n }\n }\n }\n\n rect = this._rect;\n rect.copy(target); // Update center\n\n this.center = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n },\n cloneShallow: function (name) {\n name == null && (name = this.name);\n var newRegion = new Region(name, this.geometries, this.center);\n newRegion._rect = this._rect;\n newRegion.transformTo = null; // Simply avoid to be called.\n\n return newRegion;\n }\n};\nvar _default = Region;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/coord/geo/Region.js\n// module id = 171\n// module chunks = 39","var windingLine = require(\"./windingLine\");\n\nvar EPSILON = 1e-8;\n\nfunction isAroundEqual(a, b) {\n return Math.abs(a - b) < EPSILON;\n}\n\nfunction contain(points, x, y) {\n var w = 0;\n var p = points[0];\n\n if (!p) {\n return false;\n }\n\n for (var i = 1; i < points.length; i++) {\n var p2 = points[i];\n w += windingLine(p[0], p[1], p2[0], p2[1], x, y);\n p = p2;\n } // Close polygon\n\n\n var p0 = points[0];\n\n if (!isAroundEqual(p[0], p0[0]) || !isAroundEqual(p[1], p0[1])) {\n w += windingLine(p[0], p[1], p0[0], p0[1], x, y);\n }\n\n return w !== 0;\n}\n\nexports.contain = contain;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/contain/polygon.js\n// module id = 172\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _dataStackHelper = require(\"../../data/helper/dataStackHelper\");\n\nvar isDimensionStacked = _dataStackHelper.isDimensionStacked;\n\nvar _util = require(\"zrender/lib/core/util\");\n\nvar map = _util.map;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @param {Object} coordSys\n * @param {module:echarts/data/List} data\n * @param {string} valueOrigin lineSeries.option.areaStyle.origin\n */\nfunction prepareDataCoordInfo(coordSys, data, valueOrigin) {\n var baseAxis = coordSys.getBaseAxis();\n var valueAxis = coordSys.getOtherAxis(baseAxis);\n var valueStart = getValueStart(valueAxis, valueOrigin);\n var baseAxisDim = baseAxis.dim;\n var valueAxisDim = valueAxis.dim;\n var valueDim = data.mapDimension(valueAxisDim);\n var baseDim = data.mapDimension(baseAxisDim);\n var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0;\n var dims = map(coordSys.dimensions, function (coordDim) {\n return data.mapDimension(coordDim);\n });\n var stacked;\n var stackResultDim = data.getCalculationInfo('stackResultDimension');\n\n if (stacked |= isDimensionStacked(data, dims[0]\n /*, dims[1]*/\n )) {\n // jshint ignore:line\n dims[0] = stackResultDim;\n }\n\n if (stacked |= isDimensionStacked(data, dims[1]\n /*, dims[0]*/\n )) {\n // jshint ignore:line\n dims[1] = stackResultDim;\n }\n\n return {\n dataDimsForPoint: dims,\n valueStart: valueStart,\n valueAxisDim: valueAxisDim,\n baseAxisDim: baseAxisDim,\n stacked: !!stacked,\n valueDim: valueDim,\n baseDim: baseDim,\n baseDataOffset: baseDataOffset,\n stackedOverDimension: data.getCalculationInfo('stackedOverDimension')\n };\n}\n\nfunction getValueStart(valueAxis, valueOrigin) {\n var valueStart = 0;\n var extent = valueAxis.scale.getExtent();\n\n if (valueOrigin === 'start') {\n valueStart = extent[0];\n } else if (valueOrigin === 'end') {\n valueStart = extent[1];\n } // auto\n else {\n // Both positive\n if (extent[0] > 0) {\n valueStart = extent[0];\n } // Both negative\n else if (extent[1] < 0) {\n valueStart = extent[1];\n } // If is one positive, and one negative, onZero shall be true\n\n }\n\n return valueStart;\n}\n\nfunction getStackedOnPoint(dataCoordInfo, coordSys, data, idx) {\n var value = NaN;\n\n if (dataCoordInfo.stacked) {\n value = data.get(data.getCalculationInfo('stackedOverDimension'), idx);\n }\n\n if (isNaN(value)) {\n value = dataCoordInfo.valueStart;\n }\n\n var baseDataOffset = dataCoordInfo.baseDataOffset;\n var stackedData = [];\n stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx);\n stackedData[1 - baseDataOffset] = value;\n return coordSys.dataToPoint(stackedData);\n}\n\nexports.prepareDataCoordInfo = prepareDataCoordInfo;\nexports.getStackedOnPoint = getStackedOnPoint;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/line/helper.js\n// module id = 173\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar Path = require(\"zrender/lib/graphic/Path\");\n\nvar vec2 = require(\"zrender/lib/core/vector\");\n\nvar fixClipWithShadow = require(\"zrender/lib/graphic/helper/fixClipWithShadow\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Poly path support NaN point\nvar vec2Min = vec2.min;\nvar vec2Max = vec2.max;\nvar scaleAndAdd = vec2.scaleAndAdd;\nvar v2Copy = vec2.copy; // Temporary variable\n\nvar v = [];\nvar cp0 = [];\nvar cp1 = [];\n\nfunction isPointNull(p) {\n return isNaN(p[0]) || isNaN(p[1]);\n}\n\nfunction drawSegment(ctx, points, start, segLen, allLen, dir, smoothMin, smoothMax, smooth, smoothMonotone, connectNulls) {\n // if (smoothMonotone == null) {\n // if (isMono(points, 'x')) {\n // return drawMono(ctx, points, start, segLen, allLen,\n // dir, smoothMin, smoothMax, smooth, 'x', connectNulls);\n // }\n // else if (isMono(points, 'y')) {\n // return drawMono(ctx, points, start, segLen, allLen,\n // dir, smoothMin, smoothMax, smooth, 'y', connectNulls);\n // }\n // else {\n // return drawNonMono.apply(this, arguments);\n // }\n // }\n // else if (smoothMonotone !== 'none' && isMono(points, smoothMonotone)) {\n // return drawMono.apply(this, arguments);\n // }\n // else {\n // return drawNonMono.apply(this, arguments);\n // }\n if (smoothMonotone === 'none' || !smoothMonotone) {\n return drawNonMono.apply(this, arguments);\n } else {\n return drawMono.apply(this, arguments);\n }\n}\n/**\n * Check if points is in monotone.\n *\n * @param {number[][]} points Array of points which is in [x, y] form\n * @param {string} smoothMonotone 'x', 'y', or 'none', stating for which\n * dimension that is checking.\n * If is 'none', `drawNonMono` should be\n * called.\n * If is undefined, either being monotone\n * in 'x' or 'y' will call `drawMono`.\n */\n// function isMono(points, smoothMonotone) {\n// if (points.length <= 1) {\n// return true;\n// }\n// var dim = smoothMonotone === 'x' ? 0 : 1;\n// var last = points[0][dim];\n// var lastDiff = 0;\n// for (var i = 1; i < points.length; ++i) {\n// var diff = points[i][dim] - last;\n// if (!isNaN(diff) && !isNaN(lastDiff)\n// && diff !== 0 && lastDiff !== 0\n// && ((diff >= 0) !== (lastDiff >= 0))\n// ) {\n// return false;\n// }\n// if (!isNaN(diff) && diff !== 0) {\n// lastDiff = diff;\n// last = points[i][dim];\n// }\n// }\n// return true;\n// }\n\n/**\n * Draw smoothed line in monotone, in which only vertical or horizontal bezier\n * control points will be used. This should be used when points are monotone\n * either in x or y dimension.\n */\n\n\nfunction drawMono(ctx, points, start, segLen, allLen, dir, smoothMin, smoothMax, smooth, smoothMonotone, connectNulls) {\n var prevIdx = 0;\n var idx = start;\n\n for (var k = 0; k < segLen; k++) {\n var p = points[idx];\n\n if (idx >= allLen || idx < 0) {\n break;\n }\n\n if (isPointNull(p)) {\n if (connectNulls) {\n idx += dir;\n continue;\n }\n\n break;\n }\n\n if (idx === start) {\n ctx[dir > 0 ? 'moveTo' : 'lineTo'](p[0], p[1]);\n } else {\n if (smooth > 0) {\n var prevP = points[prevIdx];\n var dim = smoothMonotone === 'y' ? 1 : 0; // Length of control point to p, either in x or y, but not both\n\n var ctrlLen = (p[dim] - prevP[dim]) * smooth;\n v2Copy(cp0, prevP);\n cp0[dim] = prevP[dim] + ctrlLen;\n v2Copy(cp1, p);\n cp1[dim] = p[dim] - ctrlLen;\n ctx.bezierCurveTo(cp0[0], cp0[1], cp1[0], cp1[1], p[0], p[1]);\n } else {\n ctx.lineTo(p[0], p[1]);\n }\n }\n\n prevIdx = idx;\n idx += dir;\n }\n\n return k;\n}\n/**\n * Draw smoothed line in non-monotone, in may cause undesired curve in extreme\n * situations. This should be used when points are non-monotone neither in x or\n * y dimension.\n */\n\n\nfunction drawNonMono(ctx, points, start, segLen, allLen, dir, smoothMin, smoothMax, smooth, smoothMonotone, connectNulls) {\n var prevIdx = 0;\n var idx = start;\n\n for (var k = 0; k < segLen; k++) {\n var p = points[idx];\n\n if (idx >= allLen || idx < 0) {\n break;\n }\n\n if (isPointNull(p)) {\n if (connectNulls) {\n idx += dir;\n continue;\n }\n\n break;\n }\n\n if (idx === start) {\n ctx[dir > 0 ? 'moveTo' : 'lineTo'](p[0], p[1]);\n v2Copy(cp0, p);\n } else {\n if (smooth > 0) {\n var nextIdx = idx + dir;\n var nextP = points[nextIdx];\n\n if (connectNulls) {\n // Find next point not null\n while (nextP && isPointNull(points[nextIdx])) {\n nextIdx += dir;\n nextP = points[nextIdx];\n }\n }\n\n var ratioNextSeg = 0.5;\n var prevP = points[prevIdx];\n var nextP = points[nextIdx]; // Last point\n\n if (!nextP || isPointNull(nextP)) {\n v2Copy(cp1, p);\n } else {\n // If next data is null in not connect case\n if (isPointNull(nextP) && !connectNulls) {\n nextP = p;\n }\n\n vec2.sub(v, nextP, prevP);\n var lenPrevSeg;\n var lenNextSeg;\n\n if (smoothMonotone === 'x' || smoothMonotone === 'y') {\n var dim = smoothMonotone === 'x' ? 0 : 1;\n lenPrevSeg = Math.abs(p[dim] - prevP[dim]);\n lenNextSeg = Math.abs(p[dim] - nextP[dim]);\n } else {\n lenPrevSeg = vec2.dist(p, prevP);\n lenNextSeg = vec2.dist(p, nextP);\n } // Use ratio of seg length\n\n\n ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);\n scaleAndAdd(cp1, p, v, -smooth * (1 - ratioNextSeg));\n } // Smooth constraint\n\n\n vec2Min(cp0, cp0, smoothMax);\n vec2Max(cp0, cp0, smoothMin);\n vec2Min(cp1, cp1, smoothMax);\n vec2Max(cp1, cp1, smoothMin);\n ctx.bezierCurveTo(cp0[0], cp0[1], cp1[0], cp1[1], p[0], p[1]); // cp0 of next segment\n\n scaleAndAdd(cp0, p, v, smooth * ratioNextSeg);\n } else {\n ctx.lineTo(p[0], p[1]);\n }\n }\n\n prevIdx = idx;\n idx += dir;\n }\n\n return k;\n}\n\nfunction getBoundingBox(points, smoothConstraint) {\n var ptMin = [Infinity, Infinity];\n var ptMax = [-Infinity, -Infinity];\n\n if (smoothConstraint) {\n for (var i = 0; i < points.length; i++) {\n var pt = points[i];\n\n if (pt[0] < ptMin[0]) {\n ptMin[0] = pt[0];\n }\n\n if (pt[1] < ptMin[1]) {\n ptMin[1] = pt[1];\n }\n\n if (pt[0] > ptMax[0]) {\n ptMax[0] = pt[0];\n }\n\n if (pt[1] > ptMax[1]) {\n ptMax[1] = pt[1];\n }\n }\n }\n\n return {\n min: smoothConstraint ? ptMin : ptMax,\n max: smoothConstraint ? ptMax : ptMin\n };\n}\n\nvar Polyline = Path.extend({\n type: 'ec-polyline',\n shape: {\n points: [],\n smooth: 0,\n smoothConstraint: true,\n smoothMonotone: null,\n connectNulls: false\n },\n style: {\n fill: null,\n stroke: '#000'\n },\n brush: fixClipWithShadow(Path.prototype.brush),\n buildPath: function (ctx, shape) {\n var points = shape.points;\n var i = 0;\n var len = points.length;\n var result = getBoundingBox(points, shape.smoothConstraint);\n\n if (shape.connectNulls) {\n // Must remove first and last null values avoid draw error in polygon\n for (; len > 0; len--) {\n if (!isPointNull(points[len - 1])) {\n break;\n }\n }\n\n for (; i < len; i++) {\n if (!isPointNull(points[i])) {\n break;\n }\n }\n }\n\n while (i < len) {\n i += drawSegment(ctx, points, i, len, len, 1, result.min, result.max, shape.smooth, shape.smoothMonotone, shape.connectNulls) + 1;\n }\n }\n});\nvar Polygon = Path.extend({\n type: 'ec-polygon',\n shape: {\n points: [],\n // Offset between stacked base points and points\n stackedOnPoints: [],\n smooth: 0,\n stackedOnSmooth: 0,\n smoothConstraint: true,\n smoothMonotone: null,\n connectNulls: false\n },\n brush: fixClipWithShadow(Path.prototype.brush),\n buildPath: function (ctx, shape) {\n var points = shape.points;\n var stackedOnPoints = shape.stackedOnPoints;\n var i = 0;\n var len = points.length;\n var smoothMonotone = shape.smoothMonotone;\n var bbox = getBoundingBox(points, shape.smoothConstraint);\n var stackedOnBBox = getBoundingBox(stackedOnPoints, shape.smoothConstraint);\n\n if (shape.connectNulls) {\n // Must remove first and last null values avoid draw error in polygon\n for (; len > 0; len--) {\n if (!isPointNull(points[len - 1])) {\n break;\n }\n }\n\n for (; i < len; i++) {\n if (!isPointNull(points[i])) {\n break;\n }\n }\n }\n\n while (i < len) {\n var k = drawSegment(ctx, points, i, len, len, 1, bbox.min, bbox.max, shape.smooth, smoothMonotone, shape.connectNulls);\n drawSegment(ctx, stackedOnPoints, i + k - 1, k, len, -1, stackedOnBBox.min, stackedOnBBox.max, shape.stackedOnSmooth, smoothMonotone, shape.connectNulls);\n i += k + 1;\n ctx.closePath();\n }\n }\n});\nexports.Polyline = Polyline;\nexports.Polygon = Polygon;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/line/poly.js\n// module id = 174\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar ComponentModel = require(\"../../model/Component\");\n\nvar axisModelCreator = require(\"../axisModelCreator\");\n\nvar axisModelCommonMixin = require(\"../axisModelCommonMixin\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar AxisModel = ComponentModel.extend({\n type: 'cartesian2dAxis',\n\n /**\n * @type {module:echarts/coord/cartesian/Axis2D}\n */\n axis: null,\n\n /**\n * @override\n */\n init: function () {\n AxisModel.superApply(this, 'init', arguments);\n this.resetRange();\n },\n\n /**\n * @override\n */\n mergeOption: function () {\n AxisModel.superApply(this, 'mergeOption', arguments);\n this.resetRange();\n },\n\n /**\n * @override\n */\n restoreData: function () {\n AxisModel.superApply(this, 'restoreData', arguments);\n this.resetRange();\n },\n\n /**\n * @override\n * @return {module:echarts/model/Component}\n */\n getCoordSysModel: function () {\n return this.ecModel.queryComponents({\n mainType: 'grid',\n index: this.option.gridIndex,\n id: this.option.gridId\n })[0];\n }\n});\n\nfunction getAxisType(axisDim, option) {\n // Default axis with data is category axis\n return option.type || (option.data ? 'category' : 'value');\n}\n\nzrUtil.merge(AxisModel.prototype, axisModelCommonMixin);\nvar extraOption = {\n // gridIndex: 0,\n // gridId: '',\n // Offset is for multiple axis on the same position\n offset: 0\n};\naxisModelCreator('x', AxisModel, getAxisType, extraOption);\naxisModelCreator('y', AxisModel, getAxisType, extraOption);\nvar _default = AxisModel;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/coord/cartesian/AxisModel.js\n// module id = 175\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar defaultOption = {\n show: true,\n zlevel: 0,\n z: 0,\n // Inverse the axis.\n inverse: false,\n // Axis name displayed.\n name: '',\n // 'start' | 'middle' | 'end'\n nameLocation: 'end',\n // By degree. By defualt auto rotate by nameLocation.\n nameRotate: null,\n nameTruncate: {\n maxWidth: null,\n ellipsis: '...',\n placeholder: '.'\n },\n // Use global text style by default.\n nameTextStyle: {},\n // The gap between axisName and axisLine.\n nameGap: 15,\n // Default `false` to support tooltip.\n silent: false,\n // Default `false` to avoid legacy user event listener fail.\n triggerEvent: false,\n tooltip: {\n show: false\n },\n axisPointer: {},\n axisLine: {\n show: true,\n onZero: true,\n onZeroAxisIndex: null,\n lineStyle: {\n color: '#333',\n width: 1,\n type: 'solid'\n },\n // The arrow at both ends the the axis.\n symbol: ['none', 'none'],\n symbolSize: [10, 15]\n },\n axisTick: {\n show: true,\n // Whether axisTick is inside the grid or outside the grid.\n inside: false,\n // The length of axisTick.\n length: 5,\n lineStyle: {\n width: 1\n }\n },\n axisLabel: {\n show: true,\n // Whether axisLabel is inside the grid or outside the grid.\n inside: false,\n rotate: 0,\n // true | false | null/undefined (auto)\n showMinLabel: null,\n // true | false | null/undefined (auto)\n showMaxLabel: null,\n margin: 8,\n // formatter: null,\n fontSize: 12\n },\n splitLine: {\n show: true,\n lineStyle: {\n color: ['#ccc'],\n width: 1,\n type: 'solid'\n }\n },\n splitArea: {\n show: false,\n areaStyle: {\n color: ['rgba(250,250,250,0.3)', 'rgba(200,200,200,0.3)']\n }\n }\n};\nvar axisDefault = {};\naxisDefault.categoryAxis = zrUtil.merge({\n // The gap at both ends of the axis. For categoryAxis, boolean.\n boundaryGap: true,\n // Set false to faster category collection.\n // Only usefull in the case like: category is\n // ['2012-01-01', '2012-01-02', ...], where the input\n // data has been ensured not duplicate and is large data.\n // null means \"auto\":\n // if axis.data provided, do not deduplication,\n // else do deduplication.\n deduplication: null,\n // splitArea: {\n // show: false\n // },\n splitLine: {\n show: false\n },\n axisTick: {\n // If tick is align with label when boundaryGap is true\n alignWithLabel: false,\n interval: 'auto'\n },\n axisLabel: {\n interval: 'auto'\n }\n}, defaultOption);\naxisDefault.valueAxis = zrUtil.merge({\n // The gap at both ends of the axis. For value axis, [GAP, GAP], where\n // `GAP` can be an absolute pixel number (like `35`), or percent (like `'30%'`)\n boundaryGap: [0, 0],\n // TODO\n // min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60]\n // Min value of the axis. can be:\n // + a number\n // + 'dataMin': use the min value in data.\n // + null/undefined: auto decide min value (consider pretty look and boundaryGap).\n // min: null,\n // Max value of the axis. can be:\n // + a number\n // + 'dataMax': use the max value in data.\n // + null/undefined: auto decide max value (consider pretty look and boundaryGap).\n // max: null,\n // Readonly prop, specifies start value of the range when using data zoom.\n // rangeStart: null\n // Readonly prop, specifies end value of the range when using data zoom.\n // rangeEnd: null\n // Optional value can be:\n // + `false`: always include value 0.\n // + `true`: the extent do not consider value 0.\n // scale: false,\n // AxisTick and axisLabel and splitLine are caculated based on splitNumber.\n splitNumber: 5 // Interval specifies the span of the ticks is mandatorily.\n // interval: null\n // Specify min interval when auto calculate tick interval.\n // minInterval: null\n // Specify max interval when auto calculate tick interval.\n // maxInterval: null\n\n}, defaultOption);\naxisDefault.timeAxis = zrUtil.defaults({\n scale: true,\n min: 'dataMin',\n max: 'dataMax'\n}, axisDefault.valueAxis);\naxisDefault.logAxis = zrUtil.defaults({\n scale: true,\n logBase: 10\n}, axisDefault.valueAxis);\nvar _default = axisDefault;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/coord/axisDefault.js\n// module id = 176\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Can only be called after coordinate system creation stage.\n * (Can be called before coordinate system update stage).\n *\n * @param {Object} opt {labelInside}\n * @return {Object} {\n * position, rotation, labelDirection, labelOffset,\n * tickDirection, labelRotate, z2\n * }\n */\nfunction layout(gridModel, axisModel, opt) {\n opt = opt || {};\n var grid = gridModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0];\n var rawAxisPosition = axis.position;\n var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition;\n var axisDim = axis.dim;\n var rect = grid.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var idx = {\n left: 0,\n right: 1,\n top: 0,\n bottom: 1,\n onZero: 2\n };\n var axisOffset = axisModel.get('offset') || 0;\n var posBound = axisDim === 'x' ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] : [rectBound[0] - axisOffset, rectBound[1] + axisOffset];\n\n if (otherAxisOnZeroOf) {\n var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0));\n posBound[idx.onZero] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]);\n } // Axis position\n\n\n layout.position = [axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0], axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3]]; // Axis rotation\n\n layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1); // Tick and label direction, x y is axisDim\n\n var dirMap = {\n top: -1,\n bottom: 1,\n left: -1,\n right: 1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];\n layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx.onZero] : 0;\n\n if (axisModel.get('axisTick.inside')) {\n layout.tickDirection = -layout.tickDirection;\n }\n\n if (zrUtil.retrieve(opt.labelInside, axisModel.get('axisLabel.inside'))) {\n layout.labelDirection = -layout.labelDirection;\n } // Special label rotation\n\n\n var labelRotate = axisModel.get('axisLabel.rotate');\n layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate; // Over splitLine and splitArea\n\n layout.z2 = 1;\n return layout;\n}\n\nexports.layout = layout;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/coord/cartesian/cartesianAxisHelper.js\n// module id = 177\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar SeriesModel = require(\"../../model/Series\");\n\nvar createListFromArray = require(\"../helper/createListFromArray\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar _default = SeriesModel.extend({\n type: 'series.__base_bar__',\n getInitialData: function (option, ecModel) {\n return createListFromArray(this.getSource(), this);\n },\n getMarkerPosition: function (value) {\n var coordSys = this.coordinateSystem;\n\n if (coordSys) {\n // PENDING if clamp ?\n var pt = coordSys.dataToPoint(coordSys.clampData(value));\n var data = this.getData();\n var offset = data.getLayout('offset');\n var size = data.getLayout('size');\n var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1;\n pt[offsetIndex] += offset + size / 2;\n return pt;\n }\n\n return [NaN, NaN];\n },\n defaultOption: {\n zlevel: 0,\n // 一级层叠\n z: 2,\n // 二级层叠\n coordinateSystem: 'cartesian2d',\n legendHoverLink: true,\n // stack: null\n // Cartesian coordinate system\n // xAxisIndex: 0,\n // yAxisIndex: 0,\n // 最小高度改为0\n barMinHeight: 0,\n // 最小角度为0,仅对极坐标系下的柱状图有效\n barMinAngle: 0,\n // cursor: null,\n large: false,\n largeThreshold: 400,\n progressive: 3e3,\n progressiveChunkMode: 'mod',\n // barMaxWidth: null,\n // 默认自适应\n // barWidth: null,\n // 柱间距离,默认为柱形宽度的30%,可设固定值\n // barGap: '30%',\n // 类目间柱形距离,默认为类目间距的20%,可设固定值\n // barCategoryGap: '20%',\n // label: {\n // show: false\n // },\n itemStyle: {},\n emphasis: {}\n }\n});\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/bar/BaseBarSeries.js\n// module id = 178\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar graphic = require(\"../../util/graphic\");\n\nvar _labelHelper = require(\"../helper/labelHelper\");\n\nvar getDefaultLabel = _labelHelper.getDefaultLabel;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction setLabel(normalStyle, hoverStyle, itemModel, color, seriesModel, dataIndex, labelPositionOutside) {\n var labelModel = itemModel.getModel('label');\n var hoverLabelModel = itemModel.getModel('emphasis.label');\n graphic.setLabelStyle(normalStyle, hoverStyle, labelModel, hoverLabelModel, {\n labelFetcher: seriesModel,\n labelDataIndex: dataIndex,\n defaultText: getDefaultLabel(seriesModel.getData(), dataIndex),\n isRectText: true,\n autoColor: color\n });\n fixPosition(normalStyle);\n fixPosition(hoverStyle);\n}\n\nfunction fixPosition(style, labelPositionOutside) {\n if (style.textPosition === 'outside') {\n style.textPosition = labelPositionOutside;\n }\n}\n\nexports.setLabel = setLabel;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/bar/helper.js\n// module id = 179\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../echarts\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction _default(seriesType, actionInfos) {\n zrUtil.each(actionInfos, function (actionInfo) {\n actionInfo.update = 'updateView';\n /**\n * @payload\n * @property {string} seriesName\n * @property {string} name\n */\n\n echarts.registerAction(actionInfo, function (payload, ecModel) {\n var selected = {};\n ecModel.eachComponent({\n mainType: 'series',\n subType: seriesType,\n query: payload\n }, function (seriesModel) {\n if (seriesModel[actionInfo.method]) {\n seriesModel[actionInfo.method](payload.name, payload.dataIndex);\n }\n\n var data = seriesModel.getData(); // Create selected map\n\n data.each(function (idx) {\n var name = data.getName(idx);\n selected[name] = seriesModel.isSelected(name) || false;\n });\n });\n return {\n name: payload.name,\n selected: selected\n };\n });\n });\n}\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/action/createDataSelectAction.js\n// module id = 180\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar RoamController = require(\"./RoamController\");\n\nvar roamHelper = require(\"../../component/helper/roamHelper\");\n\nvar _cursorHelper = require(\"../../component/helper/cursorHelper\");\n\nvar onIrrelevantElement = _cursorHelper.onIrrelevantElement;\n\nvar graphic = require(\"../../util/graphic\");\n\nvar geoSourceManager = require(\"../../coord/geo/geoSourceManager\");\n\nvar _component = require(\"../../util/component\");\n\nvar getUID = _component.getUID;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction getFixedItemStyle(model, scale) {\n var itemStyle = model.getItemStyle();\n var areaColor = model.get('areaColor'); // If user want the color not to be changed when hover,\n // they should both set areaColor and color to be null.\n\n if (areaColor != null) {\n itemStyle.fill = areaColor;\n }\n\n return itemStyle;\n}\n\nfunction updateMapSelectHandler(mapDraw, mapOrGeoModel, regionsGroup, api, fromView) {\n regionsGroup.off('click');\n regionsGroup.off('mousedown');\n\n if (mapOrGeoModel.get('selectedMode')) {\n regionsGroup.on('mousedown', function () {\n mapDraw._mouseDownFlag = true;\n });\n regionsGroup.on('click', function (e) {\n if (!mapDraw._mouseDownFlag) {\n return;\n }\n\n mapDraw._mouseDownFlag = false;\n var el = e.target;\n\n while (!el.__regions) {\n el = el.parent;\n }\n\n if (!el) {\n return;\n }\n\n var action = {\n type: (mapOrGeoModel.mainType === 'geo' ? 'geo' : 'map') + 'ToggleSelect',\n batch: zrUtil.map(el.__regions, function (region) {\n return {\n name: region.name,\n from: fromView.uid\n };\n })\n };\n action[mapOrGeoModel.mainType + 'Id'] = mapOrGeoModel.id;\n api.dispatchAction(action);\n updateMapSelected(mapOrGeoModel, regionsGroup);\n });\n }\n}\n\nfunction updateMapSelected(mapOrGeoModel, regionsGroup) {\n // FIXME\n regionsGroup.eachChild(function (otherRegionEl) {\n zrUtil.each(otherRegionEl.__regions, function (region) {\n otherRegionEl.trigger(mapOrGeoModel.isSelected(region.name) ? 'emphasis' : 'normal');\n });\n });\n}\n/**\n * @alias module:echarts/component/helper/MapDraw\n * @param {module:echarts/ExtensionAPI} api\n * @param {boolean} updateGroup\n */\n\n\nfunction MapDraw(api, updateGroup) {\n var group = new graphic.Group();\n /**\n * @type {string}\n * @private\n */\n\n this.uid = getUID('ec_map_draw');\n /**\n * @type {module:echarts/component/helper/RoamController}\n * @private\n */\n\n this._controller = new RoamController(api.getZr());\n /**\n * @type {Object} {target, zoom, zoomLimit}\n * @private\n */\n\n this._controllerHost = {\n target: updateGroup ? group : null\n };\n /**\n * @type {module:zrender/container/Group}\n * @readOnly\n */\n\n this.group = group;\n /**\n * @type {boolean}\n * @private\n */\n\n this._updateGroup = updateGroup;\n /**\n * This flag is used to make sure that only one among\n * `pan`, `zoom`, `click` can occurs, otherwise 'selected'\n * action may be triggered when `pan`, which is unexpected.\n * @type {booelan}\n */\n\n this._mouseDownFlag;\n /**\n * @type {string}\n */\n\n this._mapName;\n /**\n * @type {boolean}\n */\n\n this._initialized;\n /**\n * @type {module:zrender/container/Group}\n */\n\n group.add(this._regionsGroup = new graphic.Group());\n /**\n * @type {module:zrender/container/Group}\n */\n\n group.add(this._backgroundGroup = new graphic.Group());\n}\n\nMapDraw.prototype = {\n constructor: MapDraw,\n draw: function (mapOrGeoModel, ecModel, api, fromView, payload) {\n var isGeo = mapOrGeoModel.mainType === 'geo'; // Map series has data. GEO model that controlled by map series\n // will be assigned with map data. Other GEO model has no data.\n\n var data = mapOrGeoModel.getData && mapOrGeoModel.getData();\n isGeo && ecModel.eachComponent({\n mainType: 'series',\n subType: 'map'\n }, function (mapSeries) {\n if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) {\n data = mapSeries.getData();\n }\n });\n var geo = mapOrGeoModel.coordinateSystem;\n\n this._updateBackground(geo);\n\n var regionsGroup = this._regionsGroup;\n var group = this.group;\n var scale = geo.scale;\n var transform = {\n position: geo.position,\n scale: scale\n }; // No animation when first draw or in action\n\n if (!regionsGroup.childAt(0) || payload) {\n group.attr(transform);\n } else {\n graphic.updateProps(group, transform, mapOrGeoModel);\n }\n\n regionsGroup.removeAll();\n var itemStyleAccessPath = ['itemStyle'];\n var hoverItemStyleAccessPath = ['emphasis', 'itemStyle'];\n var labelAccessPath = ['label'];\n var hoverLabelAccessPath = ['emphasis', 'label'];\n var nameMap = zrUtil.createHashMap();\n zrUtil.each(geo.regions, function (region) {\n // Consider in GeoJson properties.name may be duplicated, for example,\n // there is multiple region named \"United Kindom\" or \"France\" (so many\n // colonies). And it is not appropriate to merge them in geo, which\n // will make them share the same label and bring trouble in label\n // location calculation.\n var regionGroup = nameMap.get(region.name) || nameMap.set(region.name, new graphic.Group());\n var compoundPath = new graphic.CompoundPath({\n shape: {\n paths: []\n }\n });\n regionGroup.add(compoundPath);\n var regionModel = mapOrGeoModel.getRegionModel(region.name) || mapOrGeoModel;\n var itemStyleModel = regionModel.getModel(itemStyleAccessPath);\n var hoverItemStyleModel = regionModel.getModel(hoverItemStyleAccessPath);\n var itemStyle = getFixedItemStyle(itemStyleModel, scale);\n var hoverItemStyle = getFixedItemStyle(hoverItemStyleModel, scale);\n var labelModel = regionModel.getModel(labelAccessPath);\n var hoverLabelModel = regionModel.getModel(hoverLabelAccessPath);\n var dataIdx; // Use the itemStyle in data if has data\n\n if (data) {\n dataIdx = data.indexOfName(region.name); // Only visual color of each item will be used. It can be encoded by dataRange\n // But visual color of series is used in symbol drawing\n //\n // Visual color for each series is for the symbol draw\n\n var visualColor = data.getItemVisual(dataIdx, 'color', true);\n\n if (visualColor) {\n itemStyle.fill = visualColor;\n }\n }\n\n zrUtil.each(region.geometries, function (geometry) {\n if (geometry.type !== 'polygon') {\n return;\n }\n\n compoundPath.shape.paths.push(new graphic.Polygon({\n shape: {\n points: geometry.exterior\n }\n }));\n\n for (var i = 0; i < (geometry.interiors ? geometry.interiors.length : 0); i++) {\n compoundPath.shape.paths.push(new graphic.Polygon({\n shape: {\n points: geometry.interiors[i]\n }\n }));\n }\n });\n compoundPath.setStyle(itemStyle);\n compoundPath.style.strokeNoScale = true;\n compoundPath.culling = true; // Label\n\n var showLabel = labelModel.get('show');\n var hoverShowLabel = hoverLabelModel.get('show');\n var isDataNaN = data && isNaN(data.get(data.mapDimension('value'), dataIdx));\n var itemLayout = data && data.getItemLayout(dataIdx); // In the following cases label will be drawn\n // 1. In map series and data value is NaN\n // 2. In geo component\n // 4. Region has no series legendSymbol, which will be add a showLabel flag in mapSymbolLayout\n\n if (isGeo || isDataNaN && (showLabel || hoverShowLabel) || itemLayout && itemLayout.showLabel) {\n var query = !isGeo ? dataIdx : region.name;\n var labelFetcher; // Consider dataIdx not found.\n\n if (!data || dataIdx >= 0) {\n labelFetcher = mapOrGeoModel;\n }\n\n var textEl = new graphic.Text({\n position: region.center.slice(),\n // FIXME\n // label rotation is not support yet in geo or regions of series-map\n // that has no data. The rotation will be effected by this `scale`.\n // So needed to change to RectText?\n scale: [1 / scale[0], 1 / scale[1]],\n z2: 10,\n silent: true\n });\n graphic.setLabelStyle(textEl.style, textEl.hoverStyle = {}, labelModel, hoverLabelModel, {\n labelFetcher: labelFetcher,\n labelDataIndex: query,\n defaultText: region.name,\n useInsideStyle: false\n }, {\n textAlign: 'center',\n textVerticalAlign: 'middle'\n });\n regionGroup.add(textEl);\n } // setItemGraphicEl, setHoverStyle after all polygons and labels\n // are added to the rigionGroup\n\n\n if (data) {\n data.setItemGraphicEl(dataIdx, regionGroup);\n } else {\n var regionModel = mapOrGeoModel.getRegionModel(region.name); // Package custom mouse event for geo component\n\n compoundPath.eventData = {\n componentType: 'geo',\n componentIndex: mapOrGeoModel.componentIndex,\n geoIndex: mapOrGeoModel.componentIndex,\n name: region.name,\n region: regionModel && regionModel.option || {}\n };\n }\n\n var groupRegions = regionGroup.__regions || (regionGroup.__regions = []);\n groupRegions.push(region);\n graphic.setHoverStyle(regionGroup, hoverItemStyle, {\n hoverSilentOnTouch: !!mapOrGeoModel.get('selectedMode')\n });\n regionsGroup.add(regionGroup);\n });\n\n this._updateController(mapOrGeoModel, ecModel, api);\n\n updateMapSelectHandler(this, mapOrGeoModel, regionsGroup, api, fromView);\n updateMapSelected(mapOrGeoModel, regionsGroup);\n },\n remove: function () {\n this._regionsGroup.removeAll();\n\n this._backgroundGroup.removeAll();\n\n this._controller.dispose();\n\n this._mapName && geoSourceManager.removeGraphic(this._mapName, this.uid);\n this._mapName = null;\n this._controllerHost = {};\n },\n _updateBackground: function (geo) {\n var mapName = geo.map;\n\n if (this._mapName !== mapName) {\n zrUtil.each(geoSourceManager.makeGraphic(mapName, this.uid), function (root) {\n this._backgroundGroup.add(root);\n }, this);\n }\n\n this._mapName = mapName;\n },\n _updateController: function (mapOrGeoModel, ecModel, api) {\n var geo = mapOrGeoModel.coordinateSystem;\n var controller = this._controller;\n var controllerHost = this._controllerHost;\n controllerHost.zoomLimit = mapOrGeoModel.get('scaleLimit');\n controllerHost.zoom = geo.getZoom(); // roamType is will be set default true if it is null\n\n controller.enable(mapOrGeoModel.get('roam') || false);\n var mainType = mapOrGeoModel.mainType;\n\n function makeActionBase() {\n var action = {\n type: 'geoRoam',\n componentType: mainType\n };\n action[mainType + 'Id'] = mapOrGeoModel.id;\n return action;\n }\n\n controller.off('pan').on('pan', function (e) {\n this._mouseDownFlag = false;\n roamHelper.updateViewOnPan(controllerHost, e.dx, e.dy);\n api.dispatchAction(zrUtil.extend(makeActionBase(), {\n dx: e.dx,\n dy: e.dy\n }));\n }, this);\n controller.off('zoom').on('zoom', function (e) {\n this._mouseDownFlag = false;\n roamHelper.updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY);\n api.dispatchAction(zrUtil.extend(makeActionBase(), {\n zoom: e.scale,\n originX: e.originX,\n originY: e.originY\n }));\n\n if (this._updateGroup) {\n var scale = this.group.scale;\n\n this._regionsGroup.traverse(function (el) {\n if (el.type === 'text') {\n el.attr('scale', [1 / scale[0], 1 / scale[1]]);\n }\n });\n }\n }, this);\n controller.setPointerChecker(function (e, x, y) {\n return geo.getViewRectAfterRoam().contain(x, y) && !onIrrelevantElement(e, api, mapOrGeoModel);\n });\n }\n};\nvar _default = MapDraw;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/helper/MapDraw.js\n// module id = 181\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../../echarts\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar ATTR = '\\0_ec_interaction_mutex';\n\nfunction take(zr, resourceKey, userKey) {\n var store = getStore(zr);\n store[resourceKey] = userKey;\n}\n\nfunction release(zr, resourceKey, userKey) {\n var store = getStore(zr);\n var uKey = store[resourceKey];\n\n if (uKey === userKey) {\n store[resourceKey] = null;\n }\n}\n\nfunction isTaken(zr, resourceKey) {\n return !!getStore(zr)[resourceKey];\n}\n\nfunction getStore(zr) {\n return zr[ATTR] || (zr[ATTR] = {});\n}\n/**\n * payload: {\n * type: 'takeGlobalCursor',\n * key: 'dataZoomSelect', or 'brush', or ...,\n * If no userKey, release global cursor.\n * }\n */\n\n\necharts.registerAction({\n type: 'takeGlobalCursor',\n event: 'globalCursorTaken',\n update: 'update'\n}, function () {});\nexports.take = take;\nexports.release = release;\nexports.isTaken = isTaken;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/helper/interactionMutex.js\n// module id = 182\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../echarts\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar _roamHelper = require(\"./roamHelper\");\n\nvar updateCenterAndZoom = _roamHelper.updateCenterAndZoom;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @payload\n * @property {string} [componentType=series]\n * @property {number} [dx]\n * @property {number} [dy]\n * @property {number} [zoom]\n * @property {number} [originX]\n * @property {number} [originY]\n */\necharts.registerAction({\n type: 'geoRoam',\n event: 'geoRoam',\n update: 'updateTransform'\n}, function (payload, ecModel) {\n var componentType = payload.componentType || 'series';\n ecModel.eachComponent({\n mainType: componentType,\n query: payload\n }, function (componentModel) {\n var geo = componentModel.coordinateSystem;\n\n if (geo.type !== 'geo') {\n return;\n }\n\n var res = updateCenterAndZoom(geo, payload, componentModel.get('scaleLimit'));\n componentModel.setCenter && componentModel.setCenter(res.center);\n componentModel.setZoom && componentModel.setZoom(res.zoom); // All map series with same `map` use the same geo coordinate system\n // So the center and zoom must be in sync. Include the series not selected by legend\n\n if (componentType === 'series') {\n zrUtil.each(componentModel.seriesGroup, function (seriesModel) {\n seriesModel.setCenter(res.center);\n seriesModel.setZoom(res.zoom);\n });\n }\n });\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/action/geoRoam.js\n// module id = 183\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Link lists and struct (graph or tree)\n */\nvar each = zrUtil.each;\nvar DATAS = '\\0__link_datas';\nvar MAIN_DATA = '\\0__link_mainData'; // Caution:\n// In most case, either list or its shallow clones (see list.cloneShallow)\n// is active in echarts process. So considering heap memory consumption,\n// we do not clone tree or graph, but share them among list and its shallow clones.\n// But in some rare case, we have to keep old list (like do animation in chart). So\n// please take care that both the old list and the new list share the same tree/graph.\n\n/**\n * @param {Object} opt\n * @param {module:echarts/data/List} opt.mainData\n * @param {Object} [opt.struct] For example, instance of Graph or Tree.\n * @param {string} [opt.structAttr] designation: list[structAttr] = struct;\n * @param {Object} [opt.datas] {dataType: data},\n * like: {node: nodeList, edge: edgeList}.\n * Should contain mainData.\n * @param {Object} [opt.datasAttr] {dataType: attr},\n * designation: struct[datasAttr[dataType]] = list;\n */\n\nfunction linkList(opt) {\n var mainData = opt.mainData;\n var datas = opt.datas;\n\n if (!datas) {\n datas = {\n main: mainData\n };\n opt.datasAttr = {\n main: 'data'\n };\n }\n\n opt.datas = opt.mainData = null;\n linkAll(mainData, datas, opt); // Porxy data original methods.\n\n each(datas, function (data) {\n each(mainData.TRANSFERABLE_METHODS, function (methodName) {\n data.wrapMethod(methodName, zrUtil.curry(transferInjection, opt));\n });\n }); // Beyond transfer, additional features should be added to `cloneShallow`.\n\n mainData.wrapMethod('cloneShallow', zrUtil.curry(cloneShallowInjection, opt)); // Only mainData trigger change, because struct.update may trigger\n // another changable methods, which may bring about dead lock.\n\n each(mainData.CHANGABLE_METHODS, function (methodName) {\n mainData.wrapMethod(methodName, zrUtil.curry(changeInjection, opt));\n }); // Make sure datas contains mainData.\n\n zrUtil.assert(datas[mainData.dataType] === mainData);\n}\n\nfunction transferInjection(opt, res) {\n if (isMainData(this)) {\n // Transfer datas to new main data.\n var datas = zrUtil.extend({}, this[DATAS]);\n datas[this.dataType] = res;\n linkAll(res, datas, opt);\n } else {\n // Modify the reference in main data to point newData.\n linkSingle(res, this.dataType, this[MAIN_DATA], opt);\n }\n\n return res;\n}\n\nfunction changeInjection(opt, res) {\n opt.struct && opt.struct.update(this);\n return res;\n}\n\nfunction cloneShallowInjection(opt, res) {\n // cloneShallow, which brings about some fragilities, may be inappropriate\n // to be exposed as an API. So for implementation simplicity we can make\n // the restriction that cloneShallow of not-mainData should not be invoked\n // outside, but only be invoked here.\n each(res[DATAS], function (data, dataType) {\n data !== res && linkSingle(data.cloneShallow(), dataType, res, opt);\n });\n return res;\n}\n/**\n * Supplement method to List.\n *\n * @public\n * @param {string} [dataType] If not specified, return mainData.\n * @return {module:echarts/data/List}\n */\n\n\nfunction getLinkedData(dataType) {\n var mainData = this[MAIN_DATA];\n return dataType == null || mainData == null ? mainData : mainData[DATAS][dataType];\n}\n\nfunction isMainData(data) {\n return data[MAIN_DATA] === data;\n}\n\nfunction linkAll(mainData, datas, opt) {\n mainData[DATAS] = {};\n each(datas, function (data, dataType) {\n linkSingle(data, dataType, mainData, opt);\n });\n}\n\nfunction linkSingle(data, dataType, mainData, opt) {\n mainData[DATAS][dataType] = data;\n data[MAIN_DATA] = mainData;\n data.dataType = dataType;\n\n if (opt.struct) {\n data[opt.structAttr] = opt.struct;\n opt.struct[opt.datasAttr[dataType]] = data;\n } // Supplement method.\n\n\n data.getLinkedData = getLinkedData;\n}\n\nvar _default = linkList;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/data/helper/linkList.js\n// module id = 184\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar layout = require(\"../../util/layout\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/*\n* A third-party license is embeded for some of the code in this file:\n* The tree layoutHelper implementation was originally copied from\n* \"d3.js\"(https://github.com/d3/d3-hierarchy) with\n* some modifications made for this project.\n* (see more details in the comment of the specific method below.)\n* The use of the source code of this file is also subject to the terms\n* and consitions of the licence of \"d3.js\" (BSD-3Clause, see\n* ).\n*/\n\n/**\n * @file The layout algorithm of node-link tree diagrams. Here we using Reingold-Tilford algorithm to drawing\n * the tree.\n */\n\n/**\n * Initialize all computational message for following algorithm.\n *\n * @param {module:echarts/data/Tree~TreeNode} root The virtual root of the tree.\n */\nfunction init(root) {\n root.hierNode = {\n defaultAncestor: null,\n ancestor: root,\n prelim: 0,\n modifier: 0,\n change: 0,\n shift: 0,\n i: 0,\n thread: null\n };\n var nodes = [root];\n var node;\n var children;\n\n while (node = nodes.pop()) {\n // jshint ignore:line\n children = node.children;\n\n if (node.isExpand && children.length) {\n var n = children.length;\n\n for (var i = n - 1; i >= 0; i--) {\n var child = children[i];\n child.hierNode = {\n defaultAncestor: null,\n ancestor: child,\n prelim: 0,\n modifier: 0,\n change: 0,\n shift: 0,\n i: i,\n thread: null\n };\n nodes.push(child);\n }\n }\n }\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * Computes a preliminary x coordinate for node. Before that, this function is\n * applied recursively to the children of node, as well as the function\n * apportion(). After spacing out the children by calling executeShifts(), the\n * node is placed to the midpoint of its outermost children.\n *\n * @param {module:echarts/data/Tree~TreeNode} node\n * @param {Function} separation\n */\n\n\nfunction firstWalk(node, separation) {\n var children = node.isExpand ? node.children : [];\n var siblings = node.parentNode.children;\n var subtreeW = node.hierNode.i ? siblings[node.hierNode.i - 1] : null;\n\n if (children.length) {\n executeShifts(node);\n var midPoint = (children[0].hierNode.prelim + children[children.length - 1].hierNode.prelim) / 2;\n\n if (subtreeW) {\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\n node.hierNode.modifier = node.hierNode.prelim - midPoint;\n } else {\n node.hierNode.prelim = midPoint;\n }\n } else if (subtreeW) {\n node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW);\n }\n\n node.parentNode.hierNode.defaultAncestor = apportion(node, subtreeW, node.parentNode.hierNode.defaultAncestor || siblings[0], separation);\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * Computes all real x-coordinates by summing up the modifiers recursively.\n *\n * @param {module:echarts/data/Tree~TreeNode} node\n */\n\n\nfunction secondWalk(node) {\n var nodeX = node.hierNode.prelim + node.parentNode.hierNode.modifier;\n node.setLayout({\n x: nodeX\n }, true);\n node.hierNode.modifier += node.parentNode.hierNode.modifier;\n}\n\nfunction separation(cb) {\n return arguments.length ? cb : defaultSeparation;\n}\n/**\n * Transform the common coordinate to radial coordinate.\n *\n * @param {number} x\n * @param {number} y\n * @return {Object}\n */\n\n\nfunction radialCoordinate(x, y) {\n var radialCoor = {};\n x -= Math.PI / 2;\n radialCoor.x = y * Math.cos(x);\n radialCoor.y = y * Math.sin(x);\n return radialCoor;\n}\n/**\n * Get the layout position of the whole view.\n *\n * @param {module:echarts/model/Series} seriesModel the model object of sankey series\n * @param {module:echarts/ExtensionAPI} api provide the API list that the developer can call\n * @return {module:zrender/core/BoundingRect} size of rect to draw the sankey view\n */\n\n\nfunction getViewRect(seriesModel, api) {\n return layout.getLayoutRect(seriesModel.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n}\n/**\n * All other shifts, applied to the smaller subtrees between w- and w+, are\n * performed by this function.\n *\n * The implementation of this function was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * @param {module:echarts/data/Tree~TreeNode} node\n */\n\n\nfunction executeShifts(node) {\n var children = node.children;\n var n = children.length;\n var shift = 0;\n var change = 0;\n\n while (--n >= 0) {\n var child = children[n];\n child.hierNode.prelim += shift;\n child.hierNode.modifier += shift;\n change += child.hierNode.change;\n shift += child.hierNode.shift + change;\n }\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * The core of the algorithm. Here, a new subtree is combined with the\n * previous subtrees. Threads are used to traverse the inside and outside\n * contours of the left and right subtree up to the highest common level.\n * Whenever two nodes of the inside contours conflict, we compute the left\n * one of the greatest uncommon ancestors using the function nextAncestor()\n * and call moveSubtree() to shift the subtree and prepare the shifts of\n * smaller subtrees. Finally, we add a new thread (if necessary).\n *\n * @param {module:echarts/data/Tree~TreeNode} subtreeV\n * @param {module:echarts/data/Tree~TreeNode} subtreeW\n * @param {module:echarts/data/Tree~TreeNode} ancestor\n * @param {Function} separation\n * @return {module:echarts/data/Tree~TreeNode}\n */\n\n\nfunction apportion(subtreeV, subtreeW, ancestor, separation) {\n if (subtreeW) {\n var nodeOutRight = subtreeV;\n var nodeInRight = subtreeV;\n var nodeOutLeft = nodeInRight.parentNode.children[0];\n var nodeInLeft = subtreeW;\n var sumOutRight = nodeOutRight.hierNode.modifier;\n var sumInRight = nodeInRight.hierNode.modifier;\n var sumOutLeft = nodeOutLeft.hierNode.modifier;\n var sumInLeft = nodeInLeft.hierNode.modifier;\n\n while (nodeInLeft = nextRight(nodeInLeft), nodeInRight = nextLeft(nodeInRight), nodeInLeft && nodeInRight) {\n nodeOutRight = nextRight(nodeOutRight);\n nodeOutLeft = nextLeft(nodeOutLeft);\n nodeOutRight.hierNode.ancestor = subtreeV;\n var shift = nodeInLeft.hierNode.prelim + sumInLeft - nodeInRight.hierNode.prelim - sumInRight + separation(nodeInLeft, nodeInRight);\n\n if (shift > 0) {\n moveSubtree(nextAncestor(nodeInLeft, subtreeV, ancestor), subtreeV, shift);\n sumInRight += shift;\n sumOutRight += shift;\n }\n\n sumInLeft += nodeInLeft.hierNode.modifier;\n sumInRight += nodeInRight.hierNode.modifier;\n sumOutRight += nodeOutRight.hierNode.modifier;\n sumOutLeft += nodeOutLeft.hierNode.modifier;\n }\n\n if (nodeInLeft && !nextRight(nodeOutRight)) {\n nodeOutRight.hierNode.thread = nodeInLeft;\n nodeOutRight.hierNode.modifier += sumInLeft - sumOutRight;\n }\n\n if (nodeInRight && !nextLeft(nodeOutLeft)) {\n nodeOutLeft.hierNode.thread = nodeInRight;\n nodeOutLeft.hierNode.modifier += sumInRight - sumOutLeft;\n ancestor = subtreeV;\n }\n }\n\n return ancestor;\n}\n/**\n * This function is used to traverse the right contour of a subtree.\n * It returns the rightmost child of node or the thread of node. The function\n * returns null if and only if node is on the highest depth of its subtree.\n *\n * @param {module:echarts/data/Tree~TreeNode} node\n * @return {module:echarts/data/Tree~TreeNode}\n */\n\n\nfunction nextRight(node) {\n var children = node.children;\n return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread;\n}\n/**\n * This function is used to traverse the left contour of a subtree (or a subforest).\n * It returns the leftmost child of node or the thread of node. The function\n * returns null if and only if node is on the highest depth of its subtree.\n *\n * @param {module:echarts/data/Tree~TreeNode} node\n * @return {module:echarts/data/Tree~TreeNode}\n */\n\n\nfunction nextLeft(node) {\n var children = node.children;\n return children.length && node.isExpand ? children[0] : node.hierNode.thread;\n}\n/**\n * If nodeInLeft’s ancestor is a sibling of node, returns nodeInLeft’s ancestor.\n * Otherwise, returns the specified ancestor.\n *\n * @param {module:echarts/data/Tree~TreeNode} nodeInLeft\n * @param {module:echarts/data/Tree~TreeNode} node\n * @param {module:echarts/data/Tree~TreeNode} ancestor\n * @return {module:echarts/data/Tree~TreeNode}\n */\n\n\nfunction nextAncestor(nodeInLeft, node, ancestor) {\n return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode ? nodeInLeft.hierNode.ancestor : ancestor;\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n *\n * Shifts the current subtree rooted at wr.\n * This is done by increasing prelim(w+) and modifier(w+) by shift.\n *\n * @param {module:echarts/data/Tree~TreeNode} wl\n * @param {module:echarts/data/Tree~TreeNode} wr\n * @param {number} shift [description]\n */\n\n\nfunction moveSubtree(wl, wr, shift) {\n var change = shift / (wr.hierNode.i - wl.hierNode.i);\n wr.hierNode.change -= change;\n wr.hierNode.shift += shift;\n wr.hierNode.modifier += shift;\n wr.hierNode.prelim += shift;\n wl.hierNode.change += change;\n}\n/**\n * The implementation of this function was originally copied from \"d3.js\"\n * \n * with some modifications made for this program.\n * See the license statement at the head of this file.\n */\n\n\nfunction defaultSeparation(node1, node2) {\n return node1.parentNode === node2.parentNode ? 1 : 2;\n}\n\nexports.init = init;\nexports.firstWalk = firstWalk;\nexports.secondWalk = secondWalk;\nexports.separation = separation;\nexports.radialCoordinate = radialCoordinate;\nexports.getViewRect = getViewRect;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/tree/layoutHelper.js\n// module id = 185\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar List = require(\"../../data/List\");\n\nvar Graph = require(\"../../data/Graph\");\n\nvar linkList = require(\"../../data/helper/linkList\");\n\nvar createDimensions = require(\"../../data/helper/createDimensions\");\n\nvar CoordinateSystem = require(\"../../CoordinateSystem\");\n\nvar createListFromArray = require(\"./createListFromArray\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction _default(nodes, edges, seriesModel, directed, beforeLink) {\n // ??? TODO\n // support dataset?\n var graph = new Graph(directed);\n\n for (var i = 0; i < nodes.length; i++) {\n graph.addNode(zrUtil.retrieve( // Id, name, dataIndex\n nodes[i].id, nodes[i].name, i), i);\n }\n\n var linkNameList = [];\n var validEdges = [];\n var linkCount = 0;\n\n for (var i = 0; i < edges.length; i++) {\n var link = edges[i];\n var source = link.source;\n var target = link.target; // addEdge may fail when source or target not exists\n\n if (graph.addEdge(source, target, linkCount)) {\n validEdges.push(link);\n linkNameList.push(zrUtil.retrieve(link.id, source + ' > ' + target));\n linkCount++;\n }\n }\n\n var coordSys = seriesModel.get('coordinateSystem');\n var nodeData;\n\n if (coordSys === 'cartesian2d' || coordSys === 'polar') {\n nodeData = createListFromArray(nodes, seriesModel);\n } else {\n var coordSysCtor = CoordinateSystem.get(coordSys);\n var coordDimensions = coordSysCtor && coordSysCtor.type !== 'view' ? coordSysCtor.dimensions || [] : []; // FIXME: Some geo do not need `value` dimenson, whereas `calendar` needs\n // `value` dimension, but graph need `value` dimension. It's better to\n // uniform this behavior.\n\n if (zrUtil.indexOf(coordDimensions, 'value') < 0) {\n coordDimensions.concat(['value']);\n }\n\n var dimensionNames = createDimensions(nodes, {\n coordDimensions: coordDimensions\n });\n nodeData = new List(dimensionNames, seriesModel);\n nodeData.initData(nodes);\n }\n\n var edgeData = new List(['value'], seriesModel);\n edgeData.initData(validEdges, linkNameList);\n beforeLink && beforeLink(nodeData, edgeData);\n linkList({\n mainData: nodeData,\n struct: graph,\n structAttr: 'graph',\n datas: {\n node: nodeData,\n edge: edgeData\n },\n datasAttr: {\n node: 'data',\n edge: 'edgeData'\n }\n }); // Update dataIndex of nodes and edges because invalid edge may be removed\n\n graph.update();\n return graph;\n}\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/helper/createGraphFromNodeEdge.js\n// module id = 186\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../../echarts\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @payload\n * @property {number} [seriesIndex]\n * @property {string} [seriesId]\n * @property {string} [seriesName]\n * @property {number} [dataIndex]\n */\necharts.registerAction({\n type: 'focusNodeAdjacency',\n event: 'focusNodeAdjacency',\n update: 'series:focusNodeAdjacency'\n}, function () {});\n/**\n * @payload\n * @property {number} [seriesIndex]\n * @property {string} [seriesId]\n * @property {string} [seriesName]\n */\n\necharts.registerAction({\n type: 'unfocusNodeAdjacency',\n event: 'unfocusNodeAdjacency',\n update: 'series:unfocusNodeAdjacency'\n}, function () {});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/helper/focusNodeAdjacencyAction.js\n// module id = 187\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar vec2 = require(\"zrender/lib/core/vector\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction simpleLayout(seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n return;\n }\n\n var graph = seriesModel.getGraph();\n graph.eachNode(function (node) {\n var model = node.getModel();\n node.setLayout([+model.get('x'), +model.get('y')]);\n });\n simpleLayoutEdge(graph);\n}\n\nfunction simpleLayoutEdge(graph) {\n graph.eachEdge(function (edge) {\n var curveness = edge.getModel().get('lineStyle.curveness') || 0;\n var p1 = vec2.clone(edge.node1.getLayout());\n var p2 = vec2.clone(edge.node2.getLayout());\n var points = [p1, p2];\n\n if (+curveness) {\n points.push([(p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness, (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness]);\n }\n\n edge.setLayout(points);\n });\n}\n\nexports.simpleLayout = simpleLayout;\nexports.simpleLayoutEdge = simpleLayoutEdge;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/graph/simpleLayoutHelper.js\n// module id = 188\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar vec2 = require(\"zrender/lib/core/vector\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction circularLayout(seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n\n if (coordSys && coordSys.type !== 'view') {\n return;\n }\n\n var rect = coordSys.getBoundingRect();\n var nodeData = seriesModel.getData();\n var graph = nodeData.graph;\n var angle = 0;\n var sum = nodeData.getSum('value');\n var unitAngle = Math.PI * 2 / (sum || nodeData.count());\n var cx = rect.width / 2 + rect.x;\n var cy = rect.height / 2 + rect.y;\n var r = Math.min(rect.width, rect.height) / 2;\n graph.eachNode(function (node) {\n var value = node.getValue('value');\n angle += unitAngle * (sum ? value : 1) / 2;\n node.setLayout([r * Math.cos(angle) + cx, r * Math.sin(angle) + cy]);\n angle += unitAngle * (sum ? value : 1) / 2;\n });\n nodeData.setLayout({\n cx: cx,\n cy: cy\n });\n graph.eachEdge(function (edge) {\n var curveness = edge.getModel().get('lineStyle.curveness') || 0;\n var p1 = vec2.clone(edge.node1.getLayout());\n var p2 = vec2.clone(edge.node2.getLayout());\n var cp1;\n var x12 = (p1[0] + p2[0]) / 2;\n var y12 = (p1[1] + p2[1]) / 2;\n\n if (+curveness) {\n curveness *= 3;\n cp1 = [cx * curveness + x12 * (1 - curveness), cy * curveness + y12 * (1 - curveness)];\n }\n\n edge.setLayout([p1, p2, cp1]);\n });\n}\n\nexports.circularLayout = circularLayout;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/graph/circularLayoutHelper.js\n// module id = 189\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../echarts\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar throttleUtil = require(\"../util/throttle\");\n\nvar parallelPreprocessor = require(\"../coord/parallel/parallelPreprocessor\");\n\nrequire(\"../coord/parallel/parallelCreator\");\n\nrequire(\"../coord/parallel/ParallelModel\");\n\nrequire(\"./parallelAxis\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar CLICK_THRESHOLD = 5; // > 4\n// Parallel view\n\necharts.extendComponentView({\n type: 'parallel',\n render: function (parallelModel, ecModel, api) {\n this._model = parallelModel;\n this._api = api;\n\n if (!this._handlers) {\n this._handlers = {};\n zrUtil.each(handlers, function (handler, eventName) {\n api.getZr().on(eventName, this._handlers[eventName] = zrUtil.bind(handler, this));\n }, this);\n }\n\n throttleUtil.createOrUpdate(this, '_throttledDispatchExpand', parallelModel.get('axisExpandRate'), 'fixRate');\n },\n dispose: function (ecModel, api) {\n zrUtil.each(this._handlers, function (handler, eventName) {\n api.getZr().off(eventName, handler);\n });\n this._handlers = null;\n },\n\n /**\n * @param {Object} [opt] If null, cancle the last action triggering for debounce.\n */\n _throttledDispatchExpand: function (opt) {\n this._dispatchExpand(opt);\n },\n _dispatchExpand: function (opt) {\n opt && this._api.dispatchAction(zrUtil.extend({\n type: 'parallelAxisExpand'\n }, opt));\n }\n});\nvar handlers = {\n mousedown: function (e) {\n if (checkTrigger(this, 'click')) {\n this._mouseDownPoint = [e.offsetX, e.offsetY];\n }\n },\n mouseup: function (e) {\n var mouseDownPoint = this._mouseDownPoint;\n\n if (checkTrigger(this, 'click') && mouseDownPoint) {\n var point = [e.offsetX, e.offsetY];\n var dist = Math.pow(mouseDownPoint[0] - point[0], 2) + Math.pow(mouseDownPoint[1] - point[1], 2);\n\n if (dist > CLICK_THRESHOLD) {\n return;\n }\n\n var result = this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\n\n result.behavior !== 'none' && this._dispatchExpand({\n axisExpandWindow: result.axisExpandWindow\n });\n }\n\n this._mouseDownPoint = null;\n },\n mousemove: function (e) {\n // Should do nothing when brushing.\n if (this._mouseDownPoint || !checkTrigger(this, 'mousemove')) {\n return;\n }\n\n var model = this._model;\n var result = model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);\n var behavior = result.behavior;\n behavior === 'jump' && this._throttledDispatchExpand.debounceNextCall(model.get('axisExpandDebounce'));\n\n this._throttledDispatchExpand(behavior === 'none' ? null // Cancle the last trigger, in case that mouse slide out of the area quickly.\n : {\n axisExpandWindow: result.axisExpandWindow,\n // Jumping uses animation, and sliding suppresses animation.\n animation: behavior === 'jump' ? null : false\n });\n }\n};\n\nfunction checkTrigger(view, triggerOn) {\n var model = view._model;\n return model.get('axisExpandable') && model.get('axisExpandTriggerOn') === triggerOn;\n}\n\necharts.registerPreprocessor(parallelPreprocessor);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/parallel.js\n// module id = 190\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar Parallel = require(\"./Parallel\");\n\nvar CoordinateSystem = require(\"../../CoordinateSystem\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Parallel coordinate system creater.\n */\nfunction create(ecModel, api) {\n var coordSysList = [];\n ecModel.eachComponent('parallel', function (parallelModel, idx) {\n var coordSys = new Parallel(parallelModel, ecModel, api);\n coordSys.name = 'parallel_' + idx;\n coordSys.resize(parallelModel, api);\n parallelModel.coordinateSystem = coordSys;\n coordSys.model = parallelModel;\n coordSysList.push(coordSys);\n }); // Inject the coordinateSystems into seriesModel\n\n ecModel.eachSeries(function (seriesModel) {\n if (seriesModel.get('coordinateSystem') === 'parallel') {\n var parallelModel = ecModel.queryComponents({\n mainType: 'parallel',\n index: seriesModel.get('parallelIndex'),\n id: seriesModel.get('parallelId')\n })[0];\n seriesModel.coordinateSystem = parallelModel.coordinateSystem;\n }\n });\n return coordSysList;\n}\n\nCoordinateSystem.register('parallel', {\n create: create\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/coord/parallel/parallelCreator.js\n// module id = 191\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar BoundingRect = require(\"zrender/lib/core/BoundingRect\");\n\nvar _cursorHelper = require(\"./cursorHelper\");\n\nvar onIrrelevantElement = _cursorHelper.onIrrelevantElement;\n\nvar graphicUtil = require(\"../../util/graphic\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nfunction makeRectPanelClipPath(rect) {\n rect = normalizeRect(rect);\n return function (localPoints, transform) {\n return graphicUtil.clipPointsByRect(localPoints, rect);\n };\n}\n\nfunction makeLinearBrushOtherExtent(rect, specifiedXYIndex) {\n rect = normalizeRect(rect);\n return function (xyIndex) {\n var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex;\n var brushWidth = idx ? rect.width : rect.height;\n var base = idx ? rect.x : rect.y;\n return [base, base + (brushWidth || 0)];\n };\n}\n\nfunction makeRectIsTargetByCursor(rect, api, targetModel) {\n rect = normalizeRect(rect);\n return function (e, localCursorPoint, transform) {\n return rect.contain(localCursorPoint[0], localCursorPoint[1]) && !onIrrelevantElement(e, api, targetModel);\n };\n} // Consider width/height is negative.\n\n\nfunction normalizeRect(rect) {\n return BoundingRect.create(rect);\n}\n\nexports.makeRectPanelClipPath = makeRectPanelClipPath;\nexports.makeLinearBrushOtherExtent = makeLinearBrushOtherExtent;\nexports.makeRectIsTargetByCursor = makeRectIsTargetByCursor;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/helper/brushHelper.js\n// module id = 192\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar createListSimply = require(\"../helper/createListSimply\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar _dimensionHelper = require(\"../../data/helper/dimensionHelper\");\n\nvar getDimensionTypeByAxis = _dimensionHelper.getDimensionTypeByAxis;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar seriesModelMixin = {\n /**\n * @private\n * @type {string}\n */\n _baseAxisDim: null,\n\n /**\n * @override\n */\n getInitialData: function (option, ecModel) {\n // When both types of xAxis and yAxis are 'value', layout is\n // needed to be specified by user. Otherwise, layout can be\n // judged by which axis is category.\n var ordinalMeta;\n var xAxisModel = ecModel.getComponent('xAxis', this.get('xAxisIndex'));\n var yAxisModel = ecModel.getComponent('yAxis', this.get('yAxisIndex'));\n var xAxisType = xAxisModel.get('type');\n var yAxisType = yAxisModel.get('type');\n var addOrdinal; // FIXME\n // 考虑时间轴\n\n if (xAxisType === 'category') {\n option.layout = 'horizontal';\n ordinalMeta = xAxisModel.getOrdinalMeta();\n addOrdinal = true;\n } else if (yAxisType === 'category') {\n option.layout = 'vertical';\n ordinalMeta = yAxisModel.getOrdinalMeta();\n addOrdinal = true;\n } else {\n option.layout = option.layout || 'horizontal';\n }\n\n var coordDims = ['x', 'y'];\n var baseAxisDimIndex = option.layout === 'horizontal' ? 0 : 1;\n var baseAxisDim = this._baseAxisDim = coordDims[baseAxisDimIndex];\n var otherAxisDim = coordDims[1 - baseAxisDimIndex];\n var axisModels = [xAxisModel, yAxisModel];\n var baseAxisType = axisModels[baseAxisDimIndex].get('type');\n var otherAxisType = axisModels[1 - baseAxisDimIndex].get('type');\n var data = option.data; // ??? FIXME make a stage to perform data transfrom.\n // MUST create a new data, consider setOption({}) again.\n\n if (data && addOrdinal) {\n var newOptionData = [];\n zrUtil.each(data, function (item, index) {\n var newItem;\n\n if (item.value && zrUtil.isArray(item.value)) {\n newItem = item.value.slice();\n item.value.unshift(index);\n } else if (zrUtil.isArray(item)) {\n newItem = item.slice();\n item.unshift(index);\n } else {\n newItem = item;\n }\n\n newOptionData.push(newItem);\n });\n option.data = newOptionData;\n }\n\n var defaultValueDimensions = this.defaultValueDimensions;\n return createListSimply(this, {\n coordDimensions: [{\n name: baseAxisDim,\n type: getDimensionTypeByAxis(baseAxisType),\n ordinalMeta: ordinalMeta,\n otherDims: {\n tooltip: false,\n itemName: 0\n },\n dimsDef: ['base']\n }, {\n name: otherAxisDim,\n type: getDimensionTypeByAxis(otherAxisType),\n dimsDef: defaultValueDimensions.slice()\n }],\n dimensionsCount: defaultValueDimensions.length + 1\n });\n },\n\n /**\n * If horizontal, base axis is x, otherwise y.\n * @override\n */\n getBaseAxis: function () {\n var dim = this._baseAxisDim;\n return this.ecModel.getComponent(dim + 'Axis', this.get(dim + 'AxisIndex')).axis;\n }\n};\nexports.seriesModelMixin = seriesModelMixin;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/helper/whiskerBoxCommon.js\n// module id = 193\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar graphic = require(\"../../util/graphic\");\n\nvar Line = require(\"./Line\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar _symbol = require(\"../../util/symbol\");\n\nvar createSymbol = _symbol.createSymbol;\n\nvar vec2 = require(\"zrender/lib/core/vector\");\n\nvar curveUtil = require(\"zrender/lib/core/curve\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Provide effect for line\n * @module echarts/chart/helper/EffectLine\n */\n\n/**\n * @constructor\n * @extends {module:zrender/graphic/Group}\n * @alias {module:echarts/chart/helper/Line}\n */\nfunction EffectLine(lineData, idx, seriesScope) {\n graphic.Group.call(this);\n this.add(this.createLine(lineData, idx, seriesScope));\n\n this._updateEffectSymbol(lineData, idx);\n}\n\nvar effectLineProto = EffectLine.prototype;\n\neffectLineProto.createLine = function (lineData, idx, seriesScope) {\n return new Line(lineData, idx, seriesScope);\n};\n\neffectLineProto._updateEffectSymbol = function (lineData, idx) {\n var itemModel = lineData.getItemModel(idx);\n var effectModel = itemModel.getModel('effect');\n var size = effectModel.get('symbolSize');\n var symbolType = effectModel.get('symbol');\n\n if (!zrUtil.isArray(size)) {\n size = [size, size];\n }\n\n var color = effectModel.get('color') || lineData.getItemVisual(idx, 'color');\n var symbol = this.childAt(1);\n\n if (this._symbolType !== symbolType) {\n // Remove previous\n this.remove(symbol);\n symbol = createSymbol(symbolType, -0.5, -0.5, 1, 1, color);\n symbol.z2 = 100;\n symbol.culling = true;\n this.add(symbol);\n } // Symbol may be removed if loop is false\n\n\n if (!symbol) {\n return;\n } // Shadow color is same with color in default\n\n\n symbol.setStyle('shadowColor', color);\n symbol.setStyle(effectModel.getItemStyle(['color']));\n symbol.attr('scale', size);\n symbol.setColor(color);\n symbol.attr('scale', size);\n this._symbolType = symbolType;\n\n this._updateEffectAnimation(lineData, effectModel, idx);\n};\n\neffectLineProto._updateEffectAnimation = function (lineData, effectModel, idx) {\n var symbol = this.childAt(1);\n\n if (!symbol) {\n return;\n }\n\n var self = this;\n var points = lineData.getItemLayout(idx);\n var period = effectModel.get('period') * 1000;\n var loop = effectModel.get('loop');\n var constantSpeed = effectModel.get('constantSpeed');\n var delayExpr = zrUtil.retrieve(effectModel.get('delay'), function (idx) {\n return idx / lineData.count() * period / 3;\n });\n var isDelayFunc = typeof delayExpr === 'function'; // Ignore when updating\n\n symbol.ignore = true;\n this.updateAnimationPoints(symbol, points);\n\n if (constantSpeed > 0) {\n period = this.getLineLength(symbol) / constantSpeed * 1000;\n }\n\n if (period !== this._period || loop !== this._loop) {\n symbol.stopAnimation();\n var delay = delayExpr;\n\n if (isDelayFunc) {\n delay = delayExpr(idx);\n }\n\n if (symbol.__t > 0) {\n delay = -period * symbol.__t;\n }\n\n symbol.__t = 0;\n var animator = symbol.animate('', loop).when(period, {\n __t: 1\n }).delay(delay).during(function () {\n self.updateSymbolPosition(symbol);\n });\n\n if (!loop) {\n animator.done(function () {\n self.remove(symbol);\n });\n }\n\n animator.start();\n }\n\n this._period = period;\n this._loop = loop;\n};\n\neffectLineProto.getLineLength = function (symbol) {\n // Not so accurate\n return vec2.dist(symbol.__p1, symbol.__cp1) + vec2.dist(symbol.__cp1, symbol.__p2);\n};\n\neffectLineProto.updateAnimationPoints = function (symbol, points) {\n symbol.__p1 = points[0];\n symbol.__p2 = points[1];\n symbol.__cp1 = points[2] || [(points[0][0] + points[1][0]) / 2, (points[0][1] + points[1][1]) / 2];\n};\n\neffectLineProto.updateData = function (lineData, idx, seriesScope) {\n this.childAt(0).updateData(lineData, idx, seriesScope);\n\n this._updateEffectSymbol(lineData, idx);\n};\n\neffectLineProto.updateSymbolPosition = function (symbol) {\n var p1 = symbol.__p1;\n var p2 = symbol.__p2;\n var cp1 = symbol.__cp1;\n var t = symbol.__t;\n var pos = symbol.position;\n var quadraticAt = curveUtil.quadraticAt;\n var quadraticDerivativeAt = curveUtil.quadraticDerivativeAt;\n pos[0] = quadraticAt(p1[0], cp1[0], p2[0], t);\n pos[1] = quadraticAt(p1[1], cp1[1], p2[1], t); // Tangent\n\n var tx = quadraticDerivativeAt(p1[0], cp1[0], p2[0], t);\n var ty = quadraticDerivativeAt(p1[1], cp1[1], p2[1], t);\n symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2;\n symbol.ignore = false;\n};\n\neffectLineProto.updateLayout = function (lineData, idx) {\n this.childAt(0).updateLayout(lineData, idx);\n var effectModel = lineData.getItemModel(idx).getModel('effect');\n\n this._updateEffectAnimation(lineData, effectModel, idx);\n};\n\nzrUtil.inherits(EffectLine, graphic.Group);\nvar _default = EffectLine;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/helper/EffectLine.js\n// module id = 194\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar graphic = require(\"../../util/graphic\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @module echarts/chart/helper/Line\n */\n\n/**\n * @constructor\n * @extends {module:zrender/graphic/Group}\n * @alias {module:echarts/chart/helper/Polyline}\n */\nfunction Polyline(lineData, idx, seriesScope) {\n graphic.Group.call(this);\n\n this._createPolyline(lineData, idx, seriesScope);\n}\n\nvar polylineProto = Polyline.prototype;\n\npolylineProto._createPolyline = function (lineData, idx, seriesScope) {\n // var seriesModel = lineData.hostModel;\n var points = lineData.getItemLayout(idx);\n var line = new graphic.Polyline({\n shape: {\n points: points\n }\n });\n this.add(line);\n\n this._updateCommonStl(lineData, idx, seriesScope);\n};\n\npolylineProto.updateData = function (lineData, idx, seriesScope) {\n var seriesModel = lineData.hostModel;\n var line = this.childAt(0);\n var target = {\n shape: {\n points: lineData.getItemLayout(idx)\n }\n };\n graphic.updateProps(line, target, seriesModel, idx);\n\n this._updateCommonStl(lineData, idx, seriesScope);\n};\n\npolylineProto._updateCommonStl = function (lineData, idx, seriesScope) {\n var line = this.childAt(0);\n var itemModel = lineData.getItemModel(idx);\n var visualColor = lineData.getItemVisual(idx, 'color');\n var lineStyle = seriesScope && seriesScope.lineStyle;\n var hoverLineStyle = seriesScope && seriesScope.hoverLineStyle;\n\n if (!seriesScope || lineData.hasItemOption) {\n lineStyle = itemModel.getModel('lineStyle').getLineStyle();\n hoverLineStyle = itemModel.getModel('emphasis.lineStyle').getLineStyle();\n }\n\n line.useStyle(zrUtil.defaults({\n strokeNoScale: true,\n fill: 'none',\n stroke: visualColor\n }, lineStyle));\n line.hoverStyle = hoverLineStyle;\n graphic.setHoverStyle(this);\n};\n\npolylineProto.updateLayout = function (lineData, idx) {\n var polyline = this.childAt(0);\n polyline.setShape('points', lineData.getItemLayout(idx));\n};\n\nzrUtil.inherits(Polyline, graphic.Group);\nvar _default = Polyline;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/helper/Polyline.js\n// module id = 195\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar createRenderPlanner = require(\"../helper/createRenderPlanner\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/* global Float32Array */\nvar _default = {\n seriesType: 'lines',\n plan: createRenderPlanner(),\n reset: function (seriesModel) {\n var coordSys = seriesModel.coordinateSystem;\n var isPolyline = seriesModel.get('polyline');\n var isLarge = seriesModel.pipelineContext.large;\n\n function progress(params, lineData) {\n var lineCoords = [];\n\n if (isLarge) {\n var points;\n var segCount = params.end - params.start;\n\n if (isPolyline) {\n var totalCoordsCount = 0;\n\n for (var i = params.start; i < params.end; i++) {\n totalCoordsCount += seriesModel.getLineCoordsCount(i);\n }\n\n points = new Float32Array(segCount + totalCoordsCount * 2);\n } else {\n points = new Float32Array(segCount * 4);\n }\n\n var offset = 0;\n var pt = [];\n\n for (var i = params.start; i < params.end; i++) {\n var len = seriesModel.getLineCoords(i, lineCoords);\n\n if (isPolyline) {\n points[offset++] = len;\n }\n\n for (var k = 0; k < len; k++) {\n pt = coordSys.dataToPoint(lineCoords[k], false, pt);\n points[offset++] = pt[0];\n points[offset++] = pt[1];\n }\n }\n\n lineData.setLayout('linesPoints', points);\n } else {\n for (var i = params.start; i < params.end; i++) {\n var itemModel = lineData.getItemModel(i);\n var len = seriesModel.getLineCoords(i, lineCoords);\n var pts = [];\n\n if (isPolyline) {\n for (var j = 0; j < len; j++) {\n pts.push(coordSys.dataToPoint(lineCoords[j]));\n }\n } else {\n pts[0] = coordSys.dataToPoint(lineCoords[0]);\n pts[1] = coordSys.dataToPoint(lineCoords[1]);\n var curveness = itemModel.get('lineStyle.curveness');\n\n if (+curveness) {\n pts[2] = [(pts[0][0] + pts[1][0]) / 2 - (pts[0][1] - pts[1][1]) * curveness, (pts[0][1] + pts[1][1]) / 2 - (pts[1][0] - pts[0][0]) * curveness];\n }\n }\n\n lineData.setItemLayout(i, pts);\n }\n }\n }\n\n return {\n progress: progress\n };\n }\n};\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/chart/lines/linesLayout.js\n// module id = 196\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../echarts\");\n\nrequire(\"../coord/single/singleCreator\");\n\nrequire(\"./axis/SingleAxisView\");\n\nrequire(\"../coord/single/AxisModel\");\n\nrequire(\"./axisPointer\");\n\nrequire(\"./axisPointer/SingleAxisPointer\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\necharts.extendComponentView({\n type: 'single'\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/singleAxis.js\n// module id = 197\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @param {Object} opt {labelInside}\n * @return {Object} {\n * position, rotation, labelDirection, labelOffset,\n * tickDirection, labelRotate, z2\n * }\n */\nfunction layout(axisModel, opt) {\n opt = opt || {};\n var single = axisModel.coordinateSystem;\n var axis = axisModel.axis;\n var layout = {};\n var axisPosition = axis.position;\n var orient = axis.orient;\n var rect = single.getRect();\n var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];\n var positionMap = {\n horizontal: {\n top: rectBound[2],\n bottom: rectBound[3]\n },\n vertical: {\n left: rectBound[0],\n right: rectBound[1]\n }\n };\n layout.position = [orient === 'vertical' ? positionMap.vertical[axisPosition] : rectBound[0], orient === 'horizontal' ? positionMap.horizontal[axisPosition] : rectBound[3]];\n var r = {\n horizontal: 0,\n vertical: 1\n };\n layout.rotation = Math.PI / 2 * r[orient];\n var directionMap = {\n top: -1,\n bottom: 1,\n right: 1,\n left: -1\n };\n layout.labelDirection = layout.tickDirection = layout.nameDirection = directionMap[axisPosition];\n\n if (axisModel.get('axisTick.inside')) {\n layout.tickDirection = -layout.tickDirection;\n }\n\n if (zrUtil.retrieve(opt.labelInside, axisModel.get('axisLabel.inside'))) {\n layout.labelDirection = -layout.labelDirection;\n }\n\n var labelRotation = opt.rotate;\n labelRotation == null && (labelRotation = axisModel.get('axisLabel.rotate'));\n layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation;\n layout.z2 = 1;\n return layout;\n}\n\nexports.layout = layout;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/coord/single/singleAxisHelper.js\n// module id = 198\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar modelUtil = require(\"../../util/model\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @param {Object} finder contains {seriesIndex, dataIndex, dataIndexInside}\n * @param {module:echarts/model/Global} ecModel\n * @return {Object} {point: [x, y], el: ...} point Will not be null.\n */\nfunction _default(finder, ecModel) {\n var point = [];\n var seriesIndex = finder.seriesIndex;\n var seriesModel;\n\n if (seriesIndex == null || !(seriesModel = ecModel.getSeriesByIndex(seriesIndex))) {\n return {\n point: []\n };\n }\n\n var data = seriesModel.getData();\n var dataIndex = modelUtil.queryDataIndex(data, finder);\n\n if (dataIndex == null || dataIndex < 0 || zrUtil.isArray(dataIndex)) {\n return {\n point: []\n };\n }\n\n var el = data.getItemGraphicEl(dataIndex);\n var coordSys = seriesModel.coordinateSystem;\n\n if (seriesModel.getTooltipPosition) {\n point = seriesModel.getTooltipPosition(dataIndex) || [];\n } else if (coordSys && coordSys.dataToPoint) {\n point = coordSys.dataToPoint(data.getValues(zrUtil.map(coordSys.dimensions, function (dim) {\n return data.mapDimension(dim);\n }), dataIndex, true)) || [];\n } else if (el) {\n // Use graphic bounding rect\n var rect = el.getBoundingRect().clone();\n rect.applyTransform(el.transform);\n point = [rect.x + rect.width / 2, rect.y + rect.height / 2];\n }\n\n return {\n point: point,\n el: el\n };\n}\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/axisPointer/findPointFromSeries.js\n// module id = 199\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar env = require(\"zrender/lib/core/env\");\n\nvar _model = require(\"../../util/model\");\n\nvar makeInner = _model.makeInner;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar inner = makeInner();\nvar each = zrUtil.each;\n/**\n * @param {string} key\n * @param {module:echarts/ExtensionAPI} api\n * @param {Function} handler\n * param: {string} currTrigger\n * param: {Array.} point\n */\n\nfunction register(key, api, handler) {\n if (env.node) {\n return;\n }\n\n var zr = api.getZr();\n inner(zr).records || (inner(zr).records = {});\n initGlobalListeners(zr, api);\n var record = inner(zr).records[key] || (inner(zr).records[key] = {});\n record.handler = handler;\n}\n\nfunction initGlobalListeners(zr, api) {\n if (inner(zr).initialized) {\n return;\n }\n\n inner(zr).initialized = true;\n useHandler('click', zrUtil.curry(doEnter, 'click'));\n useHandler('mousemove', zrUtil.curry(doEnter, 'mousemove')); // useHandler('mouseout', onLeave);\n\n useHandler('globalout', onLeave);\n\n function useHandler(eventType, cb) {\n zr.on(eventType, function (e) {\n var dis = makeDispatchAction(api);\n each(inner(zr).records, function (record) {\n record && cb(record, e, dis.dispatchAction);\n });\n dispatchTooltipFinally(dis.pendings, api);\n });\n }\n}\n\nfunction dispatchTooltipFinally(pendings, api) {\n var showLen = pendings.showTip.length;\n var hideLen = pendings.hideTip.length;\n var actuallyPayload;\n\n if (showLen) {\n actuallyPayload = pendings.showTip[showLen - 1];\n } else if (hideLen) {\n actuallyPayload = pendings.hideTip[hideLen - 1];\n }\n\n if (actuallyPayload) {\n actuallyPayload.dispatchAction = null;\n api.dispatchAction(actuallyPayload);\n }\n}\n\nfunction onLeave(record, e, dispatchAction) {\n record.handler('leave', null, dispatchAction);\n}\n\nfunction doEnter(currTrigger, record, e, dispatchAction) {\n record.handler(currTrigger, e, dispatchAction);\n}\n\nfunction makeDispatchAction(api) {\n var pendings = {\n showTip: [],\n hideTip: []\n }; // FIXME\n // better approach?\n // 'showTip' and 'hideTip' can be triggered by axisPointer and tooltip,\n // which may be conflict, (axisPointer call showTip but tooltip call hideTip);\n // So we have to add \"final stage\" to merge those dispatched actions.\n\n var dispatchAction = function (payload) {\n var pendingList = pendings[payload.type];\n\n if (pendingList) {\n pendingList.push(payload);\n } else {\n payload.dispatchAction = dispatchAction;\n api.dispatchAction(payload);\n }\n };\n\n return {\n dispatchAction: dispatchAction,\n pendings: pendings\n };\n}\n/**\n * @param {string} key\n * @param {module:echarts/ExtensionAPI} api\n */\n\n\nfunction unregister(key, api) {\n if (env.node) {\n return;\n }\n\n var zr = api.getZr();\n var record = (inner(zr).records || {})[key];\n\n if (record) {\n inner(zr).records[key] = null;\n }\n}\n\nexports.register = register;\nexports.unregister = unregister;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/axisPointer/globalListener.js\n// module id = 200\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar graphic = require(\"../../util/graphic\");\n\nvar BaseAxisPointer = require(\"./BaseAxisPointer\");\n\nvar viewHelper = require(\"./viewHelper\");\n\nvar cartesianAxisHelper = require(\"../../coord/cartesian/cartesianAxisHelper\");\n\nvar AxisView = require(\"../axis/AxisView\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar CartesianAxisPointer = BaseAxisPointer.extend({\n /**\n * @override\n */\n makeElOption: function (elOption, value, axisModel, axisPointerModel, api) {\n var axis = axisModel.axis;\n var grid = axis.grid;\n var axisPointerType = axisPointerModel.get('type');\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\n var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true));\n\n if (axisPointerType && axisPointerType !== 'none') {\n var elStyle = viewHelper.buildElStyle(axisPointerModel);\n var pointerOption = pointerShapeBuilder[axisPointerType](axis, pixelValue, otherExtent, elStyle);\n pointerOption.style = elStyle;\n elOption.graphicKey = pointerOption.type;\n elOption.pointer = pointerOption;\n }\n\n var layoutInfo = cartesianAxisHelper.layout(grid.model, axisModel);\n viewHelper.buildCartesianSingleLabelElOption(value, elOption, layoutInfo, axisModel, axisPointerModel, api);\n },\n\n /**\n * @override\n */\n getHandleTransform: function (value, axisModel, axisPointerModel) {\n var layoutInfo = cartesianAxisHelper.layout(axisModel.axis.grid.model, axisModel, {\n labelInside: false\n });\n layoutInfo.labelMargin = axisPointerModel.get('handle.margin');\n return {\n position: viewHelper.getTransformedPosition(axisModel.axis, value, layoutInfo),\n rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0)\n };\n },\n\n /**\n * @override\n */\n updateHandleTransform: function (transform, delta, axisModel, axisPointerModel) {\n var axis = axisModel.axis;\n var grid = axis.grid;\n var axisExtent = axis.getGlobalExtent(true);\n var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent();\n var dimIndex = axis.dim === 'x' ? 0 : 1;\n var currPosition = transform.position;\n currPosition[dimIndex] += delta[dimIndex];\n currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]);\n currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]);\n var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2;\n var cursorPoint = [cursorOtherValue, cursorOtherValue];\n cursorPoint[dimIndex] = currPosition[dimIndex]; // Make tooltip do not overlap axisPointer and in the middle of the grid.\n\n var tooltipOptions = [{\n verticalAlign: 'middle'\n }, {\n align: 'center'\n }];\n return {\n position: currPosition,\n rotation: transform.rotation,\n cursorPoint: cursorPoint,\n tooltipOption: tooltipOptions[dimIndex]\n };\n }\n});\n\nfunction getCartesian(grid, axis) {\n var opt = {};\n opt[axis.dim + 'AxisIndex'] = axis.index;\n return grid.getCartesian(opt);\n}\n\nvar pointerShapeBuilder = {\n line: function (axis, pixelValue, otherExtent, elStyle) {\n var targetShape = viewHelper.makeLineShape([pixelValue, otherExtent[0]], [pixelValue, otherExtent[1]], getAxisDimIndex(axis));\n graphic.subPixelOptimizeLine({\n shape: targetShape,\n style: elStyle\n });\n return {\n type: 'Line',\n shape: targetShape\n };\n },\n shadow: function (axis, pixelValue, otherExtent, elStyle) {\n var bandWidth = Math.max(1, axis.getBandWidth());\n var span = otherExtent[1] - otherExtent[0];\n return {\n type: 'Rect',\n shape: viewHelper.makeRectShape([pixelValue - bandWidth / 2, otherExtent[0]], [bandWidth, span], getAxisDimIndex(axis))\n };\n }\n};\n\nfunction getAxisDimIndex(axis) {\n return axis.dim === 'x' ? 0 : 1;\n}\n\nAxisView.registerAxisPointerClass('CartesianAxisPointer', CartesianAxisPointer);\nvar _default = CartesianAxisPointer;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/axisPointer/CartesianAxisPointer.js\n// module id = 201\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../../echarts\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar Model = require(\"../../model/Model\");\n\nvar _model = require(\"../../util/model\");\n\nvar isNameSpecified = _model.isNameSpecified;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar LegendModel = echarts.extendComponentModel({\n type: 'legend.plain',\n dependencies: ['series'],\n layoutMode: {\n type: 'box',\n // legend.width/height are maxWidth/maxHeight actually,\n // whereas realy width/height is calculated by its content.\n // (Setting {left: 10, right: 10} does not make sense).\n // So consider the case:\n // `setOption({legend: {left: 10});`\n // then `setOption({legend: {right: 10});`\n // The previous `left` should be cleared by setting `ignoreSize`.\n ignoreSize: true\n },\n init: function (option, parentModel, ecModel) {\n this.mergeDefaultAndTheme(option, ecModel);\n option.selected = option.selected || {};\n },\n mergeOption: function (option) {\n LegendModel.superCall(this, 'mergeOption', option);\n },\n optionUpdated: function () {\n this._updateData(this.ecModel);\n\n var legendData = this._data; // If selectedMode is single, try to select one\n\n if (legendData[0] && this.get('selectedMode') === 'single') {\n var hasSelected = false; // If has any selected in option.selected\n\n for (var i = 0; i < legendData.length; i++) {\n var name = legendData[i].get('name');\n\n if (this.isSelected(name)) {\n // Force to unselect others\n this.select(name);\n hasSelected = true;\n break;\n }\n } // Try select the first if selectedMode is single\n\n\n !hasSelected && this.select(legendData[0].get('name'));\n }\n },\n _updateData: function (ecModel) {\n var potentialData = [];\n var availableNames = [];\n ecModel.eachRawSeries(function (seriesModel) {\n var seriesName = seriesModel.name;\n availableNames.push(seriesName);\n var isPotential;\n\n if (seriesModel.legendDataProvider) {\n var data = seriesModel.legendDataProvider();\n var names = data.mapArray(data.getName);\n\n if (!ecModel.isSeriesFiltered(seriesModel)) {\n availableNames = availableNames.concat(names);\n }\n\n if (names.length) {\n potentialData = potentialData.concat(names);\n } else {\n isPotential = true;\n }\n } else {\n isPotential = true;\n }\n\n if (isPotential && isNameSpecified(seriesModel)) {\n potentialData.push(seriesModel.name);\n }\n });\n /**\n * @type {Array.}\n * @private\n */\n\n this._availableNames = availableNames; // If legend.data not specified in option, use availableNames as data,\n // which is convinient for user preparing option.\n\n var rawData = this.get('data') || potentialData;\n var legendData = zrUtil.map(rawData, function (dataItem) {\n // Can be string or number\n if (typeof dataItem === 'string' || typeof dataItem === 'number') {\n dataItem = {\n name: dataItem\n };\n }\n\n return new Model(dataItem, this, this.ecModel);\n }, this);\n /**\n * @type {Array.}\n * @private\n */\n\n this._data = legendData;\n },\n\n /**\n * @return {Array.}\n */\n getData: function () {\n return this._data;\n },\n\n /**\n * @param {string} name\n */\n select: function (name) {\n var selected = this.option.selected;\n var selectedMode = this.get('selectedMode');\n\n if (selectedMode === 'single') {\n var data = this._data;\n zrUtil.each(data, function (dataItem) {\n selected[dataItem.get('name')] = false;\n });\n }\n\n selected[name] = true;\n },\n\n /**\n * @param {string} name\n */\n unSelect: function (name) {\n if (this.get('selectedMode') !== 'single') {\n this.option.selected[name] = false;\n }\n },\n\n /**\n * @param {string} name\n */\n toggleSelected: function (name) {\n var selected = this.option.selected; // Default is true\n\n if (!selected.hasOwnProperty(name)) {\n selected[name] = true;\n }\n\n this[selected[name] ? 'unSelect' : 'select'](name);\n },\n\n /**\n * @param {string} name\n */\n isSelected: function (name) {\n var selected = this.option.selected;\n return !(selected.hasOwnProperty(name) && !selected[name]) && zrUtil.indexOf(this._availableNames, name) >= 0;\n },\n defaultOption: {\n // 一级层叠\n zlevel: 0,\n // 二级层叠\n z: 4,\n show: true,\n // 布局方式,默认为水平布局,可选为:\n // 'horizontal' | 'vertical'\n orient: 'horizontal',\n left: 'center',\n // right: 'center',\n top: 0,\n // bottom: null,\n // 水平对齐\n // 'auto' | 'left' | 'right'\n // 默认为 'auto', 根据 x 的位置判断是左对齐还是右对齐\n align: 'auto',\n backgroundColor: 'rgba(0,0,0,0)',\n // 图例边框颜色\n borderColor: '#ccc',\n borderRadius: 0,\n // 图例边框线宽,单位px,默认为0(无边框)\n borderWidth: 0,\n // 图例内边距,单位px,默认各方向内边距为5,\n // 接受数组分别设定上右下左边距,同css\n padding: 5,\n // 各个item之间的间隔,单位px,默认为10,\n // 横向布局时为水平间隔,纵向布局时为纵向间隔\n itemGap: 10,\n // 图例图形宽度\n itemWidth: 25,\n // 图例图形高度\n itemHeight: 14,\n // 图例关闭时候的颜色\n inactiveColor: '#ccc',\n textStyle: {\n // 图例文字颜色\n color: '#333'\n },\n // formatter: '',\n // 选择模式,默认开启图例开关\n selectedMode: true,\n // 配置默认选中状态,可配合LEGEND.SELECTED事件做动态数据载入\n // selected: null,\n // 图例内容(详见legend.data,数组中每一项代表一个item\n // data: [],\n // Tooltip 相关配置\n tooltip: {\n show: false\n }\n }\n});\nvar _default = LegendModel;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/legend/LegendModel.js\n// module id = 202\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _config = require(\"../../config\");\n\nvar __DEV__ = _config.__DEV__;\n\nvar echarts = require(\"../../echarts\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar _symbol = require(\"../../util/symbol\");\n\nvar createSymbol = _symbol.createSymbol;\n\nvar graphic = require(\"../../util/graphic\");\n\nvar _listComponent = require(\"../helper/listComponent\");\n\nvar makeBackground = _listComponent.makeBackground;\n\nvar layoutUtil = require(\"../../util/layout\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar curry = zrUtil.curry;\nvar each = zrUtil.each;\nvar Group = graphic.Group;\n\nvar _default = echarts.extendComponentView({\n type: 'legend.plain',\n newlineDisabled: false,\n\n /**\n * @override\n */\n init: function () {\n /**\n * @private\n * @type {module:zrender/container/Group}\n */\n this.group.add(this._contentGroup = new Group());\n /**\n * @private\n * @type {module:zrender/Element}\n */\n\n this._backgroundEl;\n /**\n * If first rendering, `contentGroup.position` is [0, 0], which\n * does not make sense and may cause unexepcted animation if adopted.\n * @private\n * @type {boolean}\n */\n\n this._isFirstRender = true;\n },\n\n /**\n * @protected\n */\n getContentGroup: function () {\n return this._contentGroup;\n },\n\n /**\n * @override\n */\n render: function (legendModel, ecModel, api) {\n var isFirstRender = this._isFirstRender;\n this._isFirstRender = false;\n this.resetInner();\n\n if (!legendModel.get('show', true)) {\n return;\n }\n\n var itemAlign = legendModel.get('align');\n\n if (!itemAlign || itemAlign === 'auto') {\n itemAlign = legendModel.get('left') === 'right' && legendModel.get('orient') === 'vertical' ? 'right' : 'left';\n }\n\n this.renderInner(itemAlign, legendModel, ecModel, api); // Perform layout.\n\n var positionInfo = legendModel.getBoxLayoutParams();\n var viewportSize = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var padding = legendModel.get('padding');\n var maxSize = layoutUtil.getLayoutRect(positionInfo, viewportSize, padding);\n var mainRect = this.layoutInner(legendModel, itemAlign, maxSize, isFirstRender); // Place mainGroup, based on the calculated `mainRect`.\n\n var layoutRect = layoutUtil.getLayoutRect(zrUtil.defaults({\n width: mainRect.width,\n height: mainRect.height\n }, positionInfo), viewportSize, padding);\n this.group.attr('position', [layoutRect.x - mainRect.x, layoutRect.y - mainRect.y]); // Render background after group is layout.\n\n this.group.add(this._backgroundEl = makeBackground(mainRect, legendModel));\n },\n\n /**\n * @protected\n */\n resetInner: function () {\n this.getContentGroup().removeAll();\n this._backgroundEl && this.group.remove(this._backgroundEl);\n },\n\n /**\n * @protected\n */\n renderInner: function (itemAlign, legendModel, ecModel, api) {\n var contentGroup = this.getContentGroup();\n var legendDrawnMap = zrUtil.createHashMap();\n var selectMode = legendModel.get('selectedMode');\n var excludeSeriesId = [];\n ecModel.eachRawSeries(function (seriesModel) {\n !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id);\n });\n each(legendModel.getData(), function (itemModel, dataIndex) {\n var name = itemModel.get('name'); // Use empty string or \\n as a newline string\n\n if (!this.newlineDisabled && (name === '' || name === '\\n')) {\n contentGroup.add(new Group({\n newline: true\n }));\n return;\n } // Representitive series.\n\n\n var seriesModel = ecModel.getSeriesByName(name)[0];\n\n if (legendDrawnMap.get(name)) {\n // Have been drawed\n return;\n } // Series legend\n\n\n if (seriesModel) {\n var data = seriesModel.getData();\n var color = data.getVisual('color'); // If color is a callback function\n\n if (typeof color === 'function') {\n // Use the first data\n color = color(seriesModel.getDataParams(0));\n } // Using rect symbol defaultly\n\n\n var legendSymbolType = data.getVisual('legendSymbol') || 'roundRect';\n var symbolType = data.getVisual('symbol');\n\n var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, symbolType, itemAlign, color, selectMode);\n\n itemGroup.on('click', curry(dispatchSelectAction, name, api)).on('mouseover', curry(dispatchHighlightAction, seriesModel.name, null, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, seriesModel.name, null, api, excludeSeriesId));\n legendDrawnMap.set(name, true);\n } else {\n // Data legend of pie, funnel\n ecModel.eachRawSeries(function (seriesModel) {\n // In case multiple series has same data name\n if (legendDrawnMap.get(name)) {\n return;\n }\n\n if (seriesModel.legendDataProvider) {\n var data = seriesModel.legendDataProvider();\n var idx = data.indexOfName(name);\n\n if (idx < 0) {\n return;\n }\n\n var color = data.getItemVisual(idx, 'color');\n var legendSymbolType = 'roundRect';\n\n var itemGroup = this._createItem(name, dataIndex, itemModel, legendModel, legendSymbolType, null, itemAlign, color, selectMode); // FIXME: consider different series has items with the same name.\n\n\n itemGroup.on('click', curry(dispatchSelectAction, name, api)) // Should not specify the series name, consider legend controls\n // more than one pie series.\n .on('mouseover', curry(dispatchHighlightAction, null, name, api, excludeSeriesId)).on('mouseout', curry(dispatchDownplayAction, null, name, api, excludeSeriesId));\n legendDrawnMap.set(name, true);\n }\n }, this);\n }\n }, this);\n },\n _createItem: function (name, dataIndex, itemModel, legendModel, legendSymbolType, symbolType, itemAlign, color, selectMode) {\n var itemWidth = legendModel.get('itemWidth');\n var itemHeight = legendModel.get('itemHeight');\n var inactiveColor = legendModel.get('inactiveColor');\n var symbolKeepAspect = legendModel.get('symbolKeepAspect');\n var isSelected = legendModel.isSelected(name);\n var itemGroup = new Group();\n var textStyleModel = itemModel.getModel('textStyle');\n var itemIcon = itemModel.get('icon');\n var tooltipModel = itemModel.getModel('tooltip');\n var legendGlobalTooltipModel = tooltipModel.parentModel; // Use user given icon first\n\n legendSymbolType = itemIcon || legendSymbolType;\n itemGroup.add(createSymbol(legendSymbolType, 0, 0, itemWidth, itemHeight, isSelected ? color : inactiveColor, // symbolKeepAspect default true for legend\n symbolKeepAspect == null ? true : symbolKeepAspect)); // Compose symbols\n // PENDING\n\n if (!itemIcon && symbolType // At least show one symbol, can't be all none\n && (symbolType !== legendSymbolType || symbolType === 'none')) {\n var size = itemHeight * 0.8;\n\n if (symbolType === 'none') {\n symbolType = 'circle';\n } // Put symbol in the center\n\n\n itemGroup.add(createSymbol(symbolType, (itemWidth - size) / 2, (itemHeight - size) / 2, size, size, isSelected ? color : inactiveColor, // symbolKeepAspect default true for legend\n symbolKeepAspect == null ? true : symbolKeepAspect));\n }\n\n var textX = itemAlign === 'left' ? itemWidth + 5 : -5;\n var textAlign = itemAlign;\n var formatter = legendModel.get('formatter');\n var content = name;\n\n if (typeof formatter === 'string' && formatter) {\n content = formatter.replace('{name}', name != null ? name : '');\n } else if (typeof formatter === 'function') {\n content = formatter(name);\n }\n\n itemGroup.add(new graphic.Text({\n style: graphic.setTextStyle({}, textStyleModel, {\n text: content,\n x: textX,\n y: itemHeight / 2,\n textFill: isSelected ? textStyleModel.getTextColor() : inactiveColor,\n textAlign: textAlign,\n textVerticalAlign: 'middle'\n })\n })); // Add a invisible rect to increase the area of mouse hover\n\n var hitRect = new graphic.Rect({\n shape: itemGroup.getBoundingRect(),\n invisible: true,\n tooltip: tooltipModel.get('show') ? zrUtil.extend({\n content: name,\n // Defaul formatter\n formatter: legendGlobalTooltipModel.get('formatter', true) || function () {\n return name;\n },\n formatterParams: {\n componentType: 'legend',\n legendIndex: legendModel.componentIndex,\n name: name,\n $vars: ['name']\n }\n }, tooltipModel.option) : null\n });\n itemGroup.add(hitRect);\n itemGroup.eachChild(function (child) {\n child.silent = true;\n });\n hitRect.silent = !selectMode;\n this.getContentGroup().add(itemGroup);\n graphic.setHoverStyle(itemGroup);\n itemGroup.__legendDataIndex = dataIndex;\n return itemGroup;\n },\n\n /**\n * @protected\n */\n layoutInner: function (legendModel, itemAlign, maxSize) {\n var contentGroup = this.getContentGroup(); // Place items in contentGroup.\n\n layoutUtil.box(legendModel.get('orient'), contentGroup, legendModel.get('itemGap'), maxSize.width, maxSize.height);\n var contentRect = contentGroup.getBoundingRect();\n contentGroup.attr('position', [-contentRect.x, -contentRect.y]);\n return this.group.getBoundingRect();\n },\n\n /**\n * @protected\n */\n remove: function () {\n this.getContentGroup().removeAll();\n this._isFirstRender = true;\n }\n});\n\nfunction dispatchSelectAction(name, api) {\n api.dispatchAction({\n type: 'legendToggleSelect',\n name: name\n });\n}\n\nfunction dispatchHighlightAction(seriesName, dataName, api, excludeSeriesId) {\n // If element hover will move to a hoverLayer.\n var el = api.getZr().storage.getDisplayList()[0];\n\n if (!(el && el.useHoverLayer)) {\n api.dispatchAction({\n type: 'highlight',\n seriesName: seriesName,\n name: dataName,\n excludeSeriesId: excludeSeriesId\n });\n }\n}\n\nfunction dispatchDownplayAction(seriesName, dataName, api, excludeSeriesId) {\n // If element hover will move to a hoverLayer.\n var el = api.getZr().storage.getDisplayList()[0];\n\n if (!(el && el.useHoverLayer)) {\n api.dispatchAction({\n type: 'downplay',\n seriesName: seriesName,\n name: dataName,\n excludeSeriesId: excludeSeriesId\n });\n }\n}\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/legend/LegendView.js\n// module id = 203\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _layout = require(\"../../util/layout\");\n\nvar getLayoutRect = _layout.getLayoutRect;\nvar layoutBox = _layout.box;\nvar positionElement = _layout.positionElement;\n\nvar formatUtil = require(\"../../util/format\");\n\nvar graphic = require(\"../../util/graphic\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Layout list like component.\n * It will box layout each items in group of component and then position the whole group in the viewport\n * @param {module:zrender/group/Group} group\n * @param {module:echarts/model/Component} componentModel\n * @param {module:echarts/ExtensionAPI}\n */\nfunction layout(group, componentModel, api) {\n var boxLayoutParams = componentModel.getBoxLayoutParams();\n var padding = componentModel.get('padding');\n var viewportSize = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var rect = getLayoutRect(boxLayoutParams, viewportSize, padding);\n layoutBox(componentModel.get('orient'), group, componentModel.get('itemGap'), rect.width, rect.height);\n positionElement(group, boxLayoutParams, viewportSize, padding);\n}\n\nfunction makeBackground(rect, componentModel) {\n var padding = formatUtil.normalizeCssArray(componentModel.get('padding'));\n var style = componentModel.getItemStyle(['color', 'opacity']);\n style.fill = componentModel.get('backgroundColor');\n var rect = new graphic.Rect({\n shape: {\n x: rect.x - padding[3],\n y: rect.y - padding[0],\n width: rect.width + padding[1] + padding[3],\n height: rect.height + padding[0] + padding[2],\n r: componentModel.get('borderRadius')\n },\n style: style,\n silent: true,\n z2: -1\n }); // FIXME\n // `subPixelOptimizeRect` may bring some gap between edge of viewpart\n // and background rect when setting like `left: 0`, `top: 0`.\n // graphic.subPixelOptimizeRect(rect);\n\n return rect;\n}\n\nexports.layout = layout;\nexports.makeBackground = makeBackground;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/helper/listComponent.js\n// module id = 204\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _config = require(\"../../config\");\n\nvar __DEV__ = _config.__DEV__;\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar graphic = require(\"../../util/graphic\");\n\nvar modelUtil = require(\"../../util/model\");\n\nvar brushHelper = require(\"./brushHelper\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar each = zrUtil.each;\nvar indexOf = zrUtil.indexOf;\nvar curry = zrUtil.curry;\nvar COORD_CONVERTS = ['dataToPoint', 'pointToData']; // FIXME\n// how to genarialize to more coordinate systems.\n\nvar INCLUDE_FINDER_MAIN_TYPES = ['grid', 'xAxis', 'yAxis', 'geo', 'graph', 'polar', 'radiusAxis', 'angleAxis', 'bmap'];\n/**\n * [option in constructor]:\n * {\n * Index/Id/Name of geo, xAxis, yAxis, grid: See util/model#parseFinder.\n * }\n *\n *\n * [targetInfo]:\n *\n * There can be multiple axes in a single targetInfo. Consider the case\n * of `grid` component, a targetInfo represents a grid which contains one or more\n * cartesian and one or more axes. And consider the case of parallel system,\n * which has multiple axes in a coordinate system.\n * Can be {\n * panelId: ...,\n * coordSys: ,\n * coordSyses: all cartesians.\n * gridModel: \n * xAxes: correspond to coordSyses on index\n * yAxes: correspond to coordSyses on index\n * }\n * or {\n * panelId: ...,\n * coordSys: \n * coordSyses: []\n * geoModel: \n * }\n *\n *\n * [panelOpt]:\n *\n * Make from targetInfo. Input to BrushController.\n * {\n * panelId: ...,\n * rect: ...\n * }\n *\n *\n * [area]:\n *\n * Generated by BrushController or user input.\n * {\n * panelId: Used to locate coordInfo directly. If user inpput, no panelId.\n * brushType: determine how to convert to/from coord('rect' or 'polygon' or 'lineX/Y').\n * Index/Id/Name of geo, xAxis, yAxis, grid: See util/model#parseFinder.\n * range: pixel range.\n * coordRange: representitive coord range (the first one of coordRanges).\n * coordRanges: coord ranges, used in multiple cartesian in one grid.\n * }\n */\n\n/**\n * @param {Object} option contains Index/Id/Name of xAxis/yAxis/geo/grid\n * Each can be {number|Array.}. like: {xAxisIndex: [3, 4]}\n * @param {module:echarts/model/Global} ecModel\n * @param {Object} [opt]\n * @param {Array.} [opt.include] include coordinate system types.\n */\n\nfunction BrushTargetManager(option, ecModel, opt) {\n /**\n * @private\n * @type {Array.}\n */\n var targetInfoList = this._targetInfoList = [];\n var info = {};\n var foundCpts = parseFinder(ecModel, option);\n each(targetInfoBuilders, function (builder, type) {\n if (!opt || !opt.include || indexOf(opt.include, type) >= 0) {\n builder(foundCpts, targetInfoList, info);\n }\n });\n}\n\nvar proto = BrushTargetManager.prototype;\n\nproto.setOutputRanges = function (areas, ecModel) {\n this.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) {\n (area.coordRanges || (area.coordRanges = [])).push(coordRange); // area.coordRange is the first of area.coordRanges\n\n if (!area.coordRange) {\n area.coordRange = coordRange; // In 'category' axis, coord to pixel is not reversible, so we can not\n // rebuild range by coordRange accrately, which may bring trouble when\n // brushing only one item. So we use __rangeOffset to rebuilding range\n // by coordRange. And this it only used in brush component so it is no\n // need to be adapted to coordRanges.\n\n var result = coordConvert[area.brushType](0, coordSys, coordRange);\n area.__rangeOffset = {\n offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]),\n xyMinMax: result.xyMinMax\n };\n }\n });\n};\n\nproto.matchOutputRanges = function (areas, ecModel, cb) {\n each(areas, function (area) {\n var targetInfo = this.findTargetInfo(area, ecModel);\n\n if (targetInfo && targetInfo !== true) {\n zrUtil.each(targetInfo.coordSyses, function (coordSys) {\n var result = coordConvert[area.brushType](1, coordSys, area.range);\n cb(area, result.values, coordSys, ecModel);\n });\n }\n }, this);\n};\n\nproto.setInputRanges = function (areas, ecModel) {\n each(areas, function (area) {\n var targetInfo = this.findTargetInfo(area, ecModel);\n area.range = area.range || []; // convert coordRange to global range and set panelId.\n\n if (targetInfo && targetInfo !== true) {\n area.panelId = targetInfo.panelId; // (1) area.range shoule always be calculate from coordRange but does\n // not keep its original value, for the sake of the dataZoom scenario,\n // where area.coordRange remains unchanged but area.range may be changed.\n // (2) Only support converting one coordRange to pixel range in brush\n // component. So do not consider `coordRanges`.\n // (3) About __rangeOffset, see comment above.\n\n var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange);\n var rangeOffset = area.__rangeOffset;\n area.range = rangeOffset ? diffProcessor[area.brushType](result.values, rangeOffset.offset, getScales(result.xyMinMax, rangeOffset.xyMinMax)) : result.values;\n }\n }, this);\n};\n\nproto.makePanelOpts = function (api, getDefaultBrushType) {\n return zrUtil.map(this._targetInfoList, function (targetInfo) {\n var rect = targetInfo.getPanelRect();\n return {\n panelId: targetInfo.panelId,\n defaultBrushType: getDefaultBrushType && getDefaultBrushType(targetInfo),\n clipPath: brushHelper.makeRectPanelClipPath(rect),\n isTargetByCursor: brushHelper.makeRectIsTargetByCursor(rect, api, targetInfo.coordSysModel),\n getLinearBrushOtherExtent: brushHelper.makeLinearBrushOtherExtent(rect)\n };\n });\n};\n\nproto.controlSeries = function (area, seriesModel, ecModel) {\n // Check whether area is bound in coord, and series do not belong to that coord.\n // If do not do this check, some brush (like lineX) will controll all axes.\n var targetInfo = this.findTargetInfo(area, ecModel);\n return targetInfo === true || targetInfo && indexOf(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0;\n};\n/**\n * If return Object, a coord found.\n * If reutrn true, global found.\n * Otherwise nothing found.\n *\n * @param {Object} area\n * @param {Array} targetInfoList\n * @return {Object|boolean}\n */\n\n\nproto.findTargetInfo = function (area, ecModel) {\n var targetInfoList = this._targetInfoList;\n var foundCpts = parseFinder(ecModel, area);\n\n for (var i = 0; i < targetInfoList.length; i++) {\n var targetInfo = targetInfoList[i];\n var areaPanelId = area.panelId;\n\n if (areaPanelId) {\n if (targetInfo.panelId === areaPanelId) {\n return targetInfo;\n }\n } else {\n for (var i = 0; i < targetInfoMatchers.length; i++) {\n if (targetInfoMatchers[i](foundCpts, targetInfo)) {\n return targetInfo;\n }\n }\n }\n }\n\n return true;\n};\n\nfunction formatMinMax(minMax) {\n minMax[0] > minMax[1] && minMax.reverse();\n return minMax;\n}\n\nfunction parseFinder(ecModel, option) {\n return modelUtil.parseFinder(ecModel, option, {\n includeMainTypes: INCLUDE_FINDER_MAIN_TYPES\n });\n}\n\nvar targetInfoBuilders = {\n grid: function (foundCpts, targetInfoList) {\n var xAxisModels = foundCpts.xAxisModels;\n var yAxisModels = foundCpts.yAxisModels;\n var gridModels = foundCpts.gridModels; // Remove duplicated.\n\n var gridModelMap = zrUtil.createHashMap();\n var xAxesHas = {};\n var yAxesHas = {};\n\n if (!xAxisModels && !yAxisModels && !gridModels) {\n return;\n }\n\n each(xAxisModels, function (axisModel) {\n var gridModel = axisModel.axis.grid.model;\n gridModelMap.set(gridModel.id, gridModel);\n xAxesHas[gridModel.id] = true;\n });\n each(yAxisModels, function (axisModel) {\n var gridModel = axisModel.axis.grid.model;\n gridModelMap.set(gridModel.id, gridModel);\n yAxesHas[gridModel.id] = true;\n });\n each(gridModels, function (gridModel) {\n gridModelMap.set(gridModel.id, gridModel);\n xAxesHas[gridModel.id] = true;\n yAxesHas[gridModel.id] = true;\n });\n gridModelMap.each(function (gridModel) {\n var grid = gridModel.coordinateSystem;\n var cartesians = [];\n each(grid.getCartesians(), function (cartesian, index) {\n if (indexOf(xAxisModels, cartesian.getAxis('x').model) >= 0 || indexOf(yAxisModels, cartesian.getAxis('y').model) >= 0) {\n cartesians.push(cartesian);\n }\n });\n targetInfoList.push({\n panelId: 'grid--' + gridModel.id,\n gridModel: gridModel,\n coordSysModel: gridModel,\n // Use the first one as the representitive coordSys.\n coordSys: cartesians[0],\n coordSyses: cartesians,\n getPanelRect: panelRectBuilder.grid,\n xAxisDeclared: xAxesHas[gridModel.id],\n yAxisDeclared: yAxesHas[gridModel.id]\n });\n });\n },\n geo: function (foundCpts, targetInfoList) {\n each(foundCpts.geoModels, function (geoModel) {\n var coordSys = geoModel.coordinateSystem;\n targetInfoList.push({\n panelId: 'geo--' + geoModel.id,\n geoModel: geoModel,\n coordSysModel: geoModel,\n coordSys: coordSys,\n coordSyses: [coordSys],\n getPanelRect: panelRectBuilder.geo\n });\n });\n }\n};\nvar targetInfoMatchers = [// grid\nfunction (foundCpts, targetInfo) {\n var xAxisModel = foundCpts.xAxisModel;\n var yAxisModel = foundCpts.yAxisModel;\n var gridModel = foundCpts.gridModel;\n !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model);\n !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model);\n return gridModel && gridModel === targetInfo.gridModel;\n}, // geo\nfunction (foundCpts, targetInfo) {\n var geoModel = foundCpts.geoModel;\n return geoModel && geoModel === targetInfo.geoModel;\n}];\nvar panelRectBuilder = {\n grid: function () {\n // grid is not Transformable.\n return this.coordSys.grid.getRect().clone();\n },\n geo: function () {\n var coordSys = this.coordSys;\n var rect = coordSys.getBoundingRect().clone(); // geo roam and zoom transform\n\n rect.applyTransform(graphic.getTransform(coordSys));\n return rect;\n }\n};\nvar coordConvert = {\n lineX: curry(axisConvert, 0),\n lineY: curry(axisConvert, 1),\n rect: function (to, coordSys, rangeOrCoordRange) {\n var xminymin = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]]);\n var xmaxymax = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]]);\n var values = [formatMinMax([xminymin[0], xmaxymax[0]]), formatMinMax([xminymin[1], xmaxymax[1]])];\n return {\n values: values,\n xyMinMax: values\n };\n },\n polygon: function (to, coordSys, rangeOrCoordRange) {\n var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]];\n var values = zrUtil.map(rangeOrCoordRange, function (item) {\n var p = coordSys[COORD_CONVERTS[to]](item);\n xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]);\n xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]);\n xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]);\n xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]);\n return p;\n });\n return {\n values: values,\n xyMinMax: xyMinMax\n };\n }\n};\n\nfunction axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) {\n var axis = coordSys.getAxis(['x', 'y'][axisNameIndex]);\n var values = formatMinMax(zrUtil.map([0, 1], function (i) {\n return to ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i])) : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i]));\n }));\n var xyMinMax = [];\n xyMinMax[axisNameIndex] = values;\n xyMinMax[1 - axisNameIndex] = [NaN, NaN];\n return {\n values: values,\n xyMinMax: xyMinMax\n };\n}\n\nvar diffProcessor = {\n lineX: curry(axisDiffProcessor, 0),\n lineY: curry(axisDiffProcessor, 1),\n rect: function (values, refer, scales) {\n return [[values[0][0] - scales[0] * refer[0][0], values[0][1] - scales[0] * refer[0][1]], [values[1][0] - scales[1] * refer[1][0], values[1][1] - scales[1] * refer[1][1]]];\n },\n polygon: function (values, refer, scales) {\n return zrUtil.map(values, function (item, idx) {\n return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]];\n });\n }\n};\n\nfunction axisDiffProcessor(axisNameIndex, values, refer, scales) {\n return [values[0] - scales[axisNameIndex] * refer[0], values[1] - scales[axisNameIndex] * refer[1]];\n} // We have to process scale caused by dataZoom manually,\n// although it might be not accurate.\n\n\nfunction getScales(xyMinMaxCurr, xyMinMaxOrigin) {\n var sizeCurr = getSize(xyMinMaxCurr);\n var sizeOrigin = getSize(xyMinMaxOrigin);\n var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]];\n isNaN(scales[0]) && (scales[0] = 1);\n isNaN(scales[1]) && (scales[1] = 1);\n return scales;\n}\n\nfunction getSize(xyMinMax) {\n return xyMinMax ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]] : [NaN, NaN];\n}\n\nvar _default = BrushTargetManager;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/helper/BrushTargetManager.js\n// module id = 205\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar Component = require(\"../../model/Component\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nComponent.registerSubTypeDefaulter('dataZoom', function () {\n // Default 'slider' when no type specified.\n return 'slider';\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/dataZoom/typeDefaulter.js\n// module id = 206\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../../echarts\");\n\nvar _util = require(\"zrender/lib/core/util\");\n\nvar createHashMap = _util.createHashMap;\nvar each = _util.each;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\necharts.registerProcessor({\n // `dataZoomProcessor` will only be performed in needed series. Consider if\n // there is a line series and a pie series, it is better not to update the\n // line series if only pie series is needed to be updated.\n getTargetSeries: function (ecModel) {\n var seriesModelMap = createHashMap();\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\n dataZoomModel.eachTargetAxis(function (dimNames, axisIndex, dataZoomModel) {\n var axisProxy = dataZoomModel.getAxisProxy(dimNames.name, axisIndex);\n each(axisProxy.getTargetSeriesModels(), function (seriesModel) {\n seriesModelMap.set(seriesModel.uid, seriesModel);\n });\n });\n });\n return seriesModelMap;\n },\n modifyOutputEnd: true,\n // Consider appendData, where filter should be performed. Because data process is\n // in block mode currently, it is not need to worry about that the overallProgress\n // execute every frame.\n overallReset: function (ecModel, api) {\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\n // We calculate window and reset axis here but not in model\n // init stage and not after action dispatch handler, because\n // reset should be called after seriesData.restoreData.\n dataZoomModel.eachTargetAxis(function (dimNames, axisIndex, dataZoomModel) {\n dataZoomModel.getAxisProxy(dimNames.name, axisIndex).reset(dataZoomModel, api);\n }); // Caution: data zoom filtering is order sensitive when using\n // percent range and no min/max/scale set on axis.\n // For example, we have dataZoom definition:\n // [\n // {xAxisIndex: 0, start: 30, end: 70},\n // {yAxisIndex: 0, start: 20, end: 80}\n // ]\n // In this case, [20, 80] of y-dataZoom should be based on data\n // that have filtered by x-dataZoom using range of [30, 70],\n // but should not be based on full raw data. Thus sliding\n // x-dataZoom will change both ranges of xAxis and yAxis,\n // while sliding y-dataZoom will only change the range of yAxis.\n // So we should filter x-axis after reset x-axis immediately,\n // and then reset y-axis and filter y-axis.\n\n dataZoomModel.eachTargetAxis(function (dimNames, axisIndex, dataZoomModel) {\n dataZoomModel.getAxisProxy(dimNames.name, axisIndex).filterData(dataZoomModel, api);\n });\n });\n ecModel.eachComponent('dataZoom', function (dataZoomModel) {\n // Fullfill all of the range props so that user\n // is able to get them from chart.getOption().\n var axisProxy = dataZoomModel.findRepresentativeAxisProxy();\n var percentRange = axisProxy.getDataPercentWindow();\n var valueRange = axisProxy.getDataValueWindow();\n dataZoomModel.setRawRange({\n start: percentRange[0],\n end: percentRange[1],\n startValue: valueRange[0],\n endValue: valueRange[1]\n }, true);\n });\n }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/dataZoom/dataZoomProcessor.js\n// module id = 207\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../../echarts\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar helper = require(\"./helper\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\necharts.registerAction('dataZoom', function (payload, ecModel) {\n var linkedNodesFinder = helper.createLinkedNodesFinder(zrUtil.bind(ecModel.eachComponent, ecModel, 'dataZoom'), helper.eachAxisDim, function (model, dimNames) {\n return model.get(dimNames.axisIndex);\n });\n var effectedModels = [];\n ecModel.eachComponent({\n mainType: 'dataZoom',\n query: payload\n }, function (model, index) {\n effectedModels.push.apply(effectedModels, linkedNodesFinder(model).nodes);\n });\n zrUtil.each(effectedModels, function (dataZoomModel, index) {\n dataZoomModel.setRawRange({\n start: payload.start,\n end: payload.end,\n startValue: payload.startValue,\n endValue: payload.endValue\n });\n });\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/dataZoom/dataZoomAction.js\n// module id = 208\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar each = zrUtil.each;\n\nfunction _default(option) {\n var visualMap = option && option.visualMap;\n\n if (!zrUtil.isArray(visualMap)) {\n visualMap = visualMap ? [visualMap] : [];\n }\n\n each(visualMap, function (opt) {\n if (!opt) {\n return;\n } // rename splitList to pieces\n\n\n if (has(opt, 'splitList') && !has(opt, 'pieces')) {\n opt.pieces = opt.splitList;\n delete opt.splitList;\n }\n\n var pieces = opt.pieces;\n\n if (pieces && zrUtil.isArray(pieces)) {\n each(pieces, function (piece) {\n if (zrUtil.isObject(piece)) {\n if (has(piece, 'start') && !has(piece, 'min')) {\n piece.min = piece.start;\n }\n\n if (has(piece, 'end') && !has(piece, 'max')) {\n piece.max = piece.end;\n }\n }\n });\n }\n });\n}\n\nfunction has(obj, name) {\n return obj && obj.hasOwnProperty && obj.hasOwnProperty(name);\n}\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/visualMap/preprocessor.js\n// module id = 209\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar Component = require(\"../../model/Component\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nComponent.registerSubTypeDefaulter('visualMap', function (option) {\n // Compatible with ec2, when splitNumber === 0, continuous visualMap will be used.\n return !option.categories && (!(option.pieces ? option.pieces.length > 0 : option.splitNumber > 0) || option.calculable) ? 'continuous' : 'piecewise';\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/visualMap/typeDefaulter.js\n// module id = 210\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../../echarts\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar visualSolution = require(\"../../visual/visualSolution\");\n\nvar VisualMapping = require(\"../../visual/VisualMapping\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar VISUAL_PRIORITY = echarts.PRIORITY.VISUAL.COMPONENT;\necharts.registerVisual(VISUAL_PRIORITY, {\n createOnAllSeries: true,\n reset: function (seriesModel, ecModel) {\n var resetDefines = [];\n ecModel.eachComponent('visualMap', function (visualMapModel) {\n var pipelineContext = seriesModel.pipelineContext;\n\n if (!visualMapModel.isTargetSeries(seriesModel) || pipelineContext && pipelineContext.large) {\n return;\n }\n\n resetDefines.push(visualSolution.incrementalApplyVisual(visualMapModel.stateList, visualMapModel.targetVisuals, zrUtil.bind(visualMapModel.getValueState, visualMapModel), visualMapModel.getDataDimension(seriesModel.getData())));\n });\n return resetDefines;\n }\n}); // Only support color.\n\necharts.registerVisual(VISUAL_PRIORITY, {\n createOnAllSeries: true,\n reset: function (seriesModel, ecModel) {\n var data = seriesModel.getData();\n var visualMetaList = [];\n ecModel.eachComponent('visualMap', function (visualMapModel) {\n if (visualMapModel.isTargetSeries(seriesModel)) {\n var visualMeta = visualMapModel.getVisualMeta(zrUtil.bind(getColorVisual, null, seriesModel, visualMapModel)) || {\n stops: [],\n outerColors: []\n };\n var concreteDim = visualMapModel.getDataDimension(data);\n var dimInfo = data.getDimensionInfo(concreteDim);\n\n if (dimInfo != null) {\n // visualMeta.dimension should be dimension index, but not concrete dimension.\n visualMeta.dimension = dimInfo.index;\n visualMetaList.push(visualMeta);\n }\n }\n }); // console.log(JSON.stringify(visualMetaList.map(a => a.stops)));\n\n seriesModel.getData().setVisual('visualMeta', visualMetaList);\n }\n}); // FIXME\n// performance and export for heatmap?\n// value can be Infinity or -Infinity\n\nfunction getColorVisual(seriesModel, visualMapModel, value, valueState) {\n var mappings = visualMapModel.targetVisuals[valueState];\n var visualTypes = VisualMapping.prepareVisualTypes(mappings);\n var resultVisual = {\n color: seriesModel.getData().getVisual('color') // default color.\n\n };\n\n for (var i = 0, len = visualTypes.length; i < len; i++) {\n var type = visualTypes[i];\n var mapping = mappings[type === 'opacity' ? '__alphaForOpacity' : type];\n mapping && mapping.applyVisual(value, getVisual, setVisual);\n }\n\n return resultVisual.color;\n\n function getVisual(key) {\n return resultVisual[key];\n }\n\n function setVisual(key, value) {\n resultVisual[key] = value;\n }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/visualMap/visualEncoding.js\n// module id = 211\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../../echarts\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar env = require(\"zrender/lib/core/env\");\n\nvar visualDefault = require(\"../../visual/visualDefault\");\n\nvar VisualMapping = require(\"../../visual/VisualMapping\");\n\nvar visualSolution = require(\"../../visual/visualSolution\");\n\nvar modelUtil = require(\"../../util/model\");\n\nvar numberUtil = require(\"../../util/number\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar mapVisual = VisualMapping.mapVisual;\nvar eachVisual = VisualMapping.eachVisual;\nvar isArray = zrUtil.isArray;\nvar each = zrUtil.each;\nvar asc = numberUtil.asc;\nvar linearMap = numberUtil.linearMap;\nvar noop = zrUtil.noop;\nvar VisualMapModel = echarts.extendComponentModel({\n type: 'visualMap',\n dependencies: ['series'],\n\n /**\n * @readOnly\n * @type {Array.}\n */\n stateList: ['inRange', 'outOfRange'],\n\n /**\n * @readOnly\n * @type {Array.}\n */\n replacableOptionKeys: ['inRange', 'outOfRange', 'target', 'controller', 'color'],\n\n /**\n * [lowerBound, upperBound]\n *\n * @readOnly\n * @type {Array.}\n */\n dataBound: [-Infinity, Infinity],\n\n /**\n * @readOnly\n * @type {string|Object}\n */\n layoutMode: {\n type: 'box',\n ignoreSize: true\n },\n\n /**\n * @protected\n */\n defaultOption: {\n show: true,\n zlevel: 0,\n z: 4,\n seriesIndex: 'all',\n // 'all' or null/undefined: all series.\n // A number or an array of number: the specified series.\n // set min: 0, max: 200, only for campatible with ec2.\n // In fact min max should not have default value.\n min: 0,\n // min value, must specified if pieces is not specified.\n max: 200,\n // max value, must specified if pieces is not specified.\n dimension: null,\n inRange: null,\n // 'color', 'colorHue', 'colorSaturation', 'colorLightness', 'colorAlpha',\n // 'symbol', 'symbolSize'\n outOfRange: null,\n // 'color', 'colorHue', 'colorSaturation',\n // 'colorLightness', 'colorAlpha',\n // 'symbol', 'symbolSize'\n left: 0,\n // 'center' ¦ 'left' ¦ 'right' ¦ {number} (px)\n right: null,\n // The same as left.\n top: null,\n // 'top' ¦ 'bottom' ¦ 'center' ¦ {number} (px)\n bottom: 0,\n // The same as top.\n itemWidth: null,\n itemHeight: null,\n inverse: false,\n orient: 'vertical',\n // 'horizontal' ¦ 'vertical'\n backgroundColor: 'rgba(0,0,0,0)',\n borderColor: '#ccc',\n // 值域边框颜色\n contentColor: '#5793f3',\n inactiveColor: '#aaa',\n borderWidth: 0,\n // 值域边框线宽,单位px,默认为0(无边框)\n padding: 5,\n // 值域内边距,单位px,默认各方向内边距为5,\n // 接受数组分别设定上右下左边距,同css\n textGap: 10,\n //\n precision: 0,\n // 小数精度,默认为0,无小数点\n color: null,\n //颜色(deprecated,兼容ec2,顺序同pieces,不同于inRange/outOfRange)\n formatter: null,\n text: null,\n // 文本,如['高', '低'],兼容ec2,text[0]对应高值,text[1]对应低值\n textStyle: {\n color: '#333' // 值域文字颜色\n\n }\n },\n\n /**\n * @protected\n */\n init: function (option, parentModel, ecModel) {\n /**\n * @private\n * @type {Array.}\n */\n this._dataExtent;\n /**\n * @readOnly\n */\n\n this.targetVisuals = {};\n /**\n * @readOnly\n */\n\n this.controllerVisuals = {};\n /**\n * @readOnly\n */\n\n this.textStyleModel;\n /**\n * [width, height]\n * @readOnly\n * @type {Array.}\n */\n\n this.itemSize;\n this.mergeDefaultAndTheme(option, ecModel);\n },\n\n /**\n * @protected\n */\n optionUpdated: function (newOption, isInit) {\n var thisOption = this.option; // FIXME\n // necessary?\n // Disable realtime view update if canvas is not supported.\n\n if (!env.canvasSupported) {\n thisOption.realtime = false;\n }\n\n !isInit && visualSolution.replaceVisualOption(thisOption, newOption, this.replacableOptionKeys);\n this.textStyleModel = this.getModel('textStyle');\n this.resetItemSize();\n this.completeVisualOption();\n },\n\n /**\n * @protected\n */\n resetVisual: function (supplementVisualOption) {\n var stateList = this.stateList;\n supplementVisualOption = zrUtil.bind(supplementVisualOption, this);\n this.controllerVisuals = visualSolution.createVisualMappings(this.option.controller, stateList, supplementVisualOption);\n this.targetVisuals = visualSolution.createVisualMappings(this.option.target, stateList, supplementVisualOption);\n },\n\n /**\n * @protected\n * @return {Array.} An array of series indices.\n */\n getTargetSeriesIndices: function () {\n var optionSeriesIndex = this.option.seriesIndex;\n var seriesIndices = [];\n\n if (optionSeriesIndex == null || optionSeriesIndex === 'all') {\n this.ecModel.eachSeries(function (seriesModel, index) {\n seriesIndices.push(index);\n });\n } else {\n seriesIndices = modelUtil.normalizeToArray(optionSeriesIndex);\n }\n\n return seriesIndices;\n },\n\n /**\n * @public\n */\n eachTargetSeries: function (callback, context) {\n zrUtil.each(this.getTargetSeriesIndices(), function (seriesIndex) {\n callback.call(context, this.ecModel.getSeriesByIndex(seriesIndex));\n }, this);\n },\n\n /**\n * @pubilc\n */\n isTargetSeries: function (seriesModel) {\n var is = false;\n this.eachTargetSeries(function (model) {\n model === seriesModel && (is = true);\n });\n return is;\n },\n\n /**\n * @example\n * this.formatValueText(someVal); // format single numeric value to text.\n * this.formatValueText(someVal, true); // format single category value to text.\n * this.formatValueText([min, max]); // format numeric min-max to text.\n * this.formatValueText([this.dataBound[0], max]); // using data lower bound.\n * this.formatValueText([min, this.dataBound[1]]); // using data upper bound.\n *\n * @param {number|Array.} value Real value, or this.dataBound[0 or 1].\n * @param {boolean} [isCategory=false] Only available when value is number.\n * @param {Array.} edgeSymbols Open-close symbol when value is interval.\n * @return {string}\n * @protected\n */\n formatValueText: function (value, isCategory, edgeSymbols) {\n var option = this.option;\n var precision = option.precision;\n var dataBound = this.dataBound;\n var formatter = option.formatter;\n var isMinMax;\n var textValue;\n edgeSymbols = edgeSymbols || ['<', '>'];\n\n if (zrUtil.isArray(value)) {\n value = value.slice();\n isMinMax = true;\n }\n\n textValue = isCategory ? value : isMinMax ? [toFixed(value[0]), toFixed(value[1])] : toFixed(value);\n\n if (zrUtil.isString(formatter)) {\n return formatter.replace('{value}', isMinMax ? textValue[0] : textValue).replace('{value2}', isMinMax ? textValue[1] : textValue);\n } else if (zrUtil.isFunction(formatter)) {\n return isMinMax ? formatter(value[0], value[1]) : formatter(value);\n }\n\n if (isMinMax) {\n if (value[0] === dataBound[0]) {\n return edgeSymbols[0] + ' ' + textValue[1];\n } else if (value[1] === dataBound[1]) {\n return edgeSymbols[1] + ' ' + textValue[0];\n } else {\n return textValue[0] + ' - ' + textValue[1];\n }\n } else {\n // Format single value (includes category case).\n return textValue;\n }\n\n function toFixed(val) {\n return val === dataBound[0] ? 'min' : val === dataBound[1] ? 'max' : (+val).toFixed(Math.min(precision, 20));\n }\n },\n\n /**\n * @protected\n */\n resetExtent: function () {\n var thisOption = this.option; // Can not calculate data extent by data here.\n // Because series and data may be modified in processing stage.\n // So we do not support the feature \"auto min/max\".\n\n var extent = asc([thisOption.min, thisOption.max]);\n this._dataExtent = extent;\n },\n\n /**\n * @public\n * @param {module:echarts/data/List} list\n * @return {string} Concrete dimention. If return null/undefined,\n * no dimension used.\n */\n getDataDimension: function (list) {\n var optDim = this.option.dimension;\n var listDimensions = list.dimensions;\n\n if (optDim == null && !listDimensions.length) {\n return;\n }\n\n if (optDim != null) {\n return list.getDimension(optDim);\n }\n\n var dimNames = list.dimensions;\n\n for (var i = dimNames.length - 1; i >= 0; i--) {\n var dimName = dimNames[i];\n var dimInfo = list.getDimensionInfo(dimName);\n\n if (!dimInfo.isCalculationCoord) {\n return dimName;\n }\n }\n },\n\n /**\n * @public\n * @override\n */\n getExtent: function () {\n return this._dataExtent.slice();\n },\n\n /**\n * @protected\n */\n completeVisualOption: function () {\n var ecModel = this.ecModel;\n var thisOption = this.option;\n var base = {\n inRange: thisOption.inRange,\n outOfRange: thisOption.outOfRange\n };\n var target = thisOption.target || (thisOption.target = {});\n var controller = thisOption.controller || (thisOption.controller = {});\n zrUtil.merge(target, base); // Do not override\n\n zrUtil.merge(controller, base); // Do not override\n\n var isCategory = this.isCategory();\n completeSingle.call(this, target);\n completeSingle.call(this, controller);\n completeInactive.call(this, target, 'inRange', 'outOfRange'); // completeInactive.call(this, target, 'outOfRange', 'inRange');\n\n completeController.call(this, controller);\n\n function completeSingle(base) {\n // Compatible with ec2 dataRange.color.\n // The mapping order of dataRange.color is: [high value, ..., low value]\n // whereas inRange.color and outOfRange.color is [low value, ..., high value]\n // Notice: ec2 has no inverse.\n if (isArray(thisOption.color) // If there has been inRange: {symbol: ...}, adding color is a mistake.\n // So adding color only when no inRange defined.\n && !base.inRange) {\n base.inRange = {\n color: thisOption.color.slice().reverse()\n };\n } // Compatible with previous logic, always give a defautl color, otherwise\n // simple config with no inRange and outOfRange will not work.\n // Originally we use visualMap.color as the default color, but setOption at\n // the second time the default color will be erased. So we change to use\n // constant DEFAULT_COLOR.\n // If user do not want the defualt color, set inRange: {color: null}.\n\n\n base.inRange = base.inRange || {\n color: ecModel.get('gradientColor')\n }; // If using shortcut like: {inRange: 'symbol'}, complete default value.\n\n each(this.stateList, function (state) {\n var visualType = base[state];\n\n if (zrUtil.isString(visualType)) {\n var defa = visualDefault.get(visualType, 'active', isCategory);\n\n if (defa) {\n base[state] = {};\n base[state][visualType] = defa;\n } else {\n // Mark as not specified.\n delete base[state];\n }\n }\n }, this);\n }\n\n function completeInactive(base, stateExist, stateAbsent) {\n var optExist = base[stateExist];\n var optAbsent = base[stateAbsent];\n\n if (optExist && !optAbsent) {\n optAbsent = base[stateAbsent] = {};\n each(optExist, function (visualData, visualType) {\n if (!VisualMapping.isValidType(visualType)) {\n return;\n }\n\n var defa = visualDefault.get(visualType, 'inactive', isCategory);\n\n if (defa != null) {\n optAbsent[visualType] = defa; // Compatibable with ec2:\n // Only inactive color to rgba(0,0,0,0) can not\n // make label transparent, so use opacity also.\n\n if (visualType === 'color' && !optAbsent.hasOwnProperty('opacity') && !optAbsent.hasOwnProperty('colorAlpha')) {\n optAbsent.opacity = [0, 0];\n }\n }\n });\n }\n }\n\n function completeController(controller) {\n var symbolExists = (controller.inRange || {}).symbol || (controller.outOfRange || {}).symbol;\n var symbolSizeExists = (controller.inRange || {}).symbolSize || (controller.outOfRange || {}).symbolSize;\n var inactiveColor = this.get('inactiveColor');\n each(this.stateList, function (state) {\n var itemSize = this.itemSize;\n var visuals = controller[state]; // Set inactive color for controller if no other color\n // attr (like colorAlpha) specified.\n\n if (!visuals) {\n visuals = controller[state] = {\n color: isCategory ? inactiveColor : [inactiveColor]\n };\n } // Consistent symbol and symbolSize if not specified.\n\n\n if (visuals.symbol == null) {\n visuals.symbol = symbolExists && zrUtil.clone(symbolExists) || (isCategory ? 'roundRect' : ['roundRect']);\n }\n\n if (visuals.symbolSize == null) {\n visuals.symbolSize = symbolSizeExists && zrUtil.clone(symbolSizeExists) || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]);\n } // Filter square and none.\n\n\n visuals.symbol = mapVisual(visuals.symbol, function (symbol) {\n return symbol === 'none' || symbol === 'square' ? 'roundRect' : symbol;\n }); // Normalize symbolSize\n\n var symbolSize = visuals.symbolSize;\n\n if (symbolSize != null) {\n var max = -Infinity; // symbolSize can be object when categories defined.\n\n eachVisual(symbolSize, function (value) {\n value > max && (max = value);\n });\n visuals.symbolSize = mapVisual(symbolSize, function (value) {\n return linearMap(value, [0, max], [0, itemSize[0]], true);\n });\n }\n }, this);\n }\n },\n\n /**\n * @protected\n */\n resetItemSize: function () {\n this.itemSize = [parseFloat(this.get('itemWidth')), parseFloat(this.get('itemHeight'))];\n },\n\n /**\n * @public\n */\n isCategory: function () {\n return !!this.option.categories;\n },\n\n /**\n * @public\n * @abstract\n */\n setSelected: noop,\n\n /**\n * @public\n * @abstract\n * @param {*|module:echarts/data/List} valueOrData\n * @param {number} dataIndex\n * @return {string} state See this.stateList\n */\n getValueState: noop,\n\n /**\n * FIXME\n * Do not publish to thirt-part-dev temporarily\n * util the interface is stable. (Should it return\n * a function but not visual meta?)\n *\n * @pubilc\n * @abstract\n * @param {Function} getColorVisual\n * params: value, valueState\n * return: color\n * @return {Object} visualMeta\n * should includes {stops, outerColors}\n * outerColor means [colorBeyondMinValue, colorBeyondMaxValue]\n */\n getVisualMeta: noop\n});\nvar _default = VisualMapModel;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/visualMap/VisualMapModel.js\n// module id = 212\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @file Visual mapping.\n */\nvar visualDefault = {\n /**\n * @public\n */\n get: function (visualType, key, isCategory) {\n var value = zrUtil.clone((defaultOption[visualType] || {})[key]);\n return isCategory ? zrUtil.isArray(value) ? value[value.length - 1] : value : value;\n }\n};\nvar defaultOption = {\n color: {\n active: ['#006edd', '#e0ffff'],\n inactive: ['rgba(0,0,0,0)']\n },\n colorHue: {\n active: [0, 360],\n inactive: [0, 0]\n },\n colorSaturation: {\n active: [0.3, 1],\n inactive: [0, 0]\n },\n colorLightness: {\n active: [0.9, 0.5],\n inactive: [0, 0]\n },\n colorAlpha: {\n active: [0.3, 1],\n inactive: [0, 0]\n },\n opacity: {\n active: [0.3, 1],\n inactive: [0, 0]\n },\n symbol: {\n active: ['circle', 'roundRect', 'diamond'],\n inactive: ['none']\n },\n symbolSize: {\n active: [10, 50],\n inactive: [0, 0]\n }\n};\nvar _default = visualDefault;\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/visual/visualDefault.js\n// module id = 213\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../../echarts\");\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar graphic = require(\"../../util/graphic\");\n\nvar formatUtil = require(\"../../util/format\");\n\nvar layout = require(\"../../util/layout\");\n\nvar VisualMapping = require(\"../../visual/VisualMapping\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar _default = echarts.extendComponentView({\n type: 'visualMap',\n\n /**\n * @readOnly\n * @type {Object}\n */\n autoPositionValues: {\n left: 1,\n right: 1,\n top: 1,\n bottom: 1\n },\n init: function (ecModel, api) {\n /**\n * @readOnly\n * @type {module:echarts/model/Global}\n */\n this.ecModel = ecModel;\n /**\n * @readOnly\n * @type {module:echarts/ExtensionAPI}\n */\n\n this.api = api;\n /**\n * @readOnly\n * @type {module:echarts/component/visualMap/visualMapModel}\n */\n\n this.visualMapModel;\n },\n\n /**\n * @protected\n */\n render: function (visualMapModel, ecModel, api, payload) {\n this.visualMapModel = visualMapModel;\n\n if (visualMapModel.get('show') === false) {\n this.group.removeAll();\n return;\n }\n\n this.doRender.apply(this, arguments);\n },\n\n /**\n * @protected\n */\n renderBackground: function (group) {\n var visualMapModel = this.visualMapModel;\n var padding = formatUtil.normalizeCssArray(visualMapModel.get('padding') || 0);\n var rect = group.getBoundingRect();\n group.add(new graphic.Rect({\n z2: -1,\n // Lay background rect on the lowest layer.\n silent: true,\n shape: {\n x: rect.x - padding[3],\n y: rect.y - padding[0],\n width: rect.width + padding[3] + padding[1],\n height: rect.height + padding[0] + padding[2]\n },\n style: {\n fill: visualMapModel.get('backgroundColor'),\n stroke: visualMapModel.get('borderColor'),\n lineWidth: visualMapModel.get('borderWidth')\n }\n }));\n },\n\n /**\n * @protected\n * @param {number} targetValue can be Infinity or -Infinity\n * @param {string=} visualCluster Only can be 'color' 'opacity' 'symbol' 'symbolSize'\n * @param {Object} [opts]\n * @param {string=} [opts.forceState] Specify state, instead of using getValueState method.\n * @param {string=} [opts.convertOpacityToAlpha=false] For color gradient in controller widget.\n * @return {*} Visual value.\n */\n getControllerVisual: function (targetValue, visualCluster, opts) {\n opts = opts || {};\n var forceState = opts.forceState;\n var visualMapModel = this.visualMapModel;\n var visualObj = {}; // Default values.\n\n if (visualCluster === 'symbol') {\n visualObj.symbol = visualMapModel.get('itemSymbol');\n }\n\n if (visualCluster === 'color') {\n var defaultColor = visualMapModel.get('contentColor');\n visualObj.color = defaultColor;\n }\n\n function getter(key) {\n return visualObj[key];\n }\n\n function setter(key, value) {\n visualObj[key] = value;\n }\n\n var mappings = visualMapModel.controllerVisuals[forceState || visualMapModel.getValueState(targetValue)];\n var visualTypes = VisualMapping.prepareVisualTypes(mappings);\n zrUtil.each(visualTypes, function (type) {\n var visualMapping = mappings[type];\n\n if (opts.convertOpacityToAlpha && type === 'opacity') {\n type = 'colorAlpha';\n visualMapping = mappings.__alphaForOpacity;\n }\n\n if (VisualMapping.dependsOn(type, visualCluster)) {\n visualMapping && visualMapping.applyVisual(targetValue, getter, setter);\n }\n });\n return visualObj[visualCluster];\n },\n\n /**\n * @protected\n */\n positionGroup: function (group) {\n var model = this.visualMapModel;\n var api = this.api;\n layout.positionElement(group, model.getBoxLayoutParams(), {\n width: api.getWidth(),\n height: api.getHeight()\n });\n },\n\n /**\n * @protected\n * @abstract\n */\n doRender: zrUtil.noop\n});\n\nmodule.exports = _default;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/visualMap/VisualMapView.js\n// module id = 214\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\nvar _layout = require(\"../../util/layout\");\n\nvar getLayoutRect = _layout.getLayoutRect;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @param {module:echarts/component/visualMap/VisualMapModel} visualMapModel\\\n * @param {module:echarts/ExtensionAPI} api\n * @param {Array.} itemSize always [short, long]\n * @return {string} 'left' or 'right' or 'top' or 'bottom'\n */\nfunction getItemAlign(visualMapModel, api, itemSize) {\n var modelOption = visualMapModel.option;\n var itemAlign = modelOption.align;\n\n if (itemAlign != null && itemAlign !== 'auto') {\n return itemAlign;\n } // Auto decision align.\n\n\n var ecSize = {\n width: api.getWidth(),\n height: api.getHeight()\n };\n var realIndex = modelOption.orient === 'horizontal' ? 1 : 0;\n var paramsSet = [['left', 'right', 'width'], ['top', 'bottom', 'height']];\n var reals = paramsSet[realIndex];\n var fakeValue = [0, null, 10];\n var layoutInput = {};\n\n for (var i = 0; i < 3; i++) {\n layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i];\n layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]];\n }\n\n var rParam = [['x', 'width', 3], ['y', 'height', 0]][realIndex];\n var rect = getLayoutRect(layoutInput, ecSize, modelOption.padding);\n return reals[(rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5 < ecSize[rParam[1]] * 0.5 ? 0 : 1];\n}\n/**\n * Prepare dataIndex for outside usage, where dataIndex means rawIndex, and\n * dataIndexInside means filtered index.\n */\n\n\nfunction convertDataIndex(batch) {\n zrUtil.each(batch || [], function (batchItem) {\n if (batch.dataIndex != null) {\n batch.dataIndexInside = batch.dataIndex;\n batch.dataIndex = null;\n }\n });\n return batch;\n}\n\nexports.getItemAlign = getItemAlign;\nexports.convertDataIndex = convertDataIndex;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/visualMap/helper.js\n// module id = 215\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar echarts = require(\"../../echarts\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar actionInfo = {\n type: 'selectDataRange',\n event: 'dataRangeSelected',\n // FIXME use updateView appears wrong\n update: 'update'\n};\necharts.registerAction(actionInfo, function (payload, ecModel) {\n ecModel.eachComponent({\n mainType: 'visualMap',\n query: payload\n }, function (model) {\n model.setSelected(payload.selected);\n });\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/visualMap/visualMapAction.js\n// module id = 216\n// module chunks = 39","\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = require(\"zrender/lib/core/util\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar each = zrUtil.each;\nvar ATTR = '\\0_ec_hist_store';\n/**\n * @param {module:echarts/model/Global} ecModel\n * @param {Object} newSnapshot {dataZoomId, batch: [payloadInfo, ...]}\n */\n\nfunction push(ecModel, newSnapshot) {\n var store = giveStore(ecModel); // If previous dataZoom can not be found,\n // complete an range with current range.\n\n each(newSnapshot, function (batchItem, dataZoomId) {\n var i = store.length - 1;\n\n for (; i >= 0; i--) {\n var snapshot = store[i];\n\n if (snapshot[dataZoomId]) {\n break;\n }\n }\n\n if (i < 0) {\n // No origin range set, create one by current range.\n var dataZoomModel = ecModel.queryComponents({\n mainType: 'dataZoom',\n subType: 'select',\n id: dataZoomId\n })[0];\n\n if (dataZoomModel) {\n var percentRange = dataZoomModel.getPercentRange();\n store[0][dataZoomId] = {\n dataZoomId: dataZoomId,\n start: percentRange[0],\n end: percentRange[1]\n };\n }\n }\n });\n store.push(newSnapshot);\n}\n/**\n * @param {module:echarts/model/Global} ecModel\n * @return {Object} snapshot\n */\n\n\nfunction pop(ecModel) {\n var store = giveStore(ecModel);\n var head = store[store.length - 1];\n store.length > 1 && store.pop(); // Find top for all dataZoom.\n\n var snapshot = {};\n each(head, function (batchItem, dataZoomId) {\n for (var i = store.length - 1; i >= 0; i--) {\n var batchItem = store[i][dataZoomId];\n\n if (batchItem) {\n snapshot[dataZoomId] = batchItem;\n break;\n }\n }\n });\n return snapshot;\n}\n/**\n * @param {module:echarts/model/Global} ecModel\n */\n\n\nfunction clear(ecModel) {\n ecModel[ATTR] = null;\n}\n/**\n * @param {module:echarts/model/Global} ecModel\n * @return {number} records. always >= 1.\n */\n\n\nfunction count(ecModel) {\n return giveStore(ecModel).length;\n}\n/**\n * [{key: dataZoomId, value: {dataZoomId, range}}, ...]\n * History length of each dataZoom may be different.\n * this._history[0] is used to store origin range.\n * @type {Array.}\n */\n\n\nfunction giveStore(ecModel) {\n var store = ecModel[ATTR];\n\n if (!store) {\n store = ecModel[ATTR] = [{}];\n }\n\n return store;\n}\n\nexports.push = push;\nexports.pop = pop;\nexports.clear = clear;\nexports.count = count;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/echarts/lib/component/dataZoom/history.js\n// module id = 217\n// module chunks = 39","var env = require(\"../core/env\");\n\nvar urn = 'urn:schemas-microsoft-com:vml';\nvar win = typeof window === 'undefined' ? null : window;\nvar vmlInited = false;\nvar doc = win && win.document;\n\nfunction createNode(tagName) {\n return doCreateNode(tagName);\n} // Avoid assign to an exported variable, for transforming to cjs.\n\n\nvar doCreateNode;\n\nif (doc && !env.canvasSupported) {\n try {\n !doc.namespaces.zrvml && doc.namespaces.add('zrvml', urn);\n\n doCreateNode = function (tagName) {\n return doc.createElement('');\n };\n } catch (e) {\n doCreateNode = function (tagName) {\n return doc.createElement('<' + tagName + ' xmlns=\"' + urn + '\" class=\"zrvml\">');\n };\n }\n} // From raphael\n\n\nfunction initVML() {\n if (vmlInited || !doc) {\n return;\n }\n\n vmlInited = true;\n var styleSheets = doc.styleSheets;\n\n if (styleSheets.length < 31) {\n doc.createStyleSheet().addRule('.zrvml', 'behavior:url(#default#VML)');\n } else {\n // http://msdn.microsoft.com/en-us/library/ms531194%28VS.85%29.aspx\n styleSheets[0].addRule('.zrvml', 'behavior:url(#default#VML)');\n }\n}\n\nexports.doc = doc;\nexports.createNode = createNode;\nexports.initVML = initVML;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/zrender/lib/vml/core.js\n// module id = 218\n// module chunks = 39","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Vue from 'vue'\nimport i18n from '@/module/i18n/index.js'\nimport Router from 'vue-router'\n\nVue.use(Router)\n\nconst router = new Router({\n routes: [\n {\n path: '/',\n name: 'index',\n redirect: {\n name: 'home'\n }\n },\n {\n path: '/home',\n name: 'home',\n component: resolve => require(['../pages/home/index'], resolve),\n meta: {\n title: `${i18n.$t('首页')} - EasyScheduler`\n }\n },\n {\n path: '/projects',\n name: 'projects',\n component: resolve => require(['../pages/projects/index'], resolve),\n meta: {\n title: `${i18n.$t('项目管理')}`\n },\n redirect: {\n name: 'projects-list'\n },\n children: [\n {\n path: '/projects/index',\n name: 'projects-index',\n component: resolve => require(['../pages/projects/pages/index/index'], resolve),\n meta: {\n title: `${i18n.$t('项目首页')}`\n }\n },\n {\n path: '/projects/list',\n name: 'projects-list',\n component: resolve => require(['../pages/projects/pages/list/index'], resolve),\n meta: {\n title: `${i18n.$t('项目')}`\n }\n },\n {\n path: '/projects/definition',\n name: 'definition',\n component: resolve => require(['../pages/projects/pages/definition/index'], resolve),\n meta: {\n title: `${i18n.$t('工作流定义')}`\n },\n redirect: {\n name: 'projects-definition-list'\n },\n children: [\n {\n path: '/projects/definition/list',\n name: 'projects-definition-list',\n component: resolve => require(['../pages/projects/pages/definition/pages/list/index'], resolve),\n meta: {\n title: `${i18n.$t('工作流定义')}`\n }\n },\n {\n path: '/projects/definition/list/:id',\n name: 'projects-definition-details',\n component: resolve => require(['../pages/projects/pages/definition/pages/details/index'], resolve),\n meta: {\n title: `${i18n.$t('流程定义详情')}`\n }\n },\n {\n path: '/projects/definition/create',\n name: 'definition-create',\n component: resolve => require(['../pages/projects/pages/definition/pages/create/index'], resolve),\n meta: {\n title: `${i18n.$t('创建流程定义')}`\n }\n },\n {\n path: '/projects/definition/tree/:id',\n name: 'definition-tree-view-index',\n component: resolve => require(['../pages/projects/pages/definition/pages/tree/index'], resolve),\n meta: {\n title: `${i18n.$t('树形图')}`\n }\n },\n {\n path: '/projects/definition/list/timing/:id',\n name: 'definition-timing-details',\n component: resolve => require(['../pages/projects/pages/definition/timing/index'], resolve),\n meta: {\n title: `${i18n.$t('定时任务列表')}`\n }\n }\n ]\n },\n {\n path: '/projects/instance',\n name: 'instance',\n component: resolve => require(['../pages/projects/pages/instance/index'], resolve),\n meta: {\n title: `${i18n.$t('工作流实例')}`\n },\n redirect: {\n name: 'projects-instance-list'\n },\n children: [\n {\n path: '/projects/instance/list',\n name: 'projects-instance-list',\n component: resolve => require(['../pages/projects/pages/instance/pages/list/index'], resolve),\n meta: {\n title: `${i18n.$t('工作流实例')}`\n }\n },\n {\n path: '/projects/instance/list/:id',\n name: 'projects-instance-details',\n component: resolve => require(['../pages/projects/pages/instance/pages/details/index'], resolve),\n meta: {\n title: `${i18n.$t('流程实例详情')}`\n }\n },\n {\n path: '/projects/instance/gantt/:id',\n name: 'instance-gantt-index',\n component: resolve => require(['../pages/projects/pages/instance/pages/gantt/index'], resolve),\n meta: {\n title: `${i18n.$t('甘特图')}`\n }\n }\n ]\n },\n {\n path: '/projects/task-instance',\n name: 'task-instance-index',\n component: resolve => require(['../pages/projects/pages/taskInstance'], resolve),\n meta: {\n title: `${i18n.$t('任务实例')}`\n },\n redirect: {\n name: 'task-instance-list'\n },\n children: [\n {\n path: '/projects/task-instance/list',\n name: 'task-instance-list',\n component: resolve => require(['../pages/projects/pages/taskInstance/pages/list/index'], resolve),\n meta: {\n title: `${i18n.$t('任务实例')}`\n }\n }\n ]\n },\n {\n path: '/projects/task-record',\n name: 'task-record-index',\n component: resolve => require(['../pages/projects/pages/taskRecord'], resolve),\n meta: {\n title: `${i18n.$t('任务记录')}`\n },\n redirect: {\n name: 'task-record-list'\n },\n children: [\n {\n path: '/projects/task-record/list',\n name: 'task-record-list',\n component: resolve => require(['../pages/projects/pages/taskRecord/pages/list/index'], resolve),\n meta: {\n title: `${i18n.$t('任务记录')}`\n }\n }\n ]\n }\n ]\n },\n {\n path: '/resource',\n name: 'resource',\n component: resolve => require(['../pages/resource/index'], resolve),\n redirect: {\n name: 'file'\n },\n meta: {\n title: `${i18n.$t('资源中心')}`\n },\n children: [\n {\n path: '/resource/file',\n name: 'file',\n component: resolve => require(['../pages/resource/pages/file/pages/list/index'], resolve),\n meta: {\n title: `${i18n.$t('文件管理')}`\n }\n },\n {\n path: '/resource/file/create',\n name: 'resource-file-create',\n component: resolve => require(['../pages/resource/pages/file/pages/create/index'], resolve),\n meta: {\n title: `${i18n.$t('创建资源')}`\n }\n },\n {\n path: '/resource/file/list/:id',\n name: 'resource-file-details',\n component: resolve => require(['../pages/resource/pages/file/pages/details/index'], resolve),\n meta: {\n title: `${i18n.$t('文件详情')}`\n }\n },\n {\n path: '/resource/file/edit/:id',\n name: 'resource-file-edit',\n component: resolve => require(['../pages/resource/pages/file/pages/edit/index'], resolve),\n meta: {\n title: `${i18n.$t('文件详情')}`\n }\n },\n {\n path: '/resource/udf',\n name: 'udf',\n component: resolve => require(['../pages/resource/pages/udf/index'], resolve),\n meta: {\n title: `${i18n.$t('UDF管理')}`\n },\n children: [\n {\n path: '/resource/udf/resource',\n name: 'resource-udf-resource',\n component: resolve => require(['../pages/resource/pages/udf/pages/resource/index'], resolve),\n meta: {\n title: `${i18n.$t('UDF资源管理')}`\n }\n },\n {\n path: '/resource/udf/function',\n name: 'resource-udf-function',\n component: resolve => require(['../pages/resource/pages/udf/pages/function/index'], resolve),\n meta: {\n title: `${i18n.$t('UDF函数管理')}`\n }\n }\n ]\n }\n ]\n },\n {\n path: '/datasource',\n name: 'datasource',\n component: resolve => require(['../pages/datasource/index'], resolve),\n meta: {\n title: `${i18n.$t('数据源中心')}`\n },\n redirect: {\n name: 'datasource-list'\n },\n children: [\n {\n path: '/datasource/list',\n name: 'datasource-list',\n component: resolve => require(['../pages/datasource/pages/list/index'], resolve),\n meta: {\n title: `${i18n.$t('数据源中心')}`\n }\n }\n ]\n },\n {\n path: '/security',\n name: 'security',\n component: resolve => require(['../pages/security/index'], resolve),\n meta: {\n title: `${i18n.$t('安全中心')}`\n },\n redirect: {\n name: 'tenement-manage'\n },\n children: [\n {\n path: '/security/tenant',\n name: 'tenement-manage',\n component: resolve => require(['../pages/security/pages/tenement/index'], resolve),\n meta: {\n title: `${i18n.$t('租户管理')}`\n }\n },\n {\n path: '/security/users',\n name: 'users-manage',\n component: resolve => require(['../pages/security/pages/users/index'], resolve),\n meta: {\n title: `${i18n.$t('用户管理')}`\n }\n },\n {\n path: '/security/warning-groups',\n name: 'warning-groups-manage',\n component: resolve => require(['../pages/security/pages/warningGroups/index'], resolve),\n meta: {\n title: `${i18n.$t('告警组管理')}`\n }\n },\n {\n path: '/security/queue',\n name: 'queue-manage',\n component: resolve => require(['../pages/security/pages/queue/index'], resolve),\n meta: {\n title: `${i18n.$t('队列管理')}`\n }\n },\n {\n path: '/security/servers',\n name: 'servers-manage',\n component: resolve => require(['../pages/security/pages/servers/index'], resolve),\n meta: {\n title: `${i18n.$t('服务管理')}`\n },\n redirect: {\n name: 'servers-master'\n },\n children: [\n {\n path: '/security/servers/master',\n name: 'servers-master',\n component: resolve => require(['../pages/security/pages/servers/pages/master/index'], resolve),\n meta: {\n title: `${i18n.$t('服务管理-Master')}`\n }\n },\n {\n path: '/security/servers/worker',\n name: 'servers-worker',\n component: resolve => require(['../pages/security/pages/servers/pages/worker/index'], resolve),\n meta: {\n title: `${i18n.$t('服务管理-Worker')}`\n }\n }\n ]\n }\n ]\n },\n {\n path: '/user',\n name: 'user',\n component: resolve => require(['../pages/user/index'], resolve),\n meta: {\n title: `${i18n.$t('用户中心')}`\n },\n redirect: {\n name: 'account'\n },\n children: [\n {\n path: '/user/account',\n name: 'account',\n component: resolve => require(['../pages/user/pages/account/index'], resolve),\n meta: {\n title: `${i18n.$t('用户信息')}`\n }\n },\n {\n path: '/user/password',\n name: 'password',\n component: resolve => require(['../pages/user/pages/password/index'], resolve),\n meta: {\n title: `${i18n.$t('修改密码')}`\n }\n }\n ]\n }\n ]\n})\n\nrouter.beforeEach((to, from, next) => {\n let $body = $('body')\n $body.find('.tooltip.fade.top.in').remove()\n if (to.meta.title) {\n document.title = `${to.meta.title} - EasyScheduler`\n }\n next()\n})\n\nexport default router\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/router/index.js","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-6759b734\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./popup.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./popup.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./popup.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-6759b734\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./popup.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/popup/popup.vue\n// module id = 223\n// module chunks = 39","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-8ef2e8b0\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./listBoxF.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listBoxF.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./listBoxF.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-8ef2e8b0\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./listBoxF.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/listBoxF/listBoxF.vue\n// module id = 224\n// module chunks = 39","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport i18n from '@/module/i18n'\nimport Permissions from '@/module/permissions'\n\n/**\n * Operation bar config\n * @code code\n * @icon icon\n * @disable disable\n * @desc tooltip\n */\nconst toolOper = (dagThis) => {\n let disabled = Permissions.getAuth() === false ? false : !dagThis.$store.state.dag.isDetails\n return [\n {\n code: 'pointer',\n icon: '',\n disable: disabled,\n desc: `${i18n.$t('拖动节点和选中项')}`\n },\n {\n code: 'line',\n icon: '',\n disable: disabled,\n desc: `${i18n.$t('选择线条连接')}`\n },\n {\n code: 'remove',\n icon: '',\n disable: disabled,\n desc: `${i18n.$t('删除选中的线或节点')}`\n },\n {\n code: 'download',\n icon: '',\n disable: !!dagThis.type,\n desc: `${i18n.$t('下载')}`\n },\n {\n code: 'screen',\n icon: '',\n disable: disabled,\n desc: `${i18n.$t('全屏')}`\n }\n ]\n}\n\n/**\n * Post status\n * @id Front end definition id\n * @desc tooltip\n * @code Backend definition identifier\n */\nlet publishStatus = [\n {\n id: 0,\n desc: `${i18n.$t('未发布')}`,\n code: 'NOT_RELEASE'\n },\n {\n id: 1,\n desc: `${i18n.$t('上线')}`,\n code: 'ONLINE'\n },\n {\n id: 2,\n desc: `${i18n.$t('下线')}`,\n code: 'OFFLINE'\n }\n]\n\n/**\n * Operation type\n * @desc tooltip\n * @code identifier\n */\nlet runningType = [\n {\n desc: `${i18n.$t('启动工作流')}`,\n code: 'START_PROCESS'\n },\n {\n desc: `${i18n.$t('从当前节点开始执行')}`,\n code: 'START_CURRENT_TASK_PROCESS'\n },\n {\n desc: `${i18n.$t('恢复被容错的工作流')}`,\n code: 'RECOVER_TOLERANCE_FAULT_PROCESS'\n },\n {\n desc: `${i18n.$t('恢复暂停流程')}`,\n code: 'RECOVER_SUSPENDED_PROCESS'\n },\n {\n desc: `${i18n.$t('从失败节点开始执行')}`,\n code: 'START_FAILURE_TASK_PROCESS'\n },\n {\n desc: `${i18n.$t('补数')}`,\n code: 'COMPLEMENT_DATA'\n },\n {\n desc: `${i18n.$t('调度执行')}`,\n code: 'SCHEDULER'\n },\n {\n desc: `${i18n.$t('重跑')}`,\n code: 'REPEAT_RUNNING'\n },\n {\n desc: `${i18n.$t('暂停')}`,\n code: 'PAUSE'\n },\n {\n desc: `${i18n.$t('停止')}`,\n code: 'STOP'\n },\n {\n desc: `${i18n.$t('恢复等待线程')}`,\n code: 'RECOVER_WAITTING_THREAD'\n }\n]\n\n/**\n * Task status\n * @key key\n * @id id\n * @desc tooltip\n * @color color\n * @icoUnicode iconfont\n * @isSpin is loading (Need to execute the code block to write if judgment)\n */\nlet tasksState = {\n 'SUBMITTED_SUCCESS': {\n id: 0,\n desc: `${i18n.$t('提交成功')}`,\n color: '#A9A9A9',\n icoUnicode: '',\n isSpin: false\n },\n 'RUNNING_EXEUTION': {\n id: 1,\n desc: `${i18n.$t('正在执行')}`,\n color: '#0097e0',\n icoUnicode: '',\n isSpin: true\n },\n 'READY_PAUSE': {\n id: 2,\n desc: `${i18n.$t('准备暂停')}`,\n color: '#07b1a3',\n icoUnicode: '',\n isSpin: false\n },\n 'PAUSE': {\n id: 3,\n desc: `${i18n.$t('暂停')}`,\n color: '#057c72',\n icoUnicode: '',\n isSpin: false\n },\n 'READY_STOP': {\n id: 4,\n desc: `${i18n.$t('准备停止')}`,\n color: '#FE0402',\n icoUnicode: '',\n isSpin: false\n },\n 'STOP': {\n id: 5,\n desc: `${i18n.$t('停止')}`,\n color: '#e90101',\n icoUnicode: '',\n isSpin: false\n },\n 'FAILURE': {\n id: 6,\n desc: `${i18n.$t('失败')}`,\n color: '#000000',\n icoUnicode: '',\n isSpin: false\n },\n 'SUCCESS': {\n id: 7,\n desc: `${i18n.$t('成功')}`,\n color: '#33cc00',\n icoUnicode: '',\n isSpin: false\n },\n 'NEED_FAULT_TOLERANCE': {\n id: 8,\n desc: `${i18n.$t('需要容错')}`,\n color: '#FF8C00',\n icoUnicode: '',\n isSpin: false\n },\n 'KILL': {\n id: 9,\n desc: `${i18n.$t('kill')}`,\n color: '#a70202',\n icoUnicode: '',\n isSpin: false\n },\n 'WAITTING_THREAD': {\n id: 10,\n desc: `${i18n.$t('等待线程')}`,\n color: '#912eed',\n icoUnicode: '',\n isSpin: false\n },\n 'WAITTING_DEPEND': {\n id: 11,\n desc: `${i18n.$t('等待依赖')}`,\n color: '#5101be',\n icoUnicode: '',\n isSpin: false\n }\n}\n\n/**\n * Node type\n * @key key\n * @desc tooltip\n * @color color (tree and gantt)\n */\nlet tasksType = {\n 'SHELL': {\n desc: 'SHELL',\n color: '#646464'\n },\n 'SUB_PROCESS': {\n desc: 'SUB_PROCESS',\n color: '#0097e0'\n },\n 'PROCEDURE': {\n desc: 'PROCEDURE',\n color: '#525CCD'\n },\n 'SQL': {\n desc: 'SQL',\n color: '#7A98A1'\n },\n 'SPARK': {\n desc: 'SPARK',\n color: '#E46F13'\n },\n 'MR': {\n desc: 'MapReduce',\n color: '#A0A5CC'\n },\n 'PYTHON': {\n desc: 'PYTHON',\n color: '#FED52D'\n },\n 'DEPENDENT': {\n desc: 'DEPENDENT',\n color: '#2FBFD8'\n }\n}\n\n\nexport {\n toolOper,\n publishStatus,\n runningType,\n tasksState,\n tasksType\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/pages/dag/_source/config.js","/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nif (typeof window === 'undefined') {\n throw new Error('For browser use only.')\n}\n\nconst root = window\nconst storage = root.localStorage\n\nconst localStorage = {\n setItem: function (skey, sval) {\n try {\n return storage.setItem(skey, sval)\n } catch (e) {\n console.info(e)\n }\n },\n getItem: function (skey) {\n try {\n return storage.getItem(skey)\n } catch (e) {\n console.info(e)\n return null\n }\n },\n removeItem: function (skey) {\n try {\n return storage.removeItem(skey)\n } catch (e) {\n console.info(e)\n return null\n }\n },\n getJSON: function (skey, p) {\n try {\n var d = storage.getItem(skey)\n if (d) {\n d = JSON.parse(d)\n return d[p]\n }\n } catch (e) {\n console.info(e)\n }\n },\n setJSON: function (skey, p, val) {\n try {\n var f = storage.getItem(skey)\n f = f ? JSON.parse(f) : {}\n f[p] = val\n storage.setItem(skey, JSON.stringify(f))\n } catch (e) {\n console.info(e)\n }\n },\n removeJSON: function (skey, p) {\n try {\n var d = storage.getItem(skey)\n if (d) {\n d = JSON.parse(d)\n delete d[p]\n storage.setItem(skey, JSON.stringify(d))\n }\n } catch (e) {\n console.info(e)\n }\n }\n}\n\nexport default localStorage\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/module/util/localStorage.js","!function(e,t){if(\"object\"==typeof exports&&\"object\"==typeof module)module.exports=t(require(\"echarts\"));else if(\"function\"==typeof define&&define.amd)define([\"echarts\"],t);else{var n=\"object\"==typeof exports?t(require(\"echarts\")):t(e.echarts);for(var i in n)(\"object\"==typeof exports?exports:e)[i]=n[i]}}(\"undefined\"!=typeof self?self:this,function(e){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=4)}([function(e,t,n){\"use strict\";t.__esModule=!0;t.init=function(e,t,n,i){var r=function(e){if(!e)return;if(\"string\"==typeof e)if(e.startsWith(\"#\"))e=document.getElementById(e.slice(1));else{if(!e.startsWith(\".\"))return;e=document.getElementsByClassName(e.slice(1))}if(!e)throw new Error(\"找不到对应的dom对象!\");var t=void 0;t=HTMLElement.prototype.isPrototypeOf(e)?new Array(e):Array.from(e);if(!t)throw new Error(\"未找到对应的dom对象!\");return t}(t),a=Object.assign({},{data:n},i),o=r.map(function(t){return new e(t,a)});return 1===o.length?o[0]:o};t.checkKeyInModel=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i=r.length)break;s=r[o++]}else{if((o=r.next()).done)break;s=o.value}var l=s;if(!e.hasOwnProperty(l))throw new Error(\"数据格式错误!未找到指定属性:\"+l)}}},function(e,t,n){\"use strict\";t.__esModule=!0;var i=a(n(3)),r=a(n(2));function a(e){return e&&e.__esModule?e:{default:e}}var o=function(){function e(t,n){var a=this;!function(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}(this,e),this.settings=n;var o=this.transform();o&&(this.options=o,n.theme?this.echart=i.default.init(t,n.theme):r.default.settings.defaultTheme?this.echart=i.default.init(t,r.default.settings.defaultTheme):this.echart=i.default.init(t),window.addEventListener(\"resize\",function(){return a.echart.resize()}),this.apply())}return e.prototype.setData=function(e){e&&0!==e.length&&(this.settings.data=e,this.options=this.transform(),this.apply())},e.prototype.injectDataIntoSeries=function(e,t){return e.forEach(function(e){if(\"all\"===e.index)delete e.index,t=t.map(function(t){return Object.assign({},t,e)});else if(\"start\"===e.index)delete e.index,t[0]=Object.assign({},t[0],e);else if(\"end\"===e.index)delete e.index,t[t.length-1]=Object.assign({},t[t.length-1],e);else if(Array.isArray(e.index)){var n=e.index,i=Array.isArray(n),r=0;for(n=i?n:n[Symbol.iterator]();;){var a;if(i){if(r>=n.length)break;a=n[r++]}else{if((r=n.next()).done)break;a=r.value}var o=a;t[o]&&(t[o]=Object.assign({},t[o],e))}}}),t},e}();t.default=o},function(e,t,n){\"use strict\";t.__esModule=!0,t.Scatter=t.Funnel=t.Radar=t.Pie=t.Bar=t.Line=void 0;var i=c(n(3)),r=c(n(5)),a=c(n(6)),o=c(n(7)),s=c(n(8)),l=c(n(9)),u=c(n(10)),f=n(0);function c(e){return e&&e.__esModule?e:{default:e}}var p={Line:r.default,Bar:a.default,Pie:o.default,Radar:s.default,Funnel:l.default,Scatter:u.default},d={settings:{},config:function(e){var t=e.theme;t&&((0,f.checkKeyInModel)(t,\"name\",\"data\"),i.default.registerTheme(t.name,t.data),t.default&&(d.settings.defaultTheme=t.name))}},h=function(e){p.hasOwnProperty(e)&&(d[e.toLowerCase()]=function(t,n,i){return(0,f.init)(p[e],t,n,i)})};for(var y in p)h(y);t.Line=r.default,t.Bar=a.default,t.Pie=o.default,t.Radar=s.default,t.Funnel=l.default,t.Scatter=u.default,t.default=d,\"undefined\"!=typeof window&&(window.Chart=d)},function(t,n){t.exports=e},function(e,t,n){e.exports=n(2)},function(e,t,n){\"use strict\";t.__esModule=!0;var i,r=n(1),a=(i=r)&&i.__esModule?i:{default:i},o=n(0);var s=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,e.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,e),t.init=function(e,n,i){return(0,o.init)(t,e,n,i)},t.prototype.transform=function(){var e=this.settings.data,t=void 0===e?[]:e;if(0===t.length)throw new Error(\"数据源为空!\");return Object.keys(t[0]).length>2?this.setMultipleLines():(this.simple=!0,this.setSingleLine())},t.prototype.setSingleLine=function(){var e=this.settings,t=e.data,n=void 0===t?[]:t,i=e.keyMap,r=void 0===i?{xAxisKey:\"key\",dataKey:\"value\"}:i,a=e.title,s=void 0===a?\"单条折线图\":a,l=r.xAxisKey,u=r.dataKey;(0,o.checkKeyInModel)(n[0],l,u);for(var f=[{type:\"line\",data:[]}],c={type:\"category\",data:[]},p=0;p2?this.setMultipleBars():(this.simple=!0,this.setSingleBar())},t.prototype.setSingleBar=function(){var e=this.settings,t=e.data,n=void 0===t?[]:t,i=e.keyMap,r=void 0===i?{xAxisKey:\"key\",dataKey:\"value\"}:i,a=e.title,s=void 0===a?\"单条柱状图\":a,l=r.xAxisKey,u=r.dataKey;(0,o.checkKeyInModel)(n[0],l,u);for(var f=[{type:\"bar\",data:[]}],c={type:\"category\",data:[]},p=0;p=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}var 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,e.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,e),t.init=function(e,n,i){return(0,o.init)(t,e,n,i)},t.prototype.transform=function(){var e=this.settings,t=e.data,n=void 0===t?[]:t,i=e.title,r=void 0===i?\"饼图\":i,a=e.ring,l=void 0!==a&&a,u=e.keyMap,f=void 0===u?{textKey:\"key\",dataKey:\"value\"}:u;if(0===n.length)throw new Error(\"数据源为空!\");var c=f.textKey,p=f.dataKey;(0,o.checkKeyInModel)(n[0],c,p);for(var d=[{radius:l?[\"50%\",\"70%\"]:\"60%\",center:r?[\"50%\",\"60%\"]:[\"50%\",\"50%\"],type:\"pie\",data:[]}],h=0;h=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}var 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,e.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,e),t.init=function(e,n,i){return(0,o.init)(t,e,n,i)},t.prototype.transform=function(){var e=this.settings,t=e.data,n=void 0===t?[]:t,i=e.title,r=void 0===i?\"漏斗图\":i,a=e.keyMap,l=void 0===a?{textKey:\"key\",dataKey:\"value\"}:a;if(0===n.length)throw new Error(\"数据源为空!\");var u=l.textKey,f=l.dataKey;(0,o.checkKeyInModel)(n[0],u,f);for(var c=[{type:\"funnel\",left:\"10%\",top:60,bottom:60,width:\"80%\",min:0,max:100,minSize:\"0%\",maxSize:\"100%\",sort:\"descending\",gap:2,label:{normal:{show:!0,position:\"inside\"},emphasis:{textStyle:{fontSize:20}}},labelLine:{normal:{length:10,lineStyle:{width:1,type:\"solid\"}}},itemStyle:{normal:{borderColor:\"#fff\",borderWidth:1}},data:[]}],p=0;p{b} : {c}%\"},legend:{data:i},series:a},!0)},t}(a.default);t.default=l},function(e,t,n){\"use strict\";t.__esModule=!0;var i,r=n(1),a=(i=r)&&i.__esModule?i:{default:i},o=n(0);var s=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,e.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,e),t.init=function(e,n,i){return(0,o.init)(t,e,n,i)},t.prototype.transform=function(){var e=this.settings,t=e.data,n=void 0===t?[]:t,i=e.title,r=void 0===i?\"气泡图\":i,a=e.keyMap,s=void 0===a?{xKey:\"x\",yKey:\"y\",sizeKey:\"size\",textKey:\"text\",legendKey:\"typeName\"}:a;if(0===n.length)throw new Error(\"数据源为空!\");var l=[],u=[],f=s.xKey,c=s.yKey,p=s.sizeKey,d=s.textKey,h=s.legendKey;(0,o.checkKeyInModel)(n[0],f,c,p,d,h);for(var y=function(e){var t=n[e],i=t[h],r=t[f],a=t[c],o=t[p],s=t[d],y=function(e,t){var n={};for(var i in e)t.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}(t,[h,f,c,p,d]);l.includes(i)||l.push(i);var v=u.find(function(e){return e.name===i});v||(v={type:\"scatter\",name:i,data:[],symbolSize:function(e){return Math.sqrt(e[2])},label:{emphasis:{show:!0,formatter:function(e){return e.data[3]},position:\"top\"}}},u.push(v)),v.data.push(Object.assign({value:[r,a,o,s]},y,{_raw:n[e]}))},v=0;v {\n // instance\n new Vue({\n el: '#app',\n router,\n store,\n render: h => h(App),\n mounted () {\n document.addEventListener('click', (e) => {\n $('#contextmenu').css('visibility', 'hidden')\n })\n },\n methods: {\n initApp () {\n $('.global-loading').hide()\n let bootstrapTooltip = $.fn.tooltip.noConflict()\n $.fn.tooltip = bootstrapTooltip\n $('body').tooltip({\n selector: '[data-toggle=\"tooltip\"]',\n trigger: 'hover'\n })\n // init\n i18n.init()\n }\n },\n created () {\n this.initApp()\n }\n })\n})\n\n\n\n// WEBPACK FOOTER //\n// ./src/js/conf/home/index.js","var normalizeComponent = require(\"!../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./App.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./App.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-4b1359b5\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./App.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = null\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/conf/home/App.vue\n// module id = 229\n// module chunks = 39","function injectStyle (ssrContext) {\n require(\"!!vue-loader/node_modules/vue-style-loader!css-loader?minimize!../../../../../node_modules/vue-loader/lib/style-compiler/index?{\\\"vue\\\":true,\\\"id\\\":\\\"data-v-50c6fe8a\\\",\\\"scoped\\\":false,\\\"hasInlineConfig\\\":false}!sass-loader!../../../../../node_modules/vue-loader/lib/selector?type=styles&index=0!./layout.vue\")\n}\nvar normalizeComponent = require(\"!../../../../../node_modules/vue-loader/lib/component-normalizer\")\n/* script */\nexport * from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./layout.vue\"\nimport __vue_script__ from \"!!babel-loader!../../../../../node_modules/vue-loader/lib/selector?type=script&index=0!./layout.vue\"\n/* template */\nimport __vue_template__ from \"!!../../../../../node_modules/vue-loader/lib/template-compiler/index?{\\\"id\\\":\\\"data-v-50c6fe8a\\\",\\\"hasScoped\\\":false,\\\"buble\\\":{\\\"transforms\\\":{}}}!../../../../../node_modules/vue-loader/lib/selector?type=template&index=0!./layout.vue\"\n/* template functional */\nvar __vue_template_functional__ = false\n/* styles */\nvar __vue_styles__ = injectStyle\n/* scopeId */\nvar __vue_scopeId__ = null\n/* moduleIdentifier (server only) */\nvar __vue_module_identifier__ = null\nvar Component = normalizeComponent(\n __vue_script__,\n __vue_template__,\n __vue_template_functional__,\n __vue_styles__,\n __vue_scopeId__,\n __vue_module_identifier__\n)\n\nexport default Component.exports\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/js/module/components/layout/layout.vue\n// module id = 230\n// module chunks = 39","// style-loader: Adds some css to the DOM by adding a